Skip to content

Commit 67657a2

Browse files
committed
Use more OVERRIDES_FIELD_NAME and RESOLUTIONS_FIELD_NAME
1 parent 9d99734 commit 67657a2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/commands/optimize.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ const updateManifestByAgent: Record<Agent, AgentModifyManifestFn> = (() => {
250250
let insertIndex = -1
251251
let isPlacingHigher = false
252252
if (field === OVERRIDES_FIELD_NAME) {
253-
insertIndex = getLowestEntryIndex(entries, ['resolutions'])
253+
insertIndex = getLowestEntryIndex(entries, [RESOLUTIONS_FIELD_NAME])
254254
if (insertIndex === -1) {
255255
isPlacingHigher = true
256256
insertIndex = getHighestEntryIndex(entries, [...depFields, PNPM])
@@ -259,11 +259,11 @@ const updateManifestByAgent: Record<Agent, AgentModifyManifestFn> = (() => {
259259
isPlacingHigher = true
260260
insertIndex = getHighestEntryIndex(entries, [
261261
...depFields,
262-
'overrides',
262+
OVERRIDES_FIELD_NAME,
263263
PNPM
264264
])
265265
} else if (field === PNPM_FIELD_NAME) {
266-
insertIndex = getLowestEntryIndex(entries, ['overrides', 'resolutions'])
266+
insertIndex = getLowestEntryIndex(entries, [OVERRIDES_FIELD_NAME, RESOLUTIONS_FIELD_NAME])
267267
if (insertIndex === -1) {
268268
isPlacingHigher = true
269269
insertIndex = getHighestEntryIndex(entries, depFields)

0 commit comments

Comments
 (0)