UNPKG

injektor

Version:

The simple dependency injection for Devebot

21 lines (20 loc) 654 B
"use strict"; const debugx = require("./pinbug")("injektor:chores"); function Chores() {} Chores.prototype.cloneObject = function (a) { return Object.assign({}, a); }; Chores.prototype.isArray = function (a) { return a instanceof Array; }; Chores.prototype.isObject = function (a) { return typeof a === "object" && a != null && a instanceof Array == false; }; Chores.prototype.printExceptions = function (a) { a = a || []; a.forEach(function (a, b) { debugx.enabled && debugx("Error#%s", b); debugx.enabled && console.info(" name: %s\n message: '%s'\n stack: %s", a.name, a.message, a.stack); }); }; module.exports = new Chores();