How to use the @sinonjs/samsam.isElement function in @sinonjs/samsam

To help you get started, we’ve selected a few @sinonjs/samsam examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sinonjs / formatio / lib / formatio.js View on Github external
}

    var internalProcessed = processed || [];

    if (isCircular(object, internalProcessed)) {
        return "[Circular]";
    }

    if (typeOf(object) === "array") {
        return ascii.array.call(f, object, internalProcessed);
    }

    if (!object) {
        return String(1 / object === -Infinity ? "-0" : object);
    }
    if (samsam.isElement(object)) {
        return ascii.element(object);
    }

    if (
        typeof object.toString === "function" &&
        object.toString !== Object.prototype.toString
    ) {
        return object.toString();
    }

    var i, l;
    for (i = 0, l = specialObjects.length; i < l; i++) {
        if (object === specialObjects[i].object) {
            return specialObjects[i].value;
        }
    }

@sinonjs/samsam

Value identification and comparison functions

BSD-3-Clause
Latest version published 2 months ago

Package Health Score

92 / 100
Full package analysis

Similar packages