Skip to content

Commit 0a0877e

Browse files
committed
refactor: minor tweak
1 parent b73d970 commit 0a0877e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

index.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -262,27 +262,27 @@ const sortScripts = onObject((scripts, packageJson) => {
262262
})
263263

264264
/*
265-
- Move `types` and versioned types to top
266-
- Move `default` to last
265+
- Move `types` and versioned type condition to top
266+
- Move `default` condition to bottom
267267
*/
268268
const sortConditions = (conditions) => {
269269
const {
270-
types = [],
271-
default: defaultConditions = [],
272-
rest: restConditions = [],
270+
typesConditions = [],
271+
defaultConditions = [],
272+
restConditions = [],
273273
} = objectGroupBy(conditions, (condition) => {
274274
if (condition === 'types' || condition.startsWith('types@')) {
275-
return 'types'
275+
return 'typesConditions'
276276
}
277277

278278
if (condition === 'default') {
279-
return 'default'
279+
return 'defaultConditions'
280280
}
281281

282-
return 'rest'
282+
return 'restConditions'
283283
})
284284

285-
return [...types, ...restConditions, ...defaultConditions]
285+
return [...typesConditions, ...restConditions, ...defaultConditions]
286286
}
287287

288288
const sortExports = onObject((exports) => {

0 commit comments

Comments
 (0)