How to use the core-util-is.inspect function in core-util-is

To help you get started, we’ve selected a few core-util-is 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 nodejs / readable-stream / test / common / heap.js View on Github external
var _loop = function _loop() {
              var expectedEdge = _step2.value;
              var check = typeof expectedEdge === 'function' ? expectedEdge : function (edge) {
                return isEdge(edge, expectedEdge);
              };
              var hasChild = rootNodes.some(function (node) {
                return node.outgoingEdges.some(check);
              }); // Don't use assert with a custom message here. Otherwise the
              // inspection in the message is done eagerly and wastes a lot of CPU
              // time.

              if (!hasChild) {
                throw new Error('expected to find child ' + "".concat(util.inspect(expectedEdge), " in ").concat(inspectNode(rootNodes)));
              }
            };
github nodejs / readable-stream / test / common / index.js View on Github external
function innerFn(error) {
    if (arguments.length !== 1) {
      // Do not use `assert.strictEqual()` to prevent `util.inspect` from
      // always being called.
      assert.fail("Expected one argument, got ".concat(util.inspect(arguments)));
    }

    var descriptor = Object.getOwnPropertyDescriptor(error, 'message'); // The error message should be non-enumerable

    assert.strictEqual(descriptor.enumerable, false);
    var innerSettings = settings;

    if ('type' in settings) {
      var type = settings.type;

      if (type !== Error && !Error.isPrototypeOf(type)) {
        throw new TypeError('`settings.type` must inherit from `Error`');
      }

      var _constructor = error.constructor;
github nodejs / readable-stream / test / common / heap.js View on Github external
var _loop2 = function _loop2() {
              var expectedEdge = _step4.value;
              var check = typeof expectedEdge === 'function' ? expectedEdge : function (edge) {
                return isEdge(edge, expectedEdge);
              }; // Don't use assert with a custom message here. Otherwise the
              // inspection in the message is done eagerly and wastes a lot of CPU
              // time.

              var hasChild = rootNodes.some(function (node) {
                return node.edges.some(check);
              });

              if (!hasChild) {
                throw new Error('expected to find child ' + "".concat(util.inspect(expectedEdge), " in ").concat(inspectNode(rootNodes)));
              }
            };
github nodejs / readable-stream / test / common / index.js View on Github external
process.on('exit', function () {
    // iterate through handles to make sure nothing crashes
    for (var k in initHandles) {
      util.inspect(initHandles[k]);
    }
  });
  var _queueDestroyAsyncId = async_wrap.queueDestroyAsyncId;
github nodejs / string_decoder / test / common / index.js View on Github external
process.on('exit', function () {
    // itterate through handles to make sure nothing crashes
    for (var k in initHandles) {
      util.inspect(initHandles[k]);
    }
  });
github nodejs / readable-stream / test / common / heap.js View on Github external
function inspectNode(snapshot) {
  return util.inspect(snapshot, {
    depth: 4
  });
}