rewire-6.0.0/ 0000755 0001750 0001750 00000000000 14157477202 012351 5 ustar nilesh nilesh rewire-6.0.0/.nycrc 0000644 0001750 0001750 00000000176 14157477202 013474 0 ustar nilesh nilesh {
"exclude": [
"lib/__get__.js",
"lib/__set__.js",
"lib/__with__.js",
"testLib/*"
]
}
rewire-6.0.0/testLib/ 0000755 0001750 0001750 00000000000 14157477202 013757 5 ustar nilesh nilesh rewire-6.0.0/testLib/module.coffee 0000644 0001750 0001750 00000000104 14157477202 016410 0 ustar nilesh nilesh fs = require "fs"
exports.readFileSync = () -> fs.readFileSync() rewire-6.0.0/testLib/.babelrc 0000644 0001750 0001750 00000000115 14157477202 015347 0 ustar nilesh nilesh {
"presets": ["es2015"],
"plugins": ["transform-class-properties"]
}
rewire-6.0.0/testLib/boolean.js 0000644 0001750 0001750 00000000027 14157477202 015733 0 ustar nilesh nilesh module.exports = true;
rewire-6.0.0/testLib/implicitGlobal.js 0000644 0001750 0001750 00000000311 14157477202 017243 0 ustar nilesh nilesh implicitGlobal = "this is an implicit global var ..." +
"yes, it's bad coding style but there are still some libs out there";
module.exports = function () {
return undefinedImplicitGlobal;
};
rewire-6.0.0/testLib/shebangModule.js 0000644 0001750 0001750 00000000134 14157477202 017070 0 ustar nilesh nilesh #!/usr/bin/env node
function shebangs() {
return true;
}
exports.shebangs = shebangs;
rewire-6.0.0/testLib/throwError.js 0000644 0001750 0001750 00000000331 14157477202 016467 0 ustar nilesh nilesh // Using deliberately const here because we know that we're transform const to let
const a = "a";
module.exports = function () {
// Ensure that column numbers are correct
const b = "b"; throw new Error();
};
rewire-6.0.0/testLib/null.js 0000644 0001750 0001750 00000000027 14157477202 015266 0 ustar nilesh nilesh module.exports = null;
rewire-6.0.0/testLib/wrongConstModule.js 0000644 0001750 0001750 00000000075 14157477202 017630 0 ustar nilesh nilesh // Assigning to a const should fail
const a = "a";
a = "b";
rewire-6.0.0/testLib/debuggerModule.js 0000644 0001750 0001750 00000000164 14157477202 017250 0 ustar nilesh nilesh "use strict"; // run code in ES5 strict mode
var myNumber = 0;
module.exports = function () {
myNumber = 1;
}; rewire-6.0.0/testLib/someOtherModule.js 0000644 0001750 0001750 00000000265 14157477202 017433 0 ustar nilesh nilesh "use strict"; // run code in ES5 strict mode
__filename = "/test/testModules/someOtherModule.js";
exports.fs = {};
exports.filename = __filename;
exports.name = "somOtherModule";
rewire-6.0.0/testLib/sealedObject.js 0000644 0001750 0001750 00000000067 14157477202 016704 0 ustar nilesh nilesh var obj = {};
Object.seal(obj);
module.exports = obj;
rewire-6.0.0/testLib/strictModule.js 0000644 0001750 0001750 00000000360 14157477202 016772 0 ustar nilesh nilesh "use strict"; // run code in ES5 strict mode
function doSomethingUnstrict() {
var caller = arguments.callee.caller; // this should throw an error as a proof that strict mode is on
}
exports.doSomethingUnstrict = doSomethingUnstrict; rewire-6.0.0/testLib/sharedTestCases.js 0000644 0001750 0001750 00000040412 14157477202 017403 0 ustar nilesh nilesh // Don't run code in ES5 strict mode.
// In case this module was in strict mode, all other modules called by this would also be strict.
// But when testing if the strict mode is preserved, we must ensure that this module is NOT strict.
// These shared test cases are used to check if the provided implementation of rewire is compatible
// with the original rewire. Since you can use rewire with client-side bundlers like webpack we need
// to test the implementation there again.
// @see https://github.com/jhnns/rewire-webpack
var expect = require("expect.js"),
rewire = require("rewire"),
__set__Src = require("../lib/__set__.js").toString(),
__get__Src = require("../lib/__get__.js").toString(),
__with__Src = require("../lib/__with__.js").toString();
var supportsObjectSpread = (function () {
try {
eval("({...{}})");
return true;
} catch (err) {
return false;
}
})();
var supportsObjectRest = (function () {
try {
eval("const {...a} = {}");
return true;
} catch (err) {
return false;
}
})();
function checkForTypeError(err) {
expect(err.constructor).to.be(TypeError);
}
module.exports = function () {
it("should work like require()", function () {
rewire("./moduleA.js").getFilename();
require("./moduleA.js").getFilename();
expect(rewire("./moduleA.js").getFilename()).to.eql(require("./moduleA.js").getFilename());
expect(rewire("../testLib/someOtherModule.js").filename).to.eql(require("../testLib/someOtherModule.js").filename);
});
it("should return a fresh instance of the module", function () {
var someOtherModule = require("./someOtherModule.js"),
rewiredSomeOtherModule;
someOtherModule.fs = "This has been modified";
rewiredSomeOtherModule = rewire("./someOtherModule.js");
expect(rewiredSomeOtherModule.fs).not.to.be("This has been modified");
});
it("should not cache the rewired module", function () {
var rewired,
someOtherModule = require("./someOtherModule.js");
someOtherModule.fs = "This has been changed";
rewired = rewire("./someOtherModule.js");
expect(someOtherModule).not.to.be(rewired);
expect(require("./moduleA.js").someOtherModule).not.to.be(rewired);
expect(require("./moduleA.js").someOtherModule).to.be(someOtherModule);
expect(require("./moduleA.js").someOtherModule.fs).to.be("This has been changed");
});
// By comparing the src we can ensure that the provided __set__ function is our tested implementation
it("should modify the module so it provides the __set__ - function", function () {
expect(rewire("./moduleA.js").__set__.toString()).to.be(__set__Src);
expect(rewire("./moduleB.js").__set__.toString()).to.be(__set__Src);
});
// By comparing the src we can ensure that the provided __set__ function is our tested implementation
it("should modify the module so it provides the __get__ - function", function () {
expect(rewire("./moduleA.js").__get__.toString()).to.be(__get__Src);
expect(rewire("./moduleB.js").__get__.toString()).to.be(__get__Src);
});
// By comparing the src we can ensure that the provided __set__ function is our tested implementation
it("should modify the module so it provides the __with__ - function", function () {
expect(rewire("./moduleA.js").__with__.toString()).to.be(__with__Src);
expect(rewire("./moduleB.js").__with__.toString()).to.be(__with__Src);
});
["__get__", "__set__", "__with__"].forEach(function(funcName) {
it("should provide " + funcName + " as a non-enumerable property", function () {
expect(Object.keys(rewire("./moduleA.js")).indexOf(funcName)).to.be(-1);
});
it("should provide " + funcName + " as a writable property", function () {
var obj = rewire("./moduleA.js");
var desc = Object.getOwnPropertyDescriptor(obj, funcName);
expect(desc.writable).to.be(true);
});
});
it("should not influence other modules", function () {
rewire("./moduleA.js");
expect(require("./someOtherModule.js").__set__).to.be(undefined);
expect(require("./someOtherModule.js").__get__).to.be(undefined);
expect(require("./someOtherModule.js").__with__).to.be(undefined);
});
it("should not override/influence global objects by default", function () {
// This should throw no exception
rewire("./moduleA.js").checkSomeGlobals();
rewire("./moduleB.js").checkSomeGlobals();
});
// This is just an integration test for the __set__ method
// You can find a full test for __set__ under /test/__set__.test.js
it("should provide a working __set__ method", function () {
var rewiredModuleA = rewire("./moduleA.js"),
newObj = {};
expect(rewiredModuleA.getMyNumber()).to.be(0);
rewiredModuleA.__set__("myNumber", 2);
expect(rewiredModuleA.getMyNumber()).to.be(2);
rewiredModuleA.__set__("myObj", newObj);
expect(rewiredModuleA.getMyObj()).to.be(newObj);
rewiredModuleA.__set__("env", "ENVENV");
});
// This is just an integration test for the __get__ method
// You can find a full test for __get__ under /test/__get__.test.js
it("should provide a working __get__ method", function () {
var rewiredModuleA = rewire("./moduleA.js");
expect(rewiredModuleA.__get__("myNumber")).to.be(rewiredModuleA.getMyNumber());
expect(rewiredModuleA.__get__("myObj")).to.be(rewiredModuleA.getMyObj());
});
// This is just an integration test for the __with__ method
// You can find a full test for __with__ under /test/__with__.test.js
it("should provide a working __with__ method", function () {
var rewiredModuleA = rewire("./moduleA.js"),
newObj = {};
expect(rewiredModuleA.getMyNumber()).to.be(0);
expect(rewiredModuleA.getMyObj()).to.not.be(newObj);
rewiredModuleA.__with__({
myNumber: 2,
myObj: newObj
})(function () {
expect(rewiredModuleA.getMyNumber()).to.be(2);
expect(rewiredModuleA.getMyObj()).to.be(newObj);
});
expect(rewiredModuleA.getMyNumber()).to.be(0);
expect(rewiredModuleA.getMyObj()).to.not.be(newObj);
});
it("should provide the ability to inject mocks", function (done) {
var rewiredModuleA = rewire("./moduleA.js"),
mockedFs = {
readFileSync: function (file) {
expect(file).to.be("bla.txt");
done();
}
};
rewiredModuleA.__set__("fs", mockedFs);
rewiredModuleA.readFileSync();
});
it("should not influence other modules when injecting mocks", function () {
var rewiredModuleA = rewire("./moduleA.js"),
someOtherModule,
mockedFs = {};
rewiredModuleA.__set__("fs", mockedFs);
someOtherModule = require("./someOtherModule.js");
expect(someOtherModule.fs).not.to.be(mockedFs);
});
it("should provide the ability to mock global objects just within the module", function () {
var rewiredModuleA = rewire("./moduleA.js"),
rewiredModuleB = rewire("./moduleB.js"),
consoleMock = {},
bufferMock = {},
documentMock = {},
newFilename = "myFile.js";
rewiredModuleA.__set__({
console: consoleMock,
__filename: newFilename
});
expect(rewiredModuleA.getConsole()).to.be(consoleMock);
expect(rewiredModuleB.getConsole()).not.to.be(consoleMock);
expect(console).not.to.be(consoleMock);
expect(rewiredModuleA.getFilename()).to.be(newFilename);
expect(rewiredModuleB.getFilename()).not.to.be(newFilename);
expect(console).not.to.be(newFilename);
if (typeof window === "undefined") {
rewiredModuleA.__set__("Buffer", bufferMock);
expect(rewiredModuleA.getBuffer()).to.be(bufferMock);
expect(rewiredModuleB.getBuffer()).not.to.be(bufferMock);
expect(Buffer).not.to.be(bufferMock);
} else {
rewiredModuleA.__set__("document", documentMock);
expect(rewiredModuleA.getDocument()).to.be(documentMock);
expect(rewiredModuleB.getDocument() === documentMock).to.be(false);
expect(document === documentMock).to.be(false);
}
});
it("should be possible to mock global objects that are added on runtime", function () {
var rewiredModule;
if (typeof window === "undefined") {
global.someGlobalVar = "test";
rewiredModule = rewire("./moduleA.js");
rewiredModule.__set__("someGlobalVar", "other value");
expect(global.someGlobalVar).to.be("test");
expect(rewiredModule.__get__("someGlobalVar")).to.be("other value");
delete global.someGlobalVar;
} else {
window.someGlobalVar = "test";
rewiredModule = rewire("./moduleA.js");
rewiredModule.__set__("someGlobalVar", "other value");
expect(window.someGlobalVar).to.be("test");
expect(rewiredModule.__get__("someGlobalVar")).to.be("other value");
if (typeof navigator !== "undefined" && /MSIE [6-8]\.[0-9]/g.test(navigator.userAgent) === false) {
delete window.someGlobalVar;
}
}
});
it("should not be a problem to have a comment on file end", function () {
var rewired = rewire("./emptyModule.js");
rewired.__set__("someVar", "hello");
expect(rewired.__get__("someVar")).to.be("hello");
});
it("should not be a problem to have a module that exports a boolean", function( ) {
rewire("./boolean.js"); // should not throw
});
it("should not be a problem to have a module that exports null", function () {
rewire("./null.js"); // should not throw
});
it("should not be a problem to have a module that exports a sealed object", function () {
rewire("./sealedObject.js"); // should not throw
});
(supportsObjectSpread ? it : it.skip)("should not be a problem to have a module that uses object spread operator", function () {
rewire("./objectSpreadOperator.js"); // should not throw
});
(supportsObjectRest ? it : it.skip)("should not be a problem to have a module that uses object rest operator", function () {
rewire("./objectRestOperator.js"); // should not throw
});
it("should not influence the original require if nothing has been required within the rewired module", function () {
rewire("./emptyModule.js"); // nothing happens here because emptyModule doesn't require anything
expect(require("./moduleA.js").__set__).to.be(undefined); // if restoring the original node require didn't worked, the module would have a setter
});
it("subsequent calls of rewire should always return a new instance", function () {
expect(rewire("./moduleA.js")).not.to.be(rewire("./moduleA.js"));
});
it("should preserve the strict mode", function () {
var strictModule = rewire("./strictModule.js");
expect(function () {
strictModule.doSomethingUnstrict();
}).to.throwException(checkForTypeError);
});
it("should not modify line numbers in stack traces", function () {
var throwError = rewire("./throwError.js");
try {
throwError();
} catch (err) {
// Firefox implements a different error-stack format,
// but does offer line and column numbers on errors: we use
// those instead.
if (err.lineNumber !== undefined && err.columnNumber !== undefined) {
expect(err.lineNumber).to.equal(6)
expect(err.columnNumber).to.equal(26)
}
// This is for the V8 stack trace format (Node, Chrome)
else {
expect(err.stack.split("\n")[1]).to.match(/:6:26/);
}
}
});
it("should be possible to set implicit globals", function () {
var implicitGlobalModule,
err;
try {
implicitGlobalModule = rewire("./implicitGlobal.js");
implicitGlobalModule.__set__("implicitGlobal", true);
expect(implicitGlobalModule.__get__("implicitGlobal")).to.be(true);
// setting implicit global vars will change them globally instead of locally.
// that's a shortcoming of the current implementation which can't be solved easily.
//expect(implicitGlobal).to.be.a("string");
} catch (e) {
err = e;
} finally {
// Cleaning up...
delete global.implicitGlobal;
delete global.undefinedImplicitGlobal;
}
if (err) {
throw err;
}
});
it("should throw a TypeError if the path is not a string", function () {
expect(function () {
rewire(null);
}).to.throwException(checkForTypeError);
});
it("should also revert nested changes (with dot notation)", function () {
var rewiredModuleA = rewire("./moduleA.js"),
revert;
revert = rewiredModuleA.__set__("myObj.test", true);
expect(rewiredModuleA.getMyObj()).to.eql({
test: true
});
revert();
// This test also demonstrates a known drawback of the current implementation
// If the value doesn't exist at the time it is about to be set, it will be
// reverted to undefined instead deleting it from the object
// However, this is probably not a real world use-case because why would you
// want to mock something when it is not set.
expect(rewiredModuleA.getMyObj()).to.eql({
test: undefined
});
revert = rewiredModuleA.__set__({
"myObj.test": true
});
expect(rewiredModuleA.getMyObj()).to.eql({
test: true
});
revert();
expect(rewiredModuleA.getMyObj()).to.eql({
test: undefined
});
});
it("should be possible to mock undefined, implicit globals", function () {
var implicitGlobalModule,
err;
try {
implicitGlobalModule = rewire("./implicitGlobal.js");
implicitGlobalModule.__set__("undefinedImplicitGlobal", "yoo!");
expect(implicitGlobalModule.__get__("undefinedImplicitGlobal")).to.equal("yoo!");
implicitGlobalModule = rewire("./implicitGlobal.js");
implicitGlobalModule.__set__({
undefinedImplicitGlobal: "bro!"
});
expect(implicitGlobalModule.__get__("undefinedImplicitGlobal")).to.equal("bro!");
} catch (e) {
err = e;
} finally {
// Cleaning up...
delete global.implicitGlobal;
delete global.undefinedImplicitGlobal;
}
if (err) {
throw err;
}
});
it("should be possible to mock and revert JSON.parse (see #40)", function () {
var moduleA = rewire("./moduleA.js"),
revert;
revert = moduleA.__set__({
JSON: {
parse: function () { return true; }
}
});
revert();
});
it("should be possible to set a const variable", function () {
var constModule = rewire("./constModule");
var varNames = Object.keys(constModule);
expect(varNames.length).to.be.greaterThan(0);
varNames.forEach(varName => {
constModule.__set__(varName, "this has been changed"); // should not throw
expect(constModule[varName]()).to.equal("this has been changed");
});
});
it("should fail with a helpful TypeError when const is re-assigned", function () {
expect(function () {
rewire("./wrongConstModule");
}).to.throwException(/^Assignment to constant variable at .+?wrongConstModule\.js:4:1$/);
});
it("should be possible to rewire shebang modules", function () {
var shebangModule = rewire("./shebangModule");
var shebangs = shebangModule.__get__("shebangs");
expect(typeof shebangs).to.be("function");
expect(shebangModule.shebangs()).to.be(true);
});
};
rewire-6.0.0/testLib/objectSpreadOperator.js 0000644 0001750 0001750 00000000034 14157477202 020433 0 ustar nilesh nilesh module.exports = { ...{} };
rewire-6.0.0/testLib/emptyModule.js 0000644 0001750 0001750 00000000162 14157477202 016620 0 ustar nilesh nilesh "use strict"; // run code in ES5 strict mode
var someVar;
// Comment on file end. Hope this won't break anything rewire-6.0.0/testLib/objectRestOperator.js 0000644 0001750 0001750 00000000047 14157477202 020136 0 ustar nilesh nilesh let { ...a } = {};
module.exports = a;
rewire-6.0.0/testLib/node_modules/ 0000755 0001750 0001750 00000000000 14157477202 016434 5 ustar nilesh nilesh rewire-6.0.0/testLib/node_modules/rewire/ 0000755 0001750 0001750 00000000000 14157477202 017731 5 ustar nilesh nilesh rewire-6.0.0/testLib/node_modules/rewire/package.json 0000644 0001750 0001750 00000000050 14157477202 022212 0 ustar nilesh nilesh {
"main": "../../../lib/index.js"
}
rewire-6.0.0/testLib/moduleA.js 0000644 0001750 0001750 00000007554 14157477202 015716 0 ustar nilesh nilesh "use strict"; // run code in ES5 strict mode
var someOtherModule = require("./someOtherModule.js"),
myNumber = 0, // copy by value
myObj = {}, // copy by reference
env = "bla",
fs;
// We need getters and setters for private vars to check if our injected setters and getters actual work
function setMyNumber(newNumber) {
myNumber = newNumber;
}
function getMyNumber() {
return myNumber;
}
function setMyObj(newObj) {
myObj = newObj;
}
function getMyObj() {
return myObj;
}
function readFileSync() {
fs.readFileSync("bla.txt", "utf8");
}
function checkSomeGlobals() {
var isLowerIE,
typeOfGlobalFunc;
if (typeof navigator !== "undefined") {
isLowerIE = /MSIE [6-8]\.[0-9]/g.test(navigator.userAgent);
}
if (isLowerIE) {
typeOfGlobalFunc = "object";
} else {
typeOfGlobalFunc = "function";
}
if (typeof global !== "object") {
throw new ReferenceError("global is not an object");
}
if (typeof console !== "object") {
throw new ReferenceError("console is not an object");
}
if (typeof require !== "function") {
throw new ReferenceError("require is not a function");
}
if (typeof module !== "object") {
throw new ReferenceError("module is not an object");
}
if (typeof exports !== "object") {
throw new ReferenceError("exports is not an object");
}
if (module.exports !== exports) {
throw new Error("module.exports === exports returns false");
}
if (typeof __dirname !== "string") {
throw new ReferenceError("__dirname is not a string");
}
if (typeof __filename !== "string") {
throw new ReferenceError("__filename is not a string");
}
if (typeof setTimeout !== typeOfGlobalFunc) {
throw new ReferenceError("setTimeout is not a function");
}
if (typeof clearTimeout !== typeOfGlobalFunc) {
throw new ReferenceError("clearTimeout is not a function");
}
if (typeof setInterval !== typeOfGlobalFunc) {
throw new ReferenceError("setInterval is not a function");
}
if (typeof clearInterval !== typeOfGlobalFunc) {
throw new ReferenceError("clearInterval is not a function");
}
if (typeof Error !== "function") {
throw new ReferenceError("Error is not a function");
}
if (typeof parseFloat !== "function") {
throw new ReferenceError("parseFloat is not a function");
}
if (typeof parseInt !== "function") {
throw new ReferenceError("parseInt is not a function");
}
if (typeof window === "undefined") {
if (typeof process !== "object") {
throw new ReferenceError("process is not an object");
}
if (typeof Buffer !== "function") {
throw new ReferenceError("Buffer is not a function");
}
} else {
if (typeof encodeURIComponent !== "function") {
throw new ReferenceError("encodeURIComponent is not a function");
}
if (typeof decodeURIComponent !== "function") {
throw new ReferenceError("decodeURIComponent is not a function");
}
if (typeof document !== "object") {
throw new ReferenceError("document is not an object");
}
}
}
function getConsole() {
return console;
}
function getFilename() {
return __filename;
}
function getBuffer() {
return Buffer;
}
function getDocument() {
return document;
}
// different styles of exports in moduleA.js and moduleB.js
exports.setMyNumber = setMyNumber;
exports.getMyNumber = getMyNumber;
exports.setMyObj = setMyObj;
exports.getMyObj = getMyObj;
exports.readFileSync = readFileSync;
exports.checkSomeGlobals = checkSomeGlobals;
exports.getConsole = getConsole;
exports.getFilename = getFilename;
exports.getBuffer = getBuffer;
exports.getDocument = getDocument;
exports.someOtherModule = someOtherModule; rewire-6.0.0/testLib/constModule.js 0000644 0001750 0001750 00000001660 14157477202 016614 0 ustar nilesh nilesh const j = "j"; // At the beginning of the file
// This module contains some weird combinations where valid const declarations could appear.
// Syntax oddities are totally on purpose here.
const a = require("./someOtherModule");const b = "b"; const e = "e"
const c = "c";
{}const d = "d";
const f = "f"; // there's an irregular whitespace before and after const
const
g = "g";
const/*wtf this is valid*/h = "h";
const /*and this is also*/i = "i";
const{k} = {k: "k"};
exports.a = function () {
return a;
};
exports.b = function () {
return b;
};
exports.c = function () {
return c;
};
exports.d = function () {
return d;
};
exports.e = function () {
return e;
};
exports.f = function () {
return f;
};
exports.g = function () {
return g;
};
exports.h = function () {
return h;
};
exports.i = function () {
return i;
};
exports.j = function () {
return j;
};
exports.k = function () {
return k;
};
rewire-6.0.0/testLib/moduleB.js 0000644 0001750 0001750 00000007512 14157477202 015711 0 ustar nilesh nilesh "use strict"; // run code in ES5 strict mode
var someOtherModule = require("./someOtherModule.js"),
myNumber = 0, // copy by value
myObj = {}, // copy by reference
env = "bla",
fs;
// We need getters and setters for private vars to check if our injected setters and getters actual work
function setMyNumber(newNumber) {
myNumber = newNumber;
}
function getMyNumber() {
return myNumber;
}
function setMyObj(newObj) {
myObj = newObj;
}
function getMyObj() {
return myObj;
}
function readFileSync() {
fs.readFileSync("bla.txt", "utf8");
}
function checkSomeGlobals() {
var isLowerIE,
typeOfGlobalFunc;
if (typeof navigator !== "undefined") {
isLowerIE = /MSIE [6-8]\.[0-9]/g.test(navigator.userAgent);
}
if (isLowerIE) {
typeOfGlobalFunc = "object";
} else {
typeOfGlobalFunc = "function";
}
if (typeof global !== "object") {
throw new ReferenceError("global is not an object");
}
if (typeof console !== "object") {
throw new ReferenceError("console is not an object");
}
if (typeof require !== "function") {
throw new ReferenceError("require is not a function");
}
if (typeof module !== "object") {
throw new ReferenceError("module is not an object");
}
if (typeof exports !== "object") {
throw new ReferenceError("exports is not an object");
}
if (module.exports === exports) {
throw new Error("module.exports === exports returns true");
}
if (typeof __dirname !== "string") {
throw new ReferenceError("__dirname is not a string");
}
if (typeof __filename !== "string") {
throw new ReferenceError("__filename is not a string");
}
if (typeof setTimeout !== typeOfGlobalFunc) {
throw new ReferenceError("setTimeout is not a function");
}
if (typeof clearTimeout !== typeOfGlobalFunc) {
throw new ReferenceError("clearTimeout is not a function");
}
if (typeof setInterval !== typeOfGlobalFunc) {
throw new ReferenceError("setInterval is not a function");
}
if (typeof clearInterval !== typeOfGlobalFunc) {
throw new ReferenceError("clearInterval is not a function");
}
if (typeof Error !== "function") {
throw new ReferenceError("Error is not a function");
}
if (typeof parseFloat !== "function") {
throw new ReferenceError("parseFloat is not a function");
}
if (typeof parseInt !== "function") {
throw new ReferenceError("parseInt is not a function");
}
if (typeof window === "undefined") {
if (typeof process !== "object") {
throw new ReferenceError("process is not an object");
}
if (typeof Buffer !== "function") {
throw new ReferenceError("Buffer is not a function");
}
} else {
if (typeof encodeURIComponent !== "function") {
throw new ReferenceError("encodeURIComponent is not a function");
}
if (typeof decodeURIComponent !== "function") {
throw new ReferenceError("decodeURIComponent is not a function");
}
if (typeof document !== "object") {
throw new ReferenceError("document is not an object");
}
}
}
function getConsole() {
return console;
}
function getFilename() {
return __filename;
}
function getBuffer() {
return Buffer;
}
function getDocument() {
return document;
}
// different styles of exports in moduleA.js and moduleB.js
module.exports = {
setMyNumber: setMyNumber,
getMyNumber: getMyNumber,
setMyObj: setMyObj,
getMyObj: getMyObj,
readFileSync: readFileSync,
checkSomeGlobals: checkSomeGlobals,
getConsole: getConsole,
getFilename: getFilename,
getBuffer: getBuffer,
getDocument: getDocument,
someOtherModule: someOtherModule
};
rewire-6.0.0/README.md 0000644 0001750 0001750 00000017234 14157477202 013637 0 ustar nilesh nilesh rewire
======
**Easy monkey-patching for node.js unit tests**
[](https://www.npmjs.com/package/rewire)
[](https://www.npmjs.com/package/rewire)
[](https://david-dm.org/jhnns/rewire)
[](https://travis-ci.org/jhnns/rewire)
[](https://coveralls.io/r/jhnns/rewire?branch=master)
rewire adds a special setter and getter to modules so you can modify their behaviour for better unit testing. You may
- inject mocks for other modules or globals like `process`
- inspect private variables
- override variables within the module.
**Please note:** The current version of rewire is only compatible with CommonJS modules. See [Limitations](https://github.com/jhnns/rewire#limitations).
Installation
------------
`npm install rewire`
Introduction
------------
Imagine you want to test this module:
```javascript
// lib/myModule.js
// With rewire you can change all these variables
var fs = require("fs"),
path = "/somewhere/on/the/disk";
function readSomethingFromFileSystem(cb) {
console.log("Reading from file system ...");
fs.readFile(path, "utf8", cb);
}
exports.readSomethingFromFileSystem = readSomethingFromFileSystem;
```
Now within your test module:
```javascript
// test/myModule.test.js
var rewire = require("rewire");
var myModule = rewire("../lib/myModule.js");
```
rewire acts exactly like require. With just one difference: Your module will now export a special setter and getter for private variables.
```javascript
myModule.__set__("path", "/dev/null");
myModule.__get__("path"); // = '/dev/null'
```
This allows you to mock everything in the top-level scope of the module, like the fs module for example. Just pass the variable name as first parameter and your mock as second.
```javascript
var fsMock = {
readFile: function (path, encoding, cb) {
expect(path).to.equal("/somewhere/on/the/disk");
cb(null, "Success!");
}
};
myModule.__set__("fs", fsMock);
myModule.readSomethingFromFileSystem(function (err, data) {
console.log(data); // = Success!
});
```
You can also set multiple variables with one call.
```javascript
myModule.__set__({
fs: fsMock,
path: "/dev/null"
});
```
You may also override globals. These changes are only within the module, so you don't have to be concerned that other modules are influenced by your mock.
```javascript
myModule.__set__({
console: {
log: function () { /* be quiet */ }
},
process: {
argv: ["testArg1", "testArg2"]
}
});
```
`__set__` returns a function which reverts the changes introduced by this particular `__set__` call
```javascript
var revert = myModule.__set__("port", 3000);
// port is now 3000
revert();
// port is now the previous value
```
For your convenience you can also use the `__with__` method which reverts the given changes after it finished.
```javascript
myModule.__with__({
port: 3000
})(function () {
// within this function port is 3000
});
// now port is the previous value again
```
The `__with__` method is also aware of promises. If a thenable is returned all changes stay until the promise has either been resolved or rejected.
```javascript
myModule.__with__({
port: 3000
})(function () {
return new Promise(...);
}).then(function () {
// now port is the previous value again
});
// port is still 3000 here because the promise hasn't been resolved yet
```
Limitations
-----------
**Babel's ES module emulation**
During the transpilation step from ESM to CJS modules, Babel renames internal variables. Rewire will not work in these cases (see [#62](https://github.com/jhnns/rewire/issues/62)). Other Babel transforms, however, should be fine. Another solution might be switching to [babel-plugin-rewire](https://github.com/speedskater/babel-plugin-rewire).
**Variables inside functions**
Variables inside functions can not be changed by rewire. This is constrained by the language.
```javascript
// myModule.js
(function () {
// Can't be changed by rewire
var someVariable;
})()
```
**Modules that export primitives**
rewire is not able to attach the `__set__`- and `__get__`-method if your module is just exporting a primitive. Rewiring does not work in this case.
```javascript
// Will throw an error if it's loaded with rewire()
module.exports = 2;
```
**Globals with invalid variable names**
rewire imports global variables into the local scope by prepending a list of `var` declarations:
```javascript
var someGlobalVar = global.someGlobalVar;
```
If `someGlobalVar` is not a valid variable name, rewire just ignores it. **In this case you're not able to override the global variable locally**.
**Special globals**
Please be aware that you can't rewire `eval()` or the global object itself.
API
---
### rewire(filename: String): rewiredModule
Returns a rewired version of the module found at `filename`. Use `rewire()` exactly like `require()`.
### rewiredModule.__set__(name: String, value: *): Function
Sets the internal variable `name` to the given `value`. Returns a function which can be called to revert the change.
### rewiredModule.__set__(obj: Object): Function
Takes all enumerable keys of `obj` as variable names and sets the values respectively. Returns a function which can be called to revert the change.
### rewiredModule.__get__(name: String): *
Returns the private variable with the given `name`.
### rewiredModule.__with__(obj: Object): Function<callback: Function>
Returns a function which - when being called - sets `obj`, executes the given `callback` and reverts `obj`. If `callback` returns a promise, `obj` is only reverted after the promise has been resolved or rejected. For your convenience the returned function passes the received promise through.
Caveats
-------
**Difference to require()**
Every call of rewire() executes the module again and returns a fresh instance.
```javascript
rewire("./myModule.js") === rewire("./myModule.js"); // = false
```
This can especially be a problem if the module is not idempotent [like mongoose models](https://github.com/jhnns/rewire/issues/27).
**Globals are imported into the module's scope at the time of rewiring**
Since rewire imports all gobals into the module's scope at the time of rewiring, property changes on the `global` object after that are not recognized anymore. This is a [problem when using sinon's fake timers *after* you've called `rewire()`](http://stackoverflow.com/questions/34885024/when-using-rewire-and-sinon-faketimer-order-matters/36025128).
**Dot notation**
Although it is possible to use dot notation when calling `__set__`, it is strongly discouraged in most cases. For instance, writing `myModule.__set__("console.log", fn)` is effectively the same as just writing `console.log = fn`. It would be better to write:
```javascript
myModule.__set__("console", {
log: function () {}
});
```
This replaces `console` just inside `myModule`. That is, because rewire is using `eval()` to turn the key expression into an assignment. Hence, calling `myModule.__set__("console.log", fn)` modifies the `log` function on the *global* `console` object.
webpack
-------
See [rewire-webpack](https://github.com/jhnns/rewire-webpack)
CoffeeScript
------------
Good news to all caffeine-addicts: rewire works also with [Coffee-Script](http://coffeescript.org/). Note that in this case you need to install the `coffeescript` package.
## License
MIT
rewire-6.0.0/.jshintignore 0000644 0001750 0001750 00000000344 14157477202 015056 0 ustar nilesh nilesh lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
logs
results
npm-debug.log
/node_modules
/coverage
/examples
/.idea
/lib/__get__.js
/lib/__set__.js
/test/testModules/strictModule.js
/test/testModules/someOtherModule.js rewire-6.0.0/.npmignore 0000644 0001750 0001750 00000000203 14157477202 014343 0 ustar nilesh nilesh lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
logs
results
npm-debug.log
/node_modules
/coverage
/examples
/.idea
/test
rewire-6.0.0/.editorconfig 0000644 0001750 0001750 00000000520 14157477202 015023 0 ustar nilesh nilesh # This file is for unifying the coding style for different editors and IDEs.
# More information at http://EditorConfig.org
# No .editorconfig files above the root directory
root = true
[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[package.json]
indent_size = 2
rewire-6.0.0/.gitignore 0000644 0001750 0001750 00000000212 14157477202 014334 0 ustar nilesh nilesh lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
logs
results
npm-debug.log
/node_modules
/coverage
/examples
/.idea
.nyc_output
rewire-6.0.0/package.json 0000644 0001750 0001750 00000001670 14157477202 014643 0 ustar nilesh nilesh {
"name": "rewire",
"version": "5.0.0",
"description": "Easy dependency injection for node.js unit testing",
"keywords": [
"dependency",
"injection",
"mock",
"shim",
"module",
"unit",
"test",
"leak",
"inspect",
"fake",
"require"
],
"author": {
"name": "Johannes Ewald",
"email": "mail@johannesewald.de"
},
"main": "lib/index.js",
"homepage": "https://github.com/jhnns/rewire",
"bugs": {
"url": "https://github.com/jhnns/rewire/issues",
"email": "mail@johannesewald.de"
},
"repository": {
"type": "git",
"url": "git://github.com/jhnns/rewire.git"
},
"devDependencies": {
"coffeescript": "^2.1.1",
"expect.js": "^0.3.1",
"mocha": "^9.1.2",
"nyc": "^15.1.0",
"rewire": "file://."
},
"license": "MIT",
"scripts": {
"test": "nyc --reporter=html --reporter=lcov mocha -R spec"
},
"dependencies": {
"eslint": "^7.32.0"
}
}
rewire-6.0.0/LICENSE 0000644 0001750 0001750 00000002042 14157477202 013354 0 ustar nilesh nilesh Copyright (c) 2012 Johannes Ewald
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
rewire-6.0.0/lib/ 0000755 0001750 0001750 00000000000 14157477202 013117 5 ustar nilesh nilesh rewire-6.0.0/lib/detectStrictMode.js 0000644 0001750 0001750 00000001416 14157477202 016725 0 ustar nilesh nilesh var multiLineComment = /^\s*\/\*.*?\*\//;
var singleLineComment = /^\s*\/\/.*?[\r\n]/;
var strictMode = /^\s*(?:"use strict"|'use strict')[ \t]*(?:[\r\n]|;)/;
/**
* Returns true if the source code is intended to run in strict mode. Does not detect
* "use strict" if it occurs in a nested function.
*
* @param {String} src
* @return {Boolean}
*/
function detectStrictMode(src) {
var singleLine;
var multiLine;
while ((singleLine = singleLineComment.test(src)) || (multiLine = multiLineComment.test(src))) {
if (singleLine) {
src = src.replace(singleLineComment, "");
}
if (multiLine) {
src = src.replace(multiLineComment, "");
}
}
return strictMode.test(src);
}
module.exports = detectStrictMode;
rewire-6.0.0/lib/moduleEnv.js 0000644 0001750 0001750 00000013647 14157477202 015426 0 ustar nilesh nilesh "use strict";
// TODO: Use https://www.npmjs.com/package/pirates here?
var Module = require("module"),
fs = require("fs"),
eslint = require("eslint"),
coffee;
var moduleWrapper0 = Module.wrapper[0],
moduleWrapper1 = Module.wrapper[1],
originalExtensions = {},
linter = new eslint.Linter(),
eslintOptions = {
env: {
es6: true,
},
parserOptions: {
ecmaVersion: 6,
ecmaFeatures: {
globalReturn: true,
jsx: true,
experimentalObjectRestSpread: true
},
},
rules: {
"no-const-assign": 2
}
},
// The following regular expression is used to replace const declarations with let.
// This regex replacement is not 100% safe because transforming JavaScript requires an actual parser.
// However, parsing (e.g. via babel) comes with its own problems because now the parser needs to
// be aware of syntax extensions which might not be supported by the parser, but the underlying
// JavaScript engine. In fact, rewire used to have babel in place here but required an extra
// transform for the object spread operator (check out commit d9a81c0cdacf6995b24d205b4a2068adbd8b34ff
// or see https://github.com/jhnns/rewire/pull/128). It was also notable slower
// (see https://github.com/jhnns/rewire/issues/132).
// There is another issue: replacing const with let is not safe because of their different behavior.
// That's why we also have ESLint in place which tries to identify this error case.
// There is one edge case though: when a new syntax is used *and* a const re-assignment happens,
// rewire would compile happily in this situation but the actual code wouldn't work.
// However, since most projects have a seperate linting step which catches these const re-assignment
// errors anyway, it's probably still a reasonable trade-off.
// Test the regular expresssion at https://regex101.com/r/dvnZPv/2 and also check out testLib/constModule.js.
matchConst = /(^|\s|\}|;)const(\/\*|\s|{)/gm,
// Required for importing modules with shebang declarations, since NodeJS 12.16.0
shebang = /^#!.+/,
nodeRequire,
currentModule;
function load(targetModule) {
nodeRequire = targetModule.require;
targetModule.require = requireProxy;
currentModule = targetModule;
registerExtensions();
targetModule.load(targetModule.id);
// This is only necessary if nothing has been required within the module
reset();
}
function reset() {
Module.wrapper[0] = moduleWrapper0;
Module.wrapper[1] = moduleWrapper1;
}
function inject(prelude, appendix) {
Module.wrapper[0] = moduleWrapper0 + prelude;
Module.wrapper[1] = appendix + moduleWrapper1;
}
/**
* Proxies the first require call in order to draw back all changes to the Module.wrapper.
* Thus our changes don't influence other modules
*
* @param {!String} path
*/
function requireProxy(path) {
reset();
currentModule.require = nodeRequire;
return nodeRequire.call(currentModule, path); // node's require only works when "this" points to the module
}
function registerExtensions() {
var originalJsExtension = require.extensions[".js"];
var originalCoffeeExtension = require.extensions[".coffee"];
if (originalJsExtension) {
originalExtensions.js = originalJsExtension;
}
if (originalCoffeeExtension) {
originalExtensions.coffee = originalCoffeeExtension;
}
require.extensions[".js"] = jsExtension;
require.extensions[".coffee"] = coffeeExtension;
}
function restoreExtensions() {
if ("js" in originalExtensions) {
require.extensions[".js"] = originalExtensions.js;
}
if ("coffee" in originalExtensions) {
require.extensions[".coffee"] = originalExtensions.coffee;
}
}
function isNoConstAssignMessage(message) {
return message.ruleId === "no-const-assign";
}
function jsExtension(module, filename) {
var _compile = module._compile;
module._compile = function (content, filename) {
var noConstAssignMessage = linter.verify(content, eslintOptions).find(isNoConstAssignMessage);
var line;
var column;
if (noConstAssignMessage !== undefined) {
line = noConstAssignMessage.line;
column = noConstAssignMessage.column;
throw new TypeError(`Assignment to constant variable at ${ filename }:${ line }:${ column }`);
}
_compile.call(
module,
content
.replace(shebang, '') // Remove shebang declarations
.replace(matchConst, "$1let $2"), // replace const with let, while maintaining the column width
filename
);
};
restoreExtensions();
originalExtensions.js(module, filename);
}
function coffeeExtension(module, filename) {
if (!coffee) {
throw new Error("Cannot rewire module written in CoffeeScript: Please install 'coffeescript' package first.");
}
var content = stripBOM(fs.readFileSync(filename, "utf8"));
restoreExtensions();
content = coffee.compile(content, {
filename: filename,
bare: true
});
module._compile(content, filename);
}
/**
* @see https://github.com/joyent/node/blob/master/lib/module.js
*/
function stripBOM(content) {
// Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
// because the buffer-to-string conversion in `fs.readFileSync()`
// translates it to FEFF, the UTF-16 BOM.
if (content.charCodeAt(0) === 0xFEFF) {
content = content.slice(1);
}
return content;
}
try {
coffee = require("coffeescript");
} catch (err) {
try {
// Trying to load deprecated package
coffee = require("coffee-script");
} catch (err) {
// We are not able to provide CoffeeScript support, but that's ok as long as the user doesn't want it.
}
}
exports.load = load;
exports.inject = inject;
rewire-6.0.0/lib/index.js 0000644 0001750 0001750 00000001157 14157477202 014570 0 ustar nilesh nilesh var rewireModule = require("./rewire.js");
/**
* Adds a special setter and getter to the module located at filename. After the module has been rewired, you can
* call myModule.__set__(name, value) and myModule.__get__(name) to manipulate private variables.
*
* @param {!String} filename Path to the module that shall be rewired. Use it exactly like require().
* @return {*} the rewired module
*/
function rewire(filename) {
return rewireModule(module.parent, filename);
}
module.exports = rewire;
delete require.cache[__filename]; // deleting self from module cache so the parent module is always up to date
rewire-6.0.0/lib/__set__.js 0000644 0001750 0001750 00000006106 14157477202 015047 0 ustar nilesh nilesh /**
* This function will be stringified and then injected into every rewired module.
* Then you can set private variables by calling myModule.__set__("myPrivateVar", newValue);
*
* All variables within this function are namespaced in the arguments array because every
* var declaration could possibly clash with a variable in the module scope.
*
* @param {String|Object} varName name of the variable to set
* @param {String} varValue new value
* @return {Function}
*/
function __set__() {
arguments.varName = arguments[0];
arguments.varValue = arguments[1];
// Saving references to global objects and functions. Thus a test may even change these variables
// without interfering with rewire().
// @see https://github.com/jhnns/rewire/issues/40
arguments.refs = arguments[2] || {
isArray: Array.isArray,
TypeError: TypeError,
stringify: JSON.stringify
// We can't save eval() because eval() is a *special* global function
// That's why it can't be re-assigned in strict mode
//eval: eval
};
arguments.src = "";
arguments.revertArgs = [];
if (typeof arguments[0] === "object") {
arguments.env = arguments.varName;
if (!arguments.env || arguments.refs.isArray(arguments.env)) {
throw new arguments.refs.TypeError("__set__ expects an object as env");
}
arguments.revertArgs[0] = {};
for (arguments.varName in arguments.env) {
if (arguments.env.hasOwnProperty(arguments.varName)) {
arguments.varValue = arguments.env[arguments.varName];
arguments.src += arguments.varName + " = arguments.env[" + arguments.refs.stringify(arguments.varName) + "]; ";
try {
// Allow tests to mock implicit globals
// @see https://github.com/jhnns/rewire/issues/35
arguments.revertArgs[0][arguments.varName] = eval(arguments.varName);
} catch (err) {
arguments.revertArgs[0][arguments.varName] = undefined;
}
}
}
} else if (typeof arguments.varName === "string") {
if (!arguments.varName) {
throw new arguments.refs.TypeError("__set__ expects a non-empty string as a variable name");
}
arguments.src = arguments.varName + " = arguments.varValue;";
try {
// Allow tests to mock implicit globals
// @see https://github.com/jhnns/rewire/issues/35
arguments.revertArgs = [arguments.varName, eval(arguments.varName)];
} catch (err) {
arguments.revertArgs = [arguments.varName, undefined];
}
} else {
throw new arguments.refs.TypeError("__set__ expects an environment object or a non-empty string as a variable name");
}
// Passing our saved references on to the revert function
arguments.revertArgs[2] = arguments.refs;
eval(arguments.src);
return function (revertArgs) {
__set__.apply(null, revertArgs);
}.bind(null, arguments.revertArgs);
}
module.exports = __set__;
rewire-6.0.0/lib/getImportGlobalsSrc.js 0000644 0001750 0001750 00000003230 14157477202 017401 0 ustar nilesh nilesh /**
* Declares all globals with a var and assigns the global object. Thus you're able to
* override globals without changing the global object itself.
*
* Returns something like
* "var console = global.console; var process = global.process; ..."
*
* @return {String}
*/
function getImportGlobalsSrc(ignore) {
var key,
src = "",
globalObj = typeof global === "undefined"? window: global;
ignore = ignore || [];
ignore.push(
// global itself can't be overridden because it's the only reference to our real global objects
"global",
// ignore 'module', 'exports' and 'require' on the global scope, because otherwise our code would
// shadow the module-internal variables
// @see https://github.com/jhnns/rewire-webpack/pull/6
"module", "exports", "require",
// strict mode doesn't allow to (re)define 'undefined', 'eval' & 'arguments'
"undefined", "eval", "arguments",
// 'GLOBAL' and 'root' are deprecated in Node
// (assigning them causes a DeprecationWarning)
"GLOBAL", "root",
// 'NaN' and 'Infinity' are immutable
// (doesn't throw an error if you set 'var NaN = ...', but doesn't work either)
"NaN", "Infinity",
);
const globals = Object.getOwnPropertyNames(globalObj);
for (key of globals) {
if (ignore.indexOf(key) !== -1) {
continue;
}
// key may be an invalid variable name (e.g. 'a-b')
try {
eval("var " + key + ";");
src += "var " + key + " = global." + key + "; ";
} catch(e) {}
}
return src;
}
module.exports = getImportGlobalsSrc;
rewire-6.0.0/lib/getDefinePropertySrc.js 0000644 0001750 0001750 00000001541 14157477202 017565 0 ustar nilesh nilesh "use strict";
var __get__ = require("./__get__.js");
var __set__ = require ("./__set__.js");
var __with__ = require("./__with__.js");
var srcs = {
"__get__": __get__.toString(),
"__set__": __set__.toString(),
"__with__": __with__.toString()
};
function getDefinePropertySrc() {
var src = "if (typeof(module.exports) === 'function' || \n" +
"(typeof(module.exports) === 'object' && module.exports !== null && Object.isExtensible(module.exports))) {\n";
src += Object.keys(srcs).reduce(function forEachSrc(preValue, value) {
return preValue += "Object.defineProperty(module.exports, '" +
value +
"', {enumerable: false, value: " +
srcs[value] +
", "+
"writable: true}); ";
}, "");
src += "\n}";
return src;
}
module.exports = getDefinePropertySrc;
rewire-6.0.0/lib/__with__.js 0000644 0001750 0001750 00000002260 14157477202 015224 0 ustar nilesh nilesh "use strict";
/**
* This function will be stringified and then injected into every rewired module.
*
* Calling myModule.__with__("myPrivateVar", newValue) returns a function where
* you can place your tests. As long as the returned function is executed variables
* will be set to the given value, after that all changed variables are reset back to normal.
*
* @param {String|Object} varName name of the variable to set
* @param {String} varValue new value
* @return {Function}
*/
function __with__() {
var args = arguments;
return function (callback) {
var undo,
returned,
isPromise;
if (typeof callback !== "function") {
throw new TypeError("__with__ expects a callback function");
}
undo = module.exports.__set__.apply(null, args);
try {
returned = callback();
isPromise = returned && typeof returned.then === "function";
if (isPromise) {
returned.then(undo, undo);
return returned;
}
} finally {
if (!isPromise) {
undo();
}
}
};
}
module.exports = __with__; rewire-6.0.0/lib/rewire.js 0000644 0001750 0001750 00000003376 14157477202 014763 0 ustar nilesh nilesh var Module = require("module"),
fs = require("fs"),
getImportGlobalsSrc = require("./getImportGlobalsSrc.js"),
getDefinePropertySrc = require("./getDefinePropertySrc.js"),
detectStrictMode = require("./detectStrictMode.js"),
moduleEnv = require("./moduleEnv.js");
/**
* Does actual rewiring the module. For further documentation @see index.js
*/
function internalRewire(parentModulePath, targetPath) {
var targetModule,
prelude,
appendix,
src;
// Checking params
if (typeof targetPath !== "string") {
throw new TypeError("Filename must be a string");
}
// Resolve full filename relative to the parent module
targetPath = Module._resolveFilename(targetPath, parentModulePath);
// Create testModule as it would be created by require()
targetModule = new Module(targetPath, parentModulePath);
// We prepend a list of all globals declared with var so they can be overridden (without changing original globals)
prelude = getImportGlobalsSrc();
// Wrap module src inside IIFE so that function declarations do not clash with global variables
// @see https://github.com/jhnns/rewire/issues/56
prelude += "(function () { ";
// We append our special setter and getter.
appendix = "\n" + getDefinePropertySrc();
// End of IIFE
appendix += "})();";
// Check if the module uses the strict mode.
// If so we must ensure that "use strict"; stays at the beginning of the module.
src = fs.readFileSync(targetPath, "utf8");
if (detectStrictMode(src) === true) {
prelude = ' "use strict"; ' + prelude;
}
moduleEnv.inject(prelude, appendix);
moduleEnv.load(targetModule);
return targetModule.exports;
}
module.exports = internalRewire;
rewire-6.0.0/lib/__get__.js 0000644 0001750 0001750 00000001326 14157477202 015032 0 ustar nilesh nilesh /**
* This function will be stringified and then injected into every rewired module.
* Then you can leak private variables by calling myModule.__get__("myPrivateVar");
*
* All variables within this function are namespaced in the arguments array because every
* var declaration could possibly clash with a variable in the module scope.
*
* @param {!String} name name of the variable to retrieve
* @throws {TypeError}
* @return {*}
*/
function __get__() {
arguments.varName = arguments[0];
if (arguments.varName && typeof arguments.varName === "string") {
return eval(arguments.varName);
} else {
throw new TypeError("__get__ expects a non-empty string");
}
}
module.exports = __get__; rewire-6.0.0/package-lock.json 0000644 0001750 0001750 00000275637 14157477202 015611 0 ustar nilesh nilesh {
"name": "rewire",
"version": "5.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@babel/code-frame": {
"version": "7.12.11",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz",
"integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==",
"requires": {
"@babel/highlight": "^7.10.4"
}
},
"@babel/compat-data": {
"version": "7.16.4",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.4.tgz",
"integrity": "sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==",
"dev": true
},
"@babel/core": {
"version": "7.16.5",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.5.tgz",
"integrity": "sha512-wUcenlLzuWMZ9Zt8S0KmFwGlH6QKRh3vsm/dhDA3CHkiTA45YuG1XkHRcNRl73EFPXDp/d5kVOU0/y7x2w6OaQ==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.16.0",
"@babel/generator": "^7.16.5",
"@babel/helper-compilation-targets": "^7.16.3",
"@babel/helper-module-transforms": "^7.16.5",
"@babel/helpers": "^7.16.5",
"@babel/parser": "^7.16.5",
"@babel/template": "^7.16.0",
"@babel/traverse": "^7.16.5",
"@babel/types": "^7.16.0",
"convert-source-map": "^1.7.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.2",
"json5": "^2.1.2",
"semver": "^6.3.0",
"source-map": "^0.5.0"
},
"dependencies": {
"@babel/code-frame": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz",
"integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==",
"dev": true,
"requires": {
"@babel/highlight": "^7.16.0"
}
},
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
}
}
},
"@babel/generator": {
"version": "7.16.5",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.5.tgz",
"integrity": "sha512-kIvCdjZqcdKqoDbVVdt5R99icaRtrtYhYK/xux5qiWCBmfdvEYMFZ68QCrpE5cbFM1JsuArUNs1ZkuKtTtUcZA==",
"dev": true,
"requires": {
"@babel/types": "^7.16.0",
"jsesc": "^2.5.1",
"source-map": "^0.5.0"
}
},
"@babel/helper-compilation-targets": {
"version": "7.16.3",
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz",
"integrity": "sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA==",
"dev": true,
"requires": {
"@babel/compat-data": "^7.16.0",
"@babel/helper-validator-option": "^7.14.5",
"browserslist": "^4.17.5",
"semver": "^6.3.0"
},
"dependencies": {
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
}
}
},
"@babel/helper-environment-visitor": {
"version": "7.16.5",
"resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.5.tgz",
"integrity": "sha512-ODQyc5AnxmZWm/R2W7fzhamOk1ey8gSguo5SGvF0zcB3uUzRpTRmM/jmLSm9bDMyPlvbyJ+PwPEK0BWIoZ9wjg==",
"dev": true,
"requires": {
"@babel/types": "^7.16.0"
}
},
"@babel/helper-function-name": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz",
"integrity": "sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog==",
"dev": true,
"requires": {
"@babel/helper-get-function-arity": "^7.16.0",
"@babel/template": "^7.16.0",
"@babel/types": "^7.16.0"
}
},
"@babel/helper-get-function-arity": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz",
"integrity": "sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ==",
"dev": true,
"requires": {
"@babel/types": "^7.16.0"
}
},
"@babel/helper-hoist-variables": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz",
"integrity": "sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg==",
"dev": true,
"requires": {
"@babel/types": "^7.16.0"
}
},
"@babel/helper-module-imports": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz",
"integrity": "sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==",
"dev": true,
"requires": {
"@babel/types": "^7.16.0"
}
},
"@babel/helper-module-transforms": {
"version": "7.16.5",
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.5.tgz",
"integrity": "sha512-CkvMxgV4ZyyioElFwcuWnDCcNIeyqTkCm9BxXZi73RR1ozqlpboqsbGUNvRTflgZtFbbJ1v5Emvm+lkjMYY/LQ==",
"dev": true,
"requires": {
"@babel/helper-environment-visitor": "^7.16.5",
"@babel/helper-module-imports": "^7.16.0",
"@babel/helper-simple-access": "^7.16.0",
"@babel/helper-split-export-declaration": "^7.16.0",
"@babel/helper-validator-identifier": "^7.15.7",
"@babel/template": "^7.16.0",
"@babel/traverse": "^7.16.5",
"@babel/types": "^7.16.0"
}
},
"@babel/helper-simple-access": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz",
"integrity": "sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw==",
"dev": true,
"requires": {
"@babel/types": "^7.16.0"
}
},
"@babel/helper-split-export-declaration": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz",
"integrity": "sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw==",
"dev": true,
"requires": {
"@babel/types": "^7.16.0"
}
},
"@babel/helper-validator-identifier": {
"version": "7.15.7",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz",
"integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w=="
},
"@babel/helper-validator-option": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz",
"integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==",
"dev": true
},
"@babel/helpers": {
"version": "7.16.5",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.5.tgz",
"integrity": "sha512-TLgi6Lh71vvMZGEkFuIxzaPsyeYCHQ5jJOOX1f0xXn0uciFuE8cEk0wyBquMcCxBXZ5BJhE2aUB7pnWTD150Tw==",
"dev": true,
"requires": {
"@babel/template": "^7.16.0",
"@babel/traverse": "^7.16.5",
"@babel/types": "^7.16.0"
}
},
"@babel/highlight": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz",
"integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==",
"requires": {
"@babel/helper-validator-identifier": "^7.15.7",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
},
"dependencies": {
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
}
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
}
}
},
"@babel/parser": {
"version": "7.16.6",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.6.tgz",
"integrity": "sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ==",
"dev": true
},
"@babel/template": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.0.tgz",
"integrity": "sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.16.0",
"@babel/parser": "^7.16.0",
"@babel/types": "^7.16.0"
},
"dependencies": {
"@babel/code-frame": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz",
"integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==",
"dev": true,
"requires": {
"@babel/highlight": "^7.16.0"
}
}
}
},
"@babel/traverse": {
"version": "7.16.5",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.5.tgz",
"integrity": "sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.16.0",
"@babel/generator": "^7.16.5",
"@babel/helper-environment-visitor": "^7.16.5",
"@babel/helper-function-name": "^7.16.0",
"@babel/helper-hoist-variables": "^7.16.0",
"@babel/helper-split-export-declaration": "^7.16.0",
"@babel/parser": "^7.16.5",
"@babel/types": "^7.16.0",
"debug": "^4.1.0",
"globals": "^11.1.0"
},
"dependencies": {
"@babel/code-frame": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz",
"integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==",
"dev": true,
"requires": {
"@babel/highlight": "^7.16.0"
}
},
"globals": {
"version": "11.12.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
"integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
"dev": true
}
}
},
"@babel/types": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz",
"integrity": "sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.15.7",
"to-fast-properties": "^2.0.0"
}
},
"@eslint/eslintrc": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz",
"integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==",
"requires": {
"ajv": "^6.12.4",
"debug": "^4.1.1",
"espree": "^7.3.0",
"globals": "^13.9.0",
"ignore": "^4.0.6",
"import-fresh": "^3.2.1",
"js-yaml": "^3.13.1",
"minimatch": "^3.0.4",
"strip-json-comments": "^3.1.1"
}
},
"@humanwhocodes/config-array": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz",
"integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==",
"requires": {
"@humanwhocodes/object-schema": "^1.2.0",
"debug": "^4.1.1",
"minimatch": "^3.0.4"
}
},
"@humanwhocodes/object-schema": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz",
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA=="
},
"@istanbuljs/load-nyc-config": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz",
"integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==",
"dev": true,
"requires": {
"camelcase": "^5.3.1",
"find-up": "^4.1.0",
"get-package-type": "^0.1.0",
"js-yaml": "^3.13.1",
"resolve-from": "^5.0.0"
},
"dependencies": {
"camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"dev": true
},
"find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"dev": true,
"requires": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
}
},
"locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"dev": true,
"requires": {
"p-locate": "^4.1.0"
}
},
"p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"dev": true,
"requires": {
"p-try": "^2.0.0"
}
},
"p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"dev": true,
"requires": {
"p-limit": "^2.2.0"
}
},
"resolve-from": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
"integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
"dev": true
}
}
},
"@istanbuljs/schema": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz",
"integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==",
"dev": true
},
"@ungap/promise-all-settled": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz",
"integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==",
"dev": true
},
"acorn": {
"version": "7.4.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A=="
},
"acorn-jsx": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
"integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="
},
"aggregate-error": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz",
"integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==",
"dev": true,
"requires": {
"clean-stack": "^2.0.0",
"indent-string": "^4.0.0"
}
},
"ajv": {
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"ansi-colors": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
"integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA=="
},
"ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
},
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"requires": {
"color-convert": "^1.9.0"
}
},
"anymatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz",
"integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==",
"dev": true,
"requires": {
"normalize-path": "^3.0.0",
"picomatch": "^2.0.4"
}
},
"append-transform": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz",
"integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==",
"dev": true,
"requires": {
"default-require-extensions": "^3.0.0"
}
},
"archy": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz",
"integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=",
"dev": true
},
"argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"requires": {
"sprintf-js": "~1.0.2"
}
},
"astral-regex": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
"integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ=="
},
"balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
},
"binary-extensions": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"requires": {
"fill-range": "^7.0.1"
}
},
"browser-stdout": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
"integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
"dev": true
},
"browserslist": {
"version": "4.19.1",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz",
"integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==",
"dev": true,
"requires": {
"caniuse-lite": "^1.0.30001286",
"electron-to-chromium": "^1.4.17",
"escalade": "^3.1.1",
"node-releases": "^2.0.1",
"picocolors": "^1.0.0"
}
},
"caching-transform": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz",
"integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==",
"dev": true,
"requires": {
"hasha": "^5.0.0",
"make-dir": "^3.0.0",
"package-hash": "^4.0.0",
"write-file-atomic": "^3.0.0"
}
},
"callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
},
"camelcase": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz",
"integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==",
"dev": true
},
"caniuse-lite": {
"version": "1.0.30001291",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001291.tgz",
"integrity": "sha512-roMV5V0HNGgJ88s42eE70sstqGW/gwFndosYrikHthw98N5tLnOTxFqMLQjZVRxTWFlJ4rn+MsgXrR7MDPY4jA==",
"dev": true
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"requires": {
"color-convert": "^2.0.1"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"chokidar": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz",
"integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==",
"dev": true,
"requires": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"fsevents": "~2.3.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
}
},
"clean-stack": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz",
"integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==",
"dev": true
},
"cliui": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
"integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
"dev": true,
"requires": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^7.0.0"
}
},
"coffeescript": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-2.6.1.tgz",
"integrity": "sha512-GG5nkF93qII8HmHqnnibkgpp/SV7PSnSPiWsbinwya7nNOe95aE/x2xrKZJFks8Qpko3TNrC+/LahaKgrz5YCg==",
"dev": true
},
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
},
"commondir": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
"integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
"dev": true
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"convert-source-map": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz",
"integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==",
"dev": true,
"requires": {
"safe-buffer": "~5.1.1"
},
"dependencies": {
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"dev": true
}
}
},
"cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"requires": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
}
},
"debug": {
"version": "4.3.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
"integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
"requires": {
"ms": "2.1.2"
}
},
"decamelize": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz",
"integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==",
"dev": true
},
"deep-is": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
"integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="
},
"default-require-extensions": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz",
"integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==",
"dev": true,
"requires": {
"strip-bom": "^4.0.0"
}
},
"diff": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz",
"integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==",
"dev": true
},
"doctrine": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
"integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
"requires": {
"esutils": "^2.0.2"
}
},
"electron-to-chromium": {
"version": "1.4.24",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.24.tgz",
"integrity": "sha512-erwx5r69B/WFfFuF2jcNN0817BfDBdC4765kQ6WltOMuwsimlQo3JTEq0Cle+wpHralwdeX3OfAtw/mHxPK0Wg==",
"dev": true
},
"emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
},
"enquirer": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz",
"integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==",
"requires": {
"ansi-colors": "^4.1.1"
}
},
"es6-error": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz",
"integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",
"dev": true
},
"escalade": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
"integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
"dev": true
},
"escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="
},
"eslint": {
"version": "7.32.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz",
"integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==",
"requires": {
"@babel/code-frame": "7.12.11",
"@eslint/eslintrc": "^0.4.3",
"@humanwhocodes/config-array": "^0.5.0",
"ajv": "^6.10.0",
"chalk": "^4.0.0",
"cross-spawn": "^7.0.2",
"debug": "^4.0.1",
"doctrine": "^3.0.0",
"enquirer": "^2.3.5",
"escape-string-regexp": "^4.0.0",
"eslint-scope": "^5.1.1",
"eslint-utils": "^2.1.0",
"eslint-visitor-keys": "^2.0.0",
"espree": "^7.3.1",
"esquery": "^1.4.0",
"esutils": "^2.0.2",
"fast-deep-equal": "^3.1.3",
"file-entry-cache": "^6.0.1",
"functional-red-black-tree": "^1.0.1",
"glob-parent": "^5.1.2",
"globals": "^13.6.0",
"ignore": "^4.0.6",
"import-fresh": "^3.0.0",
"imurmurhash": "^0.1.4",
"is-glob": "^4.0.0",
"js-yaml": "^3.13.1",
"json-stable-stringify-without-jsonify": "^1.0.1",
"levn": "^0.4.1",
"lodash.merge": "^4.6.2",
"minimatch": "^3.0.4",
"natural-compare": "^1.4.0",
"optionator": "^0.9.1",
"progress": "^2.0.0",
"regexpp": "^3.1.0",
"semver": "^7.2.1",
"strip-ansi": "^6.0.0",
"strip-json-comments": "^3.1.0",
"table": "^6.0.9",
"text-table": "^0.2.0",
"v8-compile-cache": "^2.0.3"
}
},
"eslint-scope": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
"integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
"requires": {
"esrecurse": "^4.3.0",
"estraverse": "^4.1.1"
}
},
"eslint-utils": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
"integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
"requires": {
"eslint-visitor-keys": "^1.1.0"
},
"dependencies": {
"eslint-visitor-keys": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
"integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ=="
}
}
},
"eslint-visitor-keys": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
"integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw=="
},
"espree": {
"version": "7.3.1",
"resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz",
"integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==",
"requires": {
"acorn": "^7.4.0",
"acorn-jsx": "^5.3.1",
"eslint-visitor-keys": "^1.3.0"
},
"dependencies": {
"eslint-visitor-keys": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
"integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ=="
}
}
},
"esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
},
"esquery": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz",
"integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==",
"requires": {
"estraverse": "^5.1.0"
},
"dependencies": {
"estraverse": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA=="
}
}
},
"esrecurse": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
"integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
"requires": {
"estraverse": "^5.2.0"
},
"dependencies": {
"estraverse": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA=="
}
}
},
"estraverse": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw=="
},
"esutils": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="
},
"expect.js": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/expect.js/-/expect.js-0.3.1.tgz",
"integrity": "sha1-sKWaDS7/VDdUTr8M6qYBWEHQm1s=",
"dev": true
},
"fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
},
"fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
},
"fast-levenshtein": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc="
},
"file-entry-cache": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
"integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
"requires": {
"flat-cache": "^3.0.4"
}
},
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"requires": {
"to-regex-range": "^5.0.1"
}
},
"find-cache-dir": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz",
"integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==",
"dev": true,
"requires": {
"commondir": "^1.0.1",
"make-dir": "^3.0.2",
"pkg-dir": "^4.1.0"
}
},
"find-up": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
"integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
"dev": true,
"requires": {
"locate-path": "^6.0.0",
"path-exists": "^4.0.0"
}
},
"flat": {
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz",
"integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==",
"dev": true
},
"flat-cache": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
"integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
"requires": {
"flatted": "^3.1.0",
"rimraf": "^3.0.2"
}
},
"flatted": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz",
"integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw=="
},
"foreground-child": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz",
"integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.0",
"signal-exit": "^3.0.2"
}
},
"fromentries": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz",
"integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==",
"dev": true
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"fsevents": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"dev": true,
"optional": true
},
"functional-red-black-tree": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
"integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc="
},
"gensync": {
"version": "1.0.0-beta.2",
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
"integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
"dev": true
},
"get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"dev": true
},
"get-package-type": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz",
"integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==",
"dev": true
},
"glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"requires": {
"is-glob": "^4.0.1"
}
},
"globals": {
"version": "13.12.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz",
"integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==",
"requires": {
"type-fest": "^0.20.2"
}
},
"graceful-fs": {
"version": "4.2.8",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz",
"integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==",
"dev": true
},
"growl": {
"version": "1.10.5",
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
"integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
"dev": true
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
},
"hasha": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz",
"integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==",
"dev": true,
"requires": {
"is-stream": "^2.0.0",
"type-fest": "^0.8.0"
},
"dependencies": {
"type-fest": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
"integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
"dev": true
}
}
},
"he": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
"dev": true
},
"html-escaper": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
"integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",
"dev": true
},
"ignore": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
"integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg=="
},
"import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
"integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
"requires": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
}
},
"imurmurhash": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o="
},
"indent-string": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
"integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
"dev": true
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"requires": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"is-binary-path": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
"dev": true,
"requires": {
"binary-extensions": "^2.0.0"
}
},
"is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI="
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
},
"is-glob": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
"requires": {
"is-extglob": "^2.1.1"
}
},
"is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true
},
"is-plain-obj": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz",
"integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
"dev": true
},
"is-stream": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
"integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
"dev": true
},
"is-typedarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=",
"dev": true
},
"is-unicode-supported": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz",
"integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==",
"dev": true
},
"is-windows": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
"integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
"dev": true
},
"isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
},
"istanbul-lib-coverage": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz",
"integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==",
"dev": true
},
"istanbul-lib-hook": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz",
"integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==",
"dev": true,
"requires": {
"append-transform": "^2.0.0"
}
},
"istanbul-lib-instrument": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz",
"integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==",
"dev": true,
"requires": {
"@babel/core": "^7.7.5",
"@istanbuljs/schema": "^0.1.2",
"istanbul-lib-coverage": "^3.0.0",
"semver": "^6.3.0"
},
"dependencies": {
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
}
}
},
"istanbul-lib-processinfo": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz",
"integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==",
"dev": true,
"requires": {
"archy": "^1.0.0",
"cross-spawn": "^7.0.0",
"istanbul-lib-coverage": "^3.0.0-alpha.1",
"make-dir": "^3.0.0",
"p-map": "^3.0.0",
"rimraf": "^3.0.0",
"uuid": "^3.3.3"
}
},
"istanbul-lib-report": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz",
"integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==",
"dev": true,
"requires": {
"istanbul-lib-coverage": "^3.0.0",
"make-dir": "^3.0.0",
"supports-color": "^7.1.0"
},
"dependencies": {
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"istanbul-lib-source-maps": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz",
"integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==",
"dev": true,
"requires": {
"debug": "^4.1.1",
"istanbul-lib-coverage": "^3.0.0",
"source-map": "^0.6.1"
},
"dependencies": {
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
}
}
},
"istanbul-reports": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.1.tgz",
"integrity": "sha512-q1kvhAXWSsXfMjCdNHNPKZZv94OlspKnoGv+R9RGbnqOOQ0VbNfLFgQDVgi7hHenKsndGq3/o0OBdzDXthWcNw==",
"dev": true,
"requires": {
"html-escaper": "^2.0.0",
"istanbul-lib-report": "^3.0.0"
}
},
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
},
"js-yaml": {
"version": "3.14.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
"integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
"requires": {
"argparse": "^1.0.7",
"esprima": "^4.0.0"
}
},
"jsesc": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
"integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
"dev": true
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
},
"json-stable-stringify-without-jsonify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
"integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE="
},
"json5": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz",
"integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==",
"dev": true,
"requires": {
"minimist": "^1.2.5"
}
},
"levn": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
"integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
"requires": {
"prelude-ls": "^1.2.1",
"type-check": "~0.4.0"
}
},
"locate-path": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
"integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
"dev": true,
"requires": {
"p-locate": "^5.0.0"
}
},
"lodash.flattendeep": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz",
"integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=",
"dev": true
},
"lodash.merge": {
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="
},
"lodash.truncate": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz",
"integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM="
},
"log-symbols": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz",
"integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==",
"dev": true,
"requires": {
"chalk": "^4.1.0",
"is-unicode-supported": "^0.1.0"
}
},
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"requires": {
"yallist": "^4.0.0"
}
},
"make-dir": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
"integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
"dev": true,
"requires": {
"semver": "^6.0.0"
},
"dependencies": {
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
}
}
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true
},
"mocha": {
"version": "9.1.3",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz",
"integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==",
"dev": true,
"requires": {
"@ungap/promise-all-settled": "1.1.2",
"ansi-colors": "4.1.1",
"browser-stdout": "1.3.1",
"chokidar": "3.5.2",
"debug": "4.3.2",
"diff": "5.0.0",
"escape-string-regexp": "4.0.0",
"find-up": "5.0.0",
"glob": "7.1.7",
"growl": "1.10.5",
"he": "1.2.0",
"js-yaml": "4.1.0",
"log-symbols": "4.1.0",
"minimatch": "3.0.4",
"ms": "2.1.3",
"nanoid": "3.1.25",
"serialize-javascript": "6.0.0",
"strip-json-comments": "3.1.1",
"supports-color": "8.1.1",
"which": "2.0.2",
"workerpool": "6.1.5",
"yargs": "16.2.0",
"yargs-parser": "20.2.4",
"yargs-unparser": "2.0.0"
},
"dependencies": {
"argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"dev": true
},
"debug": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
"integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
"dev": true,
"requires": {
"ms": "2.1.2"
},
"dependencies": {
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
}
}
},
"glob": {
"version": "7.1.7",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
"integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
"js-yaml": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dev": true,
"requires": {
"argparse": "^2.0.1"
}
},
"ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"dev": true
},
"supports-color": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"nanoid": {
"version": "3.1.25",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz",
"integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==",
"dev": true
},
"natural-compare": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
"integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc="
},
"node-preload": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz",
"integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==",
"dev": true,
"requires": {
"process-on-spawn": "^1.0.0"
}
},
"node-releases": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz",
"integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==",
"dev": true
},
"normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
"dev": true
},
"nyc": {
"version": "15.1.0",
"resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz",
"integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==",
"dev": true,
"requires": {
"@istanbuljs/load-nyc-config": "^1.0.0",
"@istanbuljs/schema": "^0.1.2",
"caching-transform": "^4.0.0",
"convert-source-map": "^1.7.0",
"decamelize": "^1.2.0",
"find-cache-dir": "^3.2.0",
"find-up": "^4.1.0",
"foreground-child": "^2.0.0",
"get-package-type": "^0.1.0",
"glob": "^7.1.6",
"istanbul-lib-coverage": "^3.0.0",
"istanbul-lib-hook": "^3.0.0",
"istanbul-lib-instrument": "^4.0.0",
"istanbul-lib-processinfo": "^2.0.2",
"istanbul-lib-report": "^3.0.0",
"istanbul-lib-source-maps": "^4.0.0",
"istanbul-reports": "^3.0.2",
"make-dir": "^3.0.0",
"node-preload": "^0.2.1",
"p-map": "^3.0.0",
"process-on-spawn": "^1.0.0",
"resolve-from": "^5.0.0",
"rimraf": "^3.0.0",
"signal-exit": "^3.0.2",
"spawn-wrap": "^2.0.0",
"test-exclude": "^6.0.0",
"yargs": "^15.0.2"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"dev": true
},
"cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
"dev": true,
"requires": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^6.2.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"decamelize": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
"dev": true
},
"find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"dev": true,
"requires": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
}
},
"locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"dev": true,
"requires": {
"p-locate": "^4.1.0"
}
},
"p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"dev": true,
"requires": {
"p-try": "^2.0.0"
}
},
"p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"dev": true,
"requires": {
"p-limit": "^2.2.0"
}
},
"resolve-from": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
"integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
"dev": true
},
"wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
"dev": true,
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
}
},
"y18n": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
"dev": true
},
"yargs": {
"version": "15.4.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
"dev": true,
"requires": {
"cliui": "^6.0.0",
"decamelize": "^1.2.0",
"find-up": "^4.1.0",
"get-caller-file": "^2.0.1",
"require-directory": "^2.1.1",
"require-main-filename": "^2.0.0",
"set-blocking": "^2.0.0",
"string-width": "^4.2.0",
"which-module": "^2.0.0",
"y18n": "^4.0.0",
"yargs-parser": "^18.1.2"
}
},
"yargs-parser": {
"version": "18.1.3",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
"dev": true,
"requires": {
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
}
}
}
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"requires": {
"wrappy": "1"
}
},
"optionator": {
"version": "0.9.1",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
"integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
"requires": {
"deep-is": "^0.1.3",
"fast-levenshtein": "^2.0.6",
"levn": "^0.4.1",
"prelude-ls": "^1.2.1",
"type-check": "^0.4.0",
"word-wrap": "^1.2.3"
}
},
"p-limit": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
"integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
"dev": true,
"requires": {
"yocto-queue": "^0.1.0"
}
},
"p-locate": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
"integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
"dev": true,
"requires": {
"p-limit": "^3.0.2"
}
},
"p-map": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz",
"integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==",
"dev": true,
"requires": {
"aggregate-error": "^3.0.0"
}
},
"p-try": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dev": true
},
"package-hash": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz",
"integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==",
"dev": true,
"requires": {
"graceful-fs": "^4.1.15",
"hasha": "^5.0.0",
"lodash.flattendeep": "^4.4.0",
"release-zalgo": "^1.0.0"
}
},
"parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
"requires": {
"callsites": "^3.0.0"
}
},
"path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"dev": true
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
"path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="
},
"picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"dev": true
},
"picomatch": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz",
"integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==",
"dev": true
},
"pkg-dir": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
"integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
"dev": true,
"requires": {
"find-up": "^4.0.0"
},
"dependencies": {
"find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"dev": true,
"requires": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
}
},
"locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"dev": true,
"requires": {
"p-locate": "^4.1.0"
}
},
"p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"dev": true,
"requires": {
"p-try": "^2.0.0"
}
},
"p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"dev": true,
"requires": {
"p-limit": "^2.2.0"
}
}
}
},
"prelude-ls": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
"integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="
},
"process-on-spawn": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz",
"integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==",
"dev": true,
"requires": {
"fromentries": "^1.2.0"
}
},
"progress": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
"integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA=="
},
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
},
"randombytes": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
"integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
"dev": true,
"requires": {
"safe-buffer": "^5.1.0"
}
},
"readdirp": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
"dev": true,
"requires": {
"picomatch": "^2.2.1"
}
},
"regexpp": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz",
"integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg=="
},
"release-zalgo": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz",
"integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=",
"dev": true,
"requires": {
"es6-error": "^4.0.1"
}
},
"require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
"dev": true
},
"require-from-string": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
"integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="
},
"require-main-filename": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
"dev": true
},
"resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="
},
"rewire": {
"version": "file:",
"dev": true,
"requires": {
"eslint": "^7.32.0"
}
},
"rimraf": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
"requires": {
"glob": "^7.1.3"
}
},
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"dev": true
},
"semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"requires": {
"lru-cache": "^6.0.0"
}
},
"serialize-javascript": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz",
"integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==",
"dev": true,
"requires": {
"randombytes": "^2.1.0"
}
},
"set-blocking": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
"dev": true
},
"shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"requires": {
"shebang-regex": "^3.0.0"
}
},
"shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="
},
"signal-exit": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz",
"integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==",
"dev": true
},
"slice-ansi": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
"integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
"requires": {
"ansi-styles": "^4.0.0",
"astral-regex": "^2.0.0",
"is-fullwidth-code-point": "^3.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"requires": {
"color-convert": "^2.0.1"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
}
}
},
"source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true
},
"spawn-wrap": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz",
"integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==",
"dev": true,
"requires": {
"foreground-child": "^2.0.0",
"is-windows": "^1.0.2",
"make-dir": "^3.0.0",
"rimraf": "^3.0.0",
"signal-exit": "^3.0.2",
"which": "^2.0.1"
}
},
"sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
},
"string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
}
},
"strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"requires": {
"ansi-regex": "^5.0.1"
}
},
"strip-bom": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
"integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==",
"dev": true
},
"strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"requires": {
"has-flag": "^3.0.0"
}
},
"table": {
"version": "6.7.5",
"resolved": "https://registry.npmjs.org/table/-/table-6.7.5.tgz",
"integrity": "sha512-LFNeryOqiQHqCVKzhkymKwt6ozeRhlm8IL1mE8rNUurkir4heF6PzMyRgaTa4tlyPTGGgXuvVOF/OLWiH09Lqw==",
"requires": {
"ajv": "^8.0.1",
"lodash.truncate": "^4.4.2",
"slice-ansi": "^4.0.0",
"string-width": "^4.2.3",
"strip-ansi": "^6.0.1"
},
"dependencies": {
"ajv": {
"version": "8.8.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.8.2.tgz",
"integrity": "sha512-x9VuX+R/jcFj1DHo/fCp99esgGDWiHENrKxaCENuCxpoMCmAt/COCGVDwA7kleEpEzJjDnvh3yGoOuLu0Dtllw==",
"requires": {
"fast-deep-equal": "^3.1.1",
"json-schema-traverse": "^1.0.0",
"require-from-string": "^2.0.2",
"uri-js": "^4.2.2"
}
},
"json-schema-traverse": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="
}
}
},
"test-exclude": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz",
"integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==",
"dev": true,
"requires": {
"@istanbuljs/schema": "^0.1.2",
"glob": "^7.1.4",
"minimatch": "^3.0.4"
}
},
"text-table": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
"integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ="
},
"to-fast-properties": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
"integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=",
"dev": true
},
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"requires": {
"is-number": "^7.0.0"
}
},
"type-check": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
"integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
"requires": {
"prelude-ls": "^1.2.1"
}
},
"type-fest": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
"integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ=="
},
"typedarray-to-buffer": {
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
"integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==",
"dev": true,
"requires": {
"is-typedarray": "^1.0.0"
}
},
"uri-js": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
"integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
"requires": {
"punycode": "^2.1.0"
}
},
"uuid": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
"dev": true
},
"v8-compile-cache": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
"integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA=="
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"requires": {
"isexe": "^2.0.0"
}
},
"which-module": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
"dev": true
},
"word-wrap": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ=="
},
"workerpool": {
"version": "6.1.5",
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz",
"integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==",
"dev": true
},
"wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dev": true,
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
}
}
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
},
"write-file-atomic": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz",
"integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==",
"dev": true,
"requires": {
"imurmurhash": "^0.1.4",
"is-typedarray": "^1.0.0",
"signal-exit": "^3.0.2",
"typedarray-to-buffer": "^3.1.5"
}
},
"y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
"dev": true
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
},
"yargs": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
"dev": true,
"requires": {
"cliui": "^7.0.2",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.0",
"y18n": "^5.0.5",
"yargs-parser": "^20.2.2"
}
},
"yargs-parser": {
"version": "20.2.4",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz",
"integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==",
"dev": true
},
"yargs-unparser": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz",
"integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==",
"dev": true,
"requires": {
"camelcase": "^6.0.0",
"decamelize": "^4.0.0",
"flat": "^5.0.2",
"is-plain-obj": "^2.1.0"
}
},
"yocto-queue": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
"dev": true
}
}
}
rewire-6.0.0/CHANGELOG.md 0000644 0001750 0001750 00000012740 14157477202 014166 0 ustar nilesh nilesh Changelog
---------
### 6.0.0
- **Breaking**: Remove Node v8 support. We had to do this because one of our dependencies had security issues and the version with the fix dropped Node v8 as well.
- Update dependencies [#193](https://github.com/jhnns/rewire/issues/193)
- Fix Modifying globals within module leaks to global with Node >=10 [#167](https://github.com/jhnns/rewire/issues/167)
- Fixed import errors on modules with shebang declarations [#179](https://github.com/jhnns/rewire/pull/179)
### 5.0.0
- **Breaking**: Remove Node v6 support. We had to do this because one of our dependencies had security issues and the version with the fix dropped Node v6 as well.
- Update dependencies [#159](https://github.com/jhnns/rewire/pull/159) [#172](https://github.com/jhnns/rewire/issues/172) [#154](https://github.com/jhnns/rewire/issues/154) [#166](https://github.com/jhnns/rewire/issues/166)
### 4.0.1
- Fix a bug where `const` was not properly detected [#139](https://github.com/jhnns/rewire/pull/139)
### 4.0.0
- **Breaking**: Remove official node v4 support. It probably still works with node v4, but no guarantees anymore.
- **Potentially breaking**: Replace babel with regex-based transformation [9b77ed9a293c538ec3eb5160bcb933e012ce517f](https://github.com/jhnns/rewire/commit/9b77ed9a293c538ec3eb5160bcb933e012ce517f).
This should not break, but it has been flagged as major version bump as the regex might not catch all cases reliably and thus fail for some users.
- Improve runtime performance [#132](https://github.com/jhnns/rewire/issues/132)
- Use `coffeescript` package in favor of deprecated `coffee-script` [#134](https://github.com/jhnns/rewire/pull/134)
### 3.0.2
- Fix a bug where rewire used the project's .babelrc [#119](https://github.com/jhnns/rewire/issues/119) [#123](https://github.com/jhnns/rewire/pull/123)
### 3.0.1
- Fix Unknown Plugin "transform-es2015-block-scoping" [#121](https://github.com/jhnns/rewire/issues/121) [#122](https://github.com/jhnns/rewire/pull/122)
### 3.0.0
- **Breaking:** Remove support for node versions below 4
- Add support for `const` [#79](https://github.com/jhnns/rewire/issues/79) [#95](https://github.com/jhnns/rewire/issues/95) [#117](https://github.com/jhnns/rewire/pull/117) [#118](https://github.com/jhnns/rewire/pull/118)
### 2.5.2
- Fix cluttering of `require.extensions` even if CoffeeScript is not installed [#98](https://github.com/jhnns/rewire/pull/98)
### 2.5.1
- Ignore modules that export non-extensible values like primitives or sealed objects [#83](https://github.com/jhnns/rewire/pull/83)
### 2.5.0
- Provide shared test cases to other modules that mimic rewire's behavior in other environments [jhnns/rewire-webpack#18](https://github.com/jhnns/rewire-webpack/pull/18)
### 2.4.0
- Make rewire's special methods `__set__`, `__get__` and `__with__` writable [#78](https://github.com/jhnns/rewire/pull/78)
### 2.3.4
- Add license and keywords to package.json [#59](https://github.com/jhnns/rewire/issues/59) [#60](https://github.com/jhnns/rewire/issues/60)
### 2.3.3
- Fix issue where the strict mode was not detected when a comment was before "strict mode"; [#54](https://github.com/jhnns/rewire/issues/54)
### 2.3.2
- Fix a problem when a function declaration had the same name as a global variable [#56](https://github.com/jhnns/rewire/issues/56)
- Add README section about rewire's limitations
### 2.3.1
- Fix problems when global objects like JSON, etc. have been rewired [#40](https://github.com/jhnns/rewire/issues/40)
### 2.3.0
- Add possibility to mock undefined, implicit globals [#35](https://github.com/jhnns/rewire/issues/35)
### 2.2.0
- Add support for dot notation in __set__(env) calls [#39](https://github.com/jhnns/rewire/issues/39)
### 2.1.5
- Fix issues with reverting nested properties [#39](https://github.com/jhnns/rewire/issues/39)
### 2.1.4
- Fix problems when an illegal variable name is used for a global
### 2.1.3
- Fix shadowing of internal `module`, `exports` and `require` when a global counterpart exists [jhnns/rewire-webpack#6](https://github.com/jhnns/rewire-webpack/pull/6)
### 2.1.2
- Fixed missing `var` statement which lead to pollution of global namespace [#33](https://github.com/jhnns/rewire/pull/33)
### 2.1.1
- Made magic `__set__`, `__get__` and `__with__` not enumerable [#32](https://github.com/jhnns/rewire/pull/32)
### 2.1.0
- Added revert feature of `__set__` method
- Introduced `__with__` method to revert changes automatically
### 2.0.1
- Added test coverage tool
- Small README and description changes
### 2.0.0
- Removed client-side bundler extensions. Browserify is not supported anymore. Webpack support has been extracted
into separate repository https://github.com/jhnns/rewire-webpack
### 1.1.3
- Removed IDE stuff from npm package
### 1.1.2
- Added deprecation warning for client-side bundlers
- Updated package.json for node v0.10
### 1.1.1
- Fixed bug with modules that had a comment on the last line
### 1.1.0
- Added Coffee-Script support
- Removed Makefile: Use `npm test` instead.
### 1.0.4
- Improved client-side rewire() with webpack
### 1.0.3
- Fixed error with client-side bundlers when a module was ending with a comment
### 1.0.2
- Improved strict mode detection
### 1.0.1
- Fixed crash when a global module has been used in the browser
### 1.0.0
- Removed caching functionality. Now rewire doesn't modify `require.cache` at all
- Added support for [webpack](https://github.com/webpack/webpack)-bundler
- Moved browserify-middleware from `rewire.browserify` to `rewire.bundlers.browserify`
- Reached stable state :)
rewire-6.0.0/.github/ 0000755 0001750 0001750 00000000000 14157477202 013711 5 ustar nilesh nilesh rewire-6.0.0/.github/workflows/ 0000755 0001750 0001750 00000000000 14157477202 015746 5 ustar nilesh nilesh rewire-6.0.0/.github/workflows/test.yml 0000644 0001750 0001750 00000002771 14157477202 017457 0 ustar nilesh nilesh name: 🧪 Test
on:
push:
branches:
- "master"
pull_request: {}
jobs:
test:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x]
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@a40b8845c0683271d9f53dfcb887a7e181d3918b # pin@0.9.1
- name: ⬇️ Checkout repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # pin@v2
- name: ⎔ Setup node ${{ matrix.node-version }}
uses: actions/setup-node@25316bbc1f10ac9d8798711f44914b1cf3c4e954 # pin@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: 🗄 Cache node_modules
id: cache-node_modules
uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # pin@v2
with:
path: "**/node_modules"
key: node_modules-${{ runner.os }}-node-${{ matrix.node-version }}-${{
hashFiles('**/package-lock.json') }}
- name: 📥 Install dependencies
if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: |
npm ci --ignore-scripts
- name: 🧪 Test
run: |
npm test
env:
CI: true
- name: ⬆️ Upload coverage report
uses: coverallsapp/github-action@9ba913c152ae4be1327bfb9085dc806cedb44057 # pin@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
rewire-6.0.0/test/ 0000755 0001750 0001750 00000000000 14157477202 013330 5 ustar nilesh nilesh rewire-6.0.0/test/rewire.test.js 0000644 0001750 0001750 00000002075 14157477202 016145 0 ustar nilesh nilesh // Don't run code in ES5 strict mode.
// In case this module was in strict mode, all other modules called by this would also be strict.
// But when testing if the strict mode is preserved, we must ensure that this module is NOT strict.
var expect = require("expect.js"),
fs = require("fs"),
path = require("path");
var rewire;
describe("rewire", function () {
before(function () {
var fakeNodeModules = path.resolve(__dirname, "../testLib/fake_node_modules");
if (fs.existsSync(fakeNodeModules)) {
fs.renameSync(fakeNodeModules, path.resolve(__dirname, "../testLib/node_modules"));
}
});
require("../testLib/sharedTestCases.js")();
it("should also work with CoffeeScript", function () {
var coffeeModule;
rewire = require("../");
coffeeModule = rewire("../testLib/module.coffee");
coffeeModule.__set__("fs", {
readFileSync: function () {
return "It works!";
}
});
expect(coffeeModule.readFileSync()).to.be("It works!");
});
});
rewire-6.0.0/test/detectStrictMode.test.js 0000644 0001750 0001750 00000003163 14157477202 020115 0 ustar nilesh nilesh var expect = require("expect.js"),
detectStrictMode = require("../lib/detectStrictMode.js");
describe("detectStrictMode", function () {
it("should detect all valid uses of \"use strict\";", function () {
expect(detectStrictMode('"use strict";')).to.be(true);
expect(detectStrictMode("'use strict';")).to.be(true);
expect(detectStrictMode(' "use strict";')).to.be(true);
expect(detectStrictMode('\n"use strict";')).to.be(true);
expect(detectStrictMode('\r\n"use strict";')).to.be(true);
expect(detectStrictMode('"use strict"\r\n')).to.be(true);
expect(detectStrictMode('"use strict" ; test();')).to.be(true);
});
it("should be allowed to place comments before \"use strict\";", function () {
expect(detectStrictMode('// some comment\n"use strict";')).to.be(true);
expect(detectStrictMode('/* yo! */"use strict"; /* another comment */')).to.be(true);
expect(detectStrictMode(' // yes yo\r\n\r\n\r\n /*oh yoh*/\r\n//oh snap!\r /* yoh! */"use strict";')).to.be(true);
});
it("should not detect invalid uses of \"use strict\";", function () {
expect(detectStrictMode('" use strict ";')).to.be(false);
expect(detectStrictMode('"use strict".replace("use", "fail");')).to.be(false);
expect(detectStrictMode('"use strict" .replace("use", "fail");')).to.be(false);
expect(detectStrictMode(';"use strict";')).to.be(false);
});
it("should not detect \"use strict\"; if it occurs in some nested function", function () {
expect(detectStrictMode('function () {"use strict";}')).to.be(false);
});
});
rewire-6.0.0/test/__set__.test.js 0000644 0001750 0001750 00000010600 14157477202 016230 0 ustar nilesh nilesh var expect = require("expect.js"),
__set__ = require("../lib/__set__.js"),
vm = require("vm"),
expectTypeError = expectError(TypeError);
function expectError(ErrConstructor) {
return function expectReferenceError(err) {
expect(err.constructor.name).to.be(ErrConstructor.name);
};
}
describe("__set__", function () {
var moduleFake,
undo;
beforeEach(function () {
moduleFake = {
module: {
exports: {}
},
myValue: 0, // copy by value
myReference: {} // copy by reference
};
vm.runInNewContext(
//__set__ requires __set__ to be present on module.exports
"__set__ = module.exports.__set__ = " + __set__.toString() + "; " +
"getValue = function () { return myValue; }; " +
"getReference = function () { return myReference; }; ",
moduleFake
);
});
it("should set the new value when calling with varName, varValue", function () {
expect(moduleFake.getValue()).to.be(0);
moduleFake.__set__("myValue", undefined);
expect(moduleFake.getValue()).to.be(undefined);
moduleFake.__set__("myValue", null);
expect(moduleFake.getValue()).to.be(null);
moduleFake.__set__("myValue", 2);
expect(moduleFake.getValue()).to.be(2);
moduleFake.__set__("myValue", "hello");
expect(moduleFake.getValue()).to.be("hello");
});
it("should set the new reference when calling with varName, varValue", function () {
var newObj = { hello: "hello" },
newArr = [1, 2, 3],
regExp = /123/gi;
function newFn() {
console.log("hello");
}
expect(moduleFake.getReference()).to.eql({});
moduleFake.__set__("myReference", newObj);
expect(moduleFake.getReference()).to.be(newObj);
moduleFake.__set__("myReference", newArr);
expect(moduleFake.getReference()).to.be(newArr);
moduleFake.__set__("myReference", newFn);
expect(moduleFake.getReference()).to.be(newFn);
moduleFake.__set__("myReference", regExp);
expect(moduleFake.getReference()).to.be(regExp);
});
it("should set the new number and the new obj when calling with an env-obj", function () {
var newObj = { hello: "hello" };
expect(moduleFake.getValue()).to.be(0);
expect(moduleFake.getReference()).to.eql({});
moduleFake.__set__({
myValue: 2,
myReference: newObj
});
expect(moduleFake.getValue()).to.be(2);
expect(moduleFake.getReference()).to.be(newObj);
});
it("should return a function that when invoked reverts to the values before set was called", function () {
undo = moduleFake.__set__("myValue", 4);
expect(undo).to.be.a("function");
expect(moduleFake.getValue()).to.be(4);
undo();
expect(moduleFake.getValue()).to.be(0);
});
it("should be able to revert when calling with an env-obj", function () {
var newObj = { hello: "hello" };
expect(moduleFake.getValue()).to.be(0);
expect(moduleFake.getReference()).to.eql({});
undo = moduleFake.__set__({
myValue: 2,
myReference: newObj
});
expect(moduleFake.getValue()).to.be(2);
expect(moduleFake.getReference()).to.be(newObj);
undo();
expect(moduleFake.getValue()).to.be(0);
expect(moduleFake.getReference()).to.eql({});
});
it("should throw a TypeError when passing misfitting params", function () {
expect(function () {
moduleFake.__set__();
}).to.throwException(expectTypeError);
expect(function () {
moduleFake.__set__(undefined);
}).to.throwException(expectTypeError);
expect(function () {
moduleFake.__set__(null);
}).to.throwException(expectTypeError);
expect(function () {
moduleFake.__set__(true);
}).to.throwException(expectTypeError);
expect(function () {
moduleFake.__set__(2);
}).to.throwException(expectTypeError);
expect(function () {
moduleFake.__set__("");
}).to.throwException(expectTypeError);
expect(function () {
moduleFake.__set__(function () {});
}).to.throwException(expectTypeError);
});
});
rewire-6.0.0/test/__with__.test.js 0000644 0001750 0001750 00000014505 14157477202 016420 0 ustar nilesh nilesh var expect = require("expect.js"),
__with__ = require("../lib/__with__.js"),
__set__ = require("../lib/__set__.js"),
vm = require("vm"),
expectTypeError = expectError(TypeError);
function expectError(ErrConstructor) {
return function expectReferenceError(err) {
expect(err.constructor.name).to.be(ErrConstructor.name);
};
}
describe("__with__", function() {
var moduleFake,
newObj;
beforeEach(function () {
moduleFake = {
module: {
exports: {}
},
myValue: 0, // copy by value
myReference: {} // copy by reference
};
newObj = { hello: "hello" };
vm.runInNewContext(
//__with__ requires __set__ to be present on module.exports
"module.exports.__set__ = " + __set__.toString() + "; " +
"__with__ = " + __with__.toString() + "; " +
"getValue = function () { return myValue; }; " +
"getReference = function () { return myReference; }; ",
moduleFake
);
});
it("should return a function", function () {
expect(moduleFake.__with__({
myValue: 2,
myReference: newObj
})).to.be.a("function");
});
it("should return a function that can be invoked with a callback which guarantees __set__'s undo function is called for you at the end", function () {
expect(moduleFake.getValue()).to.be(0);
expect(moduleFake.getReference()).to.eql({});
moduleFake.__with__({
myValue: 2,
myReference: newObj
})(function () {
// changes will be visible from within this callback function
expect(moduleFake.getValue()).to.be(2);
expect(moduleFake.getReference()).to.be(newObj);
});
// undo will automatically get called for you after returning from your callback function
expect(moduleFake.getValue()).to.be(0);
expect(moduleFake.getReference()).to.eql({});
});
it("should also accept a variable name and a variable value (just like __set__)", function () {
expect(moduleFake.getValue()).to.be(0);
moduleFake.__with__("myValue", 2)(function () {
expect(moduleFake.getValue()).to.be(2);
});
expect(moduleFake.getValue()).to.be(0);
expect(moduleFake.getReference()).to.eql({});
moduleFake.__with__("myReference", newObj)(function () {
expect(moduleFake.getReference()).to.be(newObj);
});
expect(moduleFake.getReference()).to.eql({});
});
it("should still revert values if the callback throws an exception", function(){
expect(function withError() {
moduleFake.__with__({
myValue: 2,
myReference: newObj
})(function () {
throw new Error("something went wrong...");
});
}).to.throwError();
expect(moduleFake.getValue()).to.be(0);
expect(moduleFake.getReference()).to.eql({});
});
it("should throw an error if something other than a function is passed as the callback", function() {
var withFunction = moduleFake.__with__({
myValue: 2,
myReference: newObj
});
function callWithFunction() {
var args = arguments;
return function () {
withFunction.apply(null, args);
};
}
expect(callWithFunction(1)).to.throwError(expectTypeError);
expect(callWithFunction("a string")).to.throwError(expectTypeError);
expect(callWithFunction({})).to.throwError(expectTypeError);
expect(callWithFunction(function(){})).to.not.throwError(expectTypeError);
});
describe("using promises", function () {
var promiseFake;
beforeEach(function () {
promiseFake = {
then: function (onResolve, onReject) {
promiseFake.onResolve = onResolve;
promiseFake.onReject = onReject;
}
};
});
it("should pass the returned promise through", function () {
var fn = moduleFake.__with__({});
expect(fn(function () {
return promiseFake;
})).to.equal(promiseFake);
});
it("should not undo any changes until the promise has been resolved", function () {
expect(moduleFake.getValue()).to.be(0);
expect(moduleFake.getReference()).to.eql({});
moduleFake.__with__({
myValue: 2,
myReference: newObj
})(function () {
return promiseFake;
});
// the change should still be present at this point
expect(moduleFake.getValue()).to.be(2);
expect(moduleFake.getReference()).to.be(newObj);
promiseFake.onResolve();
// now everything should be back to normal
expect(moduleFake.getValue()).to.be(0);
expect(moduleFake.getReference()).to.eql({});
});
it("should also undo any changes if the promise has been rejected", function () {
expect(moduleFake.getValue()).to.be(0);
expect(moduleFake.getReference()).to.eql({});
moduleFake.__with__({
myValue: 2,
myReference: newObj
})(function () {
return promiseFake;
});
// the change should still be present at this point
expect(moduleFake.getValue()).to.be(2);
expect(moduleFake.getReference()).to.be(newObj);
promiseFake.onReject();
// now everything should be back to normal
expect(moduleFake.getValue()).to.be(0);
expect(moduleFake.getReference()).to.eql({});
});
it("should ignore any returned value which doesn't provide a then()-method", function () {
expect(moduleFake.getValue()).to.be(0);
expect(moduleFake.getReference()).to.eql({});
moduleFake.__with__({
myValue: 2,
myReference: newObj
})(function () {
return {};
});
expect(moduleFake.getValue()).to.be(0);
expect(moduleFake.getReference()).to.eql({});
});
});
});
rewire-6.0.0/test/__get__.test.js 0000644 0001750 0001750 00000005160 14157477202 016221 0 ustar nilesh nilesh var expect = require("expect.js"),
vm = require("vm"),
__get__ = require("../lib/__get__.js"),
expectReferenceError = expectError(ReferenceError),
expectTypeError = expectError(TypeError);
function expectError(ErrConstructor) {
return function expectReferenceError(err) {
expect(err.constructor.name).to.be(ErrConstructor.name);
};
}
describe("__get__", function () {
var moduleFake;
beforeEach(function () {
moduleFake = {
__filename: "some/file.js",
myNumber: 0,
myObj: {}
};
vm.runInNewContext(
"__get__ = " + __get__.toString() + "; " +
"setNumber = function (value) { myNumber = value; }; " +
"setObj = function (value) { myObj = value; }; ",
moduleFake,
__filename
);
});
it("should return the initial value", function () {
expect(moduleFake.__get__("myNumber")).to.be(0);
expect(moduleFake.__get__("myObj")).to.eql({});
});
it("should return the changed value of the number", function () {
var newObj = { hello: "hello" };
moduleFake.setNumber(2);
moduleFake.setObj(newObj);
expect(moduleFake.__get__("myNumber")).to.be(2);
expect(moduleFake.__get__("myObj")).to.be(newObj);
});
it("should throw a ReferenceError when getting not existing vars", function () {
expect(function () {
moduleFake.__get__("blabla");
}).to.throwException(expectReferenceError);
});
it("should throw a TypeError when passing misfitting params", function () {
expect(function () {
moduleFake.__get__();
}).to.throwException(expectTypeError);
expect(function () {
moduleFake.__get__(undefined);
}).to.throwException(expectTypeError);
expect(function () {
moduleFake.__get__(null);
}).to.throwException(expectTypeError);
expect(function () {
moduleFake.__get__(true);
}).to.throwException(expectTypeError);
expect(function () {
moduleFake.__get__(2);
}).to.throwException(expectTypeError);
expect(function () {
moduleFake.__get__("");
}).to.throwException(expectTypeError);
expect(function () {
moduleFake.__get__([]);
}).to.throwException(expectTypeError);
expect(function () {
moduleFake.__get__({});
}).to.throwException(expectTypeError);
expect(function () {
moduleFake.__get__(function () {});
}).to.throwException(expectTypeError);
});
}); rewire-6.0.0/test/getImportGlobalsSrc.test.js 0000644 0001750 0001750 00000004606 14157477202 020600 0 ustar nilesh nilesh var expect = require("expect.js"),
vm = require("vm"),
getImportGlobalsSrc = require("../lib/getImportGlobalsSrc.js");
describe("getImportGlobalsSrc", function () {
it("should declare all globals with a var", function () {
var context = {
global: global
},
expectedGlobals,
src,
actualGlobals;
// Temporarily set module-internal variables on the global scope to check if getImportGlobalsSrc()
// ignores them properly
global.module = module;
global.exports = exports;
global.require = require;
// Also make sure it ignores invalid variable names
global['a-b'] = true;
src = getImportGlobalsSrc();
delete global.module;
delete global.exports;
delete global.require;
delete global['__core-js_shared__'];
delete global['a-b'];
const ignoredGlobals = ["module", "exports", "require", "undefined", "eval", "arguments", "GLOBAL", "root", "NaN", "Infinity"];
const globals = Object.getOwnPropertyNames(global);
expectedGlobals = globals.filter((el) => !ignoredGlobals.includes(el));
vm.runInNewContext(src, context);
actualGlobals = Object.getOwnPropertyNames(context);
actualGlobals.sort();
expectedGlobals.sort();
expect(actualGlobals).to.eql(expectedGlobals);
expect(actualGlobals.length).to.be.above(1);
});
it("should ignore the given variables", function () {
var context = {
global: global
},
ignore = ["console", "setTimeout"],
src,
actualGlobals,
expectedGlobals = Object.getOwnPropertyNames(global);
const ignoredGlobals = ["module", "exports", "require", "undefined", "eval", "arguments", "GLOBAL", "root", "NaN", "Infinity"];
ignore = ignore.concat(ignoredGlobals);
// getImportGlobalsSrc modifies the ignore array, so let's create a copy
src = getImportGlobalsSrc(ignore.slice(0));
expectedGlobals = expectedGlobals.filter((el) => !ignore.includes(el));
vm.runInNewContext(src, context);
actualGlobals = Object.keys(context);
actualGlobals.sort();
expectedGlobals.sort();
expect(actualGlobals).to.eql(expectedGlobals);
expect(actualGlobals.length).to.be.above(1);
});
});
rewire-6.0.0/.jshintrc 0000644 0001750 0001750 00000000221 14157477202 014171 0 ustar nilesh nilesh {
"browser": true,
"node": true,
"expr": true,
"globals": ["describe", "it", "before", "after", "beforeEach", "afterEach"]
}