Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pnpm/read-project-manifest

Package Overview
Dependencies
Maintainers
2
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/read-project-manifest - npm Package Compare versions

Comparing version 5.0.2 to 5.0.3

27

lib/index.js

@@ -16,3 +16,3 @@ "use strict";

const is_windows_1 = __importDefault(require("is-windows"));
const sort_keys_1 = __importDefault(require("sort-keys"));
const lodash_clonedeep_1 = __importDefault(require("lodash.clonedeep"));
const readFile_1 = require("./readFile");

@@ -201,11 +201,22 @@ async function safeReadProjectManifestOnly(projectDir) {

function normalize(manifest) {
manifest = JSON.parse(JSON.stringify(manifest));
const result = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
for (const [key, value] of Object.entries(manifest)) {
if (!dependencyKeys.has(key)) {
result[key] = value;
for (const key in manifest) {
if (Object.prototype.hasOwnProperty.call(manifest, key)) {
const value = manifest[key];
if (typeof value !== 'object' || !dependencyKeys.has(key)) {
result[key] = (0, lodash_clonedeep_1.default)(value);
}
else {
const keys = Object.keys(value);
if (keys.length !== 0) {
keys.sort();
const sortedValue = {};
for (const k of keys) {
// @ts-expect-error this is fine
sortedValue[k] = value[k];
}
result[key] = sortedValue;
}
}
}
else if (Object.keys(value).length !== 0) {
result[key] = (0, sort_keys_1.default)(value);
}
}

@@ -212,0 +223,0 @@ return result;

{
"name": "@pnpm/read-project-manifest",
"version": "5.0.2",
"version": "5.0.3",
"description": "Read a project manifest (called package.json in most cases)",

@@ -29,2 +29,3 @@ "main": "lib/index.js",

"json5": "^2.2.3",
"lodash.clonedeep": "^4.5.0",
"parse-json": "^5.2.0",

@@ -42,5 +43,6 @@ "read-yaml-file": "^2.1.0",

"@types/is-windows": "^1.0.0",
"@types/lodash.clonedeep": "^4.5.7",
"@types/parse-json": "^4.0.0",
"tempy": "^1.0.1",
"@pnpm/read-project-manifest": "5.0.2"
"@pnpm/read-project-manifest": "5.0.3"
},

@@ -47,0 +49,0 @@ "funding": "https://opencollective.com/pnpm",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc