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.17 to 0.1.18

3

dist/CustomRequire.d.ts

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

__invalidateCache: () => void;
__invalidate: () => NodeModule[];
__checkInvalid: () => boolean;

@@ -23,3 +24,3 @@ __whoRequired: () => NodeModule[];

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

@@ -26,0 +27,0 @@ getCallerModule(filterlist?: string[]): NodeModule;

@@ -20,3 +20,3 @@ "use strict";

if (cachedModule && cachedModule.__checkInvalid()) {
this.unrequire(cachedModule, null, true);
cachedModule.__invalidate();
}

@@ -28,3 +28,3 @@ var res = callerModule.require(id);

};
CustomRequire.prototype.unrequire = function (id, callerModule, invalidateCache) {
CustomRequire.prototype.unrequire = function (id, callerModule) {
if (typeof id == "string") {

@@ -38,5 +38,2 @@ if (!callerModule) {

var list = id.__removeCustomRequire(this);
if (invalidateCache) {
id.__invalidateCache();
}
if (this.unrequirecallback) {

@@ -78,2 +75,19 @@ this.unrequirecallback(list);

}
Module.prototype.__invalidate = function (list) {
if (this.__invalid) {
return;
}
if (!list) {
list = [];
}
list.push(this);
this.__invalid = true;
if (this.__customRequires.length == 0) {
for (var _i = 0, _a = this.__parentModules; _i < _a.length; _i++) {
var parentModule = _a[_i];
parentModule.__invalidate(list);
}
}
return list;
};
Module.prototype.__cleanCalled = function (customRequire, mod, cyclicCheck) {

@@ -80,0 +94,0 @@ if (!cyclicCheck) {

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

},
"version": "0.1.17",
"version": "0.1.18",
"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