Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"use strict";
var arrayProto = require("@sinonjs/commons").prototypes.array;
var deepEqual = require("./deep-equal").use(match); // eslint-disable-line no-use-before-define
var every = require("@sinonjs/commons").every;
var functionName = require("@sinonjs/commons").functionName;
var get = require("lodash").get;
var iterableToString = require("./iterable-to-string");
var objectProto = require("@sinonjs/commons").prototypes.object;
var stringProto = require("@sinonjs/commons").prototypes.string;
var typeOf = require("@sinonjs/commons").typeOf;
var valueToString = require("@sinonjs/commons").valueToString;
var arrayIndexOf = arrayProto.indexOf;
var arrayEvery = arrayProto.every;
var join = arrayProto.join;
var map = arrayProto.map;
var some = arrayProto.some;
"use strict";
var arrayProto = require("@sinonjs/commons").prototypes.array;
var deepEqual = require("./util/core/deep-equal").use(match); // eslint-disable-line no-use-before-define
var every = require("./util/core/every");
var functionName = require("@sinonjs/commons").functionName;
var get = require("lodash.get");
var iterableToString = require("./util/core/iterable-to-string");
var objectProto = require("@sinonjs/commons").prototypes.object;
var stringProto = require("@sinonjs/commons").prototypes.string;
var typeOf = require("./util/core/typeOf");
var valueToString = require("@sinonjs/commons").valueToString;
var arrayIndexOf = arrayProto.indexOf;
var arrayEvery = arrayProto.every;
var join = arrayProto.join;
var map = arrayProto.map;
var some = arrayProto.some;
var hasOwnProperty = objectProto.hasOwnProperty;
var isPrototypeOf = objectProto.isPrototypeOf;
var stringIndexOf = stringProto.indexOf;
function assertType(value, type, name) {
var actual = typeOf(value);
"use strict";
var arrayProto = require("@sinonjs/commons").prototypes.array;
var deepEqual = require("./deep-equal").use(match); // eslint-disable-line no-use-before-define
var every = require("@sinonjs/commons").every;
var functionName = require("@sinonjs/commons").functionName;
var get = require("lodash").get;
var iterableToString = require("./iterable-to-string");
var objectProto = require("@sinonjs/commons").prototypes.object;
var stringProto = require("@sinonjs/commons").prototypes.string;
var typeOf = require("@sinonjs/commons").typeOf;
var valueToString = require("@sinonjs/commons").valueToString;
var arrayIndexOf = arrayProto.indexOf;
var arrayEvery = arrayProto.every;
var join = arrayProto.join;
var map = arrayProto.map;
var some = arrayProto.some;
var hasOwnProperty = objectProto.hasOwnProperty;
var isPrototypeOf = objectProto.isPrototypeOf;
var objectToString = objectProto.toString;
var stringIndexOf = stringProto.indexOf;
var matcher = {
"use strict";
var arrayProto = require("@sinonjs/commons").prototypes.array;
var hasOwnProperty = require("@sinonjs/commons").prototypes.object.hasOwnProperty;
var join = arrayProto.join;
var push = arrayProto.push;
var slice = arrayProto.slice;
// Adapted from https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug
var hasDontEnumBug = (function() {
var obj = {
constructor: function() {
return "0";
},
toString: function() {
return "1";
},
valueOf: function() {
"use strict";
var interpolate = require("./interpolate");
var format = require("./format");
var reduce = require("@sinonjs/commons").prototypes.array.reduce;
function prepareMessage(message) {
if (!message) {
return "";
}
return message + (/[.:!?]$/.test(message) ? " " : ": ");
}
function interpolateProperties(referee, message, properties) {
return reduce(
Object.keys(properties),
function(str, name) {
var formattedValue =
name === "customMessage"
? prepareMessage(properties[name])
: format(properties[name]);
"use strict";
var arrayProto = require("@sinonjs/commons").prototypes.array;
var behavior = require("./behavior");
var behaviors = require("./default-behaviors");
var createProxy = require("./proxy");
var functionName = require("@sinonjs/commons").functionName;
var hasOwnProperty = require("@sinonjs/commons").prototypes.object.hasOwnProperty;
var isNonExistentProperty = require("./util/core/is-non-existent-property");
var spy = require("./spy");
var extend = require("./util/core/extend");
var getPropertyDescriptor = require("./util/core/get-property-descriptor");
var isEsModule = require("./util/core/is-es-module");
var wrapMethod = require("./util/core/wrap-method");
var throwOnFalsyObject = require("./throw-on-falsy-object");
var valueToString = require("@sinonjs/commons").valueToString;
var walkObject = require("./util/core/walk-object");
var forEach = arrayProto.forEach;
var pop = arrayProto.pop;
var slice = arrayProto.slice;
var sort = arrayProto.sort;
var uuid = 0;
"use strict";
var arrayProto = require("@sinonjs/commons").prototypes.array;
var Sandbox = require("./sandbox");
var forEach = arrayProto.forEach;
var push = arrayProto.push;
function prepareSandboxFromConfig(config) {
var sandbox = new Sandbox();
if (config.useFakeServer) {
if (typeof config.useFakeServer === "object") {
sandbox.serverPrototype = config.useFakeServer;
}
sandbox.useFakeServer();
}
"use strict";
var arrayProto = require("@sinonjs/commons").prototypes.array;
var extend = require("./util/core/extend");
var functionName = require("@sinonjs/commons").functionName;
var nextTick = require("./util/core/next-tick");
var valueToString = require("@sinonjs/commons").valueToString;
var exportAsyncBehaviors = require("./util/core/export-async-behaviors");
var concat = arrayProto.concat;
var join = arrayProto.join;
var reverse = arrayProto.reverse;
var slice = arrayProto.slice;
var useLeftMostCallback = -1;
var useRightMostCallback = -2;
function getCallback(behavior, args) {
var callArgAt = behavior.callArgAt;
"use strict";
var arrayProto = require("@sinonjs/commons").prototypes.array;
var toString = require("@sinonjs/commons").prototypes.object.toString;
var samsam = require("@sinonjs/samsam");
var every = arrayProto.every;
var join = arrayProto.join;
var sort = arrayProto.sort;
function isReallyNaN(val) {
return val !== val;
}
var deepEqual = module.exports = function deepEqual(a, b, matcher) {
if (a === null && b === null) {
return true;
}
"use strict";
var push = require("@sinonjs/commons").prototypes.array.push;
exports.incrementCallCount = function incrementCallCount(proxy) {
proxy.called = true;
proxy.callCount += 1;
proxy.notCalled = false;
proxy.calledOnce = proxy.callCount === 1;
proxy.calledTwice = proxy.callCount === 2;
proxy.calledThrice = proxy.callCount === 3;
};
exports.createCallProperties = function createCallProperties(proxy) {
proxy.firstCall = proxy.getCall(0);
proxy.secondCall = proxy.getCall(1);
proxy.thirdCall = proxy.getCall(2);
proxy.lastCall = proxy.getCall(proxy.callCount - 1);
};