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

cuculus

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cuculus - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

36

lib/cuculus.js
var PREVIOUS = Symbol('PREVIOUS');
var ON_RESTORE = Symbol('ON_RESTORE');
var _path = require('path');
function resolve(name) {
var attempts, path;
// lazy style attempts
attempts = [
function() {
return name;
},
function() {
return _path.resolve(process.cwd(), name);
}
];
while (!path && attempts.length > 0) {
try {
path = require.resolve(attempts.shift().call());
} catch (err) {
//
}
}
if (!path) {
throw new Error('Could not resolve path for module "' + name + '"');
}
return path;
}
exports.drop = function(name) {
try {
path = resolve(name);
path = require.resolve(name);
} catch (err) {

@@ -55,3 +25,3 @@ throw new Error('Could not drop non existing module "' + name + '"');

try {
path = resolve(name);
path = require.resolve(name);
} catch (err) {

@@ -107,3 +77,3 @@ throw new Error('Could not modify non existing module "' + name + '"');

try {
path = resolve(name);
path = require.resolve(name);
} catch (err) {

@@ -110,0 +80,0 @@ throw new Error('Could not restore non existing module "' + name + '"');

2

package.json
{
"name": "cuculus",
"version": "0.3.2",
"version": "0.3.3",
"engines" : { "node" : ">=0.12.0" },

@@ -5,0 +5,0 @@ "description": "Simplest require mocking",

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