File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -96,11 +96,13 @@ async function main() {
9696 // Check the package.json for 'link:' and 'file:' dependencies.
9797 const packageJson = JSON . parse ( fs . readFileSync ( 'package.json' )
9898 . toString ( 'utf8' ) ) as { dependencies : Record < string , string> } ;
99- for ( let [ dep , depVersion ] of Object . entries ( packageJson . dependencies ) ) {
100- const start = depVersion . slice ( 0 , 5 ) ;
101- if ( start === 'link:' || start === 'file:' ) {
102- throw new Error ( `${ pkg } has a '${ start } ' dependency on ${ dep } . `
103- + 'Refusing to publish.' ) ;
99+ if ( packageJson . dependencies ) {
100+ for ( let [ dep , depVersion ] of Object . entries ( packageJson . dependencies ) ) {
101+ const start = depVersion . slice ( 0 , 5 ) ;
102+ if ( start === 'link:' || start === 'file:' ) {
103+ throw new Error ( `${ pkg } has a '${ start } ' dependency on ${ dep } . `
104+ + 'Refusing to publish.' ) ;
105+ }
104106 }
105107 }
106108
You can’t perform that action at this time.
0 commit comments