Skip to content

Commit 4c4e4ea

Browse files
committed
feat(migrate): replace lodash.without
1 parent 4fe162a commit 4c4e4ea

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

packages/sync-actions/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
"lodash.intersection": "^4.4.0",
2929
"lodash.shuffle": "^4.2.0",
3030
"lodash.sortby": "^4.7.0",
31-
"lodash.uniqwith": "^4.5.0",
32-
"lodash.without": "^4.4.0"
31+
"lodash.uniqwith": "^4.5.0"
3332
},
3433
"files": ["dist", "CHANGELOG.md"],
3534
"author": "Nicola Molinari <nicola.molinari@commercetools.com> (https://github.com/emmenko)",

packages/sync-actions/src/product-actions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { ProductVariant } from '@commercetools/platform-sdk/src'
33
import intersection from 'lodash.intersection'
44
import uniqWith from 'lodash.uniqwith'
5-
import without from 'lodash.without'
65
import actionsMapCustom from './utils/action-map-custom'
76
import {
87
buildBaseAttributesActions,
@@ -425,7 +424,9 @@ function _buildVariantChangeAssetOrderAction(
425424
.map((_) => _.id)
426425
.filter((_) => _ !== undefined)
427426
const assetIdsToKeep = intersection(assetIdsCurrent, assetIdsBefore)
428-
const assetIdsToRemove = without(assetIdsBefore, ...assetIdsToKeep)
427+
const assetIdsToRemove = assetIdsBefore.filter(
428+
(item) => !assetIdsToKeep.includes(item)
429+
)
429430
const changeAssetOrderAction = {
430431
action: 'changeAssetOrder',
431432
assetOrder: assetIdsToKeep.concat(assetIdsToRemove),

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6946,11 +6946,6 @@ lodash.upperfirst@^4.3.1:
69466946
resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce"
69476947
integrity sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==
69486948

6949-
lodash.without@^4.4.0:
6950-
version "4.4.0"
6951-
resolved "https://registry.yarnpkg.com/lodash.without/-/lodash.without-4.4.0.tgz#3cd4574a00b67bae373a94b748772640507b7aac"
6952-
integrity sha512-M3MefBwfDhgKgINVuBJCO1YR3+gf6s9HNJsIiZ/Ru77Ws6uTb9eBuvrkpzO+9iLoAaRodGuq7tyrPCx+74QYGQ==
6953-
69546949
lodash@4.17.21, lodash@^4.17.13, lodash@^4.17.15:
69556950
version "4.17.21"
69566951
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"

0 commit comments

Comments
 (0)