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 4.3.3 to 4.3.4

24

lib/module/plugin.js

@@ -32,6 +32,7 @@ "use strict";

} = options;
return prefix => {
const self = prefix => {
const targetAbs = joinPath([prefix, target]);
let cache;
const result = {
self,
prefix,

@@ -44,12 +45,5 @@ targetNormalized: targetAbs.endsWith('.') ? targetAbs.slice(0, -1) : targetAbs,

type,
init: context => {
cache = {};
return init === undefined ? true : init({
context,
cache
});
},
fn: (kwargs = {}) => {
// eslint-disable-next-line no-param-reassign
kwargs.cache = cache;
kwargs.cache = self.cache;
return fn(kwargs);

@@ -68,2 +62,12 @@ },

};
self.init = context => {
self.cache = {};
return init === undefined ? true : init({
context,
cache: self.cache
});
};
return self;
};

@@ -70,0 +74,0 @@

@@ -5,6 +5,13 @@ "use strict";

const result = {};
Object.entries(map).forEach(([k, v]) => {
result[k] = v.filter(p => p.init(context) === true);
const plugins = new Map();
Object.entries(map).forEach(([prefix, pls]) => {
result[prefix] = pls.filter(pl => {
if (!plugins.has(pl.self)) {
plugins.set(pl.self, pl.self.init(context));
}
return plugins.get(pl.self) === true;
});
});
return result;
};
{
"name": "object-rewrite",
"version": "4.3.3",
"version": "4.3.4",
"description": "Rewrite Object(s) in place using plugins.",

@@ -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