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

custom-require

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

custom-require - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

4

dist/CustomRequire.d.ts

@@ -6,3 +6,3 @@ /// <reference types="node" />

__parentModules: CustomNodeModule[];
__removeCustomRequire: (customRequire: CustomRequire) => void;
__removeCustomRequire: (customRequire: CustomRequire) => CustomNodeModule[];
__addCustomRequire: (customRequire: CustomRequire) => void;

@@ -18,3 +18,3 @@ __invalidateCache: () => void;

require(id: string, callerModule?: CustomNodeModule): any;
unrequire(id: string, callerModule?: CustomNodeModule, invalidateCache?: boolean): void;
unrequire(id: string, callerModule?: CustomNodeModule, invalidateCache?: boolean): CustomNodeModule[];
getCachedModule(id: string, mod: NodeModule): CustomNodeModule;

@@ -21,0 +21,0 @@ getCallerModule(filterlist?: string[]): CustomNodeModule;

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

var cachedModule = this.getCachedModule(id, callerModule);
cachedModule.__removeCustomRequire(this);
var list = cachedModule.__removeCustomRequire(this);
if (invalidateCache) {
cachedModule.__invalidateCache();
}
return list;
};

@@ -61,2 +62,3 @@ CustomRequire.prototype.getCachedModule = function (id, mod) {

Module.prototype.__cleanCalled = function (customRequire, mod) {
var list = [];
var whoRequired = this.__whoRequired();

@@ -80,13 +82,17 @@ var clean = true;

customRequire.called.splice(customRequire.called.indexOf(this), 1);
list.push(this);
}
for (var _c = 0, _d = this.__childModules; _c < _d.length; _c++) {
var childModule = _d[_c];
childModule.__cleanCalled(customRequire, mod);
list = list.concat(childModule.__cleanCalled(customRequire, mod));
}
return list;
};
Module.prototype.__removeCustomRequire = function (customRequire) {
var list = [];
if (this.__customRequires.indexOf(customRequire) > -1) {
this.__customRequires.splice(this.__customRequires.indexOf(customRequire), 1);
this.__cleanCalled(customRequire, this);
list = this.__cleanCalled(customRequire, this);
}
return list;
};

@@ -93,0 +99,0 @@ Module.prototype.__addCustomRequire = function (customRequire) {

@@ -34,3 +34,3 @@ {

},
"version": "0.1.1",
"version": "0.1.2",
"dependencies": {

@@ -37,0 +37,0 @@ "callsite": "^1.0.0"

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