UNPKG

opennms

Version:

Client API for the OpenNMS network monitoring platform

1 lines 14 kB
{"remainingRequest":"/data/node_modules/babel-loader/lib/index.js!/data/node_modules/debug/src/debug.js","dependencies":[{"path":"/data/node_modules/debug/src/debug.js","mtime":1553611387072},{"path":"/data/.babelrc","mtime":1553611371556},{"path":"/data/node_modules/cache-loader/dist/cjs.js","mtime":1553611387012},{"path":"/data/node_modules/babel-loader/lib/index.js","mtime":1553611386992}],"contextDependencies":[],"result":["'use strict';\n\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0,\n i;\n\n for (i in namespace) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}",{"version":3,"sources":["node_modules/debug/src/debug.js"],"names":["exports","module","createDebug","debug","coerce","disable","enable","enabled","humanize","require","names","skips","formatters","prevTime","selectColor","namespace","hash","i","charCodeAt","colors","Math","abs","length","self","curr","Date","ms","diff","prev","args","Array","arguments","unshift","index","replace","match","format","formatter","val","call","splice","formatArgs","logFn","log","console","bind","apply","useColors","color","init","namespaces","save","split","len","push","RegExp","substr","name","test","Error","stack","message"],"mappings":";;AACA;;;;;;;AAOAA,UAAUC,OAAOD,OAAP,GAAiBE,YAAYC,KAAZ,GAAoBD,YAAY,SAAZ,IAAyBA,WAAxE;AACAF,QAAQI,MAAR,GAAiBA,MAAjB;AACAJ,QAAQK,OAAR,GAAkBA,OAAlB;AACAL,QAAQM,MAAR,GAAiBA,MAAjB;AACAN,QAAQO,OAAR,GAAkBA,OAAlB;AACAP,QAAQQ,QAAR,GAAmBC,QAAQ,IAAR,CAAnB;;AAEA;;;;AAIAT,QAAQU,KAAR,GAAgB,EAAhB;AACAV,QAAQW,KAAR,GAAgB,EAAhB;;AAEA;;;;;;AAMAX,QAAQY,UAAR,GAAqB,EAArB;;AAEA;;;;AAIA,IAAIC,QAAJ;;AAEA;;;;;;;AAOA,SAASC,WAAT,CAAqBC,SAArB,EAAgC;AAC9B,MAAIC,OAAO,CAAX;AAAA,MAAcC,CAAd;;AAEA,OAAKA,CAAL,IAAUF,SAAV,EAAqB;AACnBC,WAAS,CAACA,QAAQ,CAAT,IAAcA,IAAf,GAAuBD,UAAUG,UAAV,CAAqBD,CAArB,CAA/B;AACAD,YAAQ,CAAR,CAFmB,CAER;AACZ;;AAED,SAAOhB,QAAQmB,MAAR,CAAeC,KAAKC,GAAL,CAASL,IAAT,IAAiBhB,QAAQmB,MAAR,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2C,IAAd,CAAmB,IAAIC,MAAJ,CAAW,MAAML,WAAWM,MAAX,CAAkB,CAAlB,CAAN,GAA6B,GAAxC,CAAnB;AACD,KAFD,MAEO;AACLxD,cAAQU,KAAR,CAAc4C,IAAd,CAAmB,IAAIC,MAAJ,CAAW,MAAML,UAAN,GAAmB,GAA9B,CAAnB;AACD;AACF;AACF;;AAED;;;;;;AAMA,SAAS7C,OAAT,GAAmB;AACjBL,UAAQM,MAAR,CAAe,EAAf;AACD;;AAED;;;;;;;;AAQA,SAASC,OAAT,CAAiBkD,IAAjB,EAAuB;AACrB,MAAIxC,CAAJ,EAAOoC,GAAP;AACA,OAAKpC,IAAI,CAAJ,EAAOoC,MAAMrD,QAAQW,KAAR,CAAcW,MAAhC,EAAwCL,IAAIoC,GAA5C,EAAiDpC,GAAjD,EAAsD;AACpD,QAAIjB,QAAQW,KAAR,CAAcM,CAAd,EAAiByC,IAAjB,CAAsBD,IAAtB,CAAJ,EAAiC;AAC/B,aAAO,KAAP;AACD;AACF;AACD,OAAKxC,IAAI,CAAJ,EAAOoC,MAAMrD,QAAQU,KAAR,CAAcY,MAAhC,EAAwCL,IAAIoC,GAA5C,EAAiDpC,GAAjD,EAAsD;AACpD,QAAIjB,QAAQU,KAAR,CAAcO,CAAd,EAAiByC,IAAjB,CAAsBD,IAAtB,CAAJ,EAAiC;AAC/B,aAAO,IAAP;AACD;AACF;AACD,SAAO,KAAP;AACD;;AAED;;;;;;;;AAQA,SAASrD,MAAT,CAAgBkC,GAAhB,EAAqB;AACnB,MAAIA,eAAeqB,KAAnB,EAA0B,OAAOrB,IAAIsB,KAAJ,IAAatB,IAAIuB,OAAxB;AAC1B,SAAOvB,GAAP;AACD","file":"debug.js","sourceRoot":"/data","sourcesContent":["\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n"]}]}