contentful-resolve-response
Advanced tools
Comparing version 1.1.0 to 1.1.1
18
index.js
@@ -42,2 +42,19 @@ const cloneDeep = require('lodash/cloneDeep'); | ||
/** | ||
* cleanUpLink Function | ||
* - Removes unresolvable links from Arrays and Objects | ||
* | ||
* @param {Object[]|Object} input | ||
* @param {number|string} key | ||
*/ | ||
const cleanUpLink = (input, key) => { | ||
if (input[key] === undefined) { | ||
if (Array.isArray(input)) { | ||
input.splice(key, 1); | ||
} else { | ||
delete input[key]; | ||
} | ||
} | ||
}; | ||
/** | ||
* walkMutate Function | ||
@@ -58,2 +75,3 @@ * @param input | ||
input[key] = walkMutate(input[key], predicate, mutator); | ||
cleanUpLink(input, key); | ||
} | ||
@@ -60,0 +78,0 @@ } |
{ | ||
"name": "contentful-resolve-response", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8401
6
117
0