Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)));
}
};
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;
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)));
}
};
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;
process.on('exit', function () {
// itterate through handles to make sure nothing crashes
for (var k in initHandles) {
util.inspect(initHandles[k]);
}
});
function inspectNode(snapshot) {
return util.inspect(snapshot, {
depth: 4
});
}