VimUnDoQi2#wv }]SV N _ N*Q "use strict";/**, * Returns `true` if `value` is `undefined`. * @examples( * var foo; isUndefined(foo); // true * isUndefined(0); // false */function isUndefined(value) { return value === undefined;}"exports.isUndefined = isUndefined;/**% * Returns `true` if value is `null`. * @examples * isNull(null); // true! * isNull(undefined); // false */function isNull(value) { return value === null;}exports.isNull = isNull;/**' * Returns `true` if value is a string. * @examples * isString("moe"); // true */function isString(value) {# return typeof value === "string";}exports.isString = isString;/**) * Returns `true` if `value` is a number. * @examples * isNumber(8.4 * 5); // true */function isNumber(value) {# return typeof value === "number";}exports.isNumber = isNumber;/**+ * Returns `true` if `value` is a `RegExp`. * @examples * isRegExp(/moe/); // true */function isRegExp(value) {# return instanceOf(value, RegExp);}exports.isRegExp = isRegExp;/**' * Returns true if `value` is a `Date`. * @examples! * isDate(new Date()); // true */function isDate(value) {4 return isObject(value) && instanceOf(value, Date);}exports.isDate = isDate;/**( * Returns true if object is a Function. * @examples* * isFunction(function foo(){}) // true */function isFunction(value) {D return typeof value === "function" && value.call && value.apply;} exports.isFunction = isFunction;/**P * Returns `true` if `value` is an object (please note that `null` is considered$ * to be an atom and not an object). * @examples * isObject({}) // true * isObject(null) // false */function isObject(value) {7 return typeof value === "object" && value !== null;}exports.isObject = isObject;/**' * Returns true if `value` is an Array. * @examples! * isArray([1, 2, 3]) // true/ * isArray({ 0: 'foo', length: 1 }) // false */8var isArray = Array.isArray || function isArray(value) {= Object.prototype.toString.call(value) === "[object Array]";}exports.isArray = isArray;/**4 * Returns `true` if `value` is an Arguments object. * @examplesF * (function(){ return isArguments(arguments); })(1, 2, 3); // true$ * isArguments([1,2,3]); // false */function isArguments(value) {A Object.prototype.toString.call(value) === "[object Arguments]";}"exports.isArguments = isArguments;/**G * Returns true if it is a primitive `value`. (null, undefined, number, * boolean, string) * @examples * isPrimitive(3) // true * isPrimitive('foo') // true& * isPrimitive({ bar: 3 }) // false */function isPrimitive(value) {0 return !isFunction(value) && !isObject(value);}"exports.isPrimitive = isPrimitive;/**E * Returns `true` if given `object` is flat (it is direct decedent of! * `Object.prototype` or `null`). * @examples * isFlat({}) // true! * isFlat(new Type()) // false */function isFlat(object) {F return isObject(object) && (isNull(Object.getPrototypeOf(object)) ||; isNull(Object.getPrototypeOf(F Object.getPrototypeOf(object))));}exports.isFlat = isFlat;/**/ * Returns `true` if object contains no values. */function isEmpty(object) { if (isObject(object)) { for (var key in object) return false; return true; } return false;}exports.isEmpty = isEmpty;/**M * Returns `true` if `value` is an array / flat object containing only atomic! * values and other flat objects. */!function isJSON(value, visited) {/ // Adding value to array of visited values., (visited || (visited = [])).push(value);I // If `value` is an atom return `true` cause it's valid JSON.! return isPrimitive(value) ||N // If `value` is an array of JSON values that has not been visited // yet.? (isArray(value) && value.every(function(element) {B return isJSON(element, visited);& })) ||M // If `value` is a plain object containing properties with a JSON( // values it's a valid JSON.F (isFlat(value) && Object.keys(value).every(function(key) {D var $ = Object.getOwnPropertyDescriptor(value, key);H // Check every proprety of a plain object to verify thatI // it's neither getter nor setter, but a JSON value, that, // has not been visited yet.N return ((!isObject($.value) || !~visited.indexOf($.value)) &&9 !('get' in $) && !('set' in $) &&2 isJSON($.value, visited)); }));}#exports.isJSON = function (value) { return isJSON(value);};/**O * Returns if `value` is an instance of a given `Type`. This is exactly same asL * `value instanceof Type` with a difference that `Type` can be from a scopeI * that has a different top level object. (Like in case where `Type` is a> * function from different iframe / jetpack module / sandbox). */"function instanceOf(value, Type) { var isConstructorNameSame; var isConstructorSourceSame;? // If `instanceof` returned `true` we know result right away.+ var isInstanceOf = value instanceof Type;N // If `instanceof` returned `false` we do ducktype check since `Type` may beO // from a different sandbox. If a constructor of the `value` or a constructorM // of the value's prototype has same name and source we assume that it's an // instance of the Type. if (!isInstanceOf && value) {A isConstructorNameSame = value.constructor.name === Type.name;H isConstructorSourceSame = String(value.constructor) == String(Type);H isInstanceOf = (isConstructorNameSame && isConstructorSourceSame) ||C instanceOf(Object.getPrototypeOf(value), Type); } return isInstanceOf;} exports.instanceOf = instanceOf;/**L * Function returns textual representation of a value passed to it. FunctionH * takes additional `indent` argument that is used for indentation. AlsoN * optional `limit` argument may be passed to limit amount of detail returned. * @param {Object} value" * @param {String} [indent=" "] * @param {Number} [limit] */8function source(value, indent, limit, offset, visited) { var result; var names; var nestingIndex;& var isCompact = !isUndefined(limit); indent = indent || " "; offset = (offset || ""); result = ""; visited = visited || []; if (isUndefined(value)) { result += "undefined"; } else if (isNull(value)) { result += "null"; } else if (isString(value)) { result += '"' + value + '"'; } else if (isFunction(value)) {& value = String(value).split("\n");( if (isCompact && value.length > 2) {! value = value.splice(0, 2); value.push("...}"); }( result += value.join("\n" + offset); } else if (isArray(value)) {8 if ((nestingIndex = (visited.indexOf(value) + 1))) {( result = "#" + nestingIndex + "#"; } else { visited.push(value); if (isCompact)& value = value.slice(0, limit); result += "[\n";+ result += value.map(function(value) {N return offset + indent + source(value, indent, limit, offset + indent,1 visited); }).join(",\n");3 result += isCompact && value.length > limit ?> ",\n" + offset + "...]" : "\n" + offset + "]"; } } else if (isObject(value)) {8 if ((nestingIndex = (visited.indexOf(value) + 1))) {' result = "#" + nestingIndex + "#" } else { visited.push(value)! names = Object.keys(value);' result += "{ // " + value + "\n";P result += (isCompact ? names.slice(0, limit) : names).map(function(name) {3 var _limit = isCompact ? limit - 1 : limit;F var descriptor = Object.getOwnPropertyDescriptor(value, name);- var result = offset + indent + "// "; var accessor;# if (0 <= name.indexOf(" "))" name = '"' + name + '"'; if (descriptor.writable) result += "writable ";$ if (descriptor.configurable)$ result += "configurable ";" if (descriptor.enumerable)" result += "enumerable "; result += "\n";$ if ("value" in descriptor) {2 result += offset + indent + name + ": ";M result += source(descriptor.value, indent, _limit, indent + offset,$ visited); } else { if (descriptor.get) {< result += offset + indent + "get " + name + " ";N accessor = source(descriptor.get, indent, _limit, indent + offset,' visited);= result += accessor.substr(accessor.indexOf("{")); } if (descriptor.set) {< result += offset + indent + "set " + name + " ";N accessor = source(descriptor.set, indent, _limit, indent + offset,' visited);= result += accessor.substr(accessor.indexOf("{")); } } return result; }).join(",\n"); if (isCompact) {0 if (names.length > limit && limit > 0) {7 result += ",\n" + offset + indent + "//..."; } } else { if (names.length) result += ",";; result += "\n" + offset + indent + '"__proto__": ';A result += source(Object.getPrototypeOf(value), indent, 0,* offset + indent); }$ result += "\n" + offset + "}"; } } else { result += String(value); } return result;}7exports.source = function (value, indentation, limit) {+ return source(value, indentation, limit);};});5_N*5_N-})5_N.  5_N1 5_N9 exports.run = function run()5_N9 exports.run = function run() {}5_ N< exports.run = function run() {5_ 'NV   5_ NZ ! logger = logger || new Logger()5_ Ne ! test.run(logger || new Logger()5_ (Nj ( test.run(units, logger || new Logger()5_  Nw 5_ N  5_ N  5_ N exports.Assert = require()5_ N exports.Assert = require('')5_ $N $exports.Assert = require('./assert')5_ N  5_ N var test = require()5_ N var test = require('')5