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

contentful-resolve-response

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contentful-resolve-response - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

26

index.js
'use strict';
var _ = require('lodash-contrib');
module.exports = resolveResponse;

@@ -15,3 +13,3 @@

function isLink(object) {
return _.getPath(object, ['sys', 'type']) === 'Link';
return object && object.sys && object.sys.type === 'Link';
}

@@ -25,4 +23,4 @@

};
return _.find(response.items, pred) ||
response.includes && _.find(response.includes[type], pred);
return find(response.items, pred) ||
response.includes && find(response.includes[type], pred);
}

@@ -34,6 +32,8 @@

if (_.isArray(input) || _.isObject(input)) {
_.each(input, function(item, key) {
input[key] = walkMutate(item, pred, mutator);
});
if (input && typeof input == 'object') {
for (var key in input) {
if (input.hasOwnProperty(key)) {
input[key] = walkMutate(input[key], pred, mutator);
}
}
return input;

@@ -44,1 +44,9 @@ }

}
function find (array, pred) {
for (var i = 0, len = array.length; i < len; i++) {
if (pred(array[i])) {
return array[i];
}
}
}
{
"name": "contentful-resolve-response",
"version": "0.1.0",
"version": "0.1.1",
"description": "",

@@ -21,6 +21,3 @@ "main": "index.js",

},
"homepage": "https://github.com:contentful/contentful-resolve-response",
"dependencies": {
"lodash-contrib": "^241.4.7"
}
"homepage": "https://github.com:contentful/contentful-resolve-response"
}
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