File tree Expand file tree Collapse file tree 3 files changed +14
-13
lines changed Expand file tree Collapse file tree 3 files changed +14
-13
lines changed Original file line number Diff line number Diff line change 2424 },
2525 "dependencies" : {
2626 "fast-equals" : " ^2.0.0" ,
27- "jsondiffpatch" : " ^0.4.0" ,
28- "lodash.sortby" : " ^4.7.0"
27+ "jsondiffpatch" : " ^0.4.0"
2928 },
3029 "files" : [" dist" , " CHANGELOG.md" ],
3130 "author" : " Nicola Molinari <nicola.molinari@commercetools.com> (https://github.com/emmenko)" ,
Original file line number Diff line number Diff line change 11import { deepEqual } from 'fast-equals'
2- import sortBy from 'lodash.sortby'
32import { buildBaseAttributesActions } from './utils/common-actions'
43import createBuildArrayActions , {
54 ADD_ACTIONS ,
@@ -202,10 +201,18 @@ export function actionsMapFieldDefinitions(
202201 // in order to prevent any eventual removal of `addAction`.
203202 // List of `removeActions` can be found here
204203 // https://docs.commercetools.com/http-api-projects-types.html#change-key
205- const sortedActions = sortBy (
206- actions ,
207- ( action ) => action . action !== 'removeFieldDefinition'
208- )
209204
210- return sortedActions
205+ return actions . sort ( ( a , b ) => {
206+ if (
207+ a . action === 'removeFieldDefinition' &&
208+ a . action === 'removeFieldDefinition'
209+ ) {
210+ return ( a . fieldName as string ) . localeCompare ( b . fieldName )
211+ } else if ( a . action === 'removeFieldDefinition' ) {
212+ return - 1
213+ } else if ( b . action === 'removeFieldDefinition' ) {
214+ return - 1
215+ }
216+ return 0
217+ } )
211218}
Original file line number Diff line number Diff line change @@ -6911,11 +6911,6 @@ lodash.snakecase@^4.1.1:
69116911 resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d"
69126912 integrity sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==
69136913
6914- lodash.sortby@^4.7.0 :
6915- version "4.7.0"
6916- resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
6917- integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==
6918-
69196914lodash.startcase@^4.4.0 :
69206915 version "4.4.0"
69216916 resolved "https://registry.yarnpkg.com/lodash.startcase/-/lodash.startcase-4.4.0.tgz#9436e34ed26093ed7ffae1936144350915d9add8"
You can’t perform that action at this time.
0 commit comments