Initial commit, 90% there
This commit is contained in:
1
node_modules/.bin/adler32
generated
vendored
Symbolic link
1
node_modules/.bin/adler32
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../adler-32/bin/adler32.njs
|
||||
1
node_modules/.bin/cfb
generated
vendored
Symbolic link
1
node_modules/.bin/cfb
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../cfb/bin/cfb.njs
|
||||
1
node_modules/.bin/codepage
generated
vendored
Symbolic link
1
node_modules/.bin/codepage
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../codepage/bin/codepage.njs
|
||||
1
node_modules/.bin/convert-excel-to-json
generated
vendored
Symbolic link
1
node_modules/.bin/convert-excel-to-json
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../convert-excel-to-json/bin/cli.js
|
||||
1
node_modules/.bin/crc32
generated
vendored
Symbolic link
1
node_modules/.bin/crc32
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../crc-32/bin/crc32.njs
|
||||
1
node_modules/.bin/inspect-function
generated
vendored
Symbolic link
1
node_modules/.bin/inspect-function
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../inspect-function/bin/magicli.js
|
||||
1
node_modules/.bin/inspect-parameters-declaration
generated
vendored
Symbolic link
1
node_modules/.bin/inspect-parameters-declaration
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../inspect-parameters-declaration/bin/cli.js
|
||||
1
node_modules/.bin/object-to-arguments
generated
vendored
Symbolic link
1
node_modules/.bin/object-to-arguments
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../object-to-arguments/bin/cli.js
|
||||
1
node_modules/.bin/printj
generated
vendored
Symbolic link
1
node_modules/.bin/printj
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../printj/bin/printj.njs
|
||||
1
node_modules/.bin/ssf
generated
vendored
Symbolic link
1
node_modules/.bin/ssf
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../ssf/bin/ssf.njs
|
||||
1
node_modules/.bin/stringify-parameters
generated
vendored
Symbolic link
1
node_modules/.bin/stringify-parameters
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../stringify-parameters/bin/cli.js
|
||||
1
node_modules/.bin/xlsx
generated
vendored
Symbolic link
1
node_modules/.bin/xlsx
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../xlsx/bin/xlsx.njs
|
||||
750
node_modules/.package-lock.json
generated
vendored
Normal file
750
node_modules/.package-lock.json
generated
vendored
Normal file
@@ -0,0 +1,750 @@
|
||||
{
|
||||
"name": "mdares",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/adler-32": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.2.0.tgz",
|
||||
"integrity": "sha512-/vUqU/UY4MVeFsg+SsK6c+/05RZXIHZMGJA+PX5JyWI0ZRcBpupnRuPLU/NXXoFwMYCPCoxIfElM2eS+DUXCqQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"exit-on-epipe": "~1.0.1",
|
||||
"printj": "~1.1.0"
|
||||
},
|
||||
"bin": {
|
||||
"adler32": "bin/adler32.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-escape-sequences": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-4.1.0.tgz",
|
||||
"integrity": "sha512-dzW9kHxH011uBsidTXd14JXgzye/YLb2LzeKZ4bsgl/Knwx8AtbSFkkGxagdNOoh0DlqHCmfiEjWKBaqjOanVw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"array-back": "^3.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-escape-sequences/node_modules/array-back": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz",
|
||||
"integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-regex": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz",
|
||||
"integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/argparse": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
||||
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"sprintf-js": "~1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/array-back": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz",
|
||||
"integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"typical": "^2.6.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/camelcase": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
|
||||
"integrity": "sha512-FxAv7HpHrXbh3aPo4o2qxHay2lkLY3x5Mw3KeE4KQE8ysVfziWeRZDwcjauvwBSGEC/nXUPzZy8zeh4HokqOnw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/cfb": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/cfb/-/cfb-1.0.8.tgz",
|
||||
"integrity": "sha512-oA7VomcgZRWTo8V20UYLlXu4ZOCFEAfwwrcxE8PcVzXW12WOhsi38PVnymb6Xoj8y7ghoZQOOOVRBMdLJ4jCjg==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"commander": "^2.14.1",
|
||||
"printj": "~1.1.2"
|
||||
},
|
||||
"bin": {
|
||||
"cfb": "bin/cfb.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/cliss": {
|
||||
"version": "0.0.2",
|
||||
"resolved": "https://registry.npmjs.org/cliss/-/cliss-0.0.2.tgz",
|
||||
"integrity": "sha512-6rj9pgdukjT994Md13JCUAgTk91abAKrygL9sAvmHY4F6AKMOV8ccGaxhUUfcBuyg3sundWnn3JE0Mc9W6ZYqw==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"command-line-usage": "^4.0.1",
|
||||
"deepmerge": "^2.0.0",
|
||||
"get-stdin": "^5.0.1",
|
||||
"inspect-parameters-declaration": "0.0.9",
|
||||
"object-to-arguments": "0.0.8",
|
||||
"pipe-functions": "^1.3.0",
|
||||
"strip-ansi": "^4.0.0",
|
||||
"yargs-parser": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/codepage": {
|
||||
"version": "1.13.1",
|
||||
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.13.1.tgz",
|
||||
"integrity": "sha512-KnY6cQlgkfBjplnQkLk3M5KEfAKa7i9SMqXp+bMuy2/bgYovvU4LDAQvkMaoScwhvozA9VUtgnbS4Z8f7zVA8w==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"commander": "~2.14.1",
|
||||
"exit-on-epipe": "~1.0.1"
|
||||
},
|
||||
"bin": {
|
||||
"codepage": "bin/codepage.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/codepage/node_modules/commander": {
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz",
|
||||
"integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/command-line-usage": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-4.1.0.tgz",
|
||||
"integrity": "sha512-MxS8Ad995KpdAC0Jopo/ovGIroV/m0KHwzKfXxKag6FHOkGsH8/lv5yjgablcRxCJJC0oJeUMuO/gmaq+Wq46g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-escape-sequences": "^4.0.0",
|
||||
"array-back": "^2.0.0",
|
||||
"table-layout": "^0.4.2",
|
||||
"typical": "^2.6.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/commander": {
|
||||
"version": "2.15.1",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
|
||||
"integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/convert-excel-to-json": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/convert-excel-to-json/-/convert-excel-to-json-1.7.0.tgz",
|
||||
"integrity": "sha512-suJs6xw5W4C/1aEPk9zZIcnIvSjeLy6vJFvQs9joBWTfpGypwjFEHopQe2QKBCz4QPLvsDHbZ7CsiouHAklL4A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"argparse": "^1.0.2",
|
||||
"magicli": "0.0.8",
|
||||
"node.extend": "^2.0.2",
|
||||
"xlsx": "^0.12.1"
|
||||
},
|
||||
"bin": {
|
||||
"convert-excel-to-json": "bin/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/crc-32": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz",
|
||||
"integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==",
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"crc32": "bin/crc32.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/deep-extend": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
|
||||
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/deepmerge": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.2.1.tgz",
|
||||
"integrity": "sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/exit-on-epipe": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz",
|
||||
"integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/find-up": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
|
||||
"integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"locate-path": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/for-each-property": {
|
||||
"version": "0.0.4",
|
||||
"resolved": "https://registry.npmjs.org/for-each-property/-/for-each-property-0.0.4.tgz",
|
||||
"integrity": "sha512-xYs28PM0CKXETFzuGC6ZooH0voZlsSDZwidJcy92flQJi3PK7i3gZx23xHXCPOaD4zmet3bDo+wS7E7SujrlCw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"get-prototype-chain": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/for-each-property-deep": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/for-each-property-deep/-/for-each-property-deep-0.0.3.tgz",
|
||||
"integrity": "sha512-qzP8QkODWVVRPpWiBZacSbBl67cTTWoBfxMG0wE46AsS1yl7qv05sGN+dHvD4s4tnvl/goe6Sp4qBI+rlVBgNg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"for-each-property": "0.0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/frac": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz",
|
||||
"integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-prototype-chain": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-prototype-chain/-/get-prototype-chain-1.0.1.tgz",
|
||||
"integrity": "sha512-2m7WZ0jveIg/dAbCbpUxEToaJ8Dmti5EkgDP8YM3UpHUT6SAORjE2odP8XQGNVGXMHi8q8cCCoy3HTByTaTVTw==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/get-stdin": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz",
|
||||
"integrity": "sha512-jZV7n6jGE3Gt7fgSTJoz91Ak5MuTLwMwkoYdjxuJ/AmjIsE1UC03y/IWkZCQGEvVNS9qoRNwy5BCqxImv0FVeA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hasown": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/inspect-function": {
|
||||
"version": "0.3.4",
|
||||
"resolved": "https://registry.npmjs.org/inspect-function/-/inspect-function-0.3.4.tgz",
|
||||
"integrity": "sha512-s0RsbJqK/sNZ+U1mykGoTickog3ea1A9Qk4mXniogOBu4PgkkZ56elScO7QC/r8D94lhGmJ2NyDI1ipOA/uq/g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"inspect-parameters-declaration": "0.0.8",
|
||||
"magicli": "0.0.8",
|
||||
"split-skip": "0.0.1",
|
||||
"stringify-parameters": "0.0.4",
|
||||
"unpack-string": "0.0.2"
|
||||
},
|
||||
"bin": {
|
||||
"inspect-function": "bin/magicli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/inspect-function/node_modules/inspect-function": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/inspect-function/-/inspect-function-0.2.2.tgz",
|
||||
"integrity": "sha512-becs5gzcHwPrlHawscYkyQ/ShiOiosrXPhA5RVZ3qyWH4aWdD52RnMfXq/dwQXciHwiieD8aIPwdIWYv6eL+sQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"split-skip": "0.0.1",
|
||||
"unpack-string": "0.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/inspect-function/node_modules/inspect-parameters-declaration": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/inspect-parameters-declaration/-/inspect-parameters-declaration-0.0.8.tgz",
|
||||
"integrity": "sha512-W4QzN1LgFmasKOM+NoLlDd2OAZM3enNZlVUOXoGQKmYBDFgxoPDOyebF55ALaf8avyM9TavNwibXxg347RrzCg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"magicli": "0.0.5",
|
||||
"split-skip": "0.0.2",
|
||||
"stringify-parameters": "0.0.4",
|
||||
"unpack-string": "0.0.2"
|
||||
},
|
||||
"bin": {
|
||||
"inspect-parameters-declaration": "bin/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/inspect-function/node_modules/inspect-parameters-declaration/node_modules/magicli": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/magicli/-/magicli-0.0.5.tgz",
|
||||
"integrity": "sha512-wZbMtnl2v1b+Jp3xlqA9FU/O4I6YhGXR8xSY/eU2+gDAvut/F+W3gl4qs61iL4LELC7jqSAE6aAD5668EbmQHA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"commander": "^2.9.0",
|
||||
"get-stdin": "^5.0.1",
|
||||
"inspect-function": "^0.2.1",
|
||||
"pipe-functions": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/inspect-function/node_modules/inspect-parameters-declaration/node_modules/split-skip": {
|
||||
"version": "0.0.2",
|
||||
"resolved": "https://registry.npmjs.org/split-skip/-/split-skip-0.0.2.tgz",
|
||||
"integrity": "sha512-weHOi8BolsDnGIwhhWHbA+wKSuSpvWwjRrdj8SdbIIis2vSwOE37CQP8x3EleuzxanUr3AK8BdUy4MkiOULPZg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/inspect-function/node_modules/split-skip": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/split-skip/-/split-skip-0.0.1.tgz",
|
||||
"integrity": "sha512-7dkvq+gofI4M8zx4iZnEZ3O1s7FP4Y/iaIDHJh5RyWrs8idcPauFi2OZe3TBi36fLvR2j5z3kSzVtz6IhPdncQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/inspect-parameters-declaration": {
|
||||
"version": "0.0.9",
|
||||
"resolved": "https://registry.npmjs.org/inspect-parameters-declaration/-/inspect-parameters-declaration-0.0.9.tgz",
|
||||
"integrity": "sha512-c3jrKKA1rwwrsjdGMAo2hFWV0vNe3/RKHxpE/OBt41LP3ynOVI1qmgxpZYK5SQu3jtWCyaho8L7AZzCjJ4mEUw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"magicli": "0.0.5",
|
||||
"split-skip": "0.0.2",
|
||||
"stringify-parameters": "0.0.4",
|
||||
"unpack-string": "0.0.2"
|
||||
},
|
||||
"bin": {
|
||||
"inspect-parameters-declaration": "bin/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/inspect-parameters-declaration/node_modules/inspect-function": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/inspect-function/-/inspect-function-0.2.2.tgz",
|
||||
"integrity": "sha512-becs5gzcHwPrlHawscYkyQ/ShiOiosrXPhA5RVZ3qyWH4aWdD52RnMfXq/dwQXciHwiieD8aIPwdIWYv6eL+sQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"split-skip": "0.0.1",
|
||||
"unpack-string": "0.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/inspect-parameters-declaration/node_modules/inspect-function/node_modules/split-skip": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/split-skip/-/split-skip-0.0.1.tgz",
|
||||
"integrity": "sha512-7dkvq+gofI4M8zx4iZnEZ3O1s7FP4Y/iaIDHJh5RyWrs8idcPauFi2OZe3TBi36fLvR2j5z3kSzVtz6IhPdncQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/inspect-parameters-declaration/node_modules/magicli": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/magicli/-/magicli-0.0.5.tgz",
|
||||
"integrity": "sha512-wZbMtnl2v1b+Jp3xlqA9FU/O4I6YhGXR8xSY/eU2+gDAvut/F+W3gl4qs61iL4LELC7jqSAE6aAD5668EbmQHA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"commander": "^2.9.0",
|
||||
"get-stdin": "^5.0.1",
|
||||
"inspect-function": "^0.2.1",
|
||||
"pipe-functions": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/inspect-property": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inspect-property/-/inspect-property-0.0.6.tgz",
|
||||
"integrity": "sha512-LgjHkRl9W6bj2n+kWrAOgvCYPTYt+LanE4rtd/vKNq6yEb+SvVV7UTLzoSPpDX6/U1cAz7VfqPr+lPAIz7wHaQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"for-each-property": "0.0.4",
|
||||
"for-each-property-deep": "0.0.3",
|
||||
"inspect-function": "^0.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/is": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/is/-/is-3.3.2.tgz",
|
||||
"integrity": "sha512-a2xr4E3s1PjDS8ORcGgXpWx6V+liNs+O3JRD2mb9aeugD7rtkkZ0zgLdYgw0tWsKhsdiezGYptSiMlVazCBTuQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/locate-path": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
|
||||
"integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"p-locate": "^2.0.0",
|
||||
"path-exists": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash.padend": {
|
||||
"version": "4.6.1",
|
||||
"resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.6.1.tgz",
|
||||
"integrity": "sha512-sOQs2aqGpbl27tmCS1QNZA09Uqp01ZzWfDUoD+xzTii0E7dSQfRKcRetFwa+uXaxaqL+TKm7CgD2JdKP7aZBSw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/magicli": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/magicli/-/magicli-0.0.8.tgz",
|
||||
"integrity": "sha512-x/eBenweAHF+DsYy172sK4doRxZl0yrJnfxhLJiN7H6hPM3Ya0PfI6uBZshZ3ScFFSQD7HXgBqMdbnXKEZsO1g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cliss": "0.0.2",
|
||||
"find-up": "^2.1.0",
|
||||
"for-each-property": "0.0.4",
|
||||
"inspect-property": "0.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/node-red-contrib-xlsx-to-json": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/node-red-contrib-xlsx-to-json/-/node-red-contrib-xlsx-to-json-1.0.0.tgz",
|
||||
"integrity": "sha512-8aNrYlrjsq7m9k87CUrQ6QvvswjpsNxZAej4RN5X40/FzwOMoxHwsUFtC4OVtp+ZJaBbMVL+UVR5D8gZmyezvw==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"convert-excel-to-json": "^1.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node.extend": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/node.extend/-/node.extend-2.0.3.tgz",
|
||||
"integrity": "sha512-xwADg/okH48PvBmRZyoX8i8GJaKuJ1CqlqotlZOhUio8egD1P5trJupHKBzcPjSF9ifK2gPcEICRBnkfPqQXZw==",
|
||||
"license": "(MIT OR GPL-2.0)",
|
||||
"dependencies": {
|
||||
"hasown": "^2.0.0",
|
||||
"is": "^3.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/object-to-arguments": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/object-to-arguments/-/object-to-arguments-0.0.8.tgz",
|
||||
"integrity": "sha512-BfWfuAwuhdH1bhMG5EG90WE/eckkBhBvnke8eSEkCDXoLE9Jk5JwYGTbCx1ehGwV48HvBkn62VukPBdlMUOY9w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"inspect-parameters-declaration": "0.0.10",
|
||||
"magicli": "0.0.5",
|
||||
"split-skip": "0.0.2",
|
||||
"stringify-parameters": "0.0.4",
|
||||
"unpack-string": "0.0.2"
|
||||
},
|
||||
"bin": {
|
||||
"object-to-arguments": "bin/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/object-to-arguments/node_modules/inspect-function": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/inspect-function/-/inspect-function-0.2.2.tgz",
|
||||
"integrity": "sha512-becs5gzcHwPrlHawscYkyQ/ShiOiosrXPhA5RVZ3qyWH4aWdD52RnMfXq/dwQXciHwiieD8aIPwdIWYv6eL+sQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"split-skip": "0.0.1",
|
||||
"unpack-string": "0.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/object-to-arguments/node_modules/inspect-function/node_modules/split-skip": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/split-skip/-/split-skip-0.0.1.tgz",
|
||||
"integrity": "sha512-7dkvq+gofI4M8zx4iZnEZ3O1s7FP4Y/iaIDHJh5RyWrs8idcPauFi2OZe3TBi36fLvR2j5z3kSzVtz6IhPdncQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/object-to-arguments/node_modules/inspect-parameters-declaration": {
|
||||
"version": "0.0.10",
|
||||
"resolved": "https://registry.npmjs.org/inspect-parameters-declaration/-/inspect-parameters-declaration-0.0.10.tgz",
|
||||
"integrity": "sha512-L8/Bvt9iDXQTZ63xY5/MAyvzz+FagR/qGh1kIXvUpsno3AAE0Z95d6QO51zrcMGaEGpwh/57idfMxTxbvRmytg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"magicli": "0.0.5",
|
||||
"split-skip": "0.0.2",
|
||||
"stringify-parameters": "0.0.4",
|
||||
"unpack-string": "0.0.2"
|
||||
},
|
||||
"bin": {
|
||||
"inspect-parameters-declaration": "bin/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/object-to-arguments/node_modules/magicli": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/magicli/-/magicli-0.0.5.tgz",
|
||||
"integrity": "sha512-wZbMtnl2v1b+Jp3xlqA9FU/O4I6YhGXR8xSY/eU2+gDAvut/F+W3gl4qs61iL4LELC7jqSAE6aAD5668EbmQHA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"commander": "^2.9.0",
|
||||
"get-stdin": "^5.0.1",
|
||||
"inspect-function": "^0.2.1",
|
||||
"pipe-functions": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/p-limit": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
|
||||
"integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"p-try": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/p-locate": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
|
||||
"integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"p-limit": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/p-try": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
|
||||
"integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/path-exists": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
|
||||
"integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/pipe-functions": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/pipe-functions/-/pipe-functions-1.3.0.tgz",
|
||||
"integrity": "sha512-6Rtbp7criZRwedlvWbUYxqlqJoAlMvYHo2UcRWq79xZ54vZcaNHpVBOcWkX3ErT2aUA69tv+uiv4zKJbhD/Wgg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/printj": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz",
|
||||
"integrity": "sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ==",
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"printj": "bin/printj.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/reduce-flatten": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-1.0.1.tgz",
|
||||
"integrity": "sha512-j5WfFJfc9CoXv/WbwVLHq74i/hdTUpy+iNC534LxczMRP67vJeK3V9JOdnL0N1cIRbn9mYhE2yVjvvKXDxvNXQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/split-skip": {
|
||||
"version": "0.0.2",
|
||||
"resolved": "https://registry.npmjs.org/split-skip/-/split-skip-0.0.2.tgz",
|
||||
"integrity": "sha512-weHOi8BolsDnGIwhhWHbA+wKSuSpvWwjRrdj8SdbIIis2vSwOE37CQP8x3EleuzxanUr3AK8BdUy4MkiOULPZg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/sprintf-js": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/ssf": {
|
||||
"version": "0.10.3",
|
||||
"resolved": "https://registry.npmjs.org/ssf/-/ssf-0.10.3.tgz",
|
||||
"integrity": "sha512-pRuUdW0WwyB2doSqqjWyzwCD6PkfxpHAHdZp39K3dp/Hq7f+xfMwNAWIi16DyrRg4gg9c/RvLYkJTSawTPTm1w==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"frac": "~1.1.2"
|
||||
},
|
||||
"bin": {
|
||||
"ssf": "bin/ssf.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/stringify-parameters": {
|
||||
"version": "0.0.4",
|
||||
"resolved": "https://registry.npmjs.org/stringify-parameters/-/stringify-parameters-0.0.4.tgz",
|
||||
"integrity": "sha512-H3L90ERn5UPtkpO8eugnKcLgpIVlvTyUTrcLGm607AV5JDH6z0GymtNLr3gjGlP6I6NB/mxNX9QpY6jEQGLPdQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"magicli": "0.0.5",
|
||||
"unpack-string": "0.0.2"
|
||||
},
|
||||
"bin": {
|
||||
"stringify-parameters": "bin/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/stringify-parameters/node_modules/inspect-function": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/inspect-function/-/inspect-function-0.2.2.tgz",
|
||||
"integrity": "sha512-becs5gzcHwPrlHawscYkyQ/ShiOiosrXPhA5RVZ3qyWH4aWdD52RnMfXq/dwQXciHwiieD8aIPwdIWYv6eL+sQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"split-skip": "0.0.1",
|
||||
"unpack-string": "0.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/stringify-parameters/node_modules/magicli": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/magicli/-/magicli-0.0.5.tgz",
|
||||
"integrity": "sha512-wZbMtnl2v1b+Jp3xlqA9FU/O4I6YhGXR8xSY/eU2+gDAvut/F+W3gl4qs61iL4LELC7jqSAE6aAD5668EbmQHA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"commander": "^2.9.0",
|
||||
"get-stdin": "^5.0.1",
|
||||
"inspect-function": "^0.2.1",
|
||||
"pipe-functions": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/stringify-parameters/node_modules/split-skip": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/split-skip/-/split-skip-0.0.1.tgz",
|
||||
"integrity": "sha512-7dkvq+gofI4M8zx4iZnEZ3O1s7FP4Y/iaIDHJh5RyWrs8idcPauFi2OZe3TBi36fLvR2j5z3kSzVtz6IhPdncQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/strip-ansi": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
|
||||
"integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-regex": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/table-layout": {
|
||||
"version": "0.4.5",
|
||||
"resolved": "https://registry.npmjs.org/table-layout/-/table-layout-0.4.5.tgz",
|
||||
"integrity": "sha512-zTvf0mcggrGeTe/2jJ6ECkJHAQPIYEwDoqsiqBjI24mvRmQbInK5jq33fyypaCBxX08hMkfmdOqj6haT33EqWw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"array-back": "^2.0.0",
|
||||
"deep-extend": "~0.6.0",
|
||||
"lodash.padend": "^4.6.1",
|
||||
"typical": "^2.6.1",
|
||||
"wordwrapjs": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/typical": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz",
|
||||
"integrity": "sha512-ofhi8kjIje6npGozTip9Fr8iecmYfEbS06i0JnIg+rh51KakryWF4+jX8lLKZVhy6N+ID45WYSFCxPOdTWCzNg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/unpack-string": {
|
||||
"version": "0.0.2",
|
||||
"resolved": "https://registry.npmjs.org/unpack-string/-/unpack-string-0.0.2.tgz",
|
||||
"integrity": "sha512-2ZFjp5aY7QwHE6HAp47RnKYfvgAQ5+NwbKq/ZVtty85RDb3/UaTeCfizo5L/fXzM7UkMP/zDtbV+kGW/iJiK6w==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/wordwrapjs": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-3.0.0.tgz",
|
||||
"integrity": "sha512-mO8XtqyPvykVCsrwj5MlOVWvSnCdT+C+QVbm6blradR7JExAhbkZ7hZ9A+9NUtwzSqrlUo9a67ws0EiILrvRpw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"reduce-flatten": "^1.0.1",
|
||||
"typical": "^2.6.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/xlsx": {
|
||||
"version": "0.12.13",
|
||||
"resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.12.13.tgz",
|
||||
"integrity": "sha512-9/2H4PLphmG8sDvI3mfWb6JIFqbvK8IRGhgS55Pw5F+fmKPuzdv4OW9RFjrH5PiTKeqB/883Z8o+jW3JrDahmw==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"adler-32": "~1.2.0",
|
||||
"cfb": "~1.0.7",
|
||||
"codepage": "~1.13.0",
|
||||
"commander": "~2.15.1",
|
||||
"crc-32": "~1.2.0",
|
||||
"exit-on-epipe": "~1.0.1",
|
||||
"ssf": "~0.10.2"
|
||||
},
|
||||
"bin": {
|
||||
"xlsx": "bin/xlsx.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/yargs-parser": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz",
|
||||
"integrity": "sha512-WhzC+xgstid9MbVUktco/bf+KJG+Uu6vMX0LN1sLJvwmbCQVxb4D8LzogobonKycNasCZLdOzTAk1SK7+K7swg==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"camelcase": "^4.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
14
node_modules/adler-32/LICENSE
generated
vendored
Normal file
14
node_modules/adler-32/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
Copyright (C) 2014-present SheetJS
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
139
node_modules/adler-32/README.md
generated
vendored
Normal file
139
node_modules/adler-32/README.md
generated
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
# adler32
|
||||
|
||||
Signed ADLER-32 algorithm implementation in JS (for the browser and nodejs).
|
||||
Emphasis on correctness, performance, and IE6+ support.
|
||||
|
||||
## Installation
|
||||
|
||||
With [npm](https://www.npmjs.org/package/adler-32):
|
||||
|
||||
```bash
|
||||
$ npm install adler-32
|
||||
```
|
||||
|
||||
In the browser:
|
||||
|
||||
```html
|
||||
<script src="adler32.js"></script>
|
||||
```
|
||||
|
||||
The browser exposes a variable `ADLER32`.
|
||||
|
||||
When installed globally, npm installs a script `adler32` that computes the
|
||||
checksum for a specified file or standard input.
|
||||
|
||||
The script will manipulate `module.exports` if available . This is not always
|
||||
desirable. To prevent the behavior, define `DO_NOT_EXPORT_ADLER`.
|
||||
|
||||
## Usage
|
||||
|
||||
In all cases, the relevant function takes an argument representing data and an
|
||||
optional second argument representing the starting "seed" (for running hash).
|
||||
|
||||
The return value is a signed 32-bit integer.
|
||||
|
||||
- `ADLER32.buf(byte array or buffer[, seed])` assumes the argument is a sequence
|
||||
of 8-bit unsigned integers (nodejs `Buffer`, `Uint8Array` or array of bytes).
|
||||
|
||||
- `ADLER32.bstr(binary string[, seed])` assumes the argument is a binary string
|
||||
where byte `i` is the low byte of the UCS-2 char: `str.charCodeAt(i) & 0xFF`
|
||||
|
||||
- `ADLER32.str(string)` assumes the argument is a standard JS string and
|
||||
calculates the hash of the UTF-8 encoding.
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
// var ADLER32 = require('adler-32'); // uncomment if in node
|
||||
ADLER32.str("SheetJS") // 176947863
|
||||
ADLER32.bstr("SheetJS") // 176947863
|
||||
ADLER32.buf([ 83, 104, 101, 101, 116, 74, 83 ]) // 176947863
|
||||
|
||||
adler32 = ADLER32.buf([83, 104]) // 17825980 "Sh"
|
||||
adler32 = ADLER32.str("eet", adler32) // 95486458 "Sheet"
|
||||
ADLER32.bstr("JS", adler32) // 176947863 "SheetJS"
|
||||
|
||||
[ADLER32.str("\u2603"), ADLER32.str("\u0003")] // [ 73138686, 262148 ]
|
||||
[ADLER32.bstr("\u2603"), ADLER32.bstr("\u0003")] // [ 262148, 262148 ]
|
||||
[ADLER32.buf([0x2603]), ADLER32.buf([0x0003])] // [ 262148, 262148 ]
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
`make test` will run the nodejs-based test.
|
||||
|
||||
To run the in-browser tests, run a local server and go to the `ctest` directory.
|
||||
`make ctestserv` will start a python `SimpleHTTPServer` server on port 8000.
|
||||
|
||||
To update the browser artifacts, run `make ctest`.
|
||||
|
||||
To generate the bits file, use the `adler32` function from python `zlib`:
|
||||
|
||||
```python
|
||||
>>> from zlib import adler32
|
||||
>>> x="foo bar baz٪☃🍣"
|
||||
>>> adler32(x)
|
||||
1543572022
|
||||
>>> adler32(x+x)
|
||||
-2076896149
|
||||
>>> adler32(x+x+x)
|
||||
2023497376
|
||||
```
|
||||
|
||||
The included `adler32.njs` script can process files or standard input:
|
||||
|
||||
```bash
|
||||
$ echo "this is a test" > t.txt
|
||||
$ bin/adler32.njs t.txt
|
||||
726861088
|
||||
```
|
||||
|
||||
For comparison, the included `adler32.py` script uses python `zlib`:
|
||||
|
||||
```bash
|
||||
$ bin/adler32.py t.txt
|
||||
726861088
|
||||
```
|
||||
|
||||
## Performance
|
||||
|
||||
`make perf` will run algorithmic performance tests (which should justify certain
|
||||
decisions in the code).
|
||||
|
||||
Bit twiddling is much faster than taking the mod in Safari and Firefox browsers.
|
||||
Instead of taking the literal mod 65521, it is faster to keep it in the integers
|
||||
by bit-shifting: `65536 ~ 15 mod 65521` so for nonnegative integer `a`:
|
||||
|
||||
```
|
||||
a = (a >>> 16) * 65536 + (a & 65535) [equality]
|
||||
a ~ (a >>> 16) * 15 + (a & 65535) mod 65521
|
||||
```
|
||||
|
||||
The mod is taken at the very end, since the intermediate result may exceed 65521
|
||||
|
||||
## Magic Number
|
||||
|
||||
The magic numbers were chosen so as to not overflow a 31-bit integer:
|
||||
|
||||
```mathematica
|
||||
F[n_] := Reduce[x*(x + 1)*n/2 + (x + 1)*(65521) < (2^31 - 1) && x > 0, x, Integers]
|
||||
F[255] (* bstr: x \[Element] Integers && 1 <= x <= 3854 *)
|
||||
F[127] (* ascii: x \[Element] Integers && 1 <= x <= 5321 *)
|
||||
```
|
||||
|
||||
Subtract up to 4 elements for the Unicode case.
|
||||
|
||||
## License
|
||||
|
||||
Please consult the attached LICENSE file for details. All rights not explicitly
|
||||
granted by the Apache 2.0 license are reserved by the Original Author.
|
||||
|
||||
## Badges
|
||||
|
||||
[](https://saucelabs.com/u/adler32)
|
||||
|
||||
[](https://travis-ci.org/SheetJS/js-adler32)
|
||||
|
||||
[](https://coveralls.io/r/SheetJS/js-adler32?branch=master)
|
||||
|
||||
[](https://github.com/SheetJS/js-adler32)
|
||||
92
node_modules/adler-32/adler32.js
generated
vendored
Normal file
92
node_modules/adler-32/adler32.js
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
/* adler32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
||||
/* vim: set ts=2: */
|
||||
/*exported ADLER32 */
|
||||
var ADLER32;
|
||||
(function (factory) {
|
||||
/*jshint ignore:start */
|
||||
/*eslint-disable */
|
||||
if(typeof DO_NOT_EXPORT_ADLER === 'undefined') {
|
||||
if('object' === typeof exports) {
|
||||
factory(exports);
|
||||
} else if ('function' === typeof define && define.amd) {
|
||||
define(function () {
|
||||
var module = {};
|
||||
factory(module);
|
||||
return module;
|
||||
});
|
||||
} else {
|
||||
factory(ADLER32 = {});
|
||||
}
|
||||
} else {
|
||||
factory(ADLER32 = {});
|
||||
}
|
||||
/*eslint-enable */
|
||||
/*jshint ignore:end */
|
||||
}(function(ADLER32) {
|
||||
ADLER32.version = '1.2.0';
|
||||
function adler32_bstr(bstr, seed) {
|
||||
var a = 1, b = 0, L = bstr.length, M = 0;
|
||||
if(typeof seed === 'number') { a = seed & 0xFFFF; b = seed >>> 16; }
|
||||
for(var i = 0; i < L;) {
|
||||
M = Math.min(L-i, 3850)+i;
|
||||
for(;i<M;i++) {
|
||||
a += bstr.charCodeAt(i)&0xFF;
|
||||
b += a;
|
||||
}
|
||||
a = (15*(a>>>16)+(a&65535));
|
||||
b = (15*(b>>>16)+(b&65535));
|
||||
}
|
||||
return ((b%65521) << 16) | (a%65521);
|
||||
}
|
||||
|
||||
function adler32_buf(buf, seed) {
|
||||
var a = 1, b = 0, L = buf.length, M = 0;
|
||||
if(typeof seed === 'number') { a = seed & 0xFFFF; b = (seed >>> 16) & 0xFFFF; }
|
||||
for(var i = 0; i < L;) {
|
||||
M = Math.min(L-i, 3850)+i;
|
||||
for(;i<M;i++) {
|
||||
a += buf[i]&0xFF;
|
||||
b += a;
|
||||
}
|
||||
a = (15*(a>>>16)+(a&65535));
|
||||
b = (15*(b>>>16)+(b&65535));
|
||||
}
|
||||
return ((b%65521) << 16) | (a%65521);
|
||||
}
|
||||
|
||||
function adler32_str(str, seed) {
|
||||
var a = 1, b = 0, L = str.length, M = 0, c = 0, d = 0;
|
||||
if(typeof seed === 'number') { a = seed & 0xFFFF; b = seed >>> 16; }
|
||||
for(var i = 0; i < L;) {
|
||||
M = Math.min(L-i, 3850);
|
||||
while(M>0) {
|
||||
c = str.charCodeAt(i++);
|
||||
if(c < 0x80) { a += c; }
|
||||
else if(c < 0x800) {
|
||||
a += 192|((c>>6)&31); b += a; --M;
|
||||
a += 128|(c&63);
|
||||
} else if(c >= 0xD800 && c < 0xE000) {
|
||||
c = (c&1023)+64; d = str.charCodeAt(i++) & 1023;
|
||||
a += 240|((c>>8)&7); b += a; --M;
|
||||
a += 128|((c>>2)&63); b += a; --M;
|
||||
a += 128|((d>>6)&15)|((c&3)<<4); b += a; --M;
|
||||
a += 128|(d&63);
|
||||
} else {
|
||||
a += 224|((c>>12)&15); b += a; --M;
|
||||
a += 128|((c>>6)&63); b += a; --M;
|
||||
a += 128|(c&63);
|
||||
}
|
||||
b += a; --M;
|
||||
}
|
||||
a = (15*(a>>>16)+(a&65535));
|
||||
b = (15*(b>>>16)+(b&65535));
|
||||
}
|
||||
return ((b%65521) << 16) | (a%65521);
|
||||
}
|
||||
// $FlowIgnore
|
||||
ADLER32.bstr = adler32_bstr;
|
||||
// $FlowIgnore
|
||||
ADLER32.buf = adler32_buf;
|
||||
// $FlowIgnore
|
||||
ADLER32.str = adler32_str;
|
||||
}));
|
||||
87
node_modules/adler-32/bin/adler32.njs
generated
vendored
Executable file
87
node_modules/adler-32/bin/adler32.njs
generated
vendored
Executable file
@@ -0,0 +1,87 @@
|
||||
#!/usr/bin/env node
|
||||
/* adler32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
||||
/* eslint-env node */
|
||||
/* vim: set ts=2 ft=javascript: */
|
||||
/*jshint node:true */
|
||||
|
||||
var X/*:ADLER32Module*/;
|
||||
try { X = require('../'); } catch(e) { X = require('adler-32'); }
|
||||
|
||||
function help()/*:number*/ {
|
||||
[
|
||||
"usage: adler32 [options] [filename]",
|
||||
"",
|
||||
"Options:",
|
||||
" -h, --help output usage information",
|
||||
" -V, --version output the version number",
|
||||
" -S, --seed=<n> use integer seed as starting value (default 1)",
|
||||
" -H, --hex-seed=<h> use hex seed as starting value (default 1)",
|
||||
" -d, --signed print result with format `%d` (default)",
|
||||
" -u, --unsigned print result with format `%u`",
|
||||
" -x, --hex print result with format `%0.8x`",
|
||||
" -X, --HEX print result with format `%0.8X`",
|
||||
" -F, --format=<s> use specified printf format",
|
||||
"",
|
||||
"Set filename = '-' or pipe data into adler32 to read from stdin",
|
||||
"Default output mode is signed (-d)",
|
||||
""
|
||||
].forEach(function(l) { console.log(l); });
|
||||
return 0;
|
||||
}
|
||||
|
||||
function version()/*:number*/ { console.log(X.version); return 0; }
|
||||
|
||||
var fs = require('fs');
|
||||
require('exit-on-epipe');
|
||||
|
||||
function die(msg/*:string*/, ec/*:?number*/)/*:void*/ { console.error(msg); process.exit(ec || 0); }
|
||||
|
||||
var args/*:Array<string>*/ = process.argv.slice(2);
|
||||
var filename/*:string*/ = "";
|
||||
var fmt/*:string*/ = "";
|
||||
var seed = 1, r = 10;
|
||||
|
||||
for(var i = 0; i < args.length; ++i) {
|
||||
var arg = args[i];
|
||||
if(arg.charCodeAt(0) != 45) { if(filename === "") filename = arg; continue; }
|
||||
var m = arg.indexOf("=") == -1 ? arg : arg.substr(0, arg.indexOf("="));
|
||||
switch(m) {
|
||||
case "-": filename = "-"; break;
|
||||
|
||||
case "--help": case "-h": process.exit(help()); break;
|
||||
case "--version": case "-V": process.exit(version()); break;
|
||||
|
||||
case "--signed": case "-d": fmt = "%d"; break;
|
||||
case "--unsigned": case "-u": fmt = "%u"; break;
|
||||
case "--hex": case "-x": fmt = "%0.8x"; break;
|
||||
case "--HEX": case "-X": fmt = "%0.8X"; break;
|
||||
case "--format": case "-F":
|
||||
fmt = ((m!=arg) ? arg.substr(m.length+1) : args[++i])||""; break;
|
||||
|
||||
case "--hex-seed": case "-H": r = 16;
|
||||
/* falls through */
|
||||
case "--seed": case "-S":
|
||||
seed=parseInt((m!=arg) ? arg.substr(m.length+1) : args[++i], r)||1; break;
|
||||
|
||||
default: die("adler32: unrecognized option `" + arg + "'", 22);
|
||||
}
|
||||
}
|
||||
|
||||
if(!process.stdin.isTTY) filename = filename || "-";
|
||||
if(filename.length===0) die("adler32: must specify a filename ('-' for stdin)",1);
|
||||
|
||||
var adler32 = seed;
|
||||
// $FlowIgnore -- Writable is callable but type sig disagrees
|
||||
var writable = require('stream').Writable();
|
||||
writable._write = function(chunk, e, cb) { adler32 = X.buf(chunk, adler32); cb(); };
|
||||
writable._writev = function(chunks, cb) {
|
||||
chunks.forEach(function(c) { adler32 = X.buf(c.chunk, adler32);});
|
||||
cb();
|
||||
};
|
||||
writable.on('finish', function() {
|
||||
console.log(fmt === "" ? adler32 : require("printj").sprintf(fmt, adler32));
|
||||
});
|
||||
|
||||
if(filename === "-") process.stdin.pipe(writable);
|
||||
else if(fs.existsSync(filename)) fs.createReadStream(filename).pipe(writable);
|
||||
else die("adler32: " + filename + ": No such file or directory", 2);
|
||||
42
node_modules/adler-32/package.json
generated
vendored
Normal file
42
node_modules/adler-32/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "adler-32",
|
||||
"version": "1.2.0",
|
||||
"author": "sheetjs",
|
||||
"description": "Pure-JS ADLER-32",
|
||||
"keywords": [ "adler32", "checksum" ],
|
||||
"bin": {
|
||||
"adler32": "./bin/adler32.njs"
|
||||
},
|
||||
"main": "./adler32",
|
||||
"types": "types",
|
||||
"dependencies": {
|
||||
"printj":"~1.1.0",
|
||||
"exit-on-epipe":"~1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha":"~2.5.3",
|
||||
"blanket": "~1.2.3",
|
||||
"codepage":"~1.10.0",
|
||||
"@sheetjs/uglify-js":"~2.7.3",
|
||||
"@types/node":"^8.0.7",
|
||||
"dtslint": "^0.1.2",
|
||||
"typescript": "2.2.0"
|
||||
},
|
||||
"repository": { "type":"git", "url":"git://github.com/SheetJS/js-adler32.git" },
|
||||
"scripts": {
|
||||
"test": "make test",
|
||||
"build": "make",
|
||||
"lint": "make fullint",
|
||||
"dtslint": "dtslint types"
|
||||
},
|
||||
"config": {
|
||||
"blanket": {
|
||||
"pattern": "adler32.js"
|
||||
}
|
||||
},
|
||||
"homepage": "http://sheetjs.com/opensource",
|
||||
"files": ["adler32.js", "bin/adler32.njs", "LICENSE", "README.md", "types/index.d.ts", "types/*.json"],
|
||||
"bugs": { "url": "https://github.com/SheetJS/js-adler32/issues" },
|
||||
"license": "Apache-2.0",
|
||||
"engines": { "node": ">=0.8" }
|
||||
}
|
||||
14
node_modules/adler-32/types/index.d.ts
generated
vendored
Normal file
14
node_modules/adler-32/types/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/* adler32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/** Version string */
|
||||
export const version: string;
|
||||
|
||||
/** Process a node buffer or byte array */
|
||||
export function buf(data: number[] | Uint8Array, seed?: number): number;
|
||||
|
||||
/** Process a binary string */
|
||||
export function bstr(data: string, seed?: number): number;
|
||||
|
||||
/** Process a JS string based on the UTF8 encoding */
|
||||
export function str(data: string, seed?: number): number;
|
||||
14
node_modules/adler-32/types/tsconfig.json
generated
vendored
Normal file
14
node_modules/adler-32/types/tsconfig.json
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [ "es5" ],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": ".",
|
||||
"paths": { "adler-32": ["."] },
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
11
node_modules/adler-32/types/tslint.json
generated
vendored
Normal file
11
node_modules/adler-32/types/tslint.json
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "dtslint/dtslint.json",
|
||||
"rules": {
|
||||
"whitespace": false,
|
||||
"no-sparse-arrays": false,
|
||||
"only-arrow-functions": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"one-variable-per-declaration": false
|
||||
}
|
||||
}
|
||||
7
node_modules/ansi-escape-sequences/.travis.yml
generated
vendored
Normal file
7
node_modules/ansi-escape-sequences/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 4
|
||||
- 6
|
||||
- 8
|
||||
- 10
|
||||
- 11
|
||||
21
node_modules/ansi-escape-sequences/LICENSE
generated
vendored
Normal file
21
node_modules/ansi-escape-sequences/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-19 Lloyd Brookes <75pound@gmail.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.
|
||||
47
node_modules/ansi-escape-sequences/README.hbs
generated
vendored
Normal file
47
node_modules/ansi-escape-sequences/README.hbs
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
[](https://www.npmjs.org/package/ansi-escape-sequences)
|
||||
[](https://www.npmjs.org/package/ansi-escape-sequences)
|
||||
[](https://travis-ci.org/75lb/ansi-escape-sequences)
|
||||
[](https://david-dm.org/75lb/ansi-escape-sequences)
|
||||
[](https://github.com/feross/standard)
|
||||
|
||||
# ansi-escape-sequences
|
||||
A simple library containing all known terminal [ansi escape codes and sequences](http://en.wikipedia.org/wiki/ANSI_escape_code). Useful for adding colour to your command-line output, or building a dynamic text user interface.
|
||||
|
||||
## API Reference
|
||||
{{#module name="ansi-escape-sequences"}}
|
||||
{{>body~}}
|
||||
{{>member-index~}}
|
||||
{{>members~}}
|
||||
{{/module}}
|
||||
|
||||
## Load anywhere
|
||||
|
||||
This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.
|
||||
|
||||
Node.js:
|
||||
|
||||
```js
|
||||
const ansi = require('ansi-escape-sequences')
|
||||
```
|
||||
|
||||
Within Node.js with ECMAScript Module support enabled:
|
||||
|
||||
```js
|
||||
import ansi from 'ansi-escape-sequences'
|
||||
```
|
||||
|
||||
Within a modern browser ECMAScript Module:
|
||||
|
||||
```js
|
||||
import ansi from './node_modules/ansi-escape-sequences/dist/index.mjs'
|
||||
```
|
||||
|
||||
Old browser (adds `window.ansi`):
|
||||
|
||||
```html
|
||||
<script nomodule src="./node_modules/ansi-escape-sequences/dist/index.js"></script>
|
||||
```
|
||||
|
||||
* * *
|
||||
|
||||
© 2014-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).
|
||||
310
node_modules/ansi-escape-sequences/README.md
generated
vendored
Normal file
310
node_modules/ansi-escape-sequences/README.md
generated
vendored
Normal file
@@ -0,0 +1,310 @@
|
||||
[](https://www.npmjs.org/package/ansi-escape-sequences)
|
||||
[](https://www.npmjs.org/package/ansi-escape-sequences)
|
||||
[](https://travis-ci.org/75lb/ansi-escape-sequences)
|
||||
[](https://david-dm.org/75lb/ansi-escape-sequences)
|
||||
[](https://github.com/feross/standard)
|
||||
|
||||
# ansi-escape-sequences
|
||||
A simple library containing all known terminal [ansi escape codes and sequences](http://en.wikipedia.org/wiki/ANSI_escape_code). Useful for adding colour to your command-line output, or building a dynamic text user interface.
|
||||
|
||||
## API Reference
|
||||
**Example**
|
||||
```js
|
||||
const ansi = require('ansi-escape-sequences')
|
||||
```
|
||||
|
||||
* [ansi-escape-sequences](#module_ansi-escape-sequences)
|
||||
* [.cursor](#module_ansi-escape-sequences.cursor)
|
||||
* [.hide](#module_ansi-escape-sequences.cursor.hide)
|
||||
* [.show](#module_ansi-escape-sequences.cursor.show)
|
||||
* [.up([lines])](#module_ansi-escape-sequences.cursor.up) ⇒ <code>string</code>
|
||||
* [.down([lines])](#module_ansi-escape-sequences.cursor.down) ⇒ <code>string</code>
|
||||
* [.forward([lines])](#module_ansi-escape-sequences.cursor.forward) ⇒ <code>string</code>
|
||||
* [.back([lines])](#module_ansi-escape-sequences.cursor.back) ⇒ <code>string</code>
|
||||
* [.nextLine([lines])](#module_ansi-escape-sequences.cursor.nextLine) ⇒ <code>string</code>
|
||||
* [.previousLine([lines])](#module_ansi-escape-sequences.cursor.previousLine) ⇒ <code>string</code>
|
||||
* [.horizontalAbsolute(n)](#module_ansi-escape-sequences.cursor.horizontalAbsolute) ⇒ <code>string</code>
|
||||
* [.position(n, m)](#module_ansi-escape-sequences.cursor.position) ⇒ <code>string</code>
|
||||
* [.erase](#module_ansi-escape-sequences.erase)
|
||||
* [.display(n)](#module_ansi-escape-sequences.erase.display) ⇒ <code>string</code>
|
||||
* [.inLine(n)](#module_ansi-escape-sequences.erase.inLine) ⇒ <code>string</code>
|
||||
* [.style](#module_ansi-escape-sequences.style) : <code>enum</code>
|
||||
* [.styles(effectArray)](#module_ansi-escape-sequences.styles) ⇒ <code>string</code>
|
||||
* [.format(str, [styleArray])](#module_ansi-escape-sequences.format) ⇒ <code>string</code>
|
||||
|
||||
<a name="module_ansi-escape-sequences.cursor"></a>
|
||||
|
||||
## ansi.cursor
|
||||
cursor-related sequences
|
||||
|
||||
**Kind**: static property of [<code>ansi-escape-sequences</code>](#module_ansi-escape-sequences)
|
||||
|
||||
* [.cursor](#module_ansi-escape-sequences.cursor)
|
||||
* [.hide](#module_ansi-escape-sequences.cursor.hide)
|
||||
* [.show](#module_ansi-escape-sequences.cursor.show)
|
||||
* [.up([lines])](#module_ansi-escape-sequences.cursor.up) ⇒ <code>string</code>
|
||||
* [.down([lines])](#module_ansi-escape-sequences.cursor.down) ⇒ <code>string</code>
|
||||
* [.forward([lines])](#module_ansi-escape-sequences.cursor.forward) ⇒ <code>string</code>
|
||||
* [.back([lines])](#module_ansi-escape-sequences.cursor.back) ⇒ <code>string</code>
|
||||
* [.nextLine([lines])](#module_ansi-escape-sequences.cursor.nextLine) ⇒ <code>string</code>
|
||||
* [.previousLine([lines])](#module_ansi-escape-sequences.cursor.previousLine) ⇒ <code>string</code>
|
||||
* [.horizontalAbsolute(n)](#module_ansi-escape-sequences.cursor.horizontalAbsolute) ⇒ <code>string</code>
|
||||
* [.position(n, m)](#module_ansi-escape-sequences.cursor.position) ⇒ <code>string</code>
|
||||
|
||||
<a name="module_ansi-escape-sequences.cursor.hide"></a>
|
||||
|
||||
### cursor.hide
|
||||
Hides the cursor
|
||||
|
||||
**Kind**: static property of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
|
||||
<a name="module_ansi-escape-sequences.cursor.show"></a>
|
||||
|
||||
### cursor.show
|
||||
Shows the cursor
|
||||
|
||||
**Kind**: static property of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
|
||||
<a name="module_ansi-escape-sequences.cursor.up"></a>
|
||||
|
||||
### cursor.up([lines]) ⇒ <code>string</code>
|
||||
Moves the cursor `lines` cells up. If the cursor is already at the edge of the screen, this has no effect
|
||||
|
||||
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
|
||||
|
||||
| Param | Type | Default |
|
||||
| --- | --- | --- |
|
||||
| [lines] | <code>number</code> | <code>1</code> |
|
||||
|
||||
<a name="module_ansi-escape-sequences.cursor.down"></a>
|
||||
|
||||
### cursor.down([lines]) ⇒ <code>string</code>
|
||||
Moves the cursor `lines` cells down. If the cursor is already at the edge of the screen, this has no effect
|
||||
|
||||
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
|
||||
|
||||
| Param | Type | Default |
|
||||
| --- | --- | --- |
|
||||
| [lines] | <code>number</code> | <code>1</code> |
|
||||
|
||||
<a name="module_ansi-escape-sequences.cursor.forward"></a>
|
||||
|
||||
### cursor.forward([lines]) ⇒ <code>string</code>
|
||||
Moves the cursor `lines` cells forward. If the cursor is already at the edge of the screen, this has no effect
|
||||
|
||||
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
|
||||
|
||||
| Param | Type | Default |
|
||||
| --- | --- | --- |
|
||||
| [lines] | <code>number</code> | <code>1</code> |
|
||||
|
||||
<a name="module_ansi-escape-sequences.cursor.back"></a>
|
||||
|
||||
### cursor.back([lines]) ⇒ <code>string</code>
|
||||
Moves the cursor `lines` cells back. If the cursor is already at the edge of the screen, this has no effect
|
||||
|
||||
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
|
||||
|
||||
| Param | Type | Default |
|
||||
| --- | --- | --- |
|
||||
| [lines] | <code>number</code> | <code>1</code> |
|
||||
|
||||
<a name="module_ansi-escape-sequences.cursor.nextLine"></a>
|
||||
|
||||
### cursor.nextLine([lines]) ⇒ <code>string</code>
|
||||
Moves cursor to beginning of the line n lines down.
|
||||
|
||||
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
|
||||
|
||||
| Param | Type | Default |
|
||||
| --- | --- | --- |
|
||||
| [lines] | <code>number</code> | <code>1</code> |
|
||||
|
||||
<a name="module_ansi-escape-sequences.cursor.previousLine"></a>
|
||||
|
||||
### cursor.previousLine([lines]) ⇒ <code>string</code>
|
||||
Moves cursor to beginning of the line n lines up.
|
||||
|
||||
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
|
||||
|
||||
| Param | Type | Default |
|
||||
| --- | --- | --- |
|
||||
| [lines] | <code>number</code> | <code>1</code> |
|
||||
|
||||
<a name="module_ansi-escape-sequences.cursor.horizontalAbsolute"></a>
|
||||
|
||||
### cursor.horizontalAbsolute(n) ⇒ <code>string</code>
|
||||
Moves the cursor to column n.
|
||||
|
||||
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| n | <code>number</code> | column number |
|
||||
|
||||
<a name="module_ansi-escape-sequences.cursor.position"></a>
|
||||
|
||||
### cursor.position(n, m) ⇒ <code>string</code>
|
||||
Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted.
|
||||
|
||||
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| n | <code>number</code> | row number |
|
||||
| m | <code>number</code> | column number |
|
||||
|
||||
<a name="module_ansi-escape-sequences.erase"></a>
|
||||
|
||||
## ansi.erase
|
||||
erase sequences
|
||||
|
||||
**Kind**: static property of [<code>ansi-escape-sequences</code>](#module_ansi-escape-sequences)
|
||||
|
||||
* [.erase](#module_ansi-escape-sequences.erase)
|
||||
* [.display(n)](#module_ansi-escape-sequences.erase.display) ⇒ <code>string</code>
|
||||
* [.inLine(n)](#module_ansi-escape-sequences.erase.inLine) ⇒ <code>string</code>
|
||||
|
||||
<a name="module_ansi-escape-sequences.erase.display"></a>
|
||||
|
||||
### erase.display(n) ⇒ <code>string</code>
|
||||
Clears part of the screen. If n is 0 (or missing), clear from cursor to end of screen. If n is 1, clear from cursor to beginning of the screen. If n is 2, clear entire screen.
|
||||
|
||||
**Kind**: static method of [<code>erase</code>](#module_ansi-escape-sequences.erase)
|
||||
|
||||
| Param | Type |
|
||||
| --- | --- |
|
||||
| n | <code>number</code> |
|
||||
|
||||
<a name="module_ansi-escape-sequences.erase.inLine"></a>
|
||||
|
||||
### erase.inLine(n) ⇒ <code>string</code>
|
||||
Erases part of the line. If n is zero (or missing), clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change.
|
||||
|
||||
**Kind**: static method of [<code>erase</code>](#module_ansi-escape-sequences.erase)
|
||||
|
||||
| Param | Type |
|
||||
| --- | --- |
|
||||
| n | <code>number</code> |
|
||||
|
||||
<a name="module_ansi-escape-sequences.style"></a>
|
||||
|
||||
## ansi.style : <code>enum</code>
|
||||
Various formatting styles (aka Select Graphic Rendition codes).
|
||||
|
||||
**Kind**: static enum of [<code>ansi-escape-sequences</code>](#module_ansi-escape-sequences)
|
||||
**Properties**
|
||||
|
||||
| Name | Type | Default |
|
||||
| --- | --- | --- |
|
||||
| reset | <code>string</code> | <code>"\u001b[0m"</code> |
|
||||
| bold | <code>string</code> | <code>"\u001b[1m"</code> |
|
||||
| italic | <code>string</code> | <code>"\u001b[3m"</code> |
|
||||
| underline | <code>string</code> | <code>"\u001b[4m"</code> |
|
||||
| fontDefault | <code>string</code> | <code>"\u001b[10m"</code> |
|
||||
| font2 | <code>string</code> | <code>"\u001b[11m"</code> |
|
||||
| font3 | <code>string</code> | <code>"\u001b[12m"</code> |
|
||||
| font4 | <code>string</code> | <code>"\u001b[13m"</code> |
|
||||
| font5 | <code>string</code> | <code>"\u001b[14m"</code> |
|
||||
| font6 | <code>string</code> | <code>"\u001b[15m"</code> |
|
||||
| imageNegative | <code>string</code> | <code>"\u001b[7m"</code> |
|
||||
| imagePositive | <code>string</code> | <code>"\u001b[27m"</code> |
|
||||
| black | <code>string</code> | <code>"\u001b[30m"</code> |
|
||||
| red | <code>string</code> | <code>"\u001b[31m"</code> |
|
||||
| green | <code>string</code> | <code>"\u001b[32m"</code> |
|
||||
| yellow | <code>string</code> | <code>"\u001b[33m"</code> |
|
||||
| blue | <code>string</code> | <code>"\u001b[34m"</code> |
|
||||
| magenta | <code>string</code> | <code>"\u001b[35m"</code> |
|
||||
| cyan | <code>string</code> | <code>"\u001b[36m"</code> |
|
||||
| white | <code>string</code> | <code>"\u001b[37m"</code> |
|
||||
| grey | <code>string</code> | <code>"\u001b[90m"</code> |
|
||||
| gray | <code>string</code> | <code>"\u001b[90m"</code> |
|
||||
| "bg-black" | <code>string</code> | <code>"\u001b[40m"</code> |
|
||||
| "bg-red" | <code>string</code> | <code>"\u001b[41m"</code> |
|
||||
| "bg-green" | <code>string</code> | <code>"\u001b[42m"</code> |
|
||||
| "bg-yellow" | <code>string</code> | <code>"\u001b[43m"</code> |
|
||||
| "bg-blue" | <code>string</code> | <code>"\u001b[44m"</code> |
|
||||
| "bg-magenta" | <code>string</code> | <code>"\u001b[45m"</code> |
|
||||
| "bg-cyan" | <code>string</code> | <code>"\u001b[46m"</code> |
|
||||
| "bg-white" | <code>string</code> | <code>"\u001b[47m"</code> |
|
||||
| "bg-grey" | <code>string</code> | <code>"\u001b[100m"</code> |
|
||||
| "bg-gray" | <code>string</code> | <code>"\u001b[100m"</code> |
|
||||
|
||||
**Example**
|
||||
```js
|
||||
console.log(ansi.style.red + 'this is red' + ansi.style.reset)
|
||||
```
|
||||
<a name="module_ansi-escape-sequences.styles"></a>
|
||||
|
||||
## ansi.styles(effectArray) ⇒ <code>string</code>
|
||||
Returns an ansi sequence setting one or more effects
|
||||
|
||||
**Kind**: static method of [<code>ansi-escape-sequences</code>](#module_ansi-escape-sequences)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| effectArray | <code>string</code> \| <code>Array.<string></code> | a style, or list or styles |
|
||||
|
||||
**Example**
|
||||
```js
|
||||
> ansi.styles('green')
|
||||
'\u001b[32m'
|
||||
|
||||
> ansi.styles([ 'green', 'underline' ])
|
||||
'\u001b[32;4m'
|
||||
```
|
||||
<a name="module_ansi-escape-sequences.format"></a>
|
||||
|
||||
## ansi.format(str, [styleArray]) ⇒ <code>string</code>
|
||||
A convenience function, applying the provided styles to the input string and then resetting.
|
||||
|
||||
Inline styling can be applied using the syntax `[style-list]{text to format}`, where `style-list` is a space-separated list of styles from [ansi.style](#module_ansi-escape-sequences.style). For example `[bold white bg-red]{bold white text on a red background}`.
|
||||
|
||||
**Kind**: static method of [<code>ansi-escape-sequences</code>](#module_ansi-escape-sequences)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| str | <code>string</code> | the string to format |
|
||||
| [styleArray] | <code>Array.<string></code> | a list of styles to add to the input string |
|
||||
|
||||
**Example**
|
||||
```js
|
||||
> ansi.format('what?', 'green')
|
||||
'\u001b[32mwhat?\u001b[0m'
|
||||
|
||||
> ansi.format('what?', ['green', 'bold'])
|
||||
'\u001b[32;1mwhat?\u001b[0m'
|
||||
|
||||
> ansi.format('[green bold]{what?}')
|
||||
'\u001b[32;1mwhat?\u001b[0m'
|
||||
```
|
||||
|
||||
## Load anywhere
|
||||
|
||||
This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.
|
||||
|
||||
Node.js:
|
||||
|
||||
```js
|
||||
const ansi = require('ansi-escape-sequences')
|
||||
```
|
||||
|
||||
Within Node.js with ECMAScript Module support enabled:
|
||||
|
||||
```js
|
||||
import ansi from 'ansi-escape-sequences'
|
||||
```
|
||||
|
||||
Within a modern browser ECMAScript Module:
|
||||
|
||||
```js
|
||||
import ansi from './node_modules/ansi-escape-sequences/dist/index.mjs'
|
||||
```
|
||||
|
||||
Old browser (adds `window.ansi`):
|
||||
|
||||
```html
|
||||
<script nomodule src="./node_modules/ansi-escape-sequences/dist/index.js"></script>
|
||||
```
|
||||
|
||||
* * *
|
||||
|
||||
© 2014-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).
|
||||
298
node_modules/ansi-escape-sequences/dist/index.js
generated
vendored
Normal file
298
node_modules/ansi-escape-sequences/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,298 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = global || self, global.ansi = factory());
|
||||
}(this, function () { 'use strict';
|
||||
|
||||
/**
|
||||
* Takes any input and guarantees an array back.
|
||||
*
|
||||
* - converts array-like objects (e.g. `arguments`) to a real array
|
||||
* - converts `undefined` to an empty array
|
||||
* - converts any another other, singular value (including `null`) into an array containing that value
|
||||
* - ignores input which is already an array
|
||||
*
|
||||
* @module array-back
|
||||
* @example
|
||||
* > const arrayify = require('array-back')
|
||||
*
|
||||
* > arrayify(undefined)
|
||||
* []
|
||||
*
|
||||
* > arrayify(null)
|
||||
* [ null ]
|
||||
*
|
||||
* > arrayify(0)
|
||||
* [ 0 ]
|
||||
*
|
||||
* > arrayify([ 1, 2 ])
|
||||
* [ 1, 2 ]
|
||||
*
|
||||
* > function f(){ return arrayify(arguments); }
|
||||
* > f(1,2,3)
|
||||
* [ 1, 2, 3 ]
|
||||
*/
|
||||
|
||||
function isObject (input) {
|
||||
return typeof input === 'object' && input !== null
|
||||
}
|
||||
|
||||
function isArrayLike (input) {
|
||||
return isObject(input) && typeof input.length === 'number'
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {*} - the input value to convert to an array
|
||||
* @returns {Array}
|
||||
* @alias module:array-back
|
||||
*/
|
||||
function arrayify (input) {
|
||||
if (Array.isArray(input)) {
|
||||
return input
|
||||
} else {
|
||||
if (input === undefined) {
|
||||
return []
|
||||
} else if (isArrayLike(input)) {
|
||||
return Array.prototype.slice.call(input)
|
||||
} else {
|
||||
return [ input ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Control Sequence Initiator */
|
||||
const csi = '\x1b[';
|
||||
|
||||
/**
|
||||
* @exports ansi-escape-sequences
|
||||
* @typicalname ansi
|
||||
* @example
|
||||
* const ansi = require('ansi-escape-sequences')
|
||||
*/
|
||||
const ansi = {};
|
||||
|
||||
/**
|
||||
* Various formatting styles (aka Select Graphic Rendition codes).
|
||||
* @enum {string}
|
||||
* @example
|
||||
* console.log(ansi.style.red + 'this is red' + ansi.style.reset)
|
||||
*/
|
||||
ansi.style = {
|
||||
reset: '\x1b[0m',
|
||||
bold: '\x1b[1m',
|
||||
italic: '\x1b[3m',
|
||||
underline: '\x1b[4m',
|
||||
fontDefault: '\x1b[10m',
|
||||
font2: '\x1b[11m',
|
||||
font3: '\x1b[12m',
|
||||
font4: '\x1b[13m',
|
||||
font5: '\x1b[14m',
|
||||
font6: '\x1b[15m',
|
||||
imageNegative: '\x1b[7m',
|
||||
imagePositive: '\x1b[27m',
|
||||
black: '\x1b[30m',
|
||||
red: '\x1b[31m',
|
||||
green: '\x1b[32m',
|
||||
yellow: '\x1b[33m',
|
||||
blue: '\x1b[34m',
|
||||
magenta: '\x1b[35m',
|
||||
cyan: '\x1b[36m',
|
||||
white: '\x1b[37m',
|
||||
grey: '\x1b[90m',
|
||||
gray: '\x1b[90m',
|
||||
'bg-black': '\x1b[40m',
|
||||
'bg-red': '\x1b[41m',
|
||||
'bg-green': '\x1b[42m',
|
||||
'bg-yellow': '\x1b[43m',
|
||||
'bg-blue': '\x1b[44m',
|
||||
'bg-magenta': '\x1b[45m',
|
||||
'bg-cyan': '\x1b[46m',
|
||||
'bg-white': '\x1b[47m',
|
||||
'bg-grey': '\x1b[100m',
|
||||
'bg-gray': '\x1b[100m'
|
||||
};
|
||||
|
||||
/**
|
||||
* style enum - used by `ansi.styles()`.
|
||||
* @enum {number}
|
||||
* @private
|
||||
*/
|
||||
const eStyles = {
|
||||
reset: 0,
|
||||
bold: 1,
|
||||
italic: 3,
|
||||
underline: 4,
|
||||
imageNegative: 7,
|
||||
fontDefault: 10,
|
||||
font2: 11,
|
||||
font3: 12,
|
||||
font4: 13,
|
||||
font5: 14,
|
||||
font6: 15,
|
||||
imagePositive: 27,
|
||||
black: 30,
|
||||
red: 31,
|
||||
green: 32,
|
||||
yellow: 33,
|
||||
blue: 34,
|
||||
magenta: 35,
|
||||
cyan: 36,
|
||||
white: 37,
|
||||
grey: 90,
|
||||
gray: 90,
|
||||
'bg-black': 40,
|
||||
'bg-red': 41,
|
||||
'bg-green': 42,
|
||||
'bg-yellow': 43,
|
||||
'bg-blue': 44,
|
||||
'bg-magenta': 45,
|
||||
'bg-cyan': 46,
|
||||
'bg-white': 47,
|
||||
'bg-grey': 100,
|
||||
'bg-gray': 100
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns an ansi sequence setting one or more effects
|
||||
* @param {string | string[]} - a style, or list or styles
|
||||
* @returns {string}
|
||||
* @example
|
||||
* > ansi.styles('green')
|
||||
* '\u001b[32m'
|
||||
*
|
||||
* > ansi.styles([ 'green', 'underline' ])
|
||||
* '\u001b[32;4m'
|
||||
*/
|
||||
ansi.styles = function (effectArray) {
|
||||
effectArray = arrayify(effectArray);
|
||||
return csi + effectArray.map(function (effect) { return eStyles[effect] }).join(';') + 'm'
|
||||
};
|
||||
|
||||
/**
|
||||
* A convenience function, applying the provided styles to the input string and then resetting.
|
||||
*
|
||||
* Inline styling can be applied using the syntax `[style-list]{text to format}`, where `style-list` is a space-separated list of styles from {@link module:ansi-escape-sequences.style ansi.style}. For example `[bold white bg-red]{bold white text on a red background}`.
|
||||
*
|
||||
* @param {string} - the string to format
|
||||
* @param [styleArray] {string[]} - a list of styles to add to the input string
|
||||
* @returns {string}
|
||||
* @example
|
||||
* > ansi.format('what?', 'green')
|
||||
* '\u001b[32mwhat?\u001b[0m'
|
||||
*
|
||||
* > ansi.format('what?', ['green', 'bold'])
|
||||
* '\u001b[32;1mwhat?\u001b[0m'
|
||||
*
|
||||
* > ansi.format('[green bold]{what?}')
|
||||
* '\u001b[32;1mwhat?\u001b[0m'
|
||||
*/
|
||||
ansi.format = function (str, styleArray) {
|
||||
const re = /\[([\w\s-]+)\]{([^]*?)}/;
|
||||
let matches;
|
||||
if (!str) return ''
|
||||
|
||||
while (matches = str.match(re)) {
|
||||
const inlineStyles = matches[1].split(/\s+/);
|
||||
const inlineString = matches[2];
|
||||
str = str.replace(matches[0], ansi.format(inlineString, inlineStyles));
|
||||
}
|
||||
|
||||
return (styleArray && styleArray.length)
|
||||
? ansi.styles(styleArray) + str + ansi.style.reset
|
||||
: str
|
||||
};
|
||||
|
||||
/**
|
||||
* cursor-related sequences
|
||||
*/
|
||||
ansi.cursor = {
|
||||
/**
|
||||
* Moves the cursor `lines` cells up. If the cursor is already at the edge of the screen, this has no effect
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
up: function (lines) { return csi + (lines || 1) + 'A' },
|
||||
|
||||
/**
|
||||
* Moves the cursor `lines` cells down. If the cursor is already at the edge of the screen, this has no effect
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
down: function (lines) { return csi + (lines || 1) + 'B' },
|
||||
|
||||
/**
|
||||
* Moves the cursor `lines` cells forward. If the cursor is already at the edge of the screen, this has no effect
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
forward: function (lines) { return csi + (lines || 1) + 'C' },
|
||||
|
||||
/**
|
||||
* Moves the cursor `lines` cells back. If the cursor is already at the edge of the screen, this has no effect
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
back: function (lines) { return csi + (lines || 1) + 'D' },
|
||||
|
||||
/**
|
||||
* Moves cursor to beginning of the line n lines down.
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
nextLine: function (lines) { return csi + (lines || 1) + 'E' },
|
||||
|
||||
/**
|
||||
* Moves cursor to beginning of the line n lines up.
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
previousLine: function (lines) { return csi + (lines || 1) + 'F' },
|
||||
|
||||
/**
|
||||
* Moves the cursor to column n.
|
||||
* @param n {number} - column number
|
||||
* @return {string}
|
||||
*/
|
||||
horizontalAbsolute: function (n) { return csi + n + 'G' },
|
||||
|
||||
/**
|
||||
* Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted.
|
||||
* @param n {number} - row number
|
||||
* @param m {number} - column number
|
||||
* @return {string}
|
||||
*/
|
||||
position: function (n, m) { return csi + (n || 1) + ';' + (m || 1) + 'H' },
|
||||
|
||||
/**
|
||||
* Hides the cursor
|
||||
*/
|
||||
hide: csi + '?25l',
|
||||
|
||||
/**
|
||||
* Shows the cursor
|
||||
*/
|
||||
show: csi + '?25h'
|
||||
};
|
||||
|
||||
/**
|
||||
* erase sequences
|
||||
*/
|
||||
ansi.erase = {
|
||||
/**
|
||||
* Clears part of the screen. If n is 0 (or missing), clear from cursor to end of screen. If n is 1, clear from cursor to beginning of the screen. If n is 2, clear entire screen.
|
||||
* @param n {number}
|
||||
* @return {string}
|
||||
*/
|
||||
display: function (n) { return csi + (n || 0) + 'J' },
|
||||
|
||||
/**
|
||||
* Erases part of the line. If n is zero (or missing), clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change.
|
||||
* @param n {number}
|
||||
* @return {string}
|
||||
*/
|
||||
inLine: function (n) { return csi + (n || 0) + 'K' }
|
||||
};
|
||||
|
||||
return ansi;
|
||||
|
||||
}));
|
||||
290
node_modules/ansi-escape-sequences/dist/index.mjs
generated
vendored
Normal file
290
node_modules/ansi-escape-sequences/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,290 @@
|
||||
/**
|
||||
* Takes any input and guarantees an array back.
|
||||
*
|
||||
* - converts array-like objects (e.g. `arguments`) to a real array
|
||||
* - converts `undefined` to an empty array
|
||||
* - converts any another other, singular value (including `null`) into an array containing that value
|
||||
* - ignores input which is already an array
|
||||
*
|
||||
* @module array-back
|
||||
* @example
|
||||
* > const arrayify = require('array-back')
|
||||
*
|
||||
* > arrayify(undefined)
|
||||
* []
|
||||
*
|
||||
* > arrayify(null)
|
||||
* [ null ]
|
||||
*
|
||||
* > arrayify(0)
|
||||
* [ 0 ]
|
||||
*
|
||||
* > arrayify([ 1, 2 ])
|
||||
* [ 1, 2 ]
|
||||
*
|
||||
* > function f(){ return arrayify(arguments); }
|
||||
* > f(1,2,3)
|
||||
* [ 1, 2, 3 ]
|
||||
*/
|
||||
|
||||
function isObject (input) {
|
||||
return typeof input === 'object' && input !== null
|
||||
}
|
||||
|
||||
function isArrayLike (input) {
|
||||
return isObject(input) && typeof input.length === 'number'
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {*} - the input value to convert to an array
|
||||
* @returns {Array}
|
||||
* @alias module:array-back
|
||||
*/
|
||||
function arrayify (input) {
|
||||
if (Array.isArray(input)) {
|
||||
return input
|
||||
} else {
|
||||
if (input === undefined) {
|
||||
return []
|
||||
} else if (isArrayLike(input)) {
|
||||
return Array.prototype.slice.call(input)
|
||||
} else {
|
||||
return [ input ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Control Sequence Initiator */
|
||||
const csi = '\x1b[';
|
||||
|
||||
/**
|
||||
* @exports ansi-escape-sequences
|
||||
* @typicalname ansi
|
||||
* @example
|
||||
* const ansi = require('ansi-escape-sequences')
|
||||
*/
|
||||
const ansi = {};
|
||||
|
||||
/**
|
||||
* Various formatting styles (aka Select Graphic Rendition codes).
|
||||
* @enum {string}
|
||||
* @example
|
||||
* console.log(ansi.style.red + 'this is red' + ansi.style.reset)
|
||||
*/
|
||||
ansi.style = {
|
||||
reset: '\x1b[0m',
|
||||
bold: '\x1b[1m',
|
||||
italic: '\x1b[3m',
|
||||
underline: '\x1b[4m',
|
||||
fontDefault: '\x1b[10m',
|
||||
font2: '\x1b[11m',
|
||||
font3: '\x1b[12m',
|
||||
font4: '\x1b[13m',
|
||||
font5: '\x1b[14m',
|
||||
font6: '\x1b[15m',
|
||||
imageNegative: '\x1b[7m',
|
||||
imagePositive: '\x1b[27m',
|
||||
black: '\x1b[30m',
|
||||
red: '\x1b[31m',
|
||||
green: '\x1b[32m',
|
||||
yellow: '\x1b[33m',
|
||||
blue: '\x1b[34m',
|
||||
magenta: '\x1b[35m',
|
||||
cyan: '\x1b[36m',
|
||||
white: '\x1b[37m',
|
||||
grey: '\x1b[90m',
|
||||
gray: '\x1b[90m',
|
||||
'bg-black': '\x1b[40m',
|
||||
'bg-red': '\x1b[41m',
|
||||
'bg-green': '\x1b[42m',
|
||||
'bg-yellow': '\x1b[43m',
|
||||
'bg-blue': '\x1b[44m',
|
||||
'bg-magenta': '\x1b[45m',
|
||||
'bg-cyan': '\x1b[46m',
|
||||
'bg-white': '\x1b[47m',
|
||||
'bg-grey': '\x1b[100m',
|
||||
'bg-gray': '\x1b[100m'
|
||||
};
|
||||
|
||||
/**
|
||||
* style enum - used by `ansi.styles()`.
|
||||
* @enum {number}
|
||||
* @private
|
||||
*/
|
||||
const eStyles = {
|
||||
reset: 0,
|
||||
bold: 1,
|
||||
italic: 3,
|
||||
underline: 4,
|
||||
imageNegative: 7,
|
||||
fontDefault: 10,
|
||||
font2: 11,
|
||||
font3: 12,
|
||||
font4: 13,
|
||||
font5: 14,
|
||||
font6: 15,
|
||||
imagePositive: 27,
|
||||
black: 30,
|
||||
red: 31,
|
||||
green: 32,
|
||||
yellow: 33,
|
||||
blue: 34,
|
||||
magenta: 35,
|
||||
cyan: 36,
|
||||
white: 37,
|
||||
grey: 90,
|
||||
gray: 90,
|
||||
'bg-black': 40,
|
||||
'bg-red': 41,
|
||||
'bg-green': 42,
|
||||
'bg-yellow': 43,
|
||||
'bg-blue': 44,
|
||||
'bg-magenta': 45,
|
||||
'bg-cyan': 46,
|
||||
'bg-white': 47,
|
||||
'bg-grey': 100,
|
||||
'bg-gray': 100
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns an ansi sequence setting one or more effects
|
||||
* @param {string | string[]} - a style, or list or styles
|
||||
* @returns {string}
|
||||
* @example
|
||||
* > ansi.styles('green')
|
||||
* '\u001b[32m'
|
||||
*
|
||||
* > ansi.styles([ 'green', 'underline' ])
|
||||
* '\u001b[32;4m'
|
||||
*/
|
||||
ansi.styles = function (effectArray) {
|
||||
effectArray = arrayify(effectArray);
|
||||
return csi + effectArray.map(function (effect) { return eStyles[effect] }).join(';') + 'm'
|
||||
};
|
||||
|
||||
/**
|
||||
* A convenience function, applying the provided styles to the input string and then resetting.
|
||||
*
|
||||
* Inline styling can be applied using the syntax `[style-list]{text to format}`, where `style-list` is a space-separated list of styles from {@link module:ansi-escape-sequences.style ansi.style}. For example `[bold white bg-red]{bold white text on a red background}`.
|
||||
*
|
||||
* @param {string} - the string to format
|
||||
* @param [styleArray] {string[]} - a list of styles to add to the input string
|
||||
* @returns {string}
|
||||
* @example
|
||||
* > ansi.format('what?', 'green')
|
||||
* '\u001b[32mwhat?\u001b[0m'
|
||||
*
|
||||
* > ansi.format('what?', ['green', 'bold'])
|
||||
* '\u001b[32;1mwhat?\u001b[0m'
|
||||
*
|
||||
* > ansi.format('[green bold]{what?}')
|
||||
* '\u001b[32;1mwhat?\u001b[0m'
|
||||
*/
|
||||
ansi.format = function (str, styleArray) {
|
||||
const re = /\[([\w\s-]+)\]{([^]*?)}/;
|
||||
let matches;
|
||||
if (!str) return ''
|
||||
|
||||
while (matches = str.match(re)) {
|
||||
const inlineStyles = matches[1].split(/\s+/);
|
||||
const inlineString = matches[2];
|
||||
str = str.replace(matches[0], ansi.format(inlineString, inlineStyles));
|
||||
}
|
||||
|
||||
return (styleArray && styleArray.length)
|
||||
? ansi.styles(styleArray) + str + ansi.style.reset
|
||||
: str
|
||||
};
|
||||
|
||||
/**
|
||||
* cursor-related sequences
|
||||
*/
|
||||
ansi.cursor = {
|
||||
/**
|
||||
* Moves the cursor `lines` cells up. If the cursor is already at the edge of the screen, this has no effect
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
up: function (lines) { return csi + (lines || 1) + 'A' },
|
||||
|
||||
/**
|
||||
* Moves the cursor `lines` cells down. If the cursor is already at the edge of the screen, this has no effect
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
down: function (lines) { return csi + (lines || 1) + 'B' },
|
||||
|
||||
/**
|
||||
* Moves the cursor `lines` cells forward. If the cursor is already at the edge of the screen, this has no effect
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
forward: function (lines) { return csi + (lines || 1) + 'C' },
|
||||
|
||||
/**
|
||||
* Moves the cursor `lines` cells back. If the cursor is already at the edge of the screen, this has no effect
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
back: function (lines) { return csi + (lines || 1) + 'D' },
|
||||
|
||||
/**
|
||||
* Moves cursor to beginning of the line n lines down.
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
nextLine: function (lines) { return csi + (lines || 1) + 'E' },
|
||||
|
||||
/**
|
||||
* Moves cursor to beginning of the line n lines up.
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
previousLine: function (lines) { return csi + (lines || 1) + 'F' },
|
||||
|
||||
/**
|
||||
* Moves the cursor to column n.
|
||||
* @param n {number} - column number
|
||||
* @return {string}
|
||||
*/
|
||||
horizontalAbsolute: function (n) { return csi + n + 'G' },
|
||||
|
||||
/**
|
||||
* Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted.
|
||||
* @param n {number} - row number
|
||||
* @param m {number} - column number
|
||||
* @return {string}
|
||||
*/
|
||||
position: function (n, m) { return csi + (n || 1) + ';' + (m || 1) + 'H' },
|
||||
|
||||
/**
|
||||
* Hides the cursor
|
||||
*/
|
||||
hide: csi + '?25l',
|
||||
|
||||
/**
|
||||
* Shows the cursor
|
||||
*/
|
||||
show: csi + '?25h'
|
||||
};
|
||||
|
||||
/**
|
||||
* erase sequences
|
||||
*/
|
||||
ansi.erase = {
|
||||
/**
|
||||
* Clears part of the screen. If n is 0 (or missing), clear from cursor to end of screen. If n is 1, clear from cursor to beginning of the screen. If n is 2, clear entire screen.
|
||||
* @param n {number}
|
||||
* @return {string}
|
||||
*/
|
||||
display: function (n) { return csi + (n || 0) + 'J' },
|
||||
|
||||
/**
|
||||
* Erases part of the line. If n is zero (or missing), clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change.
|
||||
* @param n {number}
|
||||
* @return {string}
|
||||
*/
|
||||
inLine: function (n) { return csi + (n || 0) + 'K' }
|
||||
};
|
||||
|
||||
export default ansi;
|
||||
236
node_modules/ansi-escape-sequences/index.mjs
generated
vendored
Normal file
236
node_modules/ansi-escape-sequences/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,236 @@
|
||||
import arrayify from './node_modules/array-back/index.mjs'
|
||||
|
||||
/* Control Sequence Initiator */
|
||||
const csi = '\x1b['
|
||||
|
||||
/**
|
||||
* @exports ansi-escape-sequences
|
||||
* @typicalname ansi
|
||||
* @example
|
||||
* const ansi = require('ansi-escape-sequences')
|
||||
*/
|
||||
const ansi = {}
|
||||
|
||||
/**
|
||||
* Various formatting styles (aka Select Graphic Rendition codes).
|
||||
* @enum {string}
|
||||
* @example
|
||||
* console.log(ansi.style.red + 'this is red' + ansi.style.reset)
|
||||
*/
|
||||
ansi.style = {
|
||||
reset: '\x1b[0m',
|
||||
bold: '\x1b[1m',
|
||||
italic: '\x1b[3m',
|
||||
underline: '\x1b[4m',
|
||||
fontDefault: '\x1b[10m',
|
||||
font2: '\x1b[11m',
|
||||
font3: '\x1b[12m',
|
||||
font4: '\x1b[13m',
|
||||
font5: '\x1b[14m',
|
||||
font6: '\x1b[15m',
|
||||
imageNegative: '\x1b[7m',
|
||||
imagePositive: '\x1b[27m',
|
||||
black: '\x1b[30m',
|
||||
red: '\x1b[31m',
|
||||
green: '\x1b[32m',
|
||||
yellow: '\x1b[33m',
|
||||
blue: '\x1b[34m',
|
||||
magenta: '\x1b[35m',
|
||||
cyan: '\x1b[36m',
|
||||
white: '\x1b[37m',
|
||||
grey: '\x1b[90m',
|
||||
gray: '\x1b[90m',
|
||||
'bg-black': '\x1b[40m',
|
||||
'bg-red': '\x1b[41m',
|
||||
'bg-green': '\x1b[42m',
|
||||
'bg-yellow': '\x1b[43m',
|
||||
'bg-blue': '\x1b[44m',
|
||||
'bg-magenta': '\x1b[45m',
|
||||
'bg-cyan': '\x1b[46m',
|
||||
'bg-white': '\x1b[47m',
|
||||
'bg-grey': '\x1b[100m',
|
||||
'bg-gray': '\x1b[100m'
|
||||
}
|
||||
|
||||
/**
|
||||
* style enum - used by `ansi.styles()`.
|
||||
* @enum {number}
|
||||
* @private
|
||||
*/
|
||||
const eStyles = {
|
||||
reset: 0,
|
||||
bold: 1,
|
||||
italic: 3,
|
||||
underline: 4,
|
||||
imageNegative: 7,
|
||||
fontDefault: 10,
|
||||
font2: 11,
|
||||
font3: 12,
|
||||
font4: 13,
|
||||
font5: 14,
|
||||
font6: 15,
|
||||
imagePositive: 27,
|
||||
black: 30,
|
||||
red: 31,
|
||||
green: 32,
|
||||
yellow: 33,
|
||||
blue: 34,
|
||||
magenta: 35,
|
||||
cyan: 36,
|
||||
white: 37,
|
||||
grey: 90,
|
||||
gray: 90,
|
||||
'bg-black': 40,
|
||||
'bg-red': 41,
|
||||
'bg-green': 42,
|
||||
'bg-yellow': 43,
|
||||
'bg-blue': 44,
|
||||
'bg-magenta': 45,
|
||||
'bg-cyan': 46,
|
||||
'bg-white': 47,
|
||||
'bg-grey': 100,
|
||||
'bg-gray': 100
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an ansi sequence setting one or more effects
|
||||
* @param {string | string[]} - a style, or list or styles
|
||||
* @returns {string}
|
||||
* @example
|
||||
* > ansi.styles('green')
|
||||
* '\u001b[32m'
|
||||
*
|
||||
* > ansi.styles([ 'green', 'underline' ])
|
||||
* '\u001b[32;4m'
|
||||
*/
|
||||
ansi.styles = function (effectArray) {
|
||||
effectArray = arrayify(effectArray)
|
||||
return csi + effectArray.map(function (effect) { return eStyles[effect] }).join(';') + 'm'
|
||||
}
|
||||
|
||||
/**
|
||||
* A convenience function, applying the provided styles to the input string and then resetting.
|
||||
*
|
||||
* Inline styling can be applied using the syntax `[style-list]{text to format}`, where `style-list` is a space-separated list of styles from {@link module:ansi-escape-sequences.style ansi.style}. For example `[bold white bg-red]{bold white text on a red background}`.
|
||||
*
|
||||
* @param {string} - the string to format
|
||||
* @param [styleArray] {string[]} - a list of styles to add to the input string
|
||||
* @returns {string}
|
||||
* @example
|
||||
* > ansi.format('what?', 'green')
|
||||
* '\u001b[32mwhat?\u001b[0m'
|
||||
*
|
||||
* > ansi.format('what?', ['green', 'bold'])
|
||||
* '\u001b[32;1mwhat?\u001b[0m'
|
||||
*
|
||||
* > ansi.format('[green bold]{what?}')
|
||||
* '\u001b[32;1mwhat?\u001b[0m'
|
||||
*/
|
||||
ansi.format = function (str, styleArray) {
|
||||
const re = /\[([\w\s-]+)\]{([^]*?)}/
|
||||
let matches
|
||||
if (!str) return ''
|
||||
|
||||
while (matches = str.match(re)) {
|
||||
const inlineStyles = matches[1].split(/\s+/)
|
||||
const inlineString = matches[2]
|
||||
str = str.replace(matches[0], ansi.format(inlineString, inlineStyles))
|
||||
}
|
||||
|
||||
return (styleArray && styleArray.length)
|
||||
? ansi.styles(styleArray) + str + ansi.style.reset
|
||||
: str
|
||||
}
|
||||
|
||||
/**
|
||||
* cursor-related sequences
|
||||
*/
|
||||
ansi.cursor = {
|
||||
/**
|
||||
* Moves the cursor `lines` cells up. If the cursor is already at the edge of the screen, this has no effect
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
up: function (lines) { return csi + (lines || 1) + 'A' },
|
||||
|
||||
/**
|
||||
* Moves the cursor `lines` cells down. If the cursor is already at the edge of the screen, this has no effect
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
down: function (lines) { return csi + (lines || 1) + 'B' },
|
||||
|
||||
/**
|
||||
* Moves the cursor `lines` cells forward. If the cursor is already at the edge of the screen, this has no effect
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
forward: function (lines) { return csi + (lines || 1) + 'C' },
|
||||
|
||||
/**
|
||||
* Moves the cursor `lines` cells back. If the cursor is already at the edge of the screen, this has no effect
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
back: function (lines) { return csi + (lines || 1) + 'D' },
|
||||
|
||||
/**
|
||||
* Moves cursor to beginning of the line n lines down.
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
nextLine: function (lines) { return csi + (lines || 1) + 'E' },
|
||||
|
||||
/**
|
||||
* Moves cursor to beginning of the line n lines up.
|
||||
* @param [lines=1] {number}
|
||||
* @return {string}
|
||||
*/
|
||||
previousLine: function (lines) { return csi + (lines || 1) + 'F' },
|
||||
|
||||
/**
|
||||
* Moves the cursor to column n.
|
||||
* @param n {number} - column number
|
||||
* @return {string}
|
||||
*/
|
||||
horizontalAbsolute: function (n) { return csi + n + 'G' },
|
||||
|
||||
/**
|
||||
* Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted.
|
||||
* @param n {number} - row number
|
||||
* @param m {number} - column number
|
||||
* @return {string}
|
||||
*/
|
||||
position: function (n, m) { return csi + (n || 1) + ';' + (m || 1) + 'H' },
|
||||
|
||||
/**
|
||||
* Hides the cursor
|
||||
*/
|
||||
hide: csi + '?25l',
|
||||
|
||||
/**
|
||||
* Shows the cursor
|
||||
*/
|
||||
show: csi + '?25h'
|
||||
}
|
||||
|
||||
/**
|
||||
* erase sequences
|
||||
*/
|
||||
ansi.erase = {
|
||||
/**
|
||||
* Clears part of the screen. If n is 0 (or missing), clear from cursor to end of screen. If n is 1, clear from cursor to beginning of the screen. If n is 2, clear entire screen.
|
||||
* @param n {number}
|
||||
* @return {string}
|
||||
*/
|
||||
display: function (n) { return csi + (n || 0) + 'J' },
|
||||
|
||||
/**
|
||||
* Erases part of the line. If n is zero (or missing), clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change.
|
||||
* @param n {number}
|
||||
* @return {string}
|
||||
*/
|
||||
inLine: function (n) { return csi + (n || 0) + 'K' }
|
||||
}
|
||||
|
||||
export default ansi
|
||||
5
node_modules/ansi-escape-sequences/jsdoc.conf
generated
vendored
Normal file
5
node_modules/ansi-escape-sequences/jsdoc.conf
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"source": {
|
||||
"includePattern": ".+\\.(js(doc|x)?|mjs)$"
|
||||
}
|
||||
}
|
||||
21
node_modules/ansi-escape-sequences/node_modules/array-back/LICENSE
generated
vendored
Normal file
21
node_modules/ansi-escape-sequences/node_modules/array-back/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-19 Lloyd Brookes <75pound@gmail.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.
|
||||
40
node_modules/ansi-escape-sequences/node_modules/array-back/README.hbs
generated
vendored
Normal file
40
node_modules/ansi-escape-sequences/node_modules/array-back/README.hbs
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
[](https://www.npmjs.org/package/array-back)
|
||||
[](https://www.npmjs.org/package/array-back)
|
||||
[](https://travis-ci.org/75lb/array-back)
|
||||
[](https://coveralls.io/github/75lb/array-back?branch=master)
|
||||
[](https://david-dm.org/75lb/array-back)
|
||||
[](https://github.com/feross/standard)
|
||||
|
||||
{{>main}}
|
||||
|
||||
### Load anywhere
|
||||
|
||||
This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.
|
||||
|
||||
Node.js:
|
||||
|
||||
```js
|
||||
const arrayify = require('array-back')
|
||||
```
|
||||
|
||||
Within Node.js with ECMAScript Module support enabled:
|
||||
|
||||
```js
|
||||
import arrayify from 'array-back'
|
||||
```
|
||||
|
||||
Within an modern browser ECMAScript Module:
|
||||
|
||||
```js
|
||||
import arrayify from './node_modules/array-back/index.mjs'
|
||||
```
|
||||
|
||||
Old browser (adds `window.arrayBack`):
|
||||
|
||||
```html
|
||||
<script nomodule src="./node_modules/array-back/dist/index.js"></script>
|
||||
```
|
||||
|
||||
* * *
|
||||
|
||||
© 2015-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).
|
||||
81
node_modules/ansi-escape-sequences/node_modules/array-back/README.md
generated
vendored
Normal file
81
node_modules/ansi-escape-sequences/node_modules/array-back/README.md
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
[](https://www.npmjs.org/package/array-back)
|
||||
[](https://www.npmjs.org/package/array-back)
|
||||
[](https://travis-ci.org/75lb/array-back)
|
||||
[](https://coveralls.io/github/75lb/array-back?branch=master)
|
||||
[](https://david-dm.org/75lb/array-back)
|
||||
[](https://github.com/feross/standard)
|
||||
|
||||
<a name="module_array-back"></a>
|
||||
|
||||
## array-back
|
||||
Takes any input and guarantees an array back.
|
||||
|
||||
- Converts array-like objects (e.g. `arguments`, `Set`) to a real array.
|
||||
- Converts `undefined` to an empty array.
|
||||
- Converts any another other, singular value (including `null`, objects and iterables other than `Set`) into an array containing that value.
|
||||
- Ignores input which is already an array.
|
||||
|
||||
**Example**
|
||||
```js
|
||||
> const arrayify = require('array-back')
|
||||
|
||||
> arrayify(undefined)
|
||||
[]
|
||||
|
||||
> arrayify(null)
|
||||
[ null ]
|
||||
|
||||
> arrayify(0)
|
||||
[ 0 ]
|
||||
|
||||
> arrayify([ 1, 2 ])
|
||||
[ 1, 2 ]
|
||||
|
||||
> arrayify(new Set([ 1, 2 ]))
|
||||
[ 1, 2 ]
|
||||
|
||||
> function f(){ return arrayify(arguments); }
|
||||
> f(1,2,3)
|
||||
[ 1, 2, 3 ]
|
||||
```
|
||||
<a name="exp_module_array-back--arrayify"></a>
|
||||
|
||||
### arrayify(input) ⇒ <code>Array</code> ⏏
|
||||
**Kind**: Exported function
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| input | <code>\*</code> | The input value to convert to an array |
|
||||
|
||||
|
||||
### Load anywhere
|
||||
|
||||
This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.
|
||||
|
||||
Node.js:
|
||||
|
||||
```js
|
||||
const arrayify = require('array-back')
|
||||
```
|
||||
|
||||
Within Node.js with ECMAScript Module support enabled:
|
||||
|
||||
```js
|
||||
import arrayify from 'array-back'
|
||||
```
|
||||
|
||||
Within an modern browser ECMAScript Module:
|
||||
|
||||
```js
|
||||
import arrayify from './node_modules/array-back/index.mjs'
|
||||
```
|
||||
|
||||
Old browser (adds `window.arrayBack`):
|
||||
|
||||
```html
|
||||
<script nomodule src="./node_modules/array-back/dist/index.js"></script>
|
||||
```
|
||||
|
||||
* * *
|
||||
|
||||
© 2015-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).
|
||||
70
node_modules/ansi-escape-sequences/node_modules/array-back/dist/index.js
generated
vendored
Normal file
70
node_modules/ansi-escape-sequences/node_modules/array-back/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = global || self, global.arrayBack = factory());
|
||||
}(this, function () { 'use strict';
|
||||
|
||||
/**
|
||||
* Takes any input and guarantees an array back.
|
||||
*
|
||||
* - Converts array-like objects (e.g. `arguments`, `Set`) to a real array.
|
||||
* - Converts `undefined` to an empty array.
|
||||
* - Converts any another other, singular value (including `null`, objects and iterables other than `Set`) into an array containing that value.
|
||||
* - Ignores input which is already an array.
|
||||
*
|
||||
* @module array-back
|
||||
* @example
|
||||
* > const arrayify = require('array-back')
|
||||
*
|
||||
* > arrayify(undefined)
|
||||
* []
|
||||
*
|
||||
* > arrayify(null)
|
||||
* [ null ]
|
||||
*
|
||||
* > arrayify(0)
|
||||
* [ 0 ]
|
||||
*
|
||||
* > arrayify([ 1, 2 ])
|
||||
* [ 1, 2 ]
|
||||
*
|
||||
* > arrayify(new Set([ 1, 2 ]))
|
||||
* [ 1, 2 ]
|
||||
*
|
||||
* > function f(){ return arrayify(arguments); }
|
||||
* > f(1,2,3)
|
||||
* [ 1, 2, 3 ]
|
||||
*/
|
||||
|
||||
function isObject (input) {
|
||||
return typeof input === 'object' && input !== null
|
||||
}
|
||||
|
||||
function isArrayLike (input) {
|
||||
return isObject(input) && typeof input.length === 'number'
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {*} - The input value to convert to an array
|
||||
* @returns {Array}
|
||||
* @alias module:array-back
|
||||
*/
|
||||
function arrayify (input) {
|
||||
if (Array.isArray(input)) {
|
||||
return input
|
||||
}
|
||||
|
||||
if (input === undefined) {
|
||||
return []
|
||||
}
|
||||
|
||||
if (isArrayLike(input) || input instanceof Set) {
|
||||
return Array.from(input)
|
||||
}
|
||||
|
||||
return [ input ]
|
||||
}
|
||||
|
||||
return arrayify;
|
||||
|
||||
}));
|
||||
62
node_modules/ansi-escape-sequences/node_modules/array-back/index.mjs
generated
vendored
Normal file
62
node_modules/ansi-escape-sequences/node_modules/array-back/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* Takes any input and guarantees an array back.
|
||||
*
|
||||
* - Converts array-like objects (e.g. `arguments`, `Set`) to a real array.
|
||||
* - Converts `undefined` to an empty array.
|
||||
* - Converts any another other, singular value (including `null`, objects and iterables other than `Set`) into an array containing that value.
|
||||
* - Ignores input which is already an array.
|
||||
*
|
||||
* @module array-back
|
||||
* @example
|
||||
* > const arrayify = require('array-back')
|
||||
*
|
||||
* > arrayify(undefined)
|
||||
* []
|
||||
*
|
||||
* > arrayify(null)
|
||||
* [ null ]
|
||||
*
|
||||
* > arrayify(0)
|
||||
* [ 0 ]
|
||||
*
|
||||
* > arrayify([ 1, 2 ])
|
||||
* [ 1, 2 ]
|
||||
*
|
||||
* > arrayify(new Set([ 1, 2 ]))
|
||||
* [ 1, 2 ]
|
||||
*
|
||||
* > function f(){ return arrayify(arguments); }
|
||||
* > f(1,2,3)
|
||||
* [ 1, 2, 3 ]
|
||||
*/
|
||||
|
||||
function isObject (input) {
|
||||
return typeof input === 'object' && input !== null
|
||||
}
|
||||
|
||||
function isArrayLike (input) {
|
||||
return isObject(input) && typeof input.length === 'number'
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {*} - The input value to convert to an array
|
||||
* @returns {Array}
|
||||
* @alias module:array-back
|
||||
*/
|
||||
function arrayify (input) {
|
||||
if (Array.isArray(input)) {
|
||||
return input
|
||||
}
|
||||
|
||||
if (input === undefined) {
|
||||
return []
|
||||
}
|
||||
|
||||
if (isArrayLike(input) || input instanceof Set) {
|
||||
return Array.from(input)
|
||||
}
|
||||
|
||||
return [ input ]
|
||||
}
|
||||
|
||||
export default arrayify
|
||||
46
node_modules/ansi-escape-sequences/node_modules/array-back/package.json
generated
vendored
Normal file
46
node_modules/ansi-escape-sequences/node_modules/array-back/package.json
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "array-back",
|
||||
"author": "Lloyd Brookes <75pound@gmail.com>",
|
||||
"version": "3.1.0",
|
||||
"description": "Guarantees an array back",
|
||||
"repository": "https://github.com/75lb/array-back.git",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
"keywords": [
|
||||
"to",
|
||||
"convert",
|
||||
"return",
|
||||
"array",
|
||||
"arrayify"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"files": [
|
||||
"index.mjs",
|
||||
"dist/index.js"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "npm run test:esm && npm run test:js",
|
||||
"test:esm": "node --experimental-modules test.mjs",
|
||||
"test:js": "npm run dist:test && node dist/test.js",
|
||||
"docs": "jsdoc2md -t README.hbs index.mjs -c build/jsdoc.conf > README.md; echo",
|
||||
"cover": "nyc test-runner test.js && nyc report --reporter=text-lcov | coveralls",
|
||||
"dist": "rollup -c build/index.config.js",
|
||||
"dist:test": "rollup -c build/test.config.js",
|
||||
"lint": "standard **/*.mjs"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"coveralls": "^3.0.3",
|
||||
"jsdoc-to-markdown": "^4.0.1",
|
||||
"rollup": "^1.9.0",
|
||||
"test-runner": "^0.5.1"
|
||||
},
|
||||
"standard": {
|
||||
"ignore": [
|
||||
"dist",
|
||||
"build"
|
||||
]
|
||||
}
|
||||
}
|
||||
33
node_modules/ansi-escape-sequences/package.json
generated
vendored
Normal file
33
node_modules/ansi-escape-sequences/package.json
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "ansi-escape-sequences",
|
||||
"author": "Lloyd Brookes <75pound@gmail.com>",
|
||||
"version": "4.1.0",
|
||||
"description": "A simple library containing all known terminal ansi escape codes and sequences.",
|
||||
"repository": "https://github.com/75lb/ansi-escape-sequences.git",
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"terminal",
|
||||
"colour",
|
||||
"color",
|
||||
"command line",
|
||||
"cursor"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "test-runner test.js",
|
||||
"docs": "jsdoc2md -c jsdoc.conf -d 1 -t README.hbs index.mjs > README.md; echo",
|
||||
"dist": "rollup index.mjs -f umd -n ansi -o dist/index.js && rollup index.mjs -f esm -o dist/index.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"array-back": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jsdoc-to-markdown": "^4.0.1",
|
||||
"rollup": "^1.4.1",
|
||||
"test-runner": "^0.5.1"
|
||||
}
|
||||
}
|
||||
12
node_modules/ansi-escape-sequences/test.js
generated
vendored
Normal file
12
node_modules/ansi-escape-sequences/test.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
const TestRunner = require('test-runner')
|
||||
const ansi = require('./')
|
||||
const runner = new TestRunner()
|
||||
const a = require('assert')
|
||||
|
||||
runner.test('format', function () {
|
||||
a.strictEqual(ansi.format('clive', ['red', 'underline']), '\u001b[31;4mclive\u001b[0m')
|
||||
})
|
||||
|
||||
runner.test('inline format', function () {
|
||||
a.strictEqual(ansi.format('before [red underline]{clive} after'), 'before \u001b[31;4mclive\u001b[0m after')
|
||||
})
|
||||
10
node_modules/ansi-regex/index.js
generated
vendored
Normal file
10
node_modules/ansi-regex/index.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = () => {
|
||||
const pattern = [
|
||||
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[a-zA-Z\\d]*)*)?\\u0007)',
|
||||
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'
|
||||
].join('|');
|
||||
|
||||
return new RegExp(pattern, 'g');
|
||||
};
|
||||
9
node_modules/ansi-regex/license
generated
vendored
Normal file
9
node_modules/ansi-regex/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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.
|
||||
53
node_modules/ansi-regex/package.json
generated
vendored
Normal file
53
node_modules/ansi-regex/package.json
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"name": "ansi-regex",
|
||||
"version": "3.0.1",
|
||||
"description": "Regular expression for matching ANSI escape codes",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/ansi-regex",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava",
|
||||
"view-supported": "node fixtures/view-codes.js"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"command-line",
|
||||
"text",
|
||||
"regex",
|
||||
"regexp",
|
||||
"re",
|
||||
"match",
|
||||
"test",
|
||||
"find",
|
||||
"pattern"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
||||
46
node_modules/ansi-regex/readme.md
generated
vendored
Normal file
46
node_modules/ansi-regex/readme.md
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
# ansi-regex [](https://travis-ci.org/chalk/ansi-regex)
|
||||
|
||||
> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install ansi-regex
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const ansiRegex = require('ansi-regex');
|
||||
|
||||
ansiRegex().test('\u001B[4mcake\u001B[0m');
|
||||
//=> true
|
||||
|
||||
ansiRegex().test('cake');
|
||||
//=> false
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
|
||||
//=> ['\u001B[4m', '\u001B[0m']
|
||||
```
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
### Why do you test for codes not in the ECMA 48 standard?
|
||||
|
||||
Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.
|
||||
|
||||
On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
185
node_modules/argparse/CHANGELOG.md
generated
vendored
Normal file
185
node_modules/argparse/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,185 @@
|
||||
1.0.10 / 2018-02-15
|
||||
------------------
|
||||
|
||||
- Use .concat instead of + for arrays, #122.
|
||||
|
||||
|
||||
1.0.9 / 2016-09-29
|
||||
------------------
|
||||
|
||||
- Rerelease after 1.0.8 - deps cleanup.
|
||||
|
||||
|
||||
1.0.8 / 2016-09-29
|
||||
------------------
|
||||
|
||||
- Maintenance (deps bump, fix node 6.5+ tests, coverage report).
|
||||
|
||||
|
||||
1.0.7 / 2016-03-17
|
||||
------------------
|
||||
|
||||
- Teach `addArgument` to accept string arg names. #97, @tomxtobin.
|
||||
|
||||
|
||||
1.0.6 / 2016-02-06
|
||||
------------------
|
||||
|
||||
- Maintenance: moved to eslint & updated CS.
|
||||
|
||||
|
||||
1.0.5 / 2016-02-05
|
||||
------------------
|
||||
|
||||
- Removed lodash dependency to significantly reduce install size.
|
||||
Thanks to @mourner.
|
||||
|
||||
|
||||
1.0.4 / 2016-01-17
|
||||
------------------
|
||||
|
||||
- Maintenance: lodash update to 4.0.0.
|
||||
|
||||
|
||||
1.0.3 / 2015-10-27
|
||||
------------------
|
||||
|
||||
- Fix parse `=` in args: `--examplepath="C:\myfolder\env=x64"`. #84, @CatWithApple.
|
||||
|
||||
|
||||
1.0.2 / 2015-03-22
|
||||
------------------
|
||||
|
||||
- Relaxed lodash version dependency.
|
||||
|
||||
|
||||
1.0.1 / 2015-02-20
|
||||
------------------
|
||||
|
||||
- Changed dependencies to be compatible with ancient nodejs.
|
||||
|
||||
|
||||
1.0.0 / 2015-02-19
|
||||
------------------
|
||||
|
||||
- Maintenance release.
|
||||
- Replaced `underscore` with `lodash`.
|
||||
- Bumped version to 1.0.0 to better reflect semver meaning.
|
||||
- HISTORY.md -> CHANGELOG.md
|
||||
|
||||
|
||||
0.1.16 / 2013-12-01
|
||||
-------------------
|
||||
|
||||
- Maintenance release. Updated dependencies and docs.
|
||||
|
||||
|
||||
0.1.15 / 2013-05-13
|
||||
-------------------
|
||||
|
||||
- Fixed #55, @trebor89
|
||||
|
||||
|
||||
0.1.14 / 2013-05-12
|
||||
-------------------
|
||||
|
||||
- Fixed #62, @maxtaco
|
||||
|
||||
|
||||
0.1.13 / 2013-04-08
|
||||
-------------------
|
||||
|
||||
- Added `.npmignore` to reduce package size
|
||||
|
||||
|
||||
0.1.12 / 2013-02-10
|
||||
-------------------
|
||||
|
||||
- Fixed conflictHandler (#46), @hpaulj
|
||||
|
||||
|
||||
0.1.11 / 2013-02-07
|
||||
-------------------
|
||||
|
||||
- Multiple bugfixes, @hpaulj
|
||||
- Added 70+ tests (ported from python), @hpaulj
|
||||
- Added conflictHandler, @applepicke
|
||||
- Added fromfilePrefixChar, @hpaulj
|
||||
|
||||
|
||||
0.1.10 / 2012-12-30
|
||||
-------------------
|
||||
|
||||
- Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion)
|
||||
support, thanks to @hpaulj
|
||||
- Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj
|
||||
|
||||
|
||||
0.1.9 / 2012-12-27
|
||||
------------------
|
||||
|
||||
- Fixed option dest interferens with other options (issue #23), thanks to @hpaulj
|
||||
- Fixed default value behavior with `*` positionals, thanks to @hpaulj
|
||||
- Improve `getDefault()` behavior, thanks to @hpaulj
|
||||
- Imrove negative argument parsing, thanks to @hpaulj
|
||||
|
||||
|
||||
0.1.8 / 2012-12-01
|
||||
------------------
|
||||
|
||||
- Fixed parser parents (issue #19), thanks to @hpaulj
|
||||
- Fixed negative argument parse (issue #20), thanks to @hpaulj
|
||||
|
||||
|
||||
0.1.7 / 2012-10-14
|
||||
------------------
|
||||
|
||||
- Fixed 'choices' argument parse (issue #16)
|
||||
- Fixed stderr output (issue #15)
|
||||
|
||||
|
||||
0.1.6 / 2012-09-09
|
||||
------------------
|
||||
|
||||
- Fixed check for conflict of options (thanks to @tomxtobin)
|
||||
|
||||
|
||||
0.1.5 / 2012-09-03
|
||||
------------------
|
||||
|
||||
- Fix parser #setDefaults method (thanks to @tomxtobin)
|
||||
|
||||
|
||||
0.1.4 / 2012-07-30
|
||||
------------------
|
||||
|
||||
- Fixed pseudo-argument support (thanks to @CGamesPlay)
|
||||
- Fixed addHelp default (should be true), if not set (thanks to @benblank)
|
||||
|
||||
|
||||
0.1.3 / 2012-06-27
|
||||
------------------
|
||||
|
||||
- Fixed formatter api name: Formatter -> HelpFormatter
|
||||
|
||||
|
||||
0.1.2 / 2012-05-29
|
||||
------------------
|
||||
|
||||
- Added basic tests
|
||||
- Removed excess whitespace in help
|
||||
- Fixed error reporting, when parcer with subcommands
|
||||
called with empty arguments
|
||||
|
||||
|
||||
0.1.1 / 2012-05-23
|
||||
------------------
|
||||
|
||||
- Fixed line wrapping in help formatter
|
||||
- Added better error reporting on invalid arguments
|
||||
|
||||
|
||||
0.1.0 / 2012-05-16
|
||||
------------------
|
||||
|
||||
- First release.
|
||||
21
node_modules/argparse/LICENSE
generated
vendored
Normal file
21
node_modules/argparse/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (C) 2012 by Vitaly Puzrin
|
||||
|
||||
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.
|
||||
257
node_modules/argparse/README.md
generated
vendored
Normal file
257
node_modules/argparse/README.md
generated
vendored
Normal file
@@ -0,0 +1,257 @@
|
||||
argparse
|
||||
========
|
||||
|
||||
[](http://travis-ci.org/nodeca/argparse)
|
||||
[](https://www.npmjs.org/package/argparse)
|
||||
|
||||
CLI arguments parser for node.js. Javascript port of python's
|
||||
[argparse](http://docs.python.org/dev/library/argparse.html) module
|
||||
(original version 3.2). That's a full port, except some very rare options,
|
||||
recorded in issue tracker.
|
||||
|
||||
**NB. Difference with original.**
|
||||
|
||||
- Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/).
|
||||
- Use `defaultValue` instead of `default`.
|
||||
- Use `argparse.Const.REMAINDER` instead of `argparse.REMAINDER`, and
|
||||
similarly for constant values `OPTIONAL`, `ZERO_OR_MORE`, and `ONE_OR_MORE`
|
||||
(aliases for `nargs` values `'?'`, `'*'`, `'+'`, respectively), and
|
||||
`SUPPRESS`.
|
||||
|
||||
|
||||
Example
|
||||
=======
|
||||
|
||||
test.js file:
|
||||
|
||||
```javascript
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
var ArgumentParser = require('../lib/argparse').ArgumentParser;
|
||||
var parser = new ArgumentParser({
|
||||
version: '0.0.1',
|
||||
addHelp:true,
|
||||
description: 'Argparse example'
|
||||
});
|
||||
parser.addArgument(
|
||||
[ '-f', '--foo' ],
|
||||
{
|
||||
help: 'foo bar'
|
||||
}
|
||||
);
|
||||
parser.addArgument(
|
||||
[ '-b', '--bar' ],
|
||||
{
|
||||
help: 'bar foo'
|
||||
}
|
||||
);
|
||||
parser.addArgument(
|
||||
'--baz',
|
||||
{
|
||||
help: 'baz bar'
|
||||
}
|
||||
);
|
||||
var args = parser.parseArgs();
|
||||
console.dir(args);
|
||||
```
|
||||
|
||||
Display help:
|
||||
|
||||
```
|
||||
$ ./test.js -h
|
||||
usage: example.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ]
|
||||
|
||||
Argparse example
|
||||
|
||||
Optional arguments:
|
||||
-h, --help Show this help message and exit.
|
||||
-v, --version Show program's version number and exit.
|
||||
-f FOO, --foo FOO foo bar
|
||||
-b BAR, --bar BAR bar foo
|
||||
--baz BAZ baz bar
|
||||
```
|
||||
|
||||
Parse arguments:
|
||||
|
||||
```
|
||||
$ ./test.js -f=3 --bar=4 --baz 5
|
||||
{ foo: '3', bar: '4', baz: '5' }
|
||||
```
|
||||
|
||||
More [examples](https://github.com/nodeca/argparse/tree/master/examples).
|
||||
|
||||
|
||||
ArgumentParser objects
|
||||
======================
|
||||
|
||||
```
|
||||
new ArgumentParser({parameters hash});
|
||||
```
|
||||
|
||||
Creates a new ArgumentParser object.
|
||||
|
||||
**Supported params:**
|
||||
|
||||
- ```description``` - Text to display before the argument help.
|
||||
- ```epilog``` - Text to display after the argument help.
|
||||
- ```addHelp``` - Add a -h/–help option to the parser. (default: true)
|
||||
- ```argumentDefault``` - Set the global default value for arguments. (default: null)
|
||||
- ```parents``` - A list of ArgumentParser objects whose arguments should also be included.
|
||||
- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘)
|
||||
- ```formatterClass``` - A class for customizing the help output.
|
||||
- ```prog``` - The name of the program (default: `path.basename(process.argv[1])`)
|
||||
- ```usage``` - The string describing the program usage (default: generated)
|
||||
- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals.
|
||||
|
||||
**Not supported yet**
|
||||
|
||||
- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read.
|
||||
|
||||
|
||||
Details in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects)
|
||||
|
||||
|
||||
addArgument() method
|
||||
====================
|
||||
|
||||
```
|
||||
ArgumentParser.addArgument(name or flag or [name] or [flags...], {options})
|
||||
```
|
||||
|
||||
Defines how a single command-line argument should be parsed.
|
||||
|
||||
- ```name or flag or [name] or [flags...]``` - Either a positional name
|
||||
(e.g., `'foo'`), a single option (e.g., `'-f'` or `'--foo'`), an array
|
||||
of a single positional name (e.g., `['foo']`), or an array of options
|
||||
(e.g., `['-f', '--foo']`).
|
||||
|
||||
Options:
|
||||
|
||||
- ```action``` - The basic type of action to be taken when this argument is encountered at the command line.
|
||||
- ```nargs```- The number of command-line arguments that should be consumed.
|
||||
- ```constant``` - A constant value required by some action and nargs selections.
|
||||
- ```defaultValue``` - The value produced if the argument is absent from the command line.
|
||||
- ```type``` - The type to which the command-line argument should be converted.
|
||||
- ```choices``` - A container of the allowable values for the argument.
|
||||
- ```required``` - Whether or not the command-line option may be omitted (optionals only).
|
||||
- ```help``` - A brief description of what the argument does.
|
||||
- ```metavar``` - A name for the argument in usage messages.
|
||||
- ```dest``` - The name of the attribute to be added to the object returned by parseArgs().
|
||||
|
||||
Details in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method)
|
||||
|
||||
|
||||
Action (some details)
|
||||
================
|
||||
|
||||
ArgumentParser objects associate command-line arguments with actions.
|
||||
These actions can do just about anything with the command-line arguments associated
|
||||
with them, though most actions simply add an attribute to the object returned by
|
||||
parseArgs(). The action keyword argument specifies how the command-line arguments
|
||||
should be handled. The supported actions are:
|
||||
|
||||
- ```store``` - Just stores the argument’s value. This is the default action.
|
||||
- ```storeConst``` - Stores value, specified by the const keyword argument.
|
||||
(Note that the const keyword argument defaults to the rather unhelpful None.)
|
||||
The 'storeConst' action is most commonly used with optional arguments, that
|
||||
specify some sort of flag.
|
||||
- ```storeTrue``` and ```storeFalse``` - Stores values True and False
|
||||
respectively. These are special cases of 'storeConst'.
|
||||
- ```append``` - Stores a list, and appends each argument value to the list.
|
||||
This is useful to allow an option to be specified multiple times.
|
||||
- ```appendConst``` - Stores a list, and appends value, specified by the
|
||||
const keyword argument to the list. (Note, that the const keyword argument defaults
|
||||
is None.) The 'appendConst' action is typically used when multiple arguments need
|
||||
to store constants to the same list.
|
||||
- ```count``` - Counts the number of times a keyword argument occurs. For example,
|
||||
used for increasing verbosity levels.
|
||||
- ```help``` - Prints a complete help message for all the options in the current
|
||||
parser and then exits. By default a help action is automatically added to the parser.
|
||||
See ArgumentParser for details of how the output is created.
|
||||
- ```version``` - Prints version information and exit. Expects a `version=`
|
||||
keyword argument in the addArgument() call.
|
||||
|
||||
Details in [original action guide](http://docs.python.org/dev/library/argparse.html#action)
|
||||
|
||||
|
||||
Sub-commands
|
||||
============
|
||||
|
||||
ArgumentParser.addSubparsers()
|
||||
|
||||
Many programs split their functionality into a number of sub-commands, for
|
||||
example, the svn program can invoke sub-commands like `svn checkout`, `svn update`,
|
||||
and `svn commit`. Splitting up functionality this way can be a particularly good
|
||||
idea when a program performs several different functions which require different
|
||||
kinds of command-line arguments. `ArgumentParser` supports creation of such
|
||||
sub-commands with `addSubparsers()` method. The `addSubparsers()` method is
|
||||
normally called with no arguments and returns an special action object.
|
||||
This object has a single method `addParser()`, which takes a command name and
|
||||
any `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object
|
||||
that can be modified as usual.
|
||||
|
||||
Example:
|
||||
|
||||
sub_commands.js
|
||||
```javascript
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
var ArgumentParser = require('../lib/argparse').ArgumentParser;
|
||||
var parser = new ArgumentParser({
|
||||
version: '0.0.1',
|
||||
addHelp:true,
|
||||
description: 'Argparse examples: sub-commands',
|
||||
});
|
||||
|
||||
var subparsers = parser.addSubparsers({
|
||||
title:'subcommands',
|
||||
dest:"subcommand_name"
|
||||
});
|
||||
|
||||
var bar = subparsers.addParser('c1', {addHelp:true});
|
||||
bar.addArgument(
|
||||
[ '-f', '--foo' ],
|
||||
{
|
||||
action: 'store',
|
||||
help: 'foo3 bar3'
|
||||
}
|
||||
);
|
||||
var bar = subparsers.addParser(
|
||||
'c2',
|
||||
{aliases:['co'], addHelp:true}
|
||||
);
|
||||
bar.addArgument(
|
||||
[ '-b', '--bar' ],
|
||||
{
|
||||
action: 'store',
|
||||
type: 'int',
|
||||
help: 'foo3 bar3'
|
||||
}
|
||||
);
|
||||
|
||||
var args = parser.parseArgs();
|
||||
console.dir(args);
|
||||
|
||||
```
|
||||
|
||||
Details in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands)
|
||||
|
||||
|
||||
Contributors
|
||||
============
|
||||
|
||||
- [Eugene Shkuropat](https://github.com/shkuropat)
|
||||
- [Paul Jacobson](https://github.com/hpaulj)
|
||||
|
||||
[others](https://github.com/nodeca/argparse/graphs/contributors)
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
Copyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin).
|
||||
Released under the MIT license. See
|
||||
[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details.
|
||||
|
||||
|
||||
3
node_modules/argparse/index.js
generated
vendored
Normal file
3
node_modules/argparse/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./lib/argparse');
|
||||
146
node_modules/argparse/lib/action.js
generated
vendored
Normal file
146
node_modules/argparse/lib/action.js
generated
vendored
Normal file
@@ -0,0 +1,146 @@
|
||||
/**
|
||||
* class Action
|
||||
*
|
||||
* Base class for all actions
|
||||
* Do not call in your code, use this class only for inherits your own action
|
||||
*
|
||||
* Information about how to convert command line strings to Javascript objects.
|
||||
* Action objects are used by an ArgumentParser to represent the information
|
||||
* needed to parse a single argument from one or more strings from the command
|
||||
* line. The keyword arguments to the Action constructor are also all attributes
|
||||
* of Action instances.
|
||||
*
|
||||
* ##### Allowed keywords:
|
||||
*
|
||||
* - `store`
|
||||
* - `storeConstant`
|
||||
* - `storeTrue`
|
||||
* - `storeFalse`
|
||||
* - `append`
|
||||
* - `appendConstant`
|
||||
* - `count`
|
||||
* - `help`
|
||||
* - `version`
|
||||
*
|
||||
* Information about action options see [[Action.new]]
|
||||
*
|
||||
* See also [original guide](http://docs.python.org/dev/library/argparse.html#action)
|
||||
*
|
||||
**/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
// Constants
|
||||
var c = require('./const');
|
||||
|
||||
|
||||
/**
|
||||
* new Action(options)
|
||||
*
|
||||
* Base class for all actions. Used only for inherits
|
||||
*
|
||||
*
|
||||
* ##### Options:
|
||||
*
|
||||
* - `optionStrings` A list of command-line option strings for the action.
|
||||
* - `dest` Attribute to hold the created object(s)
|
||||
* - `nargs` The number of command-line arguments that should be consumed.
|
||||
* By default, one argument will be consumed and a single value will be
|
||||
* produced.
|
||||
* - `constant` Default value for an action with no value.
|
||||
* - `defaultValue` The value to be produced if the option is not specified.
|
||||
* - `type` Cast to 'string'|'int'|'float'|'complex'|function (string). If
|
||||
* None, 'string'.
|
||||
* - `choices` The choices available.
|
||||
* - `required` True if the action must always be specified at the command
|
||||
* line.
|
||||
* - `help` The help describing the argument.
|
||||
* - `metavar` The name to be used for the option's argument with the help
|
||||
* string. If None, the 'dest' value will be used as the name.
|
||||
*
|
||||
* ##### nargs supported values:
|
||||
*
|
||||
* - `N` (an integer) consumes N arguments (and produces a list)
|
||||
* - `?` consumes zero or one arguments
|
||||
* - `*` consumes zero or more arguments (and produces a list)
|
||||
* - `+` consumes one or more arguments (and produces a list)
|
||||
*
|
||||
* Note: that the difference between the default and nargs=1 is that with the
|
||||
* default, a single value will be produced, while with nargs=1, a list
|
||||
* containing a single value will be produced.
|
||||
**/
|
||||
var Action = module.exports = function Action(options) {
|
||||
options = options || {};
|
||||
this.optionStrings = options.optionStrings || [];
|
||||
this.dest = options.dest;
|
||||
this.nargs = typeof options.nargs !== 'undefined' ? options.nargs : null;
|
||||
this.constant = typeof options.constant !== 'undefined' ? options.constant : null;
|
||||
this.defaultValue = options.defaultValue;
|
||||
this.type = typeof options.type !== 'undefined' ? options.type : null;
|
||||
this.choices = typeof options.choices !== 'undefined' ? options.choices : null;
|
||||
this.required = typeof options.required !== 'undefined' ? options.required : false;
|
||||
this.help = typeof options.help !== 'undefined' ? options.help : null;
|
||||
this.metavar = typeof options.metavar !== 'undefined' ? options.metavar : null;
|
||||
|
||||
if (!(this.optionStrings instanceof Array)) {
|
||||
throw new Error('optionStrings should be an array');
|
||||
}
|
||||
if (typeof this.required !== 'undefined' && typeof this.required !== 'boolean') {
|
||||
throw new Error('required should be a boolean');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Action#getName -> String
|
||||
*
|
||||
* Tells action name
|
||||
**/
|
||||
Action.prototype.getName = function () {
|
||||
if (this.optionStrings.length > 0) {
|
||||
return this.optionStrings.join('/');
|
||||
} else if (this.metavar !== null && this.metavar !== c.SUPPRESS) {
|
||||
return this.metavar;
|
||||
} else if (typeof this.dest !== 'undefined' && this.dest !== c.SUPPRESS) {
|
||||
return this.dest;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Action#isOptional -> Boolean
|
||||
*
|
||||
* Return true if optional
|
||||
**/
|
||||
Action.prototype.isOptional = function () {
|
||||
return !this.isPositional();
|
||||
};
|
||||
|
||||
/**
|
||||
* Action#isPositional -> Boolean
|
||||
*
|
||||
* Return true if positional
|
||||
**/
|
||||
Action.prototype.isPositional = function () {
|
||||
return (this.optionStrings.length === 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* Action#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Call the action. Should be implemented in inherited classes
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* ActionCount.prototype.call = function (parser, namespace, values, optionString) {
|
||||
* namespace.set(this.dest, (namespace[this.dest] || 0) + 1);
|
||||
* };
|
||||
*
|
||||
**/
|
||||
Action.prototype.call = function () {
|
||||
throw new Error('.call() not defined');// Not Implemented error
|
||||
};
|
||||
53
node_modules/argparse/lib/action/append.js
generated
vendored
Normal file
53
node_modules/argparse/lib/action/append.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
/*:nodoc:*
|
||||
* class ActionAppend
|
||||
*
|
||||
* This action stores a list, and appends each argument value to the list.
|
||||
* This is useful to allow an option to be specified multiple times.
|
||||
* This class inherided from [[Action]]
|
||||
*
|
||||
**/
|
||||
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var Action = require('../action');
|
||||
|
||||
// Constants
|
||||
var c = require('../const');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionAppend(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
* Note: options.nargs should be optional for constants
|
||||
* and more then zero for other
|
||||
**/
|
||||
var ActionAppend = module.exports = function ActionAppend(options) {
|
||||
options = options || {};
|
||||
if (this.nargs <= 0) {
|
||||
throw new Error('nargs for append actions must be > 0; if arg ' +
|
||||
'strings are not supplying the value to append, ' +
|
||||
'the append const action may be more appropriate');
|
||||
}
|
||||
if (!!this.constant && this.nargs !== c.OPTIONAL) {
|
||||
throw new Error('nargs must be OPTIONAL to supply const');
|
||||
}
|
||||
Action.call(this, options);
|
||||
};
|
||||
util.inherits(ActionAppend, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionAppend#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Call the action. Save result in namespace object
|
||||
**/
|
||||
ActionAppend.prototype.call = function (parser, namespace, values) {
|
||||
var items = (namespace[this.dest] || []).slice();
|
||||
items.push(values);
|
||||
namespace.set(this.dest, items);
|
||||
};
|
||||
47
node_modules/argparse/lib/action/append/constant.js
generated
vendored
Normal file
47
node_modules/argparse/lib/action/append/constant.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
/*:nodoc:*
|
||||
* class ActionAppendConstant
|
||||
*
|
||||
* This stores a list, and appends the value specified by
|
||||
* the const keyword argument to the list.
|
||||
* (Note that the const keyword argument defaults to null.)
|
||||
* The 'appendConst' action is typically useful when multiple
|
||||
* arguments need to store constants to the same list.
|
||||
*
|
||||
* This class inherited from [[Action]]
|
||||
**/
|
||||
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var Action = require('../../action');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionAppendConstant(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionAppendConstant = module.exports = function ActionAppendConstant(options) {
|
||||
options = options || {};
|
||||
options.nargs = 0;
|
||||
if (typeof options.constant === 'undefined') {
|
||||
throw new Error('constant option is required for appendAction');
|
||||
}
|
||||
Action.call(this, options);
|
||||
};
|
||||
util.inherits(ActionAppendConstant, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionAppendConstant#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Call the action. Save result in namespace object
|
||||
**/
|
||||
ActionAppendConstant.prototype.call = function (parser, namespace) {
|
||||
var items = [].concat(namespace[this.dest] || []);
|
||||
items.push(this.constant);
|
||||
namespace.set(this.dest, items);
|
||||
};
|
||||
40
node_modules/argparse/lib/action/count.js
generated
vendored
Normal file
40
node_modules/argparse/lib/action/count.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
/*:nodoc:*
|
||||
* class ActionCount
|
||||
*
|
||||
* This counts the number of times a keyword argument occurs.
|
||||
* For example, this is useful for increasing verbosity levels
|
||||
*
|
||||
* This class inherided from [[Action]]
|
||||
*
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var Action = require('../action');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionCount(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionCount = module.exports = function ActionCount(options) {
|
||||
options = options || {};
|
||||
options.nargs = 0;
|
||||
|
||||
Action.call(this, options);
|
||||
};
|
||||
util.inherits(ActionCount, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionCount#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Call the action. Save result in namespace object
|
||||
**/
|
||||
ActionCount.prototype.call = function (parser, namespace) {
|
||||
namespace.set(this.dest, (namespace[this.dest] || 0) + 1);
|
||||
};
|
||||
47
node_modules/argparse/lib/action/help.js
generated
vendored
Normal file
47
node_modules/argparse/lib/action/help.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
/*:nodoc:*
|
||||
* class ActionHelp
|
||||
*
|
||||
* Support action for printing help
|
||||
* This class inherided from [[Action]]
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var Action = require('../action');
|
||||
|
||||
// Constants
|
||||
var c = require('../const');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionHelp(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionHelp = module.exports = function ActionHelp(options) {
|
||||
options = options || {};
|
||||
if (options.defaultValue !== null) {
|
||||
options.defaultValue = options.defaultValue;
|
||||
} else {
|
||||
options.defaultValue = c.SUPPRESS;
|
||||
}
|
||||
options.dest = (options.dest !== null ? options.dest : c.SUPPRESS);
|
||||
options.nargs = 0;
|
||||
Action.call(this, options);
|
||||
|
||||
};
|
||||
util.inherits(ActionHelp, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionHelp#call(parser, namespace, values, optionString)
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Print help and exit
|
||||
**/
|
||||
ActionHelp.prototype.call = function (parser) {
|
||||
parser.printHelp();
|
||||
parser.exit();
|
||||
};
|
||||
50
node_modules/argparse/lib/action/store.js
generated
vendored
Normal file
50
node_modules/argparse/lib/action/store.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
/*:nodoc:*
|
||||
* class ActionStore
|
||||
*
|
||||
* This action just stores the argument’s value. This is the default action.
|
||||
*
|
||||
* This class inherited from [[Action]]
|
||||
*
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var Action = require('../action');
|
||||
|
||||
// Constants
|
||||
var c = require('../const');
|
||||
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionStore(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionStore = module.exports = function ActionStore(options) {
|
||||
options = options || {};
|
||||
if (this.nargs <= 0) {
|
||||
throw new Error('nargs for store actions must be > 0; if you ' +
|
||||
'have nothing to store, actions such as store ' +
|
||||
'true or store const may be more appropriate');
|
||||
|
||||
}
|
||||
if (typeof this.constant !== 'undefined' && this.nargs !== c.OPTIONAL) {
|
||||
throw new Error('nargs must be OPTIONAL to supply const');
|
||||
}
|
||||
Action.call(this, options);
|
||||
};
|
||||
util.inherits(ActionStore, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionStore#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Call the action. Save result in namespace object
|
||||
**/
|
||||
ActionStore.prototype.call = function (parser, namespace, values) {
|
||||
namespace.set(this.dest, values);
|
||||
};
|
||||
43
node_modules/argparse/lib/action/store/constant.js
generated
vendored
Normal file
43
node_modules/argparse/lib/action/store/constant.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/*:nodoc:*
|
||||
* class ActionStoreConstant
|
||||
*
|
||||
* This action stores the value specified by the const keyword argument.
|
||||
* (Note that the const keyword argument defaults to the rather unhelpful null.)
|
||||
* The 'store_const' action is most commonly used with optional
|
||||
* arguments that specify some sort of flag.
|
||||
*
|
||||
* This class inherited from [[Action]]
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var Action = require('../../action');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionStoreConstant(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionStoreConstant = module.exports = function ActionStoreConstant(options) {
|
||||
options = options || {};
|
||||
options.nargs = 0;
|
||||
if (typeof options.constant === 'undefined') {
|
||||
throw new Error('constant option is required for storeAction');
|
||||
}
|
||||
Action.call(this, options);
|
||||
};
|
||||
util.inherits(ActionStoreConstant, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionStoreConstant#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Call the action. Save result in namespace object
|
||||
**/
|
||||
ActionStoreConstant.prototype.call = function (parser, namespace) {
|
||||
namespace.set(this.dest, this.constant);
|
||||
};
|
||||
27
node_modules/argparse/lib/action/store/false.js
generated
vendored
Normal file
27
node_modules/argparse/lib/action/store/false.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/*:nodoc:*
|
||||
* class ActionStoreFalse
|
||||
*
|
||||
* This action store the values False respectively.
|
||||
* This is special cases of 'storeConst'
|
||||
*
|
||||
* This class inherited from [[Action]]
|
||||
**/
|
||||
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var ActionStoreConstant = require('./constant');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionStoreFalse(options)
|
||||
* - options (object): hash of options see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionStoreFalse = module.exports = function ActionStoreFalse(options) {
|
||||
options = options || {};
|
||||
options.constant = false;
|
||||
options.defaultValue = options.defaultValue !== null ? options.defaultValue : true;
|
||||
ActionStoreConstant.call(this, options);
|
||||
};
|
||||
util.inherits(ActionStoreFalse, ActionStoreConstant);
|
||||
26
node_modules/argparse/lib/action/store/true.js
generated
vendored
Normal file
26
node_modules/argparse/lib/action/store/true.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/*:nodoc:*
|
||||
* class ActionStoreTrue
|
||||
*
|
||||
* This action store the values True respectively.
|
||||
* This isspecial cases of 'storeConst'
|
||||
*
|
||||
* This class inherited from [[Action]]
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var ActionStoreConstant = require('./constant');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionStoreTrue(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionStoreTrue = module.exports = function ActionStoreTrue(options) {
|
||||
options = options || {};
|
||||
options.constant = true;
|
||||
options.defaultValue = options.defaultValue !== null ? options.defaultValue : false;
|
||||
ActionStoreConstant.call(this, options);
|
||||
};
|
||||
util.inherits(ActionStoreTrue, ActionStoreConstant);
|
||||
149
node_modules/argparse/lib/action/subparsers.js
generated
vendored
Normal file
149
node_modules/argparse/lib/action/subparsers.js
generated
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
/** internal
|
||||
* class ActionSubparsers
|
||||
*
|
||||
* Support the creation of such sub-commands with the addSubparsers()
|
||||
*
|
||||
* This class inherited from [[Action]]
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
var format = require('util').format;
|
||||
|
||||
|
||||
var Action = require('../action');
|
||||
|
||||
// Constants
|
||||
var c = require('../const');
|
||||
|
||||
// Errors
|
||||
var argumentErrorHelper = require('../argument/error');
|
||||
|
||||
|
||||
/*:nodoc:*
|
||||
* new ChoicesPseudoAction(name, help)
|
||||
*
|
||||
* Create pseudo action for correct help text
|
||||
*
|
||||
**/
|
||||
function ChoicesPseudoAction(name, help) {
|
||||
var options = {
|
||||
optionStrings: [],
|
||||
dest: name,
|
||||
help: help
|
||||
};
|
||||
|
||||
Action.call(this, options);
|
||||
}
|
||||
|
||||
util.inherits(ChoicesPseudoAction, Action);
|
||||
|
||||
/**
|
||||
* new ActionSubparsers(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
function ActionSubparsers(options) {
|
||||
options = options || {};
|
||||
options.dest = options.dest || c.SUPPRESS;
|
||||
options.nargs = c.PARSER;
|
||||
|
||||
this.debug = (options.debug === true);
|
||||
|
||||
this._progPrefix = options.prog;
|
||||
this._parserClass = options.parserClass;
|
||||
this._nameParserMap = {};
|
||||
this._choicesActions = [];
|
||||
|
||||
options.choices = this._nameParserMap;
|
||||
Action.call(this, options);
|
||||
}
|
||||
|
||||
util.inherits(ActionSubparsers, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionSubparsers#addParser(name, options) -> ArgumentParser
|
||||
* - name (string): sub-command name
|
||||
* - options (object): see [[ArgumentParser.new]]
|
||||
*
|
||||
* Note:
|
||||
* addParser supports an additional aliases option,
|
||||
* which allows multiple strings to refer to the same subparser.
|
||||
* This example, like svn, aliases co as a shorthand for checkout
|
||||
*
|
||||
**/
|
||||
ActionSubparsers.prototype.addParser = function (name, options) {
|
||||
var parser;
|
||||
|
||||
var self = this;
|
||||
|
||||
options = options || {};
|
||||
|
||||
options.debug = (this.debug === true);
|
||||
|
||||
// set program from the existing prefix
|
||||
if (!options.prog) {
|
||||
options.prog = this._progPrefix + ' ' + name;
|
||||
}
|
||||
|
||||
var aliases = options.aliases || [];
|
||||
|
||||
// create a pseudo-action to hold the choice help
|
||||
if (!!options.help || typeof options.help === 'string') {
|
||||
var help = options.help;
|
||||
delete options.help;
|
||||
|
||||
var choiceAction = new ChoicesPseudoAction(name, help);
|
||||
this._choicesActions.push(choiceAction);
|
||||
}
|
||||
|
||||
// create the parser and add it to the map
|
||||
parser = new this._parserClass(options);
|
||||
this._nameParserMap[name] = parser;
|
||||
|
||||
// make parser available under aliases also
|
||||
aliases.forEach(function (alias) {
|
||||
self._nameParserMap[alias] = parser;
|
||||
});
|
||||
|
||||
return parser;
|
||||
};
|
||||
|
||||
ActionSubparsers.prototype._getSubactions = function () {
|
||||
return this._choicesActions;
|
||||
};
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionSubparsers#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Call the action. Parse input aguments
|
||||
**/
|
||||
ActionSubparsers.prototype.call = function (parser, namespace, values) {
|
||||
var parserName = values[0];
|
||||
var argStrings = values.slice(1);
|
||||
|
||||
// set the parser name if requested
|
||||
if (this.dest !== c.SUPPRESS) {
|
||||
namespace[this.dest] = parserName;
|
||||
}
|
||||
|
||||
// select the parser
|
||||
if (this._nameParserMap[parserName]) {
|
||||
parser = this._nameParserMap[parserName];
|
||||
} else {
|
||||
throw argumentErrorHelper(format(
|
||||
'Unknown parser "%s" (choices: [%s]).',
|
||||
parserName,
|
||||
Object.keys(this._nameParserMap).join(', ')
|
||||
));
|
||||
}
|
||||
|
||||
// parse all the remaining options into the namespace
|
||||
parser.parseArgs(argStrings, namespace);
|
||||
};
|
||||
|
||||
module.exports = ActionSubparsers;
|
||||
47
node_modules/argparse/lib/action/version.js
generated
vendored
Normal file
47
node_modules/argparse/lib/action/version.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
/*:nodoc:*
|
||||
* class ActionVersion
|
||||
*
|
||||
* Support action for printing program version
|
||||
* This class inherited from [[Action]]
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var Action = require('../action');
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
var c = require('../const');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionVersion(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionVersion = module.exports = function ActionVersion(options) {
|
||||
options = options || {};
|
||||
options.defaultValue = (options.defaultValue ? options.defaultValue : c.SUPPRESS);
|
||||
options.dest = (options.dest || c.SUPPRESS);
|
||||
options.nargs = 0;
|
||||
this.version = options.version;
|
||||
Action.call(this, options);
|
||||
};
|
||||
util.inherits(ActionVersion, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionVersion#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Print version and exit
|
||||
**/
|
||||
ActionVersion.prototype.call = function (parser) {
|
||||
var version = this.version || parser.version;
|
||||
var formatter = parser._getFormatter();
|
||||
formatter.addText(version);
|
||||
parser.exit(0, formatter.formatHelp());
|
||||
};
|
||||
482
node_modules/argparse/lib/action_container.js
generated
vendored
Normal file
482
node_modules/argparse/lib/action_container.js
generated
vendored
Normal file
@@ -0,0 +1,482 @@
|
||||
/** internal
|
||||
* class ActionContainer
|
||||
*
|
||||
* Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]]
|
||||
**/
|
||||
|
||||
'use strict';
|
||||
|
||||
var format = require('util').format;
|
||||
|
||||
// Constants
|
||||
var c = require('./const');
|
||||
|
||||
var $$ = require('./utils');
|
||||
|
||||
//Actions
|
||||
var ActionHelp = require('./action/help');
|
||||
var ActionAppend = require('./action/append');
|
||||
var ActionAppendConstant = require('./action/append/constant');
|
||||
var ActionCount = require('./action/count');
|
||||
var ActionStore = require('./action/store');
|
||||
var ActionStoreConstant = require('./action/store/constant');
|
||||
var ActionStoreTrue = require('./action/store/true');
|
||||
var ActionStoreFalse = require('./action/store/false');
|
||||
var ActionVersion = require('./action/version');
|
||||
var ActionSubparsers = require('./action/subparsers');
|
||||
|
||||
// Errors
|
||||
var argumentErrorHelper = require('./argument/error');
|
||||
|
||||
/**
|
||||
* new ActionContainer(options)
|
||||
*
|
||||
* Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]]
|
||||
*
|
||||
* ##### Options:
|
||||
*
|
||||
* - `description` -- A description of what the program does
|
||||
* - `prefixChars` -- Characters that prefix optional arguments
|
||||
* - `argumentDefault` -- The default value for all arguments
|
||||
* - `conflictHandler` -- The conflict handler to use for duplicate arguments
|
||||
**/
|
||||
var ActionContainer = module.exports = function ActionContainer(options) {
|
||||
options = options || {};
|
||||
|
||||
this.description = options.description;
|
||||
this.argumentDefault = options.argumentDefault;
|
||||
this.prefixChars = options.prefixChars || '';
|
||||
this.conflictHandler = options.conflictHandler;
|
||||
|
||||
// set up registries
|
||||
this._registries = {};
|
||||
|
||||
// register actions
|
||||
this.register('action', null, ActionStore);
|
||||
this.register('action', 'store', ActionStore);
|
||||
this.register('action', 'storeConst', ActionStoreConstant);
|
||||
this.register('action', 'storeTrue', ActionStoreTrue);
|
||||
this.register('action', 'storeFalse', ActionStoreFalse);
|
||||
this.register('action', 'append', ActionAppend);
|
||||
this.register('action', 'appendConst', ActionAppendConstant);
|
||||
this.register('action', 'count', ActionCount);
|
||||
this.register('action', 'help', ActionHelp);
|
||||
this.register('action', 'version', ActionVersion);
|
||||
this.register('action', 'parsers', ActionSubparsers);
|
||||
|
||||
// raise an exception if the conflict handler is invalid
|
||||
this._getHandler();
|
||||
|
||||
// action storage
|
||||
this._actions = [];
|
||||
this._optionStringActions = {};
|
||||
|
||||
// groups
|
||||
this._actionGroups = [];
|
||||
this._mutuallyExclusiveGroups = [];
|
||||
|
||||
// defaults storage
|
||||
this._defaults = {};
|
||||
|
||||
// determines whether an "option" looks like a negative number
|
||||
// -1, -1.5 -5e+4
|
||||
this._regexpNegativeNumber = new RegExp('^[-]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$');
|
||||
|
||||
// whether or not there are any optionals that look like negative
|
||||
// numbers -- uses a list so it can be shared and edited
|
||||
this._hasNegativeNumberOptionals = [];
|
||||
};
|
||||
|
||||
// Groups must be required, then ActionContainer already defined
|
||||
var ArgumentGroup = require('./argument/group');
|
||||
var MutuallyExclusiveGroup = require('./argument/exclusive');
|
||||
|
||||
//
|
||||
// Registration methods
|
||||
//
|
||||
|
||||
/**
|
||||
* ActionContainer#register(registryName, value, object) -> Void
|
||||
* - registryName (String) : object type action|type
|
||||
* - value (string) : keyword
|
||||
* - object (Object|Function) : handler
|
||||
*
|
||||
* Register handlers
|
||||
**/
|
||||
ActionContainer.prototype.register = function (registryName, value, object) {
|
||||
this._registries[registryName] = this._registries[registryName] || {};
|
||||
this._registries[registryName][value] = object;
|
||||
};
|
||||
|
||||
ActionContainer.prototype._registryGet = function (registryName, value, defaultValue) {
|
||||
if (arguments.length < 3) {
|
||||
defaultValue = null;
|
||||
}
|
||||
return this._registries[registryName][value] || defaultValue;
|
||||
};
|
||||
|
||||
//
|
||||
// Namespace default accessor methods
|
||||
//
|
||||
|
||||
/**
|
||||
* ActionContainer#setDefaults(options) -> Void
|
||||
* - options (object):hash of options see [[Action.new]]
|
||||
*
|
||||
* Set defaults
|
||||
**/
|
||||
ActionContainer.prototype.setDefaults = function (options) {
|
||||
options = options || {};
|
||||
for (var property in options) {
|
||||
if ($$.has(options, property)) {
|
||||
this._defaults[property] = options[property];
|
||||
}
|
||||
}
|
||||
|
||||
// if these defaults match any existing arguments, replace the previous
|
||||
// default on the object with the new one
|
||||
this._actions.forEach(function (action) {
|
||||
if ($$.has(options, action.dest)) {
|
||||
action.defaultValue = options[action.dest];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* ActionContainer#getDefault(dest) -> Mixed
|
||||
* - dest (string): action destination
|
||||
*
|
||||
* Return action default value
|
||||
**/
|
||||
ActionContainer.prototype.getDefault = function (dest) {
|
||||
var result = $$.has(this._defaults, dest) ? this._defaults[dest] : null;
|
||||
|
||||
this._actions.forEach(function (action) {
|
||||
if (action.dest === dest && $$.has(action, 'defaultValue')) {
|
||||
result = action.defaultValue;
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
};
|
||||
//
|
||||
// Adding argument actions
|
||||
//
|
||||
|
||||
/**
|
||||
* ActionContainer#addArgument(args, options) -> Object
|
||||
* - args (String|Array): argument key, or array of argument keys
|
||||
* - options (Object): action objects see [[Action.new]]
|
||||
*
|
||||
* #### Examples
|
||||
* - addArgument([ '-f', '--foo' ], { action: 'store', defaultValue: 1, ... })
|
||||
* - addArgument([ 'bar' ], { action: 'store', nargs: 1, ... })
|
||||
* - addArgument('--baz', { action: 'store', nargs: 1, ... })
|
||||
**/
|
||||
ActionContainer.prototype.addArgument = function (args, options) {
|
||||
args = args;
|
||||
options = options || {};
|
||||
|
||||
if (typeof args === 'string') {
|
||||
args = [ args ];
|
||||
}
|
||||
if (!Array.isArray(args)) {
|
||||
throw new TypeError('addArgument first argument should be a string or an array');
|
||||
}
|
||||
if (typeof options !== 'object' || Array.isArray(options)) {
|
||||
throw new TypeError('addArgument second argument should be a hash');
|
||||
}
|
||||
|
||||
// if no positional args are supplied or only one is supplied and
|
||||
// it doesn't look like an option string, parse a positional argument
|
||||
if (!args || args.length === 1 && this.prefixChars.indexOf(args[0][0]) < 0) {
|
||||
if (args && !!options.dest) {
|
||||
throw new Error('dest supplied twice for positional argument');
|
||||
}
|
||||
options = this._getPositional(args, options);
|
||||
|
||||
// otherwise, we're adding an optional argument
|
||||
} else {
|
||||
options = this._getOptional(args, options);
|
||||
}
|
||||
|
||||
// if no default was supplied, use the parser-level default
|
||||
if (typeof options.defaultValue === 'undefined') {
|
||||
var dest = options.dest;
|
||||
if ($$.has(this._defaults, dest)) {
|
||||
options.defaultValue = this._defaults[dest];
|
||||
} else if (typeof this.argumentDefault !== 'undefined') {
|
||||
options.defaultValue = this.argumentDefault;
|
||||
}
|
||||
}
|
||||
|
||||
// create the action object, and add it to the parser
|
||||
var ActionClass = this._popActionClass(options);
|
||||
if (typeof ActionClass !== 'function') {
|
||||
throw new Error(format('Unknown action "%s".', ActionClass));
|
||||
}
|
||||
var action = new ActionClass(options);
|
||||
|
||||
// throw an error if the action type is not callable
|
||||
var typeFunction = this._registryGet('type', action.type, action.type);
|
||||
if (typeof typeFunction !== 'function') {
|
||||
throw new Error(format('"%s" is not callable', typeFunction));
|
||||
}
|
||||
|
||||
return this._addAction(action);
|
||||
};
|
||||
|
||||
/**
|
||||
* ActionContainer#addArgumentGroup(options) -> ArgumentGroup
|
||||
* - options (Object): hash of options see [[ArgumentGroup.new]]
|
||||
*
|
||||
* Create new arguments groups
|
||||
**/
|
||||
ActionContainer.prototype.addArgumentGroup = function (options) {
|
||||
var group = new ArgumentGroup(this, options);
|
||||
this._actionGroups.push(group);
|
||||
return group;
|
||||
};
|
||||
|
||||
/**
|
||||
* ActionContainer#addMutuallyExclusiveGroup(options) -> ArgumentGroup
|
||||
* - options (Object): {required: false}
|
||||
*
|
||||
* Create new mutual exclusive groups
|
||||
**/
|
||||
ActionContainer.prototype.addMutuallyExclusiveGroup = function (options) {
|
||||
var group = new MutuallyExclusiveGroup(this, options);
|
||||
this._mutuallyExclusiveGroups.push(group);
|
||||
return group;
|
||||
};
|
||||
|
||||
ActionContainer.prototype._addAction = function (action) {
|
||||
var self = this;
|
||||
|
||||
// resolve any conflicts
|
||||
this._checkConflict(action);
|
||||
|
||||
// add to actions list
|
||||
this._actions.push(action);
|
||||
action.container = this;
|
||||
|
||||
// index the action by any option strings it has
|
||||
action.optionStrings.forEach(function (optionString) {
|
||||
self._optionStringActions[optionString] = action;
|
||||
});
|
||||
|
||||
// set the flag if any option strings look like negative numbers
|
||||
action.optionStrings.forEach(function (optionString) {
|
||||
if (optionString.match(self._regexpNegativeNumber)) {
|
||||
if (!self._hasNegativeNumberOptionals.some(Boolean)) {
|
||||
self._hasNegativeNumberOptionals.push(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// return the created action
|
||||
return action;
|
||||
};
|
||||
|
||||
ActionContainer.prototype._removeAction = function (action) {
|
||||
var actionIndex = this._actions.indexOf(action);
|
||||
if (actionIndex >= 0) {
|
||||
this._actions.splice(actionIndex, 1);
|
||||
}
|
||||
};
|
||||
|
||||
ActionContainer.prototype._addContainerActions = function (container) {
|
||||
// collect groups by titles
|
||||
var titleGroupMap = {};
|
||||
this._actionGroups.forEach(function (group) {
|
||||
if (titleGroupMap[group.title]) {
|
||||
throw new Error(format('Cannot merge actions - two groups are named "%s".', group.title));
|
||||
}
|
||||
titleGroupMap[group.title] = group;
|
||||
});
|
||||
|
||||
// map each action to its group
|
||||
var groupMap = {};
|
||||
function actionHash(action) {
|
||||
// unique (hopefully?) string suitable as dictionary key
|
||||
return action.getName();
|
||||
}
|
||||
container._actionGroups.forEach(function (group) {
|
||||
// if a group with the title exists, use that, otherwise
|
||||
// create a new group matching the container's group
|
||||
if (!titleGroupMap[group.title]) {
|
||||
titleGroupMap[group.title] = this.addArgumentGroup({
|
||||
title: group.title,
|
||||
description: group.description
|
||||
});
|
||||
}
|
||||
|
||||
// map the actions to their new group
|
||||
group._groupActions.forEach(function (action) {
|
||||
groupMap[actionHash(action)] = titleGroupMap[group.title];
|
||||
});
|
||||
}, this);
|
||||
|
||||
// add container's mutually exclusive groups
|
||||
// NOTE: if add_mutually_exclusive_group ever gains title= and
|
||||
// description= then this code will need to be expanded as above
|
||||
var mutexGroup;
|
||||
container._mutuallyExclusiveGroups.forEach(function (group) {
|
||||
mutexGroup = this.addMutuallyExclusiveGroup({
|
||||
required: group.required
|
||||
});
|
||||
// map the actions to their new mutex group
|
||||
group._groupActions.forEach(function (action) {
|
||||
groupMap[actionHash(action)] = mutexGroup;
|
||||
});
|
||||
}, this); // forEach takes a 'this' argument
|
||||
|
||||
// add all actions to this container or their group
|
||||
container._actions.forEach(function (action) {
|
||||
var key = actionHash(action);
|
||||
if (groupMap[key]) {
|
||||
groupMap[key]._addAction(action);
|
||||
} else {
|
||||
this._addAction(action);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
ActionContainer.prototype._getPositional = function (dest, options) {
|
||||
if (Array.isArray(dest)) {
|
||||
dest = dest[0];
|
||||
}
|
||||
// make sure required is not specified
|
||||
if (options.required) {
|
||||
throw new Error('"required" is an invalid argument for positionals.');
|
||||
}
|
||||
|
||||
// mark positional arguments as required if at least one is
|
||||
// always required
|
||||
if (options.nargs !== c.OPTIONAL && options.nargs !== c.ZERO_OR_MORE) {
|
||||
options.required = true;
|
||||
}
|
||||
if (options.nargs === c.ZERO_OR_MORE && typeof options.defaultValue === 'undefined') {
|
||||
options.required = true;
|
||||
}
|
||||
|
||||
// return the keyword arguments with no option strings
|
||||
options.dest = dest;
|
||||
options.optionStrings = [];
|
||||
return options;
|
||||
};
|
||||
|
||||
ActionContainer.prototype._getOptional = function (args, options) {
|
||||
var prefixChars = this.prefixChars;
|
||||
var optionStrings = [];
|
||||
var optionStringsLong = [];
|
||||
|
||||
// determine short and long option strings
|
||||
args.forEach(function (optionString) {
|
||||
// error on strings that don't start with an appropriate prefix
|
||||
if (prefixChars.indexOf(optionString[0]) < 0) {
|
||||
throw new Error(format('Invalid option string "%s": must start with a "%s".',
|
||||
optionString,
|
||||
prefixChars
|
||||
));
|
||||
}
|
||||
|
||||
// strings starting with two prefix characters are long options
|
||||
optionStrings.push(optionString);
|
||||
if (optionString.length > 1 && prefixChars.indexOf(optionString[1]) >= 0) {
|
||||
optionStringsLong.push(optionString);
|
||||
}
|
||||
});
|
||||
|
||||
// infer dest, '--foo-bar' -> 'foo_bar' and '-x' -> 'x'
|
||||
var dest = options.dest || null;
|
||||
delete options.dest;
|
||||
|
||||
if (!dest) {
|
||||
var optionStringDest = optionStringsLong.length ? optionStringsLong[0] : optionStrings[0];
|
||||
dest = $$.trimChars(optionStringDest, this.prefixChars);
|
||||
|
||||
if (dest.length === 0) {
|
||||
throw new Error(
|
||||
format('dest= is required for options like "%s"', optionStrings.join(', '))
|
||||
);
|
||||
}
|
||||
dest = dest.replace(/-/g, '_');
|
||||
}
|
||||
|
||||
// return the updated keyword arguments
|
||||
options.dest = dest;
|
||||
options.optionStrings = optionStrings;
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
ActionContainer.prototype._popActionClass = function (options, defaultValue) {
|
||||
defaultValue = defaultValue || null;
|
||||
|
||||
var action = (options.action || defaultValue);
|
||||
delete options.action;
|
||||
|
||||
var actionClass = this._registryGet('action', action, action);
|
||||
return actionClass;
|
||||
};
|
||||
|
||||
ActionContainer.prototype._getHandler = function () {
|
||||
var handlerString = this.conflictHandler;
|
||||
var handlerFuncName = '_handleConflict' + $$.capitalize(handlerString);
|
||||
var func = this[handlerFuncName];
|
||||
if (typeof func === 'undefined') {
|
||||
var msg = 'invalid conflict resolution value: ' + handlerString;
|
||||
throw new Error(msg);
|
||||
} else {
|
||||
return func;
|
||||
}
|
||||
};
|
||||
|
||||
ActionContainer.prototype._checkConflict = function (action) {
|
||||
var optionStringActions = this._optionStringActions;
|
||||
var conflictOptionals = [];
|
||||
|
||||
// find all options that conflict with this option
|
||||
// collect pairs, the string, and an existing action that it conflicts with
|
||||
action.optionStrings.forEach(function (optionString) {
|
||||
var conflOptional = optionStringActions[optionString];
|
||||
if (typeof conflOptional !== 'undefined') {
|
||||
conflictOptionals.push([ optionString, conflOptional ]);
|
||||
}
|
||||
});
|
||||
|
||||
if (conflictOptionals.length > 0) {
|
||||
var conflictHandler = this._getHandler();
|
||||
conflictHandler.call(this, action, conflictOptionals);
|
||||
}
|
||||
};
|
||||
|
||||
ActionContainer.prototype._handleConflictError = function (action, conflOptionals) {
|
||||
var conflicts = conflOptionals.map(function (pair) { return pair[0]; });
|
||||
conflicts = conflicts.join(', ');
|
||||
throw argumentErrorHelper(
|
||||
action,
|
||||
format('Conflicting option string(s): %s', conflicts)
|
||||
);
|
||||
};
|
||||
|
||||
ActionContainer.prototype._handleConflictResolve = function (action, conflOptionals) {
|
||||
// remove all conflicting options
|
||||
var self = this;
|
||||
conflOptionals.forEach(function (pair) {
|
||||
var optionString = pair[0];
|
||||
var conflictingAction = pair[1];
|
||||
// remove the conflicting option string
|
||||
var i = conflictingAction.optionStrings.indexOf(optionString);
|
||||
if (i >= 0) {
|
||||
conflictingAction.optionStrings.splice(i, 1);
|
||||
}
|
||||
delete self._optionStringActions[optionString];
|
||||
// if the option now has no option string, remove it from the
|
||||
// container holding it
|
||||
if (conflictingAction.optionStrings.length === 0) {
|
||||
conflictingAction.container._removeAction(conflictingAction);
|
||||
}
|
||||
});
|
||||
};
|
||||
14
node_modules/argparse/lib/argparse.js
generated
vendored
Normal file
14
node_modules/argparse/lib/argparse.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
module.exports.ArgumentParser = require('./argument_parser.js');
|
||||
module.exports.Namespace = require('./namespace');
|
||||
module.exports.Action = require('./action');
|
||||
module.exports.HelpFormatter = require('./help/formatter.js');
|
||||
module.exports.Const = require('./const.js');
|
||||
|
||||
module.exports.ArgumentDefaultsHelpFormatter =
|
||||
require('./help/added_formatters.js').ArgumentDefaultsHelpFormatter;
|
||||
module.exports.RawDescriptionHelpFormatter =
|
||||
require('./help/added_formatters.js').RawDescriptionHelpFormatter;
|
||||
module.exports.RawTextHelpFormatter =
|
||||
require('./help/added_formatters.js').RawTextHelpFormatter;
|
||||
50
node_modules/argparse/lib/argument/error.js
generated
vendored
Normal file
50
node_modules/argparse/lib/argument/error.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
var format = require('util').format;
|
||||
|
||||
|
||||
var ERR_CODE = 'ARGError';
|
||||
|
||||
/*:nodoc:*
|
||||
* argumentError(argument, message) -> TypeError
|
||||
* - argument (Object): action with broken argument
|
||||
* - message (String): error message
|
||||
*
|
||||
* Error format helper. An error from creating or using an argument
|
||||
* (optional or positional). The string value of this exception
|
||||
* is the message, augmented with information
|
||||
* about the argument that caused it.
|
||||
*
|
||||
* #####Example
|
||||
*
|
||||
* var argumentErrorHelper = require('./argument/error');
|
||||
* if (conflictOptionals.length > 0) {
|
||||
* throw argumentErrorHelper(
|
||||
* action,
|
||||
* format('Conflicting option string(s): %s', conflictOptionals.join(', '))
|
||||
* );
|
||||
* }
|
||||
*
|
||||
**/
|
||||
module.exports = function (argument, message) {
|
||||
var argumentName = null;
|
||||
var errMessage;
|
||||
var err;
|
||||
|
||||
if (argument.getName) {
|
||||
argumentName = argument.getName();
|
||||
} else {
|
||||
argumentName = '' + argument;
|
||||
}
|
||||
|
||||
if (!argumentName) {
|
||||
errMessage = message;
|
||||
} else {
|
||||
errMessage = format('argument "%s": %s', argumentName, message);
|
||||
}
|
||||
|
||||
err = new TypeError(errMessage);
|
||||
err.code = ERR_CODE;
|
||||
return err;
|
||||
};
|
||||
54
node_modules/argparse/lib/argument/exclusive.js
generated
vendored
Normal file
54
node_modules/argparse/lib/argument/exclusive.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
/** internal
|
||||
* class MutuallyExclusiveGroup
|
||||
*
|
||||
* Group arguments.
|
||||
* By default, ArgumentParser groups command-line arguments
|
||||
* into “positional arguments” and “optional arguments”
|
||||
* when displaying help messages. When there is a better
|
||||
* conceptual grouping of arguments than this default one,
|
||||
* appropriate groups can be created using the addArgumentGroup() method
|
||||
*
|
||||
* This class inherited from [[ArgumentContainer]]
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var ArgumentGroup = require('./group');
|
||||
|
||||
/**
|
||||
* new MutuallyExclusiveGroup(container, options)
|
||||
* - container (object): main container
|
||||
* - options (object): options.required -> true/false
|
||||
*
|
||||
* `required` could be an argument itself, but making it a property of
|
||||
* the options argument is more consistent with the JS adaptation of the Python)
|
||||
**/
|
||||
var MutuallyExclusiveGroup = module.exports = function MutuallyExclusiveGroup(container, options) {
|
||||
var required;
|
||||
options = options || {};
|
||||
required = options.required || false;
|
||||
ArgumentGroup.call(this, container);
|
||||
this.required = required;
|
||||
|
||||
};
|
||||
util.inherits(MutuallyExclusiveGroup, ArgumentGroup);
|
||||
|
||||
|
||||
MutuallyExclusiveGroup.prototype._addAction = function (action) {
|
||||
var msg;
|
||||
if (action.required) {
|
||||
msg = 'mutually exclusive arguments must be optional';
|
||||
throw new Error(msg);
|
||||
}
|
||||
action = this._container._addAction(action);
|
||||
this._groupActions.push(action);
|
||||
return action;
|
||||
};
|
||||
|
||||
|
||||
MutuallyExclusiveGroup.prototype._removeAction = function (action) {
|
||||
this._container._removeAction(action);
|
||||
this._groupActions.remove(action);
|
||||
};
|
||||
|
||||
75
node_modules/argparse/lib/argument/group.js
generated
vendored
Normal file
75
node_modules/argparse/lib/argument/group.js
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
/** internal
|
||||
* class ArgumentGroup
|
||||
*
|
||||
* Group arguments.
|
||||
* By default, ArgumentParser groups command-line arguments
|
||||
* into “positional arguments” and “optional arguments”
|
||||
* when displaying help messages. When there is a better
|
||||
* conceptual grouping of arguments than this default one,
|
||||
* appropriate groups can be created using the addArgumentGroup() method
|
||||
*
|
||||
* This class inherited from [[ArgumentContainer]]
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var ActionContainer = require('../action_container');
|
||||
|
||||
|
||||
/**
|
||||
* new ArgumentGroup(container, options)
|
||||
* - container (object): main container
|
||||
* - options (object): hash of group options
|
||||
*
|
||||
* #### options
|
||||
* - **prefixChars** group name prefix
|
||||
* - **argumentDefault** default argument value
|
||||
* - **title** group title
|
||||
* - **description** group description
|
||||
*
|
||||
**/
|
||||
var ArgumentGroup = module.exports = function ArgumentGroup(container, options) {
|
||||
|
||||
options = options || {};
|
||||
|
||||
// add any missing keyword arguments by checking the container
|
||||
options.conflictHandler = (options.conflictHandler || container.conflictHandler);
|
||||
options.prefixChars = (options.prefixChars || container.prefixChars);
|
||||
options.argumentDefault = (options.argumentDefault || container.argumentDefault);
|
||||
|
||||
ActionContainer.call(this, options);
|
||||
|
||||
// group attributes
|
||||
this.title = options.title;
|
||||
this._groupActions = [];
|
||||
|
||||
// share most attributes with the container
|
||||
this._container = container;
|
||||
this._registries = container._registries;
|
||||
this._actions = container._actions;
|
||||
this._optionStringActions = container._optionStringActions;
|
||||
this._defaults = container._defaults;
|
||||
this._hasNegativeNumberOptionals = container._hasNegativeNumberOptionals;
|
||||
this._mutuallyExclusiveGroups = container._mutuallyExclusiveGroups;
|
||||
};
|
||||
util.inherits(ArgumentGroup, ActionContainer);
|
||||
|
||||
|
||||
ArgumentGroup.prototype._addAction = function (action) {
|
||||
// Parent add action
|
||||
action = ActionContainer.prototype._addAction.call(this, action);
|
||||
this._groupActions.push(action);
|
||||
return action;
|
||||
};
|
||||
|
||||
|
||||
ArgumentGroup.prototype._removeAction = function (action) {
|
||||
// Parent remove action
|
||||
ActionContainer.prototype._removeAction.call(this, action);
|
||||
var actionIndex = this._groupActions.indexOf(action);
|
||||
if (actionIndex >= 0) {
|
||||
this._groupActions.splice(actionIndex, 1);
|
||||
}
|
||||
};
|
||||
|
||||
1161
node_modules/argparse/lib/argument_parser.js
generated
vendored
Normal file
1161
node_modules/argparse/lib/argument_parser.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
21
node_modules/argparse/lib/const.js
generated
vendored
Normal file
21
node_modules/argparse/lib/const.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports.EOL = '\n';
|
||||
|
||||
module.exports.SUPPRESS = '==SUPPRESS==';
|
||||
|
||||
module.exports.OPTIONAL = '?';
|
||||
|
||||
module.exports.ZERO_OR_MORE = '*';
|
||||
|
||||
module.exports.ONE_OR_MORE = '+';
|
||||
|
||||
module.exports.PARSER = 'A...';
|
||||
|
||||
module.exports.REMAINDER = '...';
|
||||
|
||||
module.exports._UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args';
|
||||
87
node_modules/argparse/lib/help/added_formatters.js
generated
vendored
Normal file
87
node_modules/argparse/lib/help/added_formatters.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
// Constants
|
||||
var c = require('../const');
|
||||
|
||||
var $$ = require('../utils');
|
||||
var HelpFormatter = require('./formatter.js');
|
||||
|
||||
/**
|
||||
* new RawDescriptionHelpFormatter(options)
|
||||
* new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...})
|
||||
*
|
||||
* Help message formatter which adds default values to argument help.
|
||||
*
|
||||
* Only the name of this class is considered a public API. All the methods
|
||||
* provided by the class are considered an implementation detail.
|
||||
**/
|
||||
|
||||
function ArgumentDefaultsHelpFormatter(options) {
|
||||
HelpFormatter.call(this, options);
|
||||
}
|
||||
|
||||
util.inherits(ArgumentDefaultsHelpFormatter, HelpFormatter);
|
||||
|
||||
ArgumentDefaultsHelpFormatter.prototype._getHelpString = function (action) {
|
||||
var help = action.help;
|
||||
if (action.help.indexOf('%(defaultValue)s') === -1) {
|
||||
if (action.defaultValue !== c.SUPPRESS) {
|
||||
var defaulting_nargs = [ c.OPTIONAL, c.ZERO_OR_MORE ];
|
||||
if (action.isOptional() || (defaulting_nargs.indexOf(action.nargs) >= 0)) {
|
||||
help += ' (default: %(defaultValue)s)';
|
||||
}
|
||||
}
|
||||
}
|
||||
return help;
|
||||
};
|
||||
|
||||
module.exports.ArgumentDefaultsHelpFormatter = ArgumentDefaultsHelpFormatter;
|
||||
|
||||
/**
|
||||
* new RawDescriptionHelpFormatter(options)
|
||||
* new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...})
|
||||
*
|
||||
* Help message formatter which retains any formatting in descriptions.
|
||||
*
|
||||
* Only the name of this class is considered a public API. All the methods
|
||||
* provided by the class are considered an implementation detail.
|
||||
**/
|
||||
|
||||
function RawDescriptionHelpFormatter(options) {
|
||||
HelpFormatter.call(this, options);
|
||||
}
|
||||
|
||||
util.inherits(RawDescriptionHelpFormatter, HelpFormatter);
|
||||
|
||||
RawDescriptionHelpFormatter.prototype._fillText = function (text, width, indent) {
|
||||
var lines = text.split('\n');
|
||||
lines = lines.map(function (line) {
|
||||
return $$.trimEnd(indent + line);
|
||||
});
|
||||
return lines.join('\n');
|
||||
};
|
||||
module.exports.RawDescriptionHelpFormatter = RawDescriptionHelpFormatter;
|
||||
|
||||
/**
|
||||
* new RawTextHelpFormatter(options)
|
||||
* new ArgumentParser({formatterClass: argparse.RawTextHelpFormatter, ...})
|
||||
*
|
||||
* Help message formatter which retains formatting of all help text.
|
||||
*
|
||||
* Only the name of this class is considered a public API. All the methods
|
||||
* provided by the class are considered an implementation detail.
|
||||
**/
|
||||
|
||||
function RawTextHelpFormatter(options) {
|
||||
RawDescriptionHelpFormatter.call(this, options);
|
||||
}
|
||||
|
||||
util.inherits(RawTextHelpFormatter, RawDescriptionHelpFormatter);
|
||||
|
||||
RawTextHelpFormatter.prototype._splitLines = function (text) {
|
||||
return text.split('\n');
|
||||
};
|
||||
|
||||
module.exports.RawTextHelpFormatter = RawTextHelpFormatter;
|
||||
795
node_modules/argparse/lib/help/formatter.js
generated
vendored
Normal file
795
node_modules/argparse/lib/help/formatter.js
generated
vendored
Normal file
@@ -0,0 +1,795 @@
|
||||
/**
|
||||
* class HelpFormatter
|
||||
*
|
||||
* Formatter for generating usage messages and argument help strings. Only the
|
||||
* name of this class is considered a public API. All the methods provided by
|
||||
* the class are considered an implementation detail.
|
||||
*
|
||||
* Do not call in your code, use this class only for inherits your own forvatter
|
||||
*
|
||||
* ToDo add [additonal formatters][1]
|
||||
*
|
||||
* [1]:http://docs.python.org/dev/library/argparse.html#formatter-class
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var sprintf = require('sprintf-js').sprintf;
|
||||
|
||||
// Constants
|
||||
var c = require('../const');
|
||||
|
||||
var $$ = require('../utils');
|
||||
|
||||
|
||||
/*:nodoc:* internal
|
||||
* new Support(parent, heding)
|
||||
* - parent (object): parent section
|
||||
* - heading (string): header string
|
||||
*
|
||||
**/
|
||||
function Section(parent, heading) {
|
||||
this._parent = parent;
|
||||
this._heading = heading;
|
||||
this._items = [];
|
||||
}
|
||||
|
||||
/*:nodoc:* internal
|
||||
* Section#addItem(callback) -> Void
|
||||
* - callback (array): tuple with function and args
|
||||
*
|
||||
* Add function for single element
|
||||
**/
|
||||
Section.prototype.addItem = function (callback) {
|
||||
this._items.push(callback);
|
||||
};
|
||||
|
||||
/*:nodoc:* internal
|
||||
* Section#formatHelp(formatter) -> string
|
||||
* - formatter (HelpFormatter): current formatter
|
||||
*
|
||||
* Form help section string
|
||||
*
|
||||
**/
|
||||
Section.prototype.formatHelp = function (formatter) {
|
||||
var itemHelp, heading;
|
||||
|
||||
// format the indented section
|
||||
if (this._parent) {
|
||||
formatter._indent();
|
||||
}
|
||||
|
||||
itemHelp = this._items.map(function (item) {
|
||||
var obj, func, args;
|
||||
|
||||
obj = formatter;
|
||||
func = item[0];
|
||||
args = item[1];
|
||||
return func.apply(obj, args);
|
||||
});
|
||||
itemHelp = formatter._joinParts(itemHelp);
|
||||
|
||||
if (this._parent) {
|
||||
formatter._dedent();
|
||||
}
|
||||
|
||||
// return nothing if the section was empty
|
||||
if (!itemHelp) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// add the heading if the section was non-empty
|
||||
heading = '';
|
||||
if (this._heading && this._heading !== c.SUPPRESS) {
|
||||
var currentIndent = formatter.currentIndent;
|
||||
heading = $$.repeat(' ', currentIndent) + this._heading + ':' + c.EOL;
|
||||
}
|
||||
|
||||
// join the section-initialize newline, the heading and the help
|
||||
return formatter._joinParts([ c.EOL, heading, itemHelp, c.EOL ]);
|
||||
};
|
||||
|
||||
/**
|
||||
* new HelpFormatter(options)
|
||||
*
|
||||
* #### Options:
|
||||
* - `prog`: program name
|
||||
* - `indentIncriment`: indent step, default value 2
|
||||
* - `maxHelpPosition`: max help position, default value = 24
|
||||
* - `width`: line width
|
||||
*
|
||||
**/
|
||||
var HelpFormatter = module.exports = function HelpFormatter(options) {
|
||||
options = options || {};
|
||||
|
||||
this._prog = options.prog;
|
||||
|
||||
this._maxHelpPosition = options.maxHelpPosition || 24;
|
||||
this._width = (options.width || ((process.env.COLUMNS || 80) - 2));
|
||||
|
||||
this._currentIndent = 0;
|
||||
this._indentIncriment = options.indentIncriment || 2;
|
||||
this._level = 0;
|
||||
this._actionMaxLength = 0;
|
||||
|
||||
this._rootSection = new Section(null);
|
||||
this._currentSection = this._rootSection;
|
||||
|
||||
this._whitespaceMatcher = new RegExp('\\s+', 'g');
|
||||
this._longBreakMatcher = new RegExp(c.EOL + c.EOL + c.EOL + '+', 'g');
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._indent = function () {
|
||||
this._currentIndent += this._indentIncriment;
|
||||
this._level += 1;
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._dedent = function () {
|
||||
this._currentIndent -= this._indentIncriment;
|
||||
this._level -= 1;
|
||||
if (this._currentIndent < 0) {
|
||||
throw new Error('Indent decreased below 0.');
|
||||
}
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._addItem = function (func, args) {
|
||||
this._currentSection.addItem([ func, args ]);
|
||||
};
|
||||
|
||||
//
|
||||
// Message building methods
|
||||
//
|
||||
|
||||
/**
|
||||
* HelpFormatter#startSection(heading) -> Void
|
||||
* - heading (string): header string
|
||||
*
|
||||
* Start new help section
|
||||
*
|
||||
* See alse [code example][1]
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* formatter.startSection(actionGroup.title);
|
||||
* formatter.addText(actionGroup.description);
|
||||
* formatter.addArguments(actionGroup._groupActions);
|
||||
* formatter.endSection();
|
||||
*
|
||||
**/
|
||||
HelpFormatter.prototype.startSection = function (heading) {
|
||||
this._indent();
|
||||
var section = new Section(this._currentSection, heading);
|
||||
var func = section.formatHelp.bind(section);
|
||||
this._addItem(func, [ this ]);
|
||||
this._currentSection = section;
|
||||
};
|
||||
|
||||
/**
|
||||
* HelpFormatter#endSection -> Void
|
||||
*
|
||||
* End help section
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* formatter.startSection(actionGroup.title);
|
||||
* formatter.addText(actionGroup.description);
|
||||
* formatter.addArguments(actionGroup._groupActions);
|
||||
* formatter.endSection();
|
||||
**/
|
||||
HelpFormatter.prototype.endSection = function () {
|
||||
this._currentSection = this._currentSection._parent;
|
||||
this._dedent();
|
||||
};
|
||||
|
||||
/**
|
||||
* HelpFormatter#addText(text) -> Void
|
||||
* - text (string): plain text
|
||||
*
|
||||
* Add plain text into current section
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* formatter.startSection(actionGroup.title);
|
||||
* formatter.addText(actionGroup.description);
|
||||
* formatter.addArguments(actionGroup._groupActions);
|
||||
* formatter.endSection();
|
||||
*
|
||||
**/
|
||||
HelpFormatter.prototype.addText = function (text) {
|
||||
if (text && text !== c.SUPPRESS) {
|
||||
this._addItem(this._formatText, [ text ]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* HelpFormatter#addUsage(usage, actions, groups, prefix) -> Void
|
||||
* - usage (string): usage text
|
||||
* - actions (array): actions list
|
||||
* - groups (array): groups list
|
||||
* - prefix (string): usage prefix
|
||||
*
|
||||
* Add usage data into current section
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* formatter.addUsage(this.usage, this._actions, []);
|
||||
* return formatter.formatHelp();
|
||||
*
|
||||
**/
|
||||
HelpFormatter.prototype.addUsage = function (usage, actions, groups, prefix) {
|
||||
if (usage !== c.SUPPRESS) {
|
||||
this._addItem(this._formatUsage, [ usage, actions, groups, prefix ]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* HelpFormatter#addArgument(action) -> Void
|
||||
* - action (object): action
|
||||
*
|
||||
* Add argument into current section
|
||||
*
|
||||
* Single variant of [[HelpFormatter#addArguments]]
|
||||
**/
|
||||
HelpFormatter.prototype.addArgument = function (action) {
|
||||
if (action.help !== c.SUPPRESS) {
|
||||
var self = this;
|
||||
|
||||
// find all invocations
|
||||
var invocations = [ this._formatActionInvocation(action) ];
|
||||
var invocationLength = invocations[0].length;
|
||||
|
||||
var actionLength;
|
||||
|
||||
if (action._getSubactions) {
|
||||
this._indent();
|
||||
action._getSubactions().forEach(function (subaction) {
|
||||
|
||||
var invocationNew = self._formatActionInvocation(subaction);
|
||||
invocations.push(invocationNew);
|
||||
invocationLength = Math.max(invocationLength, invocationNew.length);
|
||||
|
||||
});
|
||||
this._dedent();
|
||||
}
|
||||
|
||||
// update the maximum item length
|
||||
actionLength = invocationLength + this._currentIndent;
|
||||
this._actionMaxLength = Math.max(this._actionMaxLength, actionLength);
|
||||
|
||||
// add the item to the list
|
||||
this._addItem(this._formatAction, [ action ]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* HelpFormatter#addArguments(actions) -> Void
|
||||
* - actions (array): actions list
|
||||
*
|
||||
* Mass add arguments into current section
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* formatter.startSection(actionGroup.title);
|
||||
* formatter.addText(actionGroup.description);
|
||||
* formatter.addArguments(actionGroup._groupActions);
|
||||
* formatter.endSection();
|
||||
*
|
||||
**/
|
||||
HelpFormatter.prototype.addArguments = function (actions) {
|
||||
var self = this;
|
||||
actions.forEach(function (action) {
|
||||
self.addArgument(action);
|
||||
});
|
||||
};
|
||||
|
||||
//
|
||||
// Help-formatting methods
|
||||
//
|
||||
|
||||
/**
|
||||
* HelpFormatter#formatHelp -> string
|
||||
*
|
||||
* Format help
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* formatter.addText(this.epilog);
|
||||
* return formatter.formatHelp();
|
||||
*
|
||||
**/
|
||||
HelpFormatter.prototype.formatHelp = function () {
|
||||
var help = this._rootSection.formatHelp(this);
|
||||
if (help) {
|
||||
help = help.replace(this._longBreakMatcher, c.EOL + c.EOL);
|
||||
help = $$.trimChars(help, c.EOL) + c.EOL;
|
||||
}
|
||||
return help;
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._joinParts = function (partStrings) {
|
||||
return partStrings.filter(function (part) {
|
||||
return (part && part !== c.SUPPRESS);
|
||||
}).join('');
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._formatUsage = function (usage, actions, groups, prefix) {
|
||||
if (!prefix && typeof prefix !== 'string') {
|
||||
prefix = 'usage: ';
|
||||
}
|
||||
|
||||
actions = actions || [];
|
||||
groups = groups || [];
|
||||
|
||||
|
||||
// if usage is specified, use that
|
||||
if (usage) {
|
||||
usage = sprintf(usage, { prog: this._prog });
|
||||
|
||||
// if no optionals or positionals are available, usage is just prog
|
||||
} else if (!usage && actions.length === 0) {
|
||||
usage = this._prog;
|
||||
|
||||
// if optionals and positionals are available, calculate usage
|
||||
} else if (!usage) {
|
||||
var prog = this._prog;
|
||||
var optionals = [];
|
||||
var positionals = [];
|
||||
var actionUsage;
|
||||
var textWidth;
|
||||
|
||||
// split optionals from positionals
|
||||
actions.forEach(function (action) {
|
||||
if (action.isOptional()) {
|
||||
optionals.push(action);
|
||||
} else {
|
||||
positionals.push(action);
|
||||
}
|
||||
});
|
||||
|
||||
// build full usage string
|
||||
actionUsage = this._formatActionsUsage([].concat(optionals, positionals), groups);
|
||||
usage = [ prog, actionUsage ].join(' ');
|
||||
|
||||
// wrap the usage parts if it's too long
|
||||
textWidth = this._width - this._currentIndent;
|
||||
if ((prefix.length + usage.length) > textWidth) {
|
||||
|
||||
// break usage into wrappable parts
|
||||
var regexpPart = new RegExp('\\(.*?\\)+|\\[.*?\\]+|\\S+', 'g');
|
||||
var optionalUsage = this._formatActionsUsage(optionals, groups);
|
||||
var positionalUsage = this._formatActionsUsage(positionals, groups);
|
||||
|
||||
|
||||
var optionalParts = optionalUsage.match(regexpPart);
|
||||
var positionalParts = positionalUsage.match(regexpPart) || [];
|
||||
|
||||
if (optionalParts.join(' ') !== optionalUsage) {
|
||||
throw new Error('assert "optionalParts.join(\' \') === optionalUsage"');
|
||||
}
|
||||
if (positionalParts.join(' ') !== positionalUsage) {
|
||||
throw new Error('assert "positionalParts.join(\' \') === positionalUsage"');
|
||||
}
|
||||
|
||||
// helper for wrapping lines
|
||||
/*eslint-disable func-style*/ // node 0.10 compat
|
||||
var _getLines = function (parts, indent, prefix) {
|
||||
var lines = [];
|
||||
var line = [];
|
||||
|
||||
var lineLength = prefix ? prefix.length - 1 : indent.length - 1;
|
||||
|
||||
parts.forEach(function (part) {
|
||||
if (lineLength + 1 + part.length > textWidth) {
|
||||
lines.push(indent + line.join(' '));
|
||||
line = [];
|
||||
lineLength = indent.length - 1;
|
||||
}
|
||||
line.push(part);
|
||||
lineLength += part.length + 1;
|
||||
});
|
||||
|
||||
if (line) {
|
||||
lines.push(indent + line.join(' '));
|
||||
}
|
||||
if (prefix) {
|
||||
lines[0] = lines[0].substr(indent.length);
|
||||
}
|
||||
return lines;
|
||||
};
|
||||
|
||||
var lines, indent, parts;
|
||||
// if prog is short, follow it with optionals or positionals
|
||||
if (prefix.length + prog.length <= 0.75 * textWidth) {
|
||||
indent = $$.repeat(' ', (prefix.length + prog.length + 1));
|
||||
if (optionalParts) {
|
||||
lines = [].concat(
|
||||
_getLines([ prog ].concat(optionalParts), indent, prefix),
|
||||
_getLines(positionalParts, indent)
|
||||
);
|
||||
} else if (positionalParts) {
|
||||
lines = _getLines([ prog ].concat(positionalParts), indent, prefix);
|
||||
} else {
|
||||
lines = [ prog ];
|
||||
}
|
||||
|
||||
// if prog is long, put it on its own line
|
||||
} else {
|
||||
indent = $$.repeat(' ', prefix.length);
|
||||
parts = optionalParts.concat(positionalParts);
|
||||
lines = _getLines(parts, indent);
|
||||
if (lines.length > 1) {
|
||||
lines = [].concat(
|
||||
_getLines(optionalParts, indent),
|
||||
_getLines(positionalParts, indent)
|
||||
);
|
||||
}
|
||||
lines = [ prog ].concat(lines);
|
||||
}
|
||||
// join lines into usage
|
||||
usage = lines.join(c.EOL);
|
||||
}
|
||||
}
|
||||
|
||||
// prefix with 'usage:'
|
||||
return prefix + usage + c.EOL + c.EOL;
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._formatActionsUsage = function (actions, groups) {
|
||||
// find group indices and identify actions in groups
|
||||
var groupActions = [];
|
||||
var inserts = [];
|
||||
var self = this;
|
||||
|
||||
groups.forEach(function (group) {
|
||||
var end;
|
||||
var i;
|
||||
|
||||
var start = actions.indexOf(group._groupActions[0]);
|
||||
if (start >= 0) {
|
||||
end = start + group._groupActions.length;
|
||||
|
||||
//if (actions.slice(start, end) === group._groupActions) {
|
||||
if ($$.arrayEqual(actions.slice(start, end), group._groupActions)) {
|
||||
group._groupActions.forEach(function (action) {
|
||||
groupActions.push(action);
|
||||
});
|
||||
|
||||
if (!group.required) {
|
||||
if (inserts[start]) {
|
||||
inserts[start] += ' [';
|
||||
} else {
|
||||
inserts[start] = '[';
|
||||
}
|
||||
inserts[end] = ']';
|
||||
} else {
|
||||
if (inserts[start]) {
|
||||
inserts[start] += ' (';
|
||||
} else {
|
||||
inserts[start] = '(';
|
||||
}
|
||||
inserts[end] = ')';
|
||||
}
|
||||
for (i = start + 1; i < end; i += 1) {
|
||||
inserts[i] = '|';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// collect all actions format strings
|
||||
var parts = [];
|
||||
|
||||
actions.forEach(function (action, actionIndex) {
|
||||
var part;
|
||||
var optionString;
|
||||
var argsDefault;
|
||||
var argsString;
|
||||
|
||||
// suppressed arguments are marked with None
|
||||
// remove | separators for suppressed arguments
|
||||
if (action.help === c.SUPPRESS) {
|
||||
parts.push(null);
|
||||
if (inserts[actionIndex] === '|') {
|
||||
inserts.splice(actionIndex, actionIndex);
|
||||
} else if (inserts[actionIndex + 1] === '|') {
|
||||
inserts.splice(actionIndex + 1, actionIndex + 1);
|
||||
}
|
||||
|
||||
// produce all arg strings
|
||||
} else if (!action.isOptional()) {
|
||||
part = self._formatArgs(action, action.dest);
|
||||
|
||||
// if it's in a group, strip the outer []
|
||||
if (groupActions.indexOf(action) >= 0) {
|
||||
if (part[0] === '[' && part[part.length - 1] === ']') {
|
||||
part = part.slice(1, -1);
|
||||
}
|
||||
}
|
||||
// add the action string to the list
|
||||
parts.push(part);
|
||||
|
||||
// produce the first way to invoke the option in brackets
|
||||
} else {
|
||||
optionString = action.optionStrings[0];
|
||||
|
||||
// if the Optional doesn't take a value, format is: -s or --long
|
||||
if (action.nargs === 0) {
|
||||
part = '' + optionString;
|
||||
|
||||
// if the Optional takes a value, format is: -s ARGS or --long ARGS
|
||||
} else {
|
||||
argsDefault = action.dest.toUpperCase();
|
||||
argsString = self._formatArgs(action, argsDefault);
|
||||
part = optionString + ' ' + argsString;
|
||||
}
|
||||
// make it look optional if it's not required or in a group
|
||||
if (!action.required && groupActions.indexOf(action) < 0) {
|
||||
part = '[' + part + ']';
|
||||
}
|
||||
// add the action string to the list
|
||||
parts.push(part);
|
||||
}
|
||||
});
|
||||
|
||||
// insert things at the necessary indices
|
||||
for (var i = inserts.length - 1; i >= 0; --i) {
|
||||
if (inserts[i] !== null) {
|
||||
parts.splice(i, 0, inserts[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// join all the action items with spaces
|
||||
var text = parts.filter(function (part) {
|
||||
return !!part;
|
||||
}).join(' ');
|
||||
|
||||
// clean up separators for mutually exclusive groups
|
||||
text = text.replace(/([\[(]) /g, '$1'); // remove spaces
|
||||
text = text.replace(/ ([\])])/g, '$1');
|
||||
text = text.replace(/\[ *\]/g, ''); // remove empty groups
|
||||
text = text.replace(/\( *\)/g, '');
|
||||
text = text.replace(/\(([^|]*)\)/g, '$1'); // remove () from single action groups
|
||||
|
||||
text = text.trim();
|
||||
|
||||
// return the text
|
||||
return text;
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._formatText = function (text) {
|
||||
text = sprintf(text, { prog: this._prog });
|
||||
var textWidth = this._width - this._currentIndent;
|
||||
var indentIncriment = $$.repeat(' ', this._currentIndent);
|
||||
return this._fillText(text, textWidth, indentIncriment) + c.EOL + c.EOL;
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._formatAction = function (action) {
|
||||
var self = this;
|
||||
|
||||
var helpText;
|
||||
var helpLines;
|
||||
var parts;
|
||||
var indentFirst;
|
||||
|
||||
// determine the required width and the entry label
|
||||
var helpPosition = Math.min(this._actionMaxLength + 2, this._maxHelpPosition);
|
||||
var helpWidth = this._width - helpPosition;
|
||||
var actionWidth = helpPosition - this._currentIndent - 2;
|
||||
var actionHeader = this._formatActionInvocation(action);
|
||||
|
||||
// no help; start on same line and add a final newline
|
||||
if (!action.help) {
|
||||
actionHeader = $$.repeat(' ', this._currentIndent) + actionHeader + c.EOL;
|
||||
|
||||
// short action name; start on the same line and pad two spaces
|
||||
} else if (actionHeader.length <= actionWidth) {
|
||||
actionHeader = $$.repeat(' ', this._currentIndent) +
|
||||
actionHeader +
|
||||
' ' +
|
||||
$$.repeat(' ', actionWidth - actionHeader.length);
|
||||
indentFirst = 0;
|
||||
|
||||
// long action name; start on the next line
|
||||
} else {
|
||||
actionHeader = $$.repeat(' ', this._currentIndent) + actionHeader + c.EOL;
|
||||
indentFirst = helpPosition;
|
||||
}
|
||||
|
||||
// collect the pieces of the action help
|
||||
parts = [ actionHeader ];
|
||||
|
||||
// if there was help for the action, add lines of help text
|
||||
if (action.help) {
|
||||
helpText = this._expandHelp(action);
|
||||
helpLines = this._splitLines(helpText, helpWidth);
|
||||
parts.push($$.repeat(' ', indentFirst) + helpLines[0] + c.EOL);
|
||||
helpLines.slice(1).forEach(function (line) {
|
||||
parts.push($$.repeat(' ', helpPosition) + line + c.EOL);
|
||||
});
|
||||
|
||||
// or add a newline if the description doesn't end with one
|
||||
} else if (actionHeader.charAt(actionHeader.length - 1) !== c.EOL) {
|
||||
parts.push(c.EOL);
|
||||
}
|
||||
// if there are any sub-actions, add their help as well
|
||||
if (action._getSubactions) {
|
||||
this._indent();
|
||||
action._getSubactions().forEach(function (subaction) {
|
||||
parts.push(self._formatAction(subaction));
|
||||
});
|
||||
this._dedent();
|
||||
}
|
||||
// return a single string
|
||||
return this._joinParts(parts);
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._formatActionInvocation = function (action) {
|
||||
if (!action.isOptional()) {
|
||||
var format_func = this._metavarFormatter(action, action.dest);
|
||||
var metavars = format_func(1);
|
||||
return metavars[0];
|
||||
}
|
||||
|
||||
var parts = [];
|
||||
var argsDefault;
|
||||
var argsString;
|
||||
|
||||
// if the Optional doesn't take a value, format is: -s, --long
|
||||
if (action.nargs === 0) {
|
||||
parts = parts.concat(action.optionStrings);
|
||||
|
||||
// if the Optional takes a value, format is: -s ARGS, --long ARGS
|
||||
} else {
|
||||
argsDefault = action.dest.toUpperCase();
|
||||
argsString = this._formatArgs(action, argsDefault);
|
||||
action.optionStrings.forEach(function (optionString) {
|
||||
parts.push(optionString + ' ' + argsString);
|
||||
});
|
||||
}
|
||||
return parts.join(', ');
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._metavarFormatter = function (action, metavarDefault) {
|
||||
var result;
|
||||
|
||||
if (action.metavar || action.metavar === '') {
|
||||
result = action.metavar;
|
||||
} else if (action.choices) {
|
||||
var choices = action.choices;
|
||||
|
||||
if (typeof choices === 'string') {
|
||||
choices = choices.split('').join(', ');
|
||||
} else if (Array.isArray(choices)) {
|
||||
choices = choices.join(',');
|
||||
} else {
|
||||
choices = Object.keys(choices).join(',');
|
||||
}
|
||||
result = '{' + choices + '}';
|
||||
} else {
|
||||
result = metavarDefault;
|
||||
}
|
||||
|
||||
return function (size) {
|
||||
if (Array.isArray(result)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
var metavars = [];
|
||||
for (var i = 0; i < size; i += 1) {
|
||||
metavars.push(result);
|
||||
}
|
||||
return metavars;
|
||||
};
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._formatArgs = function (action, metavarDefault) {
|
||||
var result;
|
||||
var metavars;
|
||||
|
||||
var buildMetavar = this._metavarFormatter(action, metavarDefault);
|
||||
|
||||
switch (action.nargs) {
|
||||
/*eslint-disable no-undefined*/
|
||||
case undefined:
|
||||
case null:
|
||||
metavars = buildMetavar(1);
|
||||
result = '' + metavars[0];
|
||||
break;
|
||||
case c.OPTIONAL:
|
||||
metavars = buildMetavar(1);
|
||||
result = '[' + metavars[0] + ']';
|
||||
break;
|
||||
case c.ZERO_OR_MORE:
|
||||
metavars = buildMetavar(2);
|
||||
result = '[' + metavars[0] + ' [' + metavars[1] + ' ...]]';
|
||||
break;
|
||||
case c.ONE_OR_MORE:
|
||||
metavars = buildMetavar(2);
|
||||
result = '' + metavars[0] + ' [' + metavars[1] + ' ...]';
|
||||
break;
|
||||
case c.REMAINDER:
|
||||
result = '...';
|
||||
break;
|
||||
case c.PARSER:
|
||||
metavars = buildMetavar(1);
|
||||
result = metavars[0] + ' ...';
|
||||
break;
|
||||
default:
|
||||
metavars = buildMetavar(action.nargs);
|
||||
result = metavars.join(' ');
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._expandHelp = function (action) {
|
||||
var params = { prog: this._prog };
|
||||
|
||||
Object.keys(action).forEach(function (actionProperty) {
|
||||
var actionValue = action[actionProperty];
|
||||
|
||||
if (actionValue !== c.SUPPRESS) {
|
||||
params[actionProperty] = actionValue;
|
||||
}
|
||||
});
|
||||
|
||||
if (params.choices) {
|
||||
if (typeof params.choices === 'string') {
|
||||
params.choices = params.choices.split('').join(', ');
|
||||
} else if (Array.isArray(params.choices)) {
|
||||
params.choices = params.choices.join(', ');
|
||||
} else {
|
||||
params.choices = Object.keys(params.choices).join(', ');
|
||||
}
|
||||
}
|
||||
|
||||
return sprintf(this._getHelpString(action), params);
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._splitLines = function (text, width) {
|
||||
var lines = [];
|
||||
var delimiters = [ ' ', '.', ',', '!', '?' ];
|
||||
var re = new RegExp('[' + delimiters.join('') + '][^' + delimiters.join('') + ']*$');
|
||||
|
||||
text = text.replace(/[\n\|\t]/g, ' ');
|
||||
|
||||
text = text.trim();
|
||||
text = text.replace(this._whitespaceMatcher, ' ');
|
||||
|
||||
// Wraps the single paragraph in text (a string) so every line
|
||||
// is at most width characters long.
|
||||
text.split(c.EOL).forEach(function (line) {
|
||||
if (width >= line.length) {
|
||||
lines.push(line);
|
||||
return;
|
||||
}
|
||||
|
||||
var wrapStart = 0;
|
||||
var wrapEnd = width;
|
||||
var delimiterIndex = 0;
|
||||
while (wrapEnd <= line.length) {
|
||||
if (wrapEnd !== line.length && delimiters.indexOf(line[wrapEnd] < -1)) {
|
||||
delimiterIndex = (re.exec(line.substring(wrapStart, wrapEnd)) || {}).index;
|
||||
wrapEnd = wrapStart + delimiterIndex + 1;
|
||||
}
|
||||
lines.push(line.substring(wrapStart, wrapEnd));
|
||||
wrapStart = wrapEnd;
|
||||
wrapEnd += width;
|
||||
}
|
||||
if (wrapStart < line.length) {
|
||||
lines.push(line.substring(wrapStart, wrapEnd));
|
||||
}
|
||||
});
|
||||
|
||||
return lines;
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._fillText = function (text, width, indent) {
|
||||
var lines = this._splitLines(text, width);
|
||||
lines = lines.map(function (line) {
|
||||
return indent + line;
|
||||
});
|
||||
return lines.join(c.EOL);
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._getHelpString = function (action) {
|
||||
return action.help;
|
||||
};
|
||||
76
node_modules/argparse/lib/namespace.js
generated
vendored
Normal file
76
node_modules/argparse/lib/namespace.js
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* class Namespace
|
||||
*
|
||||
* Simple object for storing attributes. Implements equality by attribute names
|
||||
* and values, and provides a simple string representation.
|
||||
*
|
||||
* See also [original guide][1]
|
||||
*
|
||||
* [1]:http://docs.python.org/dev/library/argparse.html#the-namespace-object
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var $$ = require('./utils');
|
||||
|
||||
/**
|
||||
* new Namespace(options)
|
||||
* - options(object): predefined propertis for result object
|
||||
*
|
||||
**/
|
||||
var Namespace = module.exports = function Namespace(options) {
|
||||
$$.extend(this, options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Namespace#isset(key) -> Boolean
|
||||
* - key (string|number): property name
|
||||
*
|
||||
* Tells whenever `namespace` contains given `key` or not.
|
||||
**/
|
||||
Namespace.prototype.isset = function (key) {
|
||||
return $$.has(this, key);
|
||||
};
|
||||
|
||||
/**
|
||||
* Namespace#set(key, value) -> self
|
||||
* -key (string|number|object): propery name
|
||||
* -value (mixed): new property value
|
||||
*
|
||||
* Set the property named key with value.
|
||||
* If key object then set all key properties to namespace object
|
||||
**/
|
||||
Namespace.prototype.set = function (key, value) {
|
||||
if (typeof (key) === 'object') {
|
||||
$$.extend(this, key);
|
||||
} else {
|
||||
this[key] = value;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Namespace#get(key, defaultValue) -> mixed
|
||||
* - key (string|number): property name
|
||||
* - defaultValue (mixed): default value
|
||||
*
|
||||
* Return the property key or defaulValue if not set
|
||||
**/
|
||||
Namespace.prototype.get = function (key, defaultValue) {
|
||||
return !this[key] ? defaultValue : this[key];
|
||||
};
|
||||
|
||||
/**
|
||||
* Namespace#unset(key, defaultValue) -> mixed
|
||||
* - key (string|number): property name
|
||||
* - defaultValue (mixed): default value
|
||||
*
|
||||
* Return data[key](and delete it) or defaultValue
|
||||
**/
|
||||
Namespace.prototype.unset = function (key, defaultValue) {
|
||||
var value = this[key];
|
||||
if (value !== null) {
|
||||
delete this[key];
|
||||
return value;
|
||||
}
|
||||
return defaultValue;
|
||||
};
|
||||
57
node_modules/argparse/lib/utils.js
generated
vendored
Normal file
57
node_modules/argparse/lib/utils.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
'use strict';
|
||||
|
||||
exports.repeat = function (str, num) {
|
||||
var result = '';
|
||||
for (var i = 0; i < num; i++) { result += str; }
|
||||
return result;
|
||||
};
|
||||
|
||||
exports.arrayEqual = function (a, b) {
|
||||
if (a.length !== b.length) { return false; }
|
||||
for (var i = 0; i < a.length; i++) {
|
||||
if (a[i] !== b[i]) { return false; }
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
exports.trimChars = function (str, chars) {
|
||||
var start = 0;
|
||||
var end = str.length - 1;
|
||||
while (chars.indexOf(str.charAt(start)) >= 0) { start++; }
|
||||
while (chars.indexOf(str.charAt(end)) >= 0) { end--; }
|
||||
return str.slice(start, end + 1);
|
||||
};
|
||||
|
||||
exports.capitalize = function (str) {
|
||||
return str.charAt(0).toUpperCase() + str.slice(1);
|
||||
};
|
||||
|
||||
exports.arrayUnion = function () {
|
||||
var result = [];
|
||||
for (var i = 0, values = {}; i < arguments.length; i++) {
|
||||
var arr = arguments[i];
|
||||
for (var j = 0; j < arr.length; j++) {
|
||||
if (!values[arr[j]]) {
|
||||
values[arr[j]] = true;
|
||||
result.push(arr[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
function has(obj, key) {
|
||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
||||
}
|
||||
|
||||
exports.has = has;
|
||||
|
||||
exports.extend = function (dest, src) {
|
||||
for (var i in src) {
|
||||
if (has(src, i)) { dest[i] = src[i]; }
|
||||
}
|
||||
};
|
||||
|
||||
exports.trimEnd = function (str) {
|
||||
return str.replace(/\s+$/g, '');
|
||||
};
|
||||
34
node_modules/argparse/package.json
generated
vendored
Normal file
34
node_modules/argparse/package.json
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "argparse",
|
||||
"description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library",
|
||||
"version": "1.0.10",
|
||||
"keywords": [
|
||||
"cli",
|
||||
"parser",
|
||||
"argparse",
|
||||
"option",
|
||||
"args"
|
||||
],
|
||||
"contributors": [
|
||||
"Eugene Shkuropat",
|
||||
"Paul Jacobson"
|
||||
],
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib/"
|
||||
],
|
||||
"license": "MIT",
|
||||
"repository": "nodeca/argparse",
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
},
|
||||
"dependencies": {
|
||||
"sprintf-js": "~1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^2.13.1",
|
||||
"istanbul": "^0.4.5",
|
||||
"mocha": "^3.1.0",
|
||||
"ndoc": "^5.0.1"
|
||||
}
|
||||
}
|
||||
1
node_modules/array-back/.coveralls.yml
generated
vendored
Normal file
1
node_modules/array-back/.coveralls.yml
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
repo_token: S6p2PWnbIwJPOfO3XRVsAM5z4tNMh9hgr
|
||||
2
node_modules/array-back/.npmignore
generated
vendored
Normal file
2
node_modules/array-back/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
tmp
|
||||
out
|
||||
7
node_modules/array-back/.travis.yml
generated
vendored
Normal file
7
node_modules/array-back/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 8
|
||||
- 7
|
||||
- 6
|
||||
- 5
|
||||
- 4
|
||||
21
node_modules/array-back/LICENSE
generated
vendored
Normal file
21
node_modules/array-back/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-17 Lloyd Brookes <75pound@gmail.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.
|
||||
12
node_modules/array-back/README.hbs
generated
vendored
Normal file
12
node_modules/array-back/README.hbs
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
[](https://www.npmjs.org/package/array-back)
|
||||
[](https://www.npmjs.org/package/array-back)
|
||||
[](https://travis-ci.org/75lb/array-back)
|
||||
[](https://coveralls.io/github/75lb/array-back?branch=master)
|
||||
[](https://david-dm.org/75lb/array-back)
|
||||
[](https://github.com/feross/standard)
|
||||
|
||||
{{>main}}
|
||||
|
||||
* * *
|
||||
|
||||
© 2015-17 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).
|
||||
52
node_modules/array-back/README.md
generated
vendored
Normal file
52
node_modules/array-back/README.md
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
[](https://www.npmjs.org/package/array-back)
|
||||
[](https://www.npmjs.org/package/array-back)
|
||||
[](https://travis-ci.org/75lb/array-back)
|
||||
[](https://coveralls.io/github/75lb/array-back?branch=master)
|
||||
[](https://david-dm.org/75lb/array-back)
|
||||
[](https://github.com/feross/standard)
|
||||
|
||||
<a name="module_array-back"></a>
|
||||
|
||||
## array-back
|
||||
**Example**
|
||||
```js
|
||||
const arrayify = require('array-back')
|
||||
```
|
||||
<a name="exp_module_array-back--arrayify"></a>
|
||||
|
||||
### arrayify(input) ⇒ <code>Array</code> ⏏
|
||||
Takes any input and guarantees an array back.
|
||||
|
||||
- converts array-like objects (e.g. `arguments`) to a real array
|
||||
- converts `undefined` to an empty array
|
||||
- converts any another other, singular value (including `null`) into an array containing that value
|
||||
- ignores input which is already an array
|
||||
|
||||
**Kind**: Exported function
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| input | <code>\*</code> | the input value to convert to an array |
|
||||
|
||||
**Example**
|
||||
```js
|
||||
> a.arrayify(undefined)
|
||||
[]
|
||||
|
||||
> a.arrayify(null)
|
||||
[ null ]
|
||||
|
||||
> a.arrayify(0)
|
||||
[ 0 ]
|
||||
|
||||
> a.arrayify([ 1, 2 ])
|
||||
[ 1, 2 ]
|
||||
|
||||
> function f(){ return a.arrayify(arguments); }
|
||||
> f(1,2,3)
|
||||
[ 1, 2, 3 ]
|
||||
```
|
||||
|
||||
* * *
|
||||
|
||||
© 2015-17 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).
|
||||
1
node_modules/array-back/coverage/coverage.json
generated
vendored
Normal file
1
node_modules/array-back/coverage/coverage.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"/Users/lloydb/Documents/75lb/array-back/test.js":{"path":"/Users/lloydb/Documents/75lb/array-back/test.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1},"b":{},"f":{"1":1,"2":1,"3":1},"fnMap":{"1":{"name":"(anonymous_1)","line":8,"loc":{"start":{"line":8,"column":44},"end":{"line":8,"column":56}}},"2":{"name":"(anonymous_2)","line":14,"loc":{"start":{"line":14,"column":26},"end":{"line":14,"column":38}}},"3":{"name":"func","line":20,"loc":{"start":{"line":20,"column":2},"end":{"line":20,"column":19}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":41}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":30}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":27}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":31}},"5":{"start":{"line":8,"column":0},"end":{"line":12,"column":2}},"6":{"start":{"line":9,"column":2},"end":{"line":9,"column":23}},"7":{"start":{"line":10,"column":2},"end":{"line":10,"column":30}},"8":{"start":{"line":11,"column":2},"end":{"line":11,"column":28}},"9":{"start":{"line":14,"column":0},"end":{"line":24,"column":2}},"10":{"start":{"line":15,"column":2},"end":{"line":15,"column":44}},"11":{"start":{"line":16,"column":2},"end":{"line":16,"column":45}},"12":{"start":{"line":17,"column":2},"end":{"line":17,"column":39}},"13":{"start":{"line":18,"column":2},"end":{"line":18,"column":49}},"14":{"start":{"line":20,"column":2},"end":{"line":22,"column":3}},"15":{"start":{"line":21,"column":4},"end":{"line":21,"column":55}},"16":{"start":{"line":23,"column":2},"end":{"line":23,"column":15}}},"branchMap":{}},"/Users/lloydb/Documents/75lb/array-back/index.js":{"path":"/Users/lloydb/Documents/75lb/array-back/index.js","s":{"1":1,"2":1,"3":6,"4":6,"5":2,"6":4,"7":1,"8":3,"9":1,"10":2},"b":{"1":[2,4],"2":[1,3],"3":[1,2]},"f":{"1":6},"fnMap":{"1":{"name":"arrayify","line":36,"loc":{"start":{"line":36,"column":0},"end":{"line":36,"column":26}}}},"statementMap":{"1":{"start":{"line":6,"column":0},"end":{"line":6,"column":25}},"2":{"start":{"line":36,"column":0},"end":{"line":49,"column":1}},"3":{"start":{"line":37,"column":2},"end":{"line":37,"column":30}},"4":{"start":{"line":38,"column":2},"end":{"line":48,"column":3}},"5":{"start":{"line":39,"column":4},"end":{"line":39,"column":16}},"6":{"start":{"line":41,"column":4},"end":{"line":47,"column":5}},"7":{"start":{"line":42,"column":6},"end":{"line":42,"column":15}},"8":{"start":{"line":43,"column":11},"end":{"line":47,"column":5}},"9":{"start":{"line":44,"column":6},"end":{"line":44,"column":46}},"10":{"start":{"line":46,"column":6},"end":{"line":46,"column":22}}},"branchMap":{"1":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":2},"end":{"line":38,"column":2}},{"start":{"line":38,"column":2},"end":{"line":38,"column":2}}]},"2":{"line":41,"type":"if","locations":[{"start":{"line":41,"column":4},"end":{"line":41,"column":4}},{"start":{"line":41,"column":4},"end":{"line":41,"column":4}}]},"3":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":11},"end":{"line":43,"column":11}},{"start":{"line":43,"column":11},"end":{"line":43,"column":11}}]}}}}
|
||||
106
node_modules/array-back/coverage/lcov-report/array-back/index.html
generated
vendored
Normal file
106
node_modules/array-back/coverage/lcov-report/array-back/index.html
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for array-back/</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../prettify.css" />
|
||||
<link rel="stylesheet" href="../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../index.html">all files</a> array-back/
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>26/26</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>6/6</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>4/4</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>26/26</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<div class="pad1">
|
||||
<table class="coverage-summary">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
||||
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
||||
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
||||
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
||||
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
||||
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
||||
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr>
|
||||
<td class="file high" data-value="index.js"><a href="index.js.html">index.js</a></td>
|
||||
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="10" class="abs high">10/10</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="6" class="abs high">6/6</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="1" class="abs high">1/1</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="10" class="abs high">10/10</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="test.js"><a href="test.js.html">test.js</a></td>
|
||||
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="16" class="abs high">16/16</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">0/0</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="3" class="abs high">3/3</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="16" class="abs high">16/16</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Jun 24 2017 21:40:08 GMT+0100 (BST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../sorter.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
212
node_modules/array-back/coverage/lcov-report/array-back/index.js.html
generated
vendored
Normal file
212
node_modules/array-back/coverage/lcov-report/array-back/index.js.html
generated
vendored
Normal file
@@ -0,0 +1,212 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for array-back/index.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../prettify.css" />
|
||||
<link rel="stylesheet" href="../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../index.html">all files</a> / <a href="index.html">array-back/</a> index.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>10/10</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>6/6</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>1/1</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>10/10</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet">1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
21
|
||||
22
|
||||
23
|
||||
24
|
||||
25
|
||||
26
|
||||
27
|
||||
28
|
||||
29
|
||||
30
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37
|
||||
38
|
||||
39
|
||||
40
|
||||
41
|
||||
42
|
||||
43
|
||||
44
|
||||
45
|
||||
46
|
||||
47
|
||||
48
|
||||
49
|
||||
50</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-yes">6×</span>
|
||||
<span class="cline-any cline-yes">6×</span>
|
||||
<span class="cline-any cline-yes">2×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4×</span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-yes">3×</span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">/**
|
||||
* @module array-back
|
||||
* @example
|
||||
* const arrayify = require('array-back')
|
||||
*/
|
||||
module.exports = arrayify
|
||||
|
||||
/**
|
||||
* Takes any input and guarantees an array back.
|
||||
*
|
||||
* - converts array-like objects (e.g. `arguments`) to a real array
|
||||
* - converts `undefined` to an empty array
|
||||
* - converts any another other, singular value (including `null`) into an array containing that value
|
||||
* - ignores input which is already an array
|
||||
*
|
||||
* @param {*} - the input value to convert to an array
|
||||
* @returns {Array}
|
||||
* @alias module:array-back
|
||||
* @example
|
||||
* > a.arrayify(undefined)
|
||||
* []
|
||||
*
|
||||
* > a.arrayify(null)
|
||||
* [ null ]
|
||||
*
|
||||
* > a.arrayify(0)
|
||||
* [ 0 ]
|
||||
*
|
||||
* > a.arrayify([ 1, 2 ])
|
||||
* [ 1, 2 ]
|
||||
*
|
||||
* > function f(){ return a.arrayify(arguments); }
|
||||
* > f(1,2,3)
|
||||
* [ 1, 2, 3 ]
|
||||
*/
|
||||
function arrayify (input) {
|
||||
const t = require('typical')
|
||||
if (Array.isArray(input)) {
|
||||
return input
|
||||
} else {
|
||||
if (input === undefined) {
|
||||
return []
|
||||
} else if (t.isArrayLike(input)) {
|
||||
return Array.prototype.slice.call(input)
|
||||
} else {
|
||||
return [ input ]
|
||||
}
|
||||
}
|
||||
}
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Jun 24 2017 21:40:08 GMT+0100 (BST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../sorter.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
137
node_modules/array-back/coverage/lcov-report/array-back/test.js.html
generated
vendored
Normal file
137
node_modules/array-back/coverage/lcov-report/array-back/test.js.html
generated
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for array-back/test.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../prettify.css" />
|
||||
<link rel="stylesheet" href="../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../index.html">all files</a> / <a href="index.html">array-back/</a> test.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>16/16</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>0/0</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>3/3</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>16/16</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet">1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
21
|
||||
22
|
||||
23
|
||||
24
|
||||
25</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1×</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">'use strict'
|
||||
const TestRunner = require('test-runner')
|
||||
const arrayify = require('./')
|
||||
const a = require('assert')
|
||||
|
||||
const runner = new TestRunner()
|
||||
|
||||
runner.test('if already array, do nothing', function () {
|
||||
const arr = [ 1,2,3 ]
|
||||
const result = arrayify(arr)
|
||||
a.strictEqual(arr, result)
|
||||
})
|
||||
|
||||
runner.test('arrayify()', function () {
|
||||
a.deepStrictEqual(arrayify(undefined), [])
|
||||
a.deepStrictEqual(arrayify(null), [ null ])
|
||||
a.deepStrictEqual(arrayify(0), [ 0 ])
|
||||
a.deepStrictEqual(arrayify([ 1, 2 ]), [ 1, 2 ])
|
||||
|
||||
function func () {
|
||||
a.deepStrictEqual(arrayify(arguments), [ 1, 2, 3 ])
|
||||
}
|
||||
func(1, 2, 3)
|
||||
})
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Jun 24 2017 21:40:08 GMT+0100 (BST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../sorter.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
213
node_modules/array-back/coverage/lcov-report/base.css
generated
vendored
Normal file
213
node_modules/array-back/coverage/lcov-report/base.css
generated
vendored
Normal file
@@ -0,0 +1,213 @@
|
||||
body, html {
|
||||
margin:0; padding: 0;
|
||||
height: 100%;
|
||||
}
|
||||
body {
|
||||
font-family: Helvetica Neue, Helvetica, Arial;
|
||||
font-size: 14px;
|
||||
color:#333;
|
||||
}
|
||||
.small { font-size: 12px; }
|
||||
*, *:after, *:before {
|
||||
-webkit-box-sizing:border-box;
|
||||
-moz-box-sizing:border-box;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
h1 { font-size: 20px; margin: 0;}
|
||||
h2 { font-size: 14px; }
|
||||
pre {
|
||||
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
-moz-tab-size: 2;
|
||||
-o-tab-size: 2;
|
||||
tab-size: 2;
|
||||
}
|
||||
a { color:#0074D9; text-decoration:none; }
|
||||
a:hover { text-decoration:underline; }
|
||||
.strong { font-weight: bold; }
|
||||
.space-top1 { padding: 10px 0 0 0; }
|
||||
.pad2y { padding: 20px 0; }
|
||||
.pad1y { padding: 10px 0; }
|
||||
.pad2x { padding: 0 20px; }
|
||||
.pad2 { padding: 20px; }
|
||||
.pad1 { padding: 10px; }
|
||||
.space-left2 { padding-left:55px; }
|
||||
.space-right2 { padding-right:20px; }
|
||||
.center { text-align:center; }
|
||||
.clearfix { display:block; }
|
||||
.clearfix:after {
|
||||
content:'';
|
||||
display:block;
|
||||
height:0;
|
||||
clear:both;
|
||||
visibility:hidden;
|
||||
}
|
||||
.fl { float: left; }
|
||||
@media only screen and (max-width:640px) {
|
||||
.col3 { width:100%; max-width:100%; }
|
||||
.hide-mobile { display:none!important; }
|
||||
}
|
||||
|
||||
.quiet {
|
||||
color: #7f7f7f;
|
||||
color: rgba(0,0,0,0.5);
|
||||
}
|
||||
.quiet a { opacity: 0.7; }
|
||||
|
||||
.fraction {
|
||||
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
||||
font-size: 10px;
|
||||
color: #555;
|
||||
background: #E8E8E8;
|
||||
padding: 4px 5px;
|
||||
border-radius: 3px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.path a:link, div.path a:visited { color: #333; }
|
||||
table.coverage {
|
||||
border-collapse: collapse;
|
||||
margin: 10px 0 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
table.coverage td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
table.coverage td.line-count {
|
||||
text-align: right;
|
||||
padding: 0 5px 0 20px;
|
||||
}
|
||||
table.coverage td.line-coverage {
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
min-width:20px;
|
||||
}
|
||||
|
||||
table.coverage td span.cline-any {
|
||||
display: inline-block;
|
||||
padding: 0 5px;
|
||||
width: 100%;
|
||||
}
|
||||
.missing-if-branch {
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
border-radius: 3px;
|
||||
position: relative;
|
||||
padding: 0 4px;
|
||||
background: #333;
|
||||
color: yellow;
|
||||
}
|
||||
|
||||
.skip-if-branch {
|
||||
display: none;
|
||||
margin-right: 10px;
|
||||
position: relative;
|
||||
padding: 0 4px;
|
||||
background: #ccc;
|
||||
color: white;
|
||||
}
|
||||
.missing-if-branch .typ, .skip-if-branch .typ {
|
||||
color: inherit !important;
|
||||
}
|
||||
.coverage-summary {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
.coverage-summary tr { border-bottom: 1px solid #bbb; }
|
||||
.keyline-all { border: 1px solid #ddd; }
|
||||
.coverage-summary td, .coverage-summary th { padding: 10px; }
|
||||
.coverage-summary tbody { border: 1px solid #bbb; }
|
||||
.coverage-summary td { border-right: 1px solid #bbb; }
|
||||
.coverage-summary td:last-child { border-right: none; }
|
||||
.coverage-summary th {
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.coverage-summary th.file { border-right: none !important; }
|
||||
.coverage-summary th.pct { }
|
||||
.coverage-summary th.pic,
|
||||
.coverage-summary th.abs,
|
||||
.coverage-summary td.pct,
|
||||
.coverage-summary td.abs { text-align: right; }
|
||||
.coverage-summary td.file { white-space: nowrap; }
|
||||
.coverage-summary td.pic { min-width: 120px !important; }
|
||||
.coverage-summary tfoot td { }
|
||||
|
||||
.coverage-summary .sorter {
|
||||
height: 10px;
|
||||
width: 7px;
|
||||
display: inline-block;
|
||||
margin-left: 0.5em;
|
||||
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
|
||||
}
|
||||
.coverage-summary .sorted .sorter {
|
||||
background-position: 0 -20px;
|
||||
}
|
||||
.coverage-summary .sorted-desc .sorter {
|
||||
background-position: 0 -10px;
|
||||
}
|
||||
.status-line { height: 10px; }
|
||||
/* dark red */
|
||||
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
|
||||
.low .chart { border:1px solid #C21F39 }
|
||||
/* medium red */
|
||||
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
|
||||
/* light red */
|
||||
.low, .cline-no { background:#FCE1E5 }
|
||||
/* light green */
|
||||
.high, .cline-yes { background:rgb(230,245,208) }
|
||||
/* medium green */
|
||||
.cstat-yes { background:rgb(161,215,106) }
|
||||
/* dark green */
|
||||
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
|
||||
.high .chart { border:1px solid rgb(77,146,33) }
|
||||
/* dark yellow (gold) */
|
||||
.medium .chart { border:1px solid #f9cd0b; }
|
||||
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
|
||||
/* light yellow */
|
||||
.medium { background: #fff4c2; }
|
||||
/* light gray */
|
||||
span.cline-neutral { background: #eaeaea; }
|
||||
|
||||
.cbranch-no { background: yellow !important; color: #111; }
|
||||
|
||||
.cstat-skip { background: #ddd; color: #111; }
|
||||
.fstat-skip { background: #ddd; color: #111 !important; }
|
||||
.cbranch-skip { background: #ddd !important; color: #111; }
|
||||
|
||||
|
||||
.cover-fill, .cover-empty {
|
||||
display:inline-block;
|
||||
height: 12px;
|
||||
}
|
||||
.chart {
|
||||
line-height: 0;
|
||||
}
|
||||
.cover-empty {
|
||||
background: white;
|
||||
}
|
||||
.cover-full {
|
||||
border-right: none !important;
|
||||
}
|
||||
pre.prettyprint {
|
||||
border: none !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
.com { color: #999 !important; }
|
||||
.ignore-none { color: #999; font-weight: normal; }
|
||||
|
||||
.wrapper {
|
||||
min-height: 100%;
|
||||
height: auto !important;
|
||||
height: 100%;
|
||||
margin: 0 auto -48px;
|
||||
}
|
||||
.footer, .push {
|
||||
height: 48px;
|
||||
}
|
||||
93
node_modules/array-back/coverage/lcov-report/index.html
generated
vendored
Normal file
93
node_modules/array-back/coverage/lcov-report/index.html
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for All files</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="prettify.css" />
|
||||
<link rel="stylesheet" href="base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
/
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>26/26</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>6/6</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>4/4</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>26/26</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<div class="pad1">
|
||||
<table class="coverage-summary">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
||||
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
||||
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
||||
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
||||
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
||||
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
||||
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr>
|
||||
<td class="file high" data-value="array-back/"><a href="array-back/index.html">array-back/</a></td>
|
||||
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="26" class="abs high">26/26</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="6" class="abs high">6/6</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="4" class="abs high">4/4</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="26" class="abs high">26/26</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Jun 24 2017 21:40:08 GMT+0100 (BST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="sorter.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
1
node_modules/array-back/coverage/lcov-report/prettify.css
generated
vendored
Normal file
1
node_modules/array-back/coverage/lcov-report/prettify.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
|
||||
1
node_modules/array-back/coverage/lcov-report/prettify.js
generated
vendored
Normal file
1
node_modules/array-back/coverage/lcov-report/prettify.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
node_modules/array-back/coverage/lcov-report/sort-arrow-sprite.png
generated
vendored
Normal file
BIN
node_modules/array-back/coverage/lcov-report/sort-arrow-sprite.png
generated
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 209 B |
158
node_modules/array-back/coverage/lcov-report/sorter.js
generated
vendored
Normal file
158
node_modules/array-back/coverage/lcov-report/sorter.js
generated
vendored
Normal file
@@ -0,0 +1,158 @@
|
||||
var addSorting = (function () {
|
||||
"use strict";
|
||||
var cols,
|
||||
currentSort = {
|
||||
index: 0,
|
||||
desc: false
|
||||
};
|
||||
|
||||
// returns the summary table element
|
||||
function getTable() { return document.querySelector('.coverage-summary'); }
|
||||
// returns the thead element of the summary table
|
||||
function getTableHeader() { return getTable().querySelector('thead tr'); }
|
||||
// returns the tbody element of the summary table
|
||||
function getTableBody() { return getTable().querySelector('tbody'); }
|
||||
// returns the th element for nth column
|
||||
function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
|
||||
|
||||
// loads all columns
|
||||
function loadColumns() {
|
||||
var colNodes = getTableHeader().querySelectorAll('th'),
|
||||
colNode,
|
||||
cols = [],
|
||||
col,
|
||||
i;
|
||||
|
||||
for (i = 0; i < colNodes.length; i += 1) {
|
||||
colNode = colNodes[i];
|
||||
col = {
|
||||
key: colNode.getAttribute('data-col'),
|
||||
sortable: !colNode.getAttribute('data-nosort'),
|
||||
type: colNode.getAttribute('data-type') || 'string'
|
||||
};
|
||||
cols.push(col);
|
||||
if (col.sortable) {
|
||||
col.defaultDescSort = col.type === 'number';
|
||||
colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
|
||||
}
|
||||
}
|
||||
return cols;
|
||||
}
|
||||
// attaches a data attribute to every tr element with an object
|
||||
// of data values keyed by column name
|
||||
function loadRowData(tableRow) {
|
||||
var tableCols = tableRow.querySelectorAll('td'),
|
||||
colNode,
|
||||
col,
|
||||
data = {},
|
||||
i,
|
||||
val;
|
||||
for (i = 0; i < tableCols.length; i += 1) {
|
||||
colNode = tableCols[i];
|
||||
col = cols[i];
|
||||
val = colNode.getAttribute('data-value');
|
||||
if (col.type === 'number') {
|
||||
val = Number(val);
|
||||
}
|
||||
data[col.key] = val;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
// loads all row data
|
||||
function loadData() {
|
||||
var rows = getTableBody().querySelectorAll('tr'),
|
||||
i;
|
||||
|
||||
for (i = 0; i < rows.length; i += 1) {
|
||||
rows[i].data = loadRowData(rows[i]);
|
||||
}
|
||||
}
|
||||
// sorts the table using the data for the ith column
|
||||
function sortByIndex(index, desc) {
|
||||
var key = cols[index].key,
|
||||
sorter = function (a, b) {
|
||||
a = a.data[key];
|
||||
b = b.data[key];
|
||||
return a < b ? -1 : a > b ? 1 : 0;
|
||||
},
|
||||
finalSorter = sorter,
|
||||
tableBody = document.querySelector('.coverage-summary tbody'),
|
||||
rowNodes = tableBody.querySelectorAll('tr'),
|
||||
rows = [],
|
||||
i;
|
||||
|
||||
if (desc) {
|
||||
finalSorter = function (a, b) {
|
||||
return -1 * sorter(a, b);
|
||||
};
|
||||
}
|
||||
|
||||
for (i = 0; i < rowNodes.length; i += 1) {
|
||||
rows.push(rowNodes[i]);
|
||||
tableBody.removeChild(rowNodes[i]);
|
||||
}
|
||||
|
||||
rows.sort(finalSorter);
|
||||
|
||||
for (i = 0; i < rows.length; i += 1) {
|
||||
tableBody.appendChild(rows[i]);
|
||||
}
|
||||
}
|
||||
// removes sort indicators for current column being sorted
|
||||
function removeSortIndicators() {
|
||||
var col = getNthColumn(currentSort.index),
|
||||
cls = col.className;
|
||||
|
||||
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
|
||||
col.className = cls;
|
||||
}
|
||||
// adds sort indicators for current column being sorted
|
||||
function addSortIndicators() {
|
||||
getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
|
||||
}
|
||||
// adds event listeners for all sorter widgets
|
||||
function enableUI() {
|
||||
var i,
|
||||
el,
|
||||
ithSorter = function ithSorter(i) {
|
||||
var col = cols[i];
|
||||
|
||||
return function () {
|
||||
var desc = col.defaultDescSort;
|
||||
|
||||
if (currentSort.index === i) {
|
||||
desc = !currentSort.desc;
|
||||
}
|
||||
sortByIndex(i, desc);
|
||||
removeSortIndicators();
|
||||
currentSort.index = i;
|
||||
currentSort.desc = desc;
|
||||
addSortIndicators();
|
||||
};
|
||||
};
|
||||
for (i =0 ; i < cols.length; i += 1) {
|
||||
if (cols[i].sortable) {
|
||||
// add the click event handler on the th so users
|
||||
// dont have to click on those tiny arrows
|
||||
el = getNthColumn(i).querySelector('.sorter').parentElement;
|
||||
if (el.addEventListener) {
|
||||
el.addEventListener('click', ithSorter(i));
|
||||
} else {
|
||||
el.attachEvent('onclick', ithSorter(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// adds sorting functionality to the UI
|
||||
return function () {
|
||||
if (!getTable()) {
|
||||
return;
|
||||
}
|
||||
cols = loadColumns();
|
||||
loadData(cols);
|
||||
addSortIndicators();
|
||||
enableUI();
|
||||
};
|
||||
})();
|
||||
|
||||
window.addEventListener('load', addSorting);
|
||||
58
node_modules/array-back/coverage/lcov.info
generated
vendored
Normal file
58
node_modules/array-back/coverage/lcov.info
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
TN:
|
||||
SF:/Users/lloydb/Documents/75lb/array-back/test.js
|
||||
FN:8,(anonymous_1)
|
||||
FN:14,(anonymous_2)
|
||||
FN:20,func
|
||||
FNF:3
|
||||
FNH:3
|
||||
FNDA:1,(anonymous_1)
|
||||
FNDA:1,(anonymous_2)
|
||||
FNDA:1,func
|
||||
DA:2,1
|
||||
DA:3,1
|
||||
DA:4,1
|
||||
DA:6,1
|
||||
DA:8,1
|
||||
DA:9,1
|
||||
DA:10,1
|
||||
DA:11,1
|
||||
DA:14,1
|
||||
DA:15,1
|
||||
DA:16,1
|
||||
DA:17,1
|
||||
DA:18,1
|
||||
DA:20,1
|
||||
DA:21,1
|
||||
DA:23,1
|
||||
LF:16
|
||||
LH:16
|
||||
BRF:0
|
||||
BRH:0
|
||||
end_of_record
|
||||
TN:
|
||||
SF:/Users/lloydb/Documents/75lb/array-back/index.js
|
||||
FN:36,arrayify
|
||||
FNF:1
|
||||
FNH:1
|
||||
FNDA:6,arrayify
|
||||
DA:6,1
|
||||
DA:36,1
|
||||
DA:37,6
|
||||
DA:38,6
|
||||
DA:39,2
|
||||
DA:41,4
|
||||
DA:42,1
|
||||
DA:43,3
|
||||
DA:44,1
|
||||
DA:46,2
|
||||
LF:10
|
||||
LH:10
|
||||
BRDA:38,1,0,2
|
||||
BRDA:38,1,1,4
|
||||
BRDA:41,2,0,1
|
||||
BRDA:41,2,1,3
|
||||
BRDA:43,3,0,1
|
||||
BRDA:43,3,1,2
|
||||
BRF:6
|
||||
BRH:6
|
||||
end_of_record
|
||||
49
node_modules/array-back/index.js
generated
vendored
Normal file
49
node_modules/array-back/index.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* @module array-back
|
||||
* @example
|
||||
* const arrayify = require('array-back')
|
||||
*/
|
||||
module.exports = arrayify
|
||||
|
||||
/**
|
||||
* Takes any input and guarantees an array back.
|
||||
*
|
||||
* - converts array-like objects (e.g. `arguments`) to a real array
|
||||
* - converts `undefined` to an empty array
|
||||
* - converts any another other, singular value (including `null`) into an array containing that value
|
||||
* - ignores input which is already an array
|
||||
*
|
||||
* @param {*} - the input value to convert to an array
|
||||
* @returns {Array}
|
||||
* @alias module:array-back
|
||||
* @example
|
||||
* > a.arrayify(undefined)
|
||||
* []
|
||||
*
|
||||
* > a.arrayify(null)
|
||||
* [ null ]
|
||||
*
|
||||
* > a.arrayify(0)
|
||||
* [ 0 ]
|
||||
*
|
||||
* > a.arrayify([ 1, 2 ])
|
||||
* [ 1, 2 ]
|
||||
*
|
||||
* > function f(){ return a.arrayify(arguments); }
|
||||
* > f(1,2,3)
|
||||
* [ 1, 2, 3 ]
|
||||
*/
|
||||
function arrayify (input) {
|
||||
const t = require('typical')
|
||||
if (Array.isArray(input)) {
|
||||
return input
|
||||
} else {
|
||||
if (input === undefined) {
|
||||
return []
|
||||
} else if (t.isArrayLike(input)) {
|
||||
return Array.prototype.slice.call(input)
|
||||
} else {
|
||||
return [ input ]
|
||||
}
|
||||
}
|
||||
}
|
||||
31
node_modules/array-back/package.json
generated
vendored
Normal file
31
node_modules/array-back/package.json
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "array-back",
|
||||
"author": "Lloyd Brookes <75pound@gmail.com>",
|
||||
"version": "2.0.0",
|
||||
"description": "Guarantees an array back",
|
||||
"repository": "https://github.com/75lb/array-back.git",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"to",
|
||||
"convert",
|
||||
"return",
|
||||
"array",
|
||||
"arrayify"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "test-runner test.js",
|
||||
"docs": "jsdoc2md -t README.hbs index.js > README.md; echo",
|
||||
"cover": "istanbul cover ./node_modules/.bin/test-runner test.js && cat coverage/lcov.info | ./node_modules/.bin/coveralls; echo"
|
||||
},
|
||||
"dependencies": {
|
||||
"typical": "^2.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"coveralls": "^2.13.1",
|
||||
"jsdoc-to-markdown": "^3.0.0",
|
||||
"test-runner": "^0.4.0"
|
||||
}
|
||||
}
|
||||
24
node_modules/array-back/test.js
generated
vendored
Normal file
24
node_modules/array-back/test.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict'
|
||||
const TestRunner = require('test-runner')
|
||||
const arrayify = require('./')
|
||||
const a = require('assert')
|
||||
|
||||
const runner = new TestRunner()
|
||||
|
||||
runner.test('if already array, do nothing', function () {
|
||||
const arr = [ 1,2,3 ]
|
||||
const result = arrayify(arr)
|
||||
a.strictEqual(arr, result)
|
||||
})
|
||||
|
||||
runner.test('arrayify()', function () {
|
||||
a.deepStrictEqual(arrayify(undefined), [])
|
||||
a.deepStrictEqual(arrayify(null), [ null ])
|
||||
a.deepStrictEqual(arrayify(0), [ 0 ])
|
||||
a.deepStrictEqual(arrayify([ 1, 2 ]), [ 1, 2 ])
|
||||
|
||||
function func () {
|
||||
a.deepStrictEqual(arrayify(arguments), [ 1, 2, 3 ])
|
||||
}
|
||||
func(1, 2, 3)
|
||||
})
|
||||
911
node_modules/array-back/yarn.lock
generated
vendored
Normal file
911
node_modules/array-back/yarn.lock
generated
vendored
Normal file
@@ -0,0 +1,911 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
acorn-jsx@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b"
|
||||
dependencies:
|
||||
acorn "^3.0.4"
|
||||
|
||||
acorn@^3.0.4, acorn@^3.3.0:
|
||||
version "3.3.0"
|
||||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"
|
||||
|
||||
amdefine@>=0.0.4:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
|
||||
|
||||
ansi-escape-sequences@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-escape-sequences/-/ansi-escape-sequences-3.0.0.tgz#1c18394b6af9b76ff9a63509fa497669fd2ce53e"
|
||||
dependencies:
|
||||
array-back "^1.0.3"
|
||||
|
||||
ansi-regex@^2.0.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
|
||||
|
||||
ansi-styles@^2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
|
||||
|
||||
app-usage-stats@^0.5.0:
|
||||
version "0.5.1"
|
||||
resolved "https://registry.yarnpkg.com/app-usage-stats/-/app-usage-stats-0.5.1.tgz#6547c5db9bab0aa5f5b2c560eacc8af20d0ab13b"
|
||||
dependencies:
|
||||
array-back "^1.0.4"
|
||||
home-path "^1.0.3"
|
||||
test-value "^2.1.0"
|
||||
usage-stats "^0.9.0"
|
||||
|
||||
argparse@^1.0.7:
|
||||
version "1.0.9"
|
||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
|
||||
dependencies:
|
||||
sprintf-js "~1.0.2"
|
||||
|
||||
array-back@^1.0.2, array-back@^1.0.3, array-back@^1.0.4:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/array-back/-/array-back-1.0.4.tgz#644ba7f095f7ffcf7c43b5f0dc39d3c1f03c063b"
|
||||
dependencies:
|
||||
typical "^2.6.0"
|
||||
|
||||
asn1@~0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86"
|
||||
|
||||
assert-plus@1.0.0, assert-plus@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
|
||||
|
||||
assert-plus@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234"
|
||||
|
||||
async@~0.2.6:
|
||||
version "0.2.10"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1"
|
||||
|
||||
asynckit@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
|
||||
|
||||
aws-sign2@~0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f"
|
||||
|
||||
aws4@^1.2.1:
|
||||
version "1.6.0"
|
||||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e"
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||
|
||||
bcrypt-pbkdf@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d"
|
||||
dependencies:
|
||||
tweetnacl "^0.14.3"
|
||||
|
||||
bluebird@~3.4.6:
|
||||
version "3.4.7"
|
||||
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3"
|
||||
|
||||
boom@2.x.x:
|
||||
version "2.10.1"
|
||||
resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f"
|
||||
dependencies:
|
||||
hoek "2.x.x"
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.8"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292"
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
cache-point@^0.4.0, cache-point@~0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/cache-point/-/cache-point-0.4.0.tgz#2797f68055970757c87e89b464978e74e11047b0"
|
||||
dependencies:
|
||||
array-back "^1.0.4"
|
||||
fs-then-native "^2.0.0"
|
||||
mkdirp "~0.5.1"
|
||||
|
||||
caseless@~0.11.0:
|
||||
version "0.11.0"
|
||||
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7"
|
||||
|
||||
catharsis@~0.8.8:
|
||||
version "0.8.8"
|
||||
resolved "https://registry.yarnpkg.com/catharsis/-/catharsis-0.8.8.tgz#693479f43aac549d806bd73e924cd0d944951a06"
|
||||
dependencies:
|
||||
underscore-contrib "~0.3.0"
|
||||
|
||||
chalk@^1.1.1:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
|
||||
dependencies:
|
||||
ansi-styles "^2.2.1"
|
||||
escape-string-regexp "^1.0.2"
|
||||
has-ansi "^2.0.0"
|
||||
strip-ansi "^3.0.0"
|
||||
supports-color "^2.0.0"
|
||||
|
||||
collect-all@^1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/collect-all/-/collect-all-1.0.3.tgz#1abcc20448b58a1447487fcf34130e9512b0acf8"
|
||||
dependencies:
|
||||
stream-connect "^1.0.2"
|
||||
stream-via "^1.0.4"
|
||||
|
||||
combined-stream@^1.0.5, combined-stream@~1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009"
|
||||
dependencies:
|
||||
delayed-stream "~1.0.0"
|
||||
|
||||
command-line-args@^4.0.1, command-line-args@^4.0.6:
|
||||
version "4.0.6"
|
||||
resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-4.0.6.tgz#0ff87a1dd159890dcaeb2a005abdae71e55059fc"
|
||||
dependencies:
|
||||
array-back "^1.0.4"
|
||||
find-replace "^1.0.3"
|
||||
typical "^2.6.1"
|
||||
|
||||
command-line-tool@^0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/command-line-tool/-/command-line-tool-0.7.0.tgz#ca80792ae2069cf7caa562c0cbc2cd11811122a0"
|
||||
dependencies:
|
||||
ansi-escape-sequences "^3.0.0"
|
||||
array-back "^1.0.4"
|
||||
command-line-args "^4.0.1"
|
||||
command-line-usage "^4.0.0"
|
||||
typical "^2.6.0"
|
||||
|
||||
command-line-usage@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/command-line-usage/-/command-line-usage-4.0.0.tgz#816b32788b58f9feba44d1e6dac60fcaeb29b5ea"
|
||||
dependencies:
|
||||
ansi-escape-sequences "^3.0.0"
|
||||
array-back "^1.0.4"
|
||||
table-layout "^0.4.0"
|
||||
typical "^2.6.0"
|
||||
|
||||
commander@^2.9.0:
|
||||
version "2.10.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.10.0.tgz#e1f5d3245de246d1a5ca04702fa1ad1bd7e405fe"
|
||||
dependencies:
|
||||
graceful-readlink ">= 1.0.0"
|
||||
|
||||
common-sequence@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/common-sequence/-/common-sequence-1.0.2.tgz#30e07f3f8f6f7f9b3dee854f20b2d39eee086de8"
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
|
||||
config-master@^3.0.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/config-master/-/config-master-3.1.0.tgz#667663590505a283bf26a484d68489d74c5485da"
|
||||
dependencies:
|
||||
walk-back "^2.0.1"
|
||||
|
||||
coveralls@^2.13.1:
|
||||
version "2.13.1"
|
||||
resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-2.13.1.tgz#d70bb9acc1835ec4f063ff9dac5423c17b11f178"
|
||||
dependencies:
|
||||
js-yaml "3.6.1"
|
||||
lcov-parse "0.0.10"
|
||||
log-driver "1.2.5"
|
||||
minimist "1.2.0"
|
||||
request "2.79.0"
|
||||
|
||||
cryptiles@2.x.x:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8"
|
||||
dependencies:
|
||||
boom "2.x.x"
|
||||
|
||||
dashdash@^1.12.0:
|
||||
version "1.14.1"
|
||||
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
deep-extend@~0.4.1:
|
||||
version "0.4.2"
|
||||
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f"
|
||||
|
||||
defer-promise@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/defer-promise/-/defer-promise-1.0.1.tgz#1ca6ffeddbcef1715dd7aae25c7616f9ae22932f"
|
||||
|
||||
delayed-stream@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
|
||||
|
||||
dmd@^3.0.0:
|
||||
version "3.0.6"
|
||||
resolved "https://registry.yarnpkg.com/dmd/-/dmd-3.0.6.tgz#94c0e0fb88d1cb6b82837595053de7919c753c25"
|
||||
dependencies:
|
||||
array-back "^1.0.4"
|
||||
cache-point "^0.4.0"
|
||||
common-sequence "^1.0.2"
|
||||
file-set "^1.1.1"
|
||||
handlebars "3.0.3"
|
||||
marked "^0.3.6"
|
||||
object-get "^2.1.0"
|
||||
reduce-flatten "^1.0.1"
|
||||
reduce-unique "^1.0.0"
|
||||
reduce-without "^1.0.1"
|
||||
test-value "^2.1.0"
|
||||
walk-back "^3.0.0"
|
||||
|
||||
ecc-jsbn@~0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505"
|
||||
dependencies:
|
||||
jsbn "~0.1.0"
|
||||
|
||||
escape-string-regexp@^1.0.2, escape-string-regexp@~1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||
|
||||
espree@~3.1.7:
|
||||
version "3.1.7"
|
||||
resolved "https://registry.yarnpkg.com/espree/-/espree-3.1.7.tgz#fd5deec76a97a5120a9cd3a7cb1177a0923b11d2"
|
||||
dependencies:
|
||||
acorn "^3.3.0"
|
||||
acorn-jsx "^3.0.0"
|
||||
|
||||
esprima@^2.6.0:
|
||||
version "2.7.3"
|
||||
resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581"
|
||||
|
||||
extend@~3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444"
|
||||
|
||||
extsprintf@1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550"
|
||||
|
||||
feature-detect-es6@^1.3.1:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/feature-detect-es6/-/feature-detect-es6-1.3.1.tgz#f888736af9cb0c91f55663bfa4762eb96ee7047f"
|
||||
dependencies:
|
||||
array-back "^1.0.3"
|
||||
|
||||
file-set@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/file-set/-/file-set-1.1.1.tgz#d3ec70c080ec8f18f204ba1de106780c9056926b"
|
||||
dependencies:
|
||||
array-back "^1.0.3"
|
||||
glob "^7.1.0"
|
||||
|
||||
find-replace@^1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-1.0.3.tgz#b88e7364d2d9c959559f388c66670d6130441fa0"
|
||||
dependencies:
|
||||
array-back "^1.0.4"
|
||||
test-value "^2.1.0"
|
||||
|
||||
forever-agent@~0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
|
||||
|
||||
form-data@~2.1.1:
|
||||
version "2.1.4"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1"
|
||||
dependencies:
|
||||
asynckit "^0.4.0"
|
||||
combined-stream "^1.0.5"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
fs-then-native@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs-then-native/-/fs-then-native-2.0.0.tgz#19a124d94d90c22c8e045f2e8dd6ebea36d48c67"
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
|
||||
generate-function@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74"
|
||||
|
||||
generate-object-property@^1.1.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0"
|
||||
dependencies:
|
||||
is-property "^1.0.0"
|
||||
|
||||
getpass@^0.1.1:
|
||||
version "0.1.7"
|
||||
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
glob@^7.1.0:
|
||||
version "7.1.2"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.0.4"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
graceful-fs@^4.1.9:
|
||||
version "4.1.11"
|
||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
|
||||
|
||||
"graceful-readlink@>= 1.0.0":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
|
||||
|
||||
handlebars@3.0.3:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-3.0.3.tgz#0e09651a2f0fb3c949160583710d551f92e6d2ad"
|
||||
dependencies:
|
||||
optimist "^0.6.1"
|
||||
source-map "^0.1.40"
|
||||
optionalDependencies:
|
||||
uglify-js "~2.3"
|
||||
|
||||
har-validator@~2.0.6:
|
||||
version "2.0.6"
|
||||
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d"
|
||||
dependencies:
|
||||
chalk "^1.1.1"
|
||||
commander "^2.9.0"
|
||||
is-my-json-valid "^2.12.4"
|
||||
pinkie-promise "^2.0.0"
|
||||
|
||||
has-ansi@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
|
||||
dependencies:
|
||||
ansi-regex "^2.0.0"
|
||||
|
||||
hawk@~3.1.3:
|
||||
version "3.1.3"
|
||||
resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4"
|
||||
dependencies:
|
||||
boom "2.x.x"
|
||||
cryptiles "2.x.x"
|
||||
hoek "2.x.x"
|
||||
sntp "1.x.x"
|
||||
|
||||
hoek@2.x.x:
|
||||
version "2.16.3"
|
||||
resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"
|
||||
|
||||
home-path@^1.0.3, home-path@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/home-path/-/home-path-1.0.5.tgz#788b29815b12d53bacf575648476e6f9041d133f"
|
||||
|
||||
http-signature@~1.1.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf"
|
||||
dependencies:
|
||||
assert-plus "^0.2.0"
|
||||
jsprim "^1.2.2"
|
||||
sshpk "^1.7.0"
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||
|
||||
is-my-json-valid@^2.12.4:
|
||||
version "2.16.0"
|
||||
resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693"
|
||||
dependencies:
|
||||
generate-function "^2.0.0"
|
||||
generate-object-property "^1.1.0"
|
||||
jsonpointer "^4.0.0"
|
||||
xtend "^4.0.0"
|
||||
|
||||
is-property@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84"
|
||||
|
||||
is-typedarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
||||
|
||||
isstream@~0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||
|
||||
js-yaml@3.6.1:
|
||||
version "3.6.1"
|
||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30"
|
||||
dependencies:
|
||||
argparse "^1.0.7"
|
||||
esprima "^2.6.0"
|
||||
|
||||
js2xmlparser@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/js2xmlparser/-/js2xmlparser-1.0.0.tgz#5a170f2e8d6476ce45405e04823242513782fe30"
|
||||
|
||||
jsbn@~0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
|
||||
|
||||
jsdoc-75lb@^3.6.0:
|
||||
version "3.6.0"
|
||||
resolved "https://registry.yarnpkg.com/jsdoc-75lb/-/jsdoc-75lb-3.6.0.tgz#a807119528b4009ccbcab49b7522f63fec6cd0bd"
|
||||
dependencies:
|
||||
bluebird "~3.4.6"
|
||||
catharsis "~0.8.8"
|
||||
escape-string-regexp "~1.0.5"
|
||||
espree "~3.1.7"
|
||||
js2xmlparser "~1.0.0"
|
||||
klaw "~1.3.0"
|
||||
marked "~0.3.6"
|
||||
mkdirp "~0.5.1"
|
||||
requizzle "~0.2.1"
|
||||
strip-json-comments "~2.0.1"
|
||||
taffydb "2.6.2"
|
||||
underscore "~1.8.3"
|
||||
|
||||
jsdoc-api@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/jsdoc-api/-/jsdoc-api-3.0.0.tgz#0d52700235f865bd4a8bad5ebc1efb562fc8ad2a"
|
||||
dependencies:
|
||||
array-back "^1.0.4"
|
||||
cache-point "~0.4.0"
|
||||
collect-all "^1.0.2"
|
||||
file-set "^1.1.1"
|
||||
fs-then-native "^2.0.0"
|
||||
jsdoc-75lb "^3.6.0"
|
||||
object-to-spawn-args "^1.1.0"
|
||||
temp-path "^1.0.0"
|
||||
walk-back "^2.0.1"
|
||||
|
||||
jsdoc-parse@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/jsdoc-parse/-/jsdoc-parse-3.0.0.tgz#271531d88f19df2520b1632a7f6c989441a87fde"
|
||||
dependencies:
|
||||
array-back "^1.0.4"
|
||||
lodash.omit "^4.5.0"
|
||||
lodash.pick "^4.4.0"
|
||||
reduce-extract "^1.0.0"
|
||||
sort-array "^1.1.1"
|
||||
test-value "^2.1.0"
|
||||
|
||||
jsdoc-to-markdown@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/jsdoc-to-markdown/-/jsdoc-to-markdown-3.0.0.tgz#cc8a94f1f412ac1da4bac1657475b0975ee8161a"
|
||||
dependencies:
|
||||
array-back "^1.0.4"
|
||||
command-line-tool "^0.7.0"
|
||||
config-master "^3.0.0"
|
||||
dmd "^3.0.0"
|
||||
jsdoc-api "^3.0.0"
|
||||
jsdoc-parse "^3.0.0"
|
||||
jsdoc2md-stats "^2.0.0"
|
||||
walk-back "^2.0.1"
|
||||
|
||||
jsdoc2md-stats@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/jsdoc2md-stats/-/jsdoc2md-stats-2.0.1.tgz#bd8343734cfe69ea8050a17931251293f0d9047b"
|
||||
dependencies:
|
||||
app-usage-stats "^0.5.0"
|
||||
|
||||
json-schema@0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
|
||||
|
||||
json-stringify-safe@~5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
|
||||
|
||||
jsonpointer@^4.0.0:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9"
|
||||
|
||||
jsprim@^1.2.2:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918"
|
||||
dependencies:
|
||||
assert-plus "1.0.0"
|
||||
extsprintf "1.0.2"
|
||||
json-schema "0.2.3"
|
||||
verror "1.3.6"
|
||||
|
||||
klaw@~1.3.0:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439"
|
||||
optionalDependencies:
|
||||
graceful-fs "^4.1.9"
|
||||
|
||||
lcov-parse@0.0.10:
|
||||
version "0.0.10"
|
||||
resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3"
|
||||
|
||||
lodash.omit@^4.5.0:
|
||||
version "4.5.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.omit/-/lodash.omit-4.5.0.tgz#6eb19ae5a1ee1dd9df0b969e66ce0b7fa30b5e60"
|
||||
|
||||
lodash.padend@^4.6.1:
|
||||
version "4.6.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash.padend/-/lodash.padend-4.6.1.tgz#53ccba047d06e158d311f45da625f4e49e6f166e"
|
||||
|
||||
lodash.pick@^4.4.0:
|
||||
version "4.4.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3"
|
||||
|
||||
log-driver@1.2.5:
|
||||
version "1.2.5"
|
||||
resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.5.tgz#7ae4ec257302fd790d557cb10c97100d857b0056"
|
||||
|
||||
marked@^0.3.6, marked@~0.3.6:
|
||||
version "0.3.6"
|
||||
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.6.tgz#b2c6c618fccece4ef86c4fc6cb8a7cbf5aeda8d7"
|
||||
|
||||
mime-db@~1.27.0:
|
||||
version "1.27.0"
|
||||
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1"
|
||||
|
||||
mime-types@^2.1.12, mime-types@~2.1.7:
|
||||
version "2.1.15"
|
||||
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed"
|
||||
dependencies:
|
||||
mime-db "~1.27.0"
|
||||
|
||||
minimatch@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
minimist@0.0.8, minimist@~0.0.1:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
|
||||
|
||||
minimist@1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
|
||||
|
||||
mkdirp2@^1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp2/-/mkdirp2-1.0.3.tgz#cc8dd8265f1f06e2d8f5b10b6e52f4e050bed21b"
|
||||
|
||||
mkdirp@~0.5.1:
|
||||
version "0.5.1"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
|
||||
dependencies:
|
||||
minimist "0.0.8"
|
||||
|
||||
oauth-sign@~0.8.1:
|
||||
version "0.8.2"
|
||||
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
|
||||
|
||||
object-get@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/object-get/-/object-get-2.1.0.tgz#722bbdb60039efa47cad3c6dc2ce51a85c02c5ae"
|
||||
|
||||
object-to-spawn-args@^1.1.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/object-to-spawn-args/-/object-to-spawn-args-1.1.1.tgz#77da8827f073d011c9e1b173f895781470246785"
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
optimist@^0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
|
||||
dependencies:
|
||||
minimist "~0.0.1"
|
||||
wordwrap "~0.0.2"
|
||||
|
||||
optimist@~0.3.5:
|
||||
version "0.3.7"
|
||||
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.3.7.tgz#c90941ad59e4273328923074d2cf2e7cbc6ec0d9"
|
||||
dependencies:
|
||||
wordwrap "~0.0.2"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
|
||||
pinkie-promise@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
|
||||
dependencies:
|
||||
pinkie "^2.0.0"
|
||||
|
||||
pinkie@^2.0.0:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
|
||||
|
||||
punycode@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
|
||||
|
||||
qs@~6.3.0:
|
||||
version "6.3.2"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c"
|
||||
|
||||
reduce-extract@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/reduce-extract/-/reduce-extract-1.0.0.tgz#67f2385beda65061b5f5f4312662e8b080ca1525"
|
||||
dependencies:
|
||||
test-value "^1.0.1"
|
||||
|
||||
reduce-flatten@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-1.0.1.tgz#258c78efd153ddf93cb561237f61184f3696e327"
|
||||
|
||||
reduce-unique@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/reduce-unique/-/reduce-unique-1.0.0.tgz#7e586bcf87a4e32b6d7abd8277fad6cdec9f4803"
|
||||
|
||||
reduce-without@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/reduce-without/-/reduce-without-1.0.1.tgz#68ad0ead11855c9a37d4e8256c15bbf87972fc8c"
|
||||
dependencies:
|
||||
test-value "^2.0.0"
|
||||
|
||||
req-then@^0.6.1:
|
||||
version "0.6.2"
|
||||
resolved "https://registry.yarnpkg.com/req-then/-/req-then-0.6.2.tgz#7f9e6ebbcab327adc9280aa92b3698d3fc1c5b0d"
|
||||
dependencies:
|
||||
array-back "^1.0.4"
|
||||
defer-promise "^1.0.1"
|
||||
lodash.pick "^4.4.0"
|
||||
stream-read-all "^0.1.0"
|
||||
typical "^2.6.1"
|
||||
|
||||
request@2.79.0:
|
||||
version "2.79.0"
|
||||
resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de"
|
||||
dependencies:
|
||||
aws-sign2 "~0.6.0"
|
||||
aws4 "^1.2.1"
|
||||
caseless "~0.11.0"
|
||||
combined-stream "~1.0.5"
|
||||
extend "~3.0.0"
|
||||
forever-agent "~0.6.1"
|
||||
form-data "~2.1.1"
|
||||
har-validator "~2.0.6"
|
||||
hawk "~3.1.3"
|
||||
http-signature "~1.1.0"
|
||||
is-typedarray "~1.0.0"
|
||||
isstream "~0.1.2"
|
||||
json-stringify-safe "~5.0.1"
|
||||
mime-types "~2.1.7"
|
||||
oauth-sign "~0.8.1"
|
||||
qs "~6.3.0"
|
||||
stringstream "~0.0.4"
|
||||
tough-cookie "~2.3.0"
|
||||
tunnel-agent "~0.4.1"
|
||||
uuid "^3.0.0"
|
||||
|
||||
requizzle@~0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/requizzle/-/requizzle-0.2.1.tgz#6943c3530c4d9a7e46f1cddd51c158fc670cdbde"
|
||||
dependencies:
|
||||
underscore "~1.6.0"
|
||||
|
||||
sntp@1.x.x:
|
||||
version "1.0.9"
|
||||
resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198"
|
||||
dependencies:
|
||||
hoek "2.x.x"
|
||||
|
||||
sort-array@^1.1.1:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/sort-array/-/sort-array-1.1.2.tgz#b88986053c0170a7f9de63f18a49ec79c24c3e64"
|
||||
dependencies:
|
||||
array-back "^1.0.4"
|
||||
object-get "^2.1.0"
|
||||
typical "^2.6.0"
|
||||
|
||||
source-map@^0.1.40, source-map@~0.1.7:
|
||||
version "0.1.43"
|
||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346"
|
||||
dependencies:
|
||||
amdefine ">=0.0.4"
|
||||
|
||||
sprintf-js@~1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
||||
|
||||
sshpk@^1.7.0:
|
||||
version "1.13.1"
|
||||
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3"
|
||||
dependencies:
|
||||
asn1 "~0.2.3"
|
||||
assert-plus "^1.0.0"
|
||||
dashdash "^1.12.0"
|
||||
getpass "^0.1.1"
|
||||
optionalDependencies:
|
||||
bcrypt-pbkdf "^1.0.0"
|
||||
ecc-jsbn "~0.1.1"
|
||||
jsbn "~0.1.0"
|
||||
tweetnacl "~0.14.0"
|
||||
|
||||
stream-connect@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/stream-connect/-/stream-connect-1.0.2.tgz#18bc81f2edb35b8b5d9a8009200a985314428a97"
|
||||
dependencies:
|
||||
array-back "^1.0.2"
|
||||
|
||||
stream-read-all@^0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/stream-read-all/-/stream-read-all-0.1.0.tgz#04fd4498d4f29717f5b7f316354425cf318c6385"
|
||||
dependencies:
|
||||
test-runner "^0.4.0"
|
||||
|
||||
stream-via@^1.0.4:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/stream-via/-/stream-via-1.0.4.tgz#8dccbb0ac909328eb8bc8e2a4bd3934afdaf606c"
|
||||
|
||||
stringstream@~0.0.4:
|
||||
version "0.0.5"
|
||||
resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878"
|
||||
|
||||
strip-ansi@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
|
||||
dependencies:
|
||||
ansi-regex "^2.0.0"
|
||||
|
||||
strip-json-comments@~2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
|
||||
|
||||
supports-color@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
|
||||
|
||||
table-layout@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-0.4.0.tgz#c70ff0455d9add63b91f7c15a77926295c0e0e7d"
|
||||
dependencies:
|
||||
array-back "^1.0.4"
|
||||
deep-extend "~0.4.1"
|
||||
lodash.padend "^4.6.1"
|
||||
typical "^2.6.0"
|
||||
wordwrapjs "^2.0.0"
|
||||
|
||||
taffydb@2.6.2:
|
||||
version "2.6.2"
|
||||
resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.6.2.tgz#7cbcb64b5a141b6a2efc2c5d2c67b4e150b2a268"
|
||||
|
||||
temp-path@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/temp-path/-/temp-path-1.0.0.tgz#24b1543973ab442896d9ad367dd9cbdbfafe918b"
|
||||
|
||||
test-runner@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/test-runner/-/test-runner-0.4.0.tgz#41426f9b3dfff4bcda2cb23f3b7df73d67d6b8a2"
|
||||
dependencies:
|
||||
ansi-escape-sequences "^3.0.0"
|
||||
array-back "^1.0.4"
|
||||
command-line-args "^4.0.6"
|
||||
command-line-usage "^4.0.0"
|
||||
file-set "^1.1.1"
|
||||
reduce-flatten "^1.0.1"
|
||||
|
||||
test-value@^1.0.1:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/test-value/-/test-value-1.1.0.tgz#a09136f72ec043d27c893707c2b159bfad7de93f"
|
||||
dependencies:
|
||||
array-back "^1.0.2"
|
||||
typical "^2.4.2"
|
||||
|
||||
test-value@^2.0.0, test-value@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/test-value/-/test-value-2.1.0.tgz#11da6ff670f3471a73b625ca4f3fdcf7bb748291"
|
||||
dependencies:
|
||||
array-back "^1.0.3"
|
||||
typical "^2.6.0"
|
||||
|
||||
tough-cookie@~2.3.0:
|
||||
version "2.3.2"
|
||||
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a"
|
||||
dependencies:
|
||||
punycode "^1.4.1"
|
||||
|
||||
tunnel-agent@~0.4.1:
|
||||
version "0.4.3"
|
||||
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb"
|
||||
|
||||
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
||||
version "0.14.5"
|
||||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||
|
||||
typical@^2.4.2, typical@^2.6.0, typical@^2.6.1:
|
||||
version "2.6.1"
|
||||
resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.1.tgz#5c080e5d661cbbe38259d2e70a3c7253e873881d"
|
||||
|
||||
uglify-js@~2.3:
|
||||
version "2.3.6"
|
||||
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.3.6.tgz#fa0984770b428b7a9b2a8058f46355d14fef211a"
|
||||
dependencies:
|
||||
async "~0.2.6"
|
||||
optimist "~0.3.5"
|
||||
source-map "~0.1.7"
|
||||
|
||||
underscore-contrib@~0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/underscore-contrib/-/underscore-contrib-0.3.0.tgz#665b66c24783f8fa2b18c9f8cbb0e2c7d48c26c7"
|
||||
dependencies:
|
||||
underscore "1.6.0"
|
||||
|
||||
underscore@1.6.0, underscore@~1.6.0:
|
||||
version "1.6.0"
|
||||
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8"
|
||||
|
||||
underscore@~1.8.3:
|
||||
version "1.8.3"
|
||||
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022"
|
||||
|
||||
usage-stats@^0.9.0:
|
||||
version "0.9.1"
|
||||
resolved "https://registry.yarnpkg.com/usage-stats/-/usage-stats-0.9.1.tgz#3b34997dbef1e151f48a118a93a5c595e1d4269a"
|
||||
dependencies:
|
||||
array-back "^1.0.4"
|
||||
home-path "^1.0.5"
|
||||
mkdirp2 "^1.0.2"
|
||||
req-then "^0.6.1"
|
||||
typical "^2.6.0"
|
||||
uuid "^3.0.1"
|
||||
|
||||
uuid@^3.0.0, uuid@^3.0.1:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04"
|
||||
|
||||
verror@1.3.6:
|
||||
version "1.3.6"
|
||||
resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c"
|
||||
dependencies:
|
||||
extsprintf "1.0.2"
|
||||
|
||||
walk-back@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/walk-back/-/walk-back-2.0.1.tgz#554e2a9d874fac47a8cb006bf44c2f0c4998a0a4"
|
||||
|
||||
walk-back@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/walk-back/-/walk-back-3.0.0.tgz#2358787a35da91032dad5e92f80b12370d8795c5"
|
||||
|
||||
wordwrap@~0.0.2:
|
||||
version "0.0.3"
|
||||
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
|
||||
|
||||
wordwrapjs@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/wordwrapjs/-/wordwrapjs-2.0.0.tgz#ab55f695e6118da93858fdd70c053d1c5e01ac20"
|
||||
dependencies:
|
||||
array-back "^1.0.3"
|
||||
feature-detect-es6 "^1.3.1"
|
||||
reduce-flatten "^1.0.1"
|
||||
typical "^2.6.0"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
|
||||
xtend@^4.0.0:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
|
||||
64
node_modules/camelcase/index.js
generated
vendored
Normal file
64
node_modules/camelcase/index.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
'use strict';
|
||||
|
||||
function preserveCamelCase(str) {
|
||||
let isLastCharLower = false;
|
||||
let isLastCharUpper = false;
|
||||
let isLastLastCharUpper = false;
|
||||
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
const c = str[i];
|
||||
|
||||
if (isLastCharLower && /[a-zA-Z]/.test(c) && c.toUpperCase() === c) {
|
||||
str = str.substr(0, i) + '-' + str.substr(i);
|
||||
isLastCharLower = false;
|
||||
isLastLastCharUpper = isLastCharUpper;
|
||||
isLastCharUpper = true;
|
||||
i++;
|
||||
} else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(c) && c.toLowerCase() === c) {
|
||||
str = str.substr(0, i - 1) + '-' + str.substr(i - 1);
|
||||
isLastLastCharUpper = isLastCharUpper;
|
||||
isLastCharUpper = false;
|
||||
isLastCharLower = true;
|
||||
} else {
|
||||
isLastCharLower = c.toLowerCase() === c;
|
||||
isLastLastCharUpper = isLastCharUpper;
|
||||
isLastCharUpper = c.toUpperCase() === c;
|
||||
}
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
module.exports = function (str) {
|
||||
if (arguments.length > 1) {
|
||||
str = Array.from(arguments)
|
||||
.map(x => x.trim())
|
||||
.filter(x => x.length)
|
||||
.join('-');
|
||||
} else {
|
||||
str = str.trim();
|
||||
}
|
||||
|
||||
if (str.length === 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (str.length === 1) {
|
||||
return str.toLowerCase();
|
||||
}
|
||||
|
||||
if (/^[a-z0-9]+$/.test(str)) {
|
||||
return str;
|
||||
}
|
||||
|
||||
const hasUpperCase = str !== str.toLowerCase();
|
||||
|
||||
if (hasUpperCase) {
|
||||
str = preserveCamelCase(str);
|
||||
}
|
||||
|
||||
return str
|
||||
.replace(/^[_.\- ]+/, '')
|
||||
.toLowerCase()
|
||||
.replace(/[_.\- ]+(\w|$)/g, (m, p1) => p1.toUpperCase());
|
||||
};
|
||||
21
node_modules/camelcase/license
generated
vendored
Normal file
21
node_modules/camelcase/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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.
|
||||
42
node_modules/camelcase/package.json
generated
vendored
Normal file
42
node_modules/camelcase/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "camelcase",
|
||||
"version": "4.1.0",
|
||||
"description": "Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/camelcase",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"camelcase",
|
||||
"camel-case",
|
||||
"camel",
|
||||
"case",
|
||||
"dash",
|
||||
"hyphen",
|
||||
"dot",
|
||||
"underscore",
|
||||
"separator",
|
||||
"string",
|
||||
"text",
|
||||
"convert"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"xo": {
|
||||
"esnext": true
|
||||
}
|
||||
}
|
||||
57
node_modules/camelcase/readme.md
generated
vendored
Normal file
57
node_modules/camelcase/readme.md
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
# camelcase [](https://travis-ci.org/sindresorhus/camelcase)
|
||||
|
||||
> Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar` → `fooBar`
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save camelcase
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const camelCase = require('camelcase');
|
||||
|
||||
camelCase('foo-bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('foo_bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('Foo-Bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('--foo.bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('__foo__bar__');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('foo bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
console.log(process.argv[3]);
|
||||
//=> '--foo-bar'
|
||||
camelCase(process.argv[3]);
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('foo', 'bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('__foo__', '--bar');
|
||||
//=> 'fooBar'
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module
|
||||
- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
18
node_modules/cfb/CHANGELOG.md
generated
vendored
Normal file
18
node_modules/cfb/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
# CHANGELOG
|
||||
|
||||
This log is intended to keep track of backwards-incompatible changes, including
|
||||
but not limited to API changes and file location changes. Minor behavioral
|
||||
changes may not be included if they are not expected to break existing code.
|
||||
|
||||
## 1.0.6 (2018-04-09)
|
||||
|
||||
* `lastIndexOf` in FAT builder enables larger file parsing at minor cost
|
||||
|
||||
## 1.0.0 (2017-11-05)
|
||||
|
||||
* Actually walk mini-fat
|
||||
|
||||
## 0.14.0 (2017-11-04)
|
||||
|
||||
* Completely removed `FullPathDir`
|
||||
|
||||
13
node_modules/cfb/LICENSE
generated
vendored
Normal file
13
node_modules/cfb/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
Copyright (C) 2013-present SheetJS
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
156
node_modules/cfb/README.md
generated
vendored
Normal file
156
node_modules/cfb/README.md
generated
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
# Compound File Binary Format
|
||||
|
||||
Pure JS implementation of MS-CFB: Compound File Binary File Format, a container
|
||||
format used in many Microsoft file types (XLS, DOC, VBA blobs in XLSX and XLSB)
|
||||
|
||||
[](https://travis-ci.org/SheetJS/js-cfb)
|
||||
[](https://coveralls.io/r/SheetJS/js-cfb?branch=master)
|
||||
[](https://david-dm.org/sheetjs/js-cfb)
|
||||
[](https://npmjs.org/package/cfb)
|
||||
[](https://ghit.me/repo/sheetjs/js-xlsx)
|
||||
[](https://github.com/SheetJS/js-cfb)
|
||||
|
||||
## Installation
|
||||
|
||||
In the browser:
|
||||
|
||||
```html
|
||||
<script src="dist/cfb.min.js" type="text/javascript"></script>
|
||||
```
|
||||
|
||||
With [npm](https://www.npmjs.org/package/cfb):
|
||||
|
||||
```bash
|
||||
$ npm install cfb
|
||||
```
|
||||
|
||||
The `xlscfb.js` file is designed to be embedded in [js-xlsx](http://git.io/xlsx)
|
||||
|
||||
|
||||
## Library Usage
|
||||
|
||||
In node:
|
||||
|
||||
```js
|
||||
var CFB = require('cfb');
|
||||
```
|
||||
|
||||
For example, to get the Workbook content from an Excel 2003 XLS file:
|
||||
|
||||
```js
|
||||
var cfb = CFB.read(filename, {type: 'file'});
|
||||
var workbook = CFB.find(cfb, 'Workbook');
|
||||
var data = workbook.content;
|
||||
```
|
||||
|
||||
|
||||
## Command-Line Utility Usage
|
||||
|
||||
It is preferable to install the library globally with npm:
|
||||
|
||||
```bash
|
||||
$ npm install -g cfb
|
||||
```
|
||||
|
||||
The global installation adds a command `cfb` which can work with files:
|
||||
|
||||
- `cfb file [names...]` extracts the contents of the file. If additional names
|
||||
are supplied, only the listed files will be extracted.
|
||||
|
||||
- `cfb -l file` lists the contained files (following `unzip -l` "short format")
|
||||
|
||||
- `cfb -r file` attempts to repair by reading and re-writing the file.
|
||||
This fixes some issues with files generated by non-standard tools.
|
||||
|
||||
- `cfb -c file [files...]` creates a new file containing the listed files.
|
||||
The default root entry name is `Root Entry`.
|
||||
|
||||
- `cfb -a file [files...]` adds the listed files to the original file.
|
||||
|
||||
- `cfb -d file [files...]` deletes the listed files from the original file.
|
||||
|
||||
|
||||
## JS API
|
||||
|
||||
TypeScript definitions are maintained in `types/index.d.ts`.
|
||||
|
||||
The CFB object exposes the following methods and properties:
|
||||
|
||||
`CFB.parse(blob)` takes a nodejs Buffer or an array of bytes and returns an
|
||||
parsed representation of the data.
|
||||
|
||||
`CFB.read(blob, opts)` wraps `parse`. `opts.type` controls the behavior:
|
||||
|
||||
| `type` | expected input |
|
||||
|------------|-----------------------------------------------------------------|
|
||||
| `"base64"` | string: Base64 encoding of the file |
|
||||
| `"binary"` | string: binary string (byte `n` is `data.charCodeAt(n)`) |
|
||||
| `"file"` | string: path of file that will be read (nodejs only) |
|
||||
| (default) | buffer or array of 8-bit unsigned int (byte `n` is `data[n]`) |
|
||||
|
||||
`CFB.find(cfb, path)` performs a case-insensitive match for the path (or file
|
||||
name, if there are no slashes) and returns an entry object or null if not found.
|
||||
|
||||
`CFB.write(cfb, opts)` generates a file based on the container. `opts.type`
|
||||
controls the behavior:
|
||||
|
||||
| `type` | output |
|
||||
|------------|-----------------------------------------------------------------|
|
||||
| `"base64"` | string: Base64 encoding of the file |
|
||||
| `"binary"` | string: binary string (byte `n` is `data.charCodeAt(n)`) |
|
||||
| `"file"` | string: path of file that will be created (nodejs only) |
|
||||
| (default) | buffer if available, array of 8-bit unsigned int otherwise |
|
||||
|
||||
`CFB.writeFile(cfb, filename, opts)` creates a file with the specified name.
|
||||
|
||||
|
||||
## Utility Functions
|
||||
|
||||
The utility functions are available in the `CFB.utils` object. Functions that
|
||||
accept a `name` argument strictly deal with absolute file names:
|
||||
|
||||
- `.cfb_new(?opts)` creates a new container object.
|
||||
- `.cfb_add(cfb, name, ?content, ?opts)` adds a new file to the `cfb`.
|
||||
Set the option `{unsafe:true}` to skip existence checks (for bulk additions)
|
||||
- `.cfb_del(cfb, name)` deletes the specified file
|
||||
- `.cfb_mov(cfb, old_name, new_name)` moves the old file to new path and name
|
||||
|
||||
|
||||
## Container Object Description
|
||||
|
||||
The objects returned by `parse` and `read` have the following properties:
|
||||
|
||||
- `.FullPaths` is an array of the names of all of the streams (files) and
|
||||
storages (directories) in the container. The paths are properly prefixed from
|
||||
the root entry (so the entries are unique)
|
||||
|
||||
- `.FileIndex` is an array, in the same order as `.FullPaths`, whose values are
|
||||
objects following the schema:
|
||||
|
||||
```typescript
|
||||
interface CFBEntry {
|
||||
name: string; /** Case-sensitive internal name */
|
||||
type: number; /** 1 = dir, 2 = file, 5 = root ; see [MS-CFB] 2.6.1 */
|
||||
content: Buffer | number[] | Uint8Array; /** Raw Content */
|
||||
ct?: Date; /** Creation Time */
|
||||
mt?: Date; /** Modification Time */
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Please consult the attached LICENSE file for details. All rights not explicitly
|
||||
granted by the Apache 2.0 License are reserved by the Original Author.
|
||||
|
||||
|
||||
## References
|
||||
|
||||
|
||||
<details>
|
||||
<summary><b>OSP-covered Specifications</b> (click to show)</summary>
|
||||
|
||||
- [MS-CFB]: Compound File Binary File Format
|
||||
|
||||
</details>
|
||||
|
||||
131
node_modules/cfb/bin/cfb.njs
generated
vendored
Executable file
131
node_modules/cfb/bin/cfb.njs
generated
vendored
Executable file
@@ -0,0 +1,131 @@
|
||||
#!/usr/bin/env node
|
||||
/* cfb.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/* eslint-env node */
|
||||
/* vim: set ts=2 ft=javascript: */
|
||||
var n = "cfb";
|
||||
var X = require('../');
|
||||
var fs = require('fs');
|
||||
var program = require('commander');
|
||||
var PRINTJ = require("printj");
|
||||
var sprintf = PRINTJ.sprintf;
|
||||
program
|
||||
.version(X.version)
|
||||
.usage('[options] <file> [subfiles...]')
|
||||
.option('-l, --list-files', 'list files')
|
||||
.option('-r, --repair', 'attempt to repair and garbage-collect archive')
|
||||
.option('-c, --create', 'create file')
|
||||
.option('-a, --append', 'add files to CFB (overwrite existing data)')
|
||||
.option('-d, --delete', 'delete files from CFB')
|
||||
.option('-O, --to-stdout', 'extract raw contents to stdout')
|
||||
.option('-z, --dump', 'dump internal representation but do not extract')
|
||||
.option('-q, --quiet', 'process but do not report')
|
||||
.option('--dev', 'development mode')
|
||||
.option('--read', 'read but do not print out contents');
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
var exit = process.exit;
|
||||
var die = function(errno/*:number*/, msg/*:string*/) { console.error(n + ": " + msg); exit(errno); };
|
||||
var logit = function(cmd/*:string*/, f/*:string*/) { console.error(sprintf("%-6s %s", cmd, f)); };
|
||||
|
||||
if(program.args.length === 0) die(1, "must specify a filename");
|
||||
|
||||
if(program.create) {
|
||||
logit("create", program.args[0]);
|
||||
var newcfb = X.utils.cfb_new();
|
||||
X.writeFile(newcfb, program.args[0]);
|
||||
}
|
||||
|
||||
if(!fs.existsSync(program.args[0])) die(1, "must specify a filename");
|
||||
|
||||
var opts = ({type:'file'}/*:any*/);
|
||||
if(program.dev) opts.WTF = true;
|
||||
|
||||
var cfb = X.read(program.args[0], opts);
|
||||
if(program.quiet) exit(0);
|
||||
|
||||
if(program.dump) {
|
||||
console.log("Full Paths:");
|
||||
console.log(cfb.FullPaths.map(function(x/*:string*/) { return " " + x; }).join("\n"));
|
||||
console.log("File Index:");
|
||||
console.log(cfb.FileIndex);
|
||||
exit(0);
|
||||
}
|
||||
if(program.repair) { X.writeFile(cfb, program.args[0]); exit(0); }
|
||||
|
||||
function fix_string(x/*:string*/)/*:string*/ { return x.replace(/[\u0000-\u001f]/g, function($$) { return sprintf("\\u%04X", $$.charCodeAt(0)); }); }
|
||||
var format_date = function(date/*:Date*/)/*:string*/ {
|
||||
return sprintf("%02u-%02u-%02u %02u:%02u", date.getUTCMonth()+1, date.getUTCDate(), date.getUTCFullYear()%100, date.getUTCHours(), date.getUTCMinutes());
|
||||
};
|
||||
|
||||
if(program.listFiles) {
|
||||
var basetime = new Date(1980,0,1);
|
||||
var cnt = 0, rootsize = 0, filesize = 0;
|
||||
console.log(" Length Date Time Name");
|
||||
console.log(" -------- ---- ---- ----");
|
||||
cfb.FileIndex.forEach(function(file/*:CFBEntry*/, i/*:number*/) {
|
||||
switch(file.type) {
|
||||
case 5:
|
||||
basetime = file.ct || file.mt || basetime;
|
||||
rootsize = file.size;
|
||||
break;
|
||||
case 2:
|
||||
console.log(sprintf("%9lu %s %s", file.size, format_date(basetime), fix_string(cfb.FullPaths[i])));
|
||||
filesize += file.size;
|
||||
++cnt;
|
||||
}
|
||||
});
|
||||
console.log(" -------- -------");
|
||||
console.log(sprintf("%9lu %lu file%s", rootsize || filesize, cnt, (cnt !== 1 ? "s" : "")));
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
function mkdirp(path/*:string*/) { path.split("/").reduce(function(acc/*:string*/, p/*:string*/) {
|
||||
acc += p + "/";
|
||||
if(!fs.existsSync(acc)) { logit("mkdir", acc); fs.mkdirSync(acc); }
|
||||
return acc;
|
||||
}, ""); }
|
||||
|
||||
function write(path/*:string*/, data/*:CFBEntry*/) {
|
||||
logit("write", fix_string(path));
|
||||
fs.writeFileSync(path, /*::new Buffer((*/data.content/*:: :any))*/ || new Buffer(0));
|
||||
}
|
||||
|
||||
if(program.create || program.append) {
|
||||
program.args.slice(1).forEach(function(x/*:string*/) {
|
||||
logit("append", x);
|
||||
X.utils.cfb_add(cfb, "/" + x, fs.readFileSync(x));
|
||||
});
|
||||
X.writeFile(cfb, program.args[0]);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if(program.delete) {
|
||||
program.args.slice(1).forEach(function(x/*:string*/) {
|
||||
logit("delete", x);
|
||||
X.utils.cfb_del(cfb, "/" + x);
|
||||
});
|
||||
X.writeFile(cfb, program.args[0]);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if(program.args.length > 1) {
|
||||
program.args.slice(1).forEach(function(x/*:string*/) {
|
||||
var data/*:?CFBEntry*/ = X.find(cfb, x.replace(/\\u000\d/g,"!"));
|
||||
if(!data) { console.error(x + ": file not found"); return; }
|
||||
if(data.type !== 2) { console.error(x + ": not a file"); return; }
|
||||
var idx = cfb.FileIndex.indexOf(data), path = cfb.FullPaths[idx];
|
||||
if(program.toStdout) return process.stdout.write(/*::new Buffer((*/data.content/*:: :any))*/);
|
||||
mkdirp(path.slice(0, path.lastIndexOf("/")));
|
||||
write(path, data);
|
||||
});
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if(program.toStdout) exit(0);
|
||||
for(var i=0; i!==cfb.FullPaths.length; ++i) {
|
||||
if(!cfb.FileIndex[i].name) continue;
|
||||
if(cfb.FullPaths[i].slice(-1) === "/") mkdirp(cfb.FullPaths[i]);
|
||||
else write(cfb.FullPaths[i], cfb.FileIndex[i]);
|
||||
}
|
||||
880
node_modules/cfb/cfb.js
generated
vendored
Normal file
880
node_modules/cfb/cfb.js
generated
vendored
Normal file
@@ -0,0 +1,880 @@
|
||||
/* cfb.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/* vim: set ts=2: */
|
||||
/*jshint eqnull:true */
|
||||
/*exported CFB */
|
||||
/*global module, require:false, process:false, Buffer:false, Uint8Array:false */
|
||||
|
||||
var Base64 = (function make_b64(){
|
||||
var map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
return {
|
||||
encode: function(input) {
|
||||
var o = "";
|
||||
var c1=0, c2=0, c3=0, e1=0, e2=0, e3=0, e4=0;
|
||||
for(var i = 0; i < input.length; ) {
|
||||
c1 = input.charCodeAt(i++);
|
||||
e1 = (c1 >> 2);
|
||||
|
||||
c2 = input.charCodeAt(i++);
|
||||
e2 = ((c1 & 3) << 4) | (c2 >> 4);
|
||||
|
||||
c3 = input.charCodeAt(i++);
|
||||
e3 = ((c2 & 15) << 2) | (c3 >> 6);
|
||||
e4 = (c3 & 63);
|
||||
if (isNaN(c2)) { e3 = e4 = 64; }
|
||||
else if (isNaN(c3)) { e4 = 64; }
|
||||
o += map.charAt(e1) + map.charAt(e2) + map.charAt(e3) + map.charAt(e4);
|
||||
}
|
||||
return o;
|
||||
},
|
||||
decode: function b64_decode(input) {
|
||||
var o = "";
|
||||
var c1=0, c2=0, c3=0, e1=0, e2=0, e3=0, e4=0;
|
||||
input = input.replace(/[^\w\+\/\=]/g, "");
|
||||
for(var i = 0; i < input.length;) {
|
||||
e1 = map.indexOf(input.charAt(i++));
|
||||
e2 = map.indexOf(input.charAt(i++));
|
||||
c1 = (e1 << 2) | (e2 >> 4);
|
||||
o += String.fromCharCode(c1);
|
||||
|
||||
e3 = map.indexOf(input.charAt(i++));
|
||||
c2 = ((e2 & 15) << 4) | (e3 >> 2);
|
||||
if (e3 !== 64) { o += String.fromCharCode(c2); }
|
||||
|
||||
e4 = map.indexOf(input.charAt(i++));
|
||||
c3 = ((e3 & 3) << 6) | e4;
|
||||
if (e4 !== 64) { o += String.fromCharCode(c3); }
|
||||
}
|
||||
return o;
|
||||
}
|
||||
};
|
||||
})();
|
||||
var has_buf = (typeof Buffer !== 'undefined' && typeof process !== 'undefined' && typeof process.versions !== 'undefined' && process.versions.node);
|
||||
|
||||
var Buffer_from = function(){};
|
||||
|
||||
if(typeof Buffer !== 'undefined') {
|
||||
var nbfs = !Buffer.from;
|
||||
if(!nbfs) try { Buffer.from("foo", "utf8"); } catch(e) { nbfs = true; }
|
||||
Buffer_from = nbfs ? function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); } : Buffer.from.bind(Buffer);
|
||||
// $FlowIgnore
|
||||
if(!Buffer.alloc) Buffer.alloc = function(n) { return new Buffer(n); };
|
||||
}
|
||||
|
||||
function new_raw_buf(len) {
|
||||
/* jshint -W056 */
|
||||
return has_buf ? Buffer.alloc(len) : new Array(len);
|
||||
/* jshint +W056 */
|
||||
}
|
||||
|
||||
var s2a = function s2a(s) {
|
||||
if(has_buf) return Buffer.from(s, "binary");
|
||||
return s.split("").map(function(x){ return x.charCodeAt(0) & 0xff; });
|
||||
};
|
||||
|
||||
var chr0 = /\u0000/g, chr1 = /[\u0001-\u0006]/g;
|
||||
var __toBuffer = function(bufs) { var x = []; for(var i = 0; i < bufs[0].length; ++i) { x.push.apply(x, bufs[0][i]); } return x; };
|
||||
var ___toBuffer = __toBuffer;
|
||||
var __utf16le = function(b,s,e) { var ss=[]; for(var i=s; i<e; i+=2) ss.push(String.fromCharCode(__readUInt16LE(b,i))); return ss.join("").replace(chr0,''); };
|
||||
var ___utf16le = __utf16le;
|
||||
var __hexlify = function(b,s,l) { var ss=[]; for(var i=s; i<s+l; ++i) ss.push(("0" + b[i].toString(16)).slice(-2)); return ss.join(""); };
|
||||
var ___hexlify = __hexlify;
|
||||
var __bconcat = function(bufs) {
|
||||
if(Array.isArray(bufs[0])) return [].concat.apply([], bufs);
|
||||
var maxlen = 0, i = 0;
|
||||
for(i = 0; i < bufs.length; ++i) maxlen += bufs[i].length;
|
||||
var o = new Uint8Array(maxlen);
|
||||
for(i = 0, maxlen = 0; i < bufs.length; maxlen += bufs[i].length, ++i) o.set(bufs[i], maxlen);
|
||||
return o;
|
||||
};
|
||||
var bconcat = __bconcat;
|
||||
|
||||
|
||||
if(has_buf) {
|
||||
__utf16le = function(b,s,e) {
|
||||
if(!Buffer.isBuffer(b)) return ___utf16le(b,s,e);
|
||||
return b.toString('utf16le',s,e).replace(chr0,'')/*.replace(chr1,'!')*/;
|
||||
};
|
||||
__hexlify = function(b,s,l) { return Buffer.isBuffer(b) ? b.toString('hex',s,s+l) : ___hexlify(b,s,l); };
|
||||
__toBuffer = function(bufs) { return (bufs[0].length > 0 && Buffer.isBuffer(bufs[0][0])) ? Buffer.concat((bufs[0])) : ___toBuffer(bufs);};
|
||||
// $FlowIgnore
|
||||
s2a = function(s) { return Buffer_from(s, "binary"); };
|
||||
bconcat = function(bufs) { return Buffer.isBuffer(bufs[0]) ? Buffer.concat(bufs) : __bconcat(bufs); };
|
||||
}
|
||||
|
||||
|
||||
var __readUInt8 = function(b, idx) { return b[idx]; };
|
||||
var __readUInt16LE = function(b, idx) { return b[idx+1]*(1<<8)+b[idx]; };
|
||||
var __readInt16LE = function(b, idx) { var u = b[idx+1]*(1<<8)+b[idx]; return (u < 0x8000) ? u : (0xffff - u + 1) * -1; };
|
||||
var __readUInt32LE = function(b, idx) { return b[idx+3]*(1<<24)+(b[idx+2]<<16)+(b[idx+1]<<8)+b[idx]; };
|
||||
var __readInt32LE = function(b, idx) { return (b[idx+3]<<24)+(b[idx+2]<<16)+(b[idx+1]<<8)+b[idx]; };
|
||||
|
||||
function ReadShift(size, t) {
|
||||
var oI, oS, type = 0;
|
||||
switch(size) {
|
||||
case 1: oI = __readUInt8(this, this.l); break;
|
||||
case 2: oI = (t !== 'i' ? __readUInt16LE : __readInt16LE)(this, this.l); break;
|
||||
case 4: oI = __readInt32LE(this, this.l); break;
|
||||
case 16: type = 2; oS = __hexlify(this, this.l, size);
|
||||
}
|
||||
this.l += size; if(type === 0) return oI; return oS;
|
||||
}
|
||||
|
||||
var __writeUInt32LE = function(b, val, idx) { b[idx] = (val & 0xFF); b[idx+1] = ((val >>> 8) & 0xFF); b[idx+2] = ((val >>> 16) & 0xFF); b[idx+3] = ((val >>> 24) & 0xFF); };
|
||||
var __writeInt32LE = function(b, val, idx) { b[idx] = (val & 0xFF); b[idx+1] = ((val >> 8) & 0xFF); b[idx+2] = ((val >> 16) & 0xFF); b[idx+3] = ((val >> 24) & 0xFF); };
|
||||
|
||||
function WriteShift(t, val, f) {
|
||||
var size = 0, i = 0;
|
||||
switch(f) {
|
||||
case "hex": for(; i < t; ++i) {
|
||||
this[this.l++] = parseInt(val.slice(2*i, 2*i+2), 16)||0;
|
||||
} return this;
|
||||
case "utf16le":
|
||||
var end = this.l + t;
|
||||
for(i = 0; i < Math.min(val.length, t); ++i) {
|
||||
var cc = val.charCodeAt(i);
|
||||
this[this.l++] = cc & 0xff;
|
||||
this[this.l++] = cc >> 8;
|
||||
}
|
||||
while(this.l < end) this[this.l++] = 0;
|
||||
return this;
|
||||
}
|
||||
switch(t) {
|
||||
case 1: size = 1; this[this.l] = val&0xFF; break;
|
||||
case 2: size = 2; this[this.l] = val&0xFF; val >>>= 8; this[this.l+1] = val&0xFF; break;
|
||||
case 4: size = 4; __writeUInt32LE(this, val, this.l); break;
|
||||
case -4: size = 4; __writeInt32LE(this, val, this.l); break;
|
||||
}
|
||||
this.l += size; return this;
|
||||
}
|
||||
|
||||
function CheckField(hexstr, fld) {
|
||||
var m = __hexlify(this,this.l,hexstr.length>>1);
|
||||
if(m !== hexstr) throw new Error(fld + 'Expected ' + hexstr + ' saw ' + m);
|
||||
this.l += hexstr.length>>1;
|
||||
}
|
||||
|
||||
function prep_blob(blob, pos) {
|
||||
blob.l = pos;
|
||||
blob.read_shift = ReadShift;
|
||||
blob.chk = CheckField;
|
||||
blob.write_shift = WriteShift;
|
||||
}
|
||||
|
||||
function new_buf(sz) {
|
||||
var o = (new_raw_buf(sz));
|
||||
prep_blob(o, 0);
|
||||
return o;
|
||||
}
|
||||
|
||||
/* [MS-CFB] v20171201 */
|
||||
var CFB = (function _CFB(){
|
||||
var exports = {};
|
||||
exports.version = '1.0.8';
|
||||
/* [MS-CFB] 2.6.4 */
|
||||
function namecmp(l, r) {
|
||||
var L = l.split("/"), R = r.split("/");
|
||||
for(var i = 0, c = 0, Z = Math.min(L.length, R.length); i < Z; ++i) {
|
||||
if((c = L[i].length - R[i].length)) return c;
|
||||
if(L[i] != R[i]) return L[i] < R[i] ? -1 : 1;
|
||||
}
|
||||
return L.length - R.length;
|
||||
}
|
||||
function dirname(p) {
|
||||
if(p.charAt(p.length - 1) == "/") return (p.slice(0,-1).indexOf("/") === -1) ? p : dirname(p.slice(0, -1));
|
||||
var c = p.lastIndexOf("/");
|
||||
return (c === -1) ? p : p.slice(0, c+1);
|
||||
}
|
||||
|
||||
function filename(p) {
|
||||
if(p.charAt(p.length - 1) == "/") return filename(p.slice(0, -1));
|
||||
var c = p.lastIndexOf("/");
|
||||
return (c === -1) ? p : p.slice(c+1);
|
||||
}
|
||||
var fs;
|
||||
function get_fs() { return fs || (fs = require('fs')); }
|
||||
function parse(file, options) {
|
||||
if(file.length < 512) throw new Error("CFB file size " + file.length + " < 512");
|
||||
var mver = 3;
|
||||
var ssz = 512;
|
||||
var nmfs = 0; // number of mini FAT sectors
|
||||
var difat_sec_cnt = 0;
|
||||
var dir_start = 0;
|
||||
var minifat_start = 0;
|
||||
var difat_start = 0;
|
||||
|
||||
var fat_addrs = []; // locations of FAT sectors
|
||||
|
||||
/* [MS-CFB] 2.2 Compound File Header */
|
||||
var blob = file.slice(0,512);
|
||||
prep_blob(blob, 0);
|
||||
|
||||
/* major version */
|
||||
var mv = check_get_mver(blob);
|
||||
mver = mv[0];
|
||||
switch(mver) {
|
||||
case 3: ssz = 512; break; case 4: ssz = 4096; break;
|
||||
default: throw new Error("Major Version: Expected 3 or 4 saw " + mver);
|
||||
}
|
||||
|
||||
/* reprocess header */
|
||||
if(ssz !== 512) { blob = file.slice(0,ssz); prep_blob(blob, 28 /* blob.l */); }
|
||||
/* Save header for final object */
|
||||
var header = file.slice(0,ssz);
|
||||
|
||||
check_shifts(blob, mver);
|
||||
|
||||
// Number of Directory Sectors
|
||||
var dir_cnt = blob.read_shift(4, 'i');
|
||||
if(mver === 3 && dir_cnt !== 0) throw new Error('# Directory Sectors: Expected 0 saw ' + dir_cnt);
|
||||
|
||||
// Number of FAT Sectors
|
||||
blob.l += 4;
|
||||
|
||||
// First Directory Sector Location
|
||||
dir_start = blob.read_shift(4, 'i');
|
||||
|
||||
// Transaction Signature
|
||||
blob.l += 4;
|
||||
|
||||
// Mini Stream Cutoff Size
|
||||
blob.chk('00100000', 'Mini Stream Cutoff Size: ');
|
||||
|
||||
// First Mini FAT Sector Location
|
||||
minifat_start = blob.read_shift(4, 'i');
|
||||
|
||||
// Number of Mini FAT Sectors
|
||||
nmfs = blob.read_shift(4, 'i');
|
||||
|
||||
// First DIFAT sector location
|
||||
difat_start = blob.read_shift(4, 'i');
|
||||
|
||||
// Number of DIFAT Sectors
|
||||
difat_sec_cnt = blob.read_shift(4, 'i');
|
||||
|
||||
// Grab FAT Sector Locations
|
||||
for(var q = -1, j = 0; j < 109; ++j) { /* 109 = (512 - blob.l)>>>2; */
|
||||
q = blob.read_shift(4, 'i');
|
||||
if(q<0) break;
|
||||
fat_addrs[j] = q;
|
||||
}
|
||||
|
||||
/** Break the file up into sectors */
|
||||
var sectors = sectorify(file, ssz);
|
||||
|
||||
sleuth_fat(difat_start, difat_sec_cnt, sectors, ssz, fat_addrs);
|
||||
|
||||
/** Chains */
|
||||
var sector_list = make_sector_list(sectors, dir_start, fat_addrs, ssz);
|
||||
|
||||
sector_list[dir_start].name = "!Directory";
|
||||
if(nmfs > 0 && minifat_start !== ENDOFCHAIN) sector_list[minifat_start].name = "!MiniFAT";
|
||||
sector_list[fat_addrs[0]].name = "!FAT";
|
||||
sector_list.fat_addrs = fat_addrs;
|
||||
sector_list.ssz = ssz;
|
||||
|
||||
/* [MS-CFB] 2.6.1 Compound File Directory Entry */
|
||||
var files = {}, Paths = [], FileIndex = [], FullPaths = [];
|
||||
read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, minifat_start);
|
||||
|
||||
build_full_paths(FileIndex, FullPaths, Paths);
|
||||
Paths.shift();
|
||||
|
||||
var o = {
|
||||
FileIndex: FileIndex,
|
||||
FullPaths: FullPaths
|
||||
};
|
||||
|
||||
// $FlowIgnore
|
||||
if(options && options.raw) o.raw = {header: header, sectors: sectors};
|
||||
return o;
|
||||
} // parse
|
||||
|
||||
/* [MS-CFB] 2.2 Compound File Header -- read up to major version */
|
||||
function check_get_mver(blob) {
|
||||
// header signature 8
|
||||
blob.chk(HEADER_SIGNATURE, 'Header Signature: ');
|
||||
|
||||
// clsid 16
|
||||
blob.chk(HEADER_CLSID, 'CLSID: ');
|
||||
|
||||
// minor version 2
|
||||
var mver = blob.read_shift(2, 'u');
|
||||
|
||||
return [blob.read_shift(2,'u'), mver];
|
||||
}
|
||||
function check_shifts(blob, mver) {
|
||||
var shift = 0x09;
|
||||
|
||||
// Byte Order
|
||||
//blob.chk('feff', 'Byte Order: '); // note: some writers put 0xffff
|
||||
blob.l += 2;
|
||||
|
||||
// Sector Shift
|
||||
switch((shift = blob.read_shift(2))) {
|
||||
case 0x09: if(mver != 3) throw new Error('Sector Shift: Expected 9 saw ' + shift); break;
|
||||
case 0x0c: if(mver != 4) throw new Error('Sector Shift: Expected 12 saw ' + shift); break;
|
||||
default: throw new Error('Sector Shift: Expected 9 or 12 saw ' + shift);
|
||||
}
|
||||
|
||||
// Mini Sector Shift
|
||||
blob.chk('0600', 'Mini Sector Shift: ');
|
||||
|
||||
// Reserved
|
||||
blob.chk('000000000000', 'Reserved: ');
|
||||
}
|
||||
|
||||
/** Break the file up into sectors */
|
||||
function sectorify(file, ssz) {
|
||||
var nsectors = Math.ceil(file.length/ssz)-1;
|
||||
var sectors = [];
|
||||
for(var i=1; i < nsectors; ++i) sectors[i-1] = file.slice(i*ssz,(i+1)*ssz);
|
||||
sectors[nsectors-1] = file.slice(nsectors*ssz);
|
||||
return sectors;
|
||||
}
|
||||
|
||||
/* [MS-CFB] 2.6.4 Red-Black Tree */
|
||||
function build_full_paths(FI, FP, Paths) {
|
||||
var i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;
|
||||
var dad = [], q = [];
|
||||
|
||||
for(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }
|
||||
|
||||
for(; j < q.length; ++j) {
|
||||
i = q[j];
|
||||
L = FI[i].L; R = FI[i].R; C = FI[i].C;
|
||||
if(dad[i] === i) {
|
||||
if(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];
|
||||
if(R !== -1 && dad[R] !== R) dad[i] = dad[R];
|
||||
}
|
||||
if(C !== -1 /*NOSTREAM*/) dad[C] = i;
|
||||
if(L !== -1) { dad[L] = dad[i]; if(q.lastIndexOf(L) < j) q.push(L); }
|
||||
if(R !== -1) { dad[R] = dad[i]; if(q.lastIndexOf(R) < j) q.push(R); }
|
||||
}
|
||||
for(i=1; i < pl; ++i) if(dad[i] === i) {
|
||||
if(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];
|
||||
else if(L !== -1 && dad[L] !== L) dad[i] = dad[L];
|
||||
}
|
||||
|
||||
for(i=1; i < pl; ++i) {
|
||||
if(FI[i].type === 0 /* unknown */) continue;
|
||||
j = dad[i];
|
||||
if(j === 0) FP[i] = FP[0] + "/" + FP[i];
|
||||
else while(j !== 0 && j !== dad[j]) {
|
||||
FP[i] = FP[j] + "/" + FP[i];
|
||||
j = dad[j];
|
||||
}
|
||||
dad[i] = 0;
|
||||
}
|
||||
|
||||
FP[0] += "/";
|
||||
for(i=1; i < pl; ++i) {
|
||||
if(FI[i].type !== 2 /* stream */) FP[i] += "/";
|
||||
}
|
||||
}
|
||||
|
||||
function get_mfat_entry(entry, payload, mini) {
|
||||
var start = entry.start, size = entry.size;
|
||||
//return (payload.slice(start*MSSZ, start*MSSZ + size));
|
||||
var o = [];
|
||||
var idx = start;
|
||||
while(mini && size > 0 && idx >= 0) {
|
||||
o.push(payload.slice(idx * MSSZ, idx * MSSZ + MSSZ));
|
||||
size -= MSSZ;
|
||||
idx = __readInt32LE(mini, idx * 4);
|
||||
}
|
||||
if(o.length === 0) return (new_buf(0));
|
||||
return (bconcat(o).slice(0, entry.size));
|
||||
}
|
||||
|
||||
/** Chase down the rest of the DIFAT chain to build a comprehensive list
|
||||
DIFAT chains by storing the next sector number as the last 32 bits */
|
||||
function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {
|
||||
var q = ENDOFCHAIN;
|
||||
if(idx === ENDOFCHAIN) {
|
||||
if(cnt !== 0) throw new Error("DIFAT chain shorter than expected");
|
||||
} else if(idx !== -1 /*FREESECT*/) {
|
||||
var sector = sectors[idx], m = (ssz>>>2)-1;
|
||||
if(!sector) return;
|
||||
for(var i = 0; i < m; ++i) {
|
||||
if((q = __readInt32LE(sector,i*4)) === ENDOFCHAIN) break;
|
||||
fat_addrs.push(q);
|
||||
}
|
||||
sleuth_fat(__readInt32LE(sector,ssz-4),cnt - 1, sectors, ssz, fat_addrs);
|
||||
}
|
||||
}
|
||||
|
||||
/** Follow the linked list of sectors for a given starting point */
|
||||
function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {
|
||||
var buf = [], buf_chain = [];
|
||||
if(!chkd) chkd = [];
|
||||
var modulus = ssz - 1, j = 0, jj = 0;
|
||||
for(j=start; j>=0;) {
|
||||
chkd[j] = true;
|
||||
buf[buf.length] = j;
|
||||
buf_chain.push(sectors[j]);
|
||||
var addr = fat_addrs[Math.floor(j*4/ssz)];
|
||||
jj = ((j*4) & modulus);
|
||||
if(ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 "+ssz);
|
||||
if(!sectors[addr]) break;
|
||||
j = __readInt32LE(sectors[addr], jj);
|
||||
}
|
||||
return {nodes: buf, data:__toBuffer([buf_chain])};
|
||||
}
|
||||
|
||||
/** Chase down the sector linked lists */
|
||||
function make_sector_list(sectors, dir_start, fat_addrs, ssz) {
|
||||
var sl = sectors.length, sector_list = ([]);
|
||||
var chkd = [], buf = [], buf_chain = [];
|
||||
var modulus = ssz - 1, i=0, j=0, k=0, jj=0;
|
||||
for(i=0; i < sl; ++i) {
|
||||
buf = ([]);
|
||||
k = (i + dir_start); if(k >= sl) k-=sl;
|
||||
if(chkd[k]) continue;
|
||||
buf_chain = [];
|
||||
for(j=k; j>=0;) {
|
||||
chkd[j] = true;
|
||||
buf[buf.length] = j;
|
||||
buf_chain.push(sectors[j]);
|
||||
var addr = fat_addrs[Math.floor(j*4/ssz)];
|
||||
jj = ((j*4) & modulus);
|
||||
if(ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 "+ssz);
|
||||
if(!sectors[addr]) break;
|
||||
j = __readInt32LE(sectors[addr], jj);
|
||||
}
|
||||
sector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])});
|
||||
}
|
||||
return sector_list;
|
||||
}
|
||||
|
||||
/* [MS-CFB] 2.6.1 Compound File Directory Entry */
|
||||
function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {
|
||||
var minifat_store = 0, pl = (Paths.length?2:0);
|
||||
var sector = sector_list[dir_start].data;
|
||||
var i = 0, namelen = 0, name;
|
||||
for(; i < sector.length; i+= 128) {
|
||||
var blob = sector.slice(i, i+128);
|
||||
prep_blob(blob, 64);
|
||||
namelen = blob.read_shift(2);
|
||||
name = __utf16le(blob,0,namelen-pl);
|
||||
Paths.push(name);
|
||||
var o = ({
|
||||
name: name,
|
||||
type: blob.read_shift(1),
|
||||
color: blob.read_shift(1),
|
||||
L: blob.read_shift(4, 'i'),
|
||||
R: blob.read_shift(4, 'i'),
|
||||
C: blob.read_shift(4, 'i'),
|
||||
clsid: blob.read_shift(16),
|
||||
state: blob.read_shift(4, 'i'),
|
||||
start: 0,
|
||||
size: 0
|
||||
});
|
||||
var ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);
|
||||
if(ctime !== 0) o.ct = read_date(blob, blob.l-8);
|
||||
var mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);
|
||||
if(mtime !== 0) o.mt = read_date(blob, blob.l-8);
|
||||
o.start = blob.read_shift(4, 'i');
|
||||
o.size = blob.read_shift(4, 'i');
|
||||
if(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = ""; }
|
||||
if(o.type === 5) { /* root */
|
||||
minifat_store = o.start;
|
||||
if(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = "!StreamData";
|
||||
/*minifat_size = o.size;*/
|
||||
} else if(o.size >= 4096 /* MSCSZ */) {
|
||||
o.storage = 'fat';
|
||||
if(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);
|
||||
sector_list[o.start].name = o.name;
|
||||
o.content = (sector_list[o.start].data.slice(0,o.size));
|
||||
} else {
|
||||
o.storage = 'minifat';
|
||||
if(o.size < 0) o.size = 0;
|
||||
else if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {
|
||||
o.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data);
|
||||
}
|
||||
}
|
||||
if(o.content) prep_blob(o.content, 0);
|
||||
files[name] = o;
|
||||
FileIndex.push(o);
|
||||
}
|
||||
}
|
||||
|
||||
function read_date(blob, offset) {
|
||||
return new Date(( ( (__readUInt32LE(blob,offset+4)/1e7)*Math.pow(2,32)+__readUInt32LE(blob,offset)/1e7 ) - 11644473600)*1000);
|
||||
}
|
||||
|
||||
function read_file(filename, options) {
|
||||
get_fs();
|
||||
return parse(fs.readFileSync(filename), options);
|
||||
}
|
||||
|
||||
function read(blob, options) {
|
||||
switch(options && options.type || "base64") {
|
||||
case "file": return read_file(blob, options);
|
||||
case "base64": return parse(s2a(Base64.decode(blob)), options);
|
||||
case "binary": return parse(s2a(blob), options);
|
||||
}
|
||||
return parse(blob, options);
|
||||
}
|
||||
|
||||
function init_cfb(cfb, opts) {
|
||||
var o = opts || {}, root = o.root || "Root Entry";
|
||||
if(!cfb.FullPaths) cfb.FullPaths = [];
|
||||
if(!cfb.FileIndex) cfb.FileIndex = [];
|
||||
if(cfb.FullPaths.length !== cfb.FileIndex.length) throw new Error("inconsistent CFB structure");
|
||||
if(cfb.FullPaths.length === 0) {
|
||||
cfb.FullPaths[0] = root + "/";
|
||||
cfb.FileIndex[0] = ({ name: root, type: 5 });
|
||||
}
|
||||
if(o.CLSID) cfb.FileIndex[0].clsid = o.CLSID;
|
||||
seed_cfb(cfb);
|
||||
}
|
||||
function seed_cfb(cfb) {
|
||||
var nm = "\u0001Sh33tJ5";
|
||||
if(CFB.find(cfb, "/" + nm)) return;
|
||||
var p = new_buf(4); p[0] = 55; p[1] = p[3] = 50; p[2] = 54;
|
||||
cfb.FileIndex.push(({ name: nm, type: 2, content:p, size:4, L:69, R:69, C:69 }));
|
||||
cfb.FullPaths.push(cfb.FullPaths[0] + nm);
|
||||
rebuild_cfb(cfb);
|
||||
}
|
||||
function rebuild_cfb(cfb, f) {
|
||||
init_cfb(cfb);
|
||||
var gc = false, s = false;
|
||||
for(var i = cfb.FullPaths.length - 1; i >= 0; --i) {
|
||||
var _file = cfb.FileIndex[i];
|
||||
switch(_file.type) {
|
||||
case 0:
|
||||
if(s) gc = true;
|
||||
else { cfb.FileIndex.pop(); cfb.FullPaths.pop(); }
|
||||
break;
|
||||
case 1: case 2: case 5:
|
||||
s = true;
|
||||
if(isNaN(_file.R * _file.L * _file.C)) gc = true;
|
||||
if(_file.R > -1 && _file.L > -1 && _file.R == _file.L) gc = true;
|
||||
break;
|
||||
default: gc = true; break;
|
||||
}
|
||||
}
|
||||
if(!gc && !f) return;
|
||||
|
||||
var now = new Date(1987, 1, 19), j = 0;
|
||||
var data = [];
|
||||
for(i = 0; i < cfb.FullPaths.length; ++i) {
|
||||
if(cfb.FileIndex[i].type === 0) continue;
|
||||
data.push([cfb.FullPaths[i], cfb.FileIndex[i]]);
|
||||
}
|
||||
for(i = 0; i < data.length; ++i) {
|
||||
var dad = dirname(data[i][0]);
|
||||
s = false;
|
||||
for(j = 0; j < data.length; ++j) if(data[j][0] === dad) s = true;
|
||||
if(!s) data.push([dad, ({
|
||||
name: filename(dad).replace("/",""),
|
||||
type: 1,
|
||||
clsid: HEADER_CLSID,
|
||||
ct: now, mt: now,
|
||||
content: null
|
||||
})]);
|
||||
}
|
||||
|
||||
data.sort(function(x,y) { return namecmp(x[0], y[0]); });
|
||||
cfb.FullPaths = []; cfb.FileIndex = [];
|
||||
for(i = 0; i < data.length; ++i) { cfb.FullPaths[i] = data[i][0]; cfb.FileIndex[i] = data[i][1]; }
|
||||
for(i = 0; i < data.length; ++i) {
|
||||
var elt = cfb.FileIndex[i];
|
||||
var nm = cfb.FullPaths[i];
|
||||
|
||||
elt.name = filename(nm).replace("/","");
|
||||
elt.L = elt.R = elt.C = -(elt.color = 1);
|
||||
elt.size = elt.content ? elt.content.length : 0;
|
||||
elt.start = 0;
|
||||
elt.clsid = (elt.clsid || HEADER_CLSID);
|
||||
if(i === 0) {
|
||||
elt.C = data.length > 1 ? 1 : -1;
|
||||
elt.size = 0;
|
||||
elt.type = 5;
|
||||
} else if(nm.slice(-1) == "/") {
|
||||
for(j=i+1;j < data.length; ++j) if(dirname(cfb.FullPaths[j])==nm) break;
|
||||
elt.C = j >= data.length ? -1 : j;
|
||||
for(j=i+1;j < data.length; ++j) if(dirname(cfb.FullPaths[j])==dirname(nm)) break;
|
||||
elt.R = j >= data.length ? -1 : j;
|
||||
elt.type = 1;
|
||||
} else {
|
||||
if(dirname(cfb.FullPaths[i+1]||"") == dirname(nm)) elt.R = i + 1;
|
||||
elt.type = 2;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function _write(cfb, options) {
|
||||
var _opts = options || {};
|
||||
rebuild_cfb(cfb);
|
||||
var L = (function(cfb){
|
||||
var mini_size = 0, fat_size = 0;
|
||||
for(var i = 0; i < cfb.FileIndex.length; ++i) {
|
||||
var file = cfb.FileIndex[i];
|
||||
if(!file.content) continue;
|
||||
var flen = file.content.length;
|
||||
if(flen > 0){
|
||||
if(flen < 0x1000) mini_size += (flen + 0x3F) >> 6;
|
||||
else fat_size += (flen + 0x01FF) >> 9;
|
||||
}
|
||||
}
|
||||
var dir_cnt = (cfb.FullPaths.length +3) >> 2;
|
||||
var mini_cnt = (mini_size + 7) >> 3;
|
||||
var mfat_cnt = (mini_size + 0x7F) >> 7;
|
||||
var fat_base = mini_cnt + fat_size + dir_cnt + mfat_cnt;
|
||||
var fat_cnt = (fat_base + 0x7F) >> 7;
|
||||
var difat_cnt = fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt-109)/0x7F);
|
||||
while(((fat_base + fat_cnt + difat_cnt + 0x7F) >> 7) > fat_cnt) difat_cnt = ++fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt-109)/0x7F);
|
||||
var L = [1, difat_cnt, fat_cnt, mfat_cnt, dir_cnt, fat_size, mini_size, 0];
|
||||
cfb.FileIndex[0].size = mini_size << 6;
|
||||
L[7] = (cfb.FileIndex[0].start=L[0]+L[1]+L[2]+L[3]+L[4]+L[5])+((L[6]+7) >> 3);
|
||||
return L;
|
||||
})(cfb);
|
||||
var o = new_buf(L[7] << 9);
|
||||
var i = 0, T = 0;
|
||||
{
|
||||
for(i = 0; i < 8; ++i) o.write_shift(1, HEADER_SIG[i]);
|
||||
for(i = 0; i < 8; ++i) o.write_shift(2, 0);
|
||||
o.write_shift(2, 0x003E);
|
||||
o.write_shift(2, 0x0003);
|
||||
o.write_shift(2, 0xFFFE);
|
||||
o.write_shift(2, 0x0009);
|
||||
o.write_shift(2, 0x0006);
|
||||
for(i = 0; i < 3; ++i) o.write_shift(2, 0);
|
||||
o.write_shift(4, 0);
|
||||
o.write_shift(4, L[2]);
|
||||
o.write_shift(4, L[0] + L[1] + L[2] + L[3] - 1);
|
||||
o.write_shift(4, 0);
|
||||
o.write_shift(4, 1<<12);
|
||||
o.write_shift(4, L[3] ? L[0] + L[1] + L[2] - 1: ENDOFCHAIN);
|
||||
o.write_shift(4, L[3]);
|
||||
o.write_shift(-4, L[1] ? L[0] - 1: ENDOFCHAIN);
|
||||
o.write_shift(4, L[1]);
|
||||
for(i = 0; i < 109; ++i) o.write_shift(-4, i < L[2] ? L[1] + i : -1);
|
||||
}
|
||||
if(L[1]) {
|
||||
for(T = 0; T < L[1]; ++T) {
|
||||
for(; i < 236 + T * 127; ++i) o.write_shift(-4, i < L[2] ? L[1] + i : -1);
|
||||
o.write_shift(-4, T === L[1] - 1 ? ENDOFCHAIN : T + 1);
|
||||
}
|
||||
}
|
||||
var chainit = function(w) {
|
||||
for(T += w; i<T-1; ++i) o.write_shift(-4, i+1);
|
||||
if(w) { ++i; o.write_shift(-4, ENDOFCHAIN); }
|
||||
};
|
||||
T = i = 0;
|
||||
for(T+=L[1]; i<T; ++i) o.write_shift(-4, consts.DIFSECT);
|
||||
for(T+=L[2]; i<T; ++i) o.write_shift(-4, consts.FATSECT);
|
||||
chainit(L[3]);
|
||||
chainit(L[4]);
|
||||
var j = 0, flen = 0;
|
||||
var file = cfb.FileIndex[0];
|
||||
for(; j < cfb.FileIndex.length; ++j) {
|
||||
file = cfb.FileIndex[j];
|
||||
if(!file.content) continue;
|
||||
flen = file.content.length;
|
||||
if(flen < 0x1000) continue;
|
||||
file.start = T;
|
||||
chainit((flen + 0x01FF) >> 9);
|
||||
}
|
||||
chainit((L[6] + 7) >> 3);
|
||||
while(o.l & 0x1FF) o.write_shift(-4, consts.ENDOFCHAIN);
|
||||
T = i = 0;
|
||||
for(j = 0; j < cfb.FileIndex.length; ++j) {
|
||||
file = cfb.FileIndex[j];
|
||||
if(!file.content) continue;
|
||||
flen = file.content.length;
|
||||
if(!flen || flen >= 0x1000) continue;
|
||||
file.start = T;
|
||||
chainit((flen + 0x3F) >> 6);
|
||||
}
|
||||
while(o.l & 0x1FF) o.write_shift(-4, consts.ENDOFCHAIN);
|
||||
for(i = 0; i < L[4]<<2; ++i) {
|
||||
var nm = cfb.FullPaths[i];
|
||||
if(!nm || nm.length === 0) {
|
||||
for(j = 0; j < 17; ++j) o.write_shift(4, 0);
|
||||
for(j = 0; j < 3; ++j) o.write_shift(4, -1);
|
||||
for(j = 0; j < 12; ++j) o.write_shift(4, 0);
|
||||
continue;
|
||||
}
|
||||
file = cfb.FileIndex[i];
|
||||
if(i === 0) file.start = file.size ? file.start - 1 : ENDOFCHAIN;
|
||||
var _nm = (i === 0 && _opts.root) || file.name;
|
||||
flen = 2*(_nm.length+1);
|
||||
o.write_shift(64, _nm, "utf16le");
|
||||
o.write_shift(2, flen);
|
||||
o.write_shift(1, file.type);
|
||||
o.write_shift(1, file.color);
|
||||
o.write_shift(-4, file.L);
|
||||
o.write_shift(-4, file.R);
|
||||
o.write_shift(-4, file.C);
|
||||
if(!file.clsid) for(j = 0; j < 4; ++j) o.write_shift(4, 0);
|
||||
else o.write_shift(16, file.clsid, "hex");
|
||||
o.write_shift(4, file.state || 0);
|
||||
o.write_shift(4, 0); o.write_shift(4, 0);
|
||||
o.write_shift(4, 0); o.write_shift(4, 0);
|
||||
o.write_shift(4, file.start);
|
||||
o.write_shift(4, file.size); o.write_shift(4, 0);
|
||||
}
|
||||
for(i = 1; i < cfb.FileIndex.length; ++i) {
|
||||
file = cfb.FileIndex[i];
|
||||
if(file.size >= 0x1000) {
|
||||
o.l = (file.start+1) << 9;
|
||||
for(j = 0; j < file.size; ++j) o.write_shift(1, file.content[j]);
|
||||
for(; j & 0x1FF; ++j) o.write_shift(1, 0);
|
||||
}
|
||||
}
|
||||
for(i = 1; i < cfb.FileIndex.length; ++i) {
|
||||
file = cfb.FileIndex[i];
|
||||
if(file.size > 0 && file.size < 0x1000) {
|
||||
for(j = 0; j < file.size; ++j) o.write_shift(1, file.content[j]);
|
||||
for(; j & 0x3F; ++j) o.write_shift(1, 0);
|
||||
}
|
||||
}
|
||||
while(o.l < o.length) o.write_shift(1, 0);
|
||||
return o;
|
||||
}
|
||||
/* [MS-CFB] 2.6.4 (Unicode 3.0.1 case conversion) */
|
||||
function find(cfb, path) {
|
||||
var UCFullPaths = cfb.FullPaths.map(function(x) { return x.toUpperCase(); });
|
||||
var UCPaths = UCFullPaths.map(function(x) { var y = x.split("/"); return y[y.length - (x.slice(-1) == "/" ? 2 : 1)]; });
|
||||
var k = false;
|
||||
if(path.charCodeAt(0) === 47 /* "/" */) { k = true; path = UCFullPaths[0].slice(0, -1) + path; }
|
||||
else k = path.indexOf("/") !== -1;
|
||||
var UCPath = path.toUpperCase();
|
||||
var w = k === true ? UCFullPaths.indexOf(UCPath) : UCPaths.indexOf(UCPath);
|
||||
if(w !== -1) return cfb.FileIndex[w];
|
||||
|
||||
var m = !UCPath.match(chr1);
|
||||
UCPath = UCPath.replace(chr0,'');
|
||||
if(m) UCPath = UCPath.replace(chr1,'!');
|
||||
for(w = 0; w < UCFullPaths.length; ++w) {
|
||||
if((m ? UCFullPaths[w].replace(chr1,'!') : UCFullPaths[w]).replace(chr0,'') == UCPath) return cfb.FileIndex[w];
|
||||
if((m ? UCPaths[w].replace(chr1,'!') : UCPaths[w]).replace(chr0,'') == UCPath) return cfb.FileIndex[w];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/** CFB Constants */
|
||||
var MSSZ = 64; /* Mini Sector Size = 1<<6 */
|
||||
//var MSCSZ = 4096; /* Mini Stream Cutoff Size */
|
||||
/* 2.1 Compound File Sector Numbers and Types */
|
||||
var ENDOFCHAIN = -2;
|
||||
/* 2.2 Compound File Header */
|
||||
var HEADER_SIGNATURE = 'd0cf11e0a1b11ae1';
|
||||
var HEADER_SIG = [0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1];
|
||||
var HEADER_CLSID = '00000000000000000000000000000000';
|
||||
var consts = {
|
||||
/* 2.1 Compund File Sector Numbers and Types */
|
||||
MAXREGSECT: -6,
|
||||
DIFSECT: -4,
|
||||
FATSECT: -3,
|
||||
ENDOFCHAIN: ENDOFCHAIN,
|
||||
FREESECT: -1,
|
||||
/* 2.2 Compound File Header */
|
||||
HEADER_SIGNATURE: HEADER_SIGNATURE,
|
||||
HEADER_MINOR_VERSION: '3e00',
|
||||
MAXREGSID: -6,
|
||||
NOSTREAM: -1,
|
||||
HEADER_CLSID: HEADER_CLSID,
|
||||
/* 2.6.1 Compound File Directory Entry */
|
||||
EntryTypes: ['unknown','storage','stream','lockbytes','property','root']
|
||||
};
|
||||
|
||||
function write_file(cfb, filename, options) {
|
||||
get_fs();
|
||||
var o = _write(cfb, options);
|
||||
fs.writeFileSync(filename, o);
|
||||
}
|
||||
|
||||
function a2s(o) {
|
||||
var out = new Array(o.length);
|
||||
for(var i = 0; i < o.length; ++i) out[i] = String.fromCharCode(o[i]);
|
||||
return out.join("");
|
||||
}
|
||||
|
||||
function write(cfb, options) {
|
||||
var o = _write(cfb, options);
|
||||
switch(options && options.type) {
|
||||
case "file": get_fs(); fs.writeFileSync(options.filename, (o)); return o;
|
||||
case "binary": return a2s(o);
|
||||
case "base64": return Base64.encode(a2s(o));
|
||||
}
|
||||
return o;
|
||||
}
|
||||
function cfb_new(opts) {
|
||||
var o = ({});
|
||||
init_cfb(o, opts);
|
||||
return o;
|
||||
}
|
||||
|
||||
function cfb_add(cfb, name, content, opts) {
|
||||
var unsafe = opts && opts.unsafe;
|
||||
if(!unsafe) init_cfb(cfb);
|
||||
var file = !unsafe && CFB.find(cfb, name);
|
||||
if(!file) {
|
||||
var fpath = cfb.FullPaths[0];
|
||||
if(name.slice(0, fpath.length) == fpath) fpath = name;
|
||||
else {
|
||||
if(fpath.slice(-1) != "/") fpath += "/";
|
||||
fpath = (fpath + name).replace("//","/");
|
||||
}
|
||||
file = ({name: filename(name), type: 2});
|
||||
cfb.FileIndex.push(file);
|
||||
cfb.FullPaths.push(fpath);
|
||||
if(!unsafe) CFB.utils.cfb_gc(cfb);
|
||||
}
|
||||
file.content = (content);
|
||||
file.size = content ? content.length : 0;
|
||||
if(opts) {
|
||||
if(opts.CLSID) file.clsid = opts.CLSID;
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
function cfb_del(cfb, name) {
|
||||
init_cfb(cfb);
|
||||
var file = CFB.find(cfb, name);
|
||||
if(file) for(var j = 0; j < cfb.FileIndex.length; ++j) if(cfb.FileIndex[j] == file) {
|
||||
cfb.FileIndex.splice(j, 1);
|
||||
cfb.FullPaths.splice(j, 1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function cfb_mov(cfb, old_name, new_name) {
|
||||
init_cfb(cfb);
|
||||
var file = CFB.find(cfb, old_name);
|
||||
if(file) for(var j = 0; j < cfb.FileIndex.length; ++j) if(cfb.FileIndex[j] == file) {
|
||||
cfb.FileIndex[j].name = filename(new_name);
|
||||
cfb.FullPaths[j] = new_name;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function cfb_gc(cfb) { rebuild_cfb(cfb, true); }
|
||||
|
||||
exports.find = find;
|
||||
exports.read = read;
|
||||
exports.parse = parse;
|
||||
exports.write = write;
|
||||
exports.writeFile = write_file;
|
||||
exports.utils = {
|
||||
cfb_new: cfb_new,
|
||||
cfb_add: cfb_add,
|
||||
cfb_del: cfb_del,
|
||||
cfb_mov: cfb_mov,
|
||||
cfb_gc: cfb_gc,
|
||||
ReadShift: ReadShift,
|
||||
CheckField: CheckField,
|
||||
prep_blob: prep_blob,
|
||||
bconcat: bconcat,
|
||||
consts: consts
|
||||
};
|
||||
|
||||
return exports;
|
||||
})();
|
||||
|
||||
if(typeof require !== 'undefined' && typeof module !== 'undefined' && typeof DO_NOT_EXPORT_CFB === 'undefined') { module.exports = CFB; }
|
||||
13
node_modules/cfb/dist/LICENSE
generated
vendored
Normal file
13
node_modules/cfb/dist/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
Copyright (C) 2013-present SheetJS
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
880
node_modules/cfb/dist/cfb.js
generated
vendored
Normal file
880
node_modules/cfb/dist/cfb.js
generated
vendored
Normal file
@@ -0,0 +1,880 @@
|
||||
/* cfb.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/* vim: set ts=2: */
|
||||
/*jshint eqnull:true */
|
||||
/*exported CFB */
|
||||
/*global module, require:false, process:false, Buffer:false, Uint8Array:false */
|
||||
|
||||
var Base64 = (function make_b64(){
|
||||
var map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
return {
|
||||
encode: function(input) {
|
||||
var o = "";
|
||||
var c1=0, c2=0, c3=0, e1=0, e2=0, e3=0, e4=0;
|
||||
for(var i = 0; i < input.length; ) {
|
||||
c1 = input.charCodeAt(i++);
|
||||
e1 = (c1 >> 2);
|
||||
|
||||
c2 = input.charCodeAt(i++);
|
||||
e2 = ((c1 & 3) << 4) | (c2 >> 4);
|
||||
|
||||
c3 = input.charCodeAt(i++);
|
||||
e3 = ((c2 & 15) << 2) | (c3 >> 6);
|
||||
e4 = (c3 & 63);
|
||||
if (isNaN(c2)) { e3 = e4 = 64; }
|
||||
else if (isNaN(c3)) { e4 = 64; }
|
||||
o += map.charAt(e1) + map.charAt(e2) + map.charAt(e3) + map.charAt(e4);
|
||||
}
|
||||
return o;
|
||||
},
|
||||
decode: function b64_decode(input) {
|
||||
var o = "";
|
||||
var c1=0, c2=0, c3=0, e1=0, e2=0, e3=0, e4=0;
|
||||
input = input.replace(/[^\w\+\/\=]/g, "");
|
||||
for(var i = 0; i < input.length;) {
|
||||
e1 = map.indexOf(input.charAt(i++));
|
||||
e2 = map.indexOf(input.charAt(i++));
|
||||
c1 = (e1 << 2) | (e2 >> 4);
|
||||
o += String.fromCharCode(c1);
|
||||
|
||||
e3 = map.indexOf(input.charAt(i++));
|
||||
c2 = ((e2 & 15) << 4) | (e3 >> 2);
|
||||
if (e3 !== 64) { o += String.fromCharCode(c2); }
|
||||
|
||||
e4 = map.indexOf(input.charAt(i++));
|
||||
c3 = ((e3 & 3) << 6) | e4;
|
||||
if (e4 !== 64) { o += String.fromCharCode(c3); }
|
||||
}
|
||||
return o;
|
||||
}
|
||||
};
|
||||
})();
|
||||
var has_buf = (typeof Buffer !== 'undefined' && typeof process !== 'undefined' && typeof process.versions !== 'undefined' && process.versions.node);
|
||||
|
||||
var Buffer_from = function(){};
|
||||
|
||||
if(typeof Buffer !== 'undefined') {
|
||||
var nbfs = !Buffer.from;
|
||||
if(!nbfs) try { Buffer.from("foo", "utf8"); } catch(e) { nbfs = true; }
|
||||
Buffer_from = nbfs ? function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); } : Buffer.from.bind(Buffer);
|
||||
// $FlowIgnore
|
||||
if(!Buffer.alloc) Buffer.alloc = function(n) { return new Buffer(n); };
|
||||
}
|
||||
|
||||
function new_raw_buf(len) {
|
||||
/* jshint -W056 */
|
||||
return has_buf ? Buffer.alloc(len) : new Array(len);
|
||||
/* jshint +W056 */
|
||||
}
|
||||
|
||||
var s2a = function s2a(s) {
|
||||
if(has_buf) return Buffer.from(s, "binary");
|
||||
return s.split("").map(function(x){ return x.charCodeAt(0) & 0xff; });
|
||||
};
|
||||
|
||||
var chr0 = /\u0000/g, chr1 = /[\u0001-\u0006]/g;
|
||||
var __toBuffer = function(bufs) { var x = []; for(var i = 0; i < bufs[0].length; ++i) { x.push.apply(x, bufs[0][i]); } return x; };
|
||||
var ___toBuffer = __toBuffer;
|
||||
var __utf16le = function(b,s,e) { var ss=[]; for(var i=s; i<e; i+=2) ss.push(String.fromCharCode(__readUInt16LE(b,i))); return ss.join("").replace(chr0,''); };
|
||||
var ___utf16le = __utf16le;
|
||||
var __hexlify = function(b,s,l) { var ss=[]; for(var i=s; i<s+l; ++i) ss.push(("0" + b[i].toString(16)).slice(-2)); return ss.join(""); };
|
||||
var ___hexlify = __hexlify;
|
||||
var __bconcat = function(bufs) {
|
||||
if(Array.isArray(bufs[0])) return [].concat.apply([], bufs);
|
||||
var maxlen = 0, i = 0;
|
||||
for(i = 0; i < bufs.length; ++i) maxlen += bufs[i].length;
|
||||
var o = new Uint8Array(maxlen);
|
||||
for(i = 0, maxlen = 0; i < bufs.length; maxlen += bufs[i].length, ++i) o.set(bufs[i], maxlen);
|
||||
return o;
|
||||
};
|
||||
var bconcat = __bconcat;
|
||||
|
||||
|
||||
if(has_buf) {
|
||||
__utf16le = function(b,s,e) {
|
||||
if(!Buffer.isBuffer(b)) return ___utf16le(b,s,e);
|
||||
return b.toString('utf16le',s,e).replace(chr0,'')/*.replace(chr1,'!')*/;
|
||||
};
|
||||
__hexlify = function(b,s,l) { return Buffer.isBuffer(b) ? b.toString('hex',s,s+l) : ___hexlify(b,s,l); };
|
||||
__toBuffer = function(bufs) { return (bufs[0].length > 0 && Buffer.isBuffer(bufs[0][0])) ? Buffer.concat((bufs[0])) : ___toBuffer(bufs);};
|
||||
// $FlowIgnore
|
||||
s2a = function(s) { return Buffer_from(s, "binary"); };
|
||||
bconcat = function(bufs) { return Buffer.isBuffer(bufs[0]) ? Buffer.concat(bufs) : __bconcat(bufs); };
|
||||
}
|
||||
|
||||
|
||||
var __readUInt8 = function(b, idx) { return b[idx]; };
|
||||
var __readUInt16LE = function(b, idx) { return b[idx+1]*(1<<8)+b[idx]; };
|
||||
var __readInt16LE = function(b, idx) { var u = b[idx+1]*(1<<8)+b[idx]; return (u < 0x8000) ? u : (0xffff - u + 1) * -1; };
|
||||
var __readUInt32LE = function(b, idx) { return b[idx+3]*(1<<24)+(b[idx+2]<<16)+(b[idx+1]<<8)+b[idx]; };
|
||||
var __readInt32LE = function(b, idx) { return (b[idx+3]<<24)+(b[idx+2]<<16)+(b[idx+1]<<8)+b[idx]; };
|
||||
|
||||
function ReadShift(size, t) {
|
||||
var oI, oS, type = 0;
|
||||
switch(size) {
|
||||
case 1: oI = __readUInt8(this, this.l); break;
|
||||
case 2: oI = (t !== 'i' ? __readUInt16LE : __readInt16LE)(this, this.l); break;
|
||||
case 4: oI = __readInt32LE(this, this.l); break;
|
||||
case 16: type = 2; oS = __hexlify(this, this.l, size);
|
||||
}
|
||||
this.l += size; if(type === 0) return oI; return oS;
|
||||
}
|
||||
|
||||
var __writeUInt32LE = function(b, val, idx) { b[idx] = (val & 0xFF); b[idx+1] = ((val >>> 8) & 0xFF); b[idx+2] = ((val >>> 16) & 0xFF); b[idx+3] = ((val >>> 24) & 0xFF); };
|
||||
var __writeInt32LE = function(b, val, idx) { b[idx] = (val & 0xFF); b[idx+1] = ((val >> 8) & 0xFF); b[idx+2] = ((val >> 16) & 0xFF); b[idx+3] = ((val >> 24) & 0xFF); };
|
||||
|
||||
function WriteShift(t, val, f) {
|
||||
var size = 0, i = 0;
|
||||
switch(f) {
|
||||
case "hex": for(; i < t; ++i) {
|
||||
this[this.l++] = parseInt(val.slice(2*i, 2*i+2), 16)||0;
|
||||
} return this;
|
||||
case "utf16le":
|
||||
var end = this.l + t;
|
||||
for(i = 0; i < Math.min(val.length, t); ++i) {
|
||||
var cc = val.charCodeAt(i);
|
||||
this[this.l++] = cc & 0xff;
|
||||
this[this.l++] = cc >> 8;
|
||||
}
|
||||
while(this.l < end) this[this.l++] = 0;
|
||||
return this;
|
||||
}
|
||||
switch(t) {
|
||||
case 1: size = 1; this[this.l] = val&0xFF; break;
|
||||
case 2: size = 2; this[this.l] = val&0xFF; val >>>= 8; this[this.l+1] = val&0xFF; break;
|
||||
case 4: size = 4; __writeUInt32LE(this, val, this.l); break;
|
||||
case -4: size = 4; __writeInt32LE(this, val, this.l); break;
|
||||
}
|
||||
this.l += size; return this;
|
||||
}
|
||||
|
||||
function CheckField(hexstr, fld) {
|
||||
var m = __hexlify(this,this.l,hexstr.length>>1);
|
||||
if(m !== hexstr) throw new Error(fld + 'Expected ' + hexstr + ' saw ' + m);
|
||||
this.l += hexstr.length>>1;
|
||||
}
|
||||
|
||||
function prep_blob(blob, pos) {
|
||||
blob.l = pos;
|
||||
blob.read_shift = ReadShift;
|
||||
blob.chk = CheckField;
|
||||
blob.write_shift = WriteShift;
|
||||
}
|
||||
|
||||
function new_buf(sz) {
|
||||
var o = (new_raw_buf(sz));
|
||||
prep_blob(o, 0);
|
||||
return o;
|
||||
}
|
||||
|
||||
/* [MS-CFB] v20171201 */
|
||||
var CFB = (function _CFB(){
|
||||
var exports = {};
|
||||
exports.version = '1.0.8';
|
||||
/* [MS-CFB] 2.6.4 */
|
||||
function namecmp(l, r) {
|
||||
var L = l.split("/"), R = r.split("/");
|
||||
for(var i = 0, c = 0, Z = Math.min(L.length, R.length); i < Z; ++i) {
|
||||
if((c = L[i].length - R[i].length)) return c;
|
||||
if(L[i] != R[i]) return L[i] < R[i] ? -1 : 1;
|
||||
}
|
||||
return L.length - R.length;
|
||||
}
|
||||
function dirname(p) {
|
||||
if(p.charAt(p.length - 1) == "/") return (p.slice(0,-1).indexOf("/") === -1) ? p : dirname(p.slice(0, -1));
|
||||
var c = p.lastIndexOf("/");
|
||||
return (c === -1) ? p : p.slice(0, c+1);
|
||||
}
|
||||
|
||||
function filename(p) {
|
||||
if(p.charAt(p.length - 1) == "/") return filename(p.slice(0, -1));
|
||||
var c = p.lastIndexOf("/");
|
||||
return (c === -1) ? p : p.slice(c+1);
|
||||
}
|
||||
var fs;
|
||||
function get_fs() { return fs || (fs = require('fs')); }
|
||||
function parse(file, options) {
|
||||
if(file.length < 512) throw new Error("CFB file size " + file.length + " < 512");
|
||||
var mver = 3;
|
||||
var ssz = 512;
|
||||
var nmfs = 0; // number of mini FAT sectors
|
||||
var difat_sec_cnt = 0;
|
||||
var dir_start = 0;
|
||||
var minifat_start = 0;
|
||||
var difat_start = 0;
|
||||
|
||||
var fat_addrs = []; // locations of FAT sectors
|
||||
|
||||
/* [MS-CFB] 2.2 Compound File Header */
|
||||
var blob = file.slice(0,512);
|
||||
prep_blob(blob, 0);
|
||||
|
||||
/* major version */
|
||||
var mv = check_get_mver(blob);
|
||||
mver = mv[0];
|
||||
switch(mver) {
|
||||
case 3: ssz = 512; break; case 4: ssz = 4096; break;
|
||||
default: throw new Error("Major Version: Expected 3 or 4 saw " + mver);
|
||||
}
|
||||
|
||||
/* reprocess header */
|
||||
if(ssz !== 512) { blob = file.slice(0,ssz); prep_blob(blob, 28 /* blob.l */); }
|
||||
/* Save header for final object */
|
||||
var header = file.slice(0,ssz);
|
||||
|
||||
check_shifts(blob, mver);
|
||||
|
||||
// Number of Directory Sectors
|
||||
var dir_cnt = blob.read_shift(4, 'i');
|
||||
if(mver === 3 && dir_cnt !== 0) throw new Error('# Directory Sectors: Expected 0 saw ' + dir_cnt);
|
||||
|
||||
// Number of FAT Sectors
|
||||
blob.l += 4;
|
||||
|
||||
// First Directory Sector Location
|
||||
dir_start = blob.read_shift(4, 'i');
|
||||
|
||||
// Transaction Signature
|
||||
blob.l += 4;
|
||||
|
||||
// Mini Stream Cutoff Size
|
||||
blob.chk('00100000', 'Mini Stream Cutoff Size: ');
|
||||
|
||||
// First Mini FAT Sector Location
|
||||
minifat_start = blob.read_shift(4, 'i');
|
||||
|
||||
// Number of Mini FAT Sectors
|
||||
nmfs = blob.read_shift(4, 'i');
|
||||
|
||||
// First DIFAT sector location
|
||||
difat_start = blob.read_shift(4, 'i');
|
||||
|
||||
// Number of DIFAT Sectors
|
||||
difat_sec_cnt = blob.read_shift(4, 'i');
|
||||
|
||||
// Grab FAT Sector Locations
|
||||
for(var q = -1, j = 0; j < 109; ++j) { /* 109 = (512 - blob.l)>>>2; */
|
||||
q = blob.read_shift(4, 'i');
|
||||
if(q<0) break;
|
||||
fat_addrs[j] = q;
|
||||
}
|
||||
|
||||
/** Break the file up into sectors */
|
||||
var sectors = sectorify(file, ssz);
|
||||
|
||||
sleuth_fat(difat_start, difat_sec_cnt, sectors, ssz, fat_addrs);
|
||||
|
||||
/** Chains */
|
||||
var sector_list = make_sector_list(sectors, dir_start, fat_addrs, ssz);
|
||||
|
||||
sector_list[dir_start].name = "!Directory";
|
||||
if(nmfs > 0 && minifat_start !== ENDOFCHAIN) sector_list[minifat_start].name = "!MiniFAT";
|
||||
sector_list[fat_addrs[0]].name = "!FAT";
|
||||
sector_list.fat_addrs = fat_addrs;
|
||||
sector_list.ssz = ssz;
|
||||
|
||||
/* [MS-CFB] 2.6.1 Compound File Directory Entry */
|
||||
var files = {}, Paths = [], FileIndex = [], FullPaths = [];
|
||||
read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, minifat_start);
|
||||
|
||||
build_full_paths(FileIndex, FullPaths, Paths);
|
||||
Paths.shift();
|
||||
|
||||
var o = {
|
||||
FileIndex: FileIndex,
|
||||
FullPaths: FullPaths
|
||||
};
|
||||
|
||||
// $FlowIgnore
|
||||
if(options && options.raw) o.raw = {header: header, sectors: sectors};
|
||||
return o;
|
||||
} // parse
|
||||
|
||||
/* [MS-CFB] 2.2 Compound File Header -- read up to major version */
|
||||
function check_get_mver(blob) {
|
||||
// header signature 8
|
||||
blob.chk(HEADER_SIGNATURE, 'Header Signature: ');
|
||||
|
||||
// clsid 16
|
||||
blob.chk(HEADER_CLSID, 'CLSID: ');
|
||||
|
||||
// minor version 2
|
||||
var mver = blob.read_shift(2, 'u');
|
||||
|
||||
return [blob.read_shift(2,'u'), mver];
|
||||
}
|
||||
function check_shifts(blob, mver) {
|
||||
var shift = 0x09;
|
||||
|
||||
// Byte Order
|
||||
//blob.chk('feff', 'Byte Order: '); // note: some writers put 0xffff
|
||||
blob.l += 2;
|
||||
|
||||
// Sector Shift
|
||||
switch((shift = blob.read_shift(2))) {
|
||||
case 0x09: if(mver != 3) throw new Error('Sector Shift: Expected 9 saw ' + shift); break;
|
||||
case 0x0c: if(mver != 4) throw new Error('Sector Shift: Expected 12 saw ' + shift); break;
|
||||
default: throw new Error('Sector Shift: Expected 9 or 12 saw ' + shift);
|
||||
}
|
||||
|
||||
// Mini Sector Shift
|
||||
blob.chk('0600', 'Mini Sector Shift: ');
|
||||
|
||||
// Reserved
|
||||
blob.chk('000000000000', 'Reserved: ');
|
||||
}
|
||||
|
||||
/** Break the file up into sectors */
|
||||
function sectorify(file, ssz) {
|
||||
var nsectors = Math.ceil(file.length/ssz)-1;
|
||||
var sectors = [];
|
||||
for(var i=1; i < nsectors; ++i) sectors[i-1] = file.slice(i*ssz,(i+1)*ssz);
|
||||
sectors[nsectors-1] = file.slice(nsectors*ssz);
|
||||
return sectors;
|
||||
}
|
||||
|
||||
/* [MS-CFB] 2.6.4 Red-Black Tree */
|
||||
function build_full_paths(FI, FP, Paths) {
|
||||
var i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;
|
||||
var dad = [], q = [];
|
||||
|
||||
for(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }
|
||||
|
||||
for(; j < q.length; ++j) {
|
||||
i = q[j];
|
||||
L = FI[i].L; R = FI[i].R; C = FI[i].C;
|
||||
if(dad[i] === i) {
|
||||
if(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];
|
||||
if(R !== -1 && dad[R] !== R) dad[i] = dad[R];
|
||||
}
|
||||
if(C !== -1 /*NOSTREAM*/) dad[C] = i;
|
||||
if(L !== -1) { dad[L] = dad[i]; if(q.lastIndexOf(L) < j) q.push(L); }
|
||||
if(R !== -1) { dad[R] = dad[i]; if(q.lastIndexOf(R) < j) q.push(R); }
|
||||
}
|
||||
for(i=1; i < pl; ++i) if(dad[i] === i) {
|
||||
if(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];
|
||||
else if(L !== -1 && dad[L] !== L) dad[i] = dad[L];
|
||||
}
|
||||
|
||||
for(i=1; i < pl; ++i) {
|
||||
if(FI[i].type === 0 /* unknown */) continue;
|
||||
j = dad[i];
|
||||
if(j === 0) FP[i] = FP[0] + "/" + FP[i];
|
||||
else while(j !== 0 && j !== dad[j]) {
|
||||
FP[i] = FP[j] + "/" + FP[i];
|
||||
j = dad[j];
|
||||
}
|
||||
dad[i] = 0;
|
||||
}
|
||||
|
||||
FP[0] += "/";
|
||||
for(i=1; i < pl; ++i) {
|
||||
if(FI[i].type !== 2 /* stream */) FP[i] += "/";
|
||||
}
|
||||
}
|
||||
|
||||
function get_mfat_entry(entry, payload, mini) {
|
||||
var start = entry.start, size = entry.size;
|
||||
//return (payload.slice(start*MSSZ, start*MSSZ + size));
|
||||
var o = [];
|
||||
var idx = start;
|
||||
while(mini && size > 0 && idx >= 0) {
|
||||
o.push(payload.slice(idx * MSSZ, idx * MSSZ + MSSZ));
|
||||
size -= MSSZ;
|
||||
idx = __readInt32LE(mini, idx * 4);
|
||||
}
|
||||
if(o.length === 0) return (new_buf(0));
|
||||
return (bconcat(o).slice(0, entry.size));
|
||||
}
|
||||
|
||||
/** Chase down the rest of the DIFAT chain to build a comprehensive list
|
||||
DIFAT chains by storing the next sector number as the last 32 bits */
|
||||
function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {
|
||||
var q = ENDOFCHAIN;
|
||||
if(idx === ENDOFCHAIN) {
|
||||
if(cnt !== 0) throw new Error("DIFAT chain shorter than expected");
|
||||
} else if(idx !== -1 /*FREESECT*/) {
|
||||
var sector = sectors[idx], m = (ssz>>>2)-1;
|
||||
if(!sector) return;
|
||||
for(var i = 0; i < m; ++i) {
|
||||
if((q = __readInt32LE(sector,i*4)) === ENDOFCHAIN) break;
|
||||
fat_addrs.push(q);
|
||||
}
|
||||
sleuth_fat(__readInt32LE(sector,ssz-4),cnt - 1, sectors, ssz, fat_addrs);
|
||||
}
|
||||
}
|
||||
|
||||
/** Follow the linked list of sectors for a given starting point */
|
||||
function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {
|
||||
var buf = [], buf_chain = [];
|
||||
if(!chkd) chkd = [];
|
||||
var modulus = ssz - 1, j = 0, jj = 0;
|
||||
for(j=start; j>=0;) {
|
||||
chkd[j] = true;
|
||||
buf[buf.length] = j;
|
||||
buf_chain.push(sectors[j]);
|
||||
var addr = fat_addrs[Math.floor(j*4/ssz)];
|
||||
jj = ((j*4) & modulus);
|
||||
if(ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 "+ssz);
|
||||
if(!sectors[addr]) break;
|
||||
j = __readInt32LE(sectors[addr], jj);
|
||||
}
|
||||
return {nodes: buf, data:__toBuffer([buf_chain])};
|
||||
}
|
||||
|
||||
/** Chase down the sector linked lists */
|
||||
function make_sector_list(sectors, dir_start, fat_addrs, ssz) {
|
||||
var sl = sectors.length, sector_list = ([]);
|
||||
var chkd = [], buf = [], buf_chain = [];
|
||||
var modulus = ssz - 1, i=0, j=0, k=0, jj=0;
|
||||
for(i=0; i < sl; ++i) {
|
||||
buf = ([]);
|
||||
k = (i + dir_start); if(k >= sl) k-=sl;
|
||||
if(chkd[k]) continue;
|
||||
buf_chain = [];
|
||||
for(j=k; j>=0;) {
|
||||
chkd[j] = true;
|
||||
buf[buf.length] = j;
|
||||
buf_chain.push(sectors[j]);
|
||||
var addr = fat_addrs[Math.floor(j*4/ssz)];
|
||||
jj = ((j*4) & modulus);
|
||||
if(ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 "+ssz);
|
||||
if(!sectors[addr]) break;
|
||||
j = __readInt32LE(sectors[addr], jj);
|
||||
}
|
||||
sector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])});
|
||||
}
|
||||
return sector_list;
|
||||
}
|
||||
|
||||
/* [MS-CFB] 2.6.1 Compound File Directory Entry */
|
||||
function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {
|
||||
var minifat_store = 0, pl = (Paths.length?2:0);
|
||||
var sector = sector_list[dir_start].data;
|
||||
var i = 0, namelen = 0, name;
|
||||
for(; i < sector.length; i+= 128) {
|
||||
var blob = sector.slice(i, i+128);
|
||||
prep_blob(blob, 64);
|
||||
namelen = blob.read_shift(2);
|
||||
name = __utf16le(blob,0,namelen-pl);
|
||||
Paths.push(name);
|
||||
var o = ({
|
||||
name: name,
|
||||
type: blob.read_shift(1),
|
||||
color: blob.read_shift(1),
|
||||
L: blob.read_shift(4, 'i'),
|
||||
R: blob.read_shift(4, 'i'),
|
||||
C: blob.read_shift(4, 'i'),
|
||||
clsid: blob.read_shift(16),
|
||||
state: blob.read_shift(4, 'i'),
|
||||
start: 0,
|
||||
size: 0
|
||||
});
|
||||
var ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);
|
||||
if(ctime !== 0) o.ct = read_date(blob, blob.l-8);
|
||||
var mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);
|
||||
if(mtime !== 0) o.mt = read_date(blob, blob.l-8);
|
||||
o.start = blob.read_shift(4, 'i');
|
||||
o.size = blob.read_shift(4, 'i');
|
||||
if(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = ""; }
|
||||
if(o.type === 5) { /* root */
|
||||
minifat_store = o.start;
|
||||
if(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = "!StreamData";
|
||||
/*minifat_size = o.size;*/
|
||||
} else if(o.size >= 4096 /* MSCSZ */) {
|
||||
o.storage = 'fat';
|
||||
if(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);
|
||||
sector_list[o.start].name = o.name;
|
||||
o.content = (sector_list[o.start].data.slice(0,o.size));
|
||||
} else {
|
||||
o.storage = 'minifat';
|
||||
if(o.size < 0) o.size = 0;
|
||||
else if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {
|
||||
o.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data);
|
||||
}
|
||||
}
|
||||
if(o.content) prep_blob(o.content, 0);
|
||||
files[name] = o;
|
||||
FileIndex.push(o);
|
||||
}
|
||||
}
|
||||
|
||||
function read_date(blob, offset) {
|
||||
return new Date(( ( (__readUInt32LE(blob,offset+4)/1e7)*Math.pow(2,32)+__readUInt32LE(blob,offset)/1e7 ) - 11644473600)*1000);
|
||||
}
|
||||
|
||||
function read_file(filename, options) {
|
||||
get_fs();
|
||||
return parse(fs.readFileSync(filename), options);
|
||||
}
|
||||
|
||||
function read(blob, options) {
|
||||
switch(options && options.type || "base64") {
|
||||
case "file": return read_file(blob, options);
|
||||
case "base64": return parse(s2a(Base64.decode(blob)), options);
|
||||
case "binary": return parse(s2a(blob), options);
|
||||
}
|
||||
return parse(blob, options);
|
||||
}
|
||||
|
||||
function init_cfb(cfb, opts) {
|
||||
var o = opts || {}, root = o.root || "Root Entry";
|
||||
if(!cfb.FullPaths) cfb.FullPaths = [];
|
||||
if(!cfb.FileIndex) cfb.FileIndex = [];
|
||||
if(cfb.FullPaths.length !== cfb.FileIndex.length) throw new Error("inconsistent CFB structure");
|
||||
if(cfb.FullPaths.length === 0) {
|
||||
cfb.FullPaths[0] = root + "/";
|
||||
cfb.FileIndex[0] = ({ name: root, type: 5 });
|
||||
}
|
||||
if(o.CLSID) cfb.FileIndex[0].clsid = o.CLSID;
|
||||
seed_cfb(cfb);
|
||||
}
|
||||
function seed_cfb(cfb) {
|
||||
var nm = "\u0001Sh33tJ5";
|
||||
if(CFB.find(cfb, "/" + nm)) return;
|
||||
var p = new_buf(4); p[0] = 55; p[1] = p[3] = 50; p[2] = 54;
|
||||
cfb.FileIndex.push(({ name: nm, type: 2, content:p, size:4, L:69, R:69, C:69 }));
|
||||
cfb.FullPaths.push(cfb.FullPaths[0] + nm);
|
||||
rebuild_cfb(cfb);
|
||||
}
|
||||
function rebuild_cfb(cfb, f) {
|
||||
init_cfb(cfb);
|
||||
var gc = false, s = false;
|
||||
for(var i = cfb.FullPaths.length - 1; i >= 0; --i) {
|
||||
var _file = cfb.FileIndex[i];
|
||||
switch(_file.type) {
|
||||
case 0:
|
||||
if(s) gc = true;
|
||||
else { cfb.FileIndex.pop(); cfb.FullPaths.pop(); }
|
||||
break;
|
||||
case 1: case 2: case 5:
|
||||
s = true;
|
||||
if(isNaN(_file.R * _file.L * _file.C)) gc = true;
|
||||
if(_file.R > -1 && _file.L > -1 && _file.R == _file.L) gc = true;
|
||||
break;
|
||||
default: gc = true; break;
|
||||
}
|
||||
}
|
||||
if(!gc && !f) return;
|
||||
|
||||
var now = new Date(1987, 1, 19), j = 0;
|
||||
var data = [];
|
||||
for(i = 0; i < cfb.FullPaths.length; ++i) {
|
||||
if(cfb.FileIndex[i].type === 0) continue;
|
||||
data.push([cfb.FullPaths[i], cfb.FileIndex[i]]);
|
||||
}
|
||||
for(i = 0; i < data.length; ++i) {
|
||||
var dad = dirname(data[i][0]);
|
||||
s = false;
|
||||
for(j = 0; j < data.length; ++j) if(data[j][0] === dad) s = true;
|
||||
if(!s) data.push([dad, ({
|
||||
name: filename(dad).replace("/",""),
|
||||
type: 1,
|
||||
clsid: HEADER_CLSID,
|
||||
ct: now, mt: now,
|
||||
content: null
|
||||
})]);
|
||||
}
|
||||
|
||||
data.sort(function(x,y) { return namecmp(x[0], y[0]); });
|
||||
cfb.FullPaths = []; cfb.FileIndex = [];
|
||||
for(i = 0; i < data.length; ++i) { cfb.FullPaths[i] = data[i][0]; cfb.FileIndex[i] = data[i][1]; }
|
||||
for(i = 0; i < data.length; ++i) {
|
||||
var elt = cfb.FileIndex[i];
|
||||
var nm = cfb.FullPaths[i];
|
||||
|
||||
elt.name = filename(nm).replace("/","");
|
||||
elt.L = elt.R = elt.C = -(elt.color = 1);
|
||||
elt.size = elt.content ? elt.content.length : 0;
|
||||
elt.start = 0;
|
||||
elt.clsid = (elt.clsid || HEADER_CLSID);
|
||||
if(i === 0) {
|
||||
elt.C = data.length > 1 ? 1 : -1;
|
||||
elt.size = 0;
|
||||
elt.type = 5;
|
||||
} else if(nm.slice(-1) == "/") {
|
||||
for(j=i+1;j < data.length; ++j) if(dirname(cfb.FullPaths[j])==nm) break;
|
||||
elt.C = j >= data.length ? -1 : j;
|
||||
for(j=i+1;j < data.length; ++j) if(dirname(cfb.FullPaths[j])==dirname(nm)) break;
|
||||
elt.R = j >= data.length ? -1 : j;
|
||||
elt.type = 1;
|
||||
} else {
|
||||
if(dirname(cfb.FullPaths[i+1]||"") == dirname(nm)) elt.R = i + 1;
|
||||
elt.type = 2;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function _write(cfb, options) {
|
||||
var _opts = options || {};
|
||||
rebuild_cfb(cfb);
|
||||
var L = (function(cfb){
|
||||
var mini_size = 0, fat_size = 0;
|
||||
for(var i = 0; i < cfb.FileIndex.length; ++i) {
|
||||
var file = cfb.FileIndex[i];
|
||||
if(!file.content) continue;
|
||||
var flen = file.content.length;
|
||||
if(flen > 0){
|
||||
if(flen < 0x1000) mini_size += (flen + 0x3F) >> 6;
|
||||
else fat_size += (flen + 0x01FF) >> 9;
|
||||
}
|
||||
}
|
||||
var dir_cnt = (cfb.FullPaths.length +3) >> 2;
|
||||
var mini_cnt = (mini_size + 7) >> 3;
|
||||
var mfat_cnt = (mini_size + 0x7F) >> 7;
|
||||
var fat_base = mini_cnt + fat_size + dir_cnt + mfat_cnt;
|
||||
var fat_cnt = (fat_base + 0x7F) >> 7;
|
||||
var difat_cnt = fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt-109)/0x7F);
|
||||
while(((fat_base + fat_cnt + difat_cnt + 0x7F) >> 7) > fat_cnt) difat_cnt = ++fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt-109)/0x7F);
|
||||
var L = [1, difat_cnt, fat_cnt, mfat_cnt, dir_cnt, fat_size, mini_size, 0];
|
||||
cfb.FileIndex[0].size = mini_size << 6;
|
||||
L[7] = (cfb.FileIndex[0].start=L[0]+L[1]+L[2]+L[3]+L[4]+L[5])+((L[6]+7) >> 3);
|
||||
return L;
|
||||
})(cfb);
|
||||
var o = new_buf(L[7] << 9);
|
||||
var i = 0, T = 0;
|
||||
{
|
||||
for(i = 0; i < 8; ++i) o.write_shift(1, HEADER_SIG[i]);
|
||||
for(i = 0; i < 8; ++i) o.write_shift(2, 0);
|
||||
o.write_shift(2, 0x003E);
|
||||
o.write_shift(2, 0x0003);
|
||||
o.write_shift(2, 0xFFFE);
|
||||
o.write_shift(2, 0x0009);
|
||||
o.write_shift(2, 0x0006);
|
||||
for(i = 0; i < 3; ++i) o.write_shift(2, 0);
|
||||
o.write_shift(4, 0);
|
||||
o.write_shift(4, L[2]);
|
||||
o.write_shift(4, L[0] + L[1] + L[2] + L[3] - 1);
|
||||
o.write_shift(4, 0);
|
||||
o.write_shift(4, 1<<12);
|
||||
o.write_shift(4, L[3] ? L[0] + L[1] + L[2] - 1: ENDOFCHAIN);
|
||||
o.write_shift(4, L[3]);
|
||||
o.write_shift(-4, L[1] ? L[0] - 1: ENDOFCHAIN);
|
||||
o.write_shift(4, L[1]);
|
||||
for(i = 0; i < 109; ++i) o.write_shift(-4, i < L[2] ? L[1] + i : -1);
|
||||
}
|
||||
if(L[1]) {
|
||||
for(T = 0; T < L[1]; ++T) {
|
||||
for(; i < 236 + T * 127; ++i) o.write_shift(-4, i < L[2] ? L[1] + i : -1);
|
||||
o.write_shift(-4, T === L[1] - 1 ? ENDOFCHAIN : T + 1);
|
||||
}
|
||||
}
|
||||
var chainit = function(w) {
|
||||
for(T += w; i<T-1; ++i) o.write_shift(-4, i+1);
|
||||
if(w) { ++i; o.write_shift(-4, ENDOFCHAIN); }
|
||||
};
|
||||
T = i = 0;
|
||||
for(T+=L[1]; i<T; ++i) o.write_shift(-4, consts.DIFSECT);
|
||||
for(T+=L[2]; i<T; ++i) o.write_shift(-4, consts.FATSECT);
|
||||
chainit(L[3]);
|
||||
chainit(L[4]);
|
||||
var j = 0, flen = 0;
|
||||
var file = cfb.FileIndex[0];
|
||||
for(; j < cfb.FileIndex.length; ++j) {
|
||||
file = cfb.FileIndex[j];
|
||||
if(!file.content) continue;
|
||||
flen = file.content.length;
|
||||
if(flen < 0x1000) continue;
|
||||
file.start = T;
|
||||
chainit((flen + 0x01FF) >> 9);
|
||||
}
|
||||
chainit((L[6] + 7) >> 3);
|
||||
while(o.l & 0x1FF) o.write_shift(-4, consts.ENDOFCHAIN);
|
||||
T = i = 0;
|
||||
for(j = 0; j < cfb.FileIndex.length; ++j) {
|
||||
file = cfb.FileIndex[j];
|
||||
if(!file.content) continue;
|
||||
flen = file.content.length;
|
||||
if(!flen || flen >= 0x1000) continue;
|
||||
file.start = T;
|
||||
chainit((flen + 0x3F) >> 6);
|
||||
}
|
||||
while(o.l & 0x1FF) o.write_shift(-4, consts.ENDOFCHAIN);
|
||||
for(i = 0; i < L[4]<<2; ++i) {
|
||||
var nm = cfb.FullPaths[i];
|
||||
if(!nm || nm.length === 0) {
|
||||
for(j = 0; j < 17; ++j) o.write_shift(4, 0);
|
||||
for(j = 0; j < 3; ++j) o.write_shift(4, -1);
|
||||
for(j = 0; j < 12; ++j) o.write_shift(4, 0);
|
||||
continue;
|
||||
}
|
||||
file = cfb.FileIndex[i];
|
||||
if(i === 0) file.start = file.size ? file.start - 1 : ENDOFCHAIN;
|
||||
var _nm = (i === 0 && _opts.root) || file.name;
|
||||
flen = 2*(_nm.length+1);
|
||||
o.write_shift(64, _nm, "utf16le");
|
||||
o.write_shift(2, flen);
|
||||
o.write_shift(1, file.type);
|
||||
o.write_shift(1, file.color);
|
||||
o.write_shift(-4, file.L);
|
||||
o.write_shift(-4, file.R);
|
||||
o.write_shift(-4, file.C);
|
||||
if(!file.clsid) for(j = 0; j < 4; ++j) o.write_shift(4, 0);
|
||||
else o.write_shift(16, file.clsid, "hex");
|
||||
o.write_shift(4, file.state || 0);
|
||||
o.write_shift(4, 0); o.write_shift(4, 0);
|
||||
o.write_shift(4, 0); o.write_shift(4, 0);
|
||||
o.write_shift(4, file.start);
|
||||
o.write_shift(4, file.size); o.write_shift(4, 0);
|
||||
}
|
||||
for(i = 1; i < cfb.FileIndex.length; ++i) {
|
||||
file = cfb.FileIndex[i];
|
||||
if(file.size >= 0x1000) {
|
||||
o.l = (file.start+1) << 9;
|
||||
for(j = 0; j < file.size; ++j) o.write_shift(1, file.content[j]);
|
||||
for(; j & 0x1FF; ++j) o.write_shift(1, 0);
|
||||
}
|
||||
}
|
||||
for(i = 1; i < cfb.FileIndex.length; ++i) {
|
||||
file = cfb.FileIndex[i];
|
||||
if(file.size > 0 && file.size < 0x1000) {
|
||||
for(j = 0; j < file.size; ++j) o.write_shift(1, file.content[j]);
|
||||
for(; j & 0x3F; ++j) o.write_shift(1, 0);
|
||||
}
|
||||
}
|
||||
while(o.l < o.length) o.write_shift(1, 0);
|
||||
return o;
|
||||
}
|
||||
/* [MS-CFB] 2.6.4 (Unicode 3.0.1 case conversion) */
|
||||
function find(cfb, path) {
|
||||
var UCFullPaths = cfb.FullPaths.map(function(x) { return x.toUpperCase(); });
|
||||
var UCPaths = UCFullPaths.map(function(x) { var y = x.split("/"); return y[y.length - (x.slice(-1) == "/" ? 2 : 1)]; });
|
||||
var k = false;
|
||||
if(path.charCodeAt(0) === 47 /* "/" */) { k = true; path = UCFullPaths[0].slice(0, -1) + path; }
|
||||
else k = path.indexOf("/") !== -1;
|
||||
var UCPath = path.toUpperCase();
|
||||
var w = k === true ? UCFullPaths.indexOf(UCPath) : UCPaths.indexOf(UCPath);
|
||||
if(w !== -1) return cfb.FileIndex[w];
|
||||
|
||||
var m = !UCPath.match(chr1);
|
||||
UCPath = UCPath.replace(chr0,'');
|
||||
if(m) UCPath = UCPath.replace(chr1,'!');
|
||||
for(w = 0; w < UCFullPaths.length; ++w) {
|
||||
if((m ? UCFullPaths[w].replace(chr1,'!') : UCFullPaths[w]).replace(chr0,'') == UCPath) return cfb.FileIndex[w];
|
||||
if((m ? UCPaths[w].replace(chr1,'!') : UCPaths[w]).replace(chr0,'') == UCPath) return cfb.FileIndex[w];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/** CFB Constants */
|
||||
var MSSZ = 64; /* Mini Sector Size = 1<<6 */
|
||||
//var MSCSZ = 4096; /* Mini Stream Cutoff Size */
|
||||
/* 2.1 Compound File Sector Numbers and Types */
|
||||
var ENDOFCHAIN = -2;
|
||||
/* 2.2 Compound File Header */
|
||||
var HEADER_SIGNATURE = 'd0cf11e0a1b11ae1';
|
||||
var HEADER_SIG = [0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1];
|
||||
var HEADER_CLSID = '00000000000000000000000000000000';
|
||||
var consts = {
|
||||
/* 2.1 Compund File Sector Numbers and Types */
|
||||
MAXREGSECT: -6,
|
||||
DIFSECT: -4,
|
||||
FATSECT: -3,
|
||||
ENDOFCHAIN: ENDOFCHAIN,
|
||||
FREESECT: -1,
|
||||
/* 2.2 Compound File Header */
|
||||
HEADER_SIGNATURE: HEADER_SIGNATURE,
|
||||
HEADER_MINOR_VERSION: '3e00',
|
||||
MAXREGSID: -6,
|
||||
NOSTREAM: -1,
|
||||
HEADER_CLSID: HEADER_CLSID,
|
||||
/* 2.6.1 Compound File Directory Entry */
|
||||
EntryTypes: ['unknown','storage','stream','lockbytes','property','root']
|
||||
};
|
||||
|
||||
function write_file(cfb, filename, options) {
|
||||
get_fs();
|
||||
var o = _write(cfb, options);
|
||||
fs.writeFileSync(filename, o);
|
||||
}
|
||||
|
||||
function a2s(o) {
|
||||
var out = new Array(o.length);
|
||||
for(var i = 0; i < o.length; ++i) out[i] = String.fromCharCode(o[i]);
|
||||
return out.join("");
|
||||
}
|
||||
|
||||
function write(cfb, options) {
|
||||
var o = _write(cfb, options);
|
||||
switch(options && options.type) {
|
||||
case "file": get_fs(); fs.writeFileSync(options.filename, (o)); return o;
|
||||
case "binary": return a2s(o);
|
||||
case "base64": return Base64.encode(a2s(o));
|
||||
}
|
||||
return o;
|
||||
}
|
||||
function cfb_new(opts) {
|
||||
var o = ({});
|
||||
init_cfb(o, opts);
|
||||
return o;
|
||||
}
|
||||
|
||||
function cfb_add(cfb, name, content, opts) {
|
||||
var unsafe = opts && opts.unsafe;
|
||||
if(!unsafe) init_cfb(cfb);
|
||||
var file = !unsafe && CFB.find(cfb, name);
|
||||
if(!file) {
|
||||
var fpath = cfb.FullPaths[0];
|
||||
if(name.slice(0, fpath.length) == fpath) fpath = name;
|
||||
else {
|
||||
if(fpath.slice(-1) != "/") fpath += "/";
|
||||
fpath = (fpath + name).replace("//","/");
|
||||
}
|
||||
file = ({name: filename(name), type: 2});
|
||||
cfb.FileIndex.push(file);
|
||||
cfb.FullPaths.push(fpath);
|
||||
if(!unsafe) CFB.utils.cfb_gc(cfb);
|
||||
}
|
||||
file.content = (content);
|
||||
file.size = content ? content.length : 0;
|
||||
if(opts) {
|
||||
if(opts.CLSID) file.clsid = opts.CLSID;
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
function cfb_del(cfb, name) {
|
||||
init_cfb(cfb);
|
||||
var file = CFB.find(cfb, name);
|
||||
if(file) for(var j = 0; j < cfb.FileIndex.length; ++j) if(cfb.FileIndex[j] == file) {
|
||||
cfb.FileIndex.splice(j, 1);
|
||||
cfb.FullPaths.splice(j, 1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function cfb_mov(cfb, old_name, new_name) {
|
||||
init_cfb(cfb);
|
||||
var file = CFB.find(cfb, old_name);
|
||||
if(file) for(var j = 0; j < cfb.FileIndex.length; ++j) if(cfb.FileIndex[j] == file) {
|
||||
cfb.FileIndex[j].name = filename(new_name);
|
||||
cfb.FullPaths[j] = new_name;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function cfb_gc(cfb) { rebuild_cfb(cfb, true); }
|
||||
|
||||
exports.find = find;
|
||||
exports.read = read;
|
||||
exports.parse = parse;
|
||||
exports.write = write;
|
||||
exports.writeFile = write_file;
|
||||
exports.utils = {
|
||||
cfb_new: cfb_new,
|
||||
cfb_add: cfb_add,
|
||||
cfb_del: cfb_del,
|
||||
cfb_mov: cfb_mov,
|
||||
cfb_gc: cfb_gc,
|
||||
ReadShift: ReadShift,
|
||||
CheckField: CheckField,
|
||||
prep_blob: prep_blob,
|
||||
bconcat: bconcat,
|
||||
consts: consts
|
||||
};
|
||||
|
||||
return exports;
|
||||
})();
|
||||
|
||||
if(typeof require !== 'undefined' && typeof module !== 'undefined' && typeof DO_NOT_EXPORT_CFB === 'undefined') { module.exports = CFB; }
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user