@@ -23,6 +23,22 @@ exports[`npm parse > should parse a npm lockfile 1`] = `
2323}
2424` ;
2525
26+ exports [` npm parse should parse a npm lockfile 1` ] = `
27+ {
28+ " lockfileVersion" : 3 ,
29+ " name" : " test" ,
30+ " packages" : {
31+ " node_modules/tslib" : {
32+ " integrity" : " sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" ,
33+ " resolved" : " https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz" ,
34+ " version" : " 2.5.0" ,
35+ },
36+ },
37+ " requires" : true ,
38+ " version" : " 1.0.0" ,
39+ }
40+ ` ;
41+
2642exports [` npm toCommonLockfile > should convert a npm lockfile to a common lockfile 1` ] = `
2743{
2844 " commonLockVersion" : 0 ,
@@ -305,3 +321,286 @@ exports[`npm toCommonLockfile > should convert a npm lockfile to a common lockfi
305321 " version" : " 1.0.0" ,
306322}
307323` ;
324+
325+ exports [` npm toCommonLockfile should convert a npm lockfile to a common lockfile 1` ] = `
326+ {
327+ " commonLockVersion" : 0 ,
328+ " importers" : {
329+ " ." : {
330+ " dependencies" : {
331+ " tslib" : " 2.5.0" ,
332+ },
333+ " devDependencies" : {},
334+ " optionalDependencies" : {},
335+ " specifiers" : {
336+ " tslib" : " ^2.5.0" ,
337+ },
338+ },
339+ },
340+ " lockfileType" : " npm" ,
341+ " lockfileVersion" : 3 ,
342+ " name" : " test" ,
343+ " packages" : {
344+ " /tslib/2.5.0" : {
345+ " authors" : [],
346+ " dependencies" : {},
347+ " dev" : undefined ,
348+ " engines" : undefined ,
349+ " funding" : undefined ,
350+ " hasBin" : undefined ,
351+ " licenseFiles" : undefined ,
352+ " optional" : undefined ,
353+ " optionalDependencies" : {},
354+ " packageJsonPath" : " ./../../../../.." ,
355+ " spdxLicenseId" : undefined ,
356+ " version" : " 2.5.0" ,
357+ },
358+ },
359+ " path" : undefined ,
360+ " version" : " 1.0.0" ,
361+ }
362+ ` ;
363+
364+ exports [` npm toCommonLockfile should convert a npm lockfile to a common lockfile with npm modules 1` ] = `
365+ {
366+ " commonLockVersion" : 0 ,
367+ " importers" : {
368+ " ." : {
369+ " dependencies" : {},
370+ " devDependencies" : {},
371+ " optionalDependencies" : {},
372+ " specifiers" : {},
373+ },
374+ " long/nested/package-c" : {
375+ " dependencies" : {
376+ " @test/package-a" : " 1.0.0" ,
377+ },
378+ " devDependencies" : {},
379+ " optionalDependencies" : {},
380+ " specifiers" : {
381+ " @test/package-a" : " 1.0.0" ,
382+ },
383+ },
384+ " packages/package-a" : {
385+ " dependencies" : {},
386+ " devDependencies" : {},
387+ " optionalDependencies" : {},
388+ " specifiers" : {},
389+ },
390+ " packages/package-b" : {
391+ " dependencies" : {
392+ " @test/package-a" : " 1.0.0" ,
393+ " package-c" : " 1.0.0" ,
394+ },
395+ " devDependencies" : {
396+ " @types/node" : " 12.20.55" ,
397+ },
398+ " optionalDependencies" : {},
399+ " specifiers" : {
400+ " @test/package-a" : " 1.0.0" ,
401+ " @types/node" : " ^12.12.12" ,
402+ " package-c" : " 1.0.0" ,
403+ },
404+ },
405+ },
406+ " lockfileType" : " npm" ,
407+ " lockfileVersion" : 3 ,
408+ " name" : " npm-workspaces-demo" ,
409+ " packages" : {
410+ " /@types/node/12.20.55" : {
411+ " authors" : [
412+ {
413+ " githubUsername" : " Microsoft" ,
414+ " name" : " Microsoft TypeScript" ,
415+ " url" : " https://github.com/Microsoft" ,
416+ },
417+ {
418+ " githubUsername" : " DefinitelyTyped" ,
419+ " name" : " DefinitelyTyped" ,
420+ " url" : " https://github.com/DefinitelyTyped" ,
421+ },
422+ {
423+ " githubUsername" : " jkomyno" ,
424+ " name" : " Alberto Schiabel" ,
425+ " url" : " https://github.com/jkomyno" ,
426+ },
427+ {
428+ " githubUsername" : " alvis" ,
429+ " name" : " Alvis HT Tang" ,
430+ " url" : " https://github.com/alvis" ,
431+ },
432+ {
433+ " githubUsername" : " r3nya" ,
434+ " name" : " Andrew Makarov" ,
435+ " url" : " https://github.com/r3nya" ,
436+ },
437+ {
438+ " githubUsername" : " btoueg" ,
439+ " name" : " Benjamin Toueg" ,
440+ " url" : " https://github.com/btoueg" ,
441+ },
442+ {
443+ " githubUsername" : " smac89" ,
444+ " name" : " Chigozirim C." ,
445+ " url" : " https://github.com/smac89" ,
446+ },
447+ {
448+ " githubUsername" : " touffy" ,
449+ " name" : " David Junger" ,
450+ " url" : " https://github.com/touffy" ,
451+ },
452+ {
453+ " githubUsername" : " DeividasBakanas" ,
454+ " name" : " Deividas Bakanas" ,
455+ " url" : " https://github.com/DeividasBakanas" ,
456+ },
457+ {
458+ " githubUsername" : " eyqs" ,
459+ " name" : " Eugene Y. Q. Shen" ,
460+ " url" : " https://github.com/eyqs" ,
461+ },
462+ {
463+ " githubUsername" : " Hannes-Magnusson-CK" ,
464+ " name" : " Hannes Magnusson" ,
465+ " url" : " https://github.com/Hannes-Magnusson-CK" ,
466+ },
467+ {
468+ " githubUsername" : " KSXGitHub" ,
469+ " name" : " Hoàng Văn Khải" ,
470+ " url" : " https://github.com/KSXGitHub" ,
471+ },
472+ {
473+ " githubUsername" : " hoo29" ,
474+ " name" : " Huw" ,
475+ " url" : " https://github.com/hoo29" ,
476+ },
477+ {
478+ " githubUsername" : " kjin" ,
479+ " name" : " Kelvin Jin" ,
480+ " url" : " https://github.com/kjin" ,
481+ },
482+ {
483+ " githubUsername" : " ajafff" ,
484+ " name" : " Klaus Meinhardt" ,
485+ " url" : " https://github.com/ajafff" ,
486+ },
487+ {
488+ " githubUsername" : " islishude" ,
489+ " name" : " Lishude" ,
490+ " url" : " https://github.com/islishude" ,
491+ },
492+ {
493+ " githubUsername" : " mwiktorczyk" ,
494+ " name" : " Mariusz Wiktorczyk" ,
495+ " url" : " https://github.com/mwiktorczyk" ,
496+ },
497+ {
498+ " githubUsername" : " mohsen1" ,
499+ " name" : " Mohsen Azimi" ,
500+ " url" : " https://github.com/mohsen1" ,
501+ },
502+ {
503+ " githubUsername" : " n-e" ,
504+ " name" : " Nicolas Even" ,
505+ " url" : " https://github.com/n-e" ,
506+ },
507+ {
508+ " githubUsername" : " galkin" ,
509+ " name" : " Nikita Galkin" ,
510+ " url" : " https://github.com/galkin" ,
511+ },
512+ {
513+ " githubUsername" : " parambirs" ,
514+ " name" : " Parambir Singh" ,
515+ " url" : " https://github.com/parambirs" ,
516+ },
517+ {
518+ " githubUsername" : " eps1lon" ,
519+ " name" : " Sebastian Silbermann" ,
520+ " url" : " https://github.com/eps1lon" ,
521+ },
522+ {
523+ " githubUsername" : " SimonSchick" ,
524+ " name" : " Simon Schick" ,
525+ " url" : " https://github.com/SimonSchick" ,
526+ },
527+ {
528+ " githubUsername" : " ThomasdenH" ,
529+ " name" : " Thomas den Hollander" ,
530+ " url" : " https://github.com/ThomasdenH" ,
531+ },
532+ {
533+ " githubUsername" : " WilcoBakker" ,
534+ " name" : " Wilco Bakker" ,
535+ " url" : " https://github.com/WilcoBakker" ,
536+ },
537+ {
538+ " githubUsername" : " wwwy3y3" ,
539+ " name" : " wwwy3y3" ,
540+ " url" : " https://github.com/wwwy3y3" ,
541+ },
542+ {
543+ " githubUsername" : " ZaneHannanAU" ,
544+ " name" : " Zane Hannan AU" ,
545+ " url" : " https://github.com/ZaneHannanAU" ,
546+ },
547+ {
548+ " githubUsername" : " samuela" ,
549+ " name" : " Samuel Ainsworth" ,
550+ " url" : " https://github.com/samuela" ,
551+ },
552+ {
553+ " githubUsername" : " kuehlein" ,
554+ " name" : " Kyle Uehlein" ,
555+ " url" : " https://github.com/kuehlein" ,
556+ },
557+ {
558+ " githubUsername" : " bhongy" ,
559+ " name" : " Thanik Bhongbhibhat" ,
560+ " url" : " https://github.com/bhongy" ,
561+ },
562+ {
563+ " githubUsername" : " chyzwar" ,
564+ " name" : " Marcin Kopacz" ,
565+ " url" : " https://github.com/chyzwar" ,
566+ },
567+ {
568+ " githubUsername" : " trivikr" ,
569+ " name" : " Trivikram Kamat" ,
570+ " url" : " https://github.com/trivikr" ,
571+ },
572+ {
573+ " githubUsername" : " yoursunny" ,
574+ " name" : " Junxiao Shi" ,
575+ " url" : " https://github.com/yoursunny" ,
576+ },
577+ {
578+ " githubUsername" : " qwelias" ,
579+ " name" : " Ilia Baryshnikov" ,
580+ " url" : " https://github.com/qwelias" ,
581+ },
582+ {
583+ " githubUsername" : " ExE-Boss" ,
584+ " name" : " ExE Boss" ,
585+ " url" : " https://github.com/ExE-Boss" ,
586+ },
587+ ],
588+ " dependencies" : {},
589+ " dev" : true ,
590+ " engines" : undefined ,
591+ " funding" : undefined ,
592+ " hasBin" : undefined ,
593+ " licenseFiles" : [
594+ " ./node_modules/@types/node/LICENSE" ,
595+ ],
596+ " optional" : undefined ,
597+ " optionalDependencies" : {},
598+ " packageJsonPath" : " ./node_modules/@types/node" ,
599+ " spdxLicenseId" : " MIT" ,
600+ " version" : " 12.20.55" ,
601+ },
602+ },
603+ " path" : undefined ,
604+ " version" : " 1.0.0" ,
605+ }
606+ ` ;
0 commit comments