@pnpm/read-project-manifest
Advanced tools
Comparing version 5.0.2 to 5.0.3
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21041
292
14
5
+ Addedlodash.clonedeep@^4.5.0
+ Addedlodash.clonedeep@4.5.0(transitive)