format: prettify entire project

This commit is contained in:
Rim
2025-04-02 06:50:39 -04:00
parent 86f0782a98
commit 7ccc0be712
1711 changed files with 755867 additions and 235931 deletions

11
node_modules/debug/component.json generated vendored
View File

@ -3,16 +3,9 @@
"repo": "visionmedia/debug",
"description": "small debugging utility",
"version": "2.6.9",
"keywords": [
"debug",
"log",
"debugger"
],
"keywords": ["debug", "log", "debugger"],
"main": "src/browser.js",
"scripts": [
"src/browser.js",
"src/debug.js"
],
"scripts": ["src/browser.js", "src/debug.js"],
"dependencies": {
"rauchg/ms.js": "0.7.1"
}

31
node_modules/debug/karma.conf.js generated vendored
View File

@ -1,70 +1,53 @@
// Karma configuration
// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC)
module.exports = function(config) {
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'
],
files: ['dist/debug.js', 'test/*spec.js'],
// list of files to exclude
exclude: [
'src/node.js'
],
exclude: ['src/node.js'],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
},
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
})
}
concurrency: Infinity,
});
};

70
node_modules/debug/src/browser.js generated vendored
View File

@ -10,10 +10,10 @@ 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();
exports.storage =
'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ?
chrome.storage.local
: localstorage();
/**
* Colors.
@ -25,7 +25,7 @@ exports.colors = [
'goldenrod',
'dodgerblue',
'darkorchid',
'crimson'
'crimson',
];
/**
@ -40,27 +40,44 @@ 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') {
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) ||
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))) ||
(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) ||
(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+)/));
(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) {
exports.formatters.j = function (v) {
try {
return JSON.stringify(v);
} catch (err) {
@ -68,7 +85,6 @@ exports.formatters.j = function(v) {
}
};
/**
* Colorize log arguments if enabled.
*
@ -78,24 +94,26 @@ exports.formatters.j = function(v) {
function formatArgs(args) {
var useColors = this.useColors;
args[0] = (useColors ? '%c' : '')
+ this.namespace
+ (useColors ? ' %c' : ' ')
+ args[0]
+ (useColors ? '%c ' : ' ')
+ '+' + exports.humanize(this.diff);
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')
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) {
args[0].replace(/%[a-zA-Z%]/g, function (match) {
if ('%%' === match) return;
index++;
if ('%c' === match) {
@ -118,9 +136,11 @@ function formatArgs(args) {
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);
return (
'object' === typeof console &&
console.log &&
Function.prototype.apply.call(console.log, console, arguments)
);
}
/**
@ -137,7 +157,7 @@ function save(namespaces) {
} else {
exports.storage.debug = namespaces;
}
} catch(e) {}
} catch (e) {}
}
/**
@ -151,7 +171,7 @@ function load() {
var r;
try {
r = exports.storage.debug;
} catch(e) {}
} 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) {

19
node_modules/debug/src/debug.js generated vendored
View File

@ -1,4 +1,3 @@
/**
* This is the common logic for both the Node.js and web browser
* implementations of `debug()`.
@ -6,7 +5,11 @@
* Expose `debug()` as the module.
*/
exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
exports =
module.exports =
createDebug.debug =
createDebug['default'] =
createDebug;
exports.coerce = coerce;
exports.disable = disable;
exports.enable = enable;
@ -42,10 +45,11 @@ var prevTime;
*/
function selectColor(namespace) {
var hash = 0, i;
var hash = 0,
i;
for (i in namespace) {
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
hash = (hash << 5) - hash + namespace.charCodeAt(i);
hash |= 0; // Convert to 32bit integer
}
@ -61,7 +65,6 @@ function selectColor(namespace) {
*/
function createDebug(namespace) {
function debug() {
// disabled?
if (!debug.enabled) return;
@ -91,7 +94,7 @@ function createDebug(namespace) {
// apply any `formatters` transformations
var index = 0;
args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
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++;
@ -141,7 +144,9 @@ function enable(namespaces) {
exports.names = [];
exports.skips = [];
var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
var split = (typeof namespaces === 'string' ? namespaces : '').split(
/[\s,]+/
);
var len = split.length;
for (var i = 0; i < len; i++) {

82
node_modules/debug/src/node.js generated vendored
View File

@ -31,25 +31,29 @@ exports.colors = [6, 2, 3, 4, 5, 1];
* $ 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() });
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);
// 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;
}, {});
obj[prop] = val;
return obj;
}, {});
/**
* The file descriptor to write the `debug()` calls to.
@ -61,20 +65,24 @@ exports.inspectOpts = Object.keys(process.env).filter(function (key) {
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)')()
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);
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)
return 'colors' in exports.inspectOpts ?
Boolean(exports.inspectOpts.colors)
: tty.isatty(fd);
}
@ -82,19 +90,22 @@ function useColors() {
* Map %o to `util.inspect()`, all on a single line.
*/
exports.formatters.o = function(v) {
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(' ');
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) {
exports.formatters.O = function (v) {
this.inspectOpts.colors = this.useColors;
return util.inspect(v, this.inspectOpts);
};
@ -114,10 +125,11 @@ function formatArgs(args) {
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');
args.push(
'\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'
);
} else {
args[0] = new Date().toUTCString()
+ ' ' + name + ' ' + args[0];
args[0] = new Date().toUTCString() + ' ' + name + ' ' + args[0];
}
}
@ -164,7 +176,7 @@ function load() {
* relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
*/
function createWritableStdioStream (fd) {
function createWritableStdioStream(fd) {
var stream;
var tty_wrap = process.binding('tty_wrap');
@ -194,7 +206,7 @@ function createWritableStdioStream (fd) {
stream = new net.Socket({
fd: fd,
readable: false,
writable: true
writable: true,
});
// FIXME Should probably have an option in net.Socket to create a
@ -232,7 +244,7 @@ function createWritableStdioStream (fd) {
* differently for a particular `debug` instance.
*/
function init (debug) {
function init(debug) {
debug.inspectOpts = {};
var keys = Object.keys(exports.inspectOpts);