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.1 to 0.3.2

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 = require.resolve(name);
path = resolve(name);
} catch (err) {

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

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

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

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

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

2

package.json
{
"name": "cuculus",
"version": "0.3.1",
"version": "0.3.2",
"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