Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Remove lodash without usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Apr 20, 2023
1 parent ee9bb7b commit 56ed6ae
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 18 deletions.
6 changes: 2 additions & 4 deletions assets/js/blocks/product-best-sellers/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import { without } from 'lodash';
import { Icon, trendingUp } from '@wordpress/icons';
import { createBlock, registerBlockType } from '@wordpress/blocks';

Expand Down Expand Up @@ -32,9 +31,8 @@ registerBlockType( metadata, {
from: [
{
type: 'block',
blocks: without(
sharedAttributeBlockTypes,
'woocommerce/product-best-sellers'
blocks: sharedAttributeBlockTypes.filter(
( value ) => value !== 'woocommerce/product-best-sellers'
),
transform: ( attributes ) =>
createBlock(
Expand Down
6 changes: 2 additions & 4 deletions assets/js/blocks/product-category/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* External dependencies
*/
import { createBlock, registerBlockType } from '@wordpress/blocks';
import { without } from 'lodash';
import { Icon, file } from '@wordpress/icons';

/**
Expand Down Expand Up @@ -36,9 +35,8 @@ registerBlockType( metadata, {
from: [
{
type: 'block',
blocks: without(
sharedAttributeBlockTypes,
'woocommerce/product-category'
blocks: sharedAttributeBlockTypes.filter(
( value ) => value !== 'woocommerce/product-category'
),
transform: ( attributes ) =>
createBlock( 'woocommerce/product-category', {
Expand Down
6 changes: 2 additions & 4 deletions assets/js/blocks/product-new/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { __ } from '@wordpress/i18n';
import { createBlock, registerBlockType } from '@wordpress/blocks';
import { without } from 'lodash';
import { Icon, sparkles } from '@wordpress/icons';

/**
Expand Down Expand Up @@ -41,9 +40,8 @@ registerBlockType( 'woocommerce/product-new', {
from: [
{
type: 'block',
blocks: without(
sharedAttributeBlockTypes,
'woocommerce/product-new'
blocks: sharedAttributeBlockTypes.filter(
( value ) => value !== 'woocommerce/product-new'
),
transform: ( attributes ) =>
createBlock( 'woocommerce/product-new', attributes ),
Expand Down
6 changes: 2 additions & 4 deletions assets/js/blocks/product-on-sale/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { __ } from '@wordpress/i18n';
import { createBlock, registerBlockType } from '@wordpress/blocks';
import { without } from 'lodash';
import { Icon, percent } from '@wordpress/icons';
/**
* Internal dependencies
Expand Down Expand Up @@ -49,9 +48,8 @@ registerBlockType( 'woocommerce/product-on-sale', {
from: [
{
type: 'block',
blocks: without(
sharedAttributeBlockTypes,
'woocommerce/product-on-sale'
blocks: sharedAttributeBlockTypes.filter(
( value ) => value !== 'woocommerce/product-on-sale'
),
transform: ( attributes ) =>
createBlock( 'woocommerce/product-on-sale', attributes ),
Expand Down
5 changes: 3 additions & 2 deletions assets/js/blocks/product-top-rated/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { __ } from '@wordpress/i18n';
import { createBlock, registerBlockType } from '@wordpress/blocks';
import { thumbUp } from '@woocommerce/icons';
import { Icon } from '@wordpress/icons';
import { without } from 'lodash';

/**
* Internal dependencies
Expand Down Expand Up @@ -44,7 +43,9 @@ registerBlockType( blockTypeName, {
from: [
{
type: 'block',
blocks: without( sharedAttributeBlockTypes, blockTypeName ),
blocks: sharedAttributeBlockTypes.filter(
( value ) => value !== blockTypeName
),
transform: ( attributes ) =>
createBlock( 'woocommerce/product-top-rated', attributes ),
},
Expand Down

0 comments on commit 56ed6ae

Please sign in to comment.