Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
compatibilityMode: false,
}),
linkType: pkg.linkType.toLowerCase(),
resolution: structUtils.stringifyLocator(pkg),
checksum: this.storedChecksums.get(pkg.locatorHash),
};
}
const header = `${[
`# This file is generated by running "yarn install" inside your project.\n`,
`# Manual changes might be lost - proceed with caution!\n`,
].join(``)}\n`;
return header + stringifySyml(optimizedLockfile);
}
throw new ReportError(MessageName.AUTOMERGE_IMMUTABLE, `Cannot autofix a lockfile when running an immutable install`);
const [left, right] = getVariants(file);
let parsedLeft;
let parsedRight;
try {
parsedLeft = parseSyml(left);
parsedRight = parseSyml(right);
} catch (error) {
throw new ReportError(MessageName.AUTOMERGE_FAILED_TO_PARSE, `The individual variants of the lockfile failed to parse`);
}
const merged = Object.assign({}, parsedLeft, parsedRight);
const serialized = stringifySyml(merged);
await xfs.changeFilePromise(lockfilePath, serialized);
return true;
}
const nextValue = typeof patch[key] === `function`
? patch[key](currentValue)
: patch[key];
if (currentValue === nextValue)
continue;
current[key] = nextValue;
patched = true;
}
if (!patched)
return;
await xfs.changeFilePromise(configurationPath, stringifySyml(current));
}