Файловый менеджер - Редактировать - /home/freeclou/app.optimyar.com/front-web/build/assets/fonts/iran-yekan/MobileFonts/wgdpf7/node_modules.tar
Назад
mime/cli.js 0000775 00000000225 15105574660 0006615 0 ustar 00 #!/usr/bin/env node var mime = require('./mime.js'); var file = process.argv[2]; var type = mime.lookup(file); process.stdout.write(type + '\n'); debug/node_modules/ms/index.js 0000664 00000005314 15105574661 0012412 0 ustar 00 /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { if (ms >= d) { return Math.round(ms / d) + 'd'; } if (ms >= h) { return Math.round(ms / h) + 'h'; } if (ms >= m) { return Math.round(ms / m) + 'm'; } if (ms >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, n, name) { if (ms < n) { return; } if (ms < n * 1.5) { return Math.floor(ms / n) + ' ' + name; } return Math.ceil(ms / n) + ' ' + name + 's'; } debug/node_modules/ms/license.md 0000664 00000002065 15105574661 0012711 0 ustar 00 The MIT License (MIT) Copyright (c) 2016 Zeit, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debug/node_modules/ms/package.json 0000664 00000003005 15105574661 0013226 0 ustar 00 { "_args": [ [ "ms@2.0.0", "/home/freeclou/app.optimyar.com/backend" ] ], "_from": "ms@2.0.0", "_id": "ms@2.0.0", "_inBundle": false, "_integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "_location": "/send/debug/ms", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, "raw": "ms@2.0.0", "name": "ms", "escapedName": "ms", "rawSpec": "2.0.0", "saveSpec": null, "fetchSpec": "2.0.0" }, "_requiredBy": [ "/send/debug" ], "_resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "_spec": "2.0.0", "_where": "/home/freeclou/app.optimyar.com/backend", "bugs": { "url": "https://github.com/zeit/ms/issues" }, "description": "Tiny milisecond conversion utility", "devDependencies": { "eslint": "3.19.0", "expect.js": "0.3.1", "husky": "0.13.3", "lint-staged": "3.4.1", "mocha": "3.4.1" }, "eslintConfig": { "extends": "eslint:recommended", "env": { "node": true, "es6": true } }, "files": [ "index.js" ], "homepage": "https://github.com/zeit/ms#readme", "license": "MIT", "lint-staged": { "*.js": [ "npm run lint", "prettier --single-quote --write", "git add" ] }, "main": "./index", "name": "ms", "repository": { "type": "git", "url": "git+https://github.com/zeit/ms.git" }, "scripts": { "lint": "eslint lib/* bin/*", "precommit": "lint-staged", "test": "mocha tests.js" }, "version": "2.0.0" } debug/node_modules/ms/readme.md 0000664 00000003271 15105574661 0012524 0 ustar 00 # ms [](https://travis-ci.org/zeit/ms) [](https://zeit.chat/) Use this package to easily convert various time formats to milliseconds. ## Examples ```js ms('2 days') // 172800000 ms('1d') // 86400000 ms('10h') // 36000000 ms('2.5 hrs') // 9000000 ms('2h') // 7200000 ms('1m') // 60000 ms('5s') // 5000 ms('1y') // 31557600000 ms('100') // 100 ``` ### Convert from milliseconds ```js ms(60000) // "1m" ms(2 * 60000) // "2m" ms(ms('10 hours')) // "10h" ``` ### Time format written-out ```js ms(60000, { long: true }) // "1 minute" ms(2 * 60000, { long: true }) // "2 minutes" ms(ms('10 hours'), { long: true }) // "10 hours" ``` ## Features - Works both in [node](https://nodejs.org) and in the browser. - If a number is supplied to `ms`, a string with a unit is returned. - If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`). - If you pass a string with a number and a valid unit, the number of equivalent ms is returned. ## Caught a bug? 1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device 2. Link the package to the global module directory: `npm link` 3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms! As always, you can run the tests using: `npm test` debug/src/browser.js 0000664 00000011176 15105574661 0010464 0 ustar 00 /** * This is the web browser implementation of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = require('./debug'); exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage(); /** * Colors. */ exports.colors = [ 'lightseagreen', 'forestgreen', 'goldenrod', 'dodgerblue', 'darkorchid', 'crimson' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { return true; } // is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ exports.formatters.j = function(v) { try { return JSON.stringify(v); } catch (err) { return '[UnexpectedJSONParseError]: ' + err.message; } }; /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { var useColors = this.useColors; args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff); if (!useColors) return; var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit') // the final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function(match) { if ('%%' === match) return; index++; if ('%c' === match) { // we only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log() { // this hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (null == namespaces) { exports.storage.removeItem('debug'); } else { exports.storage.debug = namespaces; } } catch(e) {} } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.debug; } catch(e) {} // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Enable namespaces listed in `localStorage.debug` initially. */ exports.enable(load()); /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { return window.localStorage; } catch (e) {} } debug/src/debug.js 0000664 00000010452 15105574661 0010063 0 ustar 00 /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; exports.humanize = require('ms'); /** * The currently active debug mode names, and names to skip. */ exports.names = []; exports.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ exports.formatters = {}; /** * Previous log timestamp. */ var prevTime; /** * Select a color. * @param {String} namespace * @return {Number} * @api private */ function selectColor(namespace) { var hash = 0, i; for (i in namespace) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return exports.colors[Math.abs(hash) % exports.colors.length]; } /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { function debug() { // disabled? if (!debug.enabled) return; var self = debug; // set `diff` timestamp var curr = +new Date(); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; // turn the `arguments` into a proper Array var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } args[0] = exports.coerce(args[0]); if ('string' !== typeof args[0]) { // anything else let's inspect with %O args.unshift('%O'); } // apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { // if we encounter an escaped % then don't increase the array index if (match === '%%') return match; index++; var formatter = exports.formatters[format]; if ('function' === typeof formatter) { var val = args[index]; match = formatter.call(self, val); // now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // apply env-specific formatting (colors, etc.) exports.formatArgs.call(self, args); var logFn = debug.log || exports.log || console.log.bind(console); logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = exports.enabled(namespace); debug.useColors = exports.useColors(); debug.color = selectColor(namespace); // env-specific initialization logic for debug instances if ('function' === typeof exports.init) { exports.init(debug); } return debug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { exports.save(namespaces); exports.names = []; exports.skips = []; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (var i = 0; i < len; i++) { if (!split[i]) continue; // ignore empty strings namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { exports.names.push(new RegExp('^' + namespaces + '$')); } } } /** * Disable debug output. * * @api public */ function disable() { exports.enable(''); } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { var i, len; for (i = 0, len = exports.skips.length; i < len; i++) { if (exports.skips[i].test(name)) { return false; } } for (i = 0, len = exports.names.length; i < len; i++) { if (exports.names[i].test(name)) { return true; } } return false; } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) return val.stack || val.message; return val; } debug/src/index.js 0000664 00000000407 15105574661 0010103 0 ustar 00 /** * Detect Electron renderer process, which is node, but we should * treat as a browser. */ if (typeof process !== 'undefined' && process.type === 'renderer') { module.exports = require('./browser.js'); } else { module.exports = require('./node.js'); } debug/src/inspector-log.js 0000664 00000000565 15105574661 0011566 0 ustar 00 module.exports = inspectorLog; // black hole const nullStream = new (require('stream').Writable)(); nullStream._write = () => {}; /** * Outputs a `console.log()` to the Node.js Inspector console *only*. */ function inspectorLog() { const stdout = console._stdout; console._stdout = nullStream; console.log.apply(console, arguments); console._stdout = stdout; } debug/src/node.js 0000664 00000013577 15105574661 0007735 0 ustar 00 /** * Module dependencies. */ var tty = require('tty'); var util = require('util'); /** * This is the Node.js implementation of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = require('./debug'); exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(function (key) { return /^debug_/i.test(key); }).reduce(function (obj, key) { // camel-case var prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); // coerce string value into JS value var val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) val = true; else if (/^(no|off|false|disabled)$/i.test(val)) val = false; else if (val === 'null') val = null; else val = Number(val); obj[prop] = val; return obj; }, {}); /** * The file descriptor to write the `debug()` calls to. * Set the `DEBUG_FD` env variable to override with another value. i.e.: * * $ DEBUG_FD=3 node script.js 3>debug.log */ var fd = parseInt(process.env.DEBUG_FD, 10) || 2; if (1 !== fd && 2 !== fd) { util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')() } var stream = 1 === fd ? process.stdout : 2 === fd ? process.stderr : createWritableStdioStream(fd); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(fd); } /** * Map %o to `util.inspect()`, all on a single line. */ exports.formatters.o = function(v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .split('\n').map(function(str) { return str.trim() }).join(' '); }; /** * Map %o to `util.inspect()`, allowing multiple lines if needed. */ exports.formatters.O = function(v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { var name = this.namespace; var useColors = this.useColors; if (useColors) { var c = this.color; var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); } else { args[0] = new Date().toUTCString() + ' ' + name + ' ' + args[0]; } } /** * Invokes `util.format()` with the specified arguments and writes to `stream`. */ function log() { return stream.write(util.format.apply(util, arguments) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (null == namespaces) { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } else { process.env.DEBUG = namespaces; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Copied from `node/src/node.js`. * * XXX: It's lame that node doesn't expose this API out-of-the-box. It also * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. */ function createWritableStdioStream (fd) { var stream; var tty_wrap = process.binding('tty_wrap'); // Note stream._type is used for test-module-load-list.js switch (tty_wrap.guessHandleType(fd)) { case 'TTY': stream = new tty.WriteStream(fd); stream._type = 'tty'; // Hack to have stream not keep the event loop alive. // See https://github.com/joyent/node/issues/1726 if (stream._handle && stream._handle.unref) { stream._handle.unref(); } break; case 'FILE': var fs = require('fs'); stream = new fs.SyncWriteStream(fd, { autoClose: false }); stream._type = 'fs'; break; case 'PIPE': case 'TCP': var net = require('net'); stream = new net.Socket({ fd: fd, readable: false, writable: true }); // FIXME Should probably have an option in net.Socket to create a // stream from an existing fd which is writable only. But for now // we'll just add this hack and set the `readable` member to false. // Test: ./node test/fixtures/echo.js < /etc/passwd stream.readable = false; stream.read = null; stream._type = 'pipe'; // FIXME Hack to have stream not keep the event loop alive. // See https://github.com/joyent/node/issues/1726 if (stream._handle && stream._handle.unref) { stream._handle.unref(); } break; default: // Probably an error on in uv_guess_handle() throw new Error('Implement me. Unknown stream file type!'); } // For supporting legacy API we put the FD here. stream.fd = fd; stream._isStdio = true; return stream; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init (debug) { debug.inspectOpts = {}; var keys = Object.keys(exports.inspectOpts); for (var i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } /** * Enable namespaces listed in `process.env.DEBUG` initially. */ exports.enable(load()); debug/.coveralls.yml 0000664 00000000056 15105574661 0010442 0 ustar 00 repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve debug/.eslintrc 0000664 00000000264 15105574661 0007474 0 ustar 00 { "env": { "browser": true, "node": true }, "rules": { "no-console": 0, "no-empty": [1, { "allowEmptyCatch": true }] }, "extends": "eslint:recommended" } debug/.npmignore 0000664 00000000110 15105574661 0007635 0 ustar 00 support test examples example *.sock dist yarn.lock coverage bower.json debug/.travis.yml 0000664 00000000214 15105574661 0007754 0 ustar 00 language: node_js node_js: - "6" - "5" - "4" install: - make node_modules script: - make lint - make test - make coveralls debug/CHANGELOG.md 0000664 00000026673 15105574661 0007475 0 ustar 00 2.6.9 / 2017-09-22 ================== * remove ReDoS regexp in %o formatter (#504) 2.6.8 / 2017-05-18 ================== * Fix: Check for undefined on browser globals (#462, @marbemac) 2.6.7 / 2017-05-16 ================== * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) * Fix: Inline extend function in node implementation (#452, @dougwilson) * Docs: Fix typo (#455, @msasad) 2.6.5 / 2017-04-27 ================== * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) * Misc: clean up browser reference checks (#447, @thebigredgeek) * Misc: add npm-debug.log to .gitignore (@thebigredgeek) 2.6.4 / 2017-04-20 ================== * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) * Chore: ignore bower.json in npm installations. (#437, @joaovieira) * Misc: update "ms" to v0.7.3 (@tootallnate) 2.6.3 / 2017-03-13 ================== * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) * Docs: Changelog fix (@thebigredgeek) 2.6.2 / 2017-03-10 ================== * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) * Docs: Add Slackin invite badge (@tootallnate) 2.6.1 / 2017-02-10 ================== * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) * Fix: IE8 "Expected identifier" error (#414, @vgoma) * Fix: Namespaces would not disable once enabled (#409, @musikov) 2.6.0 / 2016-12-28 ================== * Fix: added better null pointer checks for browser useColors (@thebigredgeek) * Improvement: removed explicit `window.debug` export (#404, @tootallnate) * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) 2.5.2 / 2016-12-25 ================== * Fix: reference error on window within webworkers (#393, @KlausTrainer) * Docs: fixed README typo (#391, @lurch) * Docs: added notice about v3 api discussion (@thebigredgeek) 2.5.1 / 2016-12-20 ================== * Fix: babel-core compatibility 2.5.0 / 2016-12-20 ================== * Fix: wrong reference in bower file (@thebigredgeek) * Fix: webworker compatibility (@thebigredgeek) * Fix: output formatting issue (#388, @kribblo) * Fix: babel-loader compatibility (#383, @escwald) * Misc: removed built asset from repo and publications (@thebigredgeek) * Misc: moved source files to /src (#378, @yamikuronue) * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) * Test: coveralls integration (#378, @yamikuronue) * Docs: simplified language in the opening paragraph (#373, @yamikuronue) 2.4.5 / 2016-12-17 ================== * Fix: `navigator` undefined in Rhino (#376, @jochenberger) * Fix: custom log function (#379, @hsiliev) * Improvement: bit of cleanup + linting fixes (@thebigredgeek) * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) 2.4.4 / 2016-12-14 ================== * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) 2.4.3 / 2016-12-14 ================== * Fix: navigation.userAgent error for react native (#364, @escwald) 2.4.2 / 2016-12-14 ================== * Fix: browser colors (#367, @tootallnate) * Misc: travis ci integration (@thebigredgeek) * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) 2.4.1 / 2016-12-13 ================== * Fix: typo that broke the package (#356) 2.4.0 / 2016-12-13 ================== * Fix: bower.json references unbuilt src entry point (#342, @justmatt) * Fix: revert "handle regex special characters" (@tootallnate) * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) * Improvement: allow colors in workers (#335, @botverse) * Improvement: use same color for same namespace. (#338, @lchenay) 2.3.3 / 2016-11-09 ================== * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) * Fix: Returning `localStorage` saved values (#331, Levi Thomason) * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) 2.3.2 / 2016-11-09 ================== * Fix: be super-safe in index.js as well (@TooTallNate) * Fix: should check whether process exists (Tom Newby) 2.3.1 / 2016-11-09 ================== * Fix: Added electron compatibility (#324, @paulcbetts) * Improvement: Added performance optimizations (@tootallnate) * Readme: Corrected PowerShell environment variable example (#252, @gimre) * Misc: Removed yarn lock file from source control (#321, @fengmk2) 2.3.0 / 2016-11-07 ================== * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) * Package: Update "ms" to 0.7.2 (#315, @DevSide) * Package: removed superfluous version property from bower.json (#207 @kkirsche) * Readme: fix USE_COLORS to DEBUG_COLORS * Readme: Doc fixes for format string sugar (#269, @mlucool) * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) * Readme: better docs for browser support (#224, @matthewmueller) * Tooling: Added yarn integration for development (#317, @thebigredgeek) * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) * Misc: Updated contributors (@thebigredgeek) 2.2.0 / 2015-05-09 ================== * package: update "ms" to v0.7.1 (#202, @dougwilson) * README: add logging to file example (#193, @DanielOchoa) * README: fixed a typo (#191, @amir-s) * browser: expose `storage` (#190, @stephenmathieson) * Makefile: add a `distclean` target (#189, @stephenmathieson) 2.1.3 / 2015-03-13 ================== * Updated stdout/stderr example (#186) * Updated example/stdout.js to match debug current behaviour * Renamed example/stderr.js to stdout.js * Update Readme.md (#184) * replace high intensity foreground color for bold (#182, #183) 2.1.2 / 2015-03-01 ================== * dist: recompile * update "ms" to v0.7.0 * package: update "browserify" to v9.0.3 * component: fix "ms.js" repo location * changed bower package name * updated documentation about using debug in a browser * fix: security error on safari (#167, #168, @yields) 2.1.1 / 2014-12-29 ================== * browser: use `typeof` to check for `console` existence * browser: check for `console.log` truthiness (fix IE 8/9) * browser: add support for Chrome apps * Readme: added Windows usage remarks * Add `bower.json` to properly support bower install 2.1.0 / 2014-10-15 ================== * node: implement `DEBUG_FD` env variable support * package: update "browserify" to v6.1.0 * package: add "license" field to package.json (#135, @panuhorsmalahti) 2.0.0 / 2014-09-01 ================== * package: update "browserify" to v5.11.0 * node: use stderr rather than stdout for logging (#29, @stephenmathieson) 1.0.4 / 2014-07-15 ================== * dist: recompile * example: remove `console.info()` log usage * example: add "Content-Type" UTF-8 header to browser example * browser: place %c marker after the space character * browser: reset the "content" color via `color: inherit` * browser: add colors support for Firefox >= v31 * debug: prefer an instance `log()` function over the global one (#119) * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) 1.0.3 / 2014-07-09 ================== * Add support for multiple wildcards in namespaces (#122, @seegno) * browser: fix lint 1.0.2 / 2014-06-10 ================== * browser: update color palette (#113, @gscottolson) * common: make console logging function configurable (#108, @timoxley) * node: fix %o colors on old node <= 0.8.x * Makefile: find node path using shell/which (#109, @timoxley) 1.0.1 / 2014-06-06 ================== * browser: use `removeItem()` to clear localStorage * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) * package: add "contributors" section * node: fix comment typo * README: list authors 1.0.0 / 2014-06-04 ================== * make ms diff be global, not be scope * debug: ignore empty strings in enable() * node: make DEBUG_COLORS able to disable coloring * *: export the `colors` array * npmignore: don't publish the `dist` dir * Makefile: refactor to use browserify * package: add "browserify" as a dev dependency * Readme: add Web Inspector Colors section * node: reset terminal color for the debug content * node: map "%o" to `util.inspect()` * browser: map "%j" to `JSON.stringify()` * debug: add custom "formatters" * debug: use "ms" module for humanizing the diff * Readme: add "bash" syntax highlighting * browser: add Firebug color support * browser: add colors for WebKit browsers * node: apply log to `console` * rewrite: abstract common logic for Node & browsers * add .jshintrc file 0.8.1 / 2014-04-14 ================== * package: re-add the "component" section 0.8.0 / 2014-03-30 ================== * add `enable()` method for nodejs. Closes #27 * change from stderr to stdout * remove unnecessary index.js file 0.7.4 / 2013-11-13 ================== * remove "browserify" key from package.json (fixes something in browserify) 0.7.3 / 2013-10-30 ================== * fix: catch localStorage security error when cookies are blocked (Chrome) * add debug(err) support. Closes #46 * add .browser prop to package.json. Closes #42 0.7.2 / 2013-02-06 ================== * fix package.json * fix: Mobile Safari (private mode) is broken with debug * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript 0.7.1 / 2013-02-05 ================== * add repository URL to package.json * add DEBUG_COLORED to force colored output * add browserify support * fix component. Closes #24 0.7.0 / 2012-05-04 ================== * Added .component to package.json * Added debug.component.js build 0.6.0 / 2012-03-16 ================== * Added support for "-" prefix in DEBUG [Vinay Pulim] * Added `.enabled` flag to the node version [TooTallNate] 0.5.0 / 2012-02-02 ================== * Added: humanize diffs. Closes #8 * Added `debug.disable()` to the CS variant * Removed padding. Closes #10 * Fixed: persist client-side variant again. Closes #9 0.4.0 / 2012-02-01 ================== * Added browser variant support for older browsers [TooTallNate] * Added `debug.enable('project:*')` to browser variant [TooTallNate] * Added padding to diff (moved it to the right) 0.3.0 / 2012-01-26 ================== * Added millisecond diff when isatty, otherwise UTC string 0.2.0 / 2012-01-22 ================== * Added wildcard support 0.1.0 / 2011-12-02 ================== * Added: remove colors unless stderr isatty [TooTallNate] 0.0.1 / 2010-01-03 ================== * Initial release debug/LICENSE 0000664 00000002123 15105574661 0006651 0 ustar 00 (The MIT License) Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debug/Makefile 0000664 00000002043 15105574661 0007305 0 ustar 00 # get Makefile directory name: http://stackoverflow.com/a/5982798/376773 THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) # BIN directory BIN := $(THIS_DIR)/node_modules/.bin # Path PATH := node_modules/.bin:$(PATH) SHELL := /bin/bash # applications NODE ?= $(shell which node) YARN ?= $(shell which yarn) PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) BROWSERIFY ?= $(NODE) $(BIN)/browserify .FORCE: install: node_modules node_modules: package.json @NODE_ENV= $(PKG) install @touch node_modules lint: .FORCE eslint browser.js debug.js index.js node.js test-node: .FORCE istanbul cover node_modules/mocha/bin/_mocha -- test/**.js test-browser: .FORCE mkdir -p dist @$(BROWSERIFY) \ --standalone debug \ . > dist/debug.js karma start --single-run rimraf dist test: .FORCE concurrently \ "make test-node" \ "make test-browser" coveralls: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js .PHONY: all install clean distclean debug/README.md 0000664 00000042776 15105574661 0007145 0 ustar 00 # debug [](https://travis-ci.org/visionmedia/debug) [](https://coveralls.io/github/visionmedia/debug?branch=master) [](https://visionmedia-community-slackin.now.sh/) [](#backers) [](#sponsors) A tiny node.js debugging utility modelled after node core's debugging technique. **Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)** ## Installation ```bash $ npm install debug ``` ## Usage `debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. Example _app.js_: ```js var debug = require('debug')('http') , http = require('http') , name = 'My App'; // fake app debug('booting %s', name); http.createServer(function(req, res){ debug(req.method + ' ' + req.url); res.end('hello\n'); }).listen(3000, function(){ debug('listening'); }); // fake worker of some kind require('./worker'); ``` Example _worker.js_: ```js var debug = require('debug')('worker'); setInterval(function(){ debug('doing some work'); }, 1000); ``` The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:   #### Windows note On Windows the environment variable is set using the `set` command. ```cmd set DEBUG=*,-not_this ``` Note that PowerShell uses different syntax to set environment variables. ```cmd $env:DEBUG = "*,-not_this" ``` Then, run the program to be debugged as usual. ## Millisecond diff When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.  When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:  ## Conventions If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". ## Wildcards The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". ## Environment Variables When running through Node.js, you can set a few environment variables that will change the behavior of the debug logging: | Name | Purpose | |-----------|-------------------------------------------------| | `DEBUG` | Enables/disables specific debugging namespaces. | | `DEBUG_COLORS`| Whether or not to use colors in the debug output. | | `DEBUG_DEPTH` | Object inspection depth. | | `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | __Note:__ The environment variables beginning with `DEBUG_` end up being converted into an Options object that gets used with `%o`/`%O` formatters. See the Node.js documentation for [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) for the complete list. ## Formatters Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: | Formatter | Representation | |-----------|----------------| | `%O` | Pretty-print an Object on multiple lines. | | `%o` | Pretty-print an Object all on a single line. | | `%s` | String. | | `%d` | Number (both integer and float). | | `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | | `%%` | Single percent sign ('%'). This does not consume an argument. | ### Custom formatters You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: ```js const createDebug = require('debug') createDebug.formatters.h = (v) => { return v.toString('hex') } // …elsewhere const debug = createDebug('foo') debug('this is hex: %h', new Buffer('hello world')) // foo this is hex: 68656c6c6f20776f726c6421 +0ms ``` ## Browser support You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), if you don't want to build it yourself. Debug's enable state is currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. You can enable this using `localStorage.debug`: ```js localStorage.debug = 'worker:*' ``` And then refresh the page. ```js a = debug('worker:a'); b = debug('worker:b'); setInterval(function(){ a('doing some work'); }, 1000); setInterval(function(){ b('doing some work'); }, 1200); ``` #### Web Inspector Colors Colors are also enabled on "Web Inspectors" that understand the `%c` formatting option. These are WebKit web inspectors, Firefox ([since version 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) and the Firebug plugin for Firefox (any version). Colored output looks something like:  ## Output streams By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: Example _stdout.js_: ```js var debug = require('debug'); var error = debug('app:error'); // by default stderr is used error('goes to stderr!'); var log = debug('app:log'); // set this namespace to log via console.log log.log = console.log.bind(console); // don't forget to bind to console! log('goes to stdout'); error('still goes to stderr!'); // set all output to go via console.info // overrides all per-namespace log settings debug.log = console.info.bind(console); error('now goes to stdout via console.info'); log('still goes to stdout, but via console.info now'); ``` ## Authors - TJ Holowaychuk - Nathan Rajlich - Andrew Rhyne ## Backers Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] <a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a> ## Sponsors Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] <a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a> ## License (The MIT License) Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debug/component.json 0000664 00000000501 15105574661 0010537 0 ustar 00 { "name": "debug", "repo": "visionmedia/debug", "description": "small debugging utility", "version": "2.6.9", "keywords": [ "debug", "log", "debugger" ], "main": "src/browser.js", "scripts": [ "src/browser.js", "src/debug.js" ], "dependencies": { "rauchg/ms.js": "0.7.1" } } debug/karma.conf.js 0000664 00000003310 15105574661 0010220 0 ustar 00 // Karma configuration // Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) module.exports = function(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['mocha', 'chai', 'sinon'], // list of files / patterns to load in the browser files: [ 'dist/debug.js', 'test/*spec.js' ], // list of files to exclude exclude: [ 'src/node.js' ], // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { }, // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter reporters: ['progress'], // web server port port: 9876, // enable / disable colors in the output (reporters and logs) colors: true, // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes autoWatch: true, // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher browsers: ['PhantomJS'], // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits singleRun: false, // Concurrency level // how many browser should be started simultaneous concurrency: Infinity }) } debug/node.js 0000664 00000000050 15105574661 0007124 0 ustar 00 module.exports = require('./src/node'); debug/package.json 0000664 00000004123 15105574661 0010134 0 ustar 00 { "_args": [ [ "debug@2.6.9", "/home/freeclou/app.optimyar.com/backend" ] ], "_from": "debug@2.6.9", "_id": "debug@2.6.9", "_inBundle": false, "_integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "_location": "/send/debug", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, "raw": "debug@2.6.9", "name": "debug", "escapedName": "debug", "rawSpec": "2.6.9", "saveSpec": null, "fetchSpec": "2.6.9" }, "_requiredBy": [ "/send" ], "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "_spec": "2.6.9", "_where": "/home/freeclou/app.optimyar.com/backend", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" }, "browser": "./src/browser.js", "bugs": { "url": "https://github.com/visionmedia/debug/issues" }, "component": { "scripts": { "debug/index.js": "browser.js", "debug/debug.js": "debug.js" } }, "contributors": [ { "name": "Nathan Rajlich", "email": "nathan@tootallnate.net", "url": "http://n8.io" }, { "name": "Andrew Rhyne", "email": "rhyneandrew@gmail.com" } ], "dependencies": { "ms": "2.0.0" }, "description": "small debugging utility", "devDependencies": { "browserify": "9.0.3", "chai": "^3.5.0", "concurrently": "^3.1.0", "coveralls": "^2.11.15", "eslint": "^3.12.1", "istanbul": "^0.4.5", "karma": "^1.3.0", "karma-chai": "^0.1.0", "karma-mocha": "^1.3.0", "karma-phantomjs-launcher": "^1.0.2", "karma-sinon": "^1.0.5", "mocha": "^3.2.0", "mocha-lcov-reporter": "^1.2.0", "rimraf": "^2.5.4", "sinon": "^1.17.6", "sinon-chai": "^2.8.0" }, "homepage": "https://github.com/visionmedia/debug#readme", "keywords": [ "debug", "log", "debugger" ], "license": "MIT", "main": "./src/index.js", "name": "debug", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" }, "version": "2.6.9" } depd/lib/browser/index.js 0000664 00000002750 15105574661 0011376 0 ustar 00 /*! * depd * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict' /** * Module exports. * @public */ module.exports = depd /** * Create deprecate for namespace in caller. */ function depd (namespace) { if (!namespace) { throw new TypeError('argument namespace is required') } function deprecate (message) { // no-op in browser } deprecate._file = undefined deprecate._ignored = true deprecate._namespace = namespace deprecate._traced = false deprecate._warned = Object.create(null) deprecate.function = wrapfunction deprecate.property = wrapproperty return deprecate } /** * Return a wrapped function in a deprecation message. * * This is a no-op version of the wrapper, which does nothing but call * validation. */ function wrapfunction (fn, message) { if (typeof fn !== 'function') { throw new TypeError('argument fn must be a function') } return fn } /** * Wrap property in a deprecation message. * * This is a no-op version of the wrapper, which does nothing but call * validation. */ function wrapproperty (obj, prop, message) { if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { throw new TypeError('argument obj must be object') } var descriptor = Object.getOwnPropertyDescriptor(obj, prop) if (!descriptor) { throw new TypeError('must call property on owner object') } if (!descriptor.configurable) { throw new TypeError('property must be configurable') } } depd/lib/compat/callsite-tostring.js 0000664 00000004265 15105574661 0013541 0 ustar 00 /*! * depd * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ 'use strict' /** * Module exports. */ module.exports = callSiteToString /** * Format a CallSite file location to a string. */ function callSiteFileLocation (callSite) { var fileName var fileLocation = '' if (callSite.isNative()) { fileLocation = 'native' } else if (callSite.isEval()) { fileName = callSite.getScriptNameOrSourceURL() if (!fileName) { fileLocation = callSite.getEvalOrigin() } } else { fileName = callSite.getFileName() } if (fileName) { fileLocation += fileName var lineNumber = callSite.getLineNumber() if (lineNumber != null) { fileLocation += ':' + lineNumber var columnNumber = callSite.getColumnNumber() if (columnNumber) { fileLocation += ':' + columnNumber } } } return fileLocation || 'unknown source' } /** * Format a CallSite to a string. */ function callSiteToString (callSite) { var addSuffix = true var fileLocation = callSiteFileLocation(callSite) var functionName = callSite.getFunctionName() var isConstructor = callSite.isConstructor() var isMethodCall = !(callSite.isToplevel() || isConstructor) var line = '' if (isMethodCall) { var methodName = callSite.getMethodName() var typeName = getConstructorName(callSite) if (functionName) { if (typeName && functionName.indexOf(typeName) !== 0) { line += typeName + '.' } line += functionName if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) { line += ' [as ' + methodName + ']' } } else { line += typeName + '.' + (methodName || '<anonymous>') } } else if (isConstructor) { line += 'new ' + (functionName || '<anonymous>') } else if (functionName) { line += functionName } else { addSuffix = false line += fileLocation } if (addSuffix) { line += ' (' + fileLocation + ')' } return line } /** * Get constructor name of reviver. */ function getConstructorName (obj) { var receiver = obj.receiver return (receiver.constructor && receiver.constructor.name) || null } depd/lib/compat/event-listener-count.js 0000664 00000000522 15105574661 0014154 0 ustar 00 /*! * depd * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict' /** * Module exports. * @public */ module.exports = eventListenerCount /** * Get the count of listeners on an event emitter of a specific type. */ function eventListenerCount (emitter, type) { return emitter.listeners(type).length } depd/lib/compat/index.js 0000664 00000002615 15105574661 0011176 0 ustar 00 /*! * depd * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict' /** * Module dependencies. * @private */ var EventEmitter = require('events').EventEmitter /** * Module exports. * @public */ lazyProperty(module.exports, 'callSiteToString', function callSiteToString () { var limit = Error.stackTraceLimit var obj = {} var prep = Error.prepareStackTrace function prepareObjectStackTrace (obj, stack) { return stack } Error.prepareStackTrace = prepareObjectStackTrace Error.stackTraceLimit = 2 // capture the stack Error.captureStackTrace(obj) // slice the stack var stack = obj.stack.slice() Error.prepareStackTrace = prep Error.stackTraceLimit = limit return stack[0].toString ? toString : require('./callsite-tostring') }) lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount () { return EventEmitter.listenerCount || require('./event-listener-count') }) /** * Define a lazy property. */ function lazyProperty (obj, prop, getter) { function get () { var val = getter() Object.defineProperty(obj, prop, { configurable: true, enumerable: true, value: val }) return val } Object.defineProperty(obj, prop, { configurable: true, enumerable: true, get: get }) } /** * Call toString() on the obj */ function toString (obj) { return obj.toString() } depd/History.md 0000664 00000004014 15105574661 0007456 0 ustar 00 1.1.2 / 2018-01-11 ================== * perf: remove argument reassignment * Support Node.js 0.6 to 9.x 1.1.1 / 2017-07-27 ================== * Remove unnecessary `Buffer` loading * Support Node.js 0.6 to 8.x 1.1.0 / 2015-09-14 ================== * Enable strict mode in more places * Support io.js 3.x * Support io.js 2.x * Support web browser loading - Requires bundler like Browserify or webpack 1.0.1 / 2015-04-07 ================== * Fix `TypeError`s when under `'use strict'` code * Fix useless type name on auto-generated messages * Support io.js 1.x * Support Node.js 0.12 1.0.0 / 2014-09-17 ================== * No changes 0.4.5 / 2014-09-09 ================== * Improve call speed to functions using the function wrapper * Support Node.js 0.6 0.4.4 / 2014-07-27 ================== * Work-around v8 generating empty stack traces 0.4.3 / 2014-07-26 ================== * Fix exception when global `Error.stackTraceLimit` is too low 0.4.2 / 2014-07-19 ================== * Correct call site for wrapped functions and properties 0.4.1 / 2014-07-19 ================== * Improve automatic message generation for function properties 0.4.0 / 2014-07-19 ================== * Add `TRACE_DEPRECATION` environment variable * Remove non-standard grey color from color output * Support `--no-deprecation` argument * Support `--trace-deprecation` argument * Support `deprecate.property(fn, prop, message)` 0.3.0 / 2014-06-16 ================== * Add `NO_DEPRECATION` environment variable 0.2.0 / 2014-06-15 ================== * Add `deprecate.property(obj, prop, message)` * Remove `supports-color` dependency for node.js 0.8 0.1.0 / 2014-06-15 ================== * Add `deprecate.function(fn, message)` * Add `process.on('deprecation', fn)` emitter * Automatically generate message when omitted from `deprecate()` 0.0.1 / 2014-06-15 ================== * Fix warning for dynamic calls at singe call site 0.0.0 / 2014-06-15 ================== * Initial implementation depd/LICENSE 0000664 00000002106 15105574661 0006500 0 ustar 00 (The MIT License) Copyright (c) 2014-2017 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. depd/Readme.md 0000664 00000023451 15105574661 0007220 0 ustar 00 # depd [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![Node.js Version][node-image]][node-url] [![Linux Build][travis-image]][travis-url] [![Windows Build][appveyor-image]][appveyor-url] [![Coverage Status][coveralls-image]][coveralls-url] Deprecate all the things > With great modules comes great responsibility; mark things deprecated! ## Install This module is installed directly using `npm`: ```sh $ npm install depd ``` This module can also be bundled with systems like [Browserify](http://browserify.org/) or [webpack](https://webpack.github.io/), though by default this module will alter it's API to no longer display or track deprecations. ## API <!-- eslint-disable no-unused-vars --> ```js var deprecate = require('depd')('my-module') ``` This library allows you to display deprecation messages to your users. This library goes above and beyond with deprecation warnings by introspection of the call stack (but only the bits that it is interested in). Instead of just warning on the first invocation of a deprecated function and never again, this module will warn on the first invocation of a deprecated function per unique call site, making it ideal to alert users of all deprecated uses across the code base, rather than just whatever happens to execute first. The deprecation warnings from this module also include the file and line information for the call into the module that the deprecated function was in. **NOTE** this library has a similar interface to the `debug` module, and this module uses the calling file to get the boundary for the call stacks, so you should always create a new `deprecate` object in each file and not within some central file. ### depd(namespace) Create a new deprecate function that uses the given namespace name in the messages and will display the call site prior to the stack entering the file this function was called from. It is highly suggested you use the name of your module as the namespace. ### deprecate(message) Call this function from deprecated code to display a deprecation message. This message will appear once per unique caller site. Caller site is the first call site in the stack in a different file from the caller of this function. If the message is omitted, a message is generated for you based on the site of the `deprecate()` call and will display the name of the function called, similar to the name displayed in a stack trace. ### deprecate.function(fn, message) Call this function to wrap a given function in a deprecation message on any call to the function. An optional message can be supplied to provide a custom message. ### deprecate.property(obj, prop, message) Call this function to wrap a given property on object in a deprecation message on any accessing or setting of the property. An optional message can be supplied to provide a custom message. The method must be called on the object where the property belongs (not inherited from the prototype). If the property is a data descriptor, it will be converted to an accessor descriptor in order to display the deprecation message. ### process.on('deprecation', fn) This module will allow easy capturing of deprecation errors by emitting the errors as the type "deprecation" on the global `process`. If there are no listeners for this type, the errors are written to STDERR as normal, but if there are any listeners, nothing will be written to STDERR and instead only emitted. From there, you can write the errors in a different format or to a logging source. The error represents the deprecation and is emitted only once with the same rules as writing to STDERR. The error has the following properties: - `message` - This is the message given by the library - `name` - This is always `'DeprecationError'` - `namespace` - This is the namespace the deprecation came from - `stack` - This is the stack of the call to the deprecated thing Example `error.stack` output: ``` DeprecationError: my-cool-module deprecated oldfunction at Object.<anonymous> ([eval]-wrapper:6:22) at Module._compile (module.js:456:26) at evalScript (node.js:532:25) at startup (node.js:80:7) at node.js:902:3 ``` ### process.env.NO_DEPRECATION As a user of modules that are deprecated, the environment variable `NO_DEPRECATION` is provided as a quick solution to silencing deprecation warnings from being output. The format of this is similar to that of `DEBUG`: ```sh $ NO_DEPRECATION=my-module,othermod node app.js ``` This will suppress deprecations from being output for "my-module" and "othermod". The value is a list of comma-separated namespaces. To suppress every warning across all namespaces, use the value `*` for a namespace. Providing the argument `--no-deprecation` to the `node` executable will suppress all deprecations (only available in Node.js 0.8 or higher). **NOTE** This will not suppress the deperecations given to any "deprecation" event listeners, just the output to STDERR. ### process.env.TRACE_DEPRECATION As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION` is provided as a solution to getting more detailed location information in deprecation warnings by including the entire stack trace. The format of this is the same as `NO_DEPRECATION`: ```sh $ TRACE_DEPRECATION=my-module,othermod node app.js ``` This will include stack traces for deprecations being output for "my-module" and "othermod". The value is a list of comma-separated namespaces. To trace every warning across all namespaces, use the value `*` for a namespace. Providing the argument `--trace-deprecation` to the `node` executable will trace all deprecations (only available in Node.js 0.8 or higher). **NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`. ## Display  When a user calls a function in your library that you mark deprecated, they will see the following written to STDERR (in the given colors, similar colors and layout to the `debug` module): ``` bright cyan bright yellow | | reset cyan | | | | ▼ ▼ ▼ ▼ my-cool-module deprecated oldfunction [eval]-wrapper:6:22 ▲ ▲ ▲ ▲ | | | | namespace | | location of mycoolmod.oldfunction() call | deprecation message the word "deprecated" ``` If the user redirects their STDERR to a file or somewhere that does not support colors, they see (similar layout to the `debug` module): ``` Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22 ▲ ▲ ▲ ▲ ▲ | | | | | timestamp of message namespace | | location of mycoolmod.oldfunction() call | deprecation message the word "deprecated" ``` ## Examples ### Deprecating all calls to a function This will display a deprecated message about "oldfunction" being deprecated from "my-module" on STDERR. ```js var deprecate = require('depd')('my-cool-module') // message automatically derived from function name // Object.oldfunction exports.oldfunction = deprecate.function(function oldfunction () { // all calls to function are deprecated }) // specific message exports.oldfunction = deprecate.function(function () { // all calls to function are deprecated }, 'oldfunction') ``` ### Conditionally deprecating a function call This will display a deprecated message about "weirdfunction" being deprecated from "my-module" on STDERR when called with less than 2 arguments. ```js var deprecate = require('depd')('my-cool-module') exports.weirdfunction = function () { if (arguments.length < 2) { // calls with 0 or 1 args are deprecated deprecate('weirdfunction args < 2') } } ``` When calling `deprecate` as a function, the warning is counted per call site within your own module, so you can display different deprecations depending on different situations and the users will still get all the warnings: ```js var deprecate = require('depd')('my-cool-module') exports.weirdfunction = function () { if (arguments.length < 2) { // calls with 0 or 1 args are deprecated deprecate('weirdfunction args < 2') } else if (typeof arguments[0] !== 'string') { // calls with non-string first argument are deprecated deprecate('weirdfunction non-string first arg') } } ``` ### Deprecating property access This will display a deprecated message about "oldprop" being deprecated from "my-module" on STDERR when accessed. A deprecation will be displayed when setting the value and when getting the value. ```js var deprecate = require('depd')('my-cool-module') exports.oldprop = 'something' // message automatically derives from property name deprecate.property(exports, 'oldprop') // explicit message deprecate.property(exports, 'oldprop', 'oldprop >= 0.10') ``` ## License [MIT](LICENSE) [npm-version-image]: https://img.shields.io/npm/v/depd.svg [npm-downloads-image]: https://img.shields.io/npm/dm/depd.svg [npm-url]: https://npmjs.org/package/depd [travis-image]: https://img.shields.io/travis/dougwilson/nodejs-depd/master.svg?label=linux [travis-url]: https://travis-ci.org/dougwilson/nodejs-depd [appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/nodejs-depd/master.svg?label=windows [appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd [coveralls-image]: https://img.shields.io/coveralls/dougwilson/nodejs-depd/master.svg [coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master [node-image]: https://img.shields.io/node/v/depd.svg [node-url]: https://nodejs.org/en/download/ depd/index.js 0000664 00000024655 15105574661 0007155 0 ustar 00 /*! * depd * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. */ var callSiteToString = require('./lib/compat').callSiteToString var eventListenerCount = require('./lib/compat').eventListenerCount var relative = require('path').relative /** * Module exports. */ module.exports = depd /** * Get the path to base files on. */ var basePath = process.cwd() /** * Determine if namespace is contained in the string. */ function containsNamespace (str, namespace) { var vals = str.split(/[ ,]+/) var ns = String(namespace).toLowerCase() for (var i = 0; i < vals.length; i++) { var val = vals[i] // namespace contained if (val && (val === '*' || val.toLowerCase() === ns)) { return true } } return false } /** * Convert a data descriptor to accessor descriptor. */ function convertDataDescriptorToAccessor (obj, prop, message) { var descriptor = Object.getOwnPropertyDescriptor(obj, prop) var value = descriptor.value descriptor.get = function getter () { return value } if (descriptor.writable) { descriptor.set = function setter (val) { return (value = val) } } delete descriptor.value delete descriptor.writable Object.defineProperty(obj, prop, descriptor) return descriptor } /** * Create arguments string to keep arity. */ function createArgumentsString (arity) { var str = '' for (var i = 0; i < arity; i++) { str += ', arg' + i } return str.substr(2) } /** * Create stack string from stack. */ function createStackString (stack) { var str = this.name + ': ' + this.namespace if (this.message) { str += ' deprecated ' + this.message } for (var i = 0; i < stack.length; i++) { str += '\n at ' + callSiteToString(stack[i]) } return str } /** * Create deprecate for namespace in caller. */ function depd (namespace) { if (!namespace) { throw new TypeError('argument namespace is required') } var stack = getStack() var site = callSiteLocation(stack[1]) var file = site[0] function deprecate (message) { // call to self as log log.call(deprecate, message) } deprecate._file = file deprecate._ignored = isignored(namespace) deprecate._namespace = namespace deprecate._traced = istraced(namespace) deprecate._warned = Object.create(null) deprecate.function = wrapfunction deprecate.property = wrapproperty return deprecate } /** * Determine if namespace is ignored. */ function isignored (namespace) { /* istanbul ignore next: tested in a child processs */ if (process.noDeprecation) { // --no-deprecation support return true } var str = process.env.NO_DEPRECATION || '' // namespace ignored return containsNamespace(str, namespace) } /** * Determine if namespace is traced. */ function istraced (namespace) { /* istanbul ignore next: tested in a child processs */ if (process.traceDeprecation) { // --trace-deprecation support return true } var str = process.env.TRACE_DEPRECATION || '' // namespace traced return containsNamespace(str, namespace) } /** * Display deprecation message. */ function log (message, site) { var haslisteners = eventListenerCount(process, 'deprecation') !== 0 // abort early if no destination if (!haslisteners && this._ignored) { return } var caller var callFile var callSite var depSite var i = 0 var seen = false var stack = getStack() var file = this._file if (site) { // provided site depSite = site callSite = callSiteLocation(stack[1]) callSite.name = depSite.name file = callSite[0] } else { // get call site i = 2 depSite = callSiteLocation(stack[i]) callSite = depSite } // get caller of deprecated thing in relation to file for (; i < stack.length; i++) { caller = callSiteLocation(stack[i]) callFile = caller[0] if (callFile === file) { seen = true } else if (callFile === this._file) { file = this._file } else if (seen) { break } } var key = caller ? depSite.join(':') + '__' + caller.join(':') : undefined if (key !== undefined && key in this._warned) { // already warned return } this._warned[key] = true // generate automatic message from call site var msg = message if (!msg) { msg = callSite === depSite || !callSite.name ? defaultMessage(depSite) : defaultMessage(callSite) } // emit deprecation if listeners exist if (haslisteners) { var err = DeprecationError(this._namespace, msg, stack.slice(i)) process.emit('deprecation', err) return } // format and write message var format = process.stderr.isTTY ? formatColor : formatPlain var output = format.call(this, msg, caller, stack.slice(i)) process.stderr.write(output + '\n', 'utf8') } /** * Get call site location as array. */ function callSiteLocation (callSite) { var file = callSite.getFileName() || '<anonymous>' var line = callSite.getLineNumber() var colm = callSite.getColumnNumber() if (callSite.isEval()) { file = callSite.getEvalOrigin() + ', ' + file } var site = [file, line, colm] site.callSite = callSite site.name = callSite.getFunctionName() return site } /** * Generate a default message from the site. */ function defaultMessage (site) { var callSite = site.callSite var funcName = site.name // make useful anonymous name if (!funcName) { funcName = '<anonymous@' + formatLocation(site) + '>' } var context = callSite.getThis() var typeName = context && callSite.getTypeName() // ignore useless type name if (typeName === 'Object') { typeName = undefined } // make useful type name if (typeName === 'Function') { typeName = context.name || typeName } return typeName && callSite.getMethodName() ? typeName + '.' + funcName : funcName } /** * Format deprecation message without color. */ function formatPlain (msg, caller, stack) { var timestamp = new Date().toUTCString() var formatted = timestamp + ' ' + this._namespace + ' deprecated ' + msg // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { formatted += '\n at ' + callSiteToString(stack[i]) } return formatted } if (caller) { formatted += ' at ' + formatLocation(caller) } return formatted } /** * Format deprecation message with color. */ function formatColor (msg, caller, stack) { var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan ' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow ' \x1b[0m' + msg + '\x1b[39m' // reset // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m' // cyan } return formatted } if (caller) { formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan } return formatted } /** * Format call site location. */ function formatLocation (callSite) { return relative(basePath, callSite[0]) + ':' + callSite[1] + ':' + callSite[2] } /** * Get the stack as array of call sites. */ function getStack () { var limit = Error.stackTraceLimit var obj = {} var prep = Error.prepareStackTrace Error.prepareStackTrace = prepareObjectStackTrace Error.stackTraceLimit = Math.max(10, limit) // capture the stack Error.captureStackTrace(obj) // slice this function off the top var stack = obj.stack.slice(1) Error.prepareStackTrace = prep Error.stackTraceLimit = limit return stack } /** * Capture call site stack from v8. */ function prepareObjectStackTrace (obj, stack) { return stack } /** * Return a wrapped function in a deprecation message. */ function wrapfunction (fn, message) { if (typeof fn !== 'function') { throw new TypeError('argument fn must be a function') } var args = createArgumentsString(fn.length) var deprecate = this // eslint-disable-line no-unused-vars var stack = getStack() var site = callSiteLocation(stack[1]) site.name = fn.name // eslint-disable-next-line no-eval var deprecatedfn = eval('(function (' + args + ') {\n' + '"use strict"\n' + 'log.call(deprecate, message, site)\n' + 'return fn.apply(this, arguments)\n' + '})') return deprecatedfn } /** * Wrap property in a deprecation message. */ function wrapproperty (obj, prop, message) { if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { throw new TypeError('argument obj must be object') } var descriptor = Object.getOwnPropertyDescriptor(obj, prop) if (!descriptor) { throw new TypeError('must call property on owner object') } if (!descriptor.configurable) { throw new TypeError('property must be configurable') } var deprecate = this var stack = getStack() var site = callSiteLocation(stack[1]) // set site name site.name = prop // convert data descriptor if ('value' in descriptor) { descriptor = convertDataDescriptorToAccessor(obj, prop, message) } var get = descriptor.get var set = descriptor.set // wrap getter if (typeof get === 'function') { descriptor.get = function getter () { log.call(deprecate, message, site) return get.apply(this, arguments) } } // wrap setter if (typeof set === 'function') { descriptor.set = function setter () { log.call(deprecate, message, site) return set.apply(this, arguments) } } Object.defineProperty(obj, prop, descriptor) } /** * Create DeprecationError for deprecation */ function DeprecationError (namespace, message, stack) { var error = new Error() var stackString Object.defineProperty(error, 'constructor', { value: DeprecationError }) Object.defineProperty(error, 'message', { configurable: true, enumerable: false, value: message, writable: true }) Object.defineProperty(error, 'name', { enumerable: false, configurable: true, value: 'DeprecationError', writable: true }) Object.defineProperty(error, 'namespace', { configurable: true, enumerable: false, value: namespace, writable: true }) Object.defineProperty(error, 'stack', { configurable: true, enumerable: false, get: function () { if (stackString !== undefined) { return stackString } // prepare stack trace return (stackString = createStackString.call(this, stack)) }, set: function setter (val) { stackString = val } }) return error } depd/package.json 0000664 00000004021 15105574661 0007757 0 ustar 00 { "_args": [ [ "depd@1.1.2", "/home/freeclou/app.optimyar.com/backend" ] ], "_from": "depd@1.1.2", "_id": "depd@1.1.2", "_inBundle": false, "_integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", "_location": "/send/depd", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, "raw": "depd@1.1.2", "name": "depd", "escapedName": "depd", "rawSpec": "1.1.2", "saveSpec": null, "fetchSpec": "1.1.2" }, "_requiredBy": [ "/send", "/send/http-errors" ], "_resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "_spec": "1.1.2", "_where": "/home/freeclou/app.optimyar.com/backend", "author": { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" }, "browser": "lib/browser/index.js", "bugs": { "url": "https://github.com/dougwilson/nodejs-depd/issues" }, "description": "Deprecate all the things", "devDependencies": { "beautify-benchmark": "0.2.4", "benchmark": "2.1.4", "eslint": "3.19.0", "eslint-config-standard": "7.1.0", "eslint-plugin-markdown": "1.0.0-beta.7", "eslint-plugin-promise": "3.6.0", "eslint-plugin-standard": "3.0.1", "istanbul": "0.4.5", "mocha": "~1.21.5" }, "engines": { "node": ">= 0.6" }, "files": [ "lib/", "History.md", "LICENSE", "index.js", "Readme.md" ], "homepage": "https://github.com/dougwilson/nodejs-depd#readme", "keywords": [ "deprecate", "deprecated" ], "license": "MIT", "name": "depd", "repository": { "type": "git", "url": "git+https://github.com/dougwilson/nodejs-depd.git" }, "scripts": { "bench": "node benchmark/index.js", "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --bail test/", "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --no-exit test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/" }, "version": "1.1.2" } http-errors/HISTORY.md 0000664 00000006212 15105574661 0010535 0 ustar 00 2019-06-24 / 1.7.3 ================== * deps: inherits@2.0.4 2019-02-18 / 1.7.2 ================== * deps: setprototypeof@1.1.1 2018-09-08 / 1.7.1 ================== * Fix error creating objects in some environments 2018-07-30 / 1.7.0 ================== * Set constructor name when possible * Use `toidentifier` module to make class names * deps: statuses@'>= 1.5.0 < 2' 2018-03-29 / 1.6.3 ================== * deps: depd@~1.1.2 - perf: remove argument reassignment * deps: setprototypeof@1.1.0 * deps: statuses@'>= 1.4.0 < 2' 2017-08-04 / 1.6.2 ================== * deps: depd@1.1.1 - Remove unnecessary `Buffer` loading 2017-02-20 / 1.6.1 ================== * deps: setprototypeof@1.0.3 - Fix shim for old browsers 2017-02-14 / 1.6.0 ================== * Accept custom 4xx and 5xx status codes in factory * Add deprecation message to `"I'mateapot"` export * Deprecate passing status code as anything except first argument in factory * Deprecate using non-error status codes * Make `message` property enumerable for `HttpError`s 2016-11-16 / 1.5.1 ================== * deps: inherits@2.0.3 - Fix issue loading in browser * deps: setprototypeof@1.0.2 * deps: statuses@'>= 1.3.1 < 2' 2016-05-18 / 1.5.0 ================== * Support new code `421 Misdirected Request` * Use `setprototypeof` module to replace `__proto__` setting * deps: statuses@'>= 1.3.0 < 2' - Add `421 Misdirected Request` - perf: enable strict mode * perf: enable strict mode 2016-01-28 / 1.4.0 ================== * Add `HttpError` export, for `err instanceof createError.HttpError` * deps: inherits@2.0.1 * deps: statuses@'>= 1.2.1 < 2' - Fix message for status 451 - Remove incorrect nginx status code 2015-02-02 / 1.3.1 ================== * Fix regression where status can be overwritten in `createError` `props` 2015-02-01 / 1.3.0 ================== * Construct errors using defined constructors from `createError` * Fix error names that are not identifiers - `createError["I'mateapot"]` is now `createError.ImATeapot` * Set a meaningful `name` property on constructed errors 2014-12-09 / 1.2.8 ================== * Fix stack trace from exported function * Remove `arguments.callee` usage 2014-10-14 / 1.2.7 ================== * Remove duplicate line 2014-10-02 / 1.2.6 ================== * Fix `expose` to be `true` for `ClientError` constructor 2014-09-28 / 1.2.5 ================== * deps: statuses@1 2014-09-21 / 1.2.4 ================== * Fix dependency version to work with old `npm`s 2014-09-21 / 1.2.3 ================== * deps: statuses@~1.1.0 2014-09-21 / 1.2.2 ================== * Fix publish error 2014-09-21 / 1.2.1 ================== * Support Node.js 0.6 * Use `inherits` instead of `util` 2014-09-09 / 1.2.0 ================== * Fix the way inheriting functions * Support `expose` being provided in properties argument 2014-09-08 / 1.1.0 ================== * Default status to 500 * Support provided `error` to extend 2014-09-08 / 1.0.1 ================== * Fix accepting string message 2014-09-08 / 1.0.0 ================== * Initial release http-errors/LICENSE 0000664 00000002220 15105574661 0010052 0 ustar 00 The MIT License (MIT) Copyright (c) 2014 Jonathan Ong me@jongleberry.com Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. http-errors/README.md 0000664 00000012662 15105574661 0010337 0 ustar 00 # http-errors [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][node-url] [![Node.js Version][node-image]][node-url] [![Build Status][travis-image]][travis-url] [![Test Coverage][coveralls-image]][coveralls-url] Create HTTP errors for Express, Koa, Connect, etc. with ease. ## Install This is a [Node.js](https://nodejs.org/en/) module available through the [npm registry](https://www.npmjs.com/). Installation is done using the [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): ```bash $ npm install http-errors ``` ## Example ```js var createError = require('http-errors') var express = require('express') var app = express() app.use(function (req, res, next) { if (!req.user) return next(createError(401, 'Please login to view this page.')) next() }) ``` ## API This is the current API, currently extracted from Koa and subject to change. ### Error Properties - `expose` - can be used to signal if `message` should be sent to the client, defaulting to `false` when `status` >= 500 - `headers` - can be an object of header names to values to be sent to the client, defaulting to `undefined`. When defined, the key names should all be lower-cased - `message` - the traditional error message, which should be kept short and all single line - `status` - the status code of the error, mirroring `statusCode` for general compatibility - `statusCode` - the status code of the error, defaulting to `500` ### createError([status], [message], [properties]) Create a new error object with the given message `msg`. The error object inherits from `createError.HttpError`. <!-- eslint-disable no-undef, no-unused-vars --> ```js var err = createError(404, 'This video does not exist!') ``` - `status: 500` - the status code as a number - `message` - the message of the error, defaulting to node's text for that status code. - `properties` - custom properties to attach to the object ### createError([status], [error], [properties]) Extend the given `error` object with `createError.HttpError` properties. This will not alter the inheritance of the given `error` object, and the modified `error` object is the return value. <!-- eslint-disable no-redeclare, no-undef, no-unused-vars --> ```js fs.readFile('foo.txt', function (err, buf) { if (err) { if (err.code === 'ENOENT') { var httpError = createError(404, err, { expose: false }) } else { var httpError = createError(500, err) } } }) ``` - `status` - the status code as a number - `error` - the error object to extend - `properties` - custom properties to attach to the object ### new createError\[code || name\](\[msg]\)) Create a new error object with the given message `msg`. The error object inherits from `createError.HttpError`. <!-- eslint-disable no-undef, no-unused-vars --> ```js var err = new createError.NotFound() ``` - `code` - the status code as a number - `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`. #### List of all constructors |Status Code|Constructor Name | |-----------|-----------------------------| |400 |BadRequest | |401 |Unauthorized | |402 |PaymentRequired | |403 |Forbidden | |404 |NotFound | |405 |MethodNotAllowed | |406 |NotAcceptable | |407 |ProxyAuthenticationRequired | |408 |RequestTimeout | |409 |Conflict | |410 |Gone | |411 |LengthRequired | |412 |PreconditionFailed | |413 |PayloadTooLarge | |414 |URITooLong | |415 |UnsupportedMediaType | |416 |RangeNotSatisfiable | |417 |ExpectationFailed | |418 |ImATeapot | |421 |MisdirectedRequest | |422 |UnprocessableEntity | |423 |Locked | |424 |FailedDependency | |425 |UnorderedCollection | |426 |UpgradeRequired | |428 |PreconditionRequired | |429 |TooManyRequests | |431 |RequestHeaderFieldsTooLarge | |451 |UnavailableForLegalReasons | |500 |InternalServerError | |501 |NotImplemented | |502 |BadGateway | |503 |ServiceUnavailable | |504 |GatewayTimeout | |505 |HTTPVersionNotSupported | |506 |VariantAlsoNegotiates | |507 |InsufficientStorage | |508 |LoopDetected | |509 |BandwidthLimitExceeded | |510 |NotExtended | |511 |NetworkAuthenticationRequired| ## License [MIT](LICENSE) [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/http-errors/master [coveralls-url]: https://coveralls.io/r/jshttp/http-errors?branch=master [node-image]: https://badgen.net/npm/node/http-errors [node-url]: https://nodejs.org/en/download [npm-downloads-image]: https://badgen.net/npm/dm/http-errors [npm-url]: https://npmjs.org/package/http-errors [npm-version-image]: https://badgen.net/npm/v/http-errors [travis-image]: https://badgen.net/travis/jshttp/http-errors/master [travis-url]: https://travis-ci.org/jshttp/http-errors http-errors/index.js 0000664 00000013366 15105574661 0010527 0 ustar 00 /*! * http-errors * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed */ 'use strict' /** * Module dependencies. * @private */ var deprecate = require('depd')('http-errors') var setPrototypeOf = require('setprototypeof') var statuses = require('statuses') var inherits = require('inherits') var toIdentifier = require('toidentifier') /** * Module exports. * @public */ module.exports = createError module.exports.HttpError = createHttpErrorConstructor() // Populate exports for all constructors populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError) /** * Get the code class of a status code. * @private */ function codeClass (status) { return Number(String(status).charAt(0) + '00') } /** * Create a new HTTP Error. * * @returns {Error} * @public */ function createError () { // so much arity going on ~_~ var err var msg var status = 500 var props = {} for (var i = 0; i < arguments.length; i++) { var arg = arguments[i] if (arg instanceof Error) { err = arg status = err.status || err.statusCode || status continue } switch (typeof arg) { case 'string': msg = arg break case 'number': status = arg if (i !== 0) { deprecate('non-first-argument status code; replace with createError(' + arg + ', ...)') } break case 'object': props = arg break } } if (typeof status === 'number' && (status < 400 || status >= 600)) { deprecate('non-error status code; use only 4xx or 5xx status codes') } if (typeof status !== 'number' || (!statuses[status] && (status < 400 || status >= 600))) { status = 500 } // constructor var HttpError = createError[status] || createError[codeClass(status)] if (!err) { // create error err = HttpError ? new HttpError(msg) : new Error(msg || statuses[status]) Error.captureStackTrace(err, createError) } if (!HttpError || !(err instanceof HttpError) || err.status !== status) { // add properties to generic error err.expose = status < 500 err.status = err.statusCode = status } for (var key in props) { if (key !== 'status' && key !== 'statusCode') { err[key] = props[key] } } return err } /** * Create HTTP error abstract base class. * @private */ function createHttpErrorConstructor () { function HttpError () { throw new TypeError('cannot construct abstract class') } inherits(HttpError, Error) return HttpError } /** * Create a constructor for a client error. * @private */ function createClientErrorConstructor (HttpError, name, code) { var className = name.match(/Error$/) ? name : name + 'Error' function ClientError (message) { // create the error object var msg = message != null ? message : statuses[code] var err = new Error(msg) // capture a stack trace to the construction point Error.captureStackTrace(err, ClientError) // adjust the [[Prototype]] setPrototypeOf(err, ClientError.prototype) // redefine the error message Object.defineProperty(err, 'message', { enumerable: true, configurable: true, value: msg, writable: true }) // redefine the error name Object.defineProperty(err, 'name', { enumerable: false, configurable: true, value: className, writable: true }) return err } inherits(ClientError, HttpError) nameFunc(ClientError, className) ClientError.prototype.status = code ClientError.prototype.statusCode = code ClientError.prototype.expose = true return ClientError } /** * Create a constructor for a server error. * @private */ function createServerErrorConstructor (HttpError, name, code) { var className = name.match(/Error$/) ? name : name + 'Error' function ServerError (message) { // create the error object var msg = message != null ? message : statuses[code] var err = new Error(msg) // capture a stack trace to the construction point Error.captureStackTrace(err, ServerError) // adjust the [[Prototype]] setPrototypeOf(err, ServerError.prototype) // redefine the error message Object.defineProperty(err, 'message', { enumerable: true, configurable: true, value: msg, writable: true }) // redefine the error name Object.defineProperty(err, 'name', { enumerable: false, configurable: true, value: className, writable: true }) return err } inherits(ServerError, HttpError) nameFunc(ServerError, className) ServerError.prototype.status = code ServerError.prototype.statusCode = code ServerError.prototype.expose = false return ServerError } /** * Set the name of a function, if possible. * @private */ function nameFunc (func, name) { var desc = Object.getOwnPropertyDescriptor(func, 'name') if (desc && desc.configurable) { desc.value = name Object.defineProperty(func, 'name', desc) } } /** * Populate the exports object with constructors for every error class. * @private */ function populateConstructorExports (exports, codes, HttpError) { codes.forEach(function forEachCode (code) { var CodeError var name = toIdentifier(statuses[code]) switch (codeClass(code)) { case 400: CodeError = createClientErrorConstructor(HttpError, name, code) break case 500: CodeError = createServerErrorConstructor(HttpError, name, code) break } if (CodeError) { // export the constructor exports[code] = CodeError exports[name] = CodeError } }) // backwards-compatibility exports["I'mateapot"] = deprecate.function(exports.ImATeapot, '"I\'mateapot"; use "ImATeapot" instead') } http-errors/package.json 0000664 00000004623 15105574661 0011344 0 ustar 00 { "_args": [ [ "http-errors@1.7.3", "/home/freeclou/app.optimyar.com/backend" ] ], "_from": "http-errors@1.7.3", "_id": "http-errors@1.7.3", "_inBundle": false, "_integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", "_location": "/send/http-errors", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, "raw": "http-errors@1.7.3", "name": "http-errors", "escapedName": "http-errors", "rawSpec": "1.7.3", "saveSpec": null, "fetchSpec": "1.7.3" }, "_requiredBy": [ "/send" ], "_resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", "_spec": "1.7.3", "_where": "/home/freeclou/app.optimyar.com/backend", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, "bugs": { "url": "https://github.com/jshttp/http-errors/issues" }, "contributors": [ { "name": "Alan Plum", "email": "me@pluma.io" }, { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" } ], "dependencies": { "depd": "~1.1.2", "inherits": "2.0.4", "setprototypeof": "1.1.1", "statuses": ">= 1.5.0 < 2", "toidentifier": "1.0.0" }, "description": "Create HTTP error objects", "devDependencies": { "eslint": "5.16.0", "eslint-config-standard": "12.0.0", "eslint-plugin-import": "2.18.0", "eslint-plugin-markdown": "1.0.0", "eslint-plugin-node": "8.0.1", "eslint-plugin-promise": "4.1.1", "eslint-plugin-standard": "4.0.0", "istanbul": "0.4.5", "mocha": "6.1.4" }, "engines": { "node": ">= 0.6" }, "files": [ "index.js", "HISTORY.md", "LICENSE", "README.md" ], "homepage": "https://github.com/jshttp/http-errors#readme", "keywords": [ "http", "error" ], "license": "MIT", "name": "http-errors", "repository": { "type": "git", "url": "git+https://github.com/jshttp/http-errors.git" }, "scripts": { "lint": "eslint --plugin markdown --ext js,md . && node ./scripts/lint-readme-list.js", "test": "mocha --reporter spec --bail", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" }, "version": "1.7.3" } mime/src/build.js 0000775 00000002507 15105574661 0007742 0 ustar 00 #!/usr/bin/env node 'use strict'; const fs = require('fs'); const path = require('path'); const mimeScore = require('mime-score'); let db = require('mime-db'); let chalk = require('chalk'); const STANDARD_FACET_SCORE = 900; const byExtension = {}; // Clear out any conflict extensions in mime-db for (let type in db) { let entry = db[type]; entry.type = type; if (!entry.extensions) continue; entry.extensions.forEach(ext => { if (ext in byExtension) { const e0 = entry; const e1 = byExtension[ext]; e0.pri = mimeScore(e0.type, e0.source); e1.pri = mimeScore(e1.type, e1.source); let drop = e0.pri < e1.pri ? e0 : e1; let keep = e0.pri >= e1.pri ? e0 : e1; drop.extensions = drop.extensions.filter(e => e !== ext); console.log(`${ext}: Keeping ${chalk.green(keep.type)} (${keep.pri}), dropping ${chalk.red(drop.type)} (${drop.pri})`); } byExtension[ext] = entry; }); } function writeTypesFile(types, path) { fs.writeFileSync(path, JSON.stringify(types)); } // Segregate into standard and non-standard types based on facet per // https://tools.ietf.org/html/rfc6838#section-3.1 const types = {}; Object.keys(db).sort().forEach(k => { const entry = db[k]; types[entry.type] = entry.extensions; }); writeTypesFile(types, path.join(__dirname, '..', 'types.json')); mime/src/test.js 0000664 00000004436 15105574661 0007622 0 ustar 00 /** * Usage: node test.js */ var mime = require('../mime'); var assert = require('assert'); var path = require('path'); // // Test mime lookups // assert.equal('text/plain', mime.lookup('text.txt')); // normal file assert.equal('text/plain', mime.lookup('TEXT.TXT')); // uppercase assert.equal('text/plain', mime.lookup('dir/text.txt')); // dir + file assert.equal('text/plain', mime.lookup('.text.txt')); // hidden file assert.equal('text/plain', mime.lookup('.txt')); // nameless assert.equal('text/plain', mime.lookup('txt')); // extension-only assert.equal('text/plain', mime.lookup('/txt')); // extension-less () assert.equal('text/plain', mime.lookup('\\txt')); // Windows, extension-less assert.equal('application/octet-stream', mime.lookup('text.nope')); // unrecognized assert.equal('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default // // Test extensions // assert.equal('txt', mime.extension(mime.types.text)); assert.equal('html', mime.extension(mime.types.htm)); assert.equal('bin', mime.extension('application/octet-stream')); assert.equal('bin', mime.extension('application/octet-stream ')); assert.equal('html', mime.extension(' text/html; charset=UTF-8')); assert.equal('html', mime.extension('text/html; charset=UTF-8 ')); assert.equal('html', mime.extension('text/html; charset=UTF-8')); assert.equal('html', mime.extension('text/html ; charset=UTF-8')); assert.equal('html', mime.extension('text/html;charset=UTF-8')); assert.equal('html', mime.extension('text/Html;charset=UTF-8')); assert.equal(undefined, mime.extension('unrecognized')); // // Test node.types lookups // assert.equal('font/woff', mime.lookup('file.woff')); assert.equal('application/octet-stream', mime.lookup('file.buffer')); // TODO: Uncomment once #157 is resolved // assert.equal('audio/mp4', mime.lookup('file.m4a')); assert.equal('font/otf', mime.lookup('file.otf')); // // Test charsets // assert.equal('UTF-8', mime.charsets.lookup('text/plain')); assert.equal('UTF-8', mime.charsets.lookup(mime.types.js)); assert.equal('UTF-8', mime.charsets.lookup(mime.types.json)); assert.equal(undefined, mime.charsets.lookup(mime.types.bin)); assert.equal('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); console.log('\nAll tests passed'); mime/.npmignore 0000664 00000000000 15105574661 0007474 0 ustar 00 mime/CHANGELOG.md 0000664 00000022401 15105574661 0007317 0 ustar 00 # Changelog ## v1.6.0 (24/11/2017) *No changelog for this release.* --- ## v2.0.4 (24/11/2017) - [**closed**] Switch to mime-score module for resolving extension contention issues. [#182](https://github.com/broofa/node-mime/issues/182) - [**closed**] Update mime-db to 1.31.0 in v1.x branch [#181](https://github.com/broofa/node-mime/issues/181) --- ## v1.5.0 (22/11/2017) - [**closed**] need ES5 version ready in npm package [#179](https://github.com/broofa/node-mime/issues/179) - [**closed**] mime-db no trace of iWork - pages / numbers / etc. [#178](https://github.com/broofa/node-mime/issues/178) - [**closed**] How it works in brownser ? [#176](https://github.com/broofa/node-mime/issues/176) - [**closed**] Missing `./Mime` [#175](https://github.com/broofa/node-mime/issues/175) - [**closed**] Vulnerable Regular Expression [#167](https://github.com/broofa/node-mime/issues/167) --- ## v2.0.3 (25/09/2017) *No changelog for this release.* --- ## v1.4.1 (25/09/2017) - [**closed**] Issue when bundling with webpack [#172](https://github.com/broofa/node-mime/issues/172) --- ## v2.0.2 (15/09/2017) - [**V2**] fs.readFileSync is not a function [#165](https://github.com/broofa/node-mime/issues/165) - [**closed**] The extension for video/quicktime should map to .mov, not .qt [#164](https://github.com/broofa/node-mime/issues/164) - [**V2**] [v2 Feedback request] Mime class API [#163](https://github.com/broofa/node-mime/issues/163) - [**V2**] [v2 Feedback request] Resolving conflicts over extensions [#162](https://github.com/broofa/node-mime/issues/162) - [**V2**] Allow callers to load module with official, full, or no defined types. [#161](https://github.com/broofa/node-mime/issues/161) - [**V2**] Use "facets" to resolve extension conflicts [#160](https://github.com/broofa/node-mime/issues/160) - [**V2**] Remove fs and path dependencies [#152](https://github.com/broofa/node-mime/issues/152) - [**V2**] Default content-type should not be application/octet-stream [#139](https://github.com/broofa/node-mime/issues/139) - [**V2**] reset mime-types [#124](https://github.com/broofa/node-mime/issues/124) - [**V2**] Extensionless paths should return null or false [#113](https://github.com/broofa/node-mime/issues/113) --- ## v2.0.1 (14/09/2017) - [**closed**] Changelog for v2.0 does not mention breaking changes [#171](https://github.com/broofa/node-mime/issues/171) - [**closed**] MIME breaking with 'class' declaration as it is without 'use strict mode' [#170](https://github.com/broofa/node-mime/issues/170) --- ## v2.0.0 (12/09/2017) - [**closed**] woff and woff2 [#168](https://github.com/broofa/node-mime/issues/168) --- ## v1.4.0 (28/08/2017) - [**closed**] support for ac3 voc files [#159](https://github.com/broofa/node-mime/issues/159) - [**closed**] Help understanding change from application/xml to text/xml [#158](https://github.com/broofa/node-mime/issues/158) - [**closed**] no longer able to override mimetype [#157](https://github.com/broofa/node-mime/issues/157) - [**closed**] application/vnd.adobe.photoshop [#147](https://github.com/broofa/node-mime/issues/147) - [**closed**] Directories should appear as something other than application/octet-stream [#135](https://github.com/broofa/node-mime/issues/135) - [**closed**] requested features [#131](https://github.com/broofa/node-mime/issues/131) - [**closed**] Make types.json loading optional? [#129](https://github.com/broofa/node-mime/issues/129) - [**closed**] Cannot find module './types.json' [#120](https://github.com/broofa/node-mime/issues/120) - [**V2**] .wav files show up as "audio/x-wav" instead of "audio/x-wave" [#118](https://github.com/broofa/node-mime/issues/118) - [**closed**] Don't be a pain in the ass for node community [#108](https://github.com/broofa/node-mime/issues/108) - [**closed**] don't make default_type global [#78](https://github.com/broofa/node-mime/issues/78) - [**closed**] mime.extension() fails if the content-type is parameterized [#74](https://github.com/broofa/node-mime/issues/74) --- ## v1.3.6 (11/05/2017) - [**closed**] .md should be text/markdown as of March 2016 [#154](https://github.com/broofa/node-mime/issues/154) - [**closed**] Error while installing mime [#153](https://github.com/broofa/node-mime/issues/153) - [**closed**] application/manifest+json [#149](https://github.com/broofa/node-mime/issues/149) - [**closed**] Dynamic adaptive streaming over HTTP (DASH) file extension typo [#141](https://github.com/broofa/node-mime/issues/141) - [**closed**] charsets image/png undefined [#140](https://github.com/broofa/node-mime/issues/140) - [**closed**] Mime-db dependency out of date [#130](https://github.com/broofa/node-mime/issues/130) - [**closed**] how to support plist? [#126](https://github.com/broofa/node-mime/issues/126) - [**closed**] how does .types file format look like? [#123](https://github.com/broofa/node-mime/issues/123) - [**closed**] Feature: support for expanding MIME patterns [#121](https://github.com/broofa/node-mime/issues/121) - [**closed**] DEBUG_MIME doesn't work [#117](https://github.com/broofa/node-mime/issues/117) --- ## v1.3.4 (06/02/2015) *No changelog for this release.* --- ## v1.3.3 (06/02/2015) *No changelog for this release.* --- ## v1.3.1 (05/02/2015) - [**closed**] Consider adding support for Handlebars .hbs file ending [#111](https://github.com/broofa/node-mime/issues/111) - [**closed**] Consider adding support for hjson. [#110](https://github.com/broofa/node-mime/issues/110) - [**closed**] Add mime type for Opus audio files [#94](https://github.com/broofa/node-mime/issues/94) - [**closed**] Consider making the `Requesting New Types` information more visible [#77](https://github.com/broofa/node-mime/issues/77) --- ## v1.3.0 (05/02/2015) - [**closed**] Add common name? [#114](https://github.com/broofa/node-mime/issues/114) - [**closed**] application/x-yaml [#104](https://github.com/broofa/node-mime/issues/104) - [**closed**] Add mime type for WOFF file format 2.0 [#102](https://github.com/broofa/node-mime/issues/102) - [**closed**] application/x-msi for .msi [#99](https://github.com/broofa/node-mime/issues/99) - [**closed**] Add mimetype for gettext translation files [#98](https://github.com/broofa/node-mime/issues/98) - [**closed**] collaborators [#88](https://github.com/broofa/node-mime/issues/88) - [**closed**] getting errot in installation of mime module...any1 can help? [#87](https://github.com/broofa/node-mime/issues/87) - [**closed**] should application/json's charset be utf8? [#86](https://github.com/broofa/node-mime/issues/86) - [**closed**] Add "license" and "licenses" to package.json [#81](https://github.com/broofa/node-mime/issues/81) - [**closed**] lookup with extension-less file on Windows returns wrong type [#68](https://github.com/broofa/node-mime/issues/68) --- ## v1.2.11 (15/08/2013) - [**closed**] Update mime.types [#65](https://github.com/broofa/node-mime/issues/65) - [**closed**] Publish a new version [#63](https://github.com/broofa/node-mime/issues/63) - [**closed**] README should state upfront that "application/octet-stream" is default for unknown extension [#55](https://github.com/broofa/node-mime/issues/55) - [**closed**] Suggested improvement to the charset API [#52](https://github.com/broofa/node-mime/issues/52) --- ## v1.2.10 (25/07/2013) - [**closed**] Mime type for woff files should be application/font-woff and not application/x-font-woff [#62](https://github.com/broofa/node-mime/issues/62) - [**closed**] node.types in conflict with mime.types [#51](https://github.com/broofa/node-mime/issues/51) --- ## v1.2.9 (17/01/2013) - [**closed**] Please update "mime" NPM [#49](https://github.com/broofa/node-mime/issues/49) - [**closed**] Please add semicolon [#46](https://github.com/broofa/node-mime/issues/46) - [**closed**] parse full mime types [#43](https://github.com/broofa/node-mime/issues/43) --- ## v1.2.8 (10/01/2013) - [**closed**] /js directory mime is application/javascript. Is it correct? [#47](https://github.com/broofa/node-mime/issues/47) - [**closed**] Add mime types for lua code. [#45](https://github.com/broofa/node-mime/issues/45) --- ## v1.2.7 (19/10/2012) - [**closed**] cannot install 1.2.7 via npm [#41](https://github.com/broofa/node-mime/issues/41) - [**closed**] Transfer ownership to @broofa [#36](https://github.com/broofa/node-mime/issues/36) - [**closed**] it's wrong to set charset to UTF-8 for text [#30](https://github.com/broofa/node-mime/issues/30) - [**closed**] Allow multiple instances of MIME types container [#27](https://github.com/broofa/node-mime/issues/27) --- ## v1.2.5 (16/02/2012) - [**closed**] When looking up a types, check hasOwnProperty [#23](https://github.com/broofa/node-mime/issues/23) - [**closed**] Bump version to 1.2.2 [#18](https://github.com/broofa/node-mime/issues/18) - [**closed**] No license [#16](https://github.com/broofa/node-mime/issues/16) - [**closed**] Some types missing that are used by html5/css3 [#13](https://github.com/broofa/node-mime/issues/13) - [**closed**] npm install fails for 1.2.1 [#12](https://github.com/broofa/node-mime/issues/12) - [**closed**] image/pjpeg + image/x-png [#10](https://github.com/broofa/node-mime/issues/10) - [**closed**] symlink [#8](https://github.com/broofa/node-mime/issues/8) - [**closed**] gzip [#2](https://github.com/broofa/node-mime/issues/2) - [**closed**] ALL CAPS filenames return incorrect mime type [#1](https://github.com/broofa/node-mime/issues/1) mime/LICENSE 0000664 00000002112 15105574661 0006510 0 ustar 00 The MIT License (MIT) Copyright (c) 2010 Benjamin Thomas, Robert Kieffer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. mime/README.md 0000664 00000004107 15105574661 0006770 0 ustar 00 # mime Comprehensive MIME type mapping API based on mime-db module. ## Install Install with [npm](http://github.com/isaacs/npm): npm install mime ## Contributing / Testing npm run test ## Command Line mime [path_string] E.g. > mime scripts/jquery.js application/javascript ## API - Queries ### mime.lookup(path) Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g. ```js var mime = require('mime'); mime.lookup('/path/to/file.txt'); // => 'text/plain' mime.lookup('file.txt'); // => 'text/plain' mime.lookup('.TXT'); // => 'text/plain' mime.lookup('htm'); // => 'text/html' ``` ### mime.default_type Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.) ### mime.extension(type) Get the default extension for `type` ```js mime.extension('text/html'); // => 'html' mime.extension('application/octet-stream'); // => 'bin' ``` ### mime.charsets.lookup() Map mime-type to charset ```js mime.charsets.lookup('text/plain'); // => 'UTF-8' ``` (The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) ## API - Defining Custom Types Custom type mappings can be added on a per-project basis via the following APIs. ### mime.define() Add custom mime/extension mappings ```js mime.define({ 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], 'application/x-my-type': ['x-mt', 'x-mtt'], // etc ... }); mime.lookup('x-sft'); // => 'text/x-some-format' ``` The first entry in the extensions array is returned by `mime.extension()`. E.g. ```js mime.extension('text/x-some-format'); // => 'x-sf' ``` ### mime.load(filepath) Load mappings from an Apache ".types" format file ```js mime.load('./my_project.types'); ``` The .types file format is simple - See the `types` dir for examples. mime/mime.js 0000664 00000005246 15105574661 0007003 0 ustar 00 var path = require('path'); var fs = require('fs'); function Mime() { // Map of extension -> mime type this.types = Object.create(null); // Map of mime type -> extension this.extensions = Object.create(null); } /** * Define mimetype -> extension mappings. Each key is a mime-type that maps * to an array of extensions associated with the type. The first extension is * used as the default extension for the type. * * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); * * @param map (Object) type definitions */ Mime.prototype.define = function (map) { for (var type in map) { var exts = map[type]; for (var i = 0; i < exts.length; i++) { if (process.env.DEBUG_MIME && this.types[exts[i]]) { console.warn((this._loading || "define()").replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + this.types[exts[i]] + ' to ' + type); } this.types[exts[i]] = type; } // Default extension is the first one we encounter if (!this.extensions[type]) { this.extensions[type] = exts[0]; } } }; /** * Load an Apache2-style ".types" file * * This may be called multiple times (it's expected). Where files declare * overlapping types/extensions, the last file wins. * * @param file (String) path of file to load. */ Mime.prototype.load = function(file) { this._loading = file; // Read file and split into lines var map = {}, content = fs.readFileSync(file, 'ascii'), lines = content.split(/[\r\n]+/); lines.forEach(function(line) { // Clean up whitespace/comments, and split into fields var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); map[fields.shift()] = fields; }); this.define(map); this._loading = null; }; /** * Lookup a mime type based on extension */ Mime.prototype.lookup = function(path, fallback) { var ext = path.replace(/^.*[\.\/\\]/, '').toLowerCase(); return this.types[ext] || fallback || this.default_type; }; /** * Return file extension associated with a mime type */ Mime.prototype.extension = function(mimeType) { var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); return this.extensions[type]; }; // Default instance var mime = new Mime(); // Define built-in types mime.define(require('./types.json')); // Default type mime.default_type = mime.lookup('bin'); // // Additional API specific to the default instance // mime.Mime = Mime; /** * Lookup a charset based on mime type. */ mime.charsets = { lookup: function(mimeType, fallback) { // Assume text types are utf8 return (/^text\/|^application\/(javascript|json)/).test(mimeType) ? 'UTF-8' : fallback; } }; module.exports = mime; mime/package.json 0000664 00000003411 15105574661 0007774 0 ustar 00 { "_args": [ [ "mime@1.6.0", "/home/freeclou/app.optimyar.com/backend" ] ], "_from": "mime@1.6.0", "_id": "mime@1.6.0", "_inBundle": false, "_integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "_location": "/send/mime", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, "raw": "mime@1.6.0", "name": "mime", "escapedName": "mime", "rawSpec": "1.6.0", "saveSpec": null, "fetchSpec": "1.6.0" }, "_requiredBy": [ "/send" ], "_resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", "_spec": "1.6.0", "_where": "/home/freeclou/app.optimyar.com/backend", "author": { "name": "Robert Kieffer", "email": "robert@broofa.com", "url": "http://github.com/broofa" }, "bin": { "mime": "cli.js" }, "bugs": { "url": "https://github.com/broofa/node-mime/issues" }, "contributors": [ { "name": "Benjamin Thomas", "email": "benjamin@benjaminthomas.org", "url": "http://github.com/bentomas" } ], "dependencies": {}, "description": "A comprehensive library for mime-type mapping", "devDependencies": { "github-release-notes": "0.13.1", "mime-db": "1.31.0", "mime-score": "1.1.0" }, "engines": { "node": ">=4" }, "homepage": "https://github.com/broofa/node-mime#readme", "keywords": [ "util", "mime" ], "license": "MIT", "main": "mime.js", "name": "mime", "repository": { "url": "git+https://github.com/broofa/node-mime.git", "type": "git" }, "scripts": { "changelog": "gren changelog --tags=all --generate --override", "prepare": "node src/build.js", "test": "node src/test.js" }, "version": "1.6.0" } mime/types.json 0000664 00000075503 15105574661 0007560 0 ustar 00 {"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":[],"application/font-woff2":[],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]} ms/index.js 0000664 00000005732 15105574661 0006653 0 ustar 00 /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } ms/license.md 0000664 00000002065 15105574661 0007146 0 ustar 00 The MIT License (MIT) Copyright (c) 2016 Zeit, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ms/package.json 0000664 00000003070 15105574661 0007465 0 ustar 00 { "_args": [ [ "ms@2.1.1", "/home/freeclou/app.optimyar.com/backend" ] ], "_from": "ms@2.1.1", "_id": "ms@2.1.1", "_inBundle": false, "_integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "_location": "/send/ms", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, "raw": "ms@2.1.1", "name": "ms", "escapedName": "ms", "rawSpec": "2.1.1", "saveSpec": null, "fetchSpec": "2.1.1" }, "_requiredBy": [ "/send" ], "_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "_spec": "2.1.1", "_where": "/home/freeclou/app.optimyar.com/backend", "bugs": { "url": "https://github.com/zeit/ms/issues" }, "description": "Tiny millisecond conversion utility", "devDependencies": { "eslint": "4.12.1", "expect.js": "0.3.1", "husky": "0.14.3", "lint-staged": "5.0.0", "mocha": "4.0.1" }, "eslintConfig": { "extends": "eslint:recommended", "env": { "node": true, "es6": true } }, "files": [ "index.js" ], "homepage": "https://github.com/zeit/ms#readme", "license": "MIT", "lint-staged": { "*.js": [ "npm run lint", "prettier --single-quote --write", "git add" ] }, "main": "./index", "name": "ms", "repository": { "type": "git", "url": "git+https://github.com/zeit/ms.git" }, "scripts": { "lint": "eslint lib/* bin/*", "precommit": "lint-staged", "test": "mocha tests.js" }, "version": "2.1.1" } ms/readme.md 0000664 00000003722 15105574661 0006762 0 ustar 00 # ms [](https://travis-ci.org/zeit/ms) [](https://zeit.chat/) Use this package to easily convert various time formats to milliseconds. ## Examples ```js ms('2 days') // 172800000 ms('1d') // 86400000 ms('10h') // 36000000 ms('2.5 hrs') // 9000000 ms('2h') // 7200000 ms('1m') // 60000 ms('5s') // 5000 ms('1y') // 31557600000 ms('100') // 100 ms('-3 days') // -259200000 ms('-1h') // -3600000 ms('-200') // -200 ``` ### Convert from Milliseconds ```js ms(60000) // "1m" ms(2 * 60000) // "2m" ms(-3 * 60000) // "-3m" ms(ms('10 hours')) // "10h" ``` ### Time Format Written-Out ```js ms(60000, { long: true }) // "1 minute" ms(2 * 60000, { long: true }) // "2 minutes" ms(-3 * 60000, { long: true }) // "-3 minutes" ms(ms('10 hours'), { long: true }) // "10 hours" ``` ## Features - Works both in [Node.js](https://nodejs.org) and in the browser - If a number is supplied to `ms`, a string with a unit is returned - If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) - If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned ## Related Packages - [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. ## Caught a Bug? 1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device 2. Link the package to the global module directory: `npm link` 3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! As always, you can run the tests using: `npm test` setprototypeof/test/index.js 0000664 00000001262 15105574661 0012313 0 ustar 00 'use strict' /* eslint-env mocha */ /* eslint no-proto: 0 */ var assert = require('assert') var setPrototypeOf = require('..') describe('setProtoOf(obj, proto)', function () { it('should merge objects', function () { var obj = { a: 1, b: 2 } var proto = { b: 3, c: 4 } var mergeObj = setPrototypeOf(obj, proto) if (Object.getPrototypeOf) { assert.strictEqual(Object.getPrototypeOf(obj), proto) } else if ({ __proto__: [] } instanceof Array) { assert.strictEqual(obj.__proto__, proto) } else { assert.strictEqual(obj.a, 1) assert.strictEqual(obj.b, 2) assert.strictEqual(obj.c, 4) } assert.strictEqual(mergeObj, obj) }) }) setprototypeof/LICENSE 0000664 00000001327 15105574661 0010676 0 ustar 00 Copyright (c) 2015, Wes Todd Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. setprototypeof/README.md 0000664 00000001522 15105574661 0011145 0 ustar 00 # Polyfill for `Object.setPrototypeOf` [](https://npmjs.org/package/setprototypeof) [](https://npmjs.org/package/setprototypeof) [](https://github.com/standard/standard) A simple cross platform implementation to set the prototype of an instianted object. Supports all modern browsers and at least back to IE8. ## Usage: ``` $ npm install --save setprototypeof ``` ```javascript var setPrototypeOf = require('setprototypeof') var obj = {} setPrototypeOf(obj, { foo: function () { return 'bar' } }) obj.foo() // bar ``` TypeScript is also supported: ```typescript import setPrototypeOf = require('setprototypeof') ``` setprototypeof/index.d.ts 0000664 00000000135 15105574661 0011566 0 ustar 00 declare function setPrototypeOf(o: any, proto: object | null): any; export = setPrototypeOf; setprototypeof/index.js 0000664 00000000600 15105574661 0011327 0 ustar 00 'use strict' /* eslint no-proto: 0 */ module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties) function setProtoOf (obj, proto) { obj.__proto__ = proto return obj } function mixinProperties (obj, proto) { for (var prop in proto) { if (!obj.hasOwnProperty(prop)) { obj[prop] = proto[prop] } } return obj } setprototypeof/package.json 0000664 00000003744 15105574661 0012164 0 ustar 00 { "_args": [ [ "setprototypeof@1.1.1", "/home/freeclou/app.optimyar.com/backend" ] ], "_from": "setprototypeof@1.1.1", "_id": "setprototypeof@1.1.1", "_inBundle": false, "_integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "_location": "/send/setprototypeof", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, "raw": "setprototypeof@1.1.1", "name": "setprototypeof", "escapedName": "setprototypeof", "rawSpec": "1.1.1", "saveSpec": null, "fetchSpec": "1.1.1" }, "_requiredBy": [ "/send/http-errors" ], "_resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", "_spec": "1.1.1", "_where": "/home/freeclou/app.optimyar.com/backend", "author": { "name": "Wes Todd" }, "bugs": { "url": "https://github.com/wesleytodd/setprototypeof/issues" }, "description": "A small polyfill for Object.setprototypeof", "devDependencies": { "mocha": "^5.2.0", "standard": "^12.0.1" }, "homepage": "https://github.com/wesleytodd/setprototypeof", "keywords": [ "polyfill", "object", "setprototypeof" ], "license": "ISC", "main": "index.js", "name": "setprototypeof", "repository": { "type": "git", "url": "git+https://github.com/wesleytodd/setprototypeof.git" }, "scripts": { "node010": "NODE_VER=0.10 MOCHA_VER=3 npm run testversion", "node11": "NODE_VER=11 npm run testversion", "node4": "NODE_VER=4 npm run testversion", "node6": "NODE_VER=6 npm run testversion", "node9": "NODE_VER=9 npm run testversion", "test": "standard && mocha", "testallversions": "npm run node010 && npm run node4 && npm run node6 && npm run node9 && npm run node11", "testversion": "docker run -it --rm -v $(PWD):/usr/src/app -w /usr/src/app node:${NODE_VER} npm install mocha@${MOCHA_VER:-latest} && npm t" }, "typings": "index.d.ts", "version": "1.1.1" }
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0.18 |
proxy
|
phpinfo
|
Настройка