Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
resolved,
integrity,
// allow setting name explicitly when we haven't set a path yet
name,
children,
fsChildren,
linksIn,
hasShrinkwrap,
extraneous = true,
dev = true,
optional = true,
devOptional = true,
} = options
this.errors = error ? [error] : []
const pkg = normalize(options.pkg || {})
this.name = name ||
nameFromFolder(path || pkg.name || realpath) ||
pkg.name
if (!this.name)
throw new TypeError('could not detect node name from path or package')
// should be equal if not a link
this.path = path
this.realpath = !this.isLink ? this.path : realpath
this.resolved = resolved || null
if (!this.resolved) {
// note: this *only* works for non-file: deps, so we avoid even
// trying here.