New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dot-helpers

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot-helpers - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

2

lib/modify.js

@@ -9,3 +9,3 @@ const check = require('check-types');

Object.assign(acc, {
[key]: runModifiers(modifiers[key], value),
[key]: runModifiers(modifiers[key], value, values),
}),

@@ -12,0 +12,0 @@ {},

@@ -11,3 +11,9 @@ const modify = require('./modify');

{
foo: [(v) => v + 4],
foo: [
(v, args) => {
expect(v).toBe(1);
expect(args).toHaveProperty('bar');
return v + 4;
},
],
bar: [

@@ -14,0 +20,0 @@ (v) => v.trim(),

@@ -12,3 +12,3 @@ const set = require('lodash.set');

if (Array.isArray(value)) {
newValue = runModifiers(value, a[key]);
newValue = runModifiers(value, a[key], a);
} else {

@@ -15,0 +15,0 @@ newValue = extract(a, value);

@@ -9,3 +9,8 @@ const translateAndModify = require('./translateAndModify');

quuz: 'qux.quux',
bongo: [() => 'OVERRIDE'],
bongo: [
(value, state) => {
expect(state).toHaveProperty('waldo');
return 'OVERRIDE';
},
],
});

@@ -12,0 +17,0 @@

@@ -21,7 +21,8 @@ const check = require('check-types');

const runModifiers = (modifiers, originalValue) => {
const runModifiers = (modifiers, originalValue, context) => {
let newValue = originalValue;
if (check.nonEmptyArray(modifiers))
modifiers.forEach((fn) => {
if (typeof fn === 'function') newValue = fn(originalValue);
if (typeof fn === 'function')
newValue = fn(originalValue, context);
});

@@ -28,0 +29,0 @@

{
"name": "dot-helpers",
"version": "1.1.3",
"version": "1.1.4",
"description": "Object mapping helpers",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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