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

quibble

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quibble - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

.dont-break.json

56

lib/quibble.js

@@ -5,3 +5,15 @@ // Generated by CoffeeScript 1.11.1

_ = require('lodash');
_ = {
compact: require('lodash/fp/compact'),
extendAll: require('lodash/fp/extendAll'),
filter: require('lodash/fp/filter'),
find: require('lodash/fp/find'),
flow: require('lodash/fp/flow'),
invokeMap: require('lodash/fp/invokeMap'),
includes: require('lodash/fp/includes'),
reject: require('lodash/fp/reject'),
startsWith: require('lodash/fp/startsWith'),
uniq: require('lodash/uniq'),
values: require('lodash/values')
};

@@ -31,3 +43,3 @@ Module = require('module');

quibble.config = function(userConfig) {
return config = _.extend({}, {
return config = _.extendAll({}, {
defaultFakeCreator: function(request) {

@@ -64,3 +76,3 @@ return {};

}
if (_.startsWith(relativePath, '/') || /^\w/.test(relativePath)) {
if (_.startsWith(relativePath, '/') || /^(\w|@)/.test(relativePath)) {
return relativePath;

@@ -96,3 +108,3 @@ }

doWithoutCache = function(request, parent, thingToDo) {
var cachedThing, filename;
var cachedThing, filename, result;
filename = Module._resolveFilename(request, parent);

@@ -104,9 +116,9 @@ if (!Module._cache.hasOwnProperty(filename)) {

delete Module._cache[filename];
return _.tap(thingToDo(), function() {
return Module._cache[filename] = cachedThing;
});
result = thingToDo();
Module._cache[filename] = cachedThing;
return result;
};
hackErrorStackToGetCallerFile = function(includeGlobalIgnores) {
var callerFile, currentFile, e, originalFunc;
var currentFile, e, originalFunc;
if (includeGlobalIgnores == null) {

@@ -116,16 +128,20 @@ includeGlobalIgnores = true;

originalFunc = Error.prepareStackTrace;
Error.prepareStackTrace = function(e, stack) {
return stack;
};
e = new Error();
currentFile = e.stack[0].getFileName();
callerFile = _(e.stack).invoke('getFileName').compact().reject(function(f) {
return includeGlobalIgnores && _.include(ignoredCallerFiles, f);
}).select(path.isAbsolute).find(function(f) {
return f !== currentFile;
});
Error.prepareStackTrace = originalFunc;
return callerFile;
try {
Error.prepareStackTrace = function(e, stack) {
return stack;
};
e = new Error();
currentFile = e.stack[0].getFileName();
return _.flow([
_.invokeMap('getFileName'), _.compact, _.reject(function(f) {
return includeGlobalIgnores && _.includes(f, ignoredCallerFiles);
}), _.filter(path.isAbsolute), _.find(function(f) {
return f !== currentFile;
})
])(e.stack);
} finally {
Error.prepareStackTrace = originalFunc;
}
};
}).call(this);
{
"name": "quibble",
"version": "0.3.1",
"version": "0.4.0",
"description": "Makes it easy to replace require'd dependencies.",

@@ -17,3 +17,4 @@ "homepage": "https://github.com/testdouble/quibble",

"test:example": "cd example && npm test",
"test:ci": "npm test && npm run test:example",
"test:dependents": "npm run compile && dont-break --timeout 90",
"test:ci": "npm test && npm run test:example && npm run test:dependents",
"preversion": "git pull --rebase && npm run test:ci",

@@ -29,7 +30,8 @@ "prepublish": "npm run clean && npm run compile",

"dependencies": {
"lodash": "^3.10.1"
"lodash": "^4.17.2"
},
"devDependencies": {
"chai": "^3.3.0",
"coffee-script": "^1.10.0",
"chai": "^3.3.0",
"dont-break": "searls/dont-break",
"mocha": "^2.3.3",

@@ -36,0 +38,0 @@ "mocha-given": "^0.1.3",

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