l?r():void(w()||e())},0)}();else for(;p<=i&&Date.now()<=l;){var y=w();if(y)return y}},addToPath:function(e,n,t,r){var i=e.lastComponent;return i&&i.added===n&&i.removed===t?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:n,removed:t,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:n,removed:t,previousComponent:i}}},extractCommon:function(e,n,t,r){for(var i=n.length,o=t.length,l=e.oldPos,s=l-r,a=0;s+1e.length)&&(n=e.length);for(var t=0,r=new Array(n);t (\n str: string,\n options?: ParseOptions & TokensToFunctionOptions,\n) {\n return tokensToFunction (parse(str, options), options);\n}\n\nexport type PathFunction = (data?: P) => string;\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nexport function tokensToFunction (\n tokens: Token[],\n options: TokensToFunctionOptions = {},\n): PathFunction {\n const reFlags = flags(options);\n const { encode = (x: string) => x, validate = true } = options;\n\n // Compile all the tokens into regexps.\n const matches = tokens.map((token) => {\n if (typeof token === \"object\") {\n return new RegExp(`^(?:${token.pattern})$`, reFlags);\n }\n });\n\n return (data: Record {\n path: string;\n index: number;\n params: P;\n}\n\n/**\n * A match is either `false` (no match) or a match result.\n */\nexport type Match = false | MatchResult ;\n\n/**\n * The match function takes a string and returns whether it matched the path.\n */\nexport type MatchFunction = (\n path: string,\n) => Match ;\n\n/**\n * Create path match function from `path-to-regexp` spec.\n */\nexport function match (\n str: Path,\n options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions,\n) {\n const keys: Key[] = [];\n const re = pathToRegexp(str, keys, options);\n return regexpToFunction (re, keys, options);\n}\n\n/**\n * Create a path match function from `path-to-regexp` output.\n */\nexport function regexpToFunction (\n re: RegExp,\n keys: Key[],\n options: RegexpToFunctionOptions = {},\n): MatchFunction {\n const { decode = (x: string) => x } = options;\n\n return function (pathname: string) {\n const m = re.exec(pathname);\n if (!m) return false;\n\n const { 0: path, index } = m;\n const params = Object.create(null);\n\n for (let i = 1; i < m.length; i++) {\n if (m[i] === undefined) continue;\n\n const key = keys[i - 1];\n\n if (key.modifier === \"*\" || key.modifier === \"+\") {\n params[key.name] = m[i].split(key.prefix + key.suffix).map((value) => {\n return decode(value, key);\n });\n } else {\n params[key.name] = decode(m[i], key);\n }\n }\n\n return { path, index, params };\n };\n}\n\n/**\n * Escape a regular expression string.\n */\nfunction escapeString(str: string) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n}\n\n/**\n * Get the flags for a regexp from the options.\n */\nfunction flags(options?: { sensitive?: boolean }) {\n return options && options.sensitive ? \"\" : \"i\";\n}\n\n/**\n * Metadata about a key.\n */\nexport interface Key {\n name: string | number;\n prefix: string;\n suffix: string;\n pattern: string;\n modifier: string;\n}\n\n/**\n * A token is a string (nothing special) or key metadata (capture group).\n */\nexport type Token = string | Key;\n\n/**\n * Pull out keys from a regexp.\n */\nfunction regexpToRegexp(path: RegExp, keys?: Key[]): RegExp {\n if (!keys) return path;\n\n const groupsRegex = /\\((?:\\?<(.*?)>)?(?!\\?)/g;\n\n let index = 0;\n let execResult = groupsRegex.exec(path.source);\n while (execResult) {\n keys.push({\n // Use parenthesized substring match if available, index otherwise\n name: execResult[1] || index++,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\",\n });\n execResult = groupsRegex.exec(path.source);\n }\n\n return path;\n}\n\n/**\n * Transform an array into a regexp.\n */\nfunction arrayToRegexp(\n paths: Array (str: string, options?: ParseOptions & TokensToFunctionOptions): PathFunction ;
+export type PathFunction = (data?: P) => string;
+/**
+ * Expose a method for transforming tokens into the path function.
+ */
+export declare function tokensToFunction (tokens: Token[], options?: TokensToFunctionOptions): PathFunction ;
+export interface RegexpToFunctionOptions {
+ /**
+ * Function for decoding strings for params.
+ */
+ decode?: (value: string, token: Key) => string;
+}
+/**
+ * A match result contains data about the path match.
+ */
+export interface MatchResult {
+ path: string;
+ index: number;
+ params: P;
+}
+/**
+ * A match is either `false` (no match) or a match result.
+ */
+export type Match = false | MatchResult ;
+/**
+ * The match function takes a string and returns whether it matched the path.
+ */
+export type MatchFunction = (path: string) => Match ;
+/**
+ * Create path match function from `path-to-regexp` spec.
+ */
+export declare function match (str: Path, options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions): MatchFunction ;
+/**
+ * Create a path match function from `path-to-regexp` output.
+ */
+export declare function regexpToFunction (re: RegExp, keys: Key[], options?: RegexpToFunctionOptions): MatchFunction ;
+/**
+ * Metadata about a key.
+ */
+export interface Key {
+ name: string | number;
+ prefix: string;
+ suffix: string;
+ pattern: string;
+ modifier: string;
+}
+/**
+ * A token is a string (nothing special) or key metadata (capture group).
+ */
+export type Token = string | Key;
+export interface TokensToRegexpOptions {
+ /**
+ * When `true` the regexp will be case sensitive. (default: `false`)
+ */
+ sensitive?: boolean;
+ /**
+ * When `true` the regexp won't allow an optional trailing delimiter to match. (default: `false`)
+ */
+ strict?: boolean;
+ /**
+ * When `true` the regexp will match to the end of the string. (default: `true`)
+ */
+ end?: boolean;
+ /**
+ * When `true` the regexp will match from the beginning of the string. (default: `true`)
+ */
+ start?: boolean;
+ /**
+ * Sets the final character for non-ending optimistic matches. (default: `/`)
+ */
+ delimiter?: string;
+ /**
+ * List of characters that can also be "end" characters.
+ */
+ endsWith?: string;
+ /**
+ * Encode path tokens for use in the `RegExp`.
+ */
+ encode?: (value: string) => string;
+}
+/**
+ * Expose a function for taking tokens and returning a RegExp.
+ */
+export declare function tokensToRegexp(tokens: Token[], keys?: Key[], options?: TokensToRegexpOptions): RegExp;
+/**
+ * Supported `path-to-regexp` input types.
+ */
+export type Path = string | RegExp | Array (\n str: string,\n options?: ParseOptions & TokensToFunctionOptions,\n) {\n return tokensToFunction (parse(str, options), options);\n}\n\nexport type PathFunction = (data?: P) => string;\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nexport function tokensToFunction (\n tokens: Token[],\n options: TokensToFunctionOptions = {},\n): PathFunction {\n const reFlags = flags(options);\n const { encode = (x: string) => x, validate = true } = options;\n\n // Compile all the tokens into regexps.\n const matches = tokens.map((token) => {\n if (typeof token === \"object\") {\n return new RegExp(`^(?:${token.pattern})$`, reFlags);\n }\n });\n\n return (data: Record {\n path: string;\n index: number;\n params: P;\n}\n\n/**\n * A match is either `false` (no match) or a match result.\n */\nexport type Match = false | MatchResult ;\n\n/**\n * The match function takes a string and returns whether it matched the path.\n */\nexport type MatchFunction = (\n path: string,\n) => Match ;\n\n/**\n * Create path match function from `path-to-regexp` spec.\n */\nexport function match (\n str: Path,\n options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions,\n) {\n const keys: Key[] = [];\n const re = pathToRegexp(str, keys, options);\n return regexpToFunction (re, keys, options);\n}\n\n/**\n * Create a path match function from `path-to-regexp` output.\n */\nexport function regexpToFunction (\n re: RegExp,\n keys: Key[],\n options: RegexpToFunctionOptions = {},\n): MatchFunction {\n const { decode = (x: string) => x } = options;\n\n return function (pathname: string) {\n const m = re.exec(pathname);\n if (!m) return false;\n\n const { 0: path, index } = m;\n const params = Object.create(null);\n\n for (let i = 1; i < m.length; i++) {\n if (m[i] === undefined) continue;\n\n const key = keys[i - 1];\n\n if (key.modifier === \"*\" || key.modifier === \"+\") {\n params[key.name] = m[i].split(key.prefix + key.suffix).map((value) => {\n return decode(value, key);\n });\n } else {\n params[key.name] = decode(m[i], key);\n }\n }\n\n return { path, index, params };\n };\n}\n\n/**\n * Escape a regular expression string.\n */\nfunction escapeString(str: string) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n}\n\n/**\n * Get the flags for a regexp from the options.\n */\nfunction flags(options?: { sensitive?: boolean }) {\n return options && options.sensitive ? \"\" : \"i\";\n}\n\n/**\n * Metadata about a key.\n */\nexport interface Key {\n name: string | number;\n prefix: string;\n suffix: string;\n pattern: string;\n modifier: string;\n}\n\n/**\n * A token is a string (nothing special) or key metadata (capture group).\n */\nexport type Token = string | Key;\n\n/**\n * Pull out keys from a regexp.\n */\nfunction regexpToRegexp(path: RegExp, keys?: Key[]): RegExp {\n if (!keys) return path;\n\n const groupsRegex = /\\((?:\\?<(.*?)>)?(?!\\?)/g;\n\n let index = 0;\n let execResult = groupsRegex.exec(path.source);\n while (execResult) {\n keys.push({\n // Use parenthesized substring match if available, index otherwise\n name: execResult[1] || index++,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\",\n });\n execResult = groupsRegex.exec(path.source);\n }\n\n return path;\n}\n\n/**\n * Transform an array into a regexp.\n */\nfunction arrayToRegexp(\n paths: Array"),t.push((n=i.value,n.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""))),i.added?t.push(""):i.removed&&t.push("")}return t.join("")},e.createPatch=function(e,n,t,r,i,o){return b(e,e,n,t,r,i,o)},e.createTwoFilesPatch=b,e.diffArrays=function(e,n,t){return g.diff(e,n,t)},e.diffChars=function(e,n,t){return r.diff(e,n,t)},e.diffCss=function(e,n,t){return d.diff(e,n,t)},e.diffJson=function(e,n,t){return v.diff(e,n,t)},e.diffLines=L,e.diffSentences=function(e,n,t){return u.diff(e,n,t)},e.diffTrimmedLines=function(e,n,t){var r=i(t,{ignoreWhitespace:!0});return a.diff(e,n,r)},e.diffWords=function(e,n,t){return t=i(t,{ignoreWhitespace:!0}),s.diff(e,n,t)},e.diffWordsWithSpace=function(e,n,t){return s.diff(e,n,t)},e.formatPatch=S,e.merge=function(e,n,t){e=N(e,t),n=N(n,t);var r={};(e.index||n.index)&&(r.index=e.index||n.index),(e.newFileName||n.newFileName)&&(P(e)?P(n)?(r.oldFileName=j(r,e.oldFileName,n.oldFileName),r.newFileName=j(r,e.newFileName,n.newFileName),r.oldHeader=j(r,e.oldHeader,n.oldHeader),r.newHeader=j(r,e.newHeader,n.newHeader)):(r.oldFileName=e.oldFileName,r.newFileName=e.newFileName,r.oldHeader=e.oldHeader,r.newHeader=e.newHeader):(r.oldFileName=n.oldFileName||e.oldFileName,r.newFileName=n.newFileName||e.newFileName,r.oldHeader=n.oldHeader||e.oldHeader,r.newHeader=n.newHeader||e.newHeader)),r.hunks=[];for(var i=0,o=0,l=0,s=0;i
-
-Simple functions shared among the sinon end user libraries
-
-## Rules
-
-- Follows the [Sinon.JS compatibility](https://github.com/sinonjs/sinon/blob/master/CONTRIBUTING.md#compatibility)
-- 100% test coverage
-- Code formatted using [Prettier](https://prettier.io)
-- No side effects welcome! (only pure functions)
-- No platform specific functions
-- One export per file (any bundler can do tree shaking)
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/called-in-order.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/called-in-order.js
deleted file mode 100644
index 4edb67fa5e..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/called-in-order.js
+++ /dev/null
@@ -1,57 +0,0 @@
-"use strict";
-
-var every = require("./prototypes/array").every;
-
-/**
- * @private
- */
-function hasCallsLeft(callMap, spy) {
- if (callMap[spy.id] === undefined) {
- callMap[spy.id] = 0;
- }
-
- return callMap[spy.id] < spy.callCount;
-}
-
-/**
- * @private
- */
-function checkAdjacentCalls(callMap, spy, index, spies) {
- var calledBeforeNext = true;
-
- if (index !== spies.length - 1) {
- calledBeforeNext = spy.calledBefore(spies[index + 1]);
- }
-
- if (hasCallsLeft(callMap, spy) && calledBeforeNext) {
- callMap[spy.id] += 1;
- return true;
- }
-
- return false;
-}
-
-/**
- * A Sinon proxy object (fake, spy, stub)
- *
- * @typedef {object} SinonProxy
- * @property {Function} calledBefore - A method that determines if this proxy was called before another one
- * @property {string} id - Some id
- * @property {number} callCount - Number of times this proxy has been called
- */
-
-/**
- * Returns true when the spies have been called in the order they were supplied in
- *
- * @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments
- * @returns {boolean} true when spies are called in order, false otherwise
- */
-function calledInOrder(spies) {
- var callMap = {};
- // eslint-disable-next-line no-underscore-dangle
- var _spies = arguments.length > 1 ? arguments : spies;
-
- return every(_spies, checkAdjacentCalls.bind(null, callMap));
-}
-
-module.exports = calledInOrder;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/called-in-order.test.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/called-in-order.test.js
deleted file mode 100644
index 5fe66118b8..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/called-in-order.test.js
+++ /dev/null
@@ -1,121 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var calledInOrder = require("./called-in-order");
-var sinon = require("@sinonjs/referee-sinon").sinon;
-
-var testObject1 = {
- someFunction: function () {
- return;
- },
-};
-var testObject2 = {
- otherFunction: function () {
- return;
- },
-};
-var testObject3 = {
- thirdFunction: function () {
- return;
- },
-};
-
-function testMethod() {
- testObject1.someFunction();
- testObject2.otherFunction();
- testObject2.otherFunction();
- testObject2.otherFunction();
- testObject3.thirdFunction();
-}
-
-describe("calledInOrder", function () {
- beforeEach(function () {
- sinon.stub(testObject1, "someFunction");
- sinon.stub(testObject2, "otherFunction");
- sinon.stub(testObject3, "thirdFunction");
- testMethod();
- });
- afterEach(function () {
- testObject1.someFunction.restore();
- testObject2.otherFunction.restore();
- testObject3.thirdFunction.restore();
- });
-
- describe("given single array argument", function () {
- describe("when stubs were called in expected order", function () {
- it("returns true", function () {
- assert.isTrue(
- calledInOrder([
- testObject1.someFunction,
- testObject2.otherFunction,
- ])
- );
- assert.isTrue(
- calledInOrder([
- testObject1.someFunction,
- testObject2.otherFunction,
- testObject2.otherFunction,
- testObject3.thirdFunction,
- ])
- );
- });
- });
-
- describe("when stubs were called in unexpected order", function () {
- it("returns false", function () {
- assert.isFalse(
- calledInOrder([
- testObject2.otherFunction,
- testObject1.someFunction,
- ])
- );
- assert.isFalse(
- calledInOrder([
- testObject2.otherFunction,
- testObject1.someFunction,
- testObject1.someFunction,
- testObject3.thirdFunction,
- ])
- );
- });
- });
- });
-
- describe("given multiple arguments", function () {
- describe("when stubs were called in expected order", function () {
- it("returns true", function () {
- assert.isTrue(
- calledInOrder(
- testObject1.someFunction,
- testObject2.otherFunction
- )
- );
- assert.isTrue(
- calledInOrder(
- testObject1.someFunction,
- testObject2.otherFunction,
- testObject3.thirdFunction
- )
- );
- });
- });
-
- describe("when stubs were called in unexpected order", function () {
- it("returns false", function () {
- assert.isFalse(
- calledInOrder(
- testObject2.otherFunction,
- testObject1.someFunction
- )
- );
- assert.isFalse(
- calledInOrder(
- testObject2.otherFunction,
- testObject1.someFunction,
- testObject3.thirdFunction
- )
- );
- });
- });
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/class-name.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/class-name.js
deleted file mode 100644
index bcd26baeaa..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/class-name.js
+++ /dev/null
@@ -1,27 +0,0 @@
-"use strict";
-
-var functionName = require("./function-name");
-
-/**
- * Returns a display name for a value from a constructor
- *
- * @param {object} value A value to examine
- * @returns {(string|null)} A string or null
- */
-function className(value) {
- return (
- (value.constructor && value.constructor.name) ||
- // The next branch is for IE11 support only:
- // Because the name property is not set on the prototype
- // of the Function object, we finally try to grab the
- // name from its definition. This will never be reached
- // in node, so we are not able to test this properly.
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
- (typeof value.constructor === "function" &&
- /* istanbul ignore next */
- functionName(value.constructor)) ||
- null
- );
-}
-
-module.exports = className;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/class-name.test.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/class-name.test.js
deleted file mode 100644
index 994f21b817..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/class-name.test.js
+++ /dev/null
@@ -1,37 +0,0 @@
-"use strict";
-/* eslint-disable no-empty-function */
-
-var assert = require("@sinonjs/referee").assert;
-var className = require("./class-name");
-
-describe("className", function () {
- it("returns the class name of an instance", function () {
- // Because eslint-config-sinon disables es6, we can't
- // use a class definition here
- // https://github.com/sinonjs/eslint-config-sinon/blob/master/index.js
- // var instance = new (class TestClass {})();
- var instance = new (function TestClass() {})();
- var name = className(instance);
- assert.equals(name, "TestClass");
- });
-
- it("returns 'Object' for {}", function () {
- var name = className({});
- assert.equals(name, "Object");
- });
-
- it("returns null for an object that has no prototype", function () {
- var obj = Object.create(null);
- var name = className(obj);
- assert.equals(name, null);
- });
-
- it("returns null for an object whose prototype was mangled", function () {
- // This is what Node v6 and v7 do for objects returned by querystring.parse()
- function MangledObject() {}
- MangledObject.prototype = Object.create(null);
- var obj = new MangledObject();
- var name = className(obj);
- assert.equals(name, null);
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/deprecated.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/deprecated.js
deleted file mode 100644
index 4222725427..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/deprecated.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* eslint-disable no-console */
-"use strict";
-
-/**
- * Returns a function that will invoke the supplied function and print a
- * deprecation warning to the console each time it is called.
- *
- * @param {Function} func
- * @param {string} msg
- * @returns {Function}
- */
-exports.wrap = function (func, msg) {
- var wrapped = function () {
- exports.printWarning(msg);
- return func.apply(this, arguments);
- };
- if (func.prototype) {
- wrapped.prototype = func.prototype;
- }
- return wrapped;
-};
-
-/**
- * Returns a string which can be supplied to `wrap()` to notify the user that a
- * particular part of the sinon API has been deprecated.
- *
- * @param {string} packageName
- * @param {string} funcName
- * @returns {string}
- */
-exports.defaultMsg = function (packageName, funcName) {
- return `${packageName}.${funcName} is deprecated and will be removed from the public API in a future version of ${packageName}.`;
-};
-
-/**
- * Prints a warning on the console, when it exists
- *
- * @param {string} msg
- * @returns {undefined}
- */
-exports.printWarning = function (msg) {
- /* istanbul ignore next */
- if (typeof process === "object" && process.emitWarning) {
- // Emit Warnings in Node
- process.emitWarning(msg);
- } else if (console.info) {
- console.info(msg);
- } else {
- console.log(msg);
- }
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/deprecated.test.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/deprecated.test.js
deleted file mode 100644
index 275d8b1c92..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/deprecated.test.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/* eslint-disable no-console */
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var sinon = require("@sinonjs/referee-sinon").sinon;
-
-var deprecated = require("./deprecated");
-
-var msg = "test";
-
-describe("deprecated", function () {
- describe("defaultMsg", function () {
- it("should return a string", function () {
- assert.equals(
- deprecated.defaultMsg("sinon", "someFunc"),
- "sinon.someFunc is deprecated and will be removed from the public API in a future version of sinon."
- );
- });
- });
-
- describe("printWarning", function () {
- beforeEach(function () {
- sinon.replace(process, "emitWarning", sinon.fake());
- });
-
- afterEach(sinon.restore);
-
- describe("when `process.emitWarning` is defined", function () {
- it("should call process.emitWarning with a msg", function () {
- deprecated.printWarning(msg);
- assert.calledOnceWith(process.emitWarning, msg);
- });
- });
-
- describe("when `process.emitWarning` is undefined", function () {
- beforeEach(function () {
- sinon.replace(console, "info", sinon.fake());
- sinon.replace(console, "log", sinon.fake());
- process.emitWarning = undefined;
- });
-
- afterEach(sinon.restore);
-
- describe("when `console.info` is defined", function () {
- it("should call `console.info` with a message", function () {
- deprecated.printWarning(msg);
- assert.calledOnceWith(console.info, msg);
- });
- });
-
- describe("when `console.info` is undefined", function () {
- it("should call `console.log` with a message", function () {
- console.info = undefined;
- deprecated.printWarning(msg);
- assert.calledOnceWith(console.log, msg);
- });
- });
- });
- });
-
- describe("wrap", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- var method = sinon.fake();
- var wrapped;
-
- beforeEach(function () {
- wrapped = deprecated.wrap(method, msg);
- });
-
- it("should return a wrapper function", function () {
- assert.match(wrapped, sinon.match.func);
- });
-
- it("should assign the prototype of the passed method", function () {
- assert.equals(method.prototype, wrapped.prototype);
- });
-
- context("when the passed method has falsy prototype", function () {
- it("should not be assigned to the wrapped method", function () {
- method.prototype = null;
- wrapped = deprecated.wrap(method, msg);
- assert.match(wrapped.prototype, sinon.match.object);
- });
- });
-
- context("when invoking the wrapped function", function () {
- before(function () {
- sinon.replace(deprecated, "printWarning", sinon.fake());
- wrapped({});
- });
-
- it("should call `printWarning` before invoking", function () {
- assert.calledOnceWith(deprecated.printWarning, msg);
- });
-
- it("should invoke the passed method with the given arguments", function () {
- assert.calledOnceWith(method, {});
- });
- });
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/every.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/every.js
deleted file mode 100644
index 00bf304e28..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/every.js
+++ /dev/null
@@ -1,27 +0,0 @@
-"use strict";
-
-/**
- * Returns true when fn returns true for all members of obj.
- * This is an every implementation that works for all iterables
- *
- * @param {object} obj
- * @param {Function} fn
- * @returns {boolean}
- */
-module.exports = function every(obj, fn) {
- var pass = true;
-
- try {
- // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods
- obj.forEach(function () {
- if (!fn.apply(this, arguments)) {
- // Throwing an error is the only way to break `forEach`
- throw new Error();
- }
- });
- } catch (e) {
- pass = false;
- }
-
- return pass;
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/every.test.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/every.test.js
deleted file mode 100644
index e054a14de5..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/every.test.js
+++ /dev/null
@@ -1,41 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var sinon = require("@sinonjs/referee-sinon").sinon;
-var every = require("./every");
-
-describe("util/core/every", function () {
- it("returns true when the callback function returns true for every element in an iterable", function () {
- var obj = [true, true, true, true];
- var allTrue = every(obj, function (val) {
- return val;
- });
-
- assert(allTrue);
- });
-
- it("returns false when the callback function returns false for any element in an iterable", function () {
- var obj = [true, true, true, false];
- var result = every(obj, function (val) {
- return val;
- });
-
- assert.isFalse(result);
- });
-
- it("calls the given callback once for each item in an iterable until it returns false", function () {
- var iterableOne = [true, true, true, true];
- var iterableTwo = [true, true, false, true];
- var callback = sinon.spy(function (val) {
- return val;
- });
-
- every(iterableOne, callback);
- assert.equals(callback.callCount, 4);
-
- callback.resetHistory();
-
- every(iterableTwo, callback);
- assert.equals(callback.callCount, 3);
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/function-name.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/function-name.js
deleted file mode 100644
index 199b04e0d1..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/function-name.js
+++ /dev/null
@@ -1,29 +0,0 @@
-"use strict";
-
-/**
- * Returns a display name for a function
- *
- * @param {Function} func
- * @returns {string}
- */
-module.exports = function functionName(func) {
- if (!func) {
- return "";
- }
-
- try {
- return (
- func.displayName ||
- func.name ||
- // Use function decomposition as a last resort to get function
- // name. Does not rely on function decomposition to work - if it
- // doesn't debugging will be slightly less informative
- // (i.e. toString will say 'spy' rather than 'myFunc').
- (String(func).match(/function ([^\s(]+)/) || [])[1]
- );
- } catch (e) {
- // Stringify may fail and we might get an exception, as a last-last
- // resort fall back to empty string.
- return "";
- }
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/function-name.test.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/function-name.test.js
deleted file mode 100644
index 0798b4e7f7..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/function-name.test.js
+++ /dev/null
@@ -1,76 +0,0 @@
-"use strict";
-
-var jsc = require("jsverify");
-var refute = require("@sinonjs/referee-sinon").refute;
-
-var functionName = require("./function-name");
-
-describe("function-name", function () {
- it("should return empty string if func is falsy", function () {
- jsc.assertForall("falsy", function (fn) {
- return functionName(fn) === "";
- });
- });
-
- it("should use displayName by default", function () {
- jsc.assertForall("nestring", function (displayName) {
- var fn = { displayName: displayName };
-
- return functionName(fn) === fn.displayName;
- });
- });
-
- it("should use name if displayName is not available", function () {
- jsc.assertForall("nestring", function (name) {
- var fn = { name: name };
-
- return functionName(fn) === fn.name;
- });
- });
-
- it("should fallback to string parsing", function () {
- jsc.assertForall("nat", function (naturalNumber) {
- var name = `fn${naturalNumber}`;
- var fn = {
- toString: function () {
- return `\nfunction ${name}`;
- },
- };
-
- return functionName(fn) === name;
- });
- });
-
- it("should not fail when a name cannot be found", function () {
- refute.exception(function () {
- var fn = {
- toString: function () {
- return "\nfunction (";
- },
- };
-
- functionName(fn);
- });
- });
-
- it("should not fail when toString is undefined", function () {
- refute.exception(function () {
- functionName(Object.create(null));
- });
- });
-
- it("should not fail when toString throws", function () {
- refute.exception(function () {
- var fn;
- try {
- // eslint-disable-next-line no-eval
- fn = eval("(function*() {})")().constructor;
- } catch (e) {
- // env doesn't support generators
- return;
- }
-
- functionName(fn);
- });
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/global.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/global.js
deleted file mode 100644
index 51715a27c8..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/global.js
+++ /dev/null
@@ -1,22 +0,0 @@
-"use strict";
-
-/**
- * A reference to the global object
- *
- * @type {object} globalObject
- */
-var globalObject;
-
-/* istanbul ignore else */
-if (typeof global !== "undefined") {
- // Node
- globalObject = global;
-} else if (typeof window !== "undefined") {
- // Browser
- globalObject = window;
-} else {
- // WebWorker
- globalObject = self;
-}
-
-module.exports = globalObject;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/global.test.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/global.test.js
deleted file mode 100644
index 4fa73ebcf6..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/global.test.js
+++ /dev/null
@@ -1,16 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var globalObject = require("./global");
-
-describe("global", function () {
- before(function () {
- if (typeof global === "undefined") {
- this.skip();
- }
- });
-
- it("is same as global", function () {
- assert.same(globalObject, global);
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/index.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/index.js
deleted file mode 100644
index 870df32c80..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/index.js
+++ /dev/null
@@ -1,14 +0,0 @@
-"use strict";
-
-module.exports = {
- global: require("./global"),
- calledInOrder: require("./called-in-order"),
- className: require("./class-name"),
- deprecated: require("./deprecated"),
- every: require("./every"),
- functionName: require("./function-name"),
- orderByFirstCall: require("./order-by-first-call"),
- prototypes: require("./prototypes"),
- typeOf: require("./type-of"),
- valueToString: require("./value-to-string"),
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/index.test.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/index.test.js
deleted file mode 100644
index e79aa7ee0b..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/index.test.js
+++ /dev/null
@@ -1,31 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var index = require("./index");
-
-var expectedMethods = [
- "calledInOrder",
- "className",
- "every",
- "functionName",
- "orderByFirstCall",
- "typeOf",
- "valueToString",
-];
-var expectedObjectProperties = ["deprecated", "prototypes"];
-
-describe("package", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- expectedMethods.forEach(function (name) {
- it(`should export a method named ${name}`, function () {
- assert.isFunction(index[name]);
- });
- });
-
- // eslint-disable-next-line mocha/no-setup-in-describe
- expectedObjectProperties.forEach(function (name) {
- it(`should export an object property named ${name}`, function () {
- assert.isObject(index[name]);
- });
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/order-by-first-call.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/order-by-first-call.js
deleted file mode 100644
index c3d47edfeb..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/order-by-first-call.js
+++ /dev/null
@@ -1,36 +0,0 @@
-"use strict";
-
-var sort = require("./prototypes/array").sort;
-var slice = require("./prototypes/array").slice;
-
-/**
- * @private
- */
-function comparator(a, b) {
- // uuid, won't ever be equal
- var aCall = a.getCall(0);
- var bCall = b.getCall(0);
- var aId = (aCall && aCall.callId) || -1;
- var bId = (bCall && bCall.callId) || -1;
-
- return aId < bId ? -1 : 1;
-}
-
-/**
- * A Sinon proxy object (fake, spy, stub)
- *
- * @typedef {object} SinonProxy
- * @property {Function} getCall - A method that can return the first call
- */
-
-/**
- * Sorts an array of SinonProxy instances (fake, spy, stub) by their first call
- *
- * @param {SinonProxy[] | SinonProxy} spies
- * @returns {SinonProxy[]}
- */
-function orderByFirstCall(spies) {
- return sort(slice(spies), comparator);
-}
-
-module.exports = orderByFirstCall;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/order-by-first-call.test.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/order-by-first-call.test.js
deleted file mode 100644
index cbc71beb28..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/order-by-first-call.test.js
+++ /dev/null
@@ -1,52 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var knuthShuffle = require("knuth-shuffle").knuthShuffle;
-var sinon = require("@sinonjs/referee-sinon").sinon;
-var orderByFirstCall = require("./order-by-first-call");
-
-describe("orderByFirstCall", function () {
- it("should order an Array of spies by the callId of the first call, ascending", function () {
- // create an array of spies
- var spies = [
- sinon.spy(),
- sinon.spy(),
- sinon.spy(),
- sinon.spy(),
- sinon.spy(),
- sinon.spy(),
- ];
-
- // call all the spies
- spies.forEach(function (spy) {
- spy();
- });
-
- // add a few uncalled spies
- spies.push(sinon.spy());
- spies.push(sinon.spy());
-
- // randomise the order of the spies
- knuthShuffle(spies);
-
- var sortedSpies = orderByFirstCall(spies);
-
- assert.equals(sortedSpies.length, spies.length);
-
- var orderedByFirstCall = sortedSpies.every(function (spy, index) {
- if (index + 1 === sortedSpies.length) {
- return true;
- }
- var nextSpy = sortedSpies[index + 1];
-
- // uncalled spies should be ordered first
- if (!spy.called) {
- return true;
- }
-
- return spy.calledImmediatelyBefore(nextSpy);
- });
-
- assert.isTrue(orderedByFirstCall);
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/README.md b/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/README.md
deleted file mode 100644
index c3d92fe80a..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# Prototypes
-
-The functions in this folder are to be use for keeping cached references to the built-in prototypes, so that people can't inadvertently break the library by making mistakes in userland.
-
-See https://github.com/sinonjs/sinon/pull/1523
-
-## Without cached references
-
-```js
-// in userland, the library user needs to replace the filter method on
-// Array.prototype
-var array = [1, 2, 3];
-sinon.replace(array, "filter", sinon.fake.returns(2));
-
-// in a sinon module, the library author needs to use the filter method
-var someArray = ["a", "b", 42, "c"];
-var answer = filter(someArray, function (v) {
- return v === 42;
-});
-
-console.log(answer);
-// => 2
-```
-
-## With cached references
-
-```js
-// in userland, the library user needs to replace the filter method on
-// Array.prototype
-var array = [1, 2, 3];
-sinon.replace(array, "filter", sinon.fake.returns(2));
-
-// in a sinon module, the library author needs to use the filter method
-// get a reference to the original Array.prototype.filter
-var filter = require("@sinonjs/commons").prototypes.array.filter;
-var someArray = ["a", "b", 42, "c"];
-var answer = filter(someArray, function (v) {
- return v === 42;
-});
-
-console.log(answer);
-// => 42
-```
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/array.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/array.js
deleted file mode 100644
index 381a032a96..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/array.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-var copyPrototype = require("./copy-prototype-methods");
-
-module.exports = copyPrototype(Array.prototype);
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.js
deleted file mode 100644
index 38549c19da..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.js
+++ /dev/null
@@ -1,40 +0,0 @@
-"use strict";
-
-var call = Function.call;
-var throwsOnProto = require("./throws-on-proto");
-
-var disallowedProperties = [
- // ignore size because it throws from Map
- "size",
- "caller",
- "callee",
- "arguments",
-];
-
-// This branch is covered when tests are run with `--disable-proto=throw`,
-// however we can test both branches at the same time, so this is ignored
-/* istanbul ignore next */
-if (throwsOnProto) {
- disallowedProperties.push("__proto__");
-}
-
-module.exports = function copyPrototypeMethods(prototype) {
- // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods
- return Object.getOwnPropertyNames(prototype).reduce(function (
- result,
- name
- ) {
- if (disallowedProperties.includes(name)) {
- return result;
- }
-
- if (typeof prototype[name] !== "function") {
- return result;
- }
-
- result[name] = call.bind(prototype[name]);
-
- return result;
- },
- Object.create(null));
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.test.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.test.js
deleted file mode 100644
index 31de7cd304..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.test.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-
-var refute = require("@sinonjs/referee-sinon").refute;
-var copyPrototypeMethods = require("./copy-prototype-methods");
-
-describe("copyPrototypeMethods", function () {
- it("does not throw for Map", function () {
- refute.exception(function () {
- copyPrototypeMethods(Map.prototype);
- });
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/function.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/function.js
deleted file mode 100644
index a75c25d819..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/function.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-var copyPrototype = require("./copy-prototype-methods");
-
-module.exports = copyPrototype(Function.prototype);
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/index.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/index.js
deleted file mode 100644
index ab766bf8d6..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/index.js
+++ /dev/null
@@ -1,10 +0,0 @@
-"use strict";
-
-module.exports = {
- array: require("./array"),
- function: require("./function"),
- map: require("./map"),
- object: require("./object"),
- set: require("./set"),
- string: require("./string"),
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/index.test.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/index.test.js
deleted file mode 100644
index 2b3c2625f2..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/index.test.js
+++ /dev/null
@@ -1,61 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-
-var arrayProto = require("./index").array;
-var functionProto = require("./index").function;
-var mapProto = require("./index").map;
-var objectProto = require("./index").object;
-var setProto = require("./index").set;
-var stringProto = require("./index").string;
-var throwsOnProto = require("./throws-on-proto");
-
-describe("prototypes", function () {
- describe(".array", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- verifyProperties(arrayProto, Array);
- });
- describe(".function", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- verifyProperties(functionProto, Function);
- });
- describe(".map", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- verifyProperties(mapProto, Map);
- });
- describe(".object", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- verifyProperties(objectProto, Object);
- });
- describe(".set", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- verifyProperties(setProto, Set);
- });
- describe(".string", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- verifyProperties(stringProto, String);
- });
-});
-
-function verifyProperties(p, origin) {
- var disallowedProperties = ["size", "caller", "callee", "arguments"];
- if (throwsOnProto) {
- disallowedProperties.push("__proto__");
- }
-
- it("should have all the methods of the origin prototype", function () {
- var methodNames = Object.getOwnPropertyNames(origin.prototype).filter(
- function (name) {
- if (disallowedProperties.includes(name)) {
- return false;
- }
-
- return typeof origin.prototype[name] === "function";
- }
- );
-
- methodNames.forEach(function (name) {
- assert.isTrue(Object.prototype.hasOwnProperty.call(p, name), name);
- });
- });
-}
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/map.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/map.js
deleted file mode 100644
index 91ec65e238..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/map.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-var copyPrototype = require("./copy-prototype-methods");
-
-module.exports = copyPrototype(Map.prototype);
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/object.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/object.js
deleted file mode 100644
index eab7faa8f0..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/object.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-var copyPrototype = require("./copy-prototype-methods");
-
-module.exports = copyPrototype(Object.prototype);
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/set.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/set.js
deleted file mode 100644
index 7495c3b96f..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/set.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-var copyPrototype = require("./copy-prototype-methods");
-
-module.exports = copyPrototype(Set.prototype);
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/string.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/string.js
deleted file mode 100644
index 3917fe9b04..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/string.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-var copyPrototype = require("./copy-prototype-methods");
-
-module.exports = copyPrototype(String.prototype);
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js
deleted file mode 100644
index eb7a189b11..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js
+++ /dev/null
@@ -1,26 +0,0 @@
-"use strict";
-
-/**
- * Is true when the environment causes an error to be thrown for accessing the
- * __proto__ property.
- *
- * This is necessary in order to support `node --disable-proto=throw`.
- *
- * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto
- *
- * @type {boolean}
- */
-let throwsOnProto;
-try {
- const object = {};
- // eslint-disable-next-line no-proto, no-unused-expressions
- object.__proto__;
- throwsOnProto = false;
-} catch (_) {
- // This branch is covered when tests are run with `--disable-proto=throw`,
- // however we can test both branches at the same time, so this is ignored
- /* istanbul ignore next */
- throwsOnProto = true;
-}
-
-module.exports = throwsOnProto;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/type-of.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/type-of.js
deleted file mode 100644
index 97a0bb9cb9..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/type-of.js
+++ /dev/null
@@ -1,13 +0,0 @@
-"use strict";
-
-var type = require("type-detect");
-
-/**
- * Returns the lower-case result of running type from type-detect on the value
- *
- * @param {*} value
- * @returns {string}
- */
-module.exports = function typeOf(value) {
- return type(value).toLowerCase();
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/type-of.test.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/type-of.test.js
deleted file mode 100644
index ba377b9447..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/type-of.test.js
+++ /dev/null
@@ -1,51 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var typeOf = require("./type-of");
-
-describe("typeOf", function () {
- it("returns boolean", function () {
- assert.equals(typeOf(false), "boolean");
- });
-
- it("returns string", function () {
- assert.equals(typeOf("Sinon.JS"), "string");
- });
-
- it("returns number", function () {
- assert.equals(typeOf(123), "number");
- });
-
- it("returns object", function () {
- assert.equals(typeOf({}), "object");
- });
-
- it("returns function", function () {
- assert.equals(
- typeOf(function () {
- return undefined;
- }),
- "function"
- );
- });
-
- it("returns undefined", function () {
- assert.equals(typeOf(undefined), "undefined");
- });
-
- it("returns null", function () {
- assert.equals(typeOf(null), "null");
- });
-
- it("returns array", function () {
- assert.equals(typeOf([]), "array");
- });
-
- it("returns regexp", function () {
- assert.equals(typeOf(/.*/), "regexp");
- });
-
- it("returns date", function () {
- assert.equals(typeOf(new Date()), "date");
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/value-to-string.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/value-to-string.js
deleted file mode 100644
index fb14782be5..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/value-to-string.js
+++ /dev/null
@@ -1,17 +0,0 @@
-"use strict";
-
-/**
- * Returns a string representation of the value
- *
- * @param {*} value
- * @returns {string}
- */
-function valueToString(value) {
- if (value && value.toString) {
- // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods
- return value.toString();
- }
- return String(value);
-}
-
-module.exports = valueToString;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/lib/value-to-string.test.js b/node_modules/nise/node_modules/@sinonjs/commons/lib/value-to-string.test.js
deleted file mode 100644
index 645644714d..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/lib/value-to-string.test.js
+++ /dev/null
@@ -1,20 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var valueToString = require("./value-to-string");
-
-describe("util/core/valueToString", function () {
- it("returns string representation of an object", function () {
- var obj = {};
-
- assert.equals(valueToString(obj), obj.toString());
- });
-
- it("returns 'null' for literal null'", function () {
- assert.equals(valueToString(null), "null");
- });
-
- it("returns 'undefined' for literal undefined", function () {
- assert.equals(valueToString(undefined), "undefined");
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/package.json b/node_modules/nise/node_modules/@sinonjs/commons/package.json
deleted file mode 100644
index 9b68bf2659..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/package.json
+++ /dev/null
@@ -1,57 +0,0 @@
-{
- "name": "@sinonjs/commons",
- "version": "2.0.0",
- "description": "Simple functions shared among the sinon end user libraries",
- "main": "lib/index.js",
- "types": "./types/index.d.ts",
- "scripts": {
- "build": "rm -rf types && tsc",
- "lint": "eslint .",
- "precommit": "lint-staged",
- "test": "mocha --recursive -R dot \"lib/**/*.test.js\"",
- "test-check-coverage": "npm run test-coverage && nyc check-coverage --branches 100 --functions 100 --lines 100",
- "test-coverage": "nyc --reporter text --reporter html --reporter lcovonly npm run test",
- "prepublishOnly": "npm run build",
- "prettier:check": "prettier --check '**/*.{js,css,md}'",
- "prettier:write": "prettier --write '**/*.{js,css,md}'",
- "preversion": "npm run test-check-coverage",
- "version": "changes --commits --footer",
- "postversion": "git push --follow-tags && npm publish",
- "prepare": "husky install"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/sinonjs/commons.git"
- },
- "files": [
- "lib",
- "types"
- ],
- "author": "",
- "license": "BSD-3-Clause",
- "bugs": {
- "url": "https://github.com/sinonjs/commons/issues"
- },
- "homepage": "https://github.com/sinonjs/commons#readme",
- "lint-staged": {
- "*.{js,css,md}": "prettier --check",
- "*.js": "eslint"
- },
- "devDependencies": {
- "@sinonjs/eslint-config": "^4.0.6",
- "@sinonjs/eslint-plugin-no-prototype-methods": "^0.1.0",
- "@sinonjs/referee-sinon": "^10.1.0",
- "@studio/changes": "^2.2.0",
- "husky": "^6.0.0",
- "jsverify": "0.8.4",
- "knuth-shuffle": "^1.0.8",
- "lint-staged": "^13.0.3",
- "mocha": "^10.1.0",
- "nyc": "^15.1.0",
- "prettier": "^2.7.1",
- "typescript": "^4.8.4"
- },
- "dependencies": {
- "type-detect": "4.0.8"
- }
-}
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/called-in-order.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/called-in-order.d.ts
deleted file mode 100644
index 1a4508be95..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/called-in-order.d.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-export = calledInOrder;
-/**
- * A Sinon proxy object (fake, spy, stub)
- *
- * @typedef {object} SinonProxy
- * @property {Function} calledBefore - A method that determines if this proxy was called before another one
- * @property {string} id - Some id
- * @property {number} callCount - Number of times this proxy has been called
- */
-/**
- * Returns true when the spies have been called in the order they were supplied in
- *
- * @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments
- * @returns {boolean} true when spies are called in order, false otherwise
- */
-declare function calledInOrder(spies: SinonProxy[] | SinonProxy, ...args: any[]): boolean;
-declare namespace calledInOrder {
- export { SinonProxy };
-}
-/**
- * A Sinon proxy object (fake, spy, stub)
- */
-type SinonProxy = {
- /**
- * - A method that determines if this proxy was called before another one
- */
- calledBefore: Function;
- /**
- * - Some id
- */
- id: string;
- /**
- * - Number of times this proxy has been called
- */
- callCount: number;
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/class-name.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/class-name.d.ts
deleted file mode 100644
index df3687b9b2..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/class-name.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export = className;
-/**
- * Returns a display name for a value from a constructor
- *
- * @param {object} value A value to examine
- * @returns {(string|null)} A string or null
- */
-declare function className(value: object): (string | null);
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/deprecated.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/deprecated.d.ts
deleted file mode 100644
index 81a35bf836..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/deprecated.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export function wrap(func: Function, msg: string): Function;
-export function defaultMsg(packageName: string, funcName: string): string;
-export function printWarning(msg: string): undefined;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/every.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/every.d.ts
deleted file mode 100644
index bcfa64e017..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/every.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function _exports(obj: object, fn: Function): boolean;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/function-name.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/function-name.d.ts
deleted file mode 100644
index f27d519a9f..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/function-name.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function _exports(func: Function): string;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/global.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/global.d.ts
deleted file mode 100644
index 0f54a635dc..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/global.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export = globalObject;
-/**
- * A reference to the global object
- *
- * @type {object} globalObject
- */
-declare var globalObject: object;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/index.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/index.d.ts
deleted file mode 100644
index 7d675b1819..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/index.d.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-export const global: any;
-export const calledInOrder: typeof import("./called-in-order");
-export const className: typeof import("./class-name");
-export const deprecated: typeof import("./deprecated");
-export const every: (obj: any, fn: Function) => boolean;
-export const functionName: (func: Function) => string;
-export const orderByFirstCall: typeof import("./order-by-first-call");
-export const prototypes: {
- array: any;
- function: any;
- map: any;
- object: any;
- set: any;
- string: any;
-};
-export const typeOf: (value: any) => string;
-export const valueToString: typeof import("./value-to-string");
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts
deleted file mode 100644
index a9a6037d0d..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-export = orderByFirstCall;
-/**
- * A Sinon proxy object (fake, spy, stub)
- *
- * @typedef {object} SinonProxy
- * @property {Function} getCall - A method that can return the first call
- */
-/**
- * Sorts an array of SinonProxy instances (fake, spy, stub) by their first call
- *
- * @param {SinonProxy[] | SinonProxy} spies
- * @returns {SinonProxy[]}
- */
-declare function orderByFirstCall(spies: SinonProxy[] | SinonProxy): SinonProxy[];
-declare namespace orderByFirstCall {
- export { SinonProxy };
-}
-/**
- * A Sinon proxy object (fake, spy, stub)
- */
-type SinonProxy = {
- /**
- * - A method that can return the first call
- */
- getCall: Function;
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/array.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/array.d.ts
deleted file mode 100644
index 1cce635071..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/array.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _exports: any;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/copy-prototype-methods.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/copy-prototype-methods.d.ts
deleted file mode 100644
index 1479b93cf9..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/copy-prototype-methods.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function _exports(prototype: any): any;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/function.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/function.d.ts
deleted file mode 100644
index 1cce635071..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/function.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _exports: any;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/index.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/index.d.ts
deleted file mode 100644
index 0026d6c2f5..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/index.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export declare const array: any;
-declare const _function: any;
-export { _function as function };
-export declare const map: any;
-export declare const object: any;
-export declare const set: any;
-export declare const string: any;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/map.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/map.d.ts
deleted file mode 100644
index 1cce635071..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/map.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _exports: any;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/object.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/object.d.ts
deleted file mode 100644
index 1cce635071..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/object.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _exports: any;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/set.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/set.d.ts
deleted file mode 100644
index 1cce635071..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/set.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _exports: any;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/string.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/string.d.ts
deleted file mode 100644
index 1cce635071..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/string.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _exports: any;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts
deleted file mode 100644
index 6cc97f4a15..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export = throwsOnProto;
-/**
- * Is true when the environment causes an error to be thrown for accessing the
- * __proto__ property.
- *
- * This is necessary in order to support `node --disable-proto=throw`.
- *
- * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto
- *
- * @type {boolean}
- */
-declare let throwsOnProto: boolean;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/type-of.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/type-of.d.ts
deleted file mode 100644
index fc72887c0e..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/type-of.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function _exports(value: any): string;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/commons/types/value-to-string.d.ts b/node_modules/nise/node_modules/@sinonjs/commons/types/value-to-string.d.ts
deleted file mode 100644
index 19b086cd28..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/commons/types/value-to-string.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export = valueToString;
-/**
- * Returns a string representation of the value
- *
- * @param {*} value
- * @returns {string}
- */
-declare function valueToString(value: any): string;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/LICENSE b/node_modules/nise/node_modules/@sinonjs/fake-timers/LICENSE
deleted file mode 100644
index eb84755e17..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/LICENSE
+++ /dev/null
@@ -1,11 +0,0 @@
-Copyright (c) 2010-2014, Christian Johansen, christian@cjohansen.no. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
-3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/README.md b/node_modules/nise/node_modules/@sinonjs/fake-timers/README.md
deleted file mode 100644
index 049f067266..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/README.md
+++ /dev/null
@@ -1,358 +0,0 @@
-# `@sinonjs/fake-timers`
-
-[](https://codecov.io/gh/sinonjs/fake-timers)
-
-
-JavaScript implementation of the timer APIs; `setTimeout`, `clearTimeout`, `setImmediate`, `clearImmediate`, `setInterval`, `clearInterval`, `requestAnimationFrame`, `cancelAnimationFrame`, `requestIdleCallback`, and `cancelIdleCallback`, along with a clock instance that controls the flow of time. FakeTimers also provides a `Date` implementation that gets its time from the clock.
-
-In addition in browser environment `@sinonjs/fake-timers` provides a `performance` implementation that gets its time from the clock. In Node environments FakeTimers provides a `nextTick` implementation that is synchronized with the clock - and a `process.hrtime` shim that works with the clock.
-
-`@sinonjs/fake-timers` can be used to simulate passing time in automated tests and other
-situations where you want the scheduling semantics, but don't want to actually
-wait.
-
-`@sinonjs/fake-timers` is extracted from [Sinon.JS](https://github.com/sinonjs/sinon.js) and targets the [same runtimes](https://sinonjs.org/releases/latest/#supported-runtimes).
-
-## Autocomplete, IntelliSense and TypeScript definitions
-
-Version 7 introduced JSDoc to the codebase. This should provide autocomplete and type suggestions in supporting IDEs. If you need more elaborate type support, TypeScript definitions for the Sinon projects are independently maintained by the Definitely Types community:
-
-```
-npm install -D @types/sinonjs__fake-timers
-```
-
-## Installation
-
-`@sinonjs/fake-timers` can be used in both Node and browser environments. Installation is as easy as
-
-```sh
-npm install @sinonjs/fake-timers
-```
-
-If you want to use `@sinonjs/fake-timers` in a browser you can either build your own bundle or use [Skypack](https://www.skypack.dev).
-
-## Usage
-
-To use `@sinonjs/fake-timers`, create a new clock, schedule events on it using the timer
-functions and pass time using the `tick` method.
-
-```js
-// In the browser distribution, a global `FakeTimers` is already available
-var FakeTimers = require("@sinonjs/fake-timers");
-var clock = FakeTimers.createClock();
-
-clock.setTimeout(function () {
- console.log(
- "The poblano is a mild chili pepper originating in the state of Puebla, Mexico."
- );
-}, 15);
-
-// ...
-
-clock.tick(15);
-```
-
-Upon executing the last line, an interesting fact about the
-[Poblano](https://en.wikipedia.org/wiki/Poblano) will be printed synchronously to
-the screen. If you want to simulate asynchronous behavior, please see the `async` function variants (eg `clock.tick(time)` vs `await clock.tickAsync(time)`).
-
-The `next`, `runAll`, `runToFrame`, and `runToLast` methods are available to advance the clock. See the
-API Reference for more details.
-
-### Faking the native timers
-
-When using `@sinonjs/fake-timers` to test timers, you will most likely want to replace the native
-timers such that calling `setTimeout` actually schedules a callback with your
-clock instance, not the browser's internals.
-
-Calling `install` with no arguments achieves this. You can call `uninstall`
-later to restore things as they were again.
-
-```js
-// In the browser distribution, a global `FakeTimers` is already available
-var FakeTimers = require("@sinonjs/fake-timers");
-
-var clock = FakeTimers.install();
-// Equivalent to
-// var clock = FakeTimers.install(typeof global !== "undefined" ? global : window);
-
-setTimeout(fn, 15); // Schedules with clock.setTimeout
-
-clock.uninstall();
-// setTimeout is restored to the native implementation
-```
-
-To hijack timers in another context pass it to the `install` method.
-
-```js
-var FakeTimers = require("@sinonjs/fake-timers");
-var context = {
- setTimeout: setTimeout, // By default context.setTimeout uses the global setTimeout
-};
-var clock = FakeTimers.withGlobal(context).install();
-
-context.setTimeout(fn, 15); // Schedules with clock.setTimeout
-
-clock.uninstall();
-// context.setTimeout is restored to the original implementation
-```
-
-Usually you want to install the timers onto the global object, so call `install`
-without arguments.
-
-#### Automatically incrementing mocked time
-
-FakeTimers supports the possibility to attach the faked timers to any change
-in the real system time. This means that there is no need to `tick()` the
-clock in a situation where you won't know **when** to call `tick()`.
-
-Please note that this is achieved using the original setImmediate() API at a certain
-configurable interval `config.advanceTimeDelta` (default: 20ms). Meaning time would
-be incremented every 20ms, not in real time.
-
-An example would be:
-
-```js
-var FakeTimers = require("@sinonjs/fake-timers");
-var clock = FakeTimers.install({
- shouldAdvanceTime: true,
- advanceTimeDelta: 40,
-});
-
-setTimeout(() => {
- console.log("this just timed out"); //executed after 40ms
-}, 30);
-
-setImmediate(() => {
- console.log("not so immediate"); //executed after 40ms
-});
-
-setTimeout(() => {
- console.log("this timed out after"); //executed after 80ms
- clock.uninstall();
-}, 50);
-```
-
-## API Reference
-
-### `var clock = FakeTimers.createClock([now[, loopLimit]])`
-
-Creates a clock. The default
-[epoch](https://en.wikipedia.org/wiki/Epoch_%28reference_date%29) is `0`.
-
-The `now` argument may be a number (in milliseconds) or a Date object.
-
-The `loopLimit` argument sets the maximum number of timers that will be run when calling `runAll()` before assuming that we have an infinite loop and throwing an error. The default is `1000`.
-
-### `var clock = FakeTimers.install([config])`
-
-Installs FakeTimers using the specified config (otherwise with epoch `0` on the global scope). The following configuration options are available
-
-| Parameter | Type | Default | Description |
-| -------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `config.now` | Number/Date | 0 | installs FakeTimers with the specified unix epoch |
-| `config.toFake` | String[] | ["setTimeout", "clearTimeout", "setImmediate", "clearImmediate","setInterval", "clearInterval", "Date", "requestAnimationFrame", "cancelAnimationFrame", "requestIdleCallback", "cancelIdleCallback", "hrtime", "performance"] | an array with explicit function names (or objects, in the case of "performance") to hijack. _When not set, FakeTimers will automatically fake all methods **except** `nextTick`_ e.g., `FakeTimers.install({ toFake: ["setTimeout","nextTick"]})` will fake only `setTimeout` and `nextTick` |
-| `config.loopLimit` | Number | 1000 | the maximum number of timers that will be run when calling runAll() |
-| `config.shouldAdvanceTime` | Boolean | false | tells FakeTimers to increment mocked time automatically based on the real system time shift (e.g. the mocked time will be incremented by 20ms for every 20ms change in the real system time) |
-| `config.advanceTimeDelta` | Number | 20 | relevant only when using with `shouldAdvanceTime: true`. increment mocked time by `advanceTimeDelta` ms every `advanceTimeDelta` ms change in the real system time. |
-| `config.shouldClearNativeTimers` | Boolean | false | tells FakeTimers to clear 'native' (i.e. not fake) timers by delegating to their respective handlers. These are not cleared by default, leading to potentially unexpected behavior if timers existed prior to installing FakeTimers. |
-
-### `var id = clock.setTimeout(callback, timeout)`
-
-Schedules the callback to be fired once `timeout` milliseconds have ticked by.
-
-In Node.js `setTimeout` returns a timer object. FakeTimers will do the same, however
-its `ref()` and `unref()` methods have no effect.
-
-In browsers a timer ID is returned.
-
-### `clock.clearTimeout(id)`
-
-Clears the timer given the ID or timer object, as long as it was created using
-`setTimeout`.
-
-### `var id = clock.setInterval(callback, timeout)`
-
-Schedules the callback to be fired every time `timeout` milliseconds have ticked
-by.
-
-In Node.js `setInterval` returns a timer object. FakeTimers will do the same, however
-its `ref()` and `unref()` methods have no effect.
-
-In browsers a timer ID is returned.
-
-### `clock.clearInterval(id)`
-
-Clears the timer given the ID or timer object, as long as it was created using
-`setInterval`.
-
-### `var id = clock.setImmediate(callback)`
-
-Schedules the callback to be fired once `0` milliseconds have ticked by. Note
-that you'll still have to call `clock.tick()` for the callback to fire. If
-called during a tick the callback won't fire until `1` millisecond has ticked
-by.
-
-In Node.js `setImmediate` returns a timer object. FakeTimers will do the same,
-however its `ref()` and `unref()` methods have no effect.
-
-In browsers a timer ID is returned.
-
-### `clock.clearImmediate(id)`
-
-Clears the timer given the ID or timer object, as long as it was created using
-`setImmediate`.
-
-### `clock.requestAnimationFrame(callback)`
-
-Schedules the callback to be fired on the next animation frame, which runs every
-16 ticks. Returns an `id` which can be used to cancel the callback. This is
-available in both browser & node environments.
-
-### `clock.cancelAnimationFrame(id)`
-
-Cancels the callback scheduled by the provided id.
-
-### `clock.requestIdleCallback(callback[, timeout])`
-
-Queued the callback to be fired during idle periods to perform background and low priority work on the main event loop. Callbacks which have a timeout option will be fired no later than time in milliseconds. Returns an `id` which can be used to cancel the callback.
-
-### `clock.cancelIdleCallback(id)`
-
-Cancels the callback scheduled by the provided id.
-
-### `clock.countTimers()`
-
-Returns the number of waiting timers. This can be used to assert that a test
-finishes without leaking any timers.
-
-### `clock.hrtime(prevTime?)`
-
-Only available in Node.js, mimicks process.hrtime().
-
-### `clock.nextTick(callback)`
-
-Only available in Node.js, mimics `process.nextTick` to enable completely synchronous testing flows.
-
-### `clock.performance.now()`
-
-Only available in browser environments, mimicks performance.now().
-
-### `clock.tick(time)` / `await clock.tickAsync(time)`
-
-Advance the clock, firing callbacks if necessary. `time` may be the number of
-milliseconds to advance the clock by or a human-readable string. Valid string
-formats are `"08"` for eight seconds, `"01:00"` for one minute and `"02:34:10"`
-for two hours, 34 minutes and ten seconds.
-
-The `tickAsync()` will also break the event loop, allowing any scheduled promise
-callbacks to execute _before_ running the timers.
-
-### `clock.next()` / `await clock.nextAsync()`
-
-Advances the clock to the the moment of the first scheduled timer, firing it.
-
-The `nextAsync()` will also break the event loop, allowing any scheduled promise
-callbacks to execute _before_ running the timers.
-
-### `clock.jump(time)`
-
-Advance the clock by jumping forward in time, firing callbacks at most once.
-`time` takes the same formats as [`clock.tick`](#clockticktime--await-clocktickasynctime).
-
-This can be used to simulate the JS engine (such as a browser) being put to sleep and resumed later, skipping intermediary timers.
-
-### `clock.reset()`
-
-Removes all timers and ticks without firing them, and sets `now` to `config.now`
-that was provided to `FakeTimers.install` or to `0` if `config.now` was not provided.
-Useful to reset the state of the clock without having to `uninstall` and `install` it.
-
-### `clock.runAll()` / `await clock.runAllAsync()`
-
-This runs all pending timers until there are none remaining. If new timers are added while it is executing they will be run as well.
-
-This makes it easier to run asynchronous tests to completion without worrying about the number of timers they use, or the delays in those timers.
-
-It runs a maximum of `loopLimit` times after which it assumes there is an infinite loop of timers and throws an error.
-
-The `runAllAsync()` will also break the event loop, allowing any scheduled promise
-callbacks to execute _before_ running the timers.
-
-### `clock.runMicrotasks()`
-
-This runs all pending microtasks scheduled with `nextTick` but none of the timers and is mostly useful for libraries using FakeTimers underneath and for running `nextTick` items without any timers.
-
-### `clock.runToFrame()`
-
-Advances the clock to the next frame, firing all scheduled animation frame callbacks,
-if any, for that frame as well as any other timers scheduled along the way.
-
-### `clock.runToLast()` / `await clock.runToLastAsync()`
-
-This takes note of the last scheduled timer when it is run, and advances the
-clock to that time firing callbacks as necessary.
-
-If new timers are added while it is executing they will be run only if they
-would occur before this time.
-
-This is useful when you want to run a test to completion, but the test recursively
-sets timers that would cause `runAll` to trigger an infinite loop warning.
-
-The `runToLastAsync()` will also break the event loop, allowing any scheduled promise
-callbacks to execute _before_ running the timers.
-
-### `clock.setSystemTime([now])`
-
-This simulates a user changing the system clock while your program is running.
-It affects the current time but it does not in itself cause e.g. timers to fire;
-they will fire exactly as they would have done without the call to
-setSystemTime().
-
-### `clock.uninstall()`
-
-Restores the original methods of the native timers or the methods on the object
-that was passed to `FakeTimers.withGlobal`
-
-### `Date`
-
-Implements the `Date` object but using the clock to provide the correct time.
-
-### `Performance`
-
-Implements the `now` method of the [`Performance`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now) object but using the clock to provide the correct time. Only available in environments that support the Performance object (browsers mostly).
-
-### `FakeTimers.withGlobal`
-
-In order to support creating clocks based on separate or sandboxed environments (such as JSDOM), FakeTimers exports a factory method which takes single argument `global`, which it inspects to figure out what to mock and what features to support. When invoking this function with a global, you will get back an object with `timers`, `createClock` and `install` - same as the regular FakeTimers exports only based on the passed in global instead of the global environment.
-
-## Running tests
-
-FakeTimers has a comprehensive test suite. If you're thinking of contributing bug
-fixes or suggesting new features, you need to make sure you have not broken any
-tests. You are also expected to add tests for any new behavior.
-
-### On node:
-
-```sh
-npm test
-```
-
-Or, if you prefer more verbose output:
-
-```
-$(npm bin)/mocha ./test/fake-timers-test.js
-```
-
-### In the browser
-
-[Mochify](https://github.com/mantoni/mochify.js) is used to run the tests in
-PhantomJS. Make sure you have `phantomjs` installed. Then:
-
-```sh
-npm test-headless
-```
-
-## License
-
-BSD 3-clause "New" or "Revised" License (see LICENSE file)
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/LICENSE b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/LICENSE
deleted file mode 100644
index 5a77f0a2e6..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/LICENSE
+++ /dev/null
@@ -1,29 +0,0 @@
-BSD 3-Clause License
-
-Copyright (c) 2018, Sinon.JS
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-* Neither the name of the copyright holder nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/README.md b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/README.md
deleted file mode 100644
index 9c420ba5d3..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# commons
-
-[](https://circleci.com/gh/sinonjs/commons)
-[](https://codecov.io/gh/sinonjs/commons)
-
-
-Simple functions shared among the sinon end user libraries
-
-## Rules
-
-- Follows the [Sinon.JS compatibility](https://github.com/sinonjs/sinon/blob/master/CONTRIBUTING.md#compatibility)
-- 100% test coverage
-- Code formatted using [Prettier](https://prettier.io)
-- No side effects welcome! (only pure functions)
-- No platform specific functions
-- One export per file (any bundler can do tree shaking)
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/called-in-order.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/called-in-order.js
deleted file mode 100644
index 4edb67fa5e..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/called-in-order.js
+++ /dev/null
@@ -1,57 +0,0 @@
-"use strict";
-
-var every = require("./prototypes/array").every;
-
-/**
- * @private
- */
-function hasCallsLeft(callMap, spy) {
- if (callMap[spy.id] === undefined) {
- callMap[spy.id] = 0;
- }
-
- return callMap[spy.id] < spy.callCount;
-}
-
-/**
- * @private
- */
-function checkAdjacentCalls(callMap, spy, index, spies) {
- var calledBeforeNext = true;
-
- if (index !== spies.length - 1) {
- calledBeforeNext = spy.calledBefore(spies[index + 1]);
- }
-
- if (hasCallsLeft(callMap, spy) && calledBeforeNext) {
- callMap[spy.id] += 1;
- return true;
- }
-
- return false;
-}
-
-/**
- * A Sinon proxy object (fake, spy, stub)
- *
- * @typedef {object} SinonProxy
- * @property {Function} calledBefore - A method that determines if this proxy was called before another one
- * @property {string} id - Some id
- * @property {number} callCount - Number of times this proxy has been called
- */
-
-/**
- * Returns true when the spies have been called in the order they were supplied in
- *
- * @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments
- * @returns {boolean} true when spies are called in order, false otherwise
- */
-function calledInOrder(spies) {
- var callMap = {};
- // eslint-disable-next-line no-underscore-dangle
- var _spies = arguments.length > 1 ? arguments : spies;
-
- return every(_spies, checkAdjacentCalls.bind(null, callMap));
-}
-
-module.exports = calledInOrder;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/called-in-order.test.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/called-in-order.test.js
deleted file mode 100644
index 5fe66118b8..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/called-in-order.test.js
+++ /dev/null
@@ -1,121 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var calledInOrder = require("./called-in-order");
-var sinon = require("@sinonjs/referee-sinon").sinon;
-
-var testObject1 = {
- someFunction: function () {
- return;
- },
-};
-var testObject2 = {
- otherFunction: function () {
- return;
- },
-};
-var testObject3 = {
- thirdFunction: function () {
- return;
- },
-};
-
-function testMethod() {
- testObject1.someFunction();
- testObject2.otherFunction();
- testObject2.otherFunction();
- testObject2.otherFunction();
- testObject3.thirdFunction();
-}
-
-describe("calledInOrder", function () {
- beforeEach(function () {
- sinon.stub(testObject1, "someFunction");
- sinon.stub(testObject2, "otherFunction");
- sinon.stub(testObject3, "thirdFunction");
- testMethod();
- });
- afterEach(function () {
- testObject1.someFunction.restore();
- testObject2.otherFunction.restore();
- testObject3.thirdFunction.restore();
- });
-
- describe("given single array argument", function () {
- describe("when stubs were called in expected order", function () {
- it("returns true", function () {
- assert.isTrue(
- calledInOrder([
- testObject1.someFunction,
- testObject2.otherFunction,
- ])
- );
- assert.isTrue(
- calledInOrder([
- testObject1.someFunction,
- testObject2.otherFunction,
- testObject2.otherFunction,
- testObject3.thirdFunction,
- ])
- );
- });
- });
-
- describe("when stubs were called in unexpected order", function () {
- it("returns false", function () {
- assert.isFalse(
- calledInOrder([
- testObject2.otherFunction,
- testObject1.someFunction,
- ])
- );
- assert.isFalse(
- calledInOrder([
- testObject2.otherFunction,
- testObject1.someFunction,
- testObject1.someFunction,
- testObject3.thirdFunction,
- ])
- );
- });
- });
- });
-
- describe("given multiple arguments", function () {
- describe("when stubs were called in expected order", function () {
- it("returns true", function () {
- assert.isTrue(
- calledInOrder(
- testObject1.someFunction,
- testObject2.otherFunction
- )
- );
- assert.isTrue(
- calledInOrder(
- testObject1.someFunction,
- testObject2.otherFunction,
- testObject3.thirdFunction
- )
- );
- });
- });
-
- describe("when stubs were called in unexpected order", function () {
- it("returns false", function () {
- assert.isFalse(
- calledInOrder(
- testObject2.otherFunction,
- testObject1.someFunction
- )
- );
- assert.isFalse(
- calledInOrder(
- testObject2.otherFunction,
- testObject1.someFunction,
- testObject3.thirdFunction
- )
- );
- });
- });
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/class-name.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/class-name.js
deleted file mode 100644
index bcd26baeaa..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/class-name.js
+++ /dev/null
@@ -1,27 +0,0 @@
-"use strict";
-
-var functionName = require("./function-name");
-
-/**
- * Returns a display name for a value from a constructor
- *
- * @param {object} value A value to examine
- * @returns {(string|null)} A string or null
- */
-function className(value) {
- return (
- (value.constructor && value.constructor.name) ||
- // The next branch is for IE11 support only:
- // Because the name property is not set on the prototype
- // of the Function object, we finally try to grab the
- // name from its definition. This will never be reached
- // in node, so we are not able to test this properly.
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
- (typeof value.constructor === "function" &&
- /* istanbul ignore next */
- functionName(value.constructor)) ||
- null
- );
-}
-
-module.exports = className;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/class-name.test.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/class-name.test.js
deleted file mode 100644
index 994f21b817..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/class-name.test.js
+++ /dev/null
@@ -1,37 +0,0 @@
-"use strict";
-/* eslint-disable no-empty-function */
-
-var assert = require("@sinonjs/referee").assert;
-var className = require("./class-name");
-
-describe("className", function () {
- it("returns the class name of an instance", function () {
- // Because eslint-config-sinon disables es6, we can't
- // use a class definition here
- // https://github.com/sinonjs/eslint-config-sinon/blob/master/index.js
- // var instance = new (class TestClass {})();
- var instance = new (function TestClass() {})();
- var name = className(instance);
- assert.equals(name, "TestClass");
- });
-
- it("returns 'Object' for {}", function () {
- var name = className({});
- assert.equals(name, "Object");
- });
-
- it("returns null for an object that has no prototype", function () {
- var obj = Object.create(null);
- var name = className(obj);
- assert.equals(name, null);
- });
-
- it("returns null for an object whose prototype was mangled", function () {
- // This is what Node v6 and v7 do for objects returned by querystring.parse()
- function MangledObject() {}
- MangledObject.prototype = Object.create(null);
- var obj = new MangledObject();
- var name = className(obj);
- assert.equals(name, null);
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/deprecated.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/deprecated.js
deleted file mode 100644
index 4222725427..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/deprecated.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* eslint-disable no-console */
-"use strict";
-
-/**
- * Returns a function that will invoke the supplied function and print a
- * deprecation warning to the console each time it is called.
- *
- * @param {Function} func
- * @param {string} msg
- * @returns {Function}
- */
-exports.wrap = function (func, msg) {
- var wrapped = function () {
- exports.printWarning(msg);
- return func.apply(this, arguments);
- };
- if (func.prototype) {
- wrapped.prototype = func.prototype;
- }
- return wrapped;
-};
-
-/**
- * Returns a string which can be supplied to `wrap()` to notify the user that a
- * particular part of the sinon API has been deprecated.
- *
- * @param {string} packageName
- * @param {string} funcName
- * @returns {string}
- */
-exports.defaultMsg = function (packageName, funcName) {
- return `${packageName}.${funcName} is deprecated and will be removed from the public API in a future version of ${packageName}.`;
-};
-
-/**
- * Prints a warning on the console, when it exists
- *
- * @param {string} msg
- * @returns {undefined}
- */
-exports.printWarning = function (msg) {
- /* istanbul ignore next */
- if (typeof process === "object" && process.emitWarning) {
- // Emit Warnings in Node
- process.emitWarning(msg);
- } else if (console.info) {
- console.info(msg);
- } else {
- console.log(msg);
- }
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/deprecated.test.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/deprecated.test.js
deleted file mode 100644
index 275d8b1c92..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/deprecated.test.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/* eslint-disable no-console */
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var sinon = require("@sinonjs/referee-sinon").sinon;
-
-var deprecated = require("./deprecated");
-
-var msg = "test";
-
-describe("deprecated", function () {
- describe("defaultMsg", function () {
- it("should return a string", function () {
- assert.equals(
- deprecated.defaultMsg("sinon", "someFunc"),
- "sinon.someFunc is deprecated and will be removed from the public API in a future version of sinon."
- );
- });
- });
-
- describe("printWarning", function () {
- beforeEach(function () {
- sinon.replace(process, "emitWarning", sinon.fake());
- });
-
- afterEach(sinon.restore);
-
- describe("when `process.emitWarning` is defined", function () {
- it("should call process.emitWarning with a msg", function () {
- deprecated.printWarning(msg);
- assert.calledOnceWith(process.emitWarning, msg);
- });
- });
-
- describe("when `process.emitWarning` is undefined", function () {
- beforeEach(function () {
- sinon.replace(console, "info", sinon.fake());
- sinon.replace(console, "log", sinon.fake());
- process.emitWarning = undefined;
- });
-
- afterEach(sinon.restore);
-
- describe("when `console.info` is defined", function () {
- it("should call `console.info` with a message", function () {
- deprecated.printWarning(msg);
- assert.calledOnceWith(console.info, msg);
- });
- });
-
- describe("when `console.info` is undefined", function () {
- it("should call `console.log` with a message", function () {
- console.info = undefined;
- deprecated.printWarning(msg);
- assert.calledOnceWith(console.log, msg);
- });
- });
- });
- });
-
- describe("wrap", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- var method = sinon.fake();
- var wrapped;
-
- beforeEach(function () {
- wrapped = deprecated.wrap(method, msg);
- });
-
- it("should return a wrapper function", function () {
- assert.match(wrapped, sinon.match.func);
- });
-
- it("should assign the prototype of the passed method", function () {
- assert.equals(method.prototype, wrapped.prototype);
- });
-
- context("when the passed method has falsy prototype", function () {
- it("should not be assigned to the wrapped method", function () {
- method.prototype = null;
- wrapped = deprecated.wrap(method, msg);
- assert.match(wrapped.prototype, sinon.match.object);
- });
- });
-
- context("when invoking the wrapped function", function () {
- before(function () {
- sinon.replace(deprecated, "printWarning", sinon.fake());
- wrapped({});
- });
-
- it("should call `printWarning` before invoking", function () {
- assert.calledOnceWith(deprecated.printWarning, msg);
- });
-
- it("should invoke the passed method with the given arguments", function () {
- assert.calledOnceWith(method, {});
- });
- });
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/every.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/every.js
deleted file mode 100644
index 00bf304e28..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/every.js
+++ /dev/null
@@ -1,27 +0,0 @@
-"use strict";
-
-/**
- * Returns true when fn returns true for all members of obj.
- * This is an every implementation that works for all iterables
- *
- * @param {object} obj
- * @param {Function} fn
- * @returns {boolean}
- */
-module.exports = function every(obj, fn) {
- var pass = true;
-
- try {
- // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods
- obj.forEach(function () {
- if (!fn.apply(this, arguments)) {
- // Throwing an error is the only way to break `forEach`
- throw new Error();
- }
- });
- } catch (e) {
- pass = false;
- }
-
- return pass;
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/every.test.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/every.test.js
deleted file mode 100644
index e054a14de5..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/every.test.js
+++ /dev/null
@@ -1,41 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var sinon = require("@sinonjs/referee-sinon").sinon;
-var every = require("./every");
-
-describe("util/core/every", function () {
- it("returns true when the callback function returns true for every element in an iterable", function () {
- var obj = [true, true, true, true];
- var allTrue = every(obj, function (val) {
- return val;
- });
-
- assert(allTrue);
- });
-
- it("returns false when the callback function returns false for any element in an iterable", function () {
- var obj = [true, true, true, false];
- var result = every(obj, function (val) {
- return val;
- });
-
- assert.isFalse(result);
- });
-
- it("calls the given callback once for each item in an iterable until it returns false", function () {
- var iterableOne = [true, true, true, true];
- var iterableTwo = [true, true, false, true];
- var callback = sinon.spy(function (val) {
- return val;
- });
-
- every(iterableOne, callback);
- assert.equals(callback.callCount, 4);
-
- callback.resetHistory();
-
- every(iterableTwo, callback);
- assert.equals(callback.callCount, 3);
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/function-name.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/function-name.js
deleted file mode 100644
index 199b04e0d1..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/function-name.js
+++ /dev/null
@@ -1,29 +0,0 @@
-"use strict";
-
-/**
- * Returns a display name for a function
- *
- * @param {Function} func
- * @returns {string}
- */
-module.exports = function functionName(func) {
- if (!func) {
- return "";
- }
-
- try {
- return (
- func.displayName ||
- func.name ||
- // Use function decomposition as a last resort to get function
- // name. Does not rely on function decomposition to work - if it
- // doesn't debugging will be slightly less informative
- // (i.e. toString will say 'spy' rather than 'myFunc').
- (String(func).match(/function ([^\s(]+)/) || [])[1]
- );
- } catch (e) {
- // Stringify may fail and we might get an exception, as a last-last
- // resort fall back to empty string.
- return "";
- }
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/function-name.test.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/function-name.test.js
deleted file mode 100644
index 0798b4e7f7..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/function-name.test.js
+++ /dev/null
@@ -1,76 +0,0 @@
-"use strict";
-
-var jsc = require("jsverify");
-var refute = require("@sinonjs/referee-sinon").refute;
-
-var functionName = require("./function-name");
-
-describe("function-name", function () {
- it("should return empty string if func is falsy", function () {
- jsc.assertForall("falsy", function (fn) {
- return functionName(fn) === "";
- });
- });
-
- it("should use displayName by default", function () {
- jsc.assertForall("nestring", function (displayName) {
- var fn = { displayName: displayName };
-
- return functionName(fn) === fn.displayName;
- });
- });
-
- it("should use name if displayName is not available", function () {
- jsc.assertForall("nestring", function (name) {
- var fn = { name: name };
-
- return functionName(fn) === fn.name;
- });
- });
-
- it("should fallback to string parsing", function () {
- jsc.assertForall("nat", function (naturalNumber) {
- var name = `fn${naturalNumber}`;
- var fn = {
- toString: function () {
- return `\nfunction ${name}`;
- },
- };
-
- return functionName(fn) === name;
- });
- });
-
- it("should not fail when a name cannot be found", function () {
- refute.exception(function () {
- var fn = {
- toString: function () {
- return "\nfunction (";
- },
- };
-
- functionName(fn);
- });
- });
-
- it("should not fail when toString is undefined", function () {
- refute.exception(function () {
- functionName(Object.create(null));
- });
- });
-
- it("should not fail when toString throws", function () {
- refute.exception(function () {
- var fn;
- try {
- // eslint-disable-next-line no-eval
- fn = eval("(function*() {})")().constructor;
- } catch (e) {
- // env doesn't support generators
- return;
- }
-
- functionName(fn);
- });
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/global.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/global.js
deleted file mode 100644
index 51715a27c8..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/global.js
+++ /dev/null
@@ -1,22 +0,0 @@
-"use strict";
-
-/**
- * A reference to the global object
- *
- * @type {object} globalObject
- */
-var globalObject;
-
-/* istanbul ignore else */
-if (typeof global !== "undefined") {
- // Node
- globalObject = global;
-} else if (typeof window !== "undefined") {
- // Browser
- globalObject = window;
-} else {
- // WebWorker
- globalObject = self;
-}
-
-module.exports = globalObject;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/global.test.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/global.test.js
deleted file mode 100644
index 4fa73ebcf6..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/global.test.js
+++ /dev/null
@@ -1,16 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var globalObject = require("./global");
-
-describe("global", function () {
- before(function () {
- if (typeof global === "undefined") {
- this.skip();
- }
- });
-
- it("is same as global", function () {
- assert.same(globalObject, global);
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/index.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/index.js
deleted file mode 100644
index 870df32c80..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/index.js
+++ /dev/null
@@ -1,14 +0,0 @@
-"use strict";
-
-module.exports = {
- global: require("./global"),
- calledInOrder: require("./called-in-order"),
- className: require("./class-name"),
- deprecated: require("./deprecated"),
- every: require("./every"),
- functionName: require("./function-name"),
- orderByFirstCall: require("./order-by-first-call"),
- prototypes: require("./prototypes"),
- typeOf: require("./type-of"),
- valueToString: require("./value-to-string"),
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/index.test.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/index.test.js
deleted file mode 100644
index e79aa7ee0b..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/index.test.js
+++ /dev/null
@@ -1,31 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var index = require("./index");
-
-var expectedMethods = [
- "calledInOrder",
- "className",
- "every",
- "functionName",
- "orderByFirstCall",
- "typeOf",
- "valueToString",
-];
-var expectedObjectProperties = ["deprecated", "prototypes"];
-
-describe("package", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- expectedMethods.forEach(function (name) {
- it(`should export a method named ${name}`, function () {
- assert.isFunction(index[name]);
- });
- });
-
- // eslint-disable-next-line mocha/no-setup-in-describe
- expectedObjectProperties.forEach(function (name) {
- it(`should export an object property named ${name}`, function () {
- assert.isObject(index[name]);
- });
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/order-by-first-call.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/order-by-first-call.js
deleted file mode 100644
index c3d47edfeb..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/order-by-first-call.js
+++ /dev/null
@@ -1,36 +0,0 @@
-"use strict";
-
-var sort = require("./prototypes/array").sort;
-var slice = require("./prototypes/array").slice;
-
-/**
- * @private
- */
-function comparator(a, b) {
- // uuid, won't ever be equal
- var aCall = a.getCall(0);
- var bCall = b.getCall(0);
- var aId = (aCall && aCall.callId) || -1;
- var bId = (bCall && bCall.callId) || -1;
-
- return aId < bId ? -1 : 1;
-}
-
-/**
- * A Sinon proxy object (fake, spy, stub)
- *
- * @typedef {object} SinonProxy
- * @property {Function} getCall - A method that can return the first call
- */
-
-/**
- * Sorts an array of SinonProxy instances (fake, spy, stub) by their first call
- *
- * @param {SinonProxy[] | SinonProxy} spies
- * @returns {SinonProxy[]}
- */
-function orderByFirstCall(spies) {
- return sort(slice(spies), comparator);
-}
-
-module.exports = orderByFirstCall;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/order-by-first-call.test.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/order-by-first-call.test.js
deleted file mode 100644
index cbc71beb28..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/order-by-first-call.test.js
+++ /dev/null
@@ -1,52 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var knuthShuffle = require("knuth-shuffle").knuthShuffle;
-var sinon = require("@sinonjs/referee-sinon").sinon;
-var orderByFirstCall = require("./order-by-first-call");
-
-describe("orderByFirstCall", function () {
- it("should order an Array of spies by the callId of the first call, ascending", function () {
- // create an array of spies
- var spies = [
- sinon.spy(),
- sinon.spy(),
- sinon.spy(),
- sinon.spy(),
- sinon.spy(),
- sinon.spy(),
- ];
-
- // call all the spies
- spies.forEach(function (spy) {
- spy();
- });
-
- // add a few uncalled spies
- spies.push(sinon.spy());
- spies.push(sinon.spy());
-
- // randomise the order of the spies
- knuthShuffle(spies);
-
- var sortedSpies = orderByFirstCall(spies);
-
- assert.equals(sortedSpies.length, spies.length);
-
- var orderedByFirstCall = sortedSpies.every(function (spy, index) {
- if (index + 1 === sortedSpies.length) {
- return true;
- }
- var nextSpy = sortedSpies[index + 1];
-
- // uncalled spies should be ordered first
- if (!spy.called) {
- return true;
- }
-
- return spy.calledImmediatelyBefore(nextSpy);
- });
-
- assert.isTrue(orderedByFirstCall);
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/README.md b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/README.md
deleted file mode 100644
index c3d92fe80a..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# Prototypes
-
-The functions in this folder are to be use for keeping cached references to the built-in prototypes, so that people can't inadvertently break the library by making mistakes in userland.
-
-See https://github.com/sinonjs/sinon/pull/1523
-
-## Without cached references
-
-```js
-// in userland, the library user needs to replace the filter method on
-// Array.prototype
-var array = [1, 2, 3];
-sinon.replace(array, "filter", sinon.fake.returns(2));
-
-// in a sinon module, the library author needs to use the filter method
-var someArray = ["a", "b", 42, "c"];
-var answer = filter(someArray, function (v) {
- return v === 42;
-});
-
-console.log(answer);
-// => 2
-```
-
-## With cached references
-
-```js
-// in userland, the library user needs to replace the filter method on
-// Array.prototype
-var array = [1, 2, 3];
-sinon.replace(array, "filter", sinon.fake.returns(2));
-
-// in a sinon module, the library author needs to use the filter method
-// get a reference to the original Array.prototype.filter
-var filter = require("@sinonjs/commons").prototypes.array.filter;
-var someArray = ["a", "b", 42, "c"];
-var answer = filter(someArray, function (v) {
- return v === 42;
-});
-
-console.log(answer);
-// => 42
-```
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/array.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/array.js
deleted file mode 100644
index 381a032a96..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/array.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-var copyPrototype = require("./copy-prototype-methods");
-
-module.exports = copyPrototype(Array.prototype);
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.js
deleted file mode 100644
index 38549c19da..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.js
+++ /dev/null
@@ -1,40 +0,0 @@
-"use strict";
-
-var call = Function.call;
-var throwsOnProto = require("./throws-on-proto");
-
-var disallowedProperties = [
- // ignore size because it throws from Map
- "size",
- "caller",
- "callee",
- "arguments",
-];
-
-// This branch is covered when tests are run with `--disable-proto=throw`,
-// however we can test both branches at the same time, so this is ignored
-/* istanbul ignore next */
-if (throwsOnProto) {
- disallowedProperties.push("__proto__");
-}
-
-module.exports = function copyPrototypeMethods(prototype) {
- // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods
- return Object.getOwnPropertyNames(prototype).reduce(function (
- result,
- name
- ) {
- if (disallowedProperties.includes(name)) {
- return result;
- }
-
- if (typeof prototype[name] !== "function") {
- return result;
- }
-
- result[name] = call.bind(prototype[name]);
-
- return result;
- },
- Object.create(null));
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.test.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.test.js
deleted file mode 100644
index 31de7cd304..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.test.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-
-var refute = require("@sinonjs/referee-sinon").refute;
-var copyPrototypeMethods = require("./copy-prototype-methods");
-
-describe("copyPrototypeMethods", function () {
- it("does not throw for Map", function () {
- refute.exception(function () {
- copyPrototypeMethods(Map.prototype);
- });
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/function.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/function.js
deleted file mode 100644
index a75c25d819..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/function.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-var copyPrototype = require("./copy-prototype-methods");
-
-module.exports = copyPrototype(Function.prototype);
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/index.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/index.js
deleted file mode 100644
index ab766bf8d6..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/index.js
+++ /dev/null
@@ -1,10 +0,0 @@
-"use strict";
-
-module.exports = {
- array: require("./array"),
- function: require("./function"),
- map: require("./map"),
- object: require("./object"),
- set: require("./set"),
- string: require("./string"),
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/index.test.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/index.test.js
deleted file mode 100644
index 2b3c2625f2..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/index.test.js
+++ /dev/null
@@ -1,61 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-
-var arrayProto = require("./index").array;
-var functionProto = require("./index").function;
-var mapProto = require("./index").map;
-var objectProto = require("./index").object;
-var setProto = require("./index").set;
-var stringProto = require("./index").string;
-var throwsOnProto = require("./throws-on-proto");
-
-describe("prototypes", function () {
- describe(".array", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- verifyProperties(arrayProto, Array);
- });
- describe(".function", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- verifyProperties(functionProto, Function);
- });
- describe(".map", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- verifyProperties(mapProto, Map);
- });
- describe(".object", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- verifyProperties(objectProto, Object);
- });
- describe(".set", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- verifyProperties(setProto, Set);
- });
- describe(".string", function () {
- // eslint-disable-next-line mocha/no-setup-in-describe
- verifyProperties(stringProto, String);
- });
-});
-
-function verifyProperties(p, origin) {
- var disallowedProperties = ["size", "caller", "callee", "arguments"];
- if (throwsOnProto) {
- disallowedProperties.push("__proto__");
- }
-
- it("should have all the methods of the origin prototype", function () {
- var methodNames = Object.getOwnPropertyNames(origin.prototype).filter(
- function (name) {
- if (disallowedProperties.includes(name)) {
- return false;
- }
-
- return typeof origin.prototype[name] === "function";
- }
- );
-
- methodNames.forEach(function (name) {
- assert.isTrue(Object.prototype.hasOwnProperty.call(p, name), name);
- });
- });
-}
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/map.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/map.js
deleted file mode 100644
index 91ec65e238..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/map.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-var copyPrototype = require("./copy-prototype-methods");
-
-module.exports = copyPrototype(Map.prototype);
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/object.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/object.js
deleted file mode 100644
index eab7faa8f0..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/object.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-var copyPrototype = require("./copy-prototype-methods");
-
-module.exports = copyPrototype(Object.prototype);
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/set.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/set.js
deleted file mode 100644
index 7495c3b96f..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/set.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-var copyPrototype = require("./copy-prototype-methods");
-
-module.exports = copyPrototype(Set.prototype);
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/string.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/string.js
deleted file mode 100644
index 3917fe9b04..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/string.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-var copyPrototype = require("./copy-prototype-methods");
-
-module.exports = copyPrototype(String.prototype);
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js
deleted file mode 100644
index eb7a189b11..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js
+++ /dev/null
@@ -1,26 +0,0 @@
-"use strict";
-
-/**
- * Is true when the environment causes an error to be thrown for accessing the
- * __proto__ property.
- *
- * This is necessary in order to support `node --disable-proto=throw`.
- *
- * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto
- *
- * @type {boolean}
- */
-let throwsOnProto;
-try {
- const object = {};
- // eslint-disable-next-line no-proto, no-unused-expressions
- object.__proto__;
- throwsOnProto = false;
-} catch (_) {
- // This branch is covered when tests are run with `--disable-proto=throw`,
- // however we can test both branches at the same time, so this is ignored
- /* istanbul ignore next */
- throwsOnProto = true;
-}
-
-module.exports = throwsOnProto;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/type-of.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/type-of.js
deleted file mode 100644
index 97a0bb9cb9..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/type-of.js
+++ /dev/null
@@ -1,13 +0,0 @@
-"use strict";
-
-var type = require("type-detect");
-
-/**
- * Returns the lower-case result of running type from type-detect on the value
- *
- * @param {*} value
- * @returns {string}
- */
-module.exports = function typeOf(value) {
- return type(value).toLowerCase();
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/type-of.test.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/type-of.test.js
deleted file mode 100644
index ba377b9447..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/type-of.test.js
+++ /dev/null
@@ -1,51 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var typeOf = require("./type-of");
-
-describe("typeOf", function () {
- it("returns boolean", function () {
- assert.equals(typeOf(false), "boolean");
- });
-
- it("returns string", function () {
- assert.equals(typeOf("Sinon.JS"), "string");
- });
-
- it("returns number", function () {
- assert.equals(typeOf(123), "number");
- });
-
- it("returns object", function () {
- assert.equals(typeOf({}), "object");
- });
-
- it("returns function", function () {
- assert.equals(
- typeOf(function () {
- return undefined;
- }),
- "function"
- );
- });
-
- it("returns undefined", function () {
- assert.equals(typeOf(undefined), "undefined");
- });
-
- it("returns null", function () {
- assert.equals(typeOf(null), "null");
- });
-
- it("returns array", function () {
- assert.equals(typeOf([]), "array");
- });
-
- it("returns regexp", function () {
- assert.equals(typeOf(/.*/), "regexp");
- });
-
- it("returns date", function () {
- assert.equals(typeOf(new Date()), "date");
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/value-to-string.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/value-to-string.js
deleted file mode 100644
index fb14782be5..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/value-to-string.js
+++ /dev/null
@@ -1,17 +0,0 @@
-"use strict";
-
-/**
- * Returns a string representation of the value
- *
- * @param {*} value
- * @returns {string}
- */
-function valueToString(value) {
- if (value && value.toString) {
- // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods
- return value.toString();
- }
- return String(value);
-}
-
-module.exports = valueToString;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/value-to-string.test.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/value-to-string.test.js
deleted file mode 100644
index 645644714d..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/value-to-string.test.js
+++ /dev/null
@@ -1,20 +0,0 @@
-"use strict";
-
-var assert = require("@sinonjs/referee-sinon").assert;
-var valueToString = require("./value-to-string");
-
-describe("util/core/valueToString", function () {
- it("returns string representation of an object", function () {
- var obj = {};
-
- assert.equals(valueToString(obj), obj.toString());
- });
-
- it("returns 'null' for literal null'", function () {
- assert.equals(valueToString(null), "null");
- });
-
- it("returns 'undefined' for literal undefined", function () {
- assert.equals(valueToString(undefined), "undefined");
- });
-});
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/package.json b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/package.json
deleted file mode 100644
index 2f80d025a4..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/package.json
+++ /dev/null
@@ -1,57 +0,0 @@
-{
- "name": "@sinonjs/commons",
- "version": "3.0.0",
- "description": "Simple functions shared among the sinon end user libraries",
- "main": "lib/index.js",
- "types": "./types/index.d.ts",
- "scripts": {
- "build": "rm -rf types && tsc",
- "lint": "eslint .",
- "precommit": "lint-staged",
- "test": "mocha --recursive -R dot \"lib/**/*.test.js\"",
- "test-check-coverage": "npm run test-coverage && nyc check-coverage --branches 100 --functions 100 --lines 100",
- "test-coverage": "nyc --reporter text --reporter html --reporter lcovonly npm run test",
- "prepublishOnly": "npm run build",
- "prettier:check": "prettier --check '**/*.{js,css,md}'",
- "prettier:write": "prettier --write '**/*.{js,css,md}'",
- "preversion": "npm run test-check-coverage",
- "version": "changes --commits --footer",
- "postversion": "git push --follow-tags && npm publish",
- "prepare": "husky install"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/sinonjs/commons.git"
- },
- "files": [
- "lib",
- "types"
- ],
- "author": "",
- "license": "BSD-3-Clause",
- "bugs": {
- "url": "https://github.com/sinonjs/commons/issues"
- },
- "homepage": "https://github.com/sinonjs/commons#readme",
- "lint-staged": {
- "*.{js,css,md}": "prettier --check",
- "*.js": "eslint"
- },
- "devDependencies": {
- "@sinonjs/eslint-config": "^4.0.6",
- "@sinonjs/eslint-plugin-no-prototype-methods": "^0.1.0",
- "@sinonjs/referee-sinon": "^10.1.0",
- "@studio/changes": "^2.2.0",
- "husky": "^6.0.0",
- "jsverify": "0.8.4",
- "knuth-shuffle": "^1.0.8",
- "lint-staged": "^13.0.3",
- "mocha": "^10.1.0",
- "nyc": "^15.1.0",
- "prettier": "^2.7.1",
- "typescript": "^4.8.4"
- },
- "dependencies": {
- "type-detect": "4.0.8"
- }
-}
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/called-in-order.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/called-in-order.d.ts
deleted file mode 100644
index 1a4508be95..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/called-in-order.d.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-export = calledInOrder;
-/**
- * A Sinon proxy object (fake, spy, stub)
- *
- * @typedef {object} SinonProxy
- * @property {Function} calledBefore - A method that determines if this proxy was called before another one
- * @property {string} id - Some id
- * @property {number} callCount - Number of times this proxy has been called
- */
-/**
- * Returns true when the spies have been called in the order they were supplied in
- *
- * @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments
- * @returns {boolean} true when spies are called in order, false otherwise
- */
-declare function calledInOrder(spies: SinonProxy[] | SinonProxy, ...args: any[]): boolean;
-declare namespace calledInOrder {
- export { SinonProxy };
-}
-/**
- * A Sinon proxy object (fake, spy, stub)
- */
-type SinonProxy = {
- /**
- * - A method that determines if this proxy was called before another one
- */
- calledBefore: Function;
- /**
- * - Some id
- */
- id: string;
- /**
- * - Number of times this proxy has been called
- */
- callCount: number;
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/class-name.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/class-name.d.ts
deleted file mode 100644
index df3687b9b2..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/class-name.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export = className;
-/**
- * Returns a display name for a value from a constructor
- *
- * @param {object} value A value to examine
- * @returns {(string|null)} A string or null
- */
-declare function className(value: object): (string | null);
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/deprecated.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/deprecated.d.ts
deleted file mode 100644
index 81a35bf836..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/deprecated.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export function wrap(func: Function, msg: string): Function;
-export function defaultMsg(packageName: string, funcName: string): string;
-export function printWarning(msg: string): undefined;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/every.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/every.d.ts
deleted file mode 100644
index bcfa64e017..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/every.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function _exports(obj: object, fn: Function): boolean;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/function-name.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/function-name.d.ts
deleted file mode 100644
index f27d519a9f..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/function-name.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function _exports(func: Function): string;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/global.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/global.d.ts
deleted file mode 100644
index 0f54a635dc..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/global.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export = globalObject;
-/**
- * A reference to the global object
- *
- * @type {object} globalObject
- */
-declare var globalObject: object;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/index.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/index.d.ts
deleted file mode 100644
index 7d675b1819..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/index.d.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-export const global: any;
-export const calledInOrder: typeof import("./called-in-order");
-export const className: typeof import("./class-name");
-export const deprecated: typeof import("./deprecated");
-export const every: (obj: any, fn: Function) => boolean;
-export const functionName: (func: Function) => string;
-export const orderByFirstCall: typeof import("./order-by-first-call");
-export const prototypes: {
- array: any;
- function: any;
- map: any;
- object: any;
- set: any;
- string: any;
-};
-export const typeOf: (value: any) => string;
-export const valueToString: typeof import("./value-to-string");
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts
deleted file mode 100644
index a9a6037d0d..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-export = orderByFirstCall;
-/**
- * A Sinon proxy object (fake, spy, stub)
- *
- * @typedef {object} SinonProxy
- * @property {Function} getCall - A method that can return the first call
- */
-/**
- * Sorts an array of SinonProxy instances (fake, spy, stub) by their first call
- *
- * @param {SinonProxy[] | SinonProxy} spies
- * @returns {SinonProxy[]}
- */
-declare function orderByFirstCall(spies: SinonProxy[] | SinonProxy): SinonProxy[];
-declare namespace orderByFirstCall {
- export { SinonProxy };
-}
-/**
- * A Sinon proxy object (fake, spy, stub)
- */
-type SinonProxy = {
- /**
- * - A method that can return the first call
- */
- getCall: Function;
-};
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/array.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/array.d.ts
deleted file mode 100644
index 1cce635071..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/array.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _exports: any;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/copy-prototype-methods.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/copy-prototype-methods.d.ts
deleted file mode 100644
index 1479b93cf9..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/copy-prototype-methods.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function _exports(prototype: any): any;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/function.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/function.d.ts
deleted file mode 100644
index 1cce635071..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/function.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _exports: any;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/index.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/index.d.ts
deleted file mode 100644
index 0026d6c2f5..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/index.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export declare const array: any;
-declare const _function: any;
-export { _function as function };
-export declare const map: any;
-export declare const object: any;
-export declare const set: any;
-export declare const string: any;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/map.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/map.d.ts
deleted file mode 100644
index 1cce635071..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/map.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _exports: any;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/object.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/object.d.ts
deleted file mode 100644
index 1cce635071..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/object.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _exports: any;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/set.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/set.d.ts
deleted file mode 100644
index 1cce635071..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/set.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _exports: any;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/string.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/string.d.ts
deleted file mode 100644
index 1cce635071..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/string.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _exports: any;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts
deleted file mode 100644
index 6cc97f4a15..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export = throwsOnProto;
-/**
- * Is true when the environment causes an error to be thrown for accessing the
- * __proto__ property.
- *
- * This is necessary in order to support `node --disable-proto=throw`.
- *
- * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto
- *
- * @type {boolean}
- */
-declare let throwsOnProto: boolean;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/type-of.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/type-of.d.ts
deleted file mode 100644
index fc72887c0e..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/type-of.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function _exports(value: any): string;
-export = _exports;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/value-to-string.d.ts b/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/value-to-string.d.ts
deleted file mode 100644
index 19b086cd28..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/value-to-string.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export = valueToString;
-/**
- * Returns a string representation of the value
- *
- * @param {*} value
- * @returns {string}
- */
-declare function valueToString(value: any): string;
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/package.json b/node_modules/nise/node_modules/@sinonjs/fake-timers/package.json
deleted file mode 100644
index fdb1892669..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/package.json
+++ /dev/null
@@ -1,65 +0,0 @@
-{
- "name": "@sinonjs/fake-timers",
- "description": "Fake JavaScript timers",
- "version": "10.3.0",
- "homepage": "https://github.com/sinonjs/fake-timers",
- "author": "Christian Johansen",
- "repository": {
- "type": "git",
- "url": "https://github.com/sinonjs/fake-timers.git"
- },
- "bugs": {
- "mail": "christian@cjohansen.no",
- "url": "https://github.com/sinonjs/fake-timers/issues"
- },
- "license": "BSD-3-Clause",
- "scripts": {
- "lint": "eslint .",
- "test-node": "mocha --timeout 200 test/ integration-test/ -R dot --check-leaks",
- "test-headless": "mochify --no-detect-globals --timeout=10000",
- "test-check-coverage": "npm run test-coverage && nyc check-coverage",
- "test-cloud": "mochify --wd --no-detect-globals --timeout=10000",
- "test-coverage": "nyc --all --reporter text --reporter html --reporter lcovonly npm run test-node",
- "test": "npm run test-node && npm run test-headless",
- "prettier:check": "prettier --check '**/*.{js,css,md}'",
- "prettier:write": "prettier --write '**/*.{js,css,md}'",
- "preversion": "./scripts/preversion.sh",
- "version": "./scripts/version.sh",
- "postversion": "./scripts/postversion.sh",
- "prepare": "husky install"
- },
- "lint-staged": {
- "*.{js,css,md}": "prettier --check",
- "*.js": "eslint"
- },
- "files": [
- "src/"
- ],
- "devDependencies": {
- "@sinonjs/eslint-config": "^4.1.0",
- "@sinonjs/referee-sinon": "11.0.0",
- "husky": "^8.0.3",
- "jsdom": "22.0.0",
- "lint-staged": "13.2.2",
- "mocha": "10.2.0",
- "mochify": "9.2.0",
- "nyc": "15.1.0",
- "prettier": "2.8.8"
- },
- "main": "./src/fake-timers-src.js",
- "dependencies": {
- "@sinonjs/commons": "^3.0.0"
- },
- "nyc": {
- "branches": 85,
- "lines": 92,
- "functions": 92,
- "statements": 92,
- "exclude": [
- "**/*-test.js",
- "coverage/**",
- "types/**",
- "fake-timers.js"
- ]
- }
-}
diff --git a/node_modules/nise/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js b/node_modules/nise/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js
deleted file mode 100644
index 607d91fb1f..0000000000
--- a/node_modules/nise/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js
+++ /dev/null
@@ -1,1787 +0,0 @@
-"use strict";
-
-const globalObject = require("@sinonjs/commons").global;
-
-/**
- * @typedef {object} IdleDeadline
- * @property {boolean} didTimeout - whether or not the callback was called before reaching the optional timeout
- * @property {function():number} timeRemaining - a floating-point value providing an estimate of the number of milliseconds remaining in the current idle period
- */
-
-/**
- * Queues a function to be called during a browser's idle periods
- *
- * @callback RequestIdleCallback
- * @param {function(IdleDeadline)} callback
- * @param {{timeout: number}} options - an options object
- * @returns {number} the id
- */
-
-/**
- * @callback NextTick
- * @param {VoidVarArgsFunc} callback - the callback to run
- * @param {...*} arguments - optional arguments to call the callback with
- * @returns {void}
- */
-
-/**
- * @callback SetImmediate
- * @param {VoidVarArgsFunc} callback - the callback to run
- * @param {...*} arguments - optional arguments to call the callback with
- * @returns {NodeImmediate}
- */
-
-/**
- * @callback VoidVarArgsFunc
- * @param {...*} callback - the callback to run
- * @returns {void}
- */
-
-/**
- * @typedef RequestAnimationFrame
- * @property {function(number):void} requestAnimationFrame
- * @returns {number} - the id
- */
-
-/**
- * @typedef Performance
- * @property {function(): number} now
- */
-
-/* eslint-disable jsdoc/require-property-description */
-/**
- * @typedef {object} Clock
- * @property {number} now - the current time
- * @property {Date} Date - the Date constructor
- * @property {number} loopLimit - the maximum number of timers before assuming an infinite loop
- * @property {RequestIdleCallback} requestIdleCallback
- * @property {function(number):void} cancelIdleCallback
- * @property {setTimeout} setTimeout
- * @property {clearTimeout} clearTimeout
- * @property {NextTick} nextTick
- * @property {queueMicrotask} queueMicrotask
- * @property {setInterval} setInterval
- * @property {clearInterval} clearInterval
- * @property {SetImmediate} setImmediate
- * @property {function(NodeImmediate):void} clearImmediate
- * @property {function():number} countTimers
- * @property {RequestAnimationFrame} requestAnimationFrame
- * @property {function(number):void} cancelAnimationFrame
- * @property {function():void} runMicrotasks
- * @property {function(string | number): number} tick
- * @property {function(string | number): Promise
');
- }
-
- ret.push(escapeHTML(change.value));
-
- if (change.added) {
- ret.push('');
- } else if (change.removed) {
- ret.push('');
- }
- }
-
- return ret.join('');
- }
-
- function escapeHTML(s) {
- var n = s;
- n = n.replace(/&/g, '&');
- n = n.replace(//g, '>');
- n = n.replace(/"/g, '"');
- return n;
- }
-
- exports.Diff = Diff;
- exports.applyPatch = applyPatch;
- exports.applyPatches = applyPatches;
- exports.canonicalize = canonicalize;
- exports.convertChangesToDMP = convertChangesToDMP;
- exports.convertChangesToXML = convertChangesToXML;
- exports.createPatch = createPatch;
- exports.createTwoFilesPatch = createTwoFilesPatch;
- exports.diffArrays = diffArrays;
- exports.diffChars = diffChars;
- exports.diffCss = diffCss;
- exports.diffJson = diffJson;
- exports.diffLines = diffLines;
- exports.diffSentences = diffSentences;
- exports.diffTrimmedLines = diffTrimmedLines;
- exports.diffWords = diffWords;
- exports.diffWordsWithSpace = diffWordsWithSpace;
- exports.merge = merge;
- exports.parsePatch = parsePatch;
- exports.structuredPatch = structuredPatch;
-
- Object.defineProperty(exports, '__esModule', { value: true });
-
-})));
-
-},{}],120:[function(require,module,exports){
-module.exports = extend;
-
-/*
- var obj = {a: 3, b: 5};
- extend(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
- obj; // {a: 4, b: 5, c: 8}
-
- var obj = {a: 3, b: 5};
- extend({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
- obj; // {a: 3, b: 5}
-
- var arr = [1, 2, 3];
- var obj = {a: 3, b: 5};
- extend(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
- arr.push(4);
- obj; // {a: 3, b: 5, c: [1, 2, 3, 4]}
-
- var arr = [1, 2, 3];
- var obj = {a: 3, b: 5};
- extend(true, obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
- arr.push(4);
- obj; // {a: 3, b: 5, c: [1, 2, 3]}
-
- extend({a: 4, b: 5}); // {a: 4, b: 5}
- extend({a: 4, b: 5}, 3); {a: 4, b: 5}
- extend({a: 4, b: 5}, true); {a: 4, b: 5}
- extend('hello', {a: 4, b: 5}); // throws
- extend(3, {a: 4, b: 5}); // throws
-*/
-
-function extend(/* [deep], obj1, obj2, [objn] */) {
- var args = [].slice.call(arguments);
- var deep = false;
- if (typeof args[0] == 'boolean') {
- deep = args.shift();
- }
- var result = args[0];
- if (isUnextendable(result)) {
- throw new Error('extendee must be an object');
- }
- var extenders = args.slice(1);
- var len = extenders.length;
- for (var i = 0; i < len; i++) {
- var extender = extenders[i];
- for (var key in extender) {
- if (Object.prototype.hasOwnProperty.call(extender, key)) {
- var value = extender[key];
- if (deep && isCloneable(value)) {
- var base = Array.isArray(value) ? [] : {};
- result[key] = extend(
- true,
- Object.prototype.hasOwnProperty.call(result, key) && !isUnextendable(result[key])
- ? result[key]
- : base,
- value
- );
- } else {
- result[key] = value;
- }
- }
- }
- }
- return result;
-}
-
-function isCloneable(obj) {
- return Array.isArray(obj) || {}.toString.call(obj) == '[object Object]';
-}
-
-function isUnextendable(val) {
- return !val || (typeof val != 'object' && typeof val != 'function');
-}
-
-},{}],121:[function(require,module,exports){
-/**
- * lodash (Custom Build) ');
+ }
- this.requested = true;
+ ret.push(escapeHTML(change.value));
- this.requestedOnce = count === 1;
- this.requestedTwice = count === 2;
- this.requestedThrice = count === 3;
+ if (change.added) {
+ ret.push('');
+ } else if (change.removed) {
+ ret.push('');
+ }
+ }
- this.firstRequest = this.getRequest(0);
- this.secondRequest = this.getRequest(1);
- this.thirdRequest = this.getRequest(2);
+ return ret.join('');
+ }
- this.lastRequest = this.getRequest(count - 1);
-}
+ function escapeHTML(s) {
+ var n = s;
+ n = n.replace(/&/g, '&');
+ n = n.replace(//g, '>');
+ n = n.replace(/"/g, '"');
+ return n;
+ }
-var fakeServer = {
- create: function(config) {
- var server = Object.create(this);
- server.configure(config);
- this.xhr = fakeXhr.useFakeXMLHttpRequest();
- server.requests = [];
- server.requestCount = 0;
- server.queue = [];
- server.responses = [];
+ exports.Diff = Diff;
+ exports.applyPatch = applyPatch;
+ exports.applyPatches = applyPatches;
+ exports.canonicalize = canonicalize;
+ exports.convertChangesToDMP = convertChangesToDMP;
+ exports.convertChangesToXML = convertChangesToXML;
+ exports.createPatch = createPatch;
+ exports.createTwoFilesPatch = createTwoFilesPatch;
+ exports.diffArrays = diffArrays;
+ exports.diffChars = diffChars;
+ exports.diffCss = diffCss;
+ exports.diffJson = diffJson;
+ exports.diffLines = diffLines;
+ exports.diffSentences = diffSentences;
+ exports.diffTrimmedLines = diffTrimmedLines;
+ exports.diffWords = diffWords;
+ exports.diffWordsWithSpace = diffWordsWithSpace;
+ exports.formatPatch = formatPatch;
+ exports.merge = merge;
+ exports.parsePatch = parsePatch;
+ exports.reversePatch = reversePatch;
+ exports.structuredPatch = structuredPatch;
- this.xhr.onCreate = function(xhrObj) {
- xhrObj.unsafeHeadersEnabled = function() {
- return !(server.unsafeHeadersEnabled === false);
- };
- server.addRequest(xhrObj);
- };
+ Object.defineProperty(exports, '__esModule', { value: true });
- return server;
- },
+})));
- configure: function(config) {
- var self = this;
- var allowlist = {
- autoRespond: true,
- autoRespondAfter: true,
- respondImmediately: true,
- fakeHTTPMethods: true,
- logger: true,
- unsafeHeadersEnabled: true
- };
+},{}],122:[function(require,module,exports){
+'use strict';
- // eslint-disable-next-line no-param-reassign
- config = config || {};
+var GetIntrinsic = require('get-intrinsic');
- Object.keys(config).forEach(function(setting) {
- if (setting in allowlist) {
- self[setting] = config[setting];
- }
- });
+/** @type {import('.')} */
+var $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;
+if ($defineProperty) {
+ try {
+ $defineProperty({}, 'a', { value: 1 });
+ } catch (e) {
+ // IE 8 has a broken defineProperty
+ $defineProperty = false;
+ }
+}
- self.logError = configureLogError(config);
- },
+module.exports = $defineProperty;
- addRequest: function addRequest(xhrObj) {
- var server = this;
- push.call(this.requests, xhrObj);
+},{"get-intrinsic":132}],123:[function(require,module,exports){
+'use strict';
- incrementRequestCount.call(this);
+/** @type {import('./eval')} */
+module.exports = EvalError;
- xhrObj.onSend = function() {
- server.handleRequest(this);
+},{}],124:[function(require,module,exports){
+'use strict';
- if (server.respondImmediately) {
- server.respond();
- } else if (server.autoRespond && !server.responding) {
- setTimeout(function() {
- server.responding = false;
- server.respond();
- }, server.autoRespondAfter || 10);
+/** @type {import('.')} */
+module.exports = Error;
- server.responding = true;
- }
- };
- },
+},{}],125:[function(require,module,exports){
+'use strict';
- getHTTPMethod: function getHTTPMethod(request) {
- if (this.fakeHTTPMethods && /post/i.test(request.method)) {
- var matches = (request.requestBody || "").match(
- /_method=([^\b;]+)/
- );
- return matches ? matches[1] : request.method;
- }
+/** @type {import('./range')} */
+module.exports = RangeError;
- return request.method;
- },
+},{}],126:[function(require,module,exports){
+'use strict';
- handleRequest: function handleRequest(xhr) {
- if (xhr.async) {
- push.call(this.queue, xhr);
- } else {
- this.processRequest(xhr);
- }
- },
+/** @type {import('./ref')} */
+module.exports = ReferenceError;
- logger: function() {
- // no-op; override via configure()
- },
+},{}],127:[function(require,module,exports){
+'use strict';
- logError: configureLogError({}),
+/** @type {import('./syntax')} */
+module.exports = SyntaxError;
- log: log,
+},{}],128:[function(require,module,exports){
+'use strict';
- respondWith: function respondWith(method, url, body) {
- if (arguments.length === 1 && typeof method !== "function") {
- this.response = responseArray(method);
- return;
- }
+/** @type {import('./type')} */
+module.exports = TypeError;
- if (arguments.length === 1) {
- // eslint-disable-next-line no-param-reassign
- body = method;
- // eslint-disable-next-line no-param-reassign
- url = method = null;
- }
+},{}],129:[function(require,module,exports){
+'use strict';
- if (arguments.length === 2) {
- // eslint-disable-next-line no-param-reassign
- body = url;
- // eslint-disable-next-line no-param-reassign
- url = method;
- // eslint-disable-next-line no-param-reassign
- method = null;
- }
+/** @type {import('./uri')} */
+module.exports = URIError;
- // Escape port number to prevent "named" parameters in 'path-to-regexp' module
- if (typeof url === "string" && url !== "" && /:[0-9]+\//.test(url)) {
- var m = url.match(/^(https?:\/\/.*?):([0-9]+\/.*)$/);
- // eslint-disable-next-line no-param-reassign
- url = `${m[1]}\\:${m[2]}`;
- }
+},{}],130:[function(require,module,exports){
+'use strict';
- push.call(this.responses, {
- method: method,
- url:
- typeof url === "string" && url !== "" ? pathToRegexp(url) : url,
- response: typeof body === "function" ? body : responseArray(body)
- });
- },
+/* eslint no-invalid-this: 1 */
- respond: function respond() {
- if (arguments.length > 0) {
- this.respondWith.apply(this, arguments);
- }
+var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
+var toStr = Object.prototype.toString;
+var max = Math.max;
+var funcType = '[object Function]';
- var queue = this.queue || [];
- var requests = queue.splice(0, queue.length);
- var self = this;
+var concatty = function concatty(a, b) {
+ var arr = [];
- requests.forEach(function(request) {
- self.processRequest(request);
- });
- },
+ for (var i = 0; i < a.length; i += 1) {
+ arr[i] = a[i];
+ }
+ for (var j = 0; j < b.length; j += 1) {
+ arr[j + a.length] = b[j];
+ }
- respondAll: function respondAll() {
- if (this.respondImmediately) {
- return;
- }
+ return arr;
+};
- this.queue = this.requests.slice(0);
+var slicy = function slicy(arrLike, offset) {
+ var arr = [];
+ for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
+ arr[j] = arrLike[i];
+ }
+ return arr;
+};
- var request;
- while ((request = this.queue.shift())) {
- this.processRequest(request);
+var joiny = function (arr, joiner) {
+ var str = '';
+ for (var i = 0; i < arr.length; i += 1) {
+ str += arr[i];
+ if (i + 1 < arr.length) {
+ str += joiner;
}
- },
-
- processRequest: function processRequest(request) {
- try {
- if (request.aborted) {
- return;
- }
+ }
+ return str;
+};
- var response = this.response || [404, {}, ""];
+module.exports = function bind(that) {
+ var target = this;
+ if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
+ throw new TypeError(ERROR_MESSAGE + target);
+ }
+ var args = slicy(arguments, 1);
- if (this.responses) {
- for (var l = this.responses.length, i = l - 1; i >= 0; i--) {
- if (match.call(this, this.responses[i], request)) {
- response = this.responses[i].response;
- break;
- }
- }
+ var bound;
+ var binder = function () {
+ if (this instanceof bound) {
+ var result = target.apply(
+ this,
+ concatty(args, arguments)
+ );
+ if (Object(result) === result) {
+ return result;
}
+ return this;
+ }
+ return target.apply(
+ that,
+ concatty(args, arguments)
+ );
- if (request.readyState !== 4) {
- this.log(response, request);
+ };
- request.respond(response[0], response[1], response[2]);
- }
- } catch (e) {
- this.logError("Fake server request processing", e);
- }
- },
+ var boundLength = max(0, target.length - args.length);
+ var boundArgs = [];
+ for (var i = 0; i < boundLength; i++) {
+ boundArgs[i] = '$' + i;
+ }
- restore: function restore() {
- return this.xhr.restore && this.xhr.restore.apply(this.xhr, arguments);
- },
+ bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
- getRequest: function getRequest(index) {
- return this.requests[index] || null;
- },
+ if (target.prototype) {
+ var Empty = function Empty() {};
+ Empty.prototype = target.prototype;
+ bound.prototype = new Empty();
+ Empty.prototype = null;
+ }
- reset: function reset() {
- this.resetBehavior();
- this.resetHistory();
- },
+ return bound;
+};
- resetBehavior: function resetBehavior() {
- this.responses.length = this.queue.length = 0;
- },
+},{}],131:[function(require,module,exports){
+'use strict';
- resetHistory: function resetHistory() {
- this.requests.length = this.requestCount = 0;
+var implementation = require('./implementation');
- this.requestedOnce = this.requestedTwice = this.requestedThrice = this.requested = false;
+module.exports = Function.prototype.bind || implementation;
- this.firstRequest = this.secondRequest = this.thirdRequest = this.lastRequest = null;
- }
-};
+},{"./implementation":130}],132:[function(require,module,exports){
+'use strict';
-module.exports = fakeServer;
+var undefined;
-},{"../configure-logger":122,"../fake-xhr":132,"./log":130,"path-to-regexp":174}],130:[function(require,module,exports){
-"use strict";
-var inspect = require("util").inspect;
+var $Error = require('es-errors');
+var $EvalError = require('es-errors/eval');
+var $RangeError = require('es-errors/range');
+var $ReferenceError = require('es-errors/ref');
+var $SyntaxError = require('es-errors/syntax');
+var $TypeError = require('es-errors/type');
+var $URIError = require('es-errors/uri');
-function log(response, request) {
- var str;
+var $Function = Function;
- str = `Request:\n${inspect(request)}\n\n`;
- str += `Response:\n${inspect(response)}\n\n`;
+// eslint-disable-next-line consistent-return
+var getEvalledConstructor = function (expressionSyntax) {
+ try {
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
+ } catch (e) {}
+};
- /* istanbul ignore else: when this.logger is not a function, it can't be called */
- if (typeof this.logger === "function") {
- this.logger(str);
- }
+var $gOPD = Object.getOwnPropertyDescriptor;
+if ($gOPD) {
+ try {
+ $gOPD({}, '');
+ } catch (e) {
+ $gOPD = null; // this is IE 8, which has a broken gOPD
+ }
}
-module.exports = log;
+var throwTypeError = function () {
+ throw new $TypeError();
+};
+var ThrowTypeError = $gOPD
+ ? (function () {
+ try {
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
+ arguments.callee; // IE 8 does not throw here
+ return throwTypeError;
+ } catch (calleeThrows) {
+ try {
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
+ return $gOPD(arguments, 'callee').get;
+ } catch (gOPDthrows) {
+ return throwTypeError;
+ }
+ }
+ }())
+ : throwTypeError;
-},{"util":118}],131:[function(require,module,exports){
-"use strict";
+var hasSymbols = require('has-symbols')();
+var hasProto = require('has-proto')();
-exports.isSupported = (function() {
- try {
- return Boolean(new Blob());
- } catch (e) {
- return false;
- }
-})();
+var getProto = Object.getPrototypeOf || (
+ hasProto
+ ? function (x) { return x.__proto__; } // eslint-disable-line no-proto
+ : null
+);
-},{}],132:[function(require,module,exports){
-"use strict";
+var needsEval = {};
+
+var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
+
+var INTRINSICS = {
+ __proto__: null,
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
+ '%Array%': Array,
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
+ '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
+ '%AsyncFromSyncIteratorPrototype%': undefined,
+ '%AsyncFunction%': needsEval,
+ '%AsyncGenerator%': needsEval,
+ '%AsyncGeneratorFunction%': needsEval,
+ '%AsyncIteratorPrototype%': needsEval,
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
+ '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
+ '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
+ '%Boolean%': Boolean,
+ '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
+ '%Date%': Date,
+ '%decodeURI%': decodeURI,
+ '%decodeURIComponent%': decodeURIComponent,
+ '%encodeURI%': encodeURI,
+ '%encodeURIComponent%': encodeURIComponent,
+ '%Error%': $Error,
+ '%eval%': eval, // eslint-disable-line no-eval
+ '%EvalError%': $EvalError,
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
+ '%Function%': $Function,
+ '%GeneratorFunction%': needsEval,
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
+ '%isFinite%': isFinite,
+ '%isNaN%': isNaN,
+ '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined,
+ '%Map%': typeof Map === 'undefined' ? undefined : Map,
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
+ '%Math%': Math,
+ '%Number%': Number,
+ '%Object%': Object,
+ '%parseFloat%': parseFloat,
+ '%parseInt%': parseInt,
+ '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
+ '%RangeError%': $RangeError,
+ '%ReferenceError%': $ReferenceError,
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
+ '%RegExp%': RegExp,
+ '%Set%': typeof Set === 'undefined' ? undefined : Set,
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
+ '%String%': String,
+ '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
+ '%Symbol%': hasSymbols ? Symbol : undefined,
+ '%SyntaxError%': $SyntaxError,
+ '%ThrowTypeError%': ThrowTypeError,
+ '%TypedArray%': TypedArray,
+ '%TypeError%': $TypeError,
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
+ '%URIError%': $URIError,
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
+};
-var GlobalTextEncoder =
- typeof TextEncoder !== "undefined"
- ? TextEncoder
- : require("@sinonjs/text-encoding").TextEncoder;
-var globalObject = require("@sinonjs/commons").global;
-var configureLogError = require("../configure-logger");
-var sinonEvent = require("../event");
-var extend = require("just-extend");
+if (getProto) {
+ try {
+ null.error; // eslint-disable-line no-unused-expressions
+ } catch (e) {
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
+ var errorProto = getProto(getProto(e));
+ INTRINSICS['%Error.prototype%'] = errorProto;
+ }
+}
-var supportsProgress = typeof ProgressEvent !== "undefined";
-var supportsCustomEvent = typeof CustomEvent !== "undefined";
-var supportsFormData = typeof FormData !== "undefined";
-var supportsArrayBuffer = typeof ArrayBuffer !== "undefined";
-var supportsBlob = require("./blob").isSupported;
+var doEval = function doEval(name) {
+ var value;
+ if (name === '%AsyncFunction%') {
+ value = getEvalledConstructor('async function () {}');
+ } else if (name === '%GeneratorFunction%') {
+ value = getEvalledConstructor('function* () {}');
+ } else if (name === '%AsyncGeneratorFunction%') {
+ value = getEvalledConstructor('async function* () {}');
+ } else if (name === '%AsyncGenerator%') {
+ var fn = doEval('%AsyncGeneratorFunction%');
+ if (fn) {
+ value = fn.prototype;
+ }
+ } else if (name === '%AsyncIteratorPrototype%') {
+ var gen = doEval('%AsyncGenerator%');
+ if (gen && getProto) {
+ value = getProto(gen.prototype);
+ }
+ }
-function getWorkingXHR(globalScope) {
- var supportsXHR = typeof globalScope.XMLHttpRequest !== "undefined";
- if (supportsXHR) {
- return globalScope.XMLHttpRequest;
- }
+ INTRINSICS[name] = value;
- var supportsActiveX = typeof globalScope.ActiveXObject !== "undefined";
- if (supportsActiveX) {
- return function() {
- return new globalScope.ActiveXObject("MSXML2.XMLHTTP.3.0");
- };
- }
+ return value;
+};
- return false;
-}
+var LEGACY_ALIASES = {
+ __proto__: null,
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
+ '%ArrayPrototype%': ['Array', 'prototype'],
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
+ '%DataViewPrototype%': ['DataView', 'prototype'],
+ '%DatePrototype%': ['Date', 'prototype'],
+ '%ErrorPrototype%': ['Error', 'prototype'],
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
+ '%FunctionPrototype%': ['Function', 'prototype'],
+ '%Generator%': ['GeneratorFunction', 'prototype'],
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
+ '%JSONParse%': ['JSON', 'parse'],
+ '%JSONStringify%': ['JSON', 'stringify'],
+ '%MapPrototype%': ['Map', 'prototype'],
+ '%NumberPrototype%': ['Number', 'prototype'],
+ '%ObjectPrototype%': ['Object', 'prototype'],
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
+ '%PromisePrototype%': ['Promise', 'prototype'],
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
+ '%Promise_all%': ['Promise', 'all'],
+ '%Promise_reject%': ['Promise', 'reject'],
+ '%Promise_resolve%': ['Promise', 'resolve'],
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
+ '%SetPrototype%': ['Set', 'prototype'],
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
+ '%StringPrototype%': ['String', 'prototype'],
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
+};
-// Ref: https://fetch.spec.whatwg.org/#forbidden-header-name
-var unsafeHeaders = {
- "Accept-Charset": true,
- "Access-Control-Request-Headers": true,
- "Access-Control-Request-Method": true,
- "Accept-Encoding": true,
- Connection: true,
- "Content-Length": true,
- Cookie: true,
- Cookie2: true,
- "Content-Transfer-Encoding": true,
- Date: true,
- DNT: true,
- Expect: true,
- Host: true,
- "Keep-Alive": true,
- Origin: true,
- Referer: true,
- TE: true,
- Trailer: true,
- "Transfer-Encoding": true,
- Upgrade: true,
- "User-Agent": true,
- Via: true
+var bind = require('function-bind');
+var hasOwn = require('hasown');
+var $concat = bind.call(Function.call, Array.prototype.concat);
+var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
+var $replace = bind.call(Function.call, String.prototype.replace);
+var $strSlice = bind.call(Function.call, String.prototype.slice);
+var $exec = bind.call(Function.call, RegExp.prototype.exec);
+
+/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
+var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
+var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
+var stringToPath = function stringToPath(string) {
+ var first = $strSlice(string, 0, 1);
+ var last = $strSlice(string, -1);
+ if (first === '%' && last !== '%') {
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
+ } else if (last === '%' && first !== '%') {
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
+ }
+ var result = [];
+ $replace(string, rePropName, function (match, number, quote, subString) {
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
+ });
+ return result;
};
+/* end adaptation */
+
+var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
+ var intrinsicName = name;
+ var alias;
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
+ alias = LEGACY_ALIASES[intrinsicName];
+ intrinsicName = '%' + alias[0] + '%';
+ }
-function EventTargetHandler() {
- var self = this;
- var events = [
- "loadstart",
- "progress",
- "abort",
- "error",
- "load",
- "timeout",
- "loadend"
- ];
+ if (hasOwn(INTRINSICS, intrinsicName)) {
+ var value = INTRINSICS[intrinsicName];
+ if (value === needsEval) {
+ value = doEval(intrinsicName);
+ }
+ if (typeof value === 'undefined' && !allowMissing) {
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
+ }
+
+ return {
+ alias: alias,
+ name: intrinsicName,
+ value: value
+ };
+ }
+
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
+};
+
+module.exports = function GetIntrinsic(name, allowMissing) {
+ if (typeof name !== 'string' || name.length === 0) {
+ throw new $TypeError('intrinsic name must be a non-empty string');
+ }
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
+ throw new $TypeError('"allowMissing" argument must be a boolean');
+ }
- function addEventListener(eventName) {
- self.addEventListener(eventName, function(event) {
- var listener = self[`on${eventName}`];
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
+ }
+ var parts = stringToPath(name);
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
+
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
+ var intrinsicRealName = intrinsic.name;
+ var value = intrinsic.value;
+ var skipFurtherCaching = false;
+
+ var alias = intrinsic.alias;
+ if (alias) {
+ intrinsicBaseName = alias[0];
+ $spliceApply(parts, $concat([0, 1], alias));
+ }
- if (listener && typeof listener === "function") {
- listener.call(this, event);
- }
- });
- }
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
+ var part = parts[i];
+ var first = $strSlice(part, 0, 1);
+ var last = $strSlice(part, -1);
+ if (
+ (
+ (first === '"' || first === "'" || first === '`')
+ || (last === '"' || last === "'" || last === '`')
+ )
+ && first !== last
+ ) {
+ throw new $SyntaxError('property names with quotes must have matching quotes');
+ }
+ if (part === 'constructor' || !isOwn) {
+ skipFurtherCaching = true;
+ }
- events.forEach(addEventListener);
-}
+ intrinsicBaseName += '.' + part;
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
-EventTargetHandler.prototype = sinonEvent.EventTarget;
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
+ value = INTRINSICS[intrinsicRealName];
+ } else if (value != null) {
+ if (!(part in value)) {
+ if (!allowMissing) {
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
+ }
+ return void undefined;
+ }
+ if ($gOPD && (i + 1) >= parts.length) {
+ var desc = $gOPD(value, part);
+ isOwn = !!desc;
+
+ // By convention, when a data property is converted to an accessor
+ // property to emulate a data property that does not suffer from
+ // the override mistake, that accessor's getter is marked with
+ // an `originalValue` property. Here, when we detect this, we
+ // uphold the illusion by pretending to see that original data
+ // property, i.e., returning the value rather than the getter
+ // itself.
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
+ value = desc.get;
+ } else {
+ value = value[part];
+ }
+ } else {
+ isOwn = hasOwn(value, part);
+ value = value[part];
+ }
-function normalizeHeaderValue(value) {
- // Ref: https://fetch.spec.whatwg.org/#http-whitespace-bytes
- /*eslint no-control-regex: "off"*/
- return value.replace(/^[\x09\x0A\x0D\x20]+|[\x09\x0A\x0D\x20]+$/g, "");
-}
+ if (isOwn && !skipFurtherCaching) {
+ INTRINSICS[intrinsicRealName] = value;
+ }
+ }
+ }
+ return value;
+};
-function getHeader(headers, header) {
- var foundHeader = Object.keys(headers).filter(function(h) {
- return h.toLowerCase() === header.toLowerCase();
- });
+},{"es-errors":124,"es-errors/eval":123,"es-errors/range":125,"es-errors/ref":126,"es-errors/syntax":127,"es-errors/type":128,"es-errors/uri":129,"function-bind":131,"has-proto":135,"has-symbols":136,"hasown":138}],133:[function(require,module,exports){
+'use strict';
- return foundHeader[0] || null;
-}
+var GetIntrinsic = require('get-intrinsic');
-function excludeSetCookie2Header(header) {
- return !/^Set-Cookie2?$/i.test(header);
+var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
+
+if ($gOPD) {
+ try {
+ $gOPD([], 'length');
+ } catch (e) {
+ // IE 8 has a broken gOPD
+ $gOPD = null;
+ }
}
-function verifyResponseBodyType(body, responseType) {
- var error = null;
- var isString = typeof body === "string";
+module.exports = $gOPD;
- if (responseType === "arraybuffer") {
- if (!isString && !(body instanceof ArrayBuffer)) {
- error = new Error(
- `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string or ArrayBuffer.`
- );
- error.name = "InvalidBodyException";
- }
- } else if (responseType === "blob") {
- if (
- !isString &&
- !(body instanceof ArrayBuffer) &&
- supportsBlob &&
- !(body instanceof Blob)
- ) {
- error = new Error(
- `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string, ArrayBuffer, or Blob.`
- );
- error.name = "InvalidBodyException";
- }
- } else if (!isString) {
- error = new Error(
- `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string.`
- );
- error.name = "InvalidBodyException";
- }
+},{"get-intrinsic":132}],134:[function(require,module,exports){
+'use strict';
- if (error) {
- throw error;
- }
-}
+var $defineProperty = require('es-define-property');
-function convertToArrayBuffer(body, encoding) {
- if (body instanceof ArrayBuffer) {
- return body;
- }
+var hasPropertyDescriptors = function hasPropertyDescriptors() {
+ return !!$defineProperty;
+};
- return new GlobalTextEncoder(encoding || "utf-8").encode(body).buffer;
-}
+hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
+ // node v0.6 has a bug where array lengths can be Set but not Defined
+ if (!$defineProperty) {
+ return null;
+ }
+ try {
+ return $defineProperty([], 'length', { value: 1 }).length !== 1;
+ } catch (e) {
+ // In Firefox 4-22, defining length on an array throws an exception.
+ return true;
+ }
+};
-function isXmlContentType(contentType) {
- return (
- !contentType ||
- /(text\/xml)|(application\/xml)|(\+xml)/.test(contentType)
- );
-}
+module.exports = hasPropertyDescriptors;
-function clearResponse(xhr) {
- if (xhr.responseType === "" || xhr.responseType === "text") {
- xhr.response = xhr.responseText = "";
- } else {
- xhr.response = xhr.responseText = null;
- }
- xhr.responseXML = null;
-}
+},{"es-define-property":122}],135:[function(require,module,exports){
+'use strict';
-function fakeXMLHttpRequestFor(globalScope) {
- var isReactNative =
- globalScope.navigator &&
- globalScope.navigator.product === "ReactNative";
- var sinonXhr = { XMLHttpRequest: globalScope.XMLHttpRequest };
- sinonXhr.GlobalXMLHttpRequest = globalScope.XMLHttpRequest;
- sinonXhr.GlobalActiveXObject = globalScope.ActiveXObject;
- sinonXhr.supportsActiveX =
- typeof sinonXhr.GlobalActiveXObject !== "undefined";
- sinonXhr.supportsXHR = typeof sinonXhr.GlobalXMLHttpRequest !== "undefined";
- sinonXhr.workingXHR = getWorkingXHR(globalScope);
- sinonXhr.supportsTimeout =
- sinonXhr.supportsXHR &&
- "timeout" in new sinonXhr.GlobalXMLHttpRequest();
- sinonXhr.supportsCORS =
- isReactNative ||
- (sinonXhr.supportsXHR &&
- "withCredentials" in new sinonXhr.GlobalXMLHttpRequest());
+var test = {
+ __proto__: null,
+ foo: {}
+};
- // Note that for FakeXMLHttpRequest to work pre ES5
- // we lose some of the alignment with the spec.
- // To ensure as close a match as possible,
- // set responseType before calling open, send or respond;
- function FakeXMLHttpRequest(config) {
- EventTargetHandler.call(this);
- this.readyState = FakeXMLHttpRequest.UNSENT;
- this.requestHeaders = {};
- this.requestBody = null;
- this.status = 0;
- this.statusText = "";
- this.upload = new EventTargetHandler();
- this.responseType = "";
- this.response = "";
- this.logError = configureLogError(config);
+var $Object = Object;
- if (sinonXhr.supportsTimeout) {
- this.timeout = 0;
- }
+/** @type {import('.')} */
+module.exports = function hasProto() {
+ // @ts-expect-error: TS errors on an inherited property for some reason
+ return { __proto__: test }.foo === test.foo
+ && !(test instanceof $Object);
+};
- if (sinonXhr.supportsCORS) {
- this.withCredentials = false;
- }
+},{}],136:[function(require,module,exports){
+'use strict';
- if (typeof FakeXMLHttpRequest.onCreate === "function") {
- FakeXMLHttpRequest.onCreate(this);
- }
- }
+var origSymbol = typeof Symbol !== 'undefined' && Symbol;
+var hasSymbolSham = require('./shams');
- function verifyState(xhr) {
- if (xhr.readyState !== FakeXMLHttpRequest.OPENED) {
- throw new Error("INVALID_STATE_ERR");
- }
+module.exports = function hasNativeSymbols() {
+ if (typeof origSymbol !== 'function') { return false; }
+ if (typeof Symbol !== 'function') { return false; }
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
- if (xhr.sendFlag) {
- throw new Error("INVALID_STATE_ERR");
- }
- }
+ return hasSymbolSham();
+};
- // largest arity in XHR is 5 - XHR#open
- var apply = function(obj, method, args) {
- switch (args.length) {
- case 0:
- return obj[method]();
- case 1:
- return obj[method](args[0]);
- case 2:
- return obj[method](args[0], args[1]);
- case 3:
- return obj[method](args[0], args[1], args[2]);
- case 4:
- return obj[method](args[0], args[1], args[2], args[3]);
- case 5:
- return obj[method](args[0], args[1], args[2], args[3], args[4]);
- default:
- throw new Error("Unhandled case");
- }
- };
+},{"./shams":137}],137:[function(require,module,exports){
+'use strict';
- FakeXMLHttpRequest.filters = [];
- FakeXMLHttpRequest.addFilter = function addFilter(fn) {
- this.filters.push(fn);
- };
- FakeXMLHttpRequest.defake = function defake(fakeXhr, xhrArgs) {
- var xhr = new sinonXhr.workingXHR(); // eslint-disable-line new-cap
+/* eslint complexity: [2, 18], max-statements: [2, 33] */
+module.exports = function hasSymbols() {
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
+ if (typeof Symbol.iterator === 'symbol') { return true; }
- [
- "open",
- "setRequestHeader",
- "abort",
- "getResponseHeader",
- "getAllResponseHeaders",
- "addEventListener",
- "overrideMimeType",
- "removeEventListener"
- ].forEach(function(method) {
- fakeXhr[method] = function() {
- return apply(xhr, method, arguments);
- };
- });
+ var obj = {};
+ var sym = Symbol('test');
+ var symObj = Object(sym);
+ if (typeof sym === 'string') { return false; }
- fakeXhr.send = function() {
- // Ref: https://xhr.spec.whatwg.org/#the-responsetype-attribute
- if (xhr.responseType !== fakeXhr.responseType) {
- xhr.responseType = fakeXhr.responseType;
- }
- return apply(xhr, "send", arguments);
- };
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
- var copyAttrs = function(args) {
- args.forEach(function(attr) {
- fakeXhr[attr] = xhr[attr];
- });
- };
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
+ // if (sym instanceof Symbol) { return false; }
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
+ // if (!(symObj instanceof Symbol)) { return false; }
- var stateChangeStart = function() {
- fakeXhr.readyState = xhr.readyState;
- if (xhr.readyState >= FakeXMLHttpRequest.HEADERS_RECEIVED) {
- copyAttrs(["status", "statusText"]);
- }
- if (xhr.readyState >= FakeXMLHttpRequest.LOADING) {
- copyAttrs(["response"]);
- if (xhr.responseType === "" || xhr.responseType === "text") {
- copyAttrs(["responseText"]);
- }
- }
- if (
- xhr.readyState === FakeXMLHttpRequest.DONE &&
- (xhr.responseType === "" || xhr.responseType === "document")
- ) {
- copyAttrs(["responseXML"]);
- }
- };
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
- var stateChangeEnd = function() {
- if (fakeXhr.onreadystatechange) {
- // eslint-disable-next-line no-useless-call
- fakeXhr.onreadystatechange.call(fakeXhr, {
- target: fakeXhr,
- currentTarget: fakeXhr
- });
- }
- };
+ var symVal = 42;
+ obj[sym] = symVal;
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
- var stateChange = function stateChange() {
- stateChangeStart();
- stateChangeEnd();
- };
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
- if (xhr.addEventListener) {
- xhr.addEventListener("readystatechange", stateChangeStart);
+ var syms = Object.getOwnPropertySymbols(obj);
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
- Object.keys(fakeXhr.eventListeners).forEach(function(event) {
- /*eslint-disable no-loop-func*/
- fakeXhr.eventListeners[event].forEach(function(handler) {
- xhr.addEventListener(event, handler.listener, {
- capture: handler.capture,
- once: handler.once
- });
- });
- /*eslint-enable no-loop-func*/
- });
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
- xhr.addEventListener("readystatechange", stateChangeEnd);
- } else {
- xhr.onreadystatechange = stateChange;
- }
- apply(xhr, "open", xhrArgs);
- };
- FakeXMLHttpRequest.useFilters = false;
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
+ }
- function verifyRequestOpened(xhr) {
- if (xhr.readyState !== FakeXMLHttpRequest.OPENED) {
- const errorMessage =
- xhr.readyState === FakeXMLHttpRequest.UNSENT
- ? "INVALID_STATE_ERR - you might be trying to set the request state for a request that has already been aborted, it is recommended to check 'readyState' first..."
- : `INVALID_STATE_ERR - ${xhr.readyState}`;
- throw new Error(errorMessage);
- }
- }
+ return true;
+};
- function verifyRequestSent(xhr) {
- if (xhr.readyState === FakeXMLHttpRequest.DONE) {
- throw new Error("Request done");
- }
- }
+},{}],138:[function(require,module,exports){
+'use strict';
- function verifyHeadersReceived(xhr) {
- if (
- xhr.async &&
- xhr.readyState !== FakeXMLHttpRequest.HEADERS_RECEIVED
- ) {
- throw new Error("No headers received");
- }
- }
+var call = Function.prototype.call;
+var $hasOwn = Object.prototype.hasOwnProperty;
+var bind = require('function-bind');
- function convertResponseBody(responseType, contentType, body) {
- if (responseType === "" || responseType === "text") {
- return body;
- } else if (supportsArrayBuffer && responseType === "arraybuffer") {
- return convertToArrayBuffer(body);
- } else if (responseType === "json") {
- try {
- return JSON.parse(body);
- } catch (e) {
- // Return parsing failure as null
- return null;
- }
- } else if (supportsBlob && responseType === "blob") {
- if (body instanceof Blob) {
- return body;
- }
+/** @type {import('.')} */
+module.exports = bind.call(call, $hasOwn);
- var blobOptions = {};
- if (contentType) {
- blobOptions.type = contentType;
- }
- return new Blob([convertToArrayBuffer(body)], blobOptions);
- } else if (responseType === "document") {
- if (isXmlContentType(contentType)) {
- return FakeXMLHttpRequest.parseXML(body);
- }
- return null;
- }
- throw new Error(`Invalid responseType ${responseType}`);
- }
+},{"function-bind":131}],139:[function(require,module,exports){
+module.exports = extend;
- /**
- * Steps to follow when there is an error, according to:
- * https://xhr.spec.whatwg.org/#request-error-steps
- */
- function requestErrorSteps(xhr) {
- clearResponse(xhr);
- xhr.errorFlag = true;
- xhr.requestHeaders = {};
- xhr.responseHeaders = {};
+/*
+ var obj = {a: 3, b: 5};
+ extend(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
+ obj; // {a: 4, b: 5, c: 8}
- if (
- xhr.readyState !== FakeXMLHttpRequest.UNSENT &&
- xhr.sendFlag &&
- xhr.readyState !== FakeXMLHttpRequest.DONE
- ) {
- xhr.readyStateChange(FakeXMLHttpRequest.DONE);
- xhr.sendFlag = false;
- }
- }
+ var obj = {a: 3, b: 5};
+ extend({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
+ obj; // {a: 3, b: 5}
- FakeXMLHttpRequest.parseXML = function parseXML(text) {
- // Treat empty string as parsing failure
- if (text !== "") {
- try {
- if (typeof DOMParser !== "undefined") {
- var parser = new DOMParser();
- var parsererrorNS = "";
+ var arr = [1, 2, 3];
+ var obj = {a: 3, b: 5};
+ extend(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
+ arr.push(4);
+ obj; // {a: 3, b: 5, c: [1, 2, 3, 4]}
- try {
- var parsererrors = parser
- .parseFromString("INVALID", "text/xml")
- .getElementsByTagName("parsererror");
- if (parsererrors.length) {
- parsererrorNS = parsererrors[0].namespaceURI;
- }
- } catch (e) {
- // passing invalid XML makes IE11 throw
- // so no namespace needs to be determined
- }
+ var arr = [1, 2, 3];
+ var obj = {a: 3, b: 5};
+ extend(true, obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
+ arr.push(4);
+ obj; // {a: 3, b: 5, c: [1, 2, 3]}
- var result;
- try {
- result = parser.parseFromString(text, "text/xml");
- } catch (err) {
- return null;
- }
+ extend({a: 4, b: 5}); // {a: 4, b: 5}
+ extend({a: 4, b: 5}, 3); {a: 4, b: 5}
+ extend({a: 4, b: 5}, true); {a: 4, b: 5}
+ extend('hello', {a: 4, b: 5}); // throws
+ extend(3, {a: 4, b: 5}); // throws
+*/
- return result.getElementsByTagNameNS(
- parsererrorNS,
- "parsererror"
- ).length
- ? null
- : result;
- }
- var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
- xmlDoc.async = "false";
- xmlDoc.loadXML(text);
- return xmlDoc.parseError.errorCode !== 0 ? null : xmlDoc;
- } catch (e) {
- // Unable to parse XML - no biggie
- }
+function extend(/* [deep], obj1, obj2, [objn] */) {
+ var args = [].slice.call(arguments);
+ var deep = false;
+ if (typeof args[0] == 'boolean') {
+ deep = args.shift();
+ }
+ var result = args[0];
+ if (isUnextendable(result)) {
+ throw new Error('extendee must be an object');
+ }
+ var extenders = args.slice(1);
+ var len = extenders.length;
+ for (var i = 0; i < len; i++) {
+ var extender = extenders[i];
+ for (var key in extender) {
+ if (Object.prototype.hasOwnProperty.call(extender, key)) {
+ var value = extender[key];
+ if (deep && isCloneable(value)) {
+ var base = Array.isArray(value) ? [] : {};
+ result[key] = extend(
+ true,
+ Object.prototype.hasOwnProperty.call(result, key) && !isUnextendable(result[key])
+ ? result[key]
+ : base,
+ value
+ );
+ } else {
+ result[key] = value;
}
+ }
+ }
+ }
+ return result;
+}
- return null;
- };
-
- FakeXMLHttpRequest.statusCodes = {
- 100: "Continue",
- 101: "Switching Protocols",
- 200: "OK",
- 201: "Created",
- 202: "Accepted",
- 203: "Non-Authoritative Information",
- 204: "No Content",
- 205: "Reset Content",
- 206: "Partial Content",
- 207: "Multi-Status",
- 300: "Multiple Choice",
- 301: "Moved Permanently",
- 302: "Found",
- 303: "See Other",
- 304: "Not Modified",
- 305: "Use Proxy",
- 307: "Temporary Redirect",
- 400: "Bad Request",
- 401: "Unauthorized",
- 402: "Payment Required",
- 403: "Forbidden",
- 404: "Not Found",
- 405: "Method Not Allowed",
- 406: "Not Acceptable",
- 407: "Proxy Authentication Required",
- 408: "Request Timeout",
- 409: "Conflict",
- 410: "Gone",
- 411: "Length Required",
- 412: "Precondition Failed",
- 413: "Request Entity Too Large",
- 414: "Request-URI Too Long",
- 415: "Unsupported Media Type",
- 416: "Requested Range Not Satisfiable",
- 417: "Expectation Failed",
- 422: "Unprocessable Entity",
- 500: "Internal Server Error",
- 501: "Not Implemented",
- 502: "Bad Gateway",
- 503: "Service Unavailable",
- 504: "Gateway Timeout",
- 505: "HTTP Version Not Supported"
- };
+function isCloneable(obj) {
+ return Array.isArray(obj) || {}.toString.call(obj) == '[object Object]';
+}
- extend(FakeXMLHttpRequest.prototype, sinonEvent.EventTarget, {
- async: true,
+function isUnextendable(val) {
+ return !val || (typeof val != 'object' && typeof val != 'function');
+}
- open: function open(method, url, async, username, password) {
- this.method = method;
- this.url = url;
- this.async = typeof async === "boolean" ? async : true;
- this.username = username;
- this.password = password;
- clearResponse(this);
- this.requestHeaders = {};
- this.sendFlag = false;
+},{}],140:[function(require,module,exports){
+/**
+ * lodash (Custom Build) ');
- }
-
- ret.push(escapeHTML(change.value));
-
- if (change.added) {
- ret.push('');
- } else if (change.removed) {
- ret.push('');
- }
- }
-
- return ret.join('');
- }
-
- function escapeHTML(s) {
- var n = s;
- n = n.replace(/&/g, '&');
- n = n.replace(//g, '>');
- n = n.replace(/"/g, '"');
- return n;
- }
-
- exports.Diff = Diff;
- exports.applyPatch = applyPatch;
- exports.applyPatches = applyPatches;
- exports.canonicalize = canonicalize;
- exports.convertChangesToDMP = convertChangesToDMP;
- exports.convertChangesToXML = convertChangesToXML;
- exports.createPatch = createPatch;
- exports.createTwoFilesPatch = createTwoFilesPatch;
- exports.diffArrays = diffArrays;
- exports.diffChars = diffChars;
- exports.diffCss = diffCss;
- exports.diffJson = diffJson;
- exports.diffLines = diffLines;
- exports.diffSentences = diffSentences;
- exports.diffTrimmedLines = diffTrimmedLines;
- exports.diffWords = diffWords;
- exports.diffWordsWithSpace = diffWordsWithSpace;
- exports.merge = merge;
- exports.parsePatch = parsePatch;
- exports.structuredPatch = structuredPatch;
-
- Object.defineProperty(exports, '__esModule', { value: true });
-
-})));
-
-},{}],119:[function(require,module,exports){
-module.exports = extend;
-
-/*
- var obj = {a: 3, b: 5};
- extend(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
- obj; // {a: 4, b: 5, c: 8}
-
- var obj = {a: 3, b: 5};
- extend({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
- obj; // {a: 3, b: 5}
-
- var arr = [1, 2, 3];
- var obj = {a: 3, b: 5};
- extend(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
- arr.push(4);
- obj; // {a: 3, b: 5, c: [1, 2, 3, 4]}
-
- var arr = [1, 2, 3];
- var obj = {a: 3, b: 5};
- extend(true, obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
- arr.push(4);
- obj; // {a: 3, b: 5, c: [1, 2, 3]}
-
- extend({a: 4, b: 5}); // {a: 4, b: 5}
- extend({a: 4, b: 5}, 3); {a: 4, b: 5}
- extend({a: 4, b: 5}, true); {a: 4, b: 5}
- extend('hello', {a: 4, b: 5}); // throws
- extend(3, {a: 4, b: 5}); // throws
-*/
-
-function extend(/* [deep], obj1, obj2, [objn] */) {
- var args = [].slice.call(arguments);
- var deep = false;
- if (typeof args[0] == 'boolean') {
- deep = args.shift();
- }
- var result = args[0];
- if (isUnextendable(result)) {
- throw new Error('extendee must be an object');
- }
- var extenders = args.slice(1);
- var len = extenders.length;
- for (var i = 0; i < len; i++) {
- var extender = extenders[i];
- for (var key in extender) {
- if (Object.prototype.hasOwnProperty.call(extender, key)) {
- var value = extender[key];
- if (deep && isCloneable(value)) {
- var base = Array.isArray(value) ? [] : {};
- result[key] = extend(
- true,
- Object.prototype.hasOwnProperty.call(result, key) && !isUnextendable(result[key])
- ? result[key]
- : base,
- value
- );
- } else {
- result[key] = value;
- }
- }
- }
- }
- return result;
-}
-
-function isCloneable(obj) {
- return Array.isArray(obj) || {}.toString.call(obj) == '[object Object]';
-}
-
-function isUnextendable(val) {
- return !val || (typeof val != 'object' && typeof val != 'function');
-}
-
-},{}],120:[function(require,module,exports){
-/**
- * lodash (Custom Build) ');
+ }
- this.requested = true;
+ ret.push(escapeHTML(change.value));
- this.requestedOnce = count === 1;
- this.requestedTwice = count === 2;
- this.requestedThrice = count === 3;
+ if (change.added) {
+ ret.push('');
+ } else if (change.removed) {
+ ret.push('');
+ }
+ }
- this.firstRequest = this.getRequest(0);
- this.secondRequest = this.getRequest(1);
- this.thirdRequest = this.getRequest(2);
+ return ret.join('');
+ }
- this.lastRequest = this.getRequest(count - 1);
-}
+ function escapeHTML(s) {
+ var n = s;
+ n = n.replace(/&/g, '&');
+ n = n.replace(//g, '>');
+ n = n.replace(/"/g, '"');
+ return n;
+ }
-var fakeServer = {
- create: function(config) {
- var server = Object.create(this);
- server.configure(config);
- this.xhr = fakeXhr.useFakeXMLHttpRequest();
- server.requests = [];
- server.requestCount = 0;
- server.queue = [];
- server.responses = [];
+ exports.Diff = Diff;
+ exports.applyPatch = applyPatch;
+ exports.applyPatches = applyPatches;
+ exports.canonicalize = canonicalize;
+ exports.convertChangesToDMP = convertChangesToDMP;
+ exports.convertChangesToXML = convertChangesToXML;
+ exports.createPatch = createPatch;
+ exports.createTwoFilesPatch = createTwoFilesPatch;
+ exports.diffArrays = diffArrays;
+ exports.diffChars = diffChars;
+ exports.diffCss = diffCss;
+ exports.diffJson = diffJson;
+ exports.diffLines = diffLines;
+ exports.diffSentences = diffSentences;
+ exports.diffTrimmedLines = diffTrimmedLines;
+ exports.diffWords = diffWords;
+ exports.diffWordsWithSpace = diffWordsWithSpace;
+ exports.formatPatch = formatPatch;
+ exports.merge = merge;
+ exports.parsePatch = parsePatch;
+ exports.reversePatch = reversePatch;
+ exports.structuredPatch = structuredPatch;
- this.xhr.onCreate = function(xhrObj) {
- xhrObj.unsafeHeadersEnabled = function() {
- return !(server.unsafeHeadersEnabled === false);
- };
- server.addRequest(xhrObj);
- };
+ Object.defineProperty(exports, '__esModule', { value: true });
- return server;
- },
+})));
- configure: function(config) {
- var self = this;
- var allowlist = {
- autoRespond: true,
- autoRespondAfter: true,
- respondImmediately: true,
- fakeHTTPMethods: true,
- logger: true,
- unsafeHeadersEnabled: true
- };
+},{}],121:[function(require,module,exports){
+'use strict';
- // eslint-disable-next-line no-param-reassign
- config = config || {};
+var GetIntrinsic = require('get-intrinsic');
- Object.keys(config).forEach(function(setting) {
- if (setting in allowlist) {
- self[setting] = config[setting];
- }
- });
+/** @type {import('.')} */
+var $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;
+if ($defineProperty) {
+ try {
+ $defineProperty({}, 'a', { value: 1 });
+ } catch (e) {
+ // IE 8 has a broken defineProperty
+ $defineProperty = false;
+ }
+}
- self.logError = configureLogError(config);
- },
+module.exports = $defineProperty;
- addRequest: function addRequest(xhrObj) {
- var server = this;
- push.call(this.requests, xhrObj);
+},{"get-intrinsic":131}],122:[function(require,module,exports){
+'use strict';
- incrementRequestCount.call(this);
+/** @type {import('./eval')} */
+module.exports = EvalError;
- xhrObj.onSend = function() {
- server.handleRequest(this);
+},{}],123:[function(require,module,exports){
+'use strict';
- if (server.respondImmediately) {
- server.respond();
- } else if (server.autoRespond && !server.responding) {
- setTimeout(function() {
- server.responding = false;
- server.respond();
- }, server.autoRespondAfter || 10);
+/** @type {import('.')} */
+module.exports = Error;
- server.responding = true;
- }
- };
- },
+},{}],124:[function(require,module,exports){
+'use strict';
- getHTTPMethod: function getHTTPMethod(request) {
- if (this.fakeHTTPMethods && /post/i.test(request.method)) {
- var matches = (request.requestBody || "").match(
- /_method=([^\b;]+)/
- );
- return matches ? matches[1] : request.method;
- }
+/** @type {import('./range')} */
+module.exports = RangeError;
- return request.method;
- },
+},{}],125:[function(require,module,exports){
+'use strict';
- handleRequest: function handleRequest(xhr) {
- if (xhr.async) {
- push.call(this.queue, xhr);
- } else {
- this.processRequest(xhr);
- }
- },
+/** @type {import('./ref')} */
+module.exports = ReferenceError;
- logger: function() {
- // no-op; override via configure()
- },
+},{}],126:[function(require,module,exports){
+'use strict';
- logError: configureLogError({}),
+/** @type {import('./syntax')} */
+module.exports = SyntaxError;
- log: log,
+},{}],127:[function(require,module,exports){
+'use strict';
- respondWith: function respondWith(method, url, body) {
- if (arguments.length === 1 && typeof method !== "function") {
- this.response = responseArray(method);
- return;
- }
+/** @type {import('./type')} */
+module.exports = TypeError;
- if (arguments.length === 1) {
- // eslint-disable-next-line no-param-reassign
- body = method;
- // eslint-disable-next-line no-param-reassign
- url = method = null;
- }
+},{}],128:[function(require,module,exports){
+'use strict';
- if (arguments.length === 2) {
- // eslint-disable-next-line no-param-reassign
- body = url;
- // eslint-disable-next-line no-param-reassign
- url = method;
- // eslint-disable-next-line no-param-reassign
- method = null;
- }
+/** @type {import('./uri')} */
+module.exports = URIError;
- // Escape port number to prevent "named" parameters in 'path-to-regexp' module
- if (typeof url === "string" && url !== "" && /:[0-9]+\//.test(url)) {
- var m = url.match(/^(https?:\/\/.*?):([0-9]+\/.*)$/);
- // eslint-disable-next-line no-param-reassign
- url = `${m[1]}\\:${m[2]}`;
- }
+},{}],129:[function(require,module,exports){
+'use strict';
- push.call(this.responses, {
- method: method,
- url:
- typeof url === "string" && url !== "" ? pathToRegexp(url) : url,
- response: typeof body === "function" ? body : responseArray(body)
- });
- },
+/* eslint no-invalid-this: 1 */
- respond: function respond() {
- if (arguments.length > 0) {
- this.respondWith.apply(this, arguments);
- }
+var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
+var toStr = Object.prototype.toString;
+var max = Math.max;
+var funcType = '[object Function]';
- var queue = this.queue || [];
- var requests = queue.splice(0, queue.length);
- var self = this;
+var concatty = function concatty(a, b) {
+ var arr = [];
- requests.forEach(function(request) {
- self.processRequest(request);
- });
- },
+ for (var i = 0; i < a.length; i += 1) {
+ arr[i] = a[i];
+ }
+ for (var j = 0; j < b.length; j += 1) {
+ arr[j + a.length] = b[j];
+ }
- respondAll: function respondAll() {
- if (this.respondImmediately) {
- return;
- }
+ return arr;
+};
- this.queue = this.requests.slice(0);
+var slicy = function slicy(arrLike, offset) {
+ var arr = [];
+ for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
+ arr[j] = arrLike[i];
+ }
+ return arr;
+};
- var request;
- while ((request = this.queue.shift())) {
- this.processRequest(request);
+var joiny = function (arr, joiner) {
+ var str = '';
+ for (var i = 0; i < arr.length; i += 1) {
+ str += arr[i];
+ if (i + 1 < arr.length) {
+ str += joiner;
}
- },
-
- processRequest: function processRequest(request) {
- try {
- if (request.aborted) {
- return;
- }
+ }
+ return str;
+};
- var response = this.response || [404, {}, ""];
+module.exports = function bind(that) {
+ var target = this;
+ if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
+ throw new TypeError(ERROR_MESSAGE + target);
+ }
+ var args = slicy(arguments, 1);
- if (this.responses) {
- for (var l = this.responses.length, i = l - 1; i >= 0; i--) {
- if (match.call(this, this.responses[i], request)) {
- response = this.responses[i].response;
- break;
- }
- }
+ var bound;
+ var binder = function () {
+ if (this instanceof bound) {
+ var result = target.apply(
+ this,
+ concatty(args, arguments)
+ );
+ if (Object(result) === result) {
+ return result;
}
+ return this;
+ }
+ return target.apply(
+ that,
+ concatty(args, arguments)
+ );
- if (request.readyState !== 4) {
- this.log(response, request);
+ };
- request.respond(response[0], response[1], response[2]);
- }
- } catch (e) {
- this.logError("Fake server request processing", e);
- }
- },
+ var boundLength = max(0, target.length - args.length);
+ var boundArgs = [];
+ for (var i = 0; i < boundLength; i++) {
+ boundArgs[i] = '$' + i;
+ }
- restore: function restore() {
- return this.xhr.restore && this.xhr.restore.apply(this.xhr, arguments);
- },
+ bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
- getRequest: function getRequest(index) {
- return this.requests[index] || null;
- },
+ if (target.prototype) {
+ var Empty = function Empty() {};
+ Empty.prototype = target.prototype;
+ bound.prototype = new Empty();
+ Empty.prototype = null;
+ }
- reset: function reset() {
- this.resetBehavior();
- this.resetHistory();
- },
+ return bound;
+};
- resetBehavior: function resetBehavior() {
- this.responses.length = this.queue.length = 0;
- },
+},{}],130:[function(require,module,exports){
+'use strict';
- resetHistory: function resetHistory() {
- this.requests.length = this.requestCount = 0;
+var implementation = require('./implementation');
- this.requestedOnce = this.requestedTwice = this.requestedThrice = this.requested = false;
+module.exports = Function.prototype.bind || implementation;
- this.firstRequest = this.secondRequest = this.thirdRequest = this.lastRequest = null;
- }
-};
+},{"./implementation":129}],131:[function(require,module,exports){
+'use strict';
-module.exports = fakeServer;
+var undefined;
-},{"../configure-logger":121,"../fake-xhr":131,"./log":129,"path-to-regexp":173}],129:[function(require,module,exports){
-"use strict";
-var inspect = require("util").inspect;
+var $Error = require('es-errors');
+var $EvalError = require('es-errors/eval');
+var $RangeError = require('es-errors/range');
+var $ReferenceError = require('es-errors/ref');
+var $SyntaxError = require('es-errors/syntax');
+var $TypeError = require('es-errors/type');
+var $URIError = require('es-errors/uri');
-function log(response, request) {
- var str;
+var $Function = Function;
- str = `Request:\n${inspect(request)}\n\n`;
- str += `Response:\n${inspect(response)}\n\n`;
+// eslint-disable-next-line consistent-return
+var getEvalledConstructor = function (expressionSyntax) {
+ try {
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
+ } catch (e) {}
+};
- /* istanbul ignore else: when this.logger is not a function, it can't be called */
- if (typeof this.logger === "function") {
- this.logger(str);
- }
+var $gOPD = Object.getOwnPropertyDescriptor;
+if ($gOPD) {
+ try {
+ $gOPD({}, '');
+ } catch (e) {
+ $gOPD = null; // this is IE 8, which has a broken gOPD
+ }
}
-module.exports = log;
+var throwTypeError = function () {
+ throw new $TypeError();
+};
+var ThrowTypeError = $gOPD
+ ? (function () {
+ try {
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
+ arguments.callee; // IE 8 does not throw here
+ return throwTypeError;
+ } catch (calleeThrows) {
+ try {
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
+ return $gOPD(arguments, 'callee').get;
+ } catch (gOPDthrows) {
+ return throwTypeError;
+ }
+ }
+ }())
+ : throwTypeError;
-},{"util":117}],130:[function(require,module,exports){
-"use strict";
+var hasSymbols = require('has-symbols')();
+var hasProto = require('has-proto')();
-exports.isSupported = (function() {
- try {
- return Boolean(new Blob());
- } catch (e) {
- return false;
- }
-})();
+var getProto = Object.getPrototypeOf || (
+ hasProto
+ ? function (x) { return x.__proto__; } // eslint-disable-line no-proto
+ : null
+);
-},{}],131:[function(require,module,exports){
-"use strict";
+var needsEval = {};
+
+var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
+
+var INTRINSICS = {
+ __proto__: null,
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
+ '%Array%': Array,
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
+ '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
+ '%AsyncFromSyncIteratorPrototype%': undefined,
+ '%AsyncFunction%': needsEval,
+ '%AsyncGenerator%': needsEval,
+ '%AsyncGeneratorFunction%': needsEval,
+ '%AsyncIteratorPrototype%': needsEval,
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
+ '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
+ '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
+ '%Boolean%': Boolean,
+ '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
+ '%Date%': Date,
+ '%decodeURI%': decodeURI,
+ '%decodeURIComponent%': decodeURIComponent,
+ '%encodeURI%': encodeURI,
+ '%encodeURIComponent%': encodeURIComponent,
+ '%Error%': $Error,
+ '%eval%': eval, // eslint-disable-line no-eval
+ '%EvalError%': $EvalError,
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
+ '%Function%': $Function,
+ '%GeneratorFunction%': needsEval,
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
+ '%isFinite%': isFinite,
+ '%isNaN%': isNaN,
+ '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined,
+ '%Map%': typeof Map === 'undefined' ? undefined : Map,
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
+ '%Math%': Math,
+ '%Number%': Number,
+ '%Object%': Object,
+ '%parseFloat%': parseFloat,
+ '%parseInt%': parseInt,
+ '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
+ '%RangeError%': $RangeError,
+ '%ReferenceError%': $ReferenceError,
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
+ '%RegExp%': RegExp,
+ '%Set%': typeof Set === 'undefined' ? undefined : Set,
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
+ '%String%': String,
+ '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
+ '%Symbol%': hasSymbols ? Symbol : undefined,
+ '%SyntaxError%': $SyntaxError,
+ '%ThrowTypeError%': ThrowTypeError,
+ '%TypedArray%': TypedArray,
+ '%TypeError%': $TypeError,
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
+ '%URIError%': $URIError,
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
+};
-var GlobalTextEncoder =
- typeof TextEncoder !== "undefined"
- ? TextEncoder
- : require("@sinonjs/text-encoding").TextEncoder;
-var globalObject = require("@sinonjs/commons").global;
-var configureLogError = require("../configure-logger");
-var sinonEvent = require("../event");
-var extend = require("just-extend");
+if (getProto) {
+ try {
+ null.error; // eslint-disable-line no-unused-expressions
+ } catch (e) {
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
+ var errorProto = getProto(getProto(e));
+ INTRINSICS['%Error.prototype%'] = errorProto;
+ }
+}
-var supportsProgress = typeof ProgressEvent !== "undefined";
-var supportsCustomEvent = typeof CustomEvent !== "undefined";
-var supportsFormData = typeof FormData !== "undefined";
-var supportsArrayBuffer = typeof ArrayBuffer !== "undefined";
-var supportsBlob = require("./blob").isSupported;
+var doEval = function doEval(name) {
+ var value;
+ if (name === '%AsyncFunction%') {
+ value = getEvalledConstructor('async function () {}');
+ } else if (name === '%GeneratorFunction%') {
+ value = getEvalledConstructor('function* () {}');
+ } else if (name === '%AsyncGeneratorFunction%') {
+ value = getEvalledConstructor('async function* () {}');
+ } else if (name === '%AsyncGenerator%') {
+ var fn = doEval('%AsyncGeneratorFunction%');
+ if (fn) {
+ value = fn.prototype;
+ }
+ } else if (name === '%AsyncIteratorPrototype%') {
+ var gen = doEval('%AsyncGenerator%');
+ if (gen && getProto) {
+ value = getProto(gen.prototype);
+ }
+ }
-function getWorkingXHR(globalScope) {
- var supportsXHR = typeof globalScope.XMLHttpRequest !== "undefined";
- if (supportsXHR) {
- return globalScope.XMLHttpRequest;
- }
+ INTRINSICS[name] = value;
- var supportsActiveX = typeof globalScope.ActiveXObject !== "undefined";
- if (supportsActiveX) {
- return function() {
- return new globalScope.ActiveXObject("MSXML2.XMLHTTP.3.0");
- };
- }
+ return value;
+};
- return false;
-}
+var LEGACY_ALIASES = {
+ __proto__: null,
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
+ '%ArrayPrototype%': ['Array', 'prototype'],
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
+ '%DataViewPrototype%': ['DataView', 'prototype'],
+ '%DatePrototype%': ['Date', 'prototype'],
+ '%ErrorPrototype%': ['Error', 'prototype'],
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
+ '%FunctionPrototype%': ['Function', 'prototype'],
+ '%Generator%': ['GeneratorFunction', 'prototype'],
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
+ '%JSONParse%': ['JSON', 'parse'],
+ '%JSONStringify%': ['JSON', 'stringify'],
+ '%MapPrototype%': ['Map', 'prototype'],
+ '%NumberPrototype%': ['Number', 'prototype'],
+ '%ObjectPrototype%': ['Object', 'prototype'],
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
+ '%PromisePrototype%': ['Promise', 'prototype'],
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
+ '%Promise_all%': ['Promise', 'all'],
+ '%Promise_reject%': ['Promise', 'reject'],
+ '%Promise_resolve%': ['Promise', 'resolve'],
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
+ '%SetPrototype%': ['Set', 'prototype'],
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
+ '%StringPrototype%': ['String', 'prototype'],
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
+};
-// Ref: https://fetch.spec.whatwg.org/#forbidden-header-name
-var unsafeHeaders = {
- "Accept-Charset": true,
- "Access-Control-Request-Headers": true,
- "Access-Control-Request-Method": true,
- "Accept-Encoding": true,
- Connection: true,
- "Content-Length": true,
- Cookie: true,
- Cookie2: true,
- "Content-Transfer-Encoding": true,
- Date: true,
- DNT: true,
- Expect: true,
- Host: true,
- "Keep-Alive": true,
- Origin: true,
- Referer: true,
- TE: true,
- Trailer: true,
- "Transfer-Encoding": true,
- Upgrade: true,
- "User-Agent": true,
- Via: true
+var bind = require('function-bind');
+var hasOwn = require('hasown');
+var $concat = bind.call(Function.call, Array.prototype.concat);
+var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
+var $replace = bind.call(Function.call, String.prototype.replace);
+var $strSlice = bind.call(Function.call, String.prototype.slice);
+var $exec = bind.call(Function.call, RegExp.prototype.exec);
+
+/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
+var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
+var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
+var stringToPath = function stringToPath(string) {
+ var first = $strSlice(string, 0, 1);
+ var last = $strSlice(string, -1);
+ if (first === '%' && last !== '%') {
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
+ } else if (last === '%' && first !== '%') {
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
+ }
+ var result = [];
+ $replace(string, rePropName, function (match, number, quote, subString) {
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
+ });
+ return result;
};
+/* end adaptation */
+
+var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
+ var intrinsicName = name;
+ var alias;
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
+ alias = LEGACY_ALIASES[intrinsicName];
+ intrinsicName = '%' + alias[0] + '%';
+ }
-function EventTargetHandler() {
- var self = this;
- var events = [
- "loadstart",
- "progress",
- "abort",
- "error",
- "load",
- "timeout",
- "loadend"
- ];
+ if (hasOwn(INTRINSICS, intrinsicName)) {
+ var value = INTRINSICS[intrinsicName];
+ if (value === needsEval) {
+ value = doEval(intrinsicName);
+ }
+ if (typeof value === 'undefined' && !allowMissing) {
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
+ }
+
+ return {
+ alias: alias,
+ name: intrinsicName,
+ value: value
+ };
+ }
+
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
+};
+
+module.exports = function GetIntrinsic(name, allowMissing) {
+ if (typeof name !== 'string' || name.length === 0) {
+ throw new $TypeError('intrinsic name must be a non-empty string');
+ }
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
+ throw new $TypeError('"allowMissing" argument must be a boolean');
+ }
- function addEventListener(eventName) {
- self.addEventListener(eventName, function(event) {
- var listener = self[`on${eventName}`];
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
+ }
+ var parts = stringToPath(name);
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
+
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
+ var intrinsicRealName = intrinsic.name;
+ var value = intrinsic.value;
+ var skipFurtherCaching = false;
+
+ var alias = intrinsic.alias;
+ if (alias) {
+ intrinsicBaseName = alias[0];
+ $spliceApply(parts, $concat([0, 1], alias));
+ }
- if (listener && typeof listener === "function") {
- listener.call(this, event);
- }
- });
- }
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
+ var part = parts[i];
+ var first = $strSlice(part, 0, 1);
+ var last = $strSlice(part, -1);
+ if (
+ (
+ (first === '"' || first === "'" || first === '`')
+ || (last === '"' || last === "'" || last === '`')
+ )
+ && first !== last
+ ) {
+ throw new $SyntaxError('property names with quotes must have matching quotes');
+ }
+ if (part === 'constructor' || !isOwn) {
+ skipFurtherCaching = true;
+ }
- events.forEach(addEventListener);
-}
+ intrinsicBaseName += '.' + part;
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
-EventTargetHandler.prototype = sinonEvent.EventTarget;
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
+ value = INTRINSICS[intrinsicRealName];
+ } else if (value != null) {
+ if (!(part in value)) {
+ if (!allowMissing) {
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
+ }
+ return void undefined;
+ }
+ if ($gOPD && (i + 1) >= parts.length) {
+ var desc = $gOPD(value, part);
+ isOwn = !!desc;
+
+ // By convention, when a data property is converted to an accessor
+ // property to emulate a data property that does not suffer from
+ // the override mistake, that accessor's getter is marked with
+ // an `originalValue` property. Here, when we detect this, we
+ // uphold the illusion by pretending to see that original data
+ // property, i.e., returning the value rather than the getter
+ // itself.
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
+ value = desc.get;
+ } else {
+ value = value[part];
+ }
+ } else {
+ isOwn = hasOwn(value, part);
+ value = value[part];
+ }
-function normalizeHeaderValue(value) {
- // Ref: https://fetch.spec.whatwg.org/#http-whitespace-bytes
- /*eslint no-control-regex: "off"*/
- return value.replace(/^[\x09\x0A\x0D\x20]+|[\x09\x0A\x0D\x20]+$/g, "");
-}
+ if (isOwn && !skipFurtherCaching) {
+ INTRINSICS[intrinsicRealName] = value;
+ }
+ }
+ }
+ return value;
+};
-function getHeader(headers, header) {
- var foundHeader = Object.keys(headers).filter(function(h) {
- return h.toLowerCase() === header.toLowerCase();
- });
+},{"es-errors":123,"es-errors/eval":122,"es-errors/range":124,"es-errors/ref":125,"es-errors/syntax":126,"es-errors/type":127,"es-errors/uri":128,"function-bind":130,"has-proto":134,"has-symbols":135,"hasown":137}],132:[function(require,module,exports){
+'use strict';
- return foundHeader[0] || null;
-}
+var GetIntrinsic = require('get-intrinsic');
-function excludeSetCookie2Header(header) {
- return !/^Set-Cookie2?$/i.test(header);
+var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
+
+if ($gOPD) {
+ try {
+ $gOPD([], 'length');
+ } catch (e) {
+ // IE 8 has a broken gOPD
+ $gOPD = null;
+ }
}
-function verifyResponseBodyType(body, responseType) {
- var error = null;
- var isString = typeof body === "string";
+module.exports = $gOPD;
- if (responseType === "arraybuffer") {
- if (!isString && !(body instanceof ArrayBuffer)) {
- error = new Error(
- `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string or ArrayBuffer.`
- );
- error.name = "InvalidBodyException";
- }
- } else if (responseType === "blob") {
- if (
- !isString &&
- !(body instanceof ArrayBuffer) &&
- supportsBlob &&
- !(body instanceof Blob)
- ) {
- error = new Error(
- `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string, ArrayBuffer, or Blob.`
- );
- error.name = "InvalidBodyException";
- }
- } else if (!isString) {
- error = new Error(
- `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string.`
- );
- error.name = "InvalidBodyException";
- }
+},{"get-intrinsic":131}],133:[function(require,module,exports){
+'use strict';
- if (error) {
- throw error;
- }
-}
+var $defineProperty = require('es-define-property');
-function convertToArrayBuffer(body, encoding) {
- if (body instanceof ArrayBuffer) {
- return body;
- }
+var hasPropertyDescriptors = function hasPropertyDescriptors() {
+ return !!$defineProperty;
+};
- return new GlobalTextEncoder(encoding || "utf-8").encode(body).buffer;
-}
+hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
+ // node v0.6 has a bug where array lengths can be Set but not Defined
+ if (!$defineProperty) {
+ return null;
+ }
+ try {
+ return $defineProperty([], 'length', { value: 1 }).length !== 1;
+ } catch (e) {
+ // In Firefox 4-22, defining length on an array throws an exception.
+ return true;
+ }
+};
-function isXmlContentType(contentType) {
- return (
- !contentType ||
- /(text\/xml)|(application\/xml)|(\+xml)/.test(contentType)
- );
-}
+module.exports = hasPropertyDescriptors;
-function clearResponse(xhr) {
- if (xhr.responseType === "" || xhr.responseType === "text") {
- xhr.response = xhr.responseText = "";
- } else {
- xhr.response = xhr.responseText = null;
- }
- xhr.responseXML = null;
-}
+},{"es-define-property":121}],134:[function(require,module,exports){
+'use strict';
-function fakeXMLHttpRequestFor(globalScope) {
- var isReactNative =
- globalScope.navigator &&
- globalScope.navigator.product === "ReactNative";
- var sinonXhr = { XMLHttpRequest: globalScope.XMLHttpRequest };
- sinonXhr.GlobalXMLHttpRequest = globalScope.XMLHttpRequest;
- sinonXhr.GlobalActiveXObject = globalScope.ActiveXObject;
- sinonXhr.supportsActiveX =
- typeof sinonXhr.GlobalActiveXObject !== "undefined";
- sinonXhr.supportsXHR = typeof sinonXhr.GlobalXMLHttpRequest !== "undefined";
- sinonXhr.workingXHR = getWorkingXHR(globalScope);
- sinonXhr.supportsTimeout =
- sinonXhr.supportsXHR &&
- "timeout" in new sinonXhr.GlobalXMLHttpRequest();
- sinonXhr.supportsCORS =
- isReactNative ||
- (sinonXhr.supportsXHR &&
- "withCredentials" in new sinonXhr.GlobalXMLHttpRequest());
+var test = {
+ __proto__: null,
+ foo: {}
+};
- // Note that for FakeXMLHttpRequest to work pre ES5
- // we lose some of the alignment with the spec.
- // To ensure as close a match as possible,
- // set responseType before calling open, send or respond;
- function FakeXMLHttpRequest(config) {
- EventTargetHandler.call(this);
- this.readyState = FakeXMLHttpRequest.UNSENT;
- this.requestHeaders = {};
- this.requestBody = null;
- this.status = 0;
- this.statusText = "";
- this.upload = new EventTargetHandler();
- this.responseType = "";
- this.response = "";
- this.logError = configureLogError(config);
+var $Object = Object;
- if (sinonXhr.supportsTimeout) {
- this.timeout = 0;
- }
+/** @type {import('.')} */
+module.exports = function hasProto() {
+ // @ts-expect-error: TS errors on an inherited property for some reason
+ return { __proto__: test }.foo === test.foo
+ && !(test instanceof $Object);
+};
- if (sinonXhr.supportsCORS) {
- this.withCredentials = false;
- }
+},{}],135:[function(require,module,exports){
+'use strict';
- if (typeof FakeXMLHttpRequest.onCreate === "function") {
- FakeXMLHttpRequest.onCreate(this);
- }
- }
+var origSymbol = typeof Symbol !== 'undefined' && Symbol;
+var hasSymbolSham = require('./shams');
- function verifyState(xhr) {
- if (xhr.readyState !== FakeXMLHttpRequest.OPENED) {
- throw new Error("INVALID_STATE_ERR");
- }
+module.exports = function hasNativeSymbols() {
+ if (typeof origSymbol !== 'function') { return false; }
+ if (typeof Symbol !== 'function') { return false; }
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
- if (xhr.sendFlag) {
- throw new Error("INVALID_STATE_ERR");
- }
- }
+ return hasSymbolSham();
+};
- // largest arity in XHR is 5 - XHR#open
- var apply = function(obj, method, args) {
- switch (args.length) {
- case 0:
- return obj[method]();
- case 1:
- return obj[method](args[0]);
- case 2:
- return obj[method](args[0], args[1]);
- case 3:
- return obj[method](args[0], args[1], args[2]);
- case 4:
- return obj[method](args[0], args[1], args[2], args[3]);
- case 5:
- return obj[method](args[0], args[1], args[2], args[3], args[4]);
- default:
- throw new Error("Unhandled case");
- }
- };
+},{"./shams":136}],136:[function(require,module,exports){
+'use strict';
- FakeXMLHttpRequest.filters = [];
- FakeXMLHttpRequest.addFilter = function addFilter(fn) {
- this.filters.push(fn);
- };
- FakeXMLHttpRequest.defake = function defake(fakeXhr, xhrArgs) {
- var xhr = new sinonXhr.workingXHR(); // eslint-disable-line new-cap
+/* eslint complexity: [2, 18], max-statements: [2, 33] */
+module.exports = function hasSymbols() {
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
+ if (typeof Symbol.iterator === 'symbol') { return true; }
- [
- "open",
- "setRequestHeader",
- "abort",
- "getResponseHeader",
- "getAllResponseHeaders",
- "addEventListener",
- "overrideMimeType",
- "removeEventListener"
- ].forEach(function(method) {
- fakeXhr[method] = function() {
- return apply(xhr, method, arguments);
- };
- });
+ var obj = {};
+ var sym = Symbol('test');
+ var symObj = Object(sym);
+ if (typeof sym === 'string') { return false; }
- fakeXhr.send = function() {
- // Ref: https://xhr.spec.whatwg.org/#the-responsetype-attribute
- if (xhr.responseType !== fakeXhr.responseType) {
- xhr.responseType = fakeXhr.responseType;
- }
- return apply(xhr, "send", arguments);
- };
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
- var copyAttrs = function(args) {
- args.forEach(function(attr) {
- fakeXhr[attr] = xhr[attr];
- });
- };
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
+ // if (sym instanceof Symbol) { return false; }
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
+ // if (!(symObj instanceof Symbol)) { return false; }
- var stateChangeStart = function() {
- fakeXhr.readyState = xhr.readyState;
- if (xhr.readyState >= FakeXMLHttpRequest.HEADERS_RECEIVED) {
- copyAttrs(["status", "statusText"]);
- }
- if (xhr.readyState >= FakeXMLHttpRequest.LOADING) {
- copyAttrs(["response"]);
- if (xhr.responseType === "" || xhr.responseType === "text") {
- copyAttrs(["responseText"]);
- }
- }
- if (
- xhr.readyState === FakeXMLHttpRequest.DONE &&
- (xhr.responseType === "" || xhr.responseType === "document")
- ) {
- copyAttrs(["responseXML"]);
- }
- };
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
- var stateChangeEnd = function() {
- if (fakeXhr.onreadystatechange) {
- // eslint-disable-next-line no-useless-call
- fakeXhr.onreadystatechange.call(fakeXhr, {
- target: fakeXhr,
- currentTarget: fakeXhr
- });
- }
- };
+ var symVal = 42;
+ obj[sym] = symVal;
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
- var stateChange = function stateChange() {
- stateChangeStart();
- stateChangeEnd();
- };
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
- if (xhr.addEventListener) {
- xhr.addEventListener("readystatechange", stateChangeStart);
+ var syms = Object.getOwnPropertySymbols(obj);
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
- Object.keys(fakeXhr.eventListeners).forEach(function(event) {
- /*eslint-disable no-loop-func*/
- fakeXhr.eventListeners[event].forEach(function(handler) {
- xhr.addEventListener(event, handler.listener, {
- capture: handler.capture,
- once: handler.once
- });
- });
- /*eslint-enable no-loop-func*/
- });
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
- xhr.addEventListener("readystatechange", stateChangeEnd);
- } else {
- xhr.onreadystatechange = stateChange;
- }
- apply(xhr, "open", xhrArgs);
- };
- FakeXMLHttpRequest.useFilters = false;
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
+ }
- function verifyRequestOpened(xhr) {
- if (xhr.readyState !== FakeXMLHttpRequest.OPENED) {
- const errorMessage =
- xhr.readyState === FakeXMLHttpRequest.UNSENT
- ? "INVALID_STATE_ERR - you might be trying to set the request state for a request that has already been aborted, it is recommended to check 'readyState' first..."
- : `INVALID_STATE_ERR - ${xhr.readyState}`;
- throw new Error(errorMessage);
- }
- }
+ return true;
+};
- function verifyRequestSent(xhr) {
- if (xhr.readyState === FakeXMLHttpRequest.DONE) {
- throw new Error("Request done");
- }
- }
+},{}],137:[function(require,module,exports){
+'use strict';
- function verifyHeadersReceived(xhr) {
- if (
- xhr.async &&
- xhr.readyState !== FakeXMLHttpRequest.HEADERS_RECEIVED
- ) {
- throw new Error("No headers received");
- }
- }
+var call = Function.prototype.call;
+var $hasOwn = Object.prototype.hasOwnProperty;
+var bind = require('function-bind');
- function convertResponseBody(responseType, contentType, body) {
- if (responseType === "" || responseType === "text") {
- return body;
- } else if (supportsArrayBuffer && responseType === "arraybuffer") {
- return convertToArrayBuffer(body);
- } else if (responseType === "json") {
- try {
- return JSON.parse(body);
- } catch (e) {
- // Return parsing failure as null
- return null;
- }
- } else if (supportsBlob && responseType === "blob") {
- if (body instanceof Blob) {
- return body;
- }
+/** @type {import('.')} */
+module.exports = bind.call(call, $hasOwn);
- var blobOptions = {};
- if (contentType) {
- blobOptions.type = contentType;
- }
- return new Blob([convertToArrayBuffer(body)], blobOptions);
- } else if (responseType === "document") {
- if (isXmlContentType(contentType)) {
- return FakeXMLHttpRequest.parseXML(body);
- }
- return null;
- }
- throw new Error(`Invalid responseType ${responseType}`);
- }
+},{"function-bind":130}],138:[function(require,module,exports){
+module.exports = extend;
- /**
- * Steps to follow when there is an error, according to:
- * https://xhr.spec.whatwg.org/#request-error-steps
- */
- function requestErrorSteps(xhr) {
- clearResponse(xhr);
- xhr.errorFlag = true;
- xhr.requestHeaders = {};
- xhr.responseHeaders = {};
+/*
+ var obj = {a: 3, b: 5};
+ extend(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
+ obj; // {a: 4, b: 5, c: 8}
- if (
- xhr.readyState !== FakeXMLHttpRequest.UNSENT &&
- xhr.sendFlag &&
- xhr.readyState !== FakeXMLHttpRequest.DONE
- ) {
- xhr.readyStateChange(FakeXMLHttpRequest.DONE);
- xhr.sendFlag = false;
- }
- }
+ var obj = {a: 3, b: 5};
+ extend({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
+ obj; // {a: 3, b: 5}
- FakeXMLHttpRequest.parseXML = function parseXML(text) {
- // Treat empty string as parsing failure
- if (text !== "") {
- try {
- if (typeof DOMParser !== "undefined") {
- var parser = new DOMParser();
- var parsererrorNS = "";
+ var arr = [1, 2, 3];
+ var obj = {a: 3, b: 5};
+ extend(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
+ arr.push(4);
+ obj; // {a: 3, b: 5, c: [1, 2, 3, 4]}
- try {
- var parsererrors = parser
- .parseFromString("INVALID", "text/xml")
- .getElementsByTagName("parsererror");
- if (parsererrors.length) {
- parsererrorNS = parsererrors[0].namespaceURI;
- }
- } catch (e) {
- // passing invalid XML makes IE11 throw
- // so no namespace needs to be determined
- }
+ var arr = [1, 2, 3];
+ var obj = {a: 3, b: 5};
+ extend(true, obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
+ arr.push(4);
+ obj; // {a: 3, b: 5, c: [1, 2, 3]}
- var result;
- try {
- result = parser.parseFromString(text, "text/xml");
- } catch (err) {
- return null;
- }
+ extend({a: 4, b: 5}); // {a: 4, b: 5}
+ extend({a: 4, b: 5}, 3); {a: 4, b: 5}
+ extend({a: 4, b: 5}, true); {a: 4, b: 5}
+ extend('hello', {a: 4, b: 5}); // throws
+ extend(3, {a: 4, b: 5}); // throws
+*/
- return result.getElementsByTagNameNS(
- parsererrorNS,
- "parsererror"
- ).length
- ? null
- : result;
- }
- var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
- xmlDoc.async = "false";
- xmlDoc.loadXML(text);
- return xmlDoc.parseError.errorCode !== 0 ? null : xmlDoc;
- } catch (e) {
- // Unable to parse XML - no biggie
- }
+function extend(/* [deep], obj1, obj2, [objn] */) {
+ var args = [].slice.call(arguments);
+ var deep = false;
+ if (typeof args[0] == 'boolean') {
+ deep = args.shift();
+ }
+ var result = args[0];
+ if (isUnextendable(result)) {
+ throw new Error('extendee must be an object');
+ }
+ var extenders = args.slice(1);
+ var len = extenders.length;
+ for (var i = 0; i < len; i++) {
+ var extender = extenders[i];
+ for (var key in extender) {
+ if (Object.prototype.hasOwnProperty.call(extender, key)) {
+ var value = extender[key];
+ if (deep && isCloneable(value)) {
+ var base = Array.isArray(value) ? [] : {};
+ result[key] = extend(
+ true,
+ Object.prototype.hasOwnProperty.call(result, key) && !isUnextendable(result[key])
+ ? result[key]
+ : base,
+ value
+ );
+ } else {
+ result[key] = value;
}
+ }
+ }
+ }
+ return result;
+}
- return null;
- };
-
- FakeXMLHttpRequest.statusCodes = {
- 100: "Continue",
- 101: "Switching Protocols",
- 200: "OK",
- 201: "Created",
- 202: "Accepted",
- 203: "Non-Authoritative Information",
- 204: "No Content",
- 205: "Reset Content",
- 206: "Partial Content",
- 207: "Multi-Status",
- 300: "Multiple Choice",
- 301: "Moved Permanently",
- 302: "Found",
- 303: "See Other",
- 304: "Not Modified",
- 305: "Use Proxy",
- 307: "Temporary Redirect",
- 400: "Bad Request",
- 401: "Unauthorized",
- 402: "Payment Required",
- 403: "Forbidden",
- 404: "Not Found",
- 405: "Method Not Allowed",
- 406: "Not Acceptable",
- 407: "Proxy Authentication Required",
- 408: "Request Timeout",
- 409: "Conflict",
- 410: "Gone",
- 411: "Length Required",
- 412: "Precondition Failed",
- 413: "Request Entity Too Large",
- 414: "Request-URI Too Long",
- 415: "Unsupported Media Type",
- 416: "Requested Range Not Satisfiable",
- 417: "Expectation Failed",
- 422: "Unprocessable Entity",
- 500: "Internal Server Error",
- 501: "Not Implemented",
- 502: "Bad Gateway",
- 503: "Service Unavailable",
- 504: "Gateway Timeout",
- 505: "HTTP Version Not Supported"
- };
+function isCloneable(obj) {
+ return Array.isArray(obj) || {}.toString.call(obj) == '[object Object]';
+}
- extend(FakeXMLHttpRequest.prototype, sinonEvent.EventTarget, {
- async: true,
+function isUnextendable(val) {
+ return !val || (typeof val != 'object' && typeof val != 'function');
+}
- open: function open(method, url, async, username, password) {
- this.method = method;
- this.url = url;
- this.async = typeof async === "boolean" ? async : true;
- this.username = username;
- this.password = password;
- clearResponse(this);
- this.requestHeaders = {};
- this.sendFlag = false;
+},{}],139:[function(require,module,exports){
+/**
+ * lodash (Custom Build) ');
- }
-
- ret.push(escapeHTML(change.value));
-
- if (change.added) {
- ret.push('');
- } else if (change.removed) {
- ret.push('');
- }
- }
-
- return ret.join('');
- }
-
- function escapeHTML(s) {
- var n = s;
- n = n.replace(/&/g, '&');
- n = n.replace(//g, '>');
- n = n.replace(/"/g, '"');
- return n;
- }
-
- exports.Diff = Diff;
- exports.applyPatch = applyPatch;
- exports.applyPatches = applyPatches;
- exports.canonicalize = canonicalize;
- exports.convertChangesToDMP = convertChangesToDMP;
- exports.convertChangesToXML = convertChangesToXML;
- exports.createPatch = createPatch;
- exports.createTwoFilesPatch = createTwoFilesPatch;
- exports.diffArrays = diffArrays;
- exports.diffChars = diffChars;
- exports.diffCss = diffCss;
- exports.diffJson = diffJson;
- exports.diffLines = diffLines;
- exports.diffSentences = diffSentences;
- exports.diffTrimmedLines = diffTrimmedLines;
- exports.diffWords = diffWords;
- exports.diffWordsWithSpace = diffWordsWithSpace;
- exports.merge = merge;
- exports.parsePatch = parsePatch;
- exports.structuredPatch = structuredPatch;
-
- Object.defineProperty(exports, '__esModule', { value: true });
-
-})));
-
-},{}],119:[function(require,module,exports){
-module.exports = extend;
-
-/*
- var obj = {a: 3, b: 5};
- extend(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
- obj; // {a: 4, b: 5, c: 8}
-
- var obj = {a: 3, b: 5};
- extend({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
- obj; // {a: 3, b: 5}
-
- var arr = [1, 2, 3];
- var obj = {a: 3, b: 5};
- extend(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
- arr.push(4);
- obj; // {a: 3, b: 5, c: [1, 2, 3, 4]}
-
- var arr = [1, 2, 3];
- var obj = {a: 3, b: 5};
- extend(true, obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
- arr.push(4);
- obj; // {a: 3, b: 5, c: [1, 2, 3]}
-
- extend({a: 4, b: 5}); // {a: 4, b: 5}
- extend({a: 4, b: 5}, 3); {a: 4, b: 5}
- extend({a: 4, b: 5}, true); {a: 4, b: 5}
- extend('hello', {a: 4, b: 5}); // throws
- extend(3, {a: 4, b: 5}); // throws
-*/
-
-function extend(/* [deep], obj1, obj2, [objn] */) {
- var args = [].slice.call(arguments);
- var deep = false;
- if (typeof args[0] == 'boolean') {
- deep = args.shift();
- }
- var result = args[0];
- if (isUnextendable(result)) {
- throw new Error('extendee must be an object');
- }
- var extenders = args.slice(1);
- var len = extenders.length;
- for (var i = 0; i < len; i++) {
- var extender = extenders[i];
- for (var key in extender) {
- if (Object.prototype.hasOwnProperty.call(extender, key)) {
- var value = extender[key];
- if (deep && isCloneable(value)) {
- var base = Array.isArray(value) ? [] : {};
- result[key] = extend(
- true,
- Object.prototype.hasOwnProperty.call(result, key) && !isUnextendable(result[key])
- ? result[key]
- : base,
- value
- );
- } else {
- result[key] = value;
- }
- }
- }
- }
- return result;
-}
-
-function isCloneable(obj) {
- return Array.isArray(obj) || {}.toString.call(obj) == '[object Object]';
-}
-
-function isUnextendable(val) {
- return !val || (typeof val != 'object' && typeof val != 'function');
-}
-
-},{}],120:[function(require,module,exports){
-/**
- * lodash (Custom Build) ');
+ }
- this.requested = true;
+ ret.push(escapeHTML(change.value));
- this.requestedOnce = count === 1;
- this.requestedTwice = count === 2;
- this.requestedThrice = count === 3;
+ if (change.added) {
+ ret.push('');
+ } else if (change.removed) {
+ ret.push('');
+ }
+ }
- this.firstRequest = this.getRequest(0);
- this.secondRequest = this.getRequest(1);
- this.thirdRequest = this.getRequest(2);
+ return ret.join('');
+ }
- this.lastRequest = this.getRequest(count - 1);
-}
+ function escapeHTML(s) {
+ var n = s;
+ n = n.replace(/&/g, '&');
+ n = n.replace(//g, '>');
+ n = n.replace(/"/g, '"');
+ return n;
+ }
-var fakeServer = {
- create: function(config) {
- var server = Object.create(this);
- server.configure(config);
- this.xhr = fakeXhr.useFakeXMLHttpRequest();
- server.requests = [];
- server.requestCount = 0;
- server.queue = [];
- server.responses = [];
+ exports.Diff = Diff;
+ exports.applyPatch = applyPatch;
+ exports.applyPatches = applyPatches;
+ exports.canonicalize = canonicalize;
+ exports.convertChangesToDMP = convertChangesToDMP;
+ exports.convertChangesToXML = convertChangesToXML;
+ exports.createPatch = createPatch;
+ exports.createTwoFilesPatch = createTwoFilesPatch;
+ exports.diffArrays = diffArrays;
+ exports.diffChars = diffChars;
+ exports.diffCss = diffCss;
+ exports.diffJson = diffJson;
+ exports.diffLines = diffLines;
+ exports.diffSentences = diffSentences;
+ exports.diffTrimmedLines = diffTrimmedLines;
+ exports.diffWords = diffWords;
+ exports.diffWordsWithSpace = diffWordsWithSpace;
+ exports.formatPatch = formatPatch;
+ exports.merge = merge;
+ exports.parsePatch = parsePatch;
+ exports.reversePatch = reversePatch;
+ exports.structuredPatch = structuredPatch;
- this.xhr.onCreate = function(xhrObj) {
- xhrObj.unsafeHeadersEnabled = function() {
- return !(server.unsafeHeadersEnabled === false);
- };
- server.addRequest(xhrObj);
- };
+ Object.defineProperty(exports, '__esModule', { value: true });
- return server;
- },
+})));
- configure: function(config) {
- var self = this;
- var allowlist = {
- autoRespond: true,
- autoRespondAfter: true,
- respondImmediately: true,
- fakeHTTPMethods: true,
- logger: true,
- unsafeHeadersEnabled: true
- };
+},{}],121:[function(require,module,exports){
+'use strict';
- // eslint-disable-next-line no-param-reassign
- config = config || {};
+var GetIntrinsic = require('get-intrinsic');
- Object.keys(config).forEach(function(setting) {
- if (setting in allowlist) {
- self[setting] = config[setting];
- }
- });
+/** @type {import('.')} */
+var $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;
+if ($defineProperty) {
+ try {
+ $defineProperty({}, 'a', { value: 1 });
+ } catch (e) {
+ // IE 8 has a broken defineProperty
+ $defineProperty = false;
+ }
+}
- self.logError = configureLogError(config);
- },
+module.exports = $defineProperty;
- addRequest: function addRequest(xhrObj) {
- var server = this;
- push.call(this.requests, xhrObj);
+},{"get-intrinsic":131}],122:[function(require,module,exports){
+'use strict';
- incrementRequestCount.call(this);
+/** @type {import('./eval')} */
+module.exports = EvalError;
- xhrObj.onSend = function() {
- server.handleRequest(this);
+},{}],123:[function(require,module,exports){
+'use strict';
- if (server.respondImmediately) {
- server.respond();
- } else if (server.autoRespond && !server.responding) {
- setTimeout(function() {
- server.responding = false;
- server.respond();
- }, server.autoRespondAfter || 10);
+/** @type {import('.')} */
+module.exports = Error;
- server.responding = true;
- }
- };
- },
+},{}],124:[function(require,module,exports){
+'use strict';
- getHTTPMethod: function getHTTPMethod(request) {
- if (this.fakeHTTPMethods && /post/i.test(request.method)) {
- var matches = (request.requestBody || "").match(
- /_method=([^\b;]+)/
- );
- return matches ? matches[1] : request.method;
- }
+/** @type {import('./range')} */
+module.exports = RangeError;
- return request.method;
- },
+},{}],125:[function(require,module,exports){
+'use strict';
- handleRequest: function handleRequest(xhr) {
- if (xhr.async) {
- push.call(this.queue, xhr);
- } else {
- this.processRequest(xhr);
- }
- },
+/** @type {import('./ref')} */
+module.exports = ReferenceError;
- logger: function() {
- // no-op; override via configure()
- },
+},{}],126:[function(require,module,exports){
+'use strict';
- logError: configureLogError({}),
+/** @type {import('./syntax')} */
+module.exports = SyntaxError;
- log: log,
+},{}],127:[function(require,module,exports){
+'use strict';
- respondWith: function respondWith(method, url, body) {
- if (arguments.length === 1 && typeof method !== "function") {
- this.response = responseArray(method);
- return;
- }
+/** @type {import('./type')} */
+module.exports = TypeError;
- if (arguments.length === 1) {
- // eslint-disable-next-line no-param-reassign
- body = method;
- // eslint-disable-next-line no-param-reassign
- url = method = null;
- }
+},{}],128:[function(require,module,exports){
+'use strict';
- if (arguments.length === 2) {
- // eslint-disable-next-line no-param-reassign
- body = url;
- // eslint-disable-next-line no-param-reassign
- url = method;
- // eslint-disable-next-line no-param-reassign
- method = null;
- }
+/** @type {import('./uri')} */
+module.exports = URIError;
- // Escape port number to prevent "named" parameters in 'path-to-regexp' module
- if (typeof url === "string" && url !== "" && /:[0-9]+\//.test(url)) {
- var m = url.match(/^(https?:\/\/.*?):([0-9]+\/.*)$/);
- // eslint-disable-next-line no-param-reassign
- url = `${m[1]}\\:${m[2]}`;
- }
+},{}],129:[function(require,module,exports){
+'use strict';
- push.call(this.responses, {
- method: method,
- url:
- typeof url === "string" && url !== "" ? pathToRegexp(url) : url,
- response: typeof body === "function" ? body : responseArray(body)
- });
- },
+/* eslint no-invalid-this: 1 */
- respond: function respond() {
- if (arguments.length > 0) {
- this.respondWith.apply(this, arguments);
- }
+var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
+var toStr = Object.prototype.toString;
+var max = Math.max;
+var funcType = '[object Function]';
- var queue = this.queue || [];
- var requests = queue.splice(0, queue.length);
- var self = this;
+var concatty = function concatty(a, b) {
+ var arr = [];
- requests.forEach(function(request) {
- self.processRequest(request);
- });
- },
+ for (var i = 0; i < a.length; i += 1) {
+ arr[i] = a[i];
+ }
+ for (var j = 0; j < b.length; j += 1) {
+ arr[j + a.length] = b[j];
+ }
- respondAll: function respondAll() {
- if (this.respondImmediately) {
- return;
- }
+ return arr;
+};
- this.queue = this.requests.slice(0);
+var slicy = function slicy(arrLike, offset) {
+ var arr = [];
+ for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
+ arr[j] = arrLike[i];
+ }
+ return arr;
+};
- var request;
- while ((request = this.queue.shift())) {
- this.processRequest(request);
+var joiny = function (arr, joiner) {
+ var str = '';
+ for (var i = 0; i < arr.length; i += 1) {
+ str += arr[i];
+ if (i + 1 < arr.length) {
+ str += joiner;
}
- },
-
- processRequest: function processRequest(request) {
- try {
- if (request.aborted) {
- return;
- }
+ }
+ return str;
+};
- var response = this.response || [404, {}, ""];
+module.exports = function bind(that) {
+ var target = this;
+ if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
+ throw new TypeError(ERROR_MESSAGE + target);
+ }
+ var args = slicy(arguments, 1);
- if (this.responses) {
- for (var l = this.responses.length, i = l - 1; i >= 0; i--) {
- if (match.call(this, this.responses[i], request)) {
- response = this.responses[i].response;
- break;
- }
- }
+ var bound;
+ var binder = function () {
+ if (this instanceof bound) {
+ var result = target.apply(
+ this,
+ concatty(args, arguments)
+ );
+ if (Object(result) === result) {
+ return result;
}
+ return this;
+ }
+ return target.apply(
+ that,
+ concatty(args, arguments)
+ );
- if (request.readyState !== 4) {
- this.log(response, request);
+ };
- request.respond(response[0], response[1], response[2]);
- }
- } catch (e) {
- this.logError("Fake server request processing", e);
- }
- },
+ var boundLength = max(0, target.length - args.length);
+ var boundArgs = [];
+ for (var i = 0; i < boundLength; i++) {
+ boundArgs[i] = '$' + i;
+ }
- restore: function restore() {
- return this.xhr.restore && this.xhr.restore.apply(this.xhr, arguments);
- },
+ bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
- getRequest: function getRequest(index) {
- return this.requests[index] || null;
- },
+ if (target.prototype) {
+ var Empty = function Empty() {};
+ Empty.prototype = target.prototype;
+ bound.prototype = new Empty();
+ Empty.prototype = null;
+ }
- reset: function reset() {
- this.resetBehavior();
- this.resetHistory();
- },
+ return bound;
+};
- resetBehavior: function resetBehavior() {
- this.responses.length = this.queue.length = 0;
- },
+},{}],130:[function(require,module,exports){
+'use strict';
- resetHistory: function resetHistory() {
- this.requests.length = this.requestCount = 0;
+var implementation = require('./implementation');
- this.requestedOnce = this.requestedTwice = this.requestedThrice = this.requested = false;
+module.exports = Function.prototype.bind || implementation;
- this.firstRequest = this.secondRequest = this.thirdRequest = this.lastRequest = null;
- }
-};
+},{"./implementation":129}],131:[function(require,module,exports){
+'use strict';
-module.exports = fakeServer;
+var undefined;
-},{"../configure-logger":121,"../fake-xhr":131,"./log":129,"path-to-regexp":173}],129:[function(require,module,exports){
-"use strict";
-var inspect = require("util").inspect;
+var $Error = require('es-errors');
+var $EvalError = require('es-errors/eval');
+var $RangeError = require('es-errors/range');
+var $ReferenceError = require('es-errors/ref');
+var $SyntaxError = require('es-errors/syntax');
+var $TypeError = require('es-errors/type');
+var $URIError = require('es-errors/uri');
-function log(response, request) {
- var str;
+var $Function = Function;
- str = `Request:\n${inspect(request)}\n\n`;
- str += `Response:\n${inspect(response)}\n\n`;
+// eslint-disable-next-line consistent-return
+var getEvalledConstructor = function (expressionSyntax) {
+ try {
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
+ } catch (e) {}
+};
- /* istanbul ignore else: when this.logger is not a function, it can't be called */
- if (typeof this.logger === "function") {
- this.logger(str);
- }
+var $gOPD = Object.getOwnPropertyDescriptor;
+if ($gOPD) {
+ try {
+ $gOPD({}, '');
+ } catch (e) {
+ $gOPD = null; // this is IE 8, which has a broken gOPD
+ }
}
-module.exports = log;
+var throwTypeError = function () {
+ throw new $TypeError();
+};
+var ThrowTypeError = $gOPD
+ ? (function () {
+ try {
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
+ arguments.callee; // IE 8 does not throw here
+ return throwTypeError;
+ } catch (calleeThrows) {
+ try {
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
+ return $gOPD(arguments, 'callee').get;
+ } catch (gOPDthrows) {
+ return throwTypeError;
+ }
+ }
+ }())
+ : throwTypeError;
-},{"util":117}],130:[function(require,module,exports){
-"use strict";
+var hasSymbols = require('has-symbols')();
+var hasProto = require('has-proto')();
-exports.isSupported = (function() {
- try {
- return Boolean(new Blob());
- } catch (e) {
- return false;
- }
-})();
+var getProto = Object.getPrototypeOf || (
+ hasProto
+ ? function (x) { return x.__proto__; } // eslint-disable-line no-proto
+ : null
+);
-},{}],131:[function(require,module,exports){
-"use strict";
+var needsEval = {};
+
+var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
+
+var INTRINSICS = {
+ __proto__: null,
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
+ '%Array%': Array,
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
+ '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
+ '%AsyncFromSyncIteratorPrototype%': undefined,
+ '%AsyncFunction%': needsEval,
+ '%AsyncGenerator%': needsEval,
+ '%AsyncGeneratorFunction%': needsEval,
+ '%AsyncIteratorPrototype%': needsEval,
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
+ '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
+ '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
+ '%Boolean%': Boolean,
+ '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
+ '%Date%': Date,
+ '%decodeURI%': decodeURI,
+ '%decodeURIComponent%': decodeURIComponent,
+ '%encodeURI%': encodeURI,
+ '%encodeURIComponent%': encodeURIComponent,
+ '%Error%': $Error,
+ '%eval%': eval, // eslint-disable-line no-eval
+ '%EvalError%': $EvalError,
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
+ '%Function%': $Function,
+ '%GeneratorFunction%': needsEval,
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
+ '%isFinite%': isFinite,
+ '%isNaN%': isNaN,
+ '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined,
+ '%Map%': typeof Map === 'undefined' ? undefined : Map,
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
+ '%Math%': Math,
+ '%Number%': Number,
+ '%Object%': Object,
+ '%parseFloat%': parseFloat,
+ '%parseInt%': parseInt,
+ '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
+ '%RangeError%': $RangeError,
+ '%ReferenceError%': $ReferenceError,
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
+ '%RegExp%': RegExp,
+ '%Set%': typeof Set === 'undefined' ? undefined : Set,
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
+ '%String%': String,
+ '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
+ '%Symbol%': hasSymbols ? Symbol : undefined,
+ '%SyntaxError%': $SyntaxError,
+ '%ThrowTypeError%': ThrowTypeError,
+ '%TypedArray%': TypedArray,
+ '%TypeError%': $TypeError,
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
+ '%URIError%': $URIError,
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
+};
-var GlobalTextEncoder =
- typeof TextEncoder !== "undefined"
- ? TextEncoder
- : require("@sinonjs/text-encoding").TextEncoder;
-var globalObject = require("@sinonjs/commons").global;
-var configureLogError = require("../configure-logger");
-var sinonEvent = require("../event");
-var extend = require("just-extend");
+if (getProto) {
+ try {
+ null.error; // eslint-disable-line no-unused-expressions
+ } catch (e) {
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
+ var errorProto = getProto(getProto(e));
+ INTRINSICS['%Error.prototype%'] = errorProto;
+ }
+}
-var supportsProgress = typeof ProgressEvent !== "undefined";
-var supportsCustomEvent = typeof CustomEvent !== "undefined";
-var supportsFormData = typeof FormData !== "undefined";
-var supportsArrayBuffer = typeof ArrayBuffer !== "undefined";
-var supportsBlob = require("./blob").isSupported;
+var doEval = function doEval(name) {
+ var value;
+ if (name === '%AsyncFunction%') {
+ value = getEvalledConstructor('async function () {}');
+ } else if (name === '%GeneratorFunction%') {
+ value = getEvalledConstructor('function* () {}');
+ } else if (name === '%AsyncGeneratorFunction%') {
+ value = getEvalledConstructor('async function* () {}');
+ } else if (name === '%AsyncGenerator%') {
+ var fn = doEval('%AsyncGeneratorFunction%');
+ if (fn) {
+ value = fn.prototype;
+ }
+ } else if (name === '%AsyncIteratorPrototype%') {
+ var gen = doEval('%AsyncGenerator%');
+ if (gen && getProto) {
+ value = getProto(gen.prototype);
+ }
+ }
-function getWorkingXHR(globalScope) {
- var supportsXHR = typeof globalScope.XMLHttpRequest !== "undefined";
- if (supportsXHR) {
- return globalScope.XMLHttpRequest;
- }
+ INTRINSICS[name] = value;
- var supportsActiveX = typeof globalScope.ActiveXObject !== "undefined";
- if (supportsActiveX) {
- return function() {
- return new globalScope.ActiveXObject("MSXML2.XMLHTTP.3.0");
- };
- }
+ return value;
+};
- return false;
-}
+var LEGACY_ALIASES = {
+ __proto__: null,
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
+ '%ArrayPrototype%': ['Array', 'prototype'],
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
+ '%DataViewPrototype%': ['DataView', 'prototype'],
+ '%DatePrototype%': ['Date', 'prototype'],
+ '%ErrorPrototype%': ['Error', 'prototype'],
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
+ '%FunctionPrototype%': ['Function', 'prototype'],
+ '%Generator%': ['GeneratorFunction', 'prototype'],
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
+ '%JSONParse%': ['JSON', 'parse'],
+ '%JSONStringify%': ['JSON', 'stringify'],
+ '%MapPrototype%': ['Map', 'prototype'],
+ '%NumberPrototype%': ['Number', 'prototype'],
+ '%ObjectPrototype%': ['Object', 'prototype'],
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
+ '%PromisePrototype%': ['Promise', 'prototype'],
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
+ '%Promise_all%': ['Promise', 'all'],
+ '%Promise_reject%': ['Promise', 'reject'],
+ '%Promise_resolve%': ['Promise', 'resolve'],
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
+ '%SetPrototype%': ['Set', 'prototype'],
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
+ '%StringPrototype%': ['String', 'prototype'],
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
+};
-// Ref: https://fetch.spec.whatwg.org/#forbidden-header-name
-var unsafeHeaders = {
- "Accept-Charset": true,
- "Access-Control-Request-Headers": true,
- "Access-Control-Request-Method": true,
- "Accept-Encoding": true,
- Connection: true,
- "Content-Length": true,
- Cookie: true,
- Cookie2: true,
- "Content-Transfer-Encoding": true,
- Date: true,
- DNT: true,
- Expect: true,
- Host: true,
- "Keep-Alive": true,
- Origin: true,
- Referer: true,
- TE: true,
- Trailer: true,
- "Transfer-Encoding": true,
- Upgrade: true,
- "User-Agent": true,
- Via: true
+var bind = require('function-bind');
+var hasOwn = require('hasown');
+var $concat = bind.call(Function.call, Array.prototype.concat);
+var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
+var $replace = bind.call(Function.call, String.prototype.replace);
+var $strSlice = bind.call(Function.call, String.prototype.slice);
+var $exec = bind.call(Function.call, RegExp.prototype.exec);
+
+/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
+var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
+var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
+var stringToPath = function stringToPath(string) {
+ var first = $strSlice(string, 0, 1);
+ var last = $strSlice(string, -1);
+ if (first === '%' && last !== '%') {
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
+ } else if (last === '%' && first !== '%') {
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
+ }
+ var result = [];
+ $replace(string, rePropName, function (match, number, quote, subString) {
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
+ });
+ return result;
};
+/* end adaptation */
+
+var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
+ var intrinsicName = name;
+ var alias;
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
+ alias = LEGACY_ALIASES[intrinsicName];
+ intrinsicName = '%' + alias[0] + '%';
+ }
-function EventTargetHandler() {
- var self = this;
- var events = [
- "loadstart",
- "progress",
- "abort",
- "error",
- "load",
- "timeout",
- "loadend"
- ];
+ if (hasOwn(INTRINSICS, intrinsicName)) {
+ var value = INTRINSICS[intrinsicName];
+ if (value === needsEval) {
+ value = doEval(intrinsicName);
+ }
+ if (typeof value === 'undefined' && !allowMissing) {
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
+ }
+
+ return {
+ alias: alias,
+ name: intrinsicName,
+ value: value
+ };
+ }
+
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
+};
+
+module.exports = function GetIntrinsic(name, allowMissing) {
+ if (typeof name !== 'string' || name.length === 0) {
+ throw new $TypeError('intrinsic name must be a non-empty string');
+ }
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
+ throw new $TypeError('"allowMissing" argument must be a boolean');
+ }
- function addEventListener(eventName) {
- self.addEventListener(eventName, function(event) {
- var listener = self[`on${eventName}`];
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
+ }
+ var parts = stringToPath(name);
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
+
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
+ var intrinsicRealName = intrinsic.name;
+ var value = intrinsic.value;
+ var skipFurtherCaching = false;
+
+ var alias = intrinsic.alias;
+ if (alias) {
+ intrinsicBaseName = alias[0];
+ $spliceApply(parts, $concat([0, 1], alias));
+ }
- if (listener && typeof listener === "function") {
- listener.call(this, event);
- }
- });
- }
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
+ var part = parts[i];
+ var first = $strSlice(part, 0, 1);
+ var last = $strSlice(part, -1);
+ if (
+ (
+ (first === '"' || first === "'" || first === '`')
+ || (last === '"' || last === "'" || last === '`')
+ )
+ && first !== last
+ ) {
+ throw new $SyntaxError('property names with quotes must have matching quotes');
+ }
+ if (part === 'constructor' || !isOwn) {
+ skipFurtherCaching = true;
+ }
- events.forEach(addEventListener);
-}
+ intrinsicBaseName += '.' + part;
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
-EventTargetHandler.prototype = sinonEvent.EventTarget;
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
+ value = INTRINSICS[intrinsicRealName];
+ } else if (value != null) {
+ if (!(part in value)) {
+ if (!allowMissing) {
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
+ }
+ return void undefined;
+ }
+ if ($gOPD && (i + 1) >= parts.length) {
+ var desc = $gOPD(value, part);
+ isOwn = !!desc;
+
+ // By convention, when a data property is converted to an accessor
+ // property to emulate a data property that does not suffer from
+ // the override mistake, that accessor's getter is marked with
+ // an `originalValue` property. Here, when we detect this, we
+ // uphold the illusion by pretending to see that original data
+ // property, i.e., returning the value rather than the getter
+ // itself.
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
+ value = desc.get;
+ } else {
+ value = value[part];
+ }
+ } else {
+ isOwn = hasOwn(value, part);
+ value = value[part];
+ }
-function normalizeHeaderValue(value) {
- // Ref: https://fetch.spec.whatwg.org/#http-whitespace-bytes
- /*eslint no-control-regex: "off"*/
- return value.replace(/^[\x09\x0A\x0D\x20]+|[\x09\x0A\x0D\x20]+$/g, "");
-}
+ if (isOwn && !skipFurtherCaching) {
+ INTRINSICS[intrinsicRealName] = value;
+ }
+ }
+ }
+ return value;
+};
-function getHeader(headers, header) {
- var foundHeader = Object.keys(headers).filter(function(h) {
- return h.toLowerCase() === header.toLowerCase();
- });
+},{"es-errors":123,"es-errors/eval":122,"es-errors/range":124,"es-errors/ref":125,"es-errors/syntax":126,"es-errors/type":127,"es-errors/uri":128,"function-bind":130,"has-proto":134,"has-symbols":135,"hasown":137}],132:[function(require,module,exports){
+'use strict';
- return foundHeader[0] || null;
-}
+var GetIntrinsic = require('get-intrinsic');
-function excludeSetCookie2Header(header) {
- return !/^Set-Cookie2?$/i.test(header);
+var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
+
+if ($gOPD) {
+ try {
+ $gOPD([], 'length');
+ } catch (e) {
+ // IE 8 has a broken gOPD
+ $gOPD = null;
+ }
}
-function verifyResponseBodyType(body, responseType) {
- var error = null;
- var isString = typeof body === "string";
+module.exports = $gOPD;
- if (responseType === "arraybuffer") {
- if (!isString && !(body instanceof ArrayBuffer)) {
- error = new Error(
- `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string or ArrayBuffer.`
- );
- error.name = "InvalidBodyException";
- }
- } else if (responseType === "blob") {
- if (
- !isString &&
- !(body instanceof ArrayBuffer) &&
- supportsBlob &&
- !(body instanceof Blob)
- ) {
- error = new Error(
- `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string, ArrayBuffer, or Blob.`
- );
- error.name = "InvalidBodyException";
- }
- } else if (!isString) {
- error = new Error(
- `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string.`
- );
- error.name = "InvalidBodyException";
- }
+},{"get-intrinsic":131}],133:[function(require,module,exports){
+'use strict';
- if (error) {
- throw error;
- }
-}
+var $defineProperty = require('es-define-property');
-function convertToArrayBuffer(body, encoding) {
- if (body instanceof ArrayBuffer) {
- return body;
- }
+var hasPropertyDescriptors = function hasPropertyDescriptors() {
+ return !!$defineProperty;
+};
- return new GlobalTextEncoder(encoding || "utf-8").encode(body).buffer;
-}
+hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
+ // node v0.6 has a bug where array lengths can be Set but not Defined
+ if (!$defineProperty) {
+ return null;
+ }
+ try {
+ return $defineProperty([], 'length', { value: 1 }).length !== 1;
+ } catch (e) {
+ // In Firefox 4-22, defining length on an array throws an exception.
+ return true;
+ }
+};
-function isXmlContentType(contentType) {
- return (
- !contentType ||
- /(text\/xml)|(application\/xml)|(\+xml)/.test(contentType)
- );
-}
+module.exports = hasPropertyDescriptors;
-function clearResponse(xhr) {
- if (xhr.responseType === "" || xhr.responseType === "text") {
- xhr.response = xhr.responseText = "";
- } else {
- xhr.response = xhr.responseText = null;
- }
- xhr.responseXML = null;
-}
+},{"es-define-property":121}],134:[function(require,module,exports){
+'use strict';
-function fakeXMLHttpRequestFor(globalScope) {
- var isReactNative =
- globalScope.navigator &&
- globalScope.navigator.product === "ReactNative";
- var sinonXhr = { XMLHttpRequest: globalScope.XMLHttpRequest };
- sinonXhr.GlobalXMLHttpRequest = globalScope.XMLHttpRequest;
- sinonXhr.GlobalActiveXObject = globalScope.ActiveXObject;
- sinonXhr.supportsActiveX =
- typeof sinonXhr.GlobalActiveXObject !== "undefined";
- sinonXhr.supportsXHR = typeof sinonXhr.GlobalXMLHttpRequest !== "undefined";
- sinonXhr.workingXHR = getWorkingXHR(globalScope);
- sinonXhr.supportsTimeout =
- sinonXhr.supportsXHR &&
- "timeout" in new sinonXhr.GlobalXMLHttpRequest();
- sinonXhr.supportsCORS =
- isReactNative ||
- (sinonXhr.supportsXHR &&
- "withCredentials" in new sinonXhr.GlobalXMLHttpRequest());
+var test = {
+ __proto__: null,
+ foo: {}
+};
- // Note that for FakeXMLHttpRequest to work pre ES5
- // we lose some of the alignment with the spec.
- // To ensure as close a match as possible,
- // set responseType before calling open, send or respond;
- function FakeXMLHttpRequest(config) {
- EventTargetHandler.call(this);
- this.readyState = FakeXMLHttpRequest.UNSENT;
- this.requestHeaders = {};
- this.requestBody = null;
- this.status = 0;
- this.statusText = "";
- this.upload = new EventTargetHandler();
- this.responseType = "";
- this.response = "";
- this.logError = configureLogError(config);
+var $Object = Object;
- if (sinonXhr.supportsTimeout) {
- this.timeout = 0;
- }
+/** @type {import('.')} */
+module.exports = function hasProto() {
+ // @ts-expect-error: TS errors on an inherited property for some reason
+ return { __proto__: test }.foo === test.foo
+ && !(test instanceof $Object);
+};
- if (sinonXhr.supportsCORS) {
- this.withCredentials = false;
- }
+},{}],135:[function(require,module,exports){
+'use strict';
- if (typeof FakeXMLHttpRequest.onCreate === "function") {
- FakeXMLHttpRequest.onCreate(this);
- }
- }
+var origSymbol = typeof Symbol !== 'undefined' && Symbol;
+var hasSymbolSham = require('./shams');
- function verifyState(xhr) {
- if (xhr.readyState !== FakeXMLHttpRequest.OPENED) {
- throw new Error("INVALID_STATE_ERR");
- }
+module.exports = function hasNativeSymbols() {
+ if (typeof origSymbol !== 'function') { return false; }
+ if (typeof Symbol !== 'function') { return false; }
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
- if (xhr.sendFlag) {
- throw new Error("INVALID_STATE_ERR");
- }
- }
+ return hasSymbolSham();
+};
- // largest arity in XHR is 5 - XHR#open
- var apply = function(obj, method, args) {
- switch (args.length) {
- case 0:
- return obj[method]();
- case 1:
- return obj[method](args[0]);
- case 2:
- return obj[method](args[0], args[1]);
- case 3:
- return obj[method](args[0], args[1], args[2]);
- case 4:
- return obj[method](args[0], args[1], args[2], args[3]);
- case 5:
- return obj[method](args[0], args[1], args[2], args[3], args[4]);
- default:
- throw new Error("Unhandled case");
- }
- };
+},{"./shams":136}],136:[function(require,module,exports){
+'use strict';
- FakeXMLHttpRequest.filters = [];
- FakeXMLHttpRequest.addFilter = function addFilter(fn) {
- this.filters.push(fn);
- };
- FakeXMLHttpRequest.defake = function defake(fakeXhr, xhrArgs) {
- var xhr = new sinonXhr.workingXHR(); // eslint-disable-line new-cap
+/* eslint complexity: [2, 18], max-statements: [2, 33] */
+module.exports = function hasSymbols() {
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
+ if (typeof Symbol.iterator === 'symbol') { return true; }
- [
- "open",
- "setRequestHeader",
- "abort",
- "getResponseHeader",
- "getAllResponseHeaders",
- "addEventListener",
- "overrideMimeType",
- "removeEventListener"
- ].forEach(function(method) {
- fakeXhr[method] = function() {
- return apply(xhr, method, arguments);
- };
- });
+ var obj = {};
+ var sym = Symbol('test');
+ var symObj = Object(sym);
+ if (typeof sym === 'string') { return false; }
- fakeXhr.send = function() {
- // Ref: https://xhr.spec.whatwg.org/#the-responsetype-attribute
- if (xhr.responseType !== fakeXhr.responseType) {
- xhr.responseType = fakeXhr.responseType;
- }
- return apply(xhr, "send", arguments);
- };
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
- var copyAttrs = function(args) {
- args.forEach(function(attr) {
- fakeXhr[attr] = xhr[attr];
- });
- };
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
+ // if (sym instanceof Symbol) { return false; }
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
+ // if (!(symObj instanceof Symbol)) { return false; }
- var stateChangeStart = function() {
- fakeXhr.readyState = xhr.readyState;
- if (xhr.readyState >= FakeXMLHttpRequest.HEADERS_RECEIVED) {
- copyAttrs(["status", "statusText"]);
- }
- if (xhr.readyState >= FakeXMLHttpRequest.LOADING) {
- copyAttrs(["response"]);
- if (xhr.responseType === "" || xhr.responseType === "text") {
- copyAttrs(["responseText"]);
- }
- }
- if (
- xhr.readyState === FakeXMLHttpRequest.DONE &&
- (xhr.responseType === "" || xhr.responseType === "document")
- ) {
- copyAttrs(["responseXML"]);
- }
- };
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
- var stateChangeEnd = function() {
- if (fakeXhr.onreadystatechange) {
- // eslint-disable-next-line no-useless-call
- fakeXhr.onreadystatechange.call(fakeXhr, {
- target: fakeXhr,
- currentTarget: fakeXhr
- });
- }
- };
+ var symVal = 42;
+ obj[sym] = symVal;
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
- var stateChange = function stateChange() {
- stateChangeStart();
- stateChangeEnd();
- };
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
- if (xhr.addEventListener) {
- xhr.addEventListener("readystatechange", stateChangeStart);
+ var syms = Object.getOwnPropertySymbols(obj);
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
- Object.keys(fakeXhr.eventListeners).forEach(function(event) {
- /*eslint-disable no-loop-func*/
- fakeXhr.eventListeners[event].forEach(function(handler) {
- xhr.addEventListener(event, handler.listener, {
- capture: handler.capture,
- once: handler.once
- });
- });
- /*eslint-enable no-loop-func*/
- });
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
- xhr.addEventListener("readystatechange", stateChangeEnd);
- } else {
- xhr.onreadystatechange = stateChange;
- }
- apply(xhr, "open", xhrArgs);
- };
- FakeXMLHttpRequest.useFilters = false;
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
+ }
- function verifyRequestOpened(xhr) {
- if (xhr.readyState !== FakeXMLHttpRequest.OPENED) {
- const errorMessage =
- xhr.readyState === FakeXMLHttpRequest.UNSENT
- ? "INVALID_STATE_ERR - you might be trying to set the request state for a request that has already been aborted, it is recommended to check 'readyState' first..."
- : `INVALID_STATE_ERR - ${xhr.readyState}`;
- throw new Error(errorMessage);
- }
- }
+ return true;
+};
- function verifyRequestSent(xhr) {
- if (xhr.readyState === FakeXMLHttpRequest.DONE) {
- throw new Error("Request done");
- }
- }
+},{}],137:[function(require,module,exports){
+'use strict';
- function verifyHeadersReceived(xhr) {
- if (
- xhr.async &&
- xhr.readyState !== FakeXMLHttpRequest.HEADERS_RECEIVED
- ) {
- throw new Error("No headers received");
- }
- }
+var call = Function.prototype.call;
+var $hasOwn = Object.prototype.hasOwnProperty;
+var bind = require('function-bind');
- function convertResponseBody(responseType, contentType, body) {
- if (responseType === "" || responseType === "text") {
- return body;
- } else if (supportsArrayBuffer && responseType === "arraybuffer") {
- return convertToArrayBuffer(body);
- } else if (responseType === "json") {
- try {
- return JSON.parse(body);
- } catch (e) {
- // Return parsing failure as null
- return null;
- }
- } else if (supportsBlob && responseType === "blob") {
- if (body instanceof Blob) {
- return body;
- }
+/** @type {import('.')} */
+module.exports = bind.call(call, $hasOwn);
- var blobOptions = {};
- if (contentType) {
- blobOptions.type = contentType;
- }
- return new Blob([convertToArrayBuffer(body)], blobOptions);
- } else if (responseType === "document") {
- if (isXmlContentType(contentType)) {
- return FakeXMLHttpRequest.parseXML(body);
- }
- return null;
- }
- throw new Error(`Invalid responseType ${responseType}`);
- }
+},{"function-bind":130}],138:[function(require,module,exports){
+module.exports = extend;
- /**
- * Steps to follow when there is an error, according to:
- * https://xhr.spec.whatwg.org/#request-error-steps
- */
- function requestErrorSteps(xhr) {
- clearResponse(xhr);
- xhr.errorFlag = true;
- xhr.requestHeaders = {};
- xhr.responseHeaders = {};
+/*
+ var obj = {a: 3, b: 5};
+ extend(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
+ obj; // {a: 4, b: 5, c: 8}
- if (
- xhr.readyState !== FakeXMLHttpRequest.UNSENT &&
- xhr.sendFlag &&
- xhr.readyState !== FakeXMLHttpRequest.DONE
- ) {
- xhr.readyStateChange(FakeXMLHttpRequest.DONE);
- xhr.sendFlag = false;
- }
- }
+ var obj = {a: 3, b: 5};
+ extend({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
+ obj; // {a: 3, b: 5}
- FakeXMLHttpRequest.parseXML = function parseXML(text) {
- // Treat empty string as parsing failure
- if (text !== "") {
- try {
- if (typeof DOMParser !== "undefined") {
- var parser = new DOMParser();
- var parsererrorNS = "";
+ var arr = [1, 2, 3];
+ var obj = {a: 3, b: 5};
+ extend(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
+ arr.push(4);
+ obj; // {a: 3, b: 5, c: [1, 2, 3, 4]}
- try {
- var parsererrors = parser
- .parseFromString("INVALID", "text/xml")
- .getElementsByTagName("parsererror");
- if (parsererrors.length) {
- parsererrorNS = parsererrors[0].namespaceURI;
- }
- } catch (e) {
- // passing invalid XML makes IE11 throw
- // so no namespace needs to be determined
- }
+ var arr = [1, 2, 3];
+ var obj = {a: 3, b: 5};
+ extend(true, obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
+ arr.push(4);
+ obj; // {a: 3, b: 5, c: [1, 2, 3]}
- var result;
- try {
- result = parser.parseFromString(text, "text/xml");
- } catch (err) {
- return null;
- }
+ extend({a: 4, b: 5}); // {a: 4, b: 5}
+ extend({a: 4, b: 5}, 3); {a: 4, b: 5}
+ extend({a: 4, b: 5}, true); {a: 4, b: 5}
+ extend('hello', {a: 4, b: 5}); // throws
+ extend(3, {a: 4, b: 5}); // throws
+*/
- return result.getElementsByTagNameNS(
- parsererrorNS,
- "parsererror"
- ).length
- ? null
- : result;
- }
- var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
- xmlDoc.async = "false";
- xmlDoc.loadXML(text);
- return xmlDoc.parseError.errorCode !== 0 ? null : xmlDoc;
- } catch (e) {
- // Unable to parse XML - no biggie
- }
+function extend(/* [deep], obj1, obj2, [objn] */) {
+ var args = [].slice.call(arguments);
+ var deep = false;
+ if (typeof args[0] == 'boolean') {
+ deep = args.shift();
+ }
+ var result = args[0];
+ if (isUnextendable(result)) {
+ throw new Error('extendee must be an object');
+ }
+ var extenders = args.slice(1);
+ var len = extenders.length;
+ for (var i = 0; i < len; i++) {
+ var extender = extenders[i];
+ for (var key in extender) {
+ if (Object.prototype.hasOwnProperty.call(extender, key)) {
+ var value = extender[key];
+ if (deep && isCloneable(value)) {
+ var base = Array.isArray(value) ? [] : {};
+ result[key] = extend(
+ true,
+ Object.prototype.hasOwnProperty.call(result, key) && !isUnextendable(result[key])
+ ? result[key]
+ : base,
+ value
+ );
+ } else {
+ result[key] = value;
}
+ }
+ }
+ }
+ return result;
+}
- return null;
- };
-
- FakeXMLHttpRequest.statusCodes = {
- 100: "Continue",
- 101: "Switching Protocols",
- 200: "OK",
- 201: "Created",
- 202: "Accepted",
- 203: "Non-Authoritative Information",
- 204: "No Content",
- 205: "Reset Content",
- 206: "Partial Content",
- 207: "Multi-Status",
- 300: "Multiple Choice",
- 301: "Moved Permanently",
- 302: "Found",
- 303: "See Other",
- 304: "Not Modified",
- 305: "Use Proxy",
- 307: "Temporary Redirect",
- 400: "Bad Request",
- 401: "Unauthorized",
- 402: "Payment Required",
- 403: "Forbidden",
- 404: "Not Found",
- 405: "Method Not Allowed",
- 406: "Not Acceptable",
- 407: "Proxy Authentication Required",
- 408: "Request Timeout",
- 409: "Conflict",
- 410: "Gone",
- 411: "Length Required",
- 412: "Precondition Failed",
- 413: "Request Entity Too Large",
- 414: "Request-URI Too Long",
- 415: "Unsupported Media Type",
- 416: "Requested Range Not Satisfiable",
- 417: "Expectation Failed",
- 422: "Unprocessable Entity",
- 500: "Internal Server Error",
- 501: "Not Implemented",
- 502: "Bad Gateway",
- 503: "Service Unavailable",
- 504: "Gateway Timeout",
- 505: "HTTP Version Not Supported"
- };
+function isCloneable(obj) {
+ return Array.isArray(obj) || {}.toString.call(obj) == '[object Object]';
+}
- extend(FakeXMLHttpRequest.prototype, sinonEvent.EventTarget, {
- async: true,
+function isUnextendable(val) {
+ return !val || (typeof val != 'object' && typeof val != 'function');
+}
- open: function open(method, url, async, username, password) {
- this.method = method;
- this.url = url;
- this.async = typeof async === "boolean" ? async : true;
- this.username = username;
- this.password = password;
- clearResponse(this);
- this.requestHeaders = {};
- this.sendFlag = false;
+},{}],139:[function(require,module,exports){
+/**
+ * lodash (Custom Build)