@nodesecure/mama
Version:
20 lines • 684 B
JavaScript
// Import Third-party Dependencies
import hash from "object-hash";
export function packageJSONIntegrityHash(document, options = {}) {
const { isFromRemoteRegistry = false } = options;
const { dependencies = {}, license = "NONE", scripts = {} } = document;
if (isFromRemoteRegistry) {
// See https://github.com/npm/cli/issues/5234
if ("install" in dependencies && dependencies.install === "node-gyp rebuild") {
delete dependencies.install;
}
}
return hash({
name: document.name,
version: document.version,
dependencies,
license,
scripts
});
}
//# sourceMappingURL=integrity-hash.js.map