08-27-周三_17-09-29

This commit is contained in:
2025-08-27 17:10:05 +08:00
commit 86df397d8f
12735 changed files with 1145479 additions and 0 deletions

35
node_modules/dnode/lib/parse_args.js generated vendored Normal file
View File

@@ -0,0 +1,35 @@
module.exports = function (argv) {
var params = {};
for (var i = 0; i < argv.length; i++) {
var arg = argv[i];
if (typeof arg === 'string') {
if (arg.match(/^\d+$/)) {
params.port = parseInt(arg, 10);
}
else if (arg.match('^/')) {
params.path = arg;
}
else {
params.host = arg;
}
}
else if (typeof arg === 'number') {
params.port = arg;
}
else if (typeof arg === 'function') {
params.block = arg;
}
else if (typeof arg === 'object') {
for (var key in arg) {
if (key === 'port') {
params[key] = parseInt(arg[key], 10)
}
else params[key] = arg[key]
}
}
// ignore everything else
};
return params;
};