@@ -7,7 +7,7 @@ import util from 'node:util'
77import { glob as tinyGlob } from 'tinyglobby'
88
99import { readJson , remove , writeJson } from '@socketsecurity/registry/lib/fs'
10- import { toSortedObject } from '@socketsecurity/registry/lib/objects'
10+ import { hasKeys , toSortedObject } from '@socketsecurity/registry/lib/objects'
1111import {
1212 fetchPackageManifest ,
1313 readPackageJson
@@ -159,7 +159,7 @@ async function updatePackageJson() {
159159 name : SOCKET_CLI_PACKAGE_NAME ,
160160 description : SOCKET_DESCRIPTION ,
161161 bin,
162- dependencies
162+ dependencies : hasKeys ( dependencies ) ? dependencies : undefined
163163 } )
164164 // Lazily access constants.ENV[INLINED_SOCKET_CLI_LEGACY_BUILD].
165165 if ( constants . ENV [ INLINED_SOCKET_CLI_LEGACY_BUILD ] ) {
@@ -203,7 +203,11 @@ async function updatePackageLockFile() {
203203 lockJson . name = SOCKET_CLI_PACKAGE_NAME
204204 rootPkg . name = SOCKET_CLI_PACKAGE_NAME
205205 rootPkg . bin = bin
206- rootPkg . dependencies = dependencies
206+ if ( hasKeys ( dependencies ) ) {
207+ rootPkg . dependencies = dependencies
208+ } else {
209+ delete rootPkg . dependencies
210+ }
207211 // Lazily access constants.ENV[INLINED_SOCKET_CLI_LEGACY_BUILD].
208212 if ( constants . ENV [ INLINED_SOCKET_CLI_LEGACY_BUILD ] ) {
209213 lockJson . name = SOCKET_CLI_LEGACY_PACKAGE_NAME
0 commit comments