Comparing version 0.2.0 to 0.2.1
@@ -12,3 +12,3 @@ var PREVIOUS = Symbol('PREVIOUS'); | ||
var cached, original, path, cache, | ||
onRestore; | ||
onRestore, stub; | ||
@@ -35,10 +35,12 @@ try { | ||
onRestore = []; | ||
stub = replacer(original, function(fn) { | ||
if (typeof fn != "function") { | ||
throw new TypeError("Should be function"); | ||
} | ||
onRestore.push(fn); | ||
}); | ||
cache = { | ||
exports: replacer(original, function(fn) { | ||
if (typeof fn != "function") { | ||
throw new TypeError("Should be function"); | ||
} | ||
onRestore.push(fn); | ||
}) | ||
exports: stub == void 0 ? original : stub | ||
}; | ||
@@ -45,0 +47,0 @@ cache[PREVIOUS] = cached || { exports: original }; |
{ | ||
"name": "cuculus", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"engines" : { "node" : ">=0.12.0" }, | ||
@@ -5,0 +5,0 @@ "description": "Simplest require mocking", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7600
141