-
Notifications
You must be signed in to change notification settings - Fork 0
/
itslog.sourcemap.js
1 lines (1 loc) · 13.8 KB
/
itslog.sourcemap.js
1
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///itslog.min.js","webpack:///webpack/bootstrap b22bffb0c567ad7926df","webpack:///./src/index.js","webpack:///./src/constants/index.js","webpack:///./src/util/index.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_constants","_util","env","getEnv","consolePointer","getConsoleObject","wrapper","prefix","METHODS_SIMPLE","forEach","method","prefixItems","getPrefixes","args","convertArgsToArray","arguments","prependItemsToArray","apply","METHODS_COMPLEX","log","Object","defineProperty","value","NAME","STYLES","BROWSER","NODE","ENVS","noop","window","_args","Array","prototype","slice","items","arr","unshift","undefined","console","_typeof","_console","allMethods","concat","Symbol","iterator","obj","constructor"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,OAAAD,IAEAD,EAAA,OAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,SAASL,EAAQD,EAASM,GAE/B,YExDD,IAAAS,GAAAT,EAAA,GAOAU,EAAAV,EAAA,GAQMW,GAAM,EAAAD,EAAAE,UACNC,GAAiB,EAAAH,EAAAI,oBACjBC,IAMNpB,GAAOD,QAAU,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,QAAS9B,KACd,GAAuBgC,UAAnB,mBAAOC,SAAP,YAAAC,EAAOD,UACT,MAAOA,QAGT,IAAME,MACAC,EAAazC,EAAAQ,eAAekC,OAAf1C,EAAAkB,gBAMnB,OAJAuB,GAAWhC,QAAQ,SAACC,GAClB8B,EAAS9B,GAAUkB,IAGdY,EJ8FRpB,OAAOC,eAAepC,EAAS,cAC7BqC,OAAO,GAGT,IAAIiB,GAA4B,kBAAXI,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF,SAAyBE,EAAIC,cAAgBH,OAAS,eAAkBE,GAE1O5D,GI1IekB,SJ2IflB,EInIe2B,cJoIf3B,EI5He6B,qBJ6Hf7B,EIxHe+B,sBJyHf/B,EIpHeoB,kBArChB,IAAAL,GAAAT,EAAA","file":"itslog.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"itslog\"] = factory();\n\telse\n\t\troot[\"itslog\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"itslog\"] = factory();\n\telse\n\t\troot[\"itslog\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _constants = __webpack_require__(1);\n\t\n\tvar _util = __webpack_require__(2);\n\t\n\tvar env = (0, _util.getEnv)();\n\tvar consolePointer = (0, _util.getConsoleObject)();\n\tvar wrapper = {};\n\t\n\t/**\n\t * @param {String} prefix\n\t * @returns {Object} A console wrapper.\n\t */\n\tmodule.exports = function itslog(prefix) {\n\t // Use \"module.exports\" instead of \"export default\" so people who aren't using\n\t // ES6 don't have to use Logger.default. The people who use ES6 will still be\n\t // able to do \"import Logger from 'logger'\".\n\t\n\t // Attach all simple methods to the wrapper object.\n\t _constants.METHODS_SIMPLE.forEach(function (method) {\n\t wrapper[method] = function () {\n\t var prefixItems = (0, _util.getPrefixes)(env, prefix);\n\t var args = (0, _util.convertArgsToArray)(arguments);\n\t args = (0, _util.prependItemsToArray)(prefixItems, args);\n\t\n\t return consolePointer[method].apply(consolePointer, args);\n\t };\n\t });\n\t\n\t // Attach all complex methods to the wrapper object.\n\t _constants.METHODS_COMPLEX.forEach(function (method) {\n\t wrapper[method] = function () {\n\t consolePointer.log.apply(consolePointer, (0, _util.getPrefixes)(env, prefix));\n\t return consolePointer[method](arguments);\n\t };\n\t });\n\t\n\t // Pass down remaining methods to the console object.\n\t for (var method in consolePointer) {\n\t if (!wrapper[method]) {\n\t wrapper[method] = consolePointer[method];\n\t }\n\t }\n\t\n\t return wrapper;\n\t};\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar METHODS_SIMPLE = exports.METHODS_SIMPLE = ['count', 'error', 'info', 'log', 'warn'];\n\t\n\tvar METHODS_COMPLEX = exports.METHODS_COMPLEX = ['assert', 'dir', 'dirxml', 'group', 'groupCollapsed', 'groupEnd', 'table', 'timeEnd', 'trace'];\n\t\n\tvar NAME = exports.NAME = 'logger';\n\t\n\tvar STYLES = exports.STYLES = {\n\t BROWSER: 'font-style: italic;font-weight: bold;',\n\t NODE: '\\u001b[36m%s\\u001b[0m'\n\t};\n\t\n\tvar ENVS = exports.ENVS = {\n\t BROWSER: 'browser',\n\t NODE: 'node'\n\t};\n\t\n\texports.default = {\n\t ENVS: ENVS,\n\t METHODS_COMPLEX: METHODS_COMPLEX,\n\t METHODS_SIMPLE: METHODS_SIMPLE,\n\t NAME: NAME,\n\t STYLES: STYLES\n\t};\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\texports.getEnv = getEnv;\n\texports.getPrefixes = getPrefixes;\n\texports.convertArgsToArray = convertArgsToArray;\n\texports.prependItemsToArray = prependItemsToArray;\n\texports.getConsoleObject = getConsoleObject;\n\t\n\tvar _constants = __webpack_require__(1);\n\t\n\tfunction noop() {\n\t return false;\n\t}\n\t\n\tfunction getEnv() {\n\t if (typeof window !== 'undefined') {\n\t return _constants.ENVS.BROWSER;\n\t }\n\t\n\t return _constants.ENVS.NODE;\n\t}\n\t\n\tfunction getPrefixes(env, prefix) {\n\t if (env === _constants.ENVS.BROWSER) {\n\t return ['%c[' + prefix + ']: ', _constants.STYLES.BROWSER];\n\t }\n\t\n\t return [_constants.STYLES.NODE, '[' + prefix + ']: '];\n\t}\n\t\n\tfunction convertArgsToArray(_args) {\n\t var args = Array.prototype.slice.call(_args);\n\t return args;\n\t}\n\t\n\tfunction prependItemsToArray(items, arr) {\n\t arr.unshift.apply(arr, items);\n\t return arr;\n\t}\n\t\n\tfunction getConsoleObject() {\n\t if ((typeof console === 'undefined' ? 'undefined' : _typeof(console)) !== undefined) {\n\t return console;\n\t }\n\t\n\t var _console = {};\n\t var allMethods = _constants.METHODS_SIMPLE.concat(_constants.METHODS_COMPLEX);\n\t\n\t allMethods.forEach(function (method) {\n\t _console[method] = noop;\n\t });\n\t\n\t return _console;\n\t}\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** itslog.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap b22bffb0c567ad7926df\n **/","import {\n METHODS_COMPLEX,\n METHODS_SIMPLE,\n\tMETHODS_TRANSMIT,\n NAME,\n} from './constants';\n\nimport {\n convertArgsToArray,\n prependItemsToArray,\n getConsoleObject,\n getEnv,\n getPrefixes,\n} from './util';\n\nconst env = getEnv();\nconst consolePointer = getConsoleObject();\nconst wrapper = {};\n\n/**\n * @param {String} prefix\n * @returns {Object} A console wrapper.\n */\nmodule.exports = function itslog(prefix) {\n// Use \"module.exports\" instead of \"export default\" so people who aren't using\n// ES6 don't have to use Logger.default. The people who use ES6 will still be\n// able to do \"import Logger from 'logger'\".\n\n // Attach all simple methods to the wrapper object.\n METHODS_SIMPLE.forEach((method) => {\n wrapper[method] = function() {\n const prefixItems = getPrefixes(env, prefix);\n let args = convertArgsToArray(arguments);\n args = prependItemsToArray(prefixItems, args);\n\n return consolePointer[method].apply(consolePointer, args);\n }\n });\n\n // Attach all complex methods to the wrapper object.\n METHODS_COMPLEX.forEach((method) => {\n wrapper[method] = function() {\n consolePointer.log.apply(consolePointer, getPrefixes(env, prefix));\n return consolePointer[method](arguments);\n }\n });\n\n\t// Pass down remaining methods to the console object.\n for (let method in consolePointer) {\n\t\tif (!wrapper[method]) {\n\t\t\twrapper[method] = consolePointer[method];\n\t\t}\n\t}\n\n return wrapper;\n\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/index.js\n **/","export const METHODS_SIMPLE = [\n 'count',\n 'error',\n 'info',\n 'log',\n 'warn',\n];\n\nexport const METHODS_COMPLEX = [\n 'assert',\n 'dir',\n 'dirxml',\n 'group',\n 'groupCollapsed',\n 'groupEnd',\n 'table',\n\t'timeEnd',\n 'trace',\n];\n\nexport const NAME = 'logger';\n\nexport const STYLES = {\n BROWSER: `font-style: italic;font-weight: bold;`,\n NODE: `\\x1b[36m%s\\x1b[0m`,\n};\n\nexport const ENVS = {\n BROWSER: 'browser',\n NODE: 'node',\n};\n\nexport default {\n ENVS,\n METHODS_COMPLEX,\n METHODS_SIMPLE,\n NAME,\n STYLES,\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/constants/index.js\n **/","import {\n ENVS,\n METHODS_SIMPLE,\n METHODS_COMPLEX,\n STYLES,\n} from '../constants';\n\nfunction noop() {\n return false;\n}\n\nexport function getEnv() {\n if (typeof window !== 'undefined') {\n return ENVS.BROWSER;\n }\n\n return ENVS.NODE;\n}\n\nexport function getPrefixes(env, prefix) {\n if (env === ENVS.BROWSER) {\n return [ `%c[${prefix}]: `, STYLES.BROWSER ];\n }\n\n return [ STYLES.NODE, `[${prefix}]: ` ];\n}\n\nexport function convertArgsToArray(_args) {\n const args = Array.prototype.slice.call(_args);\n return args;\n}\n\nexport function prependItemsToArray(items, arr) {\n arr.unshift.apply(arr, items);\n return arr;\n}\n\nexport function getConsoleObject() {\n if (typeof console !== undefined) {\n return console;\n }\n\n const _console = {};\n const allMethods = METHODS_SIMPLE.concat(METHODS_COMPLEX);\n\n allMethods.forEach((method) => {\n _console[method] = noop;\n });\n\n return _console;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/util/index.js\n **/"],"sourceRoot":""}