Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const descriptor = structUtils.parseDescriptor(pattern);
const peerDependencyMeta = this.ensurePeerDependencyMeta(descriptor);
Object.assign(peerDependencyMeta, meta);
}
}
if (typeof data.resolutions === `object` && data.resolutions !== null) {
for (const [pattern, reference] of Object.entries(data.resolutions)) {
if (typeof reference !== `string`) {
errors.push(new Error(`Invalid resolution entry for '${pattern}'`));
continue;
}
try {
this.resolutions.push({pattern: parseResolution(pattern), reference});
} catch (error) {
errors.push(error);
continue;
}
}
}
if (Array.isArray(data.files) && data.files.length !== 0) {
this.files = new Set();
for (const filename of data.files) {
if (typeof filename !== `string`) {
errors.push(new Error(`Invalid files entry for '${filename}'`));
continue;
}