@@ -33,7 +33,12 @@ import {
3333
3434import npmBuiltinNames from '../data/npm/builtin-names.json'
3535import npmLegacyNames from '../data/npm/legacy-names.json'
36- import { LOOP_SENTINEL } from '../src/constants.js'
36+ import { LOOP_SENTINEL } from '../dist/constants.js'
37+ import { PurlError , formatPurlErrorMessage } from '../dist/error.js'
38+ import { recursiveFreeze } from '../dist/objects.js'
39+ import { PackageURL } from '../dist/package-url.js'
40+ import { PurlQualifierNames } from '../dist/purl-qualifier-names.js'
41+ import { PurlType } from '../dist/purl-type.js'
3742import {
3843 encodeComponent ,
3944 encodeNamespace ,
@@ -42,7 +47,6 @@ import {
4247 encodeSubpath ,
4348 encodeVersion ,
4449} from '../src/encode.js'
45- import { PurlError , formatPurlErrorMessage } from '../src/error.js'
4650import {
4751 normalizeName ,
4852 normalizeNamespace ,
@@ -51,8 +55,6 @@ import {
5155 normalizeType ,
5256 normalizeVersion ,
5357} from '../src/normalize.js'
54- import { recursiveFreeze } from '../src/objects.js'
55- import { PackageURL } from '../src/package-url.js'
5658import {
5759 PurlComponent ,
5860 PurlComponentEncoder ,
@@ -61,8 +63,6 @@ import {
6163 componentComparator ,
6264 componentSortOrder ,
6365} from '../src/purl-component.js'
64- import { PurlQualifierNames } from '../src/purl-qualifier-names.js'
65- import { PurlType } from '../src/purl-type.js'
6666import {
6767 validateEmptyByType ,
6868 validateQualifierKey ,
@@ -1254,7 +1254,9 @@ describe('PackageURL', () => {
12541254
12551255 it ( 'should have proper prototype for PackageURL instances' , ( ) => {
12561256 const purl = new PackageURL ( 'type' , null , 'name' )
1257- expect ( Object . getPrototypeOf ( Object . getPrototypeOf ( purl ) ) ) . toBe ( null )
1257+ // Verify the instance is properly constructed with null prototype for security
1258+ expect ( Object . getPrototypeOf ( purl ) ) . toBe ( PackageURL . prototype )
1259+ expect ( Object . getPrototypeOf ( PackageURL . prototype ) ) . toBe ( null )
12581260 } )
12591261 } )
12601262
0 commit comments