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

@stackbit/utils

Package Overview
Dependencies
Maintainers
13
Versions
313
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stackbit/utils - npm Package Compare versions

Comparing version 0.2.20 to 0.2.21-alpha.0

14

dist/object-utils.js

@@ -155,11 +155,13 @@ "use strict";

}
const childrenIterator = (val, key) => {
if (includeKeyPath) {
return _mapDeep(val, lodash_1.default.concat(keyPath, key), lodash_1.default.concat(mappedValueStack, value));
}
return _mapDeep(val, null, null);
};
if (lodash_1.default.isPlainObject(value)) {
value = lodash_1.default.mapValues(value, (val, key) => {
return _mapDeep(val, includeKeyPath ? lodash_1.default.concat(keyPath, key) : null, includeKeyPath ? lodash_1.default.concat(mappedValueStack, value) : null);
});
value = lodash_1.default.mapValues(value, childrenIterator);
}
else if (Array.isArray(value)) {
value = lodash_1.default.map(value, (val, key) => {
return _mapDeep(val, includeKeyPath ? lodash_1.default.concat(keyPath, key) : null, includeKeyPath ? lodash_1.default.concat(mappedValueStack, value) : null);
});
value = lodash_1.default.map(value, childrenIterator);
}

@@ -166,0 +168,0 @@ return value;

{
"name": "@stackbit/utils",
"version": "0.2.20",
"version": "0.2.21-alpha.0",
"description": "Stackbit utilities",

@@ -46,3 +46,3 @@ "main": "dist/index.js",

},
"gitHead": "f4471bdd3fb6fc3c6950a9899ce627fa921310cd"
"gitHead": "65c13454379b9cba8a9ce7667f0b15e1f863f1fa"
}

@@ -168,10 +168,12 @@ import _, { PropertyPath } from 'lodash';

}
const childrenIterator = (val: any, key: string | number) => {
if (includeKeyPath) {
return _mapDeep(val, _.concat(keyPath!, key), _.concat(mappedValueStack!, value));
}
return _mapDeep(val, null, null);
};
if (_.isPlainObject(value)) {
value = _.mapValues(value, (val: any, key: string) => {
return _mapDeep(val, includeKeyPath ? _.concat(keyPath!, key) : null, includeKeyPath ? _.concat(mappedValueStack!, value) : null);
});
value = _.mapValues(value, childrenIterator);
} else if (Array.isArray(value)) {
value = _.map(value, (val: any, key: number) => {
return _mapDeep(val, includeKeyPath ? _.concat(keyPath!, key) : null, includeKeyPath ? _.concat(mappedValueStack!, value) : null);
});
value = _.map(value, childrenIterator);
}

@@ -178,0 +180,0 @@ return value;

Sorry, the diff of this file is not supported yet

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