New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mr

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mr - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

packages/q/queue.js

15

package.json
{
"name": "mr",
"version": "0.0.3",
"version": "0.0.4",
"main": "require",

@@ -8,9 +8,14 @@ "bin": {

},
"mappings": {
"q": {
"name": "q",
"location": "packages/q"
}
},
"dependencies": {
"q": "*",
"qs": "*"
"q": "0.8.x >=0.8.11"
},
"directories": {
"packages": "packages"
"devDependencies": {
"qs": "0.5.x"
}
}
{
"name": "q",
"version": "0.8.7",
"description": "A library for promises (CommonJS/Promises/A,B,D)",
"homepage": "http://github.com/kriskowal/q/",
"author": {
"name": "Kris Kowal",
"email": "kris@cixar.com",
"url": "http://github.com/kriskowal/"
},
"keywords": [
"q",
"promise",
"deferred",
"future",
"async",
"fluent",
"browser",
"node"
],
"contributors": [
{
"name": "Kris Kowal",
"email": "kris@cixar.com",
"url": "http://github.com/kriskowal/"
"name": "q",
"version": "0.8.11",
"description": "A library for promises (CommonJS/Promises/A,B,D)",
"homepage": "https://github.com/kriskowal/q",
"author": "Kris Kowal <kris@cixar.com> (https://github.com/kriskowal)",
"keywords": [
"q",
"promise",
"deferred",
"future",
"async",
"fluent",
"browser",
"node"
],
"contributors": [
"Kris Kowal <kris@cixar.com> (https://github.com/kriskowal)",
"Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)",
"Domenic Denicola <domenic@domenicdenicola.com> (http://domenicdenicola.com)"
],
"bugs": {
"mail": "kris@cixar.com",
"url": "http://github.com/kriskowal/q/issues"
},
{
"name": "Irakli Gozalishvili",
"email": "rfobic@gmail.com",
"url": "http://jeditoolkit.com"
"licenses": [
{
"type": "MIT",
"url": "http://github.com/kriskowal/q/raw/master/LICENSE"
}
],
"main": "q.js",
"repository": {
"type": "git",
"url": "git://github.com/kriskowal/q.git"
},
{
"name": "Domenic Denicola",
"email": "domenic@domenicdenicola.com",
"url": "http://domenicdenicola.com"
"engines": {
"node": ">=0.6.0",
"teleport": ">=0.2.0"
},
"dependencies": {},
"devDependencies": {
"jshint": ">=0.9.1",
"cover": "*",
"jasmine-node": "*",
"opener": "*"
},
"scripts": {
"test": "jasmine-node spec",
"test-browser": "opener spec/q-spec.html",
"lint": "jshint q.js",
"cover": "cover run node_modules/jasmine-node/bin/jasmine-node spec && cover report html && opener cover_html/index.html"
},
"overlay": {
"teleport": {
"dependencies": {
"system": ">=0.0.4"
}
}
},
"directories": {
"test": "./spec"
}
],
"bugs": {
"email": "kris@cixar.com",
"url": "http://github.com/kriskowal/q/issues"
},
"licenses": [
{
"type": "MIT",
"url": "http://github.com/kriskowal/q/raw/master/LICENSE"
}
],
"main": "q.js",
"repository": {
"type": "git",
"url": "git://github.com/kriskowal/q.git"
},
"engines": {
"node": ">=0.6.0",
"teleport": ">=0.2.0"
},
"dependencies": {},
"devDependencies": {
"jshint": ">=0.7.3",
"cover": "*",
"jasmine-node": "*",
"opener": "*"
},
"scripts": {
"test": "jasmine-node spec",
"test-browser": "opener spec/q-spec.html",
"lint": "jshint --show-non-errors q.js",
"cover": "cover run node_modules/jasmine-node/bin/jasmine-node spec && cover report html && opener cover_html/index.html"
},
"overlay": {
"teleport": {
"dependencies": {
"system": ">=0.0.4"
}
}
},
"directories": {
"test": "./spec"
},
"_npmUser": {
"name": "kriskowal",
"email": "kris.kowal@cixar.com"
},
"_id": "q@0.8.7",
"optionalDependencies": {},
"_engineSupported": true,
"_npmVersion": "1.1.21",
"_nodeVersion": "v0.6.17",
"_defaultsLoaded": true,
"_from": "q@*"
}
// vim:ts=4:sts=4:sw=4:
/*jshint browser: true, node: true,
curly: true, eqeqeq: true, noarg: true, nonew: true, trailing: true,
undef: true */
/*global define: false, Q: true, msSetImmediate: false, setImmediate: false,
ReturnValue: false, cajaVM: false, ses: false */
/*!

@@ -32,29 +27,2 @@ *

*
* With formatStackTrace and formatSourcePosition functions
* Copyright 2006-2008 the V8 project authors. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

@@ -128,8 +96,4 @@

nextTick = process.nextTick;
} else if (typeof msSetImmediate === "function") {
// IE 10 only, at the moment
// And yes, ``bind``ing to ``window`` is necessary O_o.
nextTick = msSetImmediate.bind(window);
} else if (typeof setImmediate === "function") {
// https://github.com/NobleJS/setImmediate
// In IE10, or use https://github.com/NobleJS/setImmediate
nextTick = setImmediate;

@@ -274,129 +238,51 @@ } else if (typeof MessageChannel !== "undefined") {

function formatStackTrace(error, frames) {
var lines = [];
try {
lines.push(error.toString());
} catch (e) {
try {
lines.push("<error: " + e + ">");
} catch (ee) {
lines.push("<error>");
}
}
for (var i = 0; i < frames.length; i++) {
var frame = frames[i];
var line;
var STACK_JUMP_SEPARATOR = "From previous event:";
// <Inserted by @domenic>
if (typeof frame === "string") {
lines.push(frame);
// </Inserted by @domenic>
} else {
try {
line = formatSourcePosition(frame);
} catch (e) {
try {
line = "<error: " + e + ">";
} catch (ee) {
// Any code that reaches this point is seriously nasty!
line = "<error>";
}
}
lines.push(" at " + line);
}
function makeStackTraceLong(error, promise) {
// If possible (that is, if in V8), transform the error stack
// trace by removing Node and Q cruft, then concatenating with
// the stack trace of the promise we are ``done``ing. See #57.
if (promise.stack &&
typeof error === "object" &&
error !== null &&
error.stack &&
error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
) {
error.stack = filterStackString(error.stack) +
"\n" + STACK_JUMP_SEPARATOR + "\n" +
filterStackString(promise.stack);
}
return lines.join("\n");
}
function formatSourcePosition(frame) {
var fileLocation = "";
if (frame.isNative()) {
fileLocation = "native";
} else if (frame.isEval()) {
fileLocation = "eval at " + frame.getEvalOrigin();
} else {
var fileName = frame.getFileName();
if (fileName) {
fileLocation += fileName;
var lineNumber = frame.getLineNumber();
if (lineNumber !== null) {
fileLocation += ":" + lineNumber;
var columnNumber = frame.getColumnNumber();
if (columnNumber) {
fileLocation += ":" + columnNumber;
}
}
function filterStackString(stackString) {
var lines = stackString.split("\n");
var desiredLines = [];
for (var i = 0; i < lines.length; ++i) {
var line = lines[i];
if (!isInternalFrame(line) && !isNodeFrame(line)) {
desiredLines.push(line);
}
}
if (!fileLocation) {
fileLocation = "unknown source";
}
var line = "";
var functionName = frame.getFunction().name;
var addPrefix = true;
var isConstructor = frame.isConstructor();
var isMethodCall = !(frame.isToplevel() || isConstructor);
if (isMethodCall) {
var methodName = frame.getMethodName();
line += frame.getTypeName() + ".";
if (functionName) {
line += functionName;
if (methodName && (methodName !== functionName)) {
line += " [as " + methodName + "]";
}
} else {
line += methodName || "<anonymous>";
}
} else if (isConstructor) {
line += "new " + (functionName || "<anonymous>");
} else if (functionName) {
line += functionName;
} else {
line += fileLocation;
addPrefix = false;
}
if (addPrefix) {
line += " (" + fileLocation + ")";
}
return line;
return desiredLines.join("\n");
}
function isInternalFrame(fileName, frame) {
if (fileName !== qFileName) {
return false;
}
var line = frame.getLineNumber();
return line >= qStartingLine && line <= qEndingLine;
function isNodeFrame(stackLine) {
return stackLine.indexOf("(module.js:") !== -1 ||
stackLine.indexOf("(node.js:") !== -1;
}
/*
* Retrieves an array of structured stack frames parsed from the ``stack``
* property of a given object.
*
* @param objectWithStack {Object} an object with a ``stack`` property: usually
* an error or promise.
*
* @returns an array of stack frame objects. For more information, see
* [V8's JavaScript stack trace API documentation](http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi).
*/
function getStackFrames(objectWithStack) {
var oldPrepareStackTrace = Error.prepareStackTrace;
function isInternalFrame(stackLine) {
var pieces = /at .+ \((.*):(\d+):\d+\)/.exec(stackLine);
Error.prepareStackTrace = function (error, frames) {
// Filter out frames from the innards of Node and Q.
return frames.filter(function (frame) {
var fileName = frame.getFileName();
return (
fileName !== "module.js" &&
fileName !== "node.js" &&
!isInternalFrame(fileName, frame)
);
});
};
if (!pieces) {
return false;
}
var stack = objectWithStack.stack;
var fileName = pieces[1];
var lineNumber = pieces[2];
Error.prepareStackTrace = oldPrepareStackTrace;
return stack;
return fileName === qFileName &&
lineNumber >= qStartingLine &&
lineNumber <= qEndingLine;
}

@@ -428,3 +314,3 @@

function deprecate(fn, name, alternative) {
function deprecate(callback, name, alternative) {
return function () {

@@ -434,3 +320,3 @@ if (typeof console !== "undefined" && typeof console.warn === "function") {

}
return fn.apply(fn, arguments);
return callback.apply(callback, arguments);
};

@@ -465,3 +351,3 @@ }

// resolved values and other promises gracefully.
var pending = [], value;
var pending = [], progressListeners = [], value;

@@ -471,6 +357,9 @@ var deferred = object_create(defer.prototype);

promise.promiseSend = function () {
promise.promiseSend = function (op, _, __, progress) {
var args = array_slice(arguments);
if (pending) {
pending.push(args);
if (op === "when" && progress) {
progressListeners.push(progress);
}
} else {

@@ -492,2 +381,7 @@ nextTick(function () {

Error.captureStackTrace(promise, defer);
// Reify the stack into a string by using the accessor; this prevents
// memory leaks as per GH-111. At the same time, cut off the first line;
// it's always just "[object Promise]\n", as per the `toString`.
promise.stack = promise.stack.substring(promise.stack.indexOf("\n") + 1);
}

@@ -506,3 +400,3 @@

pending = void 0;
return value;
progressListeners = void 0;
}

@@ -515,4 +409,13 @@

deferred.reject = function (exception) {
return become(reject(exception));
become(reject(exception));
};
deferred.notify = function (progress) {
if (pending) {
array_reduce(progressListeners, function (undefined, progressListener) {
nextTick(function () {
progressListener(progress);
});
}, void 0);
}
};

@@ -544,3 +447,3 @@ return deferred;

* @param makePromise {Function} a function that returns nothing and accepts
* the resolve and reject functions for a deferred.
* the resolve, reject, and notify functions for a deferred.
* @returns a promise that may be resolved with the given resolve and reject

@@ -555,3 +458,4 @@ * functions, or rejected by a thrown exception in makePromise

deferred.resolve,
deferred.reject
deferred.reject,
deferred.notify
).fail(deferred.reject);

@@ -594,3 +498,5 @@ return deferred.promise;

}
resolved(result);
if (resolved) {
resolved(result);
}
};

@@ -612,6 +518,10 @@

// provide thenables, CommonJS/Promises/A
makePromise.prototype.then = function (fulfilled, rejected) {
return when(this, fulfilled, rejected);
makePromise.prototype.then = function (fulfilled, rejected, progressed) {
return when(this, fulfilled, rejected, progressed);
};
makePromise.prototype.thenResolve = function (value) {
return when(this, function () { return value; });
};
// Chainable methods

@@ -630,3 +540,7 @@ array_reduce(

"timeout", "delay",
"catch", "finally", "fail", "fin", "end"
"catch", "finally", "fail", "fin", "progress", "end", "done",
"nfcall", "nfapply", "nfbind",
"ncall", "napply", "nbind",
"npost", "ninvoke",
"nend", "nodeify"
],

@@ -665,11 +579,6 @@ function (undefined, name) {

function valueOf(value) {
// if !Object.isObject(value)
// generates a known JSHint "constructor invocation without new" warning
// supposed to be fixed, but isn't? https://github.com/jshint/jshint/issues/392
/*jshint newcap: false */
if (Object(value) !== value) {
return value;
} else {
if (isPromise(value)) {
return value.valueOf();
}
return value;
}

@@ -714,8 +623,17 @@

var errors = [];
if (typeof window !== "undefined" && window.console) {
// This promise library consumes exceptions thrown in handlers so
// they can be handled by a subsequent promise. The rejected
// promises get added to this array when they are created, and
// removed when they are handled.
console.log("Should be empty:", errors);
var errorsDisplayed;
function displayErrors() {
if (
!errorsDisplayed &&
typeof window !== "undefined" &&
!window.Touch &&
window.console
) {
// This promise library consumes exceptions thrown in handlers so
// they can be handled by a subsequent promise. The rejected
// promises get added to this array when they are created, and
// removed when they are handled.
console.log("Should be empty:", errors);
}
errorsDisplayed = true;
}

@@ -748,2 +666,3 @@

// note that the error has not been handled
displayErrors();
rejections.push(rejection);

@@ -768,7 +687,16 @@ errors.push(exception);

}
// In order to break infinite recursion or loops between `then` and
// `resolve`, it is necessary to attempt to extract fulfilled values
// out of foreign promise implementations before attempting to wrap
// them as unresolved promises. It is my hope that other
// implementations will implement `valueOf` to synchronously extract
// the fulfillment value from their fulfilled promises. If the
// other promise library does not implement `valueOf`, the
// implementations on primordial prototypes are harmless.
object = valueOf(object);
// assimilate thenables, CommonJS/Promises/A
if (object && typeof object.then === "function") {
var result = defer();
object.then(result.resolve, result.reject);
return result.promise;
var deferred = defer();
object.then(deferred.resolve, deferred.reject, deferred.notify);
return deferred.promise;
}

@@ -783,6 +711,8 @@ return makePromise({

"put": function (name, value) {
return object[name] = value;
object[name] = value;
return object;
},
"del": function (name) {
return delete object[name];
delete object[name];
return object;
},

@@ -898,9 +828,10 @@ "post": function (name, value) {

*
* @param value promise or immediate reference to observe
* @param fulfilled function to be called with the fulfilled value
* @param rejected function to be called with the rejection exception
* @param value promise or immediate reference to observe
* @param fulfilled function to be called with the fulfilled value
* @param rejected function to be called with the rejection exception
* @param progressed function to be called on any progress notifications
* @return promise for the return value from the invoked callback
*/
exports.when = when;
function when(value, fulfilled, rejected) {
function when(value, fulfilled, rejected, progressed) {
var deferred = defer();

@@ -919,11 +850,20 @@ var done = false; // ensure the untrusted promise makes at most a

function _rejected(exception) {
try {
return rejected ? rejected(exception) : reject(exception);
} catch (newException) {
return reject(newException);
if (rejected) {
makeStackTraceLong(exception, resolvedValue);
try {
return rejected(exception);
} catch (newException) {
return reject(newException);
}
}
return reject(exception);
}
function _progressed(value) {
return progressed ? progressed(value) : value;
}
var resolvedValue = resolve(value);
nextTick(function () {
resolve(value).promiseSend("when", function (value) {
resolvedValue.promiseSend("when", function (value) {
if (done) {

@@ -945,2 +885,7 @@ return;

// Progress propagator need to be attached in the current tick.
resolvedValue.promiseSend("when", void 0, void 0, function (value) {
deferred.notify(_progressed(value));
});
return deferred.promise;

@@ -964,3 +909,3 @@ }

return fulfilled.apply(void 0, values);
});
}, rejected);
}, rejected);

@@ -1057,10 +1002,10 @@ }

*
* @param {function} fn The function to decorate
* @param {function} callback The function to decorate
* @returns {function} a function that has been decorated.
*/
exports.promised = promised;
function promised(fn) {
function promised(callback) {
return function () {
return all([this, all(arguments)]).spread(function (self, args) {
return fn.apply(self, args);
return callback.apply(self, args);
});

@@ -1344,2 +1289,15 @@ };

/**
* Attaches a listener that can respond to progress notifications from a
* promise's originating deferred. This listener receives the exact arguments
* passed to ``deferred.notify``.
* @param {Any*} promise for something
* @param {Function} callback to receive any progress notifications
* @returns the given promise, unchanged
*/
exports.progress = progress;
function progress(promise, progressed) {
return when(promise, void 0, void 0, progressed);
}
/**
* Provides an opportunity to observe the rejection of a promise,

@@ -1375,29 +1333,25 @@ * regardless of whether the promise is fulfilled or rejected. Forwards

*/
exports.end = end; // XXX stopgap
function end(promise) {
when(promise, void 0, function (error) {
exports.end = deprecate(done, "end", "done"); // XXX deprecated, use done
exports.done = done;
function done(promise, fulfilled, rejected, progress) {
function onUnhandledError(error) {
// forward to a future turn so that ``when``
// does not catch it and turn it into a rejection.
nextTick(function () {
// If possible (that is, if in V8), transform the error stack
// trace by removing Node and Q cruft, then concatenating with
// the stack trace of the promise we are ``end``ing. See #57.
var errorStackFrames;
if (
Error.captureStackTrace &&
typeof error === "object" &&
(errorStackFrames = getStackFrames(error))
) {
var promiseStackFrames = getStackFrames(promise);
makeStackTraceLong(error, promise);
var combinedStackFrames = errorStackFrames.concat(
"From previous event:",
promiseStackFrames
);
error.stack = formatStackTrace(error, combinedStackFrames);
if (exports.onerror) {
exports.onerror(error);
} else {
throw error;
}
});
}
throw error;
});
});
// Avoid unnecessary `nextTick`ing via an unnecessary `when`.
var promiseToHandle = fulfilled || rejected || progress ?
when(promise, fulfilled, rejected, progress) :
promise;
fail(promiseToHandle, onUnhandledError);
}

@@ -1423,3 +1377,7 @@

deferred.resolve(value);
}, deferred.reject);
}, function (exception) {
clearTimeout(timeoutId);
deferred.reject(exception);
});
return deferred.promise;

@@ -1450,2 +1408,64 @@ }

/**
* Passes a continuation to a Node function, which is called with the given
* arguments provided as an array, and returns a promise.
*
* var readFile = require("fs").readFile;
* Q.nfapply(readFile, [__filename])
* .then(function (content) {
* })
*
*/
exports.nfapply = nfapply;
function nfapply(callback, args) {
var nodeArgs = array_slice(args);
var deferred = defer();
nodeArgs.push(deferred.makeNodeResolver());
fapply(callback, nodeArgs).fail(deferred.reject);
return deferred.promise;
}
/**
* Passes a continuation to a Node function, which is called with the given
* arguments provided individually, and returns a promise.
*
* var readFile = require("fs").readFile;
* Q.nfcall(readFile, __filename)
* .then(function (content) {
* })
*
*/
exports.nfcall = nfcall;
function nfcall(callback/*, ...args */) {
var nodeArgs = array_slice(arguments, 1);
var deferred = defer();
nodeArgs.push(deferred.makeNodeResolver());
fapply(callback, nodeArgs).fail(deferred.reject);
return deferred.promise;
}
/**
* Wraps a NodeJS continuation passing function and returns an equivalent
* version that returns a promise.
*
* Q.nfbind(FS.readFile, __filename)("utf-8")
* .then(console.log)
* .done()
*
*/
exports.nfbind = nfbind;
function nfbind(callback/*, ...args */) {
var baseArgs = array_slice(arguments, 1);
return function () {
var nodeArgs = baseArgs.concat(array_slice(arguments));
var deferred = defer();
nodeArgs.push(deferred.makeNodeResolver());
fapply(callback, nodeArgs).fail(deferred.reject);
return deferred.promise;
};
}
/**
* Passes a continuation to a Node function, which is called with a given

@@ -1460,3 +1480,3 @@ * `this` value and arguments provided as an array, and returns a promise.

*/
exports.napply = napply;
exports.napply = deprecate(napply, "napply", "npost");
function napply(callback, thisp, args) {

@@ -1476,3 +1496,3 @@ return nbind(callback, thisp).apply(void 0, args);

*/
exports.ncall = ncall;
exports.ncall = deprecate(ncall, "ncall", "ninvoke");
function ncall(callback, thisp /*, ...args*/) {

@@ -1489,6 +1509,6 @@ var args = array_slice(arguments, 2);

* .then(console.log)
* .end()
* .done()
*
*/
exports.nbind = nbind;
exports.nbind = deprecate(nbind, "nbind", "nfbind");
function nbind(callback /* thisp, ...args*/) {

@@ -1528,3 +1548,8 @@ if (arguments.length > 1) {

function npost(object, name, args) {
return napply(object[name], object, args);
var nodeArgs = array_slice(args);
var deferred = defer();
nodeArgs.push(deferred.makeNodeResolver());
post(object, name, nodeArgs).fail(deferred.reject);
return deferred.promise;
}

@@ -1544,7 +1569,27 @@

function ninvoke(object, name /*, ...args*/) {
var args = array_slice(arguments, 2);
return napply(object[name], object, args);
var nodeArgs = array_slice(arguments, 2);
var deferred = defer();
nodeArgs.push(deferred.makeNodeResolver());
post(object, name, nodeArgs).fail(deferred.reject);
return deferred.promise;
}
defend(exports);
exports.nend = deprecate(nodeify, "nend", "nodeify"); // XXX deprecated, use nodeify
exports.nodeify = nodeify;
function nodeify(promise, nodeback) {
if (nodeback) {
promise.then(function (value) {
nextTick(function () {
nodeback(null, value);
});
}, function (error) {
nextTick(function () {
nodeback(error);
});
});
} else {
return promise;
}
}

@@ -1551,0 +1596,0 @@ // All code before this point will be filtered from stack traces.

@@ -218,2 +218,4 @@

var location = mapping.location;
if (!config.hasPackage(location))
continue;
var candidate = config.getPackage(location);

@@ -283,2 +285,6 @@ var id1 = candidate.identify(id2, require2, true);

require.hasPackage = function (dependency) {
return config.getPackage(dependency, config);
};
require.getPackage = function (dependency) {

@@ -366,2 +372,8 @@ return config.getPackage(dependency, config);

config.hasPackage = function (dependency) {
dependency = normalizeDependency(dependency, config);
var location = dependency.location;
return !!loadedPackages[location];
};
config.getPackage = function (dependency) {

@@ -525,3 +537,3 @@ dependency = normalizeDependency(dependency, config);

if (modules[""].redirect !== description.name) {
if (description.name !== modules[""].redirect) {
modules[description.name] = {

@@ -528,0 +540,0 @@ id: description.name,

@@ -53,3 +53,4 @@ /* <copyright>

"not-found",
"comments"
"comments",
"identify"
].forEach(function (test) {

@@ -56,0 +57,0 @@ it(test, function () {

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