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

object-rewrite

Package Overview
Dependencies
Maintainers
1
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-rewrite - npm Package Compare versions

Comparing version 6.0.3 to 6.0.4

25

lib/module/plugin.js

@@ -56,4 +56,26 @@ "use strict";

const wrapInject = f => {
const schema = validationCompile(fnSchema);
const validate = r => {
if (schema(r) !== true) {
throw new Error(`${name}: bad fn return value "${r}"`);
}
return r;
};
return kwargs => {
const result = f(kwargs);
if (result instanceof Promise) {
return result.then(r => validate(r));
}
return validate(result);
};
};
const fnWrapped = (() => {
const wrapped = wrap(fn);
const wrapped = type === 'INJECT' ? wrapInject(wrap(fn)) : wrap(fn);

@@ -96,3 +118,2 @@ if (valueSchema === undefined) {

result.targetNormalized = prefix;
result.fnSchema = validationCompile(fnSchema);
result.targets = validationExtractKeys(targetAbs, fnSchema);

@@ -99,0 +120,0 @@ }

2

lib/module/rewriter/mk-inject-rewriter.js

@@ -36,4 +36,2 @@ "use strict";

const exec = r => {
assert(plugin.fnSchema(r) === true, r);
if (plugin.targetRel === '*') {

@@ -40,0 +38,0 @@ Object.assign(kwargs.value, r);

{
"name": "object-rewrite",
"version": "6.0.3",
"version": "6.0.4",
"description": "Rewrite Object(s) in place using plugins.",

@@ -34,3 +34,3 @@ "main": "lib/index.js",

"nyc": "15.1.0",
"semantic-release": "17.3.9"
"semantic-release": "17.4.0"
},

@@ -37,0 +37,0 @@ "scripts": {

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