Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function parseDescriptor(
targetName: string,
descriptor: mixed,
pkgPath: ?FilePath,
pkgContents: string | mixed,
): TargetDescriptor | PackageTargetDescriptor {
validateSchema.diagnostic(
DESCRIPTOR_SCHEMA,
descriptor,
pkgPath,
pkgContents,
'@parcel/core',
`/targets/${targetName}`,
`Invalid target descriptor for target "${targetName}"`,
);
// $FlowFixMe we just verified this
return descriptor;
}
function parseEngines(
engines: mixed,
pkgPath: ?FilePath,
pkgContents: string | mixed,
prependKey: string,
message: string,
): Engines | typeof undefined {
if (engines === undefined) {
return engines;
} else {
validateSchema.diagnostic(
ENGINES_SCHEMA,
engines,
pkgPath,
pkgContents,
'@parcel/core',
prependKey,
message,
);
// $FlowFixMe we just verified this
return engines;
}
}