From 5f5bbac56e23333e503c4d4f7a96122aef6be0bd Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Thu, 27 Feb 2020 15:24:35 +0100 Subject: [PATCH] initial comit --- README.md | 2 + dist/index.html | 9 + dist/r3.js | 1 + node_modules/.bin/acorn | 1 + node_modules/.bin/atob | 1 + node_modules/.bin/color-support | 1 + node_modules/.bin/errno | 1 + node_modules/.bin/gulp | 1 + node_modules/.bin/import-local-fixture | 1 + node_modules/.bin/json5 | 1 + node_modules/.bin/miller-rabin | 1 + node_modules/.bin/mkdirp | 1 + node_modules/.bin/rimraf | 1 + node_modules/.bin/semver | 1 + node_modules/.bin/sha.js | 1 + node_modules/.bin/terser | 1 + node_modules/.bin/webpack | 1 + node_modules/.bin/webpack-cli | 1 + node_modules/.bin/which | 1 + ...bd87012259640de0859cc1eeb3580d3eb599d96165 | 1 + ...bb7d42e57159e6f0672086f4f90ddbd0aa0fa82870 | 2 + node_modules/@webassemblyjs/ast/LICENSE | 21 + node_modules/@webassemblyjs/ast/README.md | 167 + node_modules/@webassemblyjs/ast/esm/clone.js | 10 + .../@webassemblyjs/ast/esm/definitions.js | 663 ++ node_modules/@webassemblyjs/ast/esm/index.js | 6 + .../@webassemblyjs/ast/esm/node-helpers.js | 84 + .../@webassemblyjs/ast/esm/node-path.js | 135 + node_modules/@webassemblyjs/ast/esm/nodes.js | 915 ++ .../@webassemblyjs/ast/esm/signatures.js | 199 + .../denormalize-type-references/index.js | 76 + .../wast-identifier-to-index/index.js | 216 + .../@webassemblyjs/ast/esm/traverse.js | 96 + .../@webassemblyjs/ast/esm/types/basic.js | 0 .../@webassemblyjs/ast/esm/types/nodes.js | 0 .../@webassemblyjs/ast/esm/types/traverse.js | 0 node_modules/@webassemblyjs/ast/esm/utils.js | 265 + node_modules/@webassemblyjs/ast/lib/clone.js | 17 + .../@webassemblyjs/ast/lib/definitions.js | 663 ++ node_modules/@webassemblyjs/ast/lib/index.js | 118 + .../@webassemblyjs/ast/lib/node-helpers.js | 107 + .../@webassemblyjs/ast/lib/node-path.js | 142 + node_modules/@webassemblyjs/ast/lib/nodes.js | 1134 ++ .../@webassemblyjs/ast/lib/signatures.js | 207 + .../denormalize-type-references/index.js | 83 + .../wast-identifier-to-index/index.js | 225 + .../@webassemblyjs/ast/lib/traverse.js | 105 + .../@webassemblyjs/ast/lib/types/basic.js | 0 .../@webassemblyjs/ast/lib/types/nodes.js | 0 .../@webassemblyjs/ast/lib/types/traverse.js | 0 node_modules/@webassemblyjs/ast/lib/utils.js | 306 + node_modules/@webassemblyjs/ast/package.json | 73 + .../ast/scripts/generateNodeUtils.js | 219 + .../ast/scripts/generateTypeDefinitions.js | 47 + .../@webassemblyjs/ast/scripts/util.js | 38 + .../ast/webassemblyjs-ast-1.7.10.tgz | Bin 0 -> 30081 bytes .../floating-point-hex-parser/LICENSE | 21 + .../floating-point-hex-parser/README.md | 34 + .../floating-point-hex-parser/esm/index.js | 42 + .../floating-point-hex-parser/lib/index.js | 49 + .../floating-point-hex-parser/package.json | 56 + .../@webassemblyjs/helper-api-error/LICENSE | 21 + .../helper-api-error/esm/index.js | 47 + .../helper-api-error/lib/index.js | 62 + .../helper-api-error/package.json | 42 + .../@webassemblyjs/helper-buffer/LICENSE | 21 + .../helper-buffer/esm/compare.js | 65 + .../@webassemblyjs/helper-buffer/esm/index.js | 67 + .../helper-buffer/lib/compare.js | 73 + .../@webassemblyjs/helper-buffer/lib/index.js | 78 + .../@webassemblyjs/helper-buffer/package.json | 58 + .../@webassemblyjs/helper-code-frame/LICENSE | 21 + .../helper-code-frame/esm/index.js | 37 + .../helper-code-frame/lib/index.js | 47 + .../helper-code-frame/package.json | 55 + ...webassemblyjs-helper-code-frame-1.7.10.tgz | Bin 0 -> 1756 bytes .../@webassemblyjs/helper-fsm/LICENSE | 21 + .../@webassemblyjs/helper-fsm/esm/index.js | 101 + .../@webassemblyjs/helper-fsm/lib/index.js | 109 + .../@webassemblyjs/helper-fsm/package.json | 41 + .../helper-module-context/LICENSE | 21 + .../helper-module-context/esm/index.js | 378 + .../helper-module-context/lib/index.js | 389 + .../helper-module-context/package.json | 60 + .../helper-module-context/src/index.js | 287 + .../helper-module-context/test/index.js | 100 + .../helper-wasm-bytecode/LICENSE | 21 + .../helper-wasm-bytecode/esm/index.js | 323 + .../helper-wasm-bytecode/esm/section.js | 31 + .../helper-wasm-bytecode/lib/index.js | 338 + .../helper-wasm-bytecode/lib/section.js | 38 + .../helper-wasm-bytecode/package.json | 56 + ...assemblyjs-helper-wasm-bytecode-1.7.10.tgz | Bin 0 -> 3848 bytes .../helper-wasm-section/LICENSE | 21 + .../helper-wasm-section/esm/create.js | 107 + .../helper-wasm-section/esm/index.js | 3 + .../helper-wasm-section/esm/remove.js | 36 + .../helper-wasm-section/esm/resize.js | 78 + .../helper-wasm-section/lib/create.js | 121 + .../helper-wasm-section/lib/index.js | 35 + .../helper-wasm-section/lib/remove.js | 45 + .../helper-wasm-section/lib/resize.js | 90 + .../helper-wasm-section/package.json | 61 + ...bassemblyjs-helper-wasm-section-1.7.10.tgz | Bin 0 -> 3890 bytes node_modules/@webassemblyjs/ieee754/LICENSE | 21 + .../@webassemblyjs/ieee754/esm/index.js | 33 + .../@webassemblyjs/ieee754/lib/index.js | 52 + .../@webassemblyjs/ieee754/package.json | 45 + .../@webassemblyjs/ieee754/src/index.js | 47 + .../@webassemblyjs/leb128/LICENSE.txt | 194 + .../@webassemblyjs/leb128/esm/bits.js | 145 + .../@webassemblyjs/leb128/esm/bufs.js | 218 + .../@webassemblyjs/leb128/esm/index.js | 34 + node_modules/@webassemblyjs/leb128/esm/leb.js | 316 + .../@webassemblyjs/leb128/lib/bits.js | 156 + .../@webassemblyjs/leb128/lib/bufs.js | 236 + .../@webassemblyjs/leb128/lib/index.js | 59 + node_modules/@webassemblyjs/leb128/lib/leb.js | 332 + .../@webassemblyjs/leb128/package.json | 45 + node_modules/@webassemblyjs/utf8/LICENSE | 21 + .../@webassemblyjs/utf8/esm/decoder.js | 95 + .../@webassemblyjs/utf8/esm/encoder.js | 46 + node_modules/@webassemblyjs/utf8/esm/index.js | 2 + .../@webassemblyjs/utf8/lib/decoder.js | 102 + .../@webassemblyjs/utf8/lib/encoder.js | 53 + node_modules/@webassemblyjs/utf8/lib/index.js | 21 + node_modules/@webassemblyjs/utf8/package.json | 53 + .../@webassemblyjs/utf8/src/decoder.js | 86 + .../@webassemblyjs/utf8/src/encoder.js | 44 + node_modules/@webassemblyjs/utf8/src/index.js | 4 + .../@webassemblyjs/utf8/test/index.js | 13 + node_modules/@webassemblyjs/wasm-edit/LICENSE | 21 + .../@webassemblyjs/wasm-edit/README.md | 86 + .../@webassemblyjs/wasm-edit/esm/apply.js | 299 + .../@webassemblyjs/wasm-edit/esm/index.js | 114 + .../@webassemblyjs/wasm-edit/lib/apply.js | 311 + .../@webassemblyjs/wasm-edit/lib/index.js | 133 + .../@webassemblyjs/wasm-edit/package.json | 65 + .../webassemblyjs-wasm-edit-1.7.10.tgz | Bin 0 -> 5634 bytes node_modules/@webassemblyjs/wasm-gen/LICENSE | 21 + .../wasm-gen/esm/encoder/index.js | 301 + .../@webassemblyjs/wasm-gen/esm/index.js | 51 + .../wasm-gen/lib/encoder/index.js | 357 + .../@webassemblyjs/wasm-gen/lib/index.js | 64 + .../@webassemblyjs/wasm-gen/package.json | 61 + .../webassemblyjs-wasm-gen-1.7.10.tgz | Bin 0 -> 4187 bytes node_modules/@webassemblyjs/wasm-opt/LICENSE | 21 + .../@webassemblyjs/wasm-opt/esm/index.js | 41 + .../@webassemblyjs/wasm-opt/esm/leb128.js | 47 + .../@webassemblyjs/wasm-opt/lib/index.js | 50 + .../@webassemblyjs/wasm-opt/lib/leb128.js | 56 + .../@webassemblyjs/wasm-opt/package.json | 58 + .../webassemblyjs-wasm-opt-1.7.10.tgz | Bin 0 -> 2701 bytes .../@webassemblyjs/wasm-parser/LICENSE | 21 + .../@webassemblyjs/wasm-parser/README.md | 26 + .../@webassemblyjs/wasm-parser/esm/decoder.js | 1760 ++++ .../@webassemblyjs/wasm-parser/esm/index.js | 247 + .../wasm-parser/esm/types/decoder.js | 0 .../@webassemblyjs/wasm-parser/lib/decoder.js | 1776 ++++ .../@webassemblyjs/wasm-parser/lib/index.js | 257 + .../wasm-parser/lib/types/decoder.js | 0 .../@webassemblyjs/wasm-parser/package.json | 77 + .../webassemblyjs-wasm-parser-1.7.10.tgz | Bin 0 -> 21780 bytes .../@webassemblyjs/wast-parser/LICENSE | 21 + .../@webassemblyjs/wast-parser/README.md | 17 + .../@webassemblyjs/wast-parser/esm/grammar.js | 1756 ++++ .../@webassemblyjs/wast-parser/esm/index.js | 9 + .../wast-parser/esm/number-literals.js | 91 + .../wast-parser/esm/string-literals.js | 88 + .../wast-parser/esm/tokenizer.js | 434 + .../@webassemblyjs/wast-parser/lib/grammar.js | 1769 ++++ .../@webassemblyjs/wast-parser/lib/index.js | 35 + .../wast-parser/lib/number-literals.js | 116 + .../wast-parser/lib/string-literals.js | 94 + .../wast-parser/lib/tokenizer.js | 447 + .../@webassemblyjs/wast-parser/package.json | 73 + .../webassemblyjs-wast-parser-1.7.10.tgz | Bin 0 -> 25182 bytes .../@webassemblyjs/wast-printer/LICENSE | 21 + .../@webassemblyjs/wast-printer/README.md | 17 + .../@webassemblyjs/wast-printer/esm/index.js | 900 ++ .../@webassemblyjs/wast-printer/lib/index.js | 911 ++ .../@webassemblyjs/wast-printer/package.json | 69 + .../webassemblyjs-wast-printer-1.7.10.tgz | Bin 0 -> 4655 bytes node_modules/@xtuc/ieee754/LICENSE | 28 + node_modules/@xtuc/ieee754/README.md | 51 + node_modules/@xtuc/ieee754/dist/.gitkeep | 0 node_modules/@xtuc/ieee754/dist/index.cjs.js | 96 + node_modules/@xtuc/ieee754/index.js | 84 + node_modules/@xtuc/ieee754/package.json | 75 + node_modules/@xtuc/long/LICENSE | 202 + node_modules/@xtuc/long/README.md | 257 + node_modules/@xtuc/long/dist/long.js | 2 + node_modules/@xtuc/long/dist/long.js.map | 1 + node_modules/@xtuc/long/index.d.ts | 429 + node_modules/@xtuc/long/index.js | 1 + node_modules/@xtuc/long/package.json | 68 + node_modules/@xtuc/long/src/long.js | 1405 +++ node_modules/acorn/CHANGELOG.md | 550 + node_modules/acorn/LICENSE | 19 + node_modules/acorn/README.md | 269 + node_modules/acorn/bin/acorn | 4 + node_modules/acorn/dist/acorn.d.ts | 209 + node_modules/acorn/dist/acorn.js | 4990 +++++++++ node_modules/acorn/dist/acorn.js.map | 1 + node_modules/acorn/dist/acorn.mjs | 4959 +++++++++ node_modules/acorn/dist/acorn.mjs.map | 1 + node_modules/acorn/dist/bin.js | 64 + node_modules/acorn/package.json | 66 + node_modules/ajv-errors/LICENSE | 21 + node_modules/ajv-errors/README.md | 318 + node_modules/ajv-errors/index.js | 48 + .../ajv-errors/lib/dot/errorMessage.jst | 372 + node_modules/ajv-errors/lib/dotjs/README.md | 3 + .../ajv-errors/lib/dotjs/errorMessage.js | 315 + node_modules/ajv-errors/package.json | 83 + node_modules/ajv-keywords/LICENSE | 21 + node_modules/ajv-keywords/README.md | 820 ++ node_modules/ajv-keywords/index.js | 35 + .../ajv-keywords/keywords/_formatLimit.js | 101 + node_modules/ajv-keywords/keywords/_util.js | 15 + .../ajv-keywords/keywords/allRequired.js | 18 + .../ajv-keywords/keywords/anyRequired.js | 24 + .../ajv-keywords/keywords/deepProperties.js | 54 + .../ajv-keywords/keywords/deepRequired.js | 57 + .../keywords/dot/_formatLimit.jst | 116 + .../keywords/dot/patternRequired.jst | 33 + .../ajv-keywords/keywords/dot/switch.jst | 73 + .../ajv-keywords/keywords/dotjs/README.md | 3 + .../keywords/dotjs/_formatLimit.js | 178 + .../keywords/dotjs/patternRequired.js | 58 + .../ajv-keywords/keywords/dotjs/switch.js | 130 + .../ajv-keywords/keywords/dynamicDefaults.js | 72 + .../ajv-keywords/keywords/formatMaximum.js | 3 + .../ajv-keywords/keywords/formatMinimum.js | 3 + node_modules/ajv-keywords/keywords/index.js | 22 + .../ajv-keywords/keywords/instanceof.js | 58 + .../ajv-keywords/keywords/oneRequired.js | 24 + .../ajv-keywords/keywords/patternRequired.js | 21 + .../ajv-keywords/keywords/prohibited.js | 24 + node_modules/ajv-keywords/keywords/range.js | 36 + node_modules/ajv-keywords/keywords/regexp.js | 36 + node_modules/ajv-keywords/keywords/select.js | 79 + node_modules/ajv-keywords/keywords/switch.js | 38 + .../ajv-keywords/keywords/transform.js | 80 + node_modules/ajv-keywords/keywords/typeof.js | 32 + .../keywords/uniqueItemProperties.js | 59 + node_modules/ajv-keywords/package.json | 79 + node_modules/ajv/.tonic_example.js | 20 + node_modules/ajv/LICENSE | 22 + node_modules/ajv/README.md | 1411 +++ node_modules/ajv/dist/ajv.bundle.js | 7165 +++++++++++++ node_modules/ajv/dist/ajv.min.js | 3 + node_modules/ajv/dist/ajv.min.js.map | 1 + node_modules/ajv/lib/ajv.d.ts | 395 + node_modules/ajv/lib/ajv.js | 506 + node_modules/ajv/lib/cache.js | 26 + node_modules/ajv/lib/compile/async.js | 90 + node_modules/ajv/lib/compile/equal.js | 5 + node_modules/ajv/lib/compile/error_classes.js | 34 + node_modules/ajv/lib/compile/formats.js | 142 + node_modules/ajv/lib/compile/index.js | 387 + node_modules/ajv/lib/compile/resolve.js | 270 + node_modules/ajv/lib/compile/rules.js | 66 + node_modules/ajv/lib/compile/schema_obj.js | 9 + node_modules/ajv/lib/compile/ucs2length.js | 20 + node_modules/ajv/lib/compile/util.js | 274 + node_modules/ajv/lib/data.js | 49 + node_modules/ajv/lib/definition_schema.js | 37 + node_modules/ajv/lib/dot/_limit.jst | 104 + node_modules/ajv/lib/dot/_limitItems.jst | 10 + node_modules/ajv/lib/dot/_limitLength.jst | 10 + node_modules/ajv/lib/dot/_limitProperties.jst | 10 + node_modules/ajv/lib/dot/allOf.jst | 34 + node_modules/ajv/lib/dot/anyOf.jst | 48 + node_modules/ajv/lib/dot/coerce.def | 61 + node_modules/ajv/lib/dot/comment.jst | 9 + node_modules/ajv/lib/dot/const.jst | 11 + node_modules/ajv/lib/dot/contains.jst | 57 + node_modules/ajv/lib/dot/custom.jst | 191 + node_modules/ajv/lib/dot/defaults.def | 47 + node_modules/ajv/lib/dot/definitions.def | 201 + node_modules/ajv/lib/dot/dependencies.jst | 80 + node_modules/ajv/lib/dot/enum.jst | 30 + node_modules/ajv/lib/dot/errors.def | 194 + node_modules/ajv/lib/dot/format.jst | 106 + node_modules/ajv/lib/dot/if.jst | 75 + node_modules/ajv/lib/dot/items.jst | 100 + node_modules/ajv/lib/dot/missing.def | 39 + node_modules/ajv/lib/dot/multipleOf.jst | 20 + node_modules/ajv/lib/dot/not.jst | 43 + node_modules/ajv/lib/dot/oneOf.jst | 54 + node_modules/ajv/lib/dot/pattern.jst | 14 + node_modules/ajv/lib/dot/properties.jst | 244 + node_modules/ajv/lib/dot/propertyNames.jst | 54 + node_modules/ajv/lib/dot/ref.jst | 85 + node_modules/ajv/lib/dot/required.jst | 108 + node_modules/ajv/lib/dot/uniqueItems.jst | 62 + node_modules/ajv/lib/dot/validate.jst | 282 + node_modules/ajv/lib/dotjs/README.md | 3 + node_modules/ajv/lib/dotjs/_limit.js | 157 + node_modules/ajv/lib/dotjs/_limitItems.js | 77 + node_modules/ajv/lib/dotjs/_limitLength.js | 82 + .../ajv/lib/dotjs/_limitProperties.js | 77 + node_modules/ajv/lib/dotjs/allOf.js | 43 + node_modules/ajv/lib/dotjs/anyOf.js | 74 + node_modules/ajv/lib/dotjs/comment.js | 14 + node_modules/ajv/lib/dotjs/const.js | 56 + node_modules/ajv/lib/dotjs/contains.js | 82 + node_modules/ajv/lib/dotjs/custom.js | 228 + node_modules/ajv/lib/dotjs/dependencies.js | 168 + node_modules/ajv/lib/dotjs/enum.js | 66 + node_modules/ajv/lib/dotjs/format.js | 150 + node_modules/ajv/lib/dotjs/if.js | 104 + node_modules/ajv/lib/dotjs/index.js | 33 + node_modules/ajv/lib/dotjs/items.js | 141 + node_modules/ajv/lib/dotjs/multipleOf.js | 77 + node_modules/ajv/lib/dotjs/not.js | 84 + node_modules/ajv/lib/dotjs/oneOf.js | 73 + node_modules/ajv/lib/dotjs/pattern.js | 75 + node_modules/ajv/lib/dotjs/properties.js | 330 + node_modules/ajv/lib/dotjs/propertyNames.js | 82 + node_modules/ajv/lib/dotjs/ref.js | 124 + node_modules/ajv/lib/dotjs/required.js | 270 + node_modules/ajv/lib/dotjs/uniqueItems.js | 86 + node_modules/ajv/lib/dotjs/validate.js | 494 + node_modules/ajv/lib/keyword.js | 146 + node_modules/ajv/lib/refs/data.json | 17 + .../ajv/lib/refs/json-schema-draft-04.json | 149 + .../ajv/lib/refs/json-schema-draft-06.json | 154 + .../ajv/lib/refs/json-schema-draft-07.json | 168 + .../ajv/lib/refs/json-schema-secure.json | 94 + node_modules/ajv/package.json | 126 + node_modules/ajv/scripts/.eslintrc.yml | 3 + node_modules/ajv/scripts/bundle.js | 61 + node_modules/ajv/scripts/compile-dots.js | 73 + node_modules/ajv/scripts/info | 10 + node_modules/ajv/scripts/prepare-tests | 12 + .../ajv/scripts/publish-built-version | 32 + node_modules/ajv/scripts/travis-gh-pages | 23 + node_modules/ansi-colors/LICENSE | 21 + node_modules/ansi-colors/README.md | 105 + node_modules/ansi-colors/index.js | 456 + node_modules/ansi-colors/package.json | 175 + node_modules/ansi-colors/types/index.d.ts | 31 + node_modules/ansi-gray/LICENSE | 21 + node_modules/ansi-gray/index.js | 14 + node_modules/ansi-gray/package.json | 86 + node_modules/ansi-gray/readme.md | 74 + node_modules/ansi-regex/index.js | 14 + node_modules/ansi-regex/license | 9 + node_modules/ansi-regex/package.json | 85 + node_modules/ansi-regex/readme.md | 87 + node_modules/ansi-styles/index.js | 165 + node_modules/ansi-styles/license | 9 + node_modules/ansi-styles/package.json | 89 + node_modules/ansi-styles/readme.md | 147 + node_modules/ansi-wrap/LICENSE | 21 + node_modules/ansi-wrap/README.md | 89 + node_modules/ansi-wrap/index.js | 5 + node_modules/ansi-wrap/package.json | 60 + node_modules/anymatch/LICENSE | 15 + node_modules/anymatch/README.md | 99 + node_modules/anymatch/index.js | 67 + .../node_modules/normalize-path/LICENSE | 21 + .../node_modules/normalize-path/README.md | 92 + .../node_modules/normalize-path/index.js | 19 + .../node_modules/normalize-path/package.json | 117 + node_modules/anymatch/package.json | 74 + node_modules/append-buffer/LICENSE | 21 + node_modules/append-buffer/README.md | 95 + node_modules/append-buffer/index.js | 41 + node_modules/append-buffer/package.json | 84 + node_modules/aproba/LICENSE | 14 + node_modules/aproba/README.md | 94 + node_modules/aproba/index.js | 105 + node_modules/aproba/package.json | 64 + node_modules/archy/.travis.yml | 4 + node_modules/archy/LICENSE | 18 + node_modules/archy/examples/beep.js | 24 + node_modules/archy/examples/multi_line.js | 25 + node_modules/archy/index.js | 35 + node_modules/archy/package.json | 83 + node_modules/archy/readme.markdown | 88 + node_modules/archy/test/beep.js | 40 + node_modules/archy/test/multi_line.js | 45 + node_modules/archy/test/non_unicode.js | 40 + node_modules/arr-diff/LICENSE | 21 + node_modules/arr-diff/README.md | 130 + node_modules/arr-diff/index.js | 47 + node_modules/arr-diff/package.json | 109 + node_modules/arr-filter/LICENSE | 21 + node_modules/arr-filter/README.md | 72 + node_modules/arr-filter/index.js | 33 + node_modules/arr-filter/package.json | 92 + node_modules/arr-flatten/LICENSE | 21 + node_modules/arr-flatten/README.md | 86 + node_modules/arr-flatten/index.js | 22 + node_modules/arr-flatten/package.json | 113 + node_modules/arr-map/LICENSE | 21 + node_modules/arr-map/README.md | 78 + node_modules/arr-map/index.js | 23 + node_modules/arr-map/package.json | 95 + node_modules/arr-union/LICENSE | 21 + node_modules/arr-union/README.md | 99 + node_modules/arr-union/index.js | 29 + node_modules/arr-union/package.json | 108 + node_modules/array-each/LICENSE | 21 + node_modules/array-each/README.md | 84 + node_modules/array-each/index.js | 46 + node_modules/array-each/package.json | 82 + node_modules/array-initial/.jshintrc | 17 + node_modules/array-initial/.npmignore | 59 + node_modules/array-initial/.travis.yml | 14 + node_modules/array-initial/LICENSE-MIT | 24 + node_modules/array-initial/README.md | 39 + node_modules/array-initial/index.js | 21 + .../node_modules/is-number/LICENSE | 21 + .../node_modules/is-number/README.md | 135 + .../node_modules/is-number/index.js | 21 + .../node_modules/is-number/package.json | 113 + node_modules/array-initial/package.json | 71 + node_modules/array-last/LICENSE | 21 + node_modules/array-last/README.md | 94 + node_modules/array-last/index.js | 30 + .../array-last/node_modules/is-number/LICENSE | 21 + .../node_modules/is-number/README.md | 135 + .../node_modules/is-number/index.js | 21 + .../node_modules/is-number/package.json | 113 + node_modules/array-last/package.json | 119 + node_modules/array-slice/LICENSE | 21 + node_modules/array-slice/README.md | 82 + node_modules/array-slice/index.js | 33 + node_modules/array-slice/package.json | 86 + node_modules/array-sort/LICENSE | 21 + node_modules/array-sort/README.md | 203 + node_modules/array-sort/index.js | 105 + .../array-sort/node_modules/kind-of/LICENSE | 21 + .../array-sort/node_modules/kind-of/README.md | 342 + .../array-sort/node_modules/kind-of/index.js | 147 + .../node_modules/kind-of/package.json | 146 + node_modules/array-sort/package.json | 137 + node_modules/array-unique/LICENSE | 21 + node_modules/array-unique/README.md | 77 + node_modules/array-unique/index.js | 43 + node_modules/array-unique/package.json | 96 + node_modules/asn1.js/README.md | 100 + node_modules/asn1.js/lib/asn1.js | 9 + node_modules/asn1.js/lib/asn1/api.js | 61 + node_modules/asn1.js/lib/asn1/base/buffer.js | 116 + node_modules/asn1.js/lib/asn1/base/index.js | 6 + node_modules/asn1.js/lib/asn1/base/node.js | 634 ++ .../asn1.js/lib/asn1/base/reporter.js | 121 + .../asn1.js/lib/asn1/constants/der.js | 42 + .../asn1.js/lib/asn1/constants/index.js | 19 + node_modules/asn1.js/lib/asn1/decoders/der.js | 324 + .../asn1.js/lib/asn1/decoders/index.js | 4 + node_modules/asn1.js/lib/asn1/decoders/pem.js | 49 + node_modules/asn1.js/lib/asn1/encoders/der.js | 295 + .../asn1.js/lib/asn1/encoders/index.js | 4 + node_modules/asn1.js/lib/asn1/encoders/pem.js | 21 + node_modules/asn1.js/package.json | 58 + node_modules/assert/.travis.yml | 30 + node_modules/assert/.zuul.yml | 13 + node_modules/assert/CHANGELOG.md | 8 + node_modules/assert/LICENSE | 18 + node_modules/assert/README.md | 105 + node_modules/assert/assert.js | 506 + .../assert/node_modules/inherits/LICENSE | 16 + .../assert/node_modules/inherits/README.md | 42 + .../assert/node_modules/inherits/inherits.js | 1 + .../node_modules/inherits/inherits_browser.js | 23 + .../assert/node_modules/inherits/package.json | 54 + .../assert/node_modules/inherits/test.js | 25 + .../assert/node_modules/util/.npmignore | 1 + .../assert/node_modules/util/.travis.yml | 8 + .../assert/node_modules/util/.zuul.yml | 10 + node_modules/assert/node_modules/util/LICENSE | 18 + .../assert/node_modules/util/README.md | 15 + .../assert/node_modules/util/package.json | 59 + .../node_modules/util/support/isBuffer.js | 3 + .../util/support/isBufferBrowser.js | 6 + .../node_modules/util/test/browser/inspect.js | 41 + .../node_modules/util/test/browser/is.js | 91 + .../node_modules/util/test/node/debug.js | 86 + .../node_modules/util/test/node/format.js | 77 + .../node_modules/util/test/node/inspect.js | 195 + .../assert/node_modules/util/test/node/log.js | 58 + .../node_modules/util/test/node/util.js | 83 + node_modules/assert/node_modules/util/util.js | 586 ++ node_modules/assert/package.json | 60 + node_modules/assert/test.js | 360 + node_modules/assign-symbols/LICENSE | 21 + node_modules/assign-symbols/README.md | 73 + node_modules/assign-symbols/index.js | 40 + node_modules/assign-symbols/package.json | 71 + node_modules/async-done/LICENSE | 21 + node_modules/async-done/README.md | 121 + node_modules/async-done/index.d.ts | 101 + node_modules/async-done/index.js | 88 + node_modules/async-done/package.json | 115 + node_modules/async-each/README.md | 52 + node_modules/async-each/index.js | 38 + node_modules/async-each/package.json | 63 + node_modules/async-settle/LICENSE | 21 + node_modules/async-settle/README.md | 96 + node_modules/async-settle/index.js | 21 + node_modules/async-settle/package.json | 86 + node_modules/atob/LICENSE | 230 + node_modules/atob/LICENSE.DOCS | 319 + node_modules/atob/README.md | 49 + node_modules/atob/bin/atob.js | 6 + node_modules/atob/bower.json | 24 + node_modules/atob/browser-atob.js | 44 + node_modules/atob/node-atob.js | 7 + node_modules/atob/package.json | 53 + node_modules/atob/test.js | 18 + node_modules/bach/LICENSE | 21 + node_modules/bach/README.md | 252 + node_modules/bach/index.js | 8 + node_modules/bach/lib/helpers.js | 84 + node_modules/bach/lib/parallel.js | 30 + node_modules/bach/lib/series.js | 30 + node_modules/bach/lib/settleParallel.js | 31 + node_modules/bach/lib/settleSeries.js | 31 + node_modules/bach/package.json | 123 + node_modules/balanced-match/.npmignore | 5 + node_modules/balanced-match/LICENSE.md | 21 + node_modules/balanced-match/README.md | 91 + node_modules/balanced-match/index.js | 59 + node_modules/balanced-match/package.json | 77 + node_modules/base/LICENSE | 21 + node_modules/base/README.md | 491 + node_modules/base/index.js | 435 + .../base/node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 95 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 93 + .../is-accessor-descriptor/LICENSE | 21 + .../is-accessor-descriptor/README.md | 144 + .../is-accessor-descriptor/index.js | 69 + .../is-accessor-descriptor/package.json | 110 + .../node_modules/is-data-descriptor/LICENSE | 21 + .../node_modules/is-data-descriptor/README.md | 161 + .../node_modules/is-data-descriptor/index.js | 49 + .../is-data-descriptor/package.json | 109 + .../base/node_modules/is-descriptor/LICENSE | 21 + .../base/node_modules/is-descriptor/README.md | 193 + .../base/node_modules/is-descriptor/index.js | 22 + .../node_modules/is-descriptor/package.json | 114 + node_modules/base/package.json | 164 + node_modules/base64-js/LICENSE | 21 + node_modules/base64-js/README.md | 32 + node_modules/base64-js/base64js.min.js | 1 + node_modules/base64-js/index.js | 152 + node_modules/base64-js/package.json | 60 + node_modules/big.js/CHANGELOG.md | 146 + node_modules/big.js/LICENCE | 23 + node_modules/big.js/README.md | 201 + node_modules/big.js/big.js | 941 ++ node_modules/big.js/big.min.js | 2 + node_modules/big.js/big.mjs | 924 ++ node_modules/big.js/package.json | 76 + .../binary-extensions/binary-extensions.json | 252 + node_modules/binary-extensions/license | 9 + node_modules/binary-extensions/package.json | 68 + node_modules/binary-extensions/readme.md | 33 + node_modules/bluebird/LICENSE | 21 + node_modules/bluebird/README.md | 57 + node_modules/bluebird/changelog.md | 1 + .../bluebird/js/browser/bluebird.core.js | 3914 +++++++ .../bluebird/js/browser/bluebird.core.min.js | 31 + node_modules/bluebird/js/browser/bluebird.js | 5778 +++++++++++ .../bluebird/js/browser/bluebird.min.js | 31 + node_modules/bluebird/js/release/any.js | 21 + node_modules/bluebird/js/release/assert.js | 55 + node_modules/bluebird/js/release/async.js | 120 + node_modules/bluebird/js/release/bind.js | 67 + node_modules/bluebird/js/release/bluebird.js | 11 + node_modules/bluebird/js/release/call_get.js | 123 + node_modules/bluebird/js/release/cancel.js | 129 + .../bluebird/js/release/catch_filter.js | 42 + node_modules/bluebird/js/release/context.js | 69 + .../bluebird/js/release/debuggability.js | 1009 ++ .../bluebird/js/release/direct_resolve.js | 46 + node_modules/bluebird/js/release/each.js | 30 + node_modules/bluebird/js/release/errors.js | 116 + node_modules/bluebird/js/release/es5.js | 80 + node_modules/bluebird/js/release/filter.js | 12 + node_modules/bluebird/js/release/finally.js | 146 + .../bluebird/js/release/generators.js | 223 + node_modules/bluebird/js/release/join.js | 165 + node_modules/bluebird/js/release/map.js | 175 + node_modules/bluebird/js/release/method.js | 55 + node_modules/bluebird/js/release/nodeback.js | 51 + node_modules/bluebird/js/release/nodeify.js | 58 + node_modules/bluebird/js/release/promise.js | 819 ++ .../bluebird/js/release/promise_array.js | 186 + node_modules/bluebird/js/release/promisify.js | 314 + node_modules/bluebird/js/release/props.js | 118 + node_modules/bluebird/js/release/queue.js | 73 + node_modules/bluebird/js/release/race.js | 49 + node_modules/bluebird/js/release/reduce.js | 183 + node_modules/bluebird/js/release/schedule.js | 62 + node_modules/bluebird/js/release/settle.js | 47 + node_modules/bluebird/js/release/some.js | 148 + .../js/release/synchronous_inspection.js | 103 + node_modules/bluebird/js/release/thenables.js | 86 + node_modules/bluebird/js/release/timers.js | 93 + node_modules/bluebird/js/release/using.js | 226 + node_modules/bluebird/js/release/util.js | 421 + node_modules/bluebird/package.json | 102 + node_modules/bn.js/.npmignore | 8 + node_modules/bn.js/README.md | 221 + node_modules/bn.js/lib/bn.js | 3427 ++++++ node_modules/bn.js/package.json | 71 + node_modules/bn.js/util/genCombMulTo.js | 65 + node_modules/bn.js/util/genCombMulTo10.js | 65 + node_modules/brace-expansion/LICENSE | 21 + node_modules/brace-expansion/README.md | 129 + node_modules/brace-expansion/index.js | 201 + node_modules/brace-expansion/package.json | 75 + node_modules/braces/LICENSE | 21 + node_modules/braces/README.md | 640 ++ node_modules/braces/index.js | 318 + node_modules/braces/lib/braces.js | 104 + node_modules/braces/lib/compilers.js | 282 + node_modules/braces/lib/parsers.js | 360 + node_modules/braces/lib/utils.js | 343 + .../node_modules/extend-shallow/LICENSE | 21 + .../node_modules/extend-shallow/README.md | 61 + .../node_modules/extend-shallow/index.js | 33 + .../node_modules/extend-shallow/package.json | 87 + node_modules/braces/package.json | 157 + node_modules/brorand/.npmignore | 2 + node_modules/brorand/README.md | 26 + node_modules/brorand/index.js | 65 + node_modules/brorand/package.json | 60 + node_modules/brorand/test/api-test.js | 8 + node_modules/browserify-aes/.travis.yml | 15 + node_modules/browserify-aes/LICENSE | 21 + node_modules/browserify-aes/README.md | 19 + node_modules/browserify-aes/aes.js | 228 + node_modules/browserify-aes/authCipher.js | 117 + node_modules/browserify-aes/browser.js | 13 + node_modules/browserify-aes/decrypter.js | 124 + node_modules/browserify-aes/encrypter.js | 114 + node_modules/browserify-aes/ghash.js | 89 + node_modules/browserify-aes/incr32.js | 15 + node_modules/browserify-aes/index.js | 7 + node_modules/browserify-aes/modes/cbc.js | 17 + node_modules/browserify-aes/modes/cfb.js | 33 + node_modules/browserify-aes/modes/cfb1.js | 42 + node_modules/browserify-aes/modes/cfb8.js | 25 + node_modules/browserify-aes/modes/ctr.js | 30 + node_modules/browserify-aes/modes/ecb.js | 7 + node_modules/browserify-aes/modes/index.js | 18 + node_modules/browserify-aes/modes/list.json | 191 + node_modules/browserify-aes/modes/ofb.js | 16 + node_modules/browserify-aes/package.json | 69 + node_modules/browserify-aes/streamCipher.js | 27 + node_modules/browserify-cipher/.travis.yml | 14 + node_modules/browserify-cipher/LICENSE | 21 + node_modules/browserify-cipher/README.md | 7 + node_modules/browserify-cipher/browser.js | 67 + node_modules/browserify-cipher/index.js | 7 + node_modules/browserify-cipher/package.json | 58 + node_modules/browserify-cipher/test.js | 55 + node_modules/browserify-des/.travis.yml | 8 + node_modules/browserify-des/index.js | 50 + node_modules/browserify-des/license | 21 + node_modules/browserify-des/modes.js | 24 + node_modules/browserify-des/package.json | 58 + node_modules/browserify-des/readme.md | 6 + node_modules/browserify-des/test.js | 81 + node_modules/browserify-rsa/.travis.yml | 3 + node_modules/browserify-rsa/LICENSE | 21 + node_modules/browserify-rsa/index.js | 40 + node_modules/browserify-rsa/package.json | 54 + node_modules/browserify-rsa/readme.md | 10 + node_modules/browserify-rsa/test.js | 53 + node_modules/browserify-sign/LICENSE | 13 + node_modules/browserify-sign/README.md | 13 + node_modules/browserify-sign/algos.js | 1 + .../browserify-sign/browser/algorithms.json | 152 + .../browserify-sign/browser/curves.json | 8 + node_modules/browserify-sign/browser/index.js | 91 + node_modules/browserify-sign/browser/sign.js | 145 + .../browserify-sign/browser/verify.js | 83 + node_modules/browserify-sign/index.js | 7 + node_modules/browserify-sign/package.json | 66 + node_modules/browserify-zlib/.npmignore | 7 + node_modules/browserify-zlib/.travis.yml | 16 + node_modules/browserify-zlib/LICENSE | 70 + node_modules/browserify-zlib/README.md | 24 + node_modules/browserify-zlib/karma.conf.js | 11 + node_modules/browserify-zlib/lib/binding.js | 409 + node_modules/browserify-zlib/lib/index.js | 609 ++ node_modules/browserify-zlib/package.json | 92 + node_modules/browserify-zlib/src/binding.js | 432 + node_modules/browserify-zlib/src/index.js | 650 ++ node_modules/browserify-zlib/yarn.lock | 3819 +++++++ node_modules/buffer-equal/.travis.yml | 4 + node_modules/buffer-equal/LICENSE | 18 + node_modules/buffer-equal/README.markdown | 62 + node_modules/buffer-equal/example/eq.js | 14 + node_modules/buffer-equal/index.js | 14 + node_modules/buffer-equal/package.json | 62 + node_modules/buffer-equal/test/eq.js | 35 + node_modules/buffer-from/LICENSE | 21 + node_modules/buffer-from/index.js | 69 + node_modules/buffer-from/package.json | 53 + node_modules/buffer-from/readme.md | 69 + node_modules/buffer-xor/.npmignore | 1 + node_modules/buffer-xor/.travis.yml | 9 + node_modules/buffer-xor/LICENSE | 21 + node_modules/buffer-xor/README.md | 41 + node_modules/buffer-xor/index.js | 10 + node_modules/buffer-xor/inline.js | 1 + node_modules/buffer-xor/inplace.js | 9 + node_modules/buffer-xor/package.json | 64 + node_modules/buffer-xor/test/fixtures.json | 23 + node_modules/buffer-xor/test/index.js | 38 + node_modules/buffer/.travis.yml | 8 + node_modules/buffer/AUTHORS.md | 44 + node_modules/buffer/LICENSE | 21 + node_modules/buffer/README.md | 378 + .../buffer/bin/download-node-tests.js | 106 + node_modules/buffer/bin/test.js | 41 + node_modules/buffer/bin/update-authors.sh | 21 + node_modules/buffer/bin/zuul-es5.yml | 14 + node_modules/buffer/bin/zuul-es6.yml | 6 + node_modules/buffer/index.js | 1789 ++++ node_modules/buffer/package.json | 108 + node_modules/buffer/test/_polyfill.js | 150 + node_modules/buffer/test/base64.js | 47 + node_modules/buffer/test/basic.js | 85 + node_modules/buffer/test/compare.js | 59 + node_modules/buffer/test/constructor.js | 193 + node_modules/buffer/test/from-string.js | 132 + node_modules/buffer/test/is-buffer.js | 22 + node_modules/buffer/test/methods.js | 127 + .../buffer/test/node/test-buffer-alloc.js | 1501 +++ .../test/node/test-buffer-arraybuffer.js | 112 + .../buffer/test/node/test-buffer-ascii.js | 28 + .../test/node/test-buffer-bad-overload.js | 18 + .../buffer/test/node/test-buffer-badhex.js | 46 + .../test/node/test-buffer-bytelength.js | 90 + .../test/node/test-buffer-compare-offset.js | 66 + .../buffer/test/node/test-buffer-concat.js | 40 + .../buffer/test/node/test-buffer-fill.js | 272 + .../buffer/test/node/test-buffer-includes.js | 305 + .../buffer/test/node/test-buffer-indexof.js | 523 + .../test/node/test-buffer-inheritance.js | 42 + .../buffer/test/node/test-buffer-inspect.js | 41 + .../buffer/test/node/test-buffer-iterator.js | 65 + .../test/node/test-buffer-safe-unsafe.js | 27 + .../buffer/test/node/test-buffer-slow.js | 63 + .../buffer/test/node/test-buffer-swap.js | 141 + .../test/node/test-buffer-zero-fill-cli.js | 35 + .../test/node/test-buffer-zero-fill-reset.js | 22 + node_modules/buffer/test/node/test-buffer.js | 1534 +++ node_modules/buffer/test/slice.js | 37 + node_modules/buffer/test/static.js | 17 + node_modules/buffer/test/to-string.js | 233 + node_modules/buffer/test/write.js | 131 + node_modules/buffer/test/write_infinity.js | 45 + node_modules/builtin-status-codes/browser.js | 64 + node_modules/builtin-status-codes/build.js | 8 + node_modules/builtin-status-codes/index.js | 3 + node_modules/builtin-status-codes/license | 21 + .../builtin-status-codes/package.json | 71 + node_modules/builtin-status-codes/readme.md | 31 + node_modules/cacache/CHANGELOG.md | 657 ++ node_modules/cacache/LICENSE.md | 16 + node_modules/cacache/README.es.md | 628 ++ node_modules/cacache/README.md | 641 ++ node_modules/cacache/en.js | 3 + node_modules/cacache/es.js | 3 + node_modules/cacache/get.js | 247 + node_modules/cacache/index.js | 3 + node_modules/cacache/lib/content/path.js | 26 + node_modules/cacache/lib/content/read.js | 195 + node_modules/cacache/lib/content/rm.js | 21 + node_modules/cacache/lib/content/write.js | 164 + node_modules/cacache/lib/entry-index.js | 288 + node_modules/cacache/lib/memoization.js | 69 + node_modules/cacache/lib/util/fix-owner.js | 128 + .../cacache/lib/util/hash-to-segments.js | 11 + node_modules/cacache/lib/util/move-file.js | 51 + node_modules/cacache/lib/util/tmp.js | 37 + node_modules/cacache/lib/util/y.js | 25 + node_modules/cacache/lib/verify.js | 227 + node_modules/cacache/locales/en.js | 47 + node_modules/cacache/locales/en.json | 7 + node_modules/cacache/locales/es.js | 49 + node_modules/cacache/locales/es.json | 6 + node_modules/cacache/ls.js | 6 + node_modules/cacache/package.json | 126 + node_modules/cacache/put.js | 86 + node_modules/cacache/rm.js | 28 + node_modules/cacache/verify.js | 3 + node_modules/cache-base/LICENSE | 21 + node_modules/cache-base/README.md | 291 + node_modules/cache-base/index.js | 261 + node_modules/cache-base/package.json | 118 + node_modules/camelcase/index.d.ts | 63 + node_modules/camelcase/index.js | 76 + node_modules/camelcase/license | 9 + node_modules/camelcase/package.json | 75 + node_modules/camelcase/readme.md | 99 + node_modules/chalk/index.js | 228 + node_modules/chalk/index.js.flow | 93 + node_modules/chalk/license | 9 + .../node_modules/supports-color/browser.js | 5 + .../node_modules/supports-color/index.js | 131 + .../chalk/node_modules/supports-color/license | 9 + .../node_modules/supports-color/package.json | 85 + .../node_modules/supports-color/readme.md | 66 + node_modules/chalk/package.json | 105 + node_modules/chalk/readme.md | 314 + node_modules/chalk/templates.js | 128 + node_modules/chalk/types/index.d.ts | 97 + node_modules/chokidar/CHANGELOG.md | 317 + node_modules/chokidar/README.md | 294 + node_modules/chokidar/index.js | 747 ++ node_modules/chokidar/lib/fsevents-handler.js | 412 + node_modules/chokidar/lib/nodefs-handler.js | 506 + node_modules/chokidar/package.json | 92 + node_modules/chokidar/types/index.d.ts | 191 + node_modules/chownr/LICENSE | 15 + node_modules/chownr/README.md | 3 + node_modules/chownr/chownr.js | 167 + node_modules/chownr/package.json | 62 + node_modules/chrome-trace-event/.travis.yml | 22 + node_modules/chrome-trace-event/CHANGES.md | 26 + node_modules/chrome-trace-event/LICENSE.txt | 23 + node_modules/chrome-trace-event/Makefile | 42 + node_modules/chrome-trace-event/README.md | 31 + .../chrome-trace-event/dist/trace-event.d.ts | 52 + .../chrome-trace-event/dist/trace-event.js | 178 + .../dist/trace-event.js.map | 1 + node_modules/chrome-trace-event/package.json | 64 + node_modules/chrome-trace-event/tsconfig.json | 28 + node_modules/cipher-base/.eslintrc | 3 + node_modules/cipher-base/.npmignore | 1 + node_modules/cipher-base/.travis.yml | 6 + node_modules/cipher-base/LICENSE | 21 + node_modules/cipher-base/README.md | 17 + node_modules/cipher-base/index.js | 99 + node_modules/cipher-base/package.json | 63 + node_modules/cipher-base/test.js | 111 + node_modules/class-utils/LICENSE | 21 + node_modules/class-utils/README.md | 300 + node_modules/class-utils/index.js | 370 + .../node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 77 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 82 + node_modules/class-utils/package.json | 131 + node_modules/cliui/CHANGELOG.md | 65 + node_modules/cliui/LICENSE.txt | 14 + node_modules/cliui/README.md | 115 + node_modules/cliui/index.js | 324 + node_modules/cliui/package.json | 99 + node_modules/clone-buffer/LICENSE | 21 + node_modules/clone-buffer/README.md | 47 + node_modules/clone-buffer/index.js | 28 + node_modules/clone-buffer/package.json | 82 + node_modules/clone-stats/LICENSE.md | 21 + node_modules/clone-stats/README.md | 17 + node_modules/clone-stats/index.js | 13 + node_modules/clone-stats/package.json | 60 + node_modules/clone-stats/test.js | 36 + node_modules/clone/.npmignore | 4 + node_modules/clone/LICENSE | 18 + node_modules/clone/README.md | 194 + node_modules/clone/clone.iml | 10 + node_modules/clone/clone.js | 257 + node_modules/clone/package.json | 158 + node_modules/cloneable-readable/.travis.yml | 13 + node_modules/cloneable-readable/LICENSE | 21 + node_modules/cloneable-readable/README.md | 54 + node_modules/cloneable-readable/example.js | 14 + node_modules/cloneable-readable/index.js | 153 + node_modules/cloneable-readable/package.json | 67 + node_modules/cloneable-readable/test.js | 702 ++ node_modules/code-point-at/index.js | 32 + node_modules/code-point-at/license | 21 + node_modules/code-point-at/package.json | 70 + node_modules/code-point-at/readme.md | 32 + node_modules/collection-map/LICENSE | 21 + node_modules/collection-map/README.md | 133 + node_modules/collection-map/index.js | 25 + node_modules/collection-map/package.json | 87 + node_modules/collection-visit/LICENSE | 21 + node_modules/collection-visit/README.md | 89 + node_modules/collection-visit/index.js | 30 + node_modules/collection-visit/package.json | 115 + node_modules/color-convert/CHANGELOG.md | 54 + node_modules/color-convert/LICENSE | 21 + node_modules/color-convert/README.md | 68 + node_modules/color-convert/conversions.js | 868 ++ node_modules/color-convert/index.js | 78 + node_modules/color-convert/package.json | 81 + node_modules/color-convert/route.js | 97 + node_modules/color-name/.eslintrc.json | 43 + node_modules/color-name/.npmignore | 107 + node_modules/color-name/LICENSE | 8 + node_modules/color-name/README.md | 11 + node_modules/color-name/index.js | 152 + node_modules/color-name/package.json | 53 + node_modules/color-name/test.js | 7 + node_modules/color-support/LICENSE | 15 + node_modules/color-support/README.md | 129 + node_modules/color-support/bin.js | 3 + node_modules/color-support/browser.js | 14 + node_modules/color-support/index.js | 134 + node_modules/color-support/package.json | 72 + node_modules/commander/CHANGELOG.md | 419 + node_modules/commander/LICENSE | 22 + node_modules/commander/Readme.md | 428 + node_modules/commander/index.js | 1224 +++ node_modules/commander/package.json | 70 + node_modules/commander/typings/index.d.ts | 310 + node_modules/commondir/LICENSE | 24 + node_modules/commondir/example/dir.js | 3 + node_modules/commondir/index.js | 29 + node_modules/commondir/package.json | 63 + node_modules/commondir/readme.markdown | 48 + node_modules/commondir/test/dirs.js | 55 + node_modules/component-emitter/History.md | 75 + node_modules/component-emitter/LICENSE | 24 + node_modules/component-emitter/Readme.md | 74 + node_modules/component-emitter/index.js | 175 + node_modules/component-emitter/package.json | 57 + node_modules/concat-map/.travis.yml | 4 + node_modules/concat-map/LICENSE | 18 + node_modules/concat-map/README.markdown | 62 + node_modules/concat-map/example/map.js | 6 + node_modules/concat-map/index.js | 13 + node_modules/concat-map/package.json | 88 + node_modules/concat-map/test/map.js | 39 + node_modules/concat-stream/LICENSE | 24 + node_modules/concat-stream/index.js | 144 + node_modules/concat-stream/package.json | 84 + node_modules/concat-stream/readme.md | 102 + node_modules/console-browserify/.testem.json | 14 + node_modules/console-browserify/.travis.yml | 11 + node_modules/console-browserify/CHANGELOG.md | 10 + node_modules/console-browserify/LICENCE | 19 + node_modules/console-browserify/README.md | 42 + node_modules/console-browserify/index.js | 87 + node_modules/console-browserify/package.json | 90 + node_modules/console-browserify/test/index.js | 67 + .../console-browserify/test/static/index.html | 12 + .../test/static/test-adapter.js | 53 + node_modules/constants-browserify/README.md | 54 + node_modules/constants-browserify/build.sh | 1 + .../constants-browserify/constants.json | 209 + .../constants-browserify/package.json | 62 + node_modules/constants-browserify/test.js | 18 + node_modules/convert-source-map/LICENSE | 23 + node_modules/convert-source-map/README.md | 125 + node_modules/convert-source-map/index.js | 136 + node_modules/convert-source-map/package.json | 72 + node_modules/copy-concurrently/LICENSE | 14 + node_modules/copy-concurrently/README.md | 128 + node_modules/copy-concurrently/README.md~ | 127 + node_modules/copy-concurrently/copy.js | 225 + node_modules/copy-concurrently/is-windows.js | 2 + node_modules/copy-concurrently/package.json | 72 + node_modules/copy-descriptor/LICENSE | 21 + node_modules/copy-descriptor/index.js | 81 + node_modules/copy-descriptor/package.json | 87 + node_modules/copy-props/LICENSE | 21 + node_modules/copy-props/README.md | 227 + node_modules/copy-props/index.js | 226 + node_modules/copy-props/package.json | 77 + node_modules/core-util-is/LICENSE | 19 + node_modules/core-util-is/README.md | 3 + node_modules/core-util-is/float.patch | 604 ++ node_modules/core-util-is/lib/util.js | 107 + node_modules/core-util-is/package.json | 62 + node_modules/core-util-is/test.js | 68 + node_modules/create-ecdh/.travis.yml | 7 + node_modules/create-ecdh/LICENSE | 21 + node_modules/create-ecdh/browser.js | 124 + node_modules/create-ecdh/index.js | 3 + node_modules/create-ecdh/package.json | 62 + node_modules/create-ecdh/readme.md | 4 + node_modules/create-hash/.travis.yml | 17 + node_modules/create-hash/LICENSE | 21 + node_modules/create-hash/README.md | 19 + node_modules/create-hash/browser.js | 30 + node_modules/create-hash/index.js | 1 + node_modules/create-hash/md5.js | 5 + node_modules/create-hash/package.json | 70 + node_modules/create-hash/test.js | 41 + node_modules/create-hmac/LICENSE | 21 + node_modules/create-hmac/README.md | 20 + node_modules/create-hmac/browser.js | 62 + node_modules/create-hmac/index.js | 1 + node_modules/create-hmac/legacy.js | 46 + node_modules/create-hmac/package.json | 72 + node_modules/cross-spawn/CHANGELOG.md | 100 + node_modules/cross-spawn/LICENSE | 21 + node_modules/cross-spawn/README.md | 94 + node_modules/cross-spawn/index.js | 39 + node_modules/cross-spawn/lib/enoent.js | 59 + node_modules/cross-spawn/lib/parse.js | 125 + node_modules/cross-spawn/lib/util/escape.js | 45 + .../cross-spawn/lib/util/readShebang.js | 32 + .../cross-spawn/lib/util/resolveCommand.js | 47 + node_modules/cross-spawn/package.json | 108 + node_modules/crypto-browserify/.travis.yml | 27 + node_modules/crypto-browserify/.zuul.yml | 1 + node_modules/crypto-browserify/LICENSE | 24 + node_modules/crypto-browserify/README.md | 50 + .../crypto-browserify/example/bundle.js | 637 ++ .../crypto-browserify/example/index.html | 12 + .../crypto-browserify/example/test.js | 4 + node_modules/crypto-browserify/index.js | 97 + node_modules/crypto-browserify/package.json | 78 + node_modules/crypto-browserify/test/aes.js | 49 + .../crypto-browserify/test/create-hash.js | 50 + .../crypto-browserify/test/create-hmac.js | 50 + node_modules/crypto-browserify/test/dh.js | 49 + node_modules/crypto-browserify/test/ecdh.js | 61 + node_modules/crypto-browserify/test/index.js | 19 + .../crypto-browserify/test/node/dh.js | 51 + node_modules/crypto-browserify/test/pbkdf2.js | 21 + .../crypto-browserify/test/public-encrypt.js | 36 + .../crypto-browserify/test/random-bytes.js | 60 + .../crypto-browserify/test/random-fill.js | 53 + node_modules/crypto-browserify/test/sign.js | 59 + node_modules/cyclist/.npmignore | 2 + node_modules/cyclist/.travis.yml | 5 + node_modules/cyclist/LICENSE | 21 + node_modules/cyclist/README.md | 43 + node_modules/cyclist/index.js | 33 + node_modules/cyclist/package.json | 59 + node_modules/cyclist/test.js | 37 + node_modules/d/.editorconfig | 15 + node_modules/d/.github/FUNDING.yml | 1 + node_modules/d/CHANGELOG.md | 9 + node_modules/d/CHANGES | 17 + node_modules/d/LICENSE | 15 + node_modules/d/README.md | 134 + node_modules/d/auto-bind.js | 33 + node_modules/d/index.js | 62 + node_modules/d/lazy.js | 115 + node_modules/d/package.json | 107 + node_modules/d/test/auto-bind.js | 11 + node_modules/d/test/index.js | 209 + node_modules/d/test/lazy.js | 97 + node_modules/debug/.coveralls.yml | 1 + node_modules/debug/.eslintrc | 11 + node_modules/debug/.npmignore | 9 + node_modules/debug/.travis.yml | 14 + node_modules/debug/CHANGELOG.md | 362 + node_modules/debug/LICENSE | 19 + node_modules/debug/Makefile | 50 + node_modules/debug/README.md | 312 + node_modules/debug/component.json | 19 + node_modules/debug/karma.conf.js | 70 + node_modules/debug/node.js | 1 + node_modules/debug/package.json | 89 + node_modules/debug/src/browser.js | 185 + node_modules/debug/src/debug.js | 202 + node_modules/debug/src/index.js | 10 + node_modules/debug/src/inspector-log.js | 15 + node_modules/debug/src/node.js | 248 + node_modules/decamelize/index.js | 13 + node_modules/decamelize/license | 21 + node_modules/decamelize/package.json | 70 + node_modules/decamelize/readme.md | 48 + node_modules/decode-uri-component/index.js | 94 + node_modules/decode-uri-component/license | 21 + .../decode-uri-component/package.json | 69 + node_modules/decode-uri-component/readme.md | 70 + node_modules/default-compare/LICENSE | 21 + node_modules/default-compare/README.md | 116 + node_modules/default-compare/index.js | 44 + .../node_modules/kind-of/LICENSE | 21 + .../node_modules/kind-of/README.md | 342 + .../node_modules/kind-of/index.js | 147 + .../node_modules/kind-of/package.json | 146 + node_modules/default-compare/package.json | 77 + node_modules/default-resolution/LICENSE | 21 + node_modules/default-resolution/README.md | 70 + node_modules/default-resolution/index.js | 17 + .../default-resolution/node-version.js | 10 + node_modules/default-resolution/package.json | 85 + node_modules/define-properties/.editorconfig | 13 + node_modules/define-properties/.eslintrc | 12 + node_modules/define-properties/.jscs.json | 175 + node_modules/define-properties/.travis.yml | 233 + node_modules/define-properties/CHANGELOG.md | 44 + node_modules/define-properties/LICENSE | 21 + node_modules/define-properties/README.md | 86 + node_modules/define-properties/index.js | 58 + node_modules/define-properties/package.json | 96 + node_modules/define-properties/test/index.js | 125 + node_modules/define-property/CHANGELOG.md | 82 + node_modules/define-property/LICENSE | 21 + node_modules/define-property/README.md | 117 + node_modules/define-property/index.js | 38 + .../is-accessor-descriptor/LICENSE | 21 + .../is-accessor-descriptor/README.md | 144 + .../is-accessor-descriptor/index.js | 69 + .../is-accessor-descriptor/package.json | 110 + .../node_modules/is-data-descriptor/LICENSE | 21 + .../node_modules/is-data-descriptor/README.md | 161 + .../node_modules/is-data-descriptor/index.js | 49 + .../is-data-descriptor/package.json | 109 + .../node_modules/is-descriptor/LICENSE | 21 + .../node_modules/is-descriptor/README.md | 193 + .../node_modules/is-descriptor/index.js | 22 + .../node_modules/is-descriptor/package.json | 114 + node_modules/define-property/package.json | 108 + node_modules/des.js/.jscsrc | 46 + node_modules/des.js/.jshintrc | 89 + node_modules/des.js/README.md | 26 + node_modules/des.js/lib/des.js | 7 + node_modules/des.js/lib/des/cbc.js | 65 + node_modules/des.js/lib/des/cipher.js | 141 + node_modules/des.js/lib/des/des.js | 142 + node_modules/des.js/lib/des/ede.js | 54 + node_modules/des.js/lib/des/utils.js | 256 + node_modules/des.js/package.json | 62 + node_modules/des.js/test/cbc-test.js | 73 + node_modules/des.js/test/des-test.js | 139 + node_modules/des.js/test/ede-test.js | 73 + node_modules/des.js/test/fixtures.js | 5 + node_modules/des.js/test/utils-test.js | 169 + node_modules/detect-file/LICENSE | 21 + node_modules/detect-file/README.md | 99 + node_modules/detect-file/index.js | 109 + node_modules/detect-file/package.json | 91 + node_modules/diffie-hellman/.travis.yml | 10 + node_modules/diffie-hellman/LICENSE | 19 + node_modules/diffie-hellman/browser.js | 42 + node_modules/diffie-hellman/index.js | 10 + node_modules/diffie-hellman/lib/dh.js | 164 + .../diffie-hellman/lib/generatePrime.js | 105 + node_modules/diffie-hellman/lib/primes.json | 34 + node_modules/diffie-hellman/package.json | 62 + node_modules/diffie-hellman/readme.md | 4 + node_modules/domain-browser/HISTORY.md | 46 + node_modules/domain-browser/LICENSE.md | 23 + node_modules/domain-browser/README.md | 121 + node_modules/domain-browser/package.json | 172 + node_modules/domain-browser/source/index.js | 70 + node_modules/duplexify/.travis.yml | 6 + node_modules/duplexify/LICENSE | 21 + node_modules/duplexify/README.md | 97 + node_modules/duplexify/example.js | 21 + node_modules/duplexify/index.js | 234 + node_modules/duplexify/package.json | 67 + node_modules/duplexify/test.js | 295 + node_modules/each-props/LICENSE | 21 + node_modules/each-props/README.md | 125 + node_modules/each-props/index.js | 57 + node_modules/each-props/package.json | 77 + node_modules/elliptic/README.md | 238 + node_modules/elliptic/lib/elliptic.js | 13 + .../elliptic/lib/elliptic/curve/base.js | 376 + .../elliptic/lib/elliptic/curve/edwards.js | 432 + .../elliptic/lib/elliptic/curve/index.js | 8 + .../elliptic/lib/elliptic/curve/mont.js | 178 + .../elliptic/lib/elliptic/curve/short.js | 937 ++ node_modules/elliptic/lib/elliptic/curves.js | 206 + .../elliptic/lib/elliptic/ec/index.js | 241 + node_modules/elliptic/lib/elliptic/ec/key.js | 118 + .../elliptic/lib/elliptic/ec/signature.js | 134 + .../elliptic/lib/elliptic/eddsa/index.js | 118 + .../elliptic/lib/elliptic/eddsa/key.js | 95 + .../elliptic/lib/elliptic/eddsa/signature.js | 65 + .../lib/elliptic/precomputed/secp256k1.js | 780 ++ node_modules/elliptic/lib/elliptic/utils.js | 119 + node_modules/elliptic/package.json | 87 + node_modules/emoji-regex/LICENSE-MIT.txt | 20 + node_modules/emoji-regex/README.md | 73 + node_modules/emoji-regex/es2015/index.js | 6 + node_modules/emoji-regex/es2015/text.js | 6 + node_modules/emoji-regex/index.d.ts | 5 + node_modules/emoji-regex/index.js | 6 + node_modules/emoji-regex/package.json | 78 + node_modules/emoji-regex/text.js | 6 + node_modules/emojis-list/CHANGELOG.md | 85 + node_modules/emojis-list/LICENSE.md | 9 + node_modules/emojis-list/README.md | 36 + node_modules/emojis-list/index.js | 3077 ++++++ node_modules/emojis-list/package.json | 70 + node_modules/end-of-stream/LICENSE | 21 + node_modules/end-of-stream/README.md | 54 + node_modules/end-of-stream/index.js | 94 + node_modules/end-of-stream/package.json | 69 + node_modules/enhanced-resolve/LICENSE | 20 + node_modules/enhanced-resolve/README.md | 121 + .../enhanced-resolve/lib/AliasFieldPlugin.js | 74 + .../enhanced-resolve/lib/AliasPlugin.js | 77 + .../enhanced-resolve/lib/AppendPlugin.js | 33 + .../lib/CachedInputFileSystem.js | 307 + .../lib/CloneBasenamePlugin.js | 37 + .../lib/ConcordExtensionsPlugin.js | 62 + .../enhanced-resolve/lib/ConcordMainPlugin.js | 44 + .../lib/ConcordModulesPlugin.js | 68 + .../lib/DescriptionFilePlugin.js | 76 + .../lib/DescriptionFileUtils.js | 109 + .../lib/DirectoryExistsPlugin.js | 46 + .../enhanced-resolve/lib/FileExistsPlugin.js | 41 + .../enhanced-resolve/lib/FileKindPlugin.js | 24 + .../enhanced-resolve/lib/JoinRequestPlugin.js | 28 + .../enhanced-resolve/lib/LogInfoPlugin.js | 41 + .../enhanced-resolve/lib/MainFieldPlugin.js | 66 + .../lib/ModuleAppendPlugin.js | 44 + .../enhanced-resolve/lib/ModuleKindPlugin.js | 36 + .../ModulesInHierachicDirectoriesPlugin.js | 64 + .../lib/ModulesInRootPlugin.js | 32 + .../enhanced-resolve/lib/NextPlugin.js | 21 + .../lib/NodeJsInputFileSystem.js | 50 + .../enhanced-resolve/lib/ParsePlugin.js | 31 + node_modules/enhanced-resolve/lib/Resolver.js | 347 + .../enhanced-resolve/lib/ResolverFactory.js | 339 + .../enhanced-resolve/lib/ResultPlugin.js | 26 + .../enhanced-resolve/lib/SymlinkPlugin.js | 64 + .../lib/SyncAsyncFileSystemDecorator.js | 65 + .../enhanced-resolve/lib/TryNextPlugin.js | 28 + .../enhanced-resolve/lib/UnsafeCachePlugin.js | 49 + .../enhanced-resolve/lib/UseFilePlugin.js | 35 + node_modules/enhanced-resolve/lib/concord.js | 205 + .../lib/createInnerCallback.js | 52 + .../lib/createInnerContext.js | 30 + .../enhanced-resolve/lib/forEachBail.js | 69 + .../enhanced-resolve/lib/getInnerRequest.js | 26 + node_modules/enhanced-resolve/lib/getPaths.js | 35 + .../enhanced-resolve/lib/globToRegExp.js | 201 + node_modules/enhanced-resolve/lib/node.js | 201 + .../node_modules/memory-fs/LICENSE | 20 + .../node_modules/memory-fs/README.md | 29 + .../memory-fs/lib/MemoryFileSystem.js | 335 + .../memory-fs/lib/MemoryFileSystemError.js | 31 + .../node_modules/memory-fs/lib/join.js | 16 + .../node_modules/memory-fs/lib/normalize.js | 99 + .../node_modules/memory-fs/package.json | 75 + node_modules/enhanced-resolve/package.json | 96 + node_modules/errno/.jshintrc | 59 + node_modules/errno/.travis.yml | 11 + node_modules/errno/README.md | 145 + node_modules/errno/build.js | 43 + node_modules/errno/cli.js | 22 + node_modules/errno/custom.js | 57 + node_modules/errno/errno.js | 313 + node_modules/errno/package.json | 64 + node_modules/errno/test.js | 88 + node_modules/error-ex/LICENSE | 21 + node_modules/error-ex/README.md | 144 + node_modules/error-ex/index.js | 141 + node_modules/error-ex/package.json | 86 + node_modules/es5-ext/.editorconfig | 16 + node_modules/es5-ext/.github/FUNDING.yml | 1 + node_modules/es5-ext/CHANGELOG.md | 325 + node_modules/es5-ext/CHANGES | 650 ++ node_modules/es5-ext/LICENSE | 15 + node_modules/es5-ext/README.md | 1039 ++ .../es5-ext/array/#/@@iterator/implement.js | 10 + .../es5-ext/array/#/@@iterator/index.js | 5 + .../array/#/@@iterator/is-implemented.js | 16 + .../es5-ext/array/#/@@iterator/shim.js | 3 + .../es5-ext/array/#/_compare-by-length.js | 7 + node_modules/es5-ext/array/#/binary-search.js | 27 + node_modules/es5-ext/array/#/clear.js | 12 + node_modules/es5-ext/array/#/compact.js | 11 + .../es5-ext/array/#/concat/implement.js | 10 + node_modules/es5-ext/array/#/concat/index.js | 3 + .../es5-ext/array/#/concat/is-implemented.js | 5 + node_modules/es5-ext/array/#/concat/shim.js | 44 + node_modules/es5-ext/array/#/contains.js | 7 + .../es5-ext/array/#/copy-within/implement.js | 10 + .../es5-ext/array/#/copy-within/index.js | 3 + .../array/#/copy-within/is-implemented.js | 7 + .../es5-ext/array/#/copy-within/shim.js | 45 + node_modules/es5-ext/array/#/diff.js | 11 + node_modules/es5-ext/array/#/e-index-of.js | 28 + .../es5-ext/array/#/e-last-index-of.js | 31 + .../es5-ext/array/#/entries/implement.js | 10 + node_modules/es5-ext/array/#/entries/index.js | 3 + .../es5-ext/array/#/entries/is-implemented.js | 15 + node_modules/es5-ext/array/#/entries/shim.js | 4 + node_modules/es5-ext/array/#/exclusion.js | 25 + .../es5-ext/array/#/fill/implement.js | 10 + node_modules/es5-ext/array/#/fill/index.js | 3 + .../es5-ext/array/#/fill/is-implemented.js | 7 + node_modules/es5-ext/array/#/fill/shim.js | 25 + .../es5-ext/array/#/filter/implement.js | 10 + node_modules/es5-ext/array/#/filter/index.js | 3 + .../es5-ext/array/#/filter/is-implemented.js | 6 + node_modules/es5-ext/array/#/filter/shim.js | 23 + .../es5-ext/array/#/find-index/implement.js | 10 + .../es5-ext/array/#/find-index/index.js | 3 + .../array/#/find-index/is-implemented.js | 9 + .../es5-ext/array/#/find-index/shim.js | 26 + .../es5-ext/array/#/find/implement.js | 10 + node_modules/es5-ext/array/#/find/index.js | 3 + .../es5-ext/array/#/find/is-implemented.js | 9 + node_modules/es5-ext/array/#/find/shim.js | 9 + node_modules/es5-ext/array/#/first-index.js | 15 + node_modules/es5-ext/array/#/first.js | 9 + node_modules/es5-ext/array/#/flatten.js | 40 + .../es5-ext/array/#/for-each-right.js | 19 + node_modules/es5-ext/array/#/group.js | 28 + node_modules/es5-ext/array/#/index.js | 41 + node_modules/es5-ext/array/#/indexes-of.js | 12 + node_modules/es5-ext/array/#/intersection.js | 19 + node_modules/es5-ext/array/#/is-copy.js | 21 + node_modules/es5-ext/array/#/is-empty.js | 6 + node_modules/es5-ext/array/#/is-uniq.js | 9 + .../es5-ext/array/#/keys/implement.js | 10 + node_modules/es5-ext/array/#/keys/index.js | 3 + .../es5-ext/array/#/keys/is-implemented.js | 14 + node_modules/es5-ext/array/#/keys/shim.js | 4 + node_modules/es5-ext/array/#/last-index.js | 15 + node_modules/es5-ext/array/#/last.js | 9 + node_modules/es5-ext/array/#/map/implement.js | 10 + node_modules/es5-ext/array/#/map/index.js | 3 + .../es5-ext/array/#/map/is-implemented.js | 6 + node_modules/es5-ext/array/#/map/shim.js | 22 + node_modules/es5-ext/array/#/remove.js | 17 + node_modules/es5-ext/array/#/separate.js | 10 + .../es5-ext/array/#/slice/implement.js | 10 + node_modules/es5-ext/array/#/slice/index.js | 3 + .../es5-ext/array/#/slice/is-implemented.js | 5 + node_modules/es5-ext/array/#/slice/shim.js | 36 + node_modules/es5-ext/array/#/some-right.js | 21 + .../es5-ext/array/#/splice/implement.js | 10 + node_modules/es5-ext/array/#/splice/index.js | 3 + .../es5-ext/array/#/splice/is-implemented.js | 5 + node_modules/es5-ext/array/#/splice/shim.js | 15 + node_modules/es5-ext/array/#/uniq.js | 9 + .../es5-ext/array/#/values/implement.js | 10 + node_modules/es5-ext/array/#/values/index.js | 3 + .../es5-ext/array/#/values/is-implemented.js | 14 + node_modules/es5-ext/array/#/values/shim.js | 4 + node_modules/es5-ext/array/_is-extensible.js | 14 + .../es5-ext/array/_sub-array-dummy-safe.js | 22 + .../es5-ext/array/_sub-array-dummy.js | 15 + node_modules/es5-ext/array/from/implement.js | 10 + node_modules/es5-ext/array/from/index.js | 3 + .../es5-ext/array/from/is-implemented.js | 9 + node_modules/es5-ext/array/from/shim.js | 119 + node_modules/es5-ext/array/generate.js | 18 + node_modules/es5-ext/array/index.js | 11 + node_modules/es5-ext/array/is-plain-array.js | 11 + node_modules/es5-ext/array/of/implement.js | 10 + node_modules/es5-ext/array/of/index.js | 3 + .../es5-ext/array/of/is-implemented.js | 8 + node_modules/es5-ext/array/of/shim.js | 19 + node_modules/es5-ext/array/to-array.js | 6 + node_modules/es5-ext/array/valid-array.js | 8 + node_modules/es5-ext/boolean/index.js | 3 + node_modules/es5-ext/boolean/is-boolean.js | 10 + node_modules/es5-ext/date/#/copy.js | 5 + node_modules/es5-ext/date/#/days-in-month.js | 17 + node_modules/es5-ext/date/#/floor-day.js | 8 + node_modules/es5-ext/date/#/floor-month.js | 8 + node_modules/es5-ext/date/#/floor-year.js | 8 + node_modules/es5-ext/date/#/format.js | 20 + node_modules/es5-ext/date/#/index.js | 10 + .../es5-ext/date/ensure-time-value.js | 10 + node_modules/es5-ext/date/index.js | 9 + node_modules/es5-ext/date/is-date.js | 10 + node_modules/es5-ext/date/is-time-value.js | 9 + node_modules/es5-ext/date/valid-date.js | 8 + node_modules/es5-ext/error/#/index.js | 3 + node_modules/es5-ext/error/#/throw.js | 5 + node_modules/es5-ext/error/custom.js | 20 + node_modules/es5-ext/error/index.js | 8 + node_modules/es5-ext/error/is-error.js | 7 + node_modules/es5-ext/error/valid-error.js | 8 + node_modules/es5-ext/function/#/compose.js | 20 + node_modules/es5-ext/function/#/copy.js | 22 + node_modules/es5-ext/function/#/curry.js | 25 + node_modules/es5-ext/function/#/index.js | 13 + node_modules/es5-ext/function/#/lock.js | 10 + .../es5-ext/function/#/microtask-delay.js | 12 + node_modules/es5-ext/function/#/not.js | 11 + node_modules/es5-ext/function/#/partial.js | 14 + node_modules/es5-ext/function/#/spread.js | 9 + .../es5-ext/function/#/to-string-tokens.js | 17 + .../es5-ext/function/_define-length.js | 54 + node_modules/es5-ext/function/constant.js | 5 + node_modules/es5-ext/function/identity.js | 3 + node_modules/es5-ext/function/index.js | 15 + node_modules/es5-ext/function/invoke.js | 14 + node_modules/es5-ext/function/is-arguments.js | 6 + node_modules/es5-ext/function/is-function.js | 8 + node_modules/es5-ext/function/noop.js | 4 + node_modules/es5-ext/function/pluck.js | 7 + .../es5-ext/function/valid-function.js | 8 + node_modules/es5-ext/global.js | 35 + node_modules/es5-ext/index.js | 22 + node_modules/es5-ext/iterable/for-each.js | 11 + node_modules/es5-ext/iterable/index.js | 8 + node_modules/es5-ext/iterable/is.js | 11 + .../es5-ext/iterable/validate-object.js | 9 + node_modules/es5-ext/iterable/validate.js | 8 + node_modules/es5-ext/json/index.js | 3 + node_modules/es5-ext/json/safe-stringify.js | 37 + node_modules/es5-ext/math/_decimal-adjust.js | 29 + node_modules/es5-ext/math/_pack-ieee754.js | 88 + node_modules/es5-ext/math/_unpack-ieee754.js | 33 + node_modules/es5-ext/math/acosh/implement.js | 10 + node_modules/es5-ext/math/acosh/index.js | 3 + .../es5-ext/math/acosh/is-implemented.js | 7 + node_modules/es5-ext/math/acosh/shim.js | 12 + node_modules/es5-ext/math/asinh/implement.js | 10 + node_modules/es5-ext/math/asinh/index.js | 3 + .../es5-ext/math/asinh/is-implemented.js | 7 + node_modules/es5-ext/math/asinh/shim.js | 15 + node_modules/es5-ext/math/atanh/implement.js | 10 + node_modules/es5-ext/math/atanh/index.js | 3 + .../es5-ext/math/atanh/is-implemented.js | 7 + node_modules/es5-ext/math/atanh/shim.js | 14 + node_modules/es5-ext/math/cbrt/implement.js | 10 + node_modules/es5-ext/math/cbrt/index.js | 3 + .../es5-ext/math/cbrt/is-implemented.js | 7 + node_modules/es5-ext/math/cbrt/shim.js | 12 + node_modules/es5-ext/math/ceil-10.js | 3 + node_modules/es5-ext/math/clz32/implement.js | 10 + node_modules/es5-ext/math/clz32/index.js | 3 + .../es5-ext/math/clz32/is-implemented.js | 7 + node_modules/es5-ext/math/clz32/shim.js | 7 + node_modules/es5-ext/math/cosh/implement.js | 10 + node_modules/es5-ext/math/cosh/index.js | 3 + .../es5-ext/math/cosh/is-implemented.js | 7 + node_modules/es5-ext/math/cosh/shim.js | 11 + node_modules/es5-ext/math/expm1/implement.js | 10 + node_modules/es5-ext/math/expm1/index.js | 3 + .../es5-ext/math/expm1/is-implemented.js | 7 + node_modules/es5-ext/math/expm1/shim.js | 16 + node_modules/es5-ext/math/floor-10.js | 3 + node_modules/es5-ext/math/fround/implement.js | 10 + node_modules/es5-ext/math/fround/index.js | 3 + .../es5-ext/math/fround/is-implemented.js | 7 + node_modules/es5-ext/math/fround/shim.js | 33 + node_modules/es5-ext/math/hypot/implement.js | 10 + node_modules/es5-ext/math/hypot/index.js | 3 + .../es5-ext/math/hypot/is-implemented.js | 7 + node_modules/es5-ext/math/hypot/shim.js | 37 + node_modules/es5-ext/math/imul/implement.js | 10 + node_modules/es5-ext/math/imul/index.js | 3 + .../es5-ext/math/imul/is-implemented.js | 7 + node_modules/es5-ext/math/imul/shim.js | 17 + node_modules/es5-ext/math/index.js | 24 + node_modules/es5-ext/math/log10/implement.js | 10 + node_modules/es5-ext/math/log10/index.js | 3 + .../es5-ext/math/log10/is-implemented.js | 7 + node_modules/es5-ext/math/log10/shim.js | 14 + node_modules/es5-ext/math/log1p/implement.js | 10 + node_modules/es5-ext/math/log1p/index.js | 3 + .../es5-ext/math/log1p/is-implemented.js | 7 + node_modules/es5-ext/math/log1p/shim.js | 17 + node_modules/es5-ext/math/log2/implement.js | 10 + node_modules/es5-ext/math/log2/index.js | 3 + .../es5-ext/math/log2/is-implemented.js | 7 + node_modules/es5-ext/math/log2/shim.js | 14 + node_modules/es5-ext/math/round-10.js | 3 + node_modules/es5-ext/math/sign/implement.js | 10 + node_modules/es5-ext/math/sign/index.js | 3 + .../es5-ext/math/sign/is-implemented.js | 7 + node_modules/es5-ext/math/sign/shim.js | 7 + node_modules/es5-ext/math/sinh/implement.js | 10 + node_modules/es5-ext/math/sinh/index.js | 3 + .../es5-ext/math/sinh/is-implemented.js | 7 + node_modules/es5-ext/math/sinh/shim.js | 18 + node_modules/es5-ext/math/tanh/implement.js | 10 + node_modules/es5-ext/math/tanh/index.js | 3 + .../es5-ext/math/tanh/is-implemented.js | 7 + node_modules/es5-ext/math/tanh/shim.js | 17 + node_modules/es5-ext/math/trunc/implement.js | 10 + node_modules/es5-ext/math/trunc/index.js | 3 + .../es5-ext/math/trunc/is-implemented.js | 7 + node_modules/es5-ext/math/trunc/shim.js | 13 + node_modules/es5-ext/number/#/index.js | 3 + node_modules/es5-ext/number/#/pad.js | 16 + .../es5-ext/number/epsilon/implement.js | 10 + node_modules/es5-ext/number/epsilon/index.js | 3 + .../es5-ext/number/epsilon/is-implemented.js | 3 + node_modules/es5-ext/number/index.js | 17 + .../es5-ext/number/is-finite/implement.js | 10 + .../es5-ext/number/is-finite/index.js | 3 + .../number/is-finite/is-implemented.js | 7 + node_modules/es5-ext/number/is-finite/shim.js | 3 + .../es5-ext/number/is-integer/implement.js | 10 + .../es5-ext/number/is-integer/index.js | 3 + .../number/is-integer/is-implemented.js | 7 + .../es5-ext/number/is-integer/shim.js | 8 + .../es5-ext/number/is-nan/implement.js | 10 + node_modules/es5-ext/number/is-nan/index.js | 3 + .../es5-ext/number/is-nan/is-implemented.js | 7 + node_modules/es5-ext/number/is-nan/shim.js | 6 + node_modules/es5-ext/number/is-natural.js | 5 + node_modules/es5-ext/number/is-number.js | 10 + .../number/is-safe-integer/implement.js | 10 + .../es5-ext/number/is-safe-integer/index.js | 3 + .../number/is-safe-integer/is-implemented.js | 7 + .../es5-ext/number/is-safe-integer/shim.js | 10 + .../number/max-safe-integer/implement.js | 10 + .../es5-ext/number/max-safe-integer/index.js | 3 + .../number/max-safe-integer/is-implemented.js | 3 + .../number/min-safe-integer/implement.js | 10 + .../es5-ext/number/min-safe-integer/index.js | 3 + .../number/min-safe-integer/is-implemented.js | 3 + node_modules/es5-ext/number/to-integer.js | 12 + node_modules/es5-ext/number/to-pos-integer.js | 6 + node_modules/es5-ext/number/to-uint32.js | 6 + node_modules/es5-ext/object/_iterate.js | 30 + node_modules/es5-ext/object/assign-deep.js | 34 + .../es5-ext/object/assign/implement.js | 10 + node_modules/es5-ext/object/assign/index.js | 3 + .../es5-ext/object/assign/is-implemented.js | 9 + node_modules/es5-ext/object/assign/shim.js | 23 + node_modules/es5-ext/object/clear.js | 16 + node_modules/es5-ext/object/compact.js | 8 + node_modules/es5-ext/object/compare.js | 39 + node_modules/es5-ext/object/copy-deep.js | 35 + node_modules/es5-ext/object/copy.js | 19 + node_modules/es5-ext/object/count.js | 5 + node_modules/es5-ext/object/create.js | 43 + node_modules/es5-ext/object/ensure-array.js | 9 + .../es5-ext/object/ensure-finite-number.js | 9 + node_modules/es5-ext/object/ensure-integer.js | 9 + .../object/ensure-natural-number-value.js | 10 + .../es5-ext/object/ensure-natural-number.js | 10 + .../es5-ext/object/ensure-plain-function.js | 11 + .../es5-ext/object/ensure-plain-object.js | 9 + node_modules/es5-ext/object/ensure-promise.js | 9 + .../es5-ext/object/ensure-thenable.js | 9 + .../es5-ext/object/entries/implement.js | 10 + node_modules/es5-ext/object/entries/index.js | 3 + .../es5-ext/object/entries/is-implemented.js | 6 + node_modules/es5-ext/object/entries/shim.js | 14 + node_modules/es5-ext/object/eq.js | 7 + node_modules/es5-ext/object/every.js | 3 + node_modules/es5-ext/object/filter.js | 14 + node_modules/es5-ext/object/find-key.js | 3 + node_modules/es5-ext/object/find.js | 10 + node_modules/es5-ext/object/first-key.js | 13 + node_modules/es5-ext/object/flatten.js | 16 + node_modules/es5-ext/object/for-each.js | 3 + .../es5-ext/object/get-property-names.js | 17 + node_modules/es5-ext/object/index.js | 70 + node_modules/es5-ext/object/is-array-like.js | 17 + node_modules/es5-ext/object/is-callable.js | 5 + node_modules/es5-ext/object/is-copy-deep.js | 59 + node_modules/es5-ext/object/is-copy.js | 23 + node_modules/es5-ext/object/is-empty.js | 14 + .../es5-ext/object/is-finite-number.js | 5 + node_modules/es5-ext/object/is-integer.js | 10 + .../es5-ext/object/is-natural-number-value.js | 9 + .../es5-ext/object/is-natural-number.js | 5 + .../es5-ext/object/is-number-value.js | 9 + node_modules/es5-ext/object/is-object.js | 7 + .../es5-ext/object/is-plain-function.js | 11 + .../es5-ext/object/is-plain-object.js | 20 + node_modules/es5-ext/object/is-promise.js | 4 + node_modules/es5-ext/object/is-thenable.js | 6 + node_modules/es5-ext/object/is-value.js | 5 + node_modules/es5-ext/object/is.js | 10 + node_modules/es5-ext/object/key-of.js | 17 + node_modules/es5-ext/object/keys/implement.js | 10 + node_modules/es5-ext/object/keys/index.js | 3 + .../es5-ext/object/keys/is-implemented.js | 10 + node_modules/es5-ext/object/keys/shim.js | 7 + node_modules/es5-ext/object/map-keys.js | 18 + node_modules/es5-ext/object/map.js | 14 + .../es5-ext/object/mixin-prototypes.js | 25 + node_modules/es5-ext/object/mixin.js | 26 + .../es5-ext/object/normalize-options.js | 20 + node_modules/es5-ext/object/primitive-set.js | 10 + node_modules/es5-ext/object/safe-traverse.js | 16 + node_modules/es5-ext/object/serialize.js | 41 + .../object/set-prototype-of/implement.js | 12 + .../es5-ext/object/set-prototype-of/index.js | 3 + .../object/set-prototype-of/is-implemented.js | 9 + .../es5-ext/object/set-prototype-of/shim.js | 81 + node_modules/es5-ext/object/some.js | 3 + node_modules/es5-ext/object/to-array.js | 21 + node_modules/es5-ext/object/unserialize.js | 8 + node_modules/es5-ext/object/valid-callable.js | 6 + node_modules/es5-ext/object/valid-object.js | 8 + node_modules/es5-ext/object/valid-value.js | 8 + .../object/validate-array-like-object.js | 9 + .../es5-ext/object/validate-array-like.js | 8 + .../object/validate-stringifiable-value.js | 6 + .../es5-ext/object/validate-stringifiable.js | 12 + node_modules/es5-ext/optional-chaining.js | 12 + node_modules/es5-ext/package.json | 132 + node_modules/es5-ext/promise/#/as-callback.js | 15 + .../es5-ext/promise/#/finally/implement.js | 10 + .../es5-ext/promise/#/finally/index.js | 3 + .../promise/#/finally/is-implemented.js | 7 + .../es5-ext/promise/#/finally/shim.js | 24 + node_modules/es5-ext/promise/#/index.js | 3 + node_modules/es5-ext/promise/.eslintrc.json | 1 + node_modules/es5-ext/promise/index.js | 3 + node_modules/es5-ext/promise/lazy.js | 35 + node_modules/es5-ext/reg-exp/#/index.js | 10 + node_modules/es5-ext/reg-exp/#/is-sticky.js | 6 + node_modules/es5-ext/reg-exp/#/is-unicode.js | 6 + .../es5-ext/reg-exp/#/match/implement.js | 10 + node_modules/es5-ext/reg-exp/#/match/index.js | 3 + .../es5-ext/reg-exp/#/match/is-implemented.js | 8 + node_modules/es5-ext/reg-exp/#/match/shim.js | 8 + .../es5-ext/reg-exp/#/replace/implement.js | 10 + .../es5-ext/reg-exp/#/replace/index.js | 3 + .../reg-exp/#/replace/is-implemented.js | 8 + .../es5-ext/reg-exp/#/replace/shim.js | 8 + .../es5-ext/reg-exp/#/search/implement.js | 10 + .../es5-ext/reg-exp/#/search/index.js | 3 + .../reg-exp/#/search/is-implemented.js | 8 + node_modules/es5-ext/reg-exp/#/search/shim.js | 8 + .../es5-ext/reg-exp/#/split/implement.js | 10 + node_modules/es5-ext/reg-exp/#/split/index.js | 3 + .../es5-ext/reg-exp/#/split/is-implemented.js | 8 + node_modules/es5-ext/reg-exp/#/split/shim.js | 8 + .../es5-ext/reg-exp/#/sticky/implement.js | 11 + .../reg-exp/#/sticky/is-implemented.js | 10 + .../es5-ext/reg-exp/#/unicode/implement.js | 11 + .../reg-exp/#/unicode/is-implemented.js | 10 + node_modules/es5-ext/reg-exp/escape.js | 9 + node_modules/es5-ext/reg-exp/index.js | 8 + node_modules/es5-ext/reg-exp/is-reg-exp.js | 7 + node_modules/es5-ext/reg-exp/valid-reg-exp.js | 8 + node_modules/es5-ext/safe-to-string.js | 12 + .../es5-ext/string/#/@@iterator/implement.js | 10 + .../es5-ext/string/#/@@iterator/index.js | 5 + .../string/#/@@iterator/is-implemented.js | 16 + .../es5-ext/string/#/@@iterator/shim.js | 6 + node_modules/es5-ext/string/#/at.js | 35 + .../es5-ext/string/#/camel-to-hyphen.js | 9 + node_modules/es5-ext/string/#/capitalize.js | 8 + .../string/#/case-insensitive-compare.js | 7 + .../string/#/code-point-at/implement.js | 10 + .../es5-ext/string/#/code-point-at/index.js | 3 + .../string/#/code-point-at/is-implemented.js | 8 + .../es5-ext/string/#/code-point-at/shim.js | 26 + .../es5-ext/string/#/contains/implement.js | 10 + .../es5-ext/string/#/contains/index.js | 3 + .../string/#/contains/is-implemented.js | 8 + .../es5-ext/string/#/contains/shim.js | 7 + node_modules/es5-ext/string/#/count.js | 15 + .../es5-ext/string/#/ends-with/implement.js | 10 + .../es5-ext/string/#/ends-with/index.js | 3 + .../string/#/ends-with/is-implemented.js | 8 + .../es5-ext/string/#/ends-with/shim.js | 18 + .../es5-ext/string/#/hyphen-to-camel.js | 6 + node_modules/es5-ext/string/#/indent.js | 12 + node_modules/es5-ext/string/#/index.js | 23 + node_modules/es5-ext/string/#/last.js | 8 + .../es5-ext/string/#/normalize/_data.js | 6988 +++++++++++++ .../es5-ext/string/#/normalize/implement.js | 10 + .../es5-ext/string/#/normalize/index.js | 3 + .../string/#/normalize/is-implemented.js | 8 + .../es5-ext/string/#/normalize/shim.js | 309 + node_modules/es5-ext/string/#/pad.js | 16 + .../es5-ext/string/#/plain-replace-all.js | 16 + .../es5-ext/string/#/plain-replace.js | 9 + .../es5-ext/string/#/repeat/implement.js | 10 + node_modules/es5-ext/string/#/repeat/index.js | 3 + .../es5-ext/string/#/repeat/is-implemented.js | 8 + node_modules/es5-ext/string/#/repeat/shim.js | 24 + .../es5-ext/string/#/starts-with/implement.js | 10 + .../es5-ext/string/#/starts-with/index.js | 3 + .../string/#/starts-with/is-implemented.js | 8 + .../es5-ext/string/#/starts-with/shim.js | 12 + node_modules/es5-ext/string/#/uncapitalize.js | 8 + node_modules/es5-ext/string/format-method.js | 27 + .../string/from-code-point/implement.js | 10 + .../es5-ext/string/from-code-point/index.js | 3 + .../string/from-code-point/is-implemented.js | 7 + .../es5-ext/string/from-code-point/shim.js | 37 + node_modules/es5-ext/string/index.js | 11 + node_modules/es5-ext/string/is-string.js | 13 + node_modules/es5-ext/string/random-uniq.js | 11 + node_modules/es5-ext/string/random.js | 38 + node_modules/es5-ext/string/raw/implement.js | 10 + node_modules/es5-ext/string/raw/index.js | 3 + .../es5-ext/string/raw/is-implemented.js | 9 + node_modules/es5-ext/string/raw/shim.js | 14 + node_modules/es5-ext/test/.eslintrc.json | 12 + node_modules/es5-ext/test/__tad.js | 3 + .../test/array/#/@@iterator/implement.js | 5 + .../es5-ext/test/array/#/@@iterator/index.js | 3 + .../test/array/#/@@iterator/is-implemented.js | 3 + .../es5-ext/test/array/#/@@iterator/shim.js | 9 + .../test/array/#/_compare-by-length.js | 7 + .../es5-ext/test/array/#/binary-search.js | 15 + node_modules/es5-ext/test/array/#/clear.js | 7 + node_modules/es5-ext/test/array/#/compact.js | 15 + .../es5-ext/test/array/#/concat/implement.js | 5 + .../es5-ext/test/array/#/concat/index.js | 3 + .../test/array/#/concat/is-implemented.js | 3 + .../es5-ext/test/array/#/concat/shim.js | 29 + node_modules/es5-ext/test/array/#/contains.js | 21 + .../test/array/#/copy-within/implement.js | 5 + .../es5-ext/test/array/#/copy-within/index.js | 3 + .../array/#/copy-within/is-implemented.js | 3 + .../es5-ext/test/array/#/copy-within/shim.js | 29 + node_modules/es5-ext/test/array/#/diff.js | 13 + .../es5-ext/test/array/#/e-index-of.js | 13 + .../es5-ext/test/array/#/e-last-index-of.js | 12 + .../es5-ext/test/array/#/entries/implement.js | 5 + .../es5-ext/test/array/#/entries/index.js | 3 + .../test/array/#/entries/is-implemented.js | 3 + .../es5-ext/test/array/#/entries/shim.js | 9 + .../es5-ext/test/array/#/exclusion.js | 15 + .../es5-ext/test/array/#/fill/implement.js | 5 + .../es5-ext/test/array/#/fill/index.js | 3 + .../test/array/#/fill/is-implemented.js | 3 + .../es5-ext/test/array/#/fill/shim.js | 15 + .../es5-ext/test/array/#/filter/implement.js | 5 + .../es5-ext/test/array/#/filter/index.js | 3 + .../test/array/#/filter/is-implemented.js | 3 + .../es5-ext/test/array/#/filter/shim.js | 17 + .../test/array/#/find-index/implement.js | 5 + .../es5-ext/test/array/#/find-index/index.js | 3 + .../test/array/#/find-index/is-implemented.js | 3 + .../es5-ext/test/array/#/find-index/shim.js | 23 + .../es5-ext/test/array/#/find/implement.js | 5 + .../es5-ext/test/array/#/find/index.js | 3 + .../test/array/#/find/is-implemented.js | 3 + .../es5-ext/test/array/#/find/shim.js | 23 + .../es5-ext/test/array/#/first-index.js | 17 + node_modules/es5-ext/test/array/#/first.js | 11 + node_modules/es5-ext/test/array/#/flatten.js | 12 + .../es5-ext/test/array/#/for-each-right.js | 39 + node_modules/es5-ext/test/array/#/group.js | 30 + .../es5-ext/test/array/#/indexes-of.js | 12 + .../es5-ext/test/array/#/intersection.js | 25 + node_modules/es5-ext/test/array/#/is-copy.js | 12 + node_modules/es5-ext/test/array/#/is-empty.js | 8 + node_modules/es5-ext/test/array/#/is-uniq.js | 11 + .../es5-ext/test/array/#/keys/implement.js | 5 + .../es5-ext/test/array/#/keys/index.js | 3 + .../test/array/#/keys/is-implemented.js | 3 + .../es5-ext/test/array/#/keys/shim.js | 9 + .../es5-ext/test/array/#/last-index.js | 17 + node_modules/es5-ext/test/array/#/last.js | 13 + .../es5-ext/test/array/#/map/implement.js | 5 + .../es5-ext/test/array/#/map/index.js | 3 + .../test/array/#/map/is-implemented.js | 3 + node_modules/es5-ext/test/array/#/map/shim.js | 17 + node_modules/es5-ext/test/array/#/remove.js | 14 + node_modules/es5-ext/test/array/#/separate.js | 15 + .../es5-ext/test/array/#/slice/implement.js | 5 + .../es5-ext/test/array/#/slice/index.js | 3 + .../test/array/#/slice/is-implemented.js | 3 + .../es5-ext/test/array/#/slice/shim.js | 17 + .../es5-ext/test/array/#/some-right.js | 54 + .../es5-ext/test/array/#/splice/implement.js | 5 + .../es5-ext/test/array/#/splice/index.js | 3 + .../test/array/#/splice/is-implemented.js | 3 + .../es5-ext/test/array/#/splice/shim.js | 19 + node_modules/es5-ext/test/array/#/uniq.js | 12 + .../es5-ext/test/array/#/values/implement.js | 5 + .../es5-ext/test/array/#/values/index.js | 3 + .../test/array/#/values/is-implemented.js | 3 + .../es5-ext/test/array/#/values/shim.js | 9 + node_modules/es5-ext/test/array/__scopes.js | 9 + .../es5-ext/test/array/_is-extensible.js | 3 + .../test/array/_sub-array-dummy-safe.js | 5 + .../es5-ext/test/array/_sub-array-dummy.js | 5 + .../es5-ext/test/array/from/implement.js | 5 + node_modules/es5-ext/test/array/from/index.js | 3 + .../es5-ext/test/array/from/is-implemented.js | 3 + node_modules/es5-ext/test/array/from/shim.js | 64 + node_modules/es5-ext/test/array/generate.js | 10 + .../es5-ext/test/array/is-plain-array.js | 18 + .../es5-ext/test/array/of/implement.js | 5 + node_modules/es5-ext/test/array/of/index.js | 3 + .../es5-ext/test/array/of/is-implemented.js | 3 + node_modules/es5-ext/test/array/of/shim.js | 81 + node_modules/es5-ext/test/array/to-array.js | 11 + .../es5-ext/test/array/valid-array.js | 20 + .../es5-ext/test/boolean/is-boolean.js | 12 + node_modules/es5-ext/test/date/#/copy.js | 10 + .../es5-ext/test/date/#/days-in-month.js | 17 + node_modules/es5-ext/test/date/#/floor-day.js | 5 + .../es5-ext/test/date/#/floor-month.js | 5 + .../es5-ext/test/date/#/floor-year.js | 5 + node_modules/es5-ext/test/date/#/format.js | 6 + .../es5-ext/test/date/ensure-time-value.js | 8 + node_modules/es5-ext/test/date/is-date.js | 10 + .../es5-ext/test/date/is-time-value.js | 15 + node_modules/es5-ext/test/date/valid-date.js | 10 + node_modules/es5-ext/test/error/#/throw.js | 7 + node_modules/es5-ext/test/error/custom.js | 12 + node_modules/es5-ext/test/error/is-error.js | 15 + .../es5-ext/test/error/valid-error.js | 7 + .../es5-ext/test/function/#/compose.js | 10 + node_modules/es5-ext/test/function/#/copy.js | 20 + node_modules/es5-ext/test/function/#/curry.js | 17 + node_modules/es5-ext/test/function/#/lock.js | 5 + .../test/function/#/microtask-delay.js | 22 + node_modules/es5-ext/test/function/#/not.js | 11 + .../es5-ext/test/function/#/partial.js | 6 + .../es5-ext/test/function/#/spread.js | 5 + .../test/function/#/to-string-tokens.js | 26 + .../es5-ext/test/function/_define-length.js | 10 + .../es5-ext/test/function/constant.js | 5 + .../es5-ext/test/function/identity.js | 5 + node_modules/es5-ext/test/function/invoke.js | 6 + .../es5-ext/test/function/is-arguments.js | 11 + .../es5-ext/test/function/is-function.js | 14 + node_modules/es5-ext/test/function/noop.js | 3 + node_modules/es5-ext/test/function/pluck.js | 5 + .../es5-ext/test/function/valid-function.js | 14 + node_modules/es5-ext/test/global.js | 7 + .../es5-ext/test/iterable/for-each.js | 62 + node_modules/es5-ext/test/iterable/is.js | 20 + .../es5-ext/test/iterable/validate-object.js | 26 + .../es5-ext/test/iterable/validate.js | 26 + .../es5-ext/test/json/safe-stringify.js | 21 + .../es5-ext/test/math/_decimal-adjust.js | 6 + .../es5-ext/test/math/_pack-ieee754.js | 3 + .../es5-ext/test/math/_unpack-ieee754.js | 3 + .../es5-ext/test/math/acosh/implement.js | 5 + node_modules/es5-ext/test/math/acosh/index.js | 3 + .../es5-ext/test/math/acosh/is-implemented.js | 3 + node_modules/es5-ext/test/math/acosh/shim.js | 11 + .../es5-ext/test/math/asinh/implement.js | 5 + node_modules/es5-ext/test/math/asinh/index.js | 3 + .../es5-ext/test/math/asinh/is-implemented.js | 3 + node_modules/es5-ext/test/math/asinh/shim.js | 10 + .../es5-ext/test/math/atanh/implement.js | 5 + node_modules/es5-ext/test/math/atanh/index.js | 3 + .../es5-ext/test/math/atanh/is-implemented.js | 3 + node_modules/es5-ext/test/math/atanh/shim.js | 11 + .../es5-ext/test/math/cbrt/implement.js | 5 + node_modules/es5-ext/test/math/cbrt/index.js | 3 + .../es5-ext/test/math/cbrt/is-implemented.js | 3 + node_modules/es5-ext/test/math/cbrt/shim.js | 11 + node_modules/es5-ext/test/math/ceil-10.js | 8 + .../es5-ext/test/math/clz32/implement.js | 5 + node_modules/es5-ext/test/math/clz32/index.js | 3 + .../es5-ext/test/math/clz32/is-implemented.js | 3 + node_modules/es5-ext/test/math/clz32/shim.js | 12 + .../es5-ext/test/math/cosh/implement.js | 5 + node_modules/es5-ext/test/math/cosh/index.js | 3 + .../es5-ext/test/math/cosh/is-implemented.js | 3 + node_modules/es5-ext/test/math/cosh/shim.js | 13 + .../es5-ext/test/math/expm1/implement.js | 5 + node_modules/es5-ext/test/math/expm1/index.js | 3 + .../es5-ext/test/math/expm1/is-implemented.js | 3 + node_modules/es5-ext/test/math/expm1/shim.js | 9 + node_modules/es5-ext/test/math/floor-10.js | 8 + .../es5-ext/test/math/fround/implement.js | 5 + .../es5-ext/test/math/fround/index.js | 3 + .../test/math/fround/is-implemented.js | 3 + node_modules/es5-ext/test/math/fround/shim.js | 9 + .../es5-ext/test/math/hypot/implement.js | 5 + node_modules/es5-ext/test/math/hypot/index.js | 3 + .../es5-ext/test/math/hypot/is-implemented.js | 3 + node_modules/es5-ext/test/math/hypot/shim.js | 11 + .../es5-ext/test/math/imul/implement.js | 5 + node_modules/es5-ext/test/math/imul/index.js | 3 + .../es5-ext/test/math/imul/is-implemented.js | 3 + node_modules/es5-ext/test/math/imul/shim.js | 9 + .../es5-ext/test/math/log10/implement.js | 5 + node_modules/es5-ext/test/math/log10/index.js | 3 + .../es5-ext/test/math/log10/is-implemented.js | 3 + node_modules/es5-ext/test/math/log10/shim.js | 10 + .../es5-ext/test/math/log1p/implement.js | 5 + node_modules/es5-ext/test/math/log1p/index.js | 3 + .../es5-ext/test/math/log1p/is-implemented.js | 3 + node_modules/es5-ext/test/math/log1p/shim.js | 10 + .../es5-ext/test/math/log2/implement.js | 5 + node_modules/es5-ext/test/math/log2/index.js | 3 + .../es5-ext/test/math/log2/is-implemented.js | 3 + node_modules/es5-ext/test/math/log2/shim.js | 10 + node_modules/es5-ext/test/math/round-10.js | 14 + .../es5-ext/test/math/sign/implement.js | 5 + node_modules/es5-ext/test/math/sign/index.js | 3 + .../es5-ext/test/math/sign/is-implemented.js | 3 + node_modules/es5-ext/test/math/sign/shim.js | 11 + .../es5-ext/test/math/sinh/implement.js | 5 + node_modules/es5-ext/test/math/sinh/index.js | 3 + .../es5-ext/test/math/sinh/is-implemented.js | 3 + node_modules/es5-ext/test/math/sinh/shim.js | 13 + .../es5-ext/test/math/tanh/implement.js | 5 + node_modules/es5-ext/test/math/tanh/index.js | 3 + .../es5-ext/test/math/tanh/is-implemented.js | 3 + node_modules/es5-ext/test/math/tanh/shim.js | 11 + .../es5-ext/test/math/trunc/implement.js | 5 + node_modules/es5-ext/test/math/trunc/index.js | 3 + .../es5-ext/test/math/trunc/is-implemented.js | 3 + node_modules/es5-ext/test/math/trunc/shim.js | 16 + node_modules/es5-ext/test/number/#/pad.js | 7 + .../es5-ext/test/number/epsilon/implement.js | 5 + .../es5-ext/test/number/epsilon/index.js | 3 + .../test/number/epsilon/is-implemented.js | 3 + .../test/number/is-finite/implement.js | 5 + .../es5-ext/test/number/is-finite/index.js | 3 + .../test/number/is-finite/is-implemented.js | 3 + .../es5-ext/test/number/is-finite/shim.js | 8 + .../test/number/is-integer/implement.js | 5 + .../es5-ext/test/number/is-integer/index.js | 3 + .../test/number/is-integer/is-implemented.js | 3 + .../es5-ext/test/number/is-integer/shim.js | 9 + .../es5-ext/test/number/is-nan/implement.js | 5 + .../es5-ext/test/number/is-nan/index.js | 3 + .../test/number/is-nan/is-implemented.js | 3 + .../es5-ext/test/number/is-nan/shim.js | 7 + .../es5-ext/test/number/is-natural.js | 10 + node_modules/es5-ext/test/number/is-number.js | 13 + .../test/number/is-safe-integer/implement.js | 5 + .../test/number/is-safe-integer/index.js | 3 + .../number/is-safe-integer/is-implemented.js | 3 + .../test/number/is-safe-integer/shim.js | 11 + .../test/number/max-safe-integer/implement.js | 5 + .../test/number/max-safe-integer/index.js | 3 + .../number/max-safe-integer/is-implemented.js | 3 + .../test/number/min-safe-integer/implement.js | 5 + .../test/number/min-safe-integer/index.js | 3 + .../number/min-safe-integer/is-implemented.js | 3 + .../es5-ext/test/number/to-integer.js | 10 + .../es5-ext/test/number/to-pos-integer.js | 10 + node_modules/es5-ext/test/number/to-uint32.js | 8 + node_modules/es5-ext/test/object/_iterate.js | 36 + .../es5-ext/test/object/assign-deep.js | 27 + .../es5-ext/test/object/assign/implement.js | 5 + .../es5-ext/test/object/assign/index.js | 3 + .../test/object/assign/is-implemented.js | 3 + .../es5-ext/test/object/assign/shim.js | 10 + node_modules/es5-ext/test/object/clear.js | 13 + node_modules/es5-ext/test/object/compact.js | 12 + node_modules/es5-ext/test/object/compare.js | 13 + node_modules/es5-ext/test/object/copy-deep.js | 35 + node_modules/es5-ext/test/object/copy.js | 30 + node_modules/es5-ext/test/object/count.js | 14 + node_modules/es5-ext/test/object/create.js | 22 + .../es5-ext/test/object/ensure-array.js | 23 + .../test/object/ensure-finite-number.js | 18 + .../es5-ext/test/object/ensure-integer.js | 12 + .../object/ensure-natural-number-value.js | 12 + .../test/object/ensure-natural-number.js | 12 + .../test/object/ensure-plain-function.js | 8 + .../test/object/ensure-plain-object.js | 16 + .../es5-ext/test/object/ensure-promise.js | 20 + .../es5-ext/test/object/ensure-thenable.js | 9 + .../es5-ext/test/object/entries/implement.js | 5 + .../es5-ext/test/object/entries/index.js | 3 + .../test/object/entries/is-implemented.js | 3 + .../es5-ext/test/object/entries/shim.js | 8 + node_modules/es5-ext/test/object/eq.js | 12 + node_modules/es5-ext/test/object/every.js | 16 + node_modules/es5-ext/test/object/filter.js | 8 + node_modules/es5-ext/test/object/find-key.js | 24 + node_modules/es5-ext/test/object/find.js | 24 + node_modules/es5-ext/test/object/first-key.js | 13 + node_modules/es5-ext/test/object/flatten.js | 5 + node_modules/es5-ext/test/object/for-each.js | 7 + .../es5-ext/test/object/get-property-names.js | 17 + .../es5-ext/test/object/is-array-like.js | 14 + .../es5-ext/test/object/is-callable.js | 8 + .../es5-ext/test/object/is-copy-deep.js | 42 + node_modules/es5-ext/test/object/is-copy.js | 15 + node_modules/es5-ext/test/object/is-empty.js | 6 + .../es5-ext/test/object/is-finite-number.js | 18 + .../es5-ext/test/object/is-integer.js | 12 + .../test/object/is-natural-number-value.js | 12 + .../es5-ext/test/object/is-natural-number.js | 12 + .../es5-ext/test/object/is-number-value.js | 18 + node_modules/es5-ext/test/object/is-object.js | 13 + .../es5-ext/test/object/is-plain-function.js | 39 + .../es5-ext/test/object/is-plain-object.js | 23 + .../es5-ext/test/object/is-promise.js | 17 + .../es5-ext/test/object/is-thenable.js | 17 + node_modules/es5-ext/test/object/is-value.js | 14 + node_modules/es5-ext/test/object/is.js | 12 + node_modules/es5-ext/test/object/key-of.js | 11 + .../es5-ext/test/object/keys/implement.js | 5 + .../es5-ext/test/object/keys/index.js | 3 + .../test/object/keys/is-implemented.js | 3 + node_modules/es5-ext/test/object/keys/shim.js | 8 + node_modules/es5-ext/test/object/map-keys.js | 9 + node_modules/es5-ext/test/object/map.js | 12 + .../es5-ext/test/object/mixin-prototypes.js | 68 + node_modules/es5-ext/test/object/mixin.js | 70 + .../es5-ext/test/object/normalize-options.js | 55 + .../es5-ext/test/object/primitive-set.js | 14 + .../es5-ext/test/object/safe-traverse.js | 15 + node_modules/es5-ext/test/object/serialize.js | 43 + .../test/object/set-prototype-of/implement.js | 6 + .../test/object/set-prototype-of/index.js | 22 + .../object/set-prototype-of/is-implemented.js | 3 + .../test/object/set-prototype-of/shim.js | 22 + node_modules/es5-ext/test/object/some.js | 24 + node_modules/es5-ext/test/object/to-array.js | 18 + .../es5-ext/test/object/unserialize.js | 39 + .../es5-ext/test/object/valid-callable.js | 7 + .../es5-ext/test/object/valid-object.js | 15 + .../es5-ext/test/object/valid-value.js | 15 + .../test/object/validate-array-like-object.js | 21 + .../test/object/validate-array-like.js | 21 + .../object/validate-stringifiable-value.js | 16 + .../test/object/validate-stringifiable.js | 16 + .../es5-ext/test/optional-chaining.js | 17 + .../es5-ext/test/promise/#/as-callback.js | 25 + .../test/promise/#/finally/implement.js | 7 + .../es5-ext/test/promise/#/finally/index.js | 3 + .../test/promise/#/finally/is-implemented.js | 3 + .../es5-ext/test/promise/#/finally/shim.js | 75 + .../es5-ext/test/promise/.eslintrc.json | 1 + node_modules/es5-ext/test/promise/lazy.js | 46 + node_modules/es5-ext/test/reg-exp/#/index.js | 15 + .../es5-ext/test/reg-exp/#/is-sticky.js | 13 + .../es5-ext/test/reg-exp/#/is-unicode.js | 13 + .../es5-ext/test/reg-exp/#/match/implement.js | 5 + .../es5-ext/test/reg-exp/#/match/index.js | 3 + .../test/reg-exp/#/match/is-implemented.js | 3 + .../es5-ext/test/reg-exp/#/match/shim.js | 6 + .../test/reg-exp/#/replace/implement.js | 5 + .../es5-ext/test/reg-exp/#/replace/index.js | 3 + .../test/reg-exp/#/replace/is-implemented.js | 3 + .../es5-ext/test/reg-exp/#/replace/shim.js | 3 + .../test/reg-exp/#/search/implement.js | 5 + .../es5-ext/test/reg-exp/#/search/index.js | 3 + .../test/reg-exp/#/search/is-implemented.js | 3 + .../es5-ext/test/reg-exp/#/search/shim.js | 3 + .../es5-ext/test/reg-exp/#/split/implement.js | 5 + .../es5-ext/test/reg-exp/#/split/index.js | 3 + .../test/reg-exp/#/split/is-implemented.js | 3 + .../es5-ext/test/reg-exp/#/split/shim.js | 3 + .../test/reg-exp/#/sticky/implement.js | 5 + .../test/reg-exp/#/sticky/is-implemented.js | 3 + .../test/reg-exp/#/unicode/implement.js | 5 + .../test/reg-exp/#/unicode/is-implemented.js | 3 + node_modules/es5-ext/test/reg-exp/escape.js | 6 + .../es5-ext/test/reg-exp/is-reg-exp.js | 12 + .../es5-ext/test/reg-exp/valid-reg-exp.js | 15 + node_modules/es5-ext/test/safe-to-string.js | 12 + .../test/string/#/@@iterator/implement.js | 5 + .../es5-ext/test/string/#/@@iterator/index.js | 3 + .../string/#/@@iterator/is-implemented.js | 3 + .../es5-ext/test/string/#/@@iterator/shim.js | 9 + node_modules/es5-ext/test/string/#/at.js | 97 + .../es5-ext/test/string/#/camel-to-hyphen.js | 7 + .../es5-ext/test/string/#/capitalize.js | 9 + .../test/string/#/case-insensitive-compare.js | 7 + .../test/string/#/code-point-at/implement.js | 5 + .../test/string/#/code-point-at/index.js | 3 + .../string/#/code-point-at/is-implemented.js | 3 + .../test/string/#/code-point-at/shim.js | 83 + .../test/string/#/contains/implement.js | 5 + .../es5-ext/test/string/#/contains/index.js | 3 + .../test/string/#/contains/is-implemented.js | 3 + .../es5-ext/test/string/#/contains/shim.js | 14 + node_modules/es5-ext/test/string/#/count.js | 12 + .../test/string/#/ends-with/implement.js | 5 + .../es5-ext/test/string/#/ends-with/index.js | 3 + .../test/string/#/ends-with/is-implemented.js | 3 + .../es5-ext/test/string/#/ends-with/shim.js | 16 + .../es5-ext/test/string/#/hyphen-to-camel.js | 7 + node_modules/es5-ext/test/string/#/indent.js | 8 + node_modules/es5-ext/test/string/#/last.js | 6 + .../es5-ext/test/string/#/normalize/_data.js | 3 + .../test/string/#/normalize/implement.js | 5 + .../es5-ext/test/string/#/normalize/index.js | 3 + .../test/string/#/normalize/is-implemented.js | 3 + .../es5-ext/test/string/#/normalize/shim.js | 13 + node_modules/es5-ext/test/string/#/pad.js | 24 + .../test/string/#/plain-replace-all.js | 10 + .../es5-ext/test/string/#/plain-replace.js | 7 + .../es5-ext/test/string/#/repeat/implement.js | 5 + .../es5-ext/test/string/#/repeat/index.js | 3 + .../test/string/#/repeat/is-implemented.js | 3 + .../es5-ext/test/string/#/repeat/shim.js | 12 + .../test/string/#/starts-with/implement.js | 5 + .../test/string/#/starts-with/index.js | 3 + .../string/#/starts-with/is-implemented.js | 3 + .../es5-ext/test/string/#/starts-with/shim.js | 14 + .../es5-ext/test/string/#/uncapitalize.js | 10 + .../es5-ext/test/string/format-method.js | 6 + .../test/string/from-code-point/implement.js | 5 + .../test/string/from-code-point/index.js | 3 + .../string/from-code-point/is-implemented.js | 3 + .../test/string/from-code-point/shim.js | 47 + node_modules/es5-ext/test/string/is-string.js | 11 + .../es5-ext/test/string/random-uniq.js | 14 + node_modules/es5-ext/test/string/random.js | 13 + .../es5-ext/test/string/raw/implement.js | 5 + node_modules/es5-ext/test/string/raw/index.js | 3 + .../es5-ext/test/string/raw/is-implemented.js | 3 + node_modules/es5-ext/test/string/raw/shim.js | 14 + .../test/to-short-string-representation.js | 16 + .../es5-ext/to-short-string-representation.js | 16 + node_modules/es6-iterator/#/chain.js | 40 + node_modules/es6-iterator/.editorconfig | 14 + node_modules/es6-iterator/.npmignore | 12 + node_modules/es6-iterator/CHANGELOG.md | 27 + node_modules/es6-iterator/CHANGES | 42 + node_modules/es6-iterator/LICENSE | 21 + node_modules/es6-iterator/README.md | 148 + node_modules/es6-iterator/appveyor.yml | 26 + node_modules/es6-iterator/array.js | 32 + node_modules/es6-iterator/for-of.js | 47 + node_modules/es6-iterator/get.js | 15 + node_modules/es6-iterator/index.js | 106 + node_modules/es6-iterator/is-iterable.js | 16 + node_modules/es6-iterator/package.json | 76 + node_modules/es6-iterator/string.js | 39 + node_modules/es6-iterator/test/#/chain.js | 23 + node_modules/es6-iterator/test/.eslintrc.json | 5 + node_modules/es6-iterator/test/array.js | 67 + node_modules/es6-iterator/test/for-of.js | 42 + node_modules/es6-iterator/test/get.js | 27 + node_modules/es6-iterator/test/index.js | 99 + node_modules/es6-iterator/test/is-iterable.js | 23 + node_modules/es6-iterator/test/string.js | 23 + .../es6-iterator/test/valid-iterable.js | 28 + node_modules/es6-iterator/valid-iterable.js | 8 + node_modules/es6-symbol/.editorconfig | 16 + node_modules/es6-symbol/.github/FUNDING.yml | 1 + node_modules/es6-symbol/.testignore | 1 + node_modules/es6-symbol/CHANGELOG.md | 16 + node_modules/es6-symbol/CHANGES | 61 + node_modules/es6-symbol/LICENSE | 15 + node_modules/es6-symbol/README.md | 104 + node_modules/es6-symbol/implement.js | 10 + node_modules/es6-symbol/index.js | 5 + node_modules/es6-symbol/is-implemented.js | 20 + .../es6-symbol/is-native-implemented.js | 7 + node_modules/es6-symbol/is-symbol.js | 9 + .../es6-symbol/lib/private/generate-name.js | 29 + .../lib/private/setup/standard-symbols.js | 34 + .../lib/private/setup/symbol-registry.js | 23 + node_modules/es6-symbol/package.json | 139 + node_modules/es6-symbol/polyfill.js | 87 + node_modules/es6-symbol/test/implement.js | 3 + node_modules/es6-symbol/test/index.js | 11 + .../es6-symbol/test/is-implemented.js | 14 + .../es6-symbol/test/is-native-implemented.js | 3 + node_modules/es6-symbol/test/is-symbol.js | 16 + node_modules/es6-symbol/test/polyfill.js | 32 + .../es6-symbol/test/validate-symbol.js | 19 + node_modules/es6-symbol/validate-symbol.js | 8 + node_modules/es6-weak-map/.editorconfig | 14 + node_modules/es6-weak-map/CHANGELOG.md | 5 + node_modules/es6-weak-map/CHANGES | 45 + node_modules/es6-weak-map/LICENSE | 15 + node_modules/es6-weak-map/README.md | 78 + node_modules/es6-weak-map/implement.js | 11 + node_modules/es6-weak-map/index.js | 3 + node_modules/es6-weak-map/is-implemented.js | 21 + .../es6-weak-map/is-native-implemented.js | 8 + node_modules/es6-weak-map/is-weak-map.js | 13 + node_modules/es6-weak-map/package.json | 78 + node_modules/es6-weak-map/polyfill.js | 65 + node_modules/es6-weak-map/test/implement.js | 5 + node_modules/es6-weak-map/test/index.js | 7 + .../es6-weak-map/test/is-implemented.js | 15 + .../test/is-native-implemented.js | 5 + node_modules/es6-weak-map/test/is-weak-map.js | 16 + node_modules/es6-weak-map/test/polyfill.js | 23 + .../es6-weak-map/test/valid-weak-map.js | 32 + node_modules/es6-weak-map/valid-weak-map.js | 8 + node_modules/escape-string-regexp/index.js | 11 + node_modules/escape-string-regexp/license | 21 + .../escape-string-regexp/package.json | 81 + node_modules/escape-string-regexp/readme.md | 27 + node_modules/eslint-scope/CHANGELOG.md | 55 + node_modules/eslint-scope/LICENSE | 22 + node_modules/eslint-scope/README.md | 54 + node_modules/eslint-scope/lib/definition.js | 86 + node_modules/eslint-scope/lib/index.js | 165 + .../eslint-scope/lib/pattern-visitor.js | 152 + node_modules/eslint-scope/lib/reference.js | 167 + node_modules/eslint-scope/lib/referencer.js | 612 ++ .../eslint-scope/lib/scope-manager.js | 247 + node_modules/eslint-scope/lib/scope.js | 745 ++ node_modules/eslint-scope/lib/variable.js | 88 + node_modules/eslint-scope/package.json | 74 + node_modules/esrecurse/.babelrc | 3 + node_modules/esrecurse/README.md | 171 + node_modules/esrecurse/esrecurse.js | 117 + node_modules/esrecurse/gulpfile.babel.js | 92 + node_modules/esrecurse/package.json | 80 + node_modules/estraverse/.jshintrc | 16 + node_modules/estraverse/LICENSE.BSD | 19 + node_modules/estraverse/README.md | 153 + node_modules/estraverse/estraverse.js | 782 ++ node_modules/estraverse/gulpfile.js | 70 + node_modules/estraverse/package.json | 69 + node_modules/events/.airtap.yml | 15 + node_modules/events/.github/FUNDING.yml | 12 + node_modules/events/.travis.yml | 16 + node_modules/events/History.md | 89 + node_modules/events/LICENSE | 22 + node_modules/events/Readme.md | 48 + node_modules/events/events.js | 446 + node_modules/events/package.json | 65 + node_modules/events/security.md | 10 + node_modules/events/tests/add-listeners.js | 111 + .../events/tests/check-listener-leaks.js | 101 + node_modules/events/tests/common.js | 104 + node_modules/events/tests/errors.js | 13 + node_modules/events/tests/events-list.js | 28 + node_modules/events/tests/index.js | 48 + node_modules/events/tests/legacy-compat.js | 16 + node_modules/events/tests/listener-count.js | 37 + .../events/tests/listeners-side-effects.js | 56 + node_modules/events/tests/listeners.js | 168 + node_modules/events/tests/max-listeners.js | 47 + node_modules/events/tests/method-names.js | 35 + node_modules/events/tests/modify-in-emit.js | 90 + node_modules/events/tests/num-args.js | 60 + node_modules/events/tests/once.js | 83 + node_modules/events/tests/prepend.js | 31 + .../events/tests/remove-all-listeners.js | 133 + node_modules/events/tests/remove-listeners.js | 212 + .../tests/set-max-listeners-side-effects.js | 31 + .../events/tests/special-event-names.js | 45 + node_modules/events/tests/subclass.js | 66 + node_modules/events/tests/symbols.js | 25 + node_modules/evp_bytestokey/LICENSE | 21 + node_modules/evp_bytestokey/README.md | 51 + node_modules/evp_bytestokey/index.js | 45 + node_modules/evp_bytestokey/package.json | 78 + node_modules/execa/index.js | 361 + node_modules/execa/lib/errname.js | 39 + node_modules/execa/lib/stdio.js | 41 + node_modules/execa/license | 9 + node_modules/execa/package.json | 101 + node_modules/execa/readme.md | 327 + node_modules/expand-brackets/LICENSE | 21 + node_modules/expand-brackets/README.md | 302 + node_modules/expand-brackets/changelog.md | 35 + node_modules/expand-brackets/index.js | 211 + node_modules/expand-brackets/lib/compilers.js | 87 + node_modules/expand-brackets/lib/parsers.js | 219 + node_modules/expand-brackets/lib/utils.js | 34 + .../node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 77 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 82 + .../node_modules/extend-shallow/LICENSE | 21 + .../node_modules/extend-shallow/README.md | 61 + .../node_modules/extend-shallow/index.js | 33 + .../node_modules/extend-shallow/package.json | 87 + node_modules/expand-brackets/package.json | 133 + node_modules/expand-tilde/LICENSE | 21 + node_modules/expand-tilde/README.md | 80 + node_modules/expand-tilde/index.js | 22 + node_modules/expand-tilde/package.json | 99 + node_modules/ext/.editorconfig | 16 + node_modules/ext/CHANGELOG.md | 64 + node_modules/ext/LICENSE | 15 + node_modules/ext/README.md | 33 + node_modules/ext/docs/function/identity.md | 9 + node_modules/ext/docs/global-this.md | 9 + node_modules/ext/docs/math/ceil-10.md | 10 + node_modules/ext/docs/math/floor-10.md | 10 + node_modules/ext/docs/math/round-10.md | 10 + node_modules/ext/docs/object/entries.md | 11 + node_modules/ext/docs/string/random.md | 31 + node_modules/ext/docs/string_/includes.md | 10 + node_modules/ext/docs/thenable_/finally.md | 9 + node_modules/ext/function/identity.js | 3 + .../ext/global-this/implementation.js | 31 + node_modules/ext/global-this/index.js | 3 + .../ext/global-this/is-implemented.js | 7 + .../ext/lib/private/decimal-adjust.js | 29 + node_modules/ext/math/ceil-10.js | 3 + node_modules/ext/math/floor-10.js | 3 + node_modules/ext/math/round-10.js | 3 + .../ext/node_modules/type/.editorconfig | 16 + .../ext/node_modules/type/CHANGELOG.md | 104 + node_modules/ext/node_modules/type/LICENSE | 15 + node_modules/ext/node_modules/type/README.md | 820 ++ .../node_modules/type/array-length/coerce.js | 10 + .../node_modules/type/array-length/ensure.js | 10 + .../node_modules/type/array-like/ensure.js | 9 + .../ext/node_modules/type/array-like/is.js | 21 + .../ext/node_modules/type/array/ensure.js | 9 + .../ext/node_modules/type/array/is.js | 27 + .../ext/node_modules/type/date/ensure.js | 9 + node_modules/ext/node_modules/type/date/is.js | 26 + .../ext/node_modules/type/error/ensure.js | 9 + .../ext/node_modules/type/error/is.js | 45 + .../ext/node_modules/type/finite/coerce.js | 8 + .../ext/node_modules/type/finite/ensure.js | 10 + .../ext/node_modules/type/function/ensure.js | 9 + .../ext/node_modules/type/function/is.js | 19 + .../ext/node_modules/type/integer/coerce.js | 11 + .../ext/node_modules/type/integer/ensure.js | 10 + .../ext/node_modules/type/iterable/ensure.js | 45 + .../ext/node_modules/type/iterable/is.js | 32 + .../type/lib/is-to-string-tag-supported.js | 3 + .../type/lib/resolve-error-message.js | 13 + .../type/lib/resolve-exception.js | 13 + .../node_modules/type/lib/safe-to-string.js | 10 + .../node_modules/type/lib/to-short-string.js | 29 + .../type/natural-number/coerce.js | 10 + .../type/natural-number/ensure.js | 10 + .../ext/node_modules/type/number/coerce.js | 14 + .../ext/node_modules/type/number/ensure.js | 10 + .../ext/node_modules/type/object/ensure.js | 9 + .../ext/node_modules/type/object/is.js | 11 + .../ext/node_modules/type/package.json | 132 + .../type/plain-function/ensure.js | 9 + .../node_modules/type/plain-function/is.js | 11 + .../node_modules/type/plain-object/ensure.js | 65 + .../ext/node_modules/type/plain-object/is.js | 28 + .../ext/node_modules/type/promise/ensure.js | 9 + .../ext/node_modules/type/promise/is.js | 27 + .../ext/node_modules/type/prototype/is.js | 13 + .../ext/node_modules/type/reg-exp/ensure.js | 9 + .../ext/node_modules/type/reg-exp/is.js | 37 + .../node_modules/type/safe-integer/coerce.js | 13 + .../node_modules/type/safe-integer/ensure.js | 10 + .../ext/node_modules/type/string/coerce.js | 23 + .../ext/node_modules/type/string/ensure.js | 10 + .../test/_lib/arrow-function-if-supported.js | 4 + .../type/test/_lib/class-if-supported.js | 4 + .../type/test/array-length/coerce.js | 47 + .../type/test/array-length/ensure.js | 19 + .../type/test/array-like/ensure.js | 24 + .../node_modules/type/test/array-like/is.js | 47 + .../node_modules/type/test/array/ensure.js | 20 + .../ext/node_modules/type/test/array/is.js | 41 + .../ext/node_modules/type/test/date/ensure.js | 20 + .../ext/node_modules/type/test/date/is.js | 46 + .../node_modules/type/test/error/ensure.js | 20 + .../ext/node_modules/type/test/error/is.js | 50 + .../node_modules/type/test/finite/coerce.js | 40 + .../node_modules/type/test/finite/ensure.js | 17 + .../node_modules/type/test/function/ensure.js | 20 + .../ext/node_modules/type/test/function/is.js | 46 + .../node_modules/type/test/integer/coerce.js | 49 + .../node_modules/type/test/integer/ensure.js | 17 + .../node_modules/type/test/iterable/ensure.js | 42 + .../ext/node_modules/type/test/iterable/is.js | 57 + .../test/lib/is-to-string-tag-supported.js | 10 + .../type/test/lib/resolve-error-message.js | 16 + .../type/test/lib/resolve-exception.js | 31 + .../type/test/lib/safe-to-string.js | 32 + .../type/test/lib/to-short-string.js | 41 + .../type/test/natural-number/coerce.js | 47 + .../type/test/natural-number/ensure.js | 19 + .../node_modules/type/test/number/coerce.js | 40 + .../node_modules/type/test/number/ensure.js | 17 + .../node_modules/type/test/object/ensure.js | 20 + .../ext/node_modules/type/test/object/is.js | 30 + .../type/test/plain-function/ensure.js | 20 + .../type/test/plain-function/is.js | 56 + .../type/test/plain-object/ensure.js | 46 + .../node_modules/type/test/plain-object/is.js | 47 + .../node_modules/type/test/promise/ensure.js | 20 + .../ext/node_modules/type/test/promise/is.js | 39 + .../node_modules/type/test/prototype/is.js | 39 + .../node_modules/type/test/reg-exp/ensure.js | 20 + .../ext/node_modules/type/test/reg-exp/is.js | 47 + .../type/test/safe-integer/coerce.js | 49 + .../type/test/safe-integer/ensure.js | 19 + .../node_modules/type/test/string/coerce.js | 36 + .../node_modules/type/test/string/ensure.js | 17 + .../node_modules/type/test/thenable/ensure.js | 20 + .../ext/node_modules/type/test/thenable/is.js | 44 + .../type/test/time-value/coerce.js | 47 + .../type/test/time-value/ensure.js | 17 + .../node_modules/type/test/value/ensure.js | 20 + .../ext/node_modules/type/test/value/is.js | 29 + .../ext/node_modules/type/thenable/ensure.js | 9 + .../ext/node_modules/type/thenable/is.js | 9 + .../node_modules/type/time-value/coerce.js | 12 + .../node_modules/type/time-value/ensure.js | 10 + .../ext/node_modules/type/value/ensure.js | 9 + .../ext/node_modules/type/value/is.js | 6 + node_modules/ext/object/entries/implement.js | 10 + .../ext/object/entries/implementation.js | 15 + node_modules/ext/object/entries/index.js | 3 + .../ext/object/entries/is-implemented.js | 6 + node_modules/ext/package.json | 149 + node_modules/ext/string/random.js | 50 + .../ext/string_/includes/implementation.js | 7 + node_modules/ext/string_/includes/index.js | 5 + .../ext/string_/includes/is-implemented.js | 8 + node_modules/ext/test/function/identity.js | 14 + .../ext/test/global-this/implementation.js | 13 + node_modules/ext/test/global-this/index.js | 10 + .../ext/test/global-this/is-implemented.js | 8 + node_modules/ext/test/math/ceil-10.js | 13 + node_modules/ext/test/math/floor-10.js | 13 + node_modules/ext/test/math/round-10.js | 19 + .../ext/test/object/entries/_tests.js | 15 + .../ext/test/object/entries/implementation.js | 6 + node_modules/ext/test/object/entries/index.js | 6 + .../ext/test/object/entries/is-implemented.js | 8 + node_modules/ext/test/string/random.js | 36 + .../ext/test/string_/includes/_tests.js | 40 + .../test/string_/includes/implementation.js | 5 + .../ext/test/string_/includes/index.js | 5 + .../test/string_/includes/is-implemented.js | 8 + node_modules/ext/test/thenable_/finally.js | 89 + node_modules/ext/thenable_/finally.js | 24 + node_modules/extend-shallow/LICENSE | 21 + node_modules/extend-shallow/README.md | 97 + node_modules/extend-shallow/index.js | 60 + .../node_modules/is-extendable/LICENSE | 21 + .../node_modules/is-extendable/README.md | 88 + .../node_modules/is-extendable/index.d.ts | 5 + .../node_modules/is-extendable/index.js | 14 + .../node_modules/is-extendable/package.json | 98 + node_modules/extend-shallow/package.json | 126 + node_modules/extend/.editorconfig | 20 + node_modules/extend/.eslintrc | 17 + node_modules/extend/.jscs.json | 175 + node_modules/extend/.travis.yml | 230 + node_modules/extend/CHANGELOG.md | 83 + node_modules/extend/LICENSE | 23 + node_modules/extend/README.md | 81 + node_modules/extend/component.json | 32 + node_modules/extend/index.js | 117 + node_modules/extend/package.json | 76 + node_modules/extglob/LICENSE | 21 + node_modules/extglob/README.md | 362 + node_modules/extglob/changelog.md | 25 + node_modules/extglob/index.js | 331 + node_modules/extglob/lib/.DS_Store | Bin 0 -> 6148 bytes node_modules/extglob/lib/compilers.js | 169 + node_modules/extglob/lib/extglob.js | 78 + node_modules/extglob/lib/parsers.js | 156 + node_modules/extglob/lib/utils.js | 69 + .../node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 95 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 93 + .../node_modules/extend-shallow/LICENSE | 21 + .../node_modules/extend-shallow/README.md | 61 + .../node_modules/extend-shallow/index.js | 33 + .../node_modules/extend-shallow/package.json | 87 + .../is-accessor-descriptor/LICENSE | 21 + .../is-accessor-descriptor/README.md | 144 + .../is-accessor-descriptor/index.js | 69 + .../is-accessor-descriptor/package.json | 110 + .../node_modules/is-data-descriptor/LICENSE | 21 + .../node_modules/is-data-descriptor/README.md | 161 + .../node_modules/is-data-descriptor/index.js | 49 + .../is-data-descriptor/package.json | 109 + .../node_modules/is-descriptor/LICENSE | 21 + .../node_modules/is-descriptor/README.md | 193 + .../node_modules/is-descriptor/index.js | 22 + .../node_modules/is-descriptor/package.json | 114 + node_modules/extglob/package.json | 160 + node_modules/fancy-log/LICENSE | 22 + node_modules/fancy-log/README.md | 71 + node_modules/fancy-log/index.js | 92 + node_modules/fancy-log/package.json | 91 + node_modules/fast-deep-equal/LICENSE | 21 + node_modules/fast-deep-equal/README.md | 96 + node_modules/fast-deep-equal/es6/index.d.ts | 2 + node_modules/fast-deep-equal/es6/index.js | 72 + node_modules/fast-deep-equal/es6/react.d.ts | 2 + node_modules/fast-deep-equal/es6/react.js | 79 + node_modules/fast-deep-equal/index.d.ts | 4 + node_modules/fast-deep-equal/index.js | 46 + node_modules/fast-deep-equal/package.json | 88 + node_modules/fast-deep-equal/react.d.ts | 2 + node_modules/fast-deep-equal/react.js | 53 + .../fast-json-stable-stringify/.eslintrc.yml | 26 + .../.github/FUNDING.yml | 1 + .../fast-json-stable-stringify/.travis.yml | 8 + .../fast-json-stable-stringify/LICENSE | 21 + .../fast-json-stable-stringify/README.md | 131 + .../benchmark/index.js | 31 + .../benchmark/test.json | 137 + .../example/key_cmp.js | 7 + .../example/nested.js | 3 + .../fast-json-stable-stringify/example/str.js | 3 + .../example/value_cmp.js | 7 + .../fast-json-stable-stringify/index.d.ts | 4 + .../fast-json-stable-stringify/index.js | 59 + .../fast-json-stable-stringify/package.json | 80 + .../fast-json-stable-stringify/test/cmp.js | 13 + .../fast-json-stable-stringify/test/nested.js | 44 + .../fast-json-stable-stringify/test/str.js | 46 + .../test/to-json.js | 22 + node_modules/figgy-pudding/CHANGELOG.md | 151 + node_modules/figgy-pudding/LICENSE.md | 16 + node_modules/figgy-pudding/README.md | 260 + node_modules/figgy-pudding/index.js | 197 + node_modules/figgy-pudding/package.json | 71 + node_modules/fill-range/LICENSE | 21 + node_modules/fill-range/README.md | 250 + node_modules/fill-range/index.js | 208 + .../node_modules/extend-shallow/LICENSE | 21 + .../node_modules/extend-shallow/README.md | 61 + .../node_modules/extend-shallow/index.js | 33 + .../node_modules/extend-shallow/package.json | 87 + node_modules/fill-range/package.json | 130 + node_modules/find-cache-dir/index.js | 32 + node_modules/find-cache-dir/license | 9 + node_modules/find-cache-dir/package.json | 74 + node_modules/find-cache-dir/readme.md | 116 + node_modules/find-up/index.js | 46 + node_modules/find-up/license | 9 + node_modules/find-up/package.json | 82 + node_modules/find-up/readme.md | 87 + node_modules/findup-sync/LICENSE | 21 + node_modules/findup-sync/README.md | 57 + node_modules/findup-sync/index.js | 87 + node_modules/findup-sync/package.json | 105 + node_modules/fined/LICENSE | 21 + node_modules/fined/README.md | 81 + node_modules/fined/index.js | 174 + node_modules/fined/package.json | 89 + node_modules/flagged-respawn/LICENSE | 21 + node_modules/flagged-respawn/README.md | 111 + node_modules/flagged-respawn/index.js | 52 + .../flagged-respawn/lib/is-v8flags.js | 13 + node_modules/flagged-respawn/lib/remover.js | 13 + node_modules/flagged-respawn/lib/reorder.js | 18 + node_modules/flagged-respawn/lib/respawn.js | 16 + node_modules/flagged-respawn/package.json | 95 + node_modules/flush-write-stream/.travis.yml | 6 + node_modules/flush-write-stream/LICENSE | 21 + node_modules/flush-write-stream/README.md | 59 + node_modules/flush-write-stream/example.js | 22 + node_modules/flush-write-stream/index.js | 54 + node_modules/flush-write-stream/package.json | 54 + node_modules/flush-write-stream/test.js | 85 + node_modules/for-in/LICENSE | 21 + node_modules/for-in/README.md | 85 + node_modules/for-in/index.js | 16 + node_modules/for-in/package.json | 106 + node_modules/for-own/LICENSE | 21 + node_modules/for-own/README.md | 85 + node_modules/for-own/index.js | 19 + node_modules/for-own/package.json | 112 + node_modules/fragment-cache/LICENSE | 21 + node_modules/fragment-cache/README.md | 156 + node_modules/fragment-cache/index.js | 128 + node_modules/fragment-cache/package.json | 93 + node_modules/from2/.travis.yml | 8 + node_modules/from2/LICENSE.md | 21 + node_modules/from2/README.md | 70 + node_modules/from2/index.js | 103 + node_modules/from2/package.json | 69 + node_modules/from2/test.js | 123 + node_modules/fs-mkdirp-stream/LICENSE | 21 + node_modules/fs-mkdirp-stream/README.md | 65 + node_modules/fs-mkdirp-stream/index.js | 50 + node_modules/fs-mkdirp-stream/mkdirp.js | 71 + node_modules/fs-mkdirp-stream/package.json | 91 + .../fs-write-stream-atomic/.npmignore | 3 + .../fs-write-stream-atomic/.travis.yml | 11 + node_modules/fs-write-stream-atomic/LICENSE | 15 + node_modules/fs-write-stream-atomic/README.md | 35 + node_modules/fs-write-stream-atomic/index.js | 176 + .../fs-write-stream-atomic/package.json | 63 + .../fs-write-stream-atomic/test/basic.js | 97 + .../fs-write-stream-atomic/test/chown.js | 44 + .../test/rename-eperm.js | 154 + .../test/rename-fail.js | 30 + .../fs-write-stream-atomic/test/slow-close.js | 40 + .../fs-write-stream-atomic/test/toolong.js | 29 + node_modules/fs.realpath/LICENSE | 43 + node_modules/fs.realpath/README.md | 33 + node_modules/fs.realpath/index.js | 66 + node_modules/fs.realpath/old.js | 303 + node_modules/fs.realpath/package.json | 59 + node_modules/function-bind/.editorconfig | 20 + node_modules/function-bind/.eslintrc | 15 + node_modules/function-bind/.jscs.json | 176 + node_modules/function-bind/.npmignore | 22 + node_modules/function-bind/.travis.yml | 168 + node_modules/function-bind/LICENSE | 20 + node_modules/function-bind/README.md | 48 + node_modules/function-bind/implementation.js | 52 + node_modules/function-bind/index.js | 5 + node_modules/function-bind/package.json | 94 + node_modules/function-bind/test/.eslintrc | 9 + node_modules/function-bind/test/index.js | 252 + node_modules/get-caller-file/LICENSE.md | 6 + node_modules/get-caller-file/README.md | 41 + node_modules/get-caller-file/index.d.ts | 2 + node_modules/get-caller-file/index.js | 22 + node_modules/get-caller-file/index.js.map | 1 + node_modules/get-caller-file/package.json | 69 + node_modules/get-stream/buffer-stream.js | 51 + node_modules/get-stream/index.js | 50 + node_modules/get-stream/license | 9 + node_modules/get-stream/package.json | 78 + node_modules/get-stream/readme.md | 123 + node_modules/get-value/LICENSE | 21 + node_modules/get-value/index.js | 50 + node_modules/get-value/package.json | 113 + node_modules/glob-parent/LICENSE | 15 + node_modules/glob-parent/README.md | 109 + node_modules/glob-parent/index.js | 24 + .../glob-parent/node_modules/is-glob/LICENSE | 21 + .../node_modules/is-glob/README.md | 142 + .../glob-parent/node_modules/is-glob/index.js | 25 + .../node_modules/is-glob/package.json | 119 + node_modules/glob-parent/package.json | 72 + node_modules/glob-stream/LICENSE | 21 + node_modules/glob-stream/README.md | 146 + node_modules/glob-stream/index.js | 94 + node_modules/glob-stream/package.json | 101 + node_modules/glob-stream/readable.js | 117 + node_modules/glob-watcher/LICENSE | 21 + node_modules/glob-watcher/README.md | 137 + node_modules/glob-watcher/index.js | 138 + node_modules/glob-watcher/package.json | 88 + node_modules/glob/LICENSE | 21 + node_modules/glob/README.md | 375 + node_modules/glob/changelog.md | 67 + node_modules/glob/common.js | 240 + node_modules/glob/glob.js | 790 ++ node_modules/glob/package.json | 80 + node_modules/glob/sync.js | 486 + node_modules/global-modules/LICENSE | 21 + node_modules/global-modules/README.md | 87 + node_modules/global-modules/index.js | 29 + .../node_modules/global-prefix/LICENSE | 21 + .../node_modules/global-prefix/README.md | 92 + .../node_modules/global-prefix/index.js | 85 + .../node_modules/global-prefix/package.json | 105 + node_modules/global-modules/package.json | 110 + node_modules/global-prefix/LICENSE | 21 + node_modules/global-prefix/README.md | 78 + node_modules/global-prefix/index.js | 96 + node_modules/global-prefix/package.json | 130 + node_modules/glogg/LICENSE | 22 + node_modules/glogg/README.md | 114 + node_modules/glogg/index.js | 34 + node_modules/glogg/package.json | 83 + node_modules/graceful-fs/LICENSE | 15 + node_modules/graceful-fs/README.md | 133 + node_modules/graceful-fs/clone.js | 19 + node_modules/graceful-fs/graceful-fs.js | 346 + node_modules/graceful-fs/legacy-streams.js | 118 + node_modules/graceful-fs/package.json | 83 + node_modules/graceful-fs/polyfills.js | 342 + node_modules/gulp/CHANGELOG.md | 269 + node_modules/gulp/LICENSE | 21 + node_modules/gulp/README.md | 284 + node_modules/gulp/bin/gulp.js | 3 + node_modules/gulp/index.js | 55 + node_modules/gulp/node_modules/.bin/gulp | 1 + .../gulp/node_modules/ansi-regex/index.js | 4 + .../gulp/node_modules/ansi-regex/license | 21 + .../gulp/node_modules/ansi-regex/package.json | 108 + .../gulp/node_modules/ansi-regex/readme.md | 39 + .../gulp/node_modules/camelcase/index.js | 56 + .../gulp/node_modules/camelcase/license | 21 + .../gulp/node_modules/camelcase/package.json | 72 + .../gulp/node_modules/camelcase/readme.md | 57 + .../gulp/node_modules/cliui/CHANGELOG.md | 15 + .../gulp/node_modules/cliui/LICENSE.txt | 14 + .../gulp/node_modules/cliui/README.md | 110 + node_modules/gulp/node_modules/cliui/index.js | 316 + .../gulp/node_modules/cliui/package.json | 96 + .../node_modules/get-caller-file/LICENSE.md | 6 + .../node_modules/get-caller-file/README.md | 4 + .../node_modules/get-caller-file/index.js | 20 + .../node_modules/get-caller-file/package.json | 58 + .../gulp/node_modules/gulp-cli/LICENSE | 21 + .../gulp/node_modules/gulp-cli/README.md | 240 + .../gulp/node_modules/gulp-cli/bin/gulp.js | 5 + .../gulp-cli/completion/README.md | 20 + .../node_modules/gulp-cli/completion/bash | 27 + .../node_modules/gulp-cli/completion/fish | 10 + .../gulp-cli/completion/powershell | 61 + .../gulp/node_modules/gulp-cli/completion/zsh | 25 + .../gulp/node_modules/gulp-cli/gulp.1 | 83 + .../gulp/node_modules/gulp-cli/index.js | 202 + .../node_modules/gulp-cli/lib/shared/ansi.js | 41 + .../gulp-cli/lib/shared/cli-options.js | 122 + .../gulp-cli/lib/shared/completion.js | 22 + .../gulp-cli/lib/shared/config/cli-flags.js | 25 + .../gulp-cli/lib/shared/config/env-flags.js | 44 + .../gulp-cli/lib/shared/config/load-files.js | 30 + .../node_modules/gulp-cli/lib/shared/exit.js | 15 + .../gulp-cli/lib/shared/get-blacklist.js | 62 + .../lib/shared/log/blacklist-error.js | 15 + .../gulp-cli/lib/shared/log/copy-tree.js | 81 + .../gulp-cli/lib/shared/log/tasks.js | 166 + .../gulp-cli/lib/shared/log/to-console.js | 58 + .../gulp-cli/lib/shared/log/verify.js | 28 + .../gulp-cli/lib/shared/make-title.js | 11 + .../gulp-cli/lib/shared/register-exports.js | 21 + .../gulp-cli/lib/shared/tildify.js | 9 + .../lib/shared/verify-dependencies.js | 25 + .../lib/versioned/^3.7.0/format-error.js | 23 + .../gulp-cli/lib/versioned/^3.7.0/index.js | 76 + .../lib/versioned/^3.7.0/log/events.js | 60 + .../lib/versioned/^3.7.0/log/tasks-simple.js | 9 + .../lib/versioned/^3.7.0/task-tree.js | 27 + .../lib/versioned/^4.0.0-alpha.1/index.js | 91 + .../lib/versioned/^4.0.0-alpha.2/index.js | 91 + .../lib/versioned/^4.0.0/format-error.js | 24 + .../gulp-cli/lib/versioned/^4.0.0/index.js | 91 + .../lib/versioned/^4.0.0/log/events.js | 50 + .../lib/versioned/^4.0.0/log/get-task.js | 43 + .../lib/versioned/^4.0.0/log/sync-task.js | 46 + .../lib/versioned/^4.0.0/log/tasks-simple.js | 7 + .../gulp/node_modules/gulp-cli/package.json | 113 + .../gulp/node_modules/invert-kv/index.js | 15 + .../gulp/node_modules/invert-kv/package.json | 65 + .../gulp/node_modules/invert-kv/readme.md | 25 + .../is-fullwidth-code-point/index.js | 46 + .../is-fullwidth-code-point/license | 21 + .../is-fullwidth-code-point/package.json | 77 + .../is-fullwidth-code-point/readme.md | 39 + node_modules/gulp/node_modules/lcid/index.js | 22 + node_modules/gulp/node_modules/lcid/lcid.json | 203 + node_modules/gulp/node_modules/lcid/license | 21 + .../gulp/node_modules/lcid/package.json | 78 + node_modules/gulp/node_modules/lcid/readme.md | 35 + .../gulp/node_modules/os-locale/index.js | 127 + .../gulp/node_modules/os-locale/license | 21 + .../gulp/node_modules/os-locale/package.json | 75 + .../gulp/node_modules/os-locale/readme.md | 47 + .../require-main-filename/.npmignore | 3 + .../require-main-filename/.travis.yml | 8 + .../require-main-filename/LICENSE.txt | 14 + .../require-main-filename/README.md | 26 + .../require-main-filename/index.js | 18 + .../require-main-filename/package.json | 58 + .../require-main-filename/test.js | 36 + .../gulp/node_modules/string-width/index.js | 37 + .../gulp/node_modules/string-width/license | 21 + .../node_modules/string-width/package.json | 90 + .../gulp/node_modules/string-width/readme.md | 42 + .../gulp/node_modules/strip-ansi/index.js | 6 + .../gulp/node_modules/strip-ansi/license | 21 + .../gulp/node_modules/strip-ansi/package.json | 103 + .../gulp/node_modules/strip-ansi/readme.md | 33 + .../node_modules/which-module/CHANGELOG.md | 11 + .../gulp/node_modules/which-module/LICENSE | 13 + .../gulp/node_modules/which-module/README.md | 55 + .../gulp/node_modules/which-module/index.js | 9 + .../node_modules/which-module/package.json | 68 + .../gulp/node_modules/wrap-ansi/index.js | 168 + .../gulp/node_modules/wrap-ansi/license | 21 + .../gulp/node_modules/wrap-ansi/package.json | 116 + .../gulp/node_modules/wrap-ansi/readme.md | 73 + node_modules/gulp/node_modules/y18n/LICENSE | 13 + node_modules/gulp/node_modules/y18n/README.md | 91 + node_modules/gulp/node_modules/y18n/index.js | 172 + .../gulp/node_modules/y18n/package.json | 65 + .../node_modules/yargs-parser/CHANGELOG.md | 169 + .../node_modules/yargs-parser/LICENSE.txt | 14 + .../gulp/node_modules/yargs-parser/README.md | 257 + .../gulp/node_modules/yargs-parser/index.js | 759 ++ .../yargs-parser/lib/tokenize-arg-string.js | 34 + .../node_modules/yargs-parser/package.json | 75 + .../gulp/node_modules/yargs/CHANGELOG.md | 921 ++ node_modules/gulp/node_modules/yargs/LICENSE | 22 + .../gulp/node_modules/yargs/README.md | 2017 ++++ .../gulp/node_modules/yargs/completion.sh.hbs | 28 + node_modules/gulp/node_modules/yargs/index.js | 31 + .../node_modules/yargs/lib/apply-extends.js | 41 + .../gulp/node_modules/yargs/lib/argsert.js | 72 + .../gulp/node_modules/yargs/lib/assign.js | 15 + .../gulp/node_modules/yargs/lib/command.js | 334 + .../gulp/node_modules/yargs/lib/completion.js | 104 + .../node_modules/yargs/lib/levenshtein.js | 47 + .../gulp/node_modules/yargs/lib/obj-filter.js | 10 + .../gulp/node_modules/yargs/lib/usage.js | 489 + .../gulp/node_modules/yargs/lib/validation.js | 363 + .../gulp/node_modules/yargs/lib/yerror.js | 10 + .../gulp/node_modules/yargs/locales/be.json | 39 + .../gulp/node_modules/yargs/locales/de.json | 39 + .../gulp/node_modules/yargs/locales/en.json | 40 + .../gulp/node_modules/yargs/locales/es.json | 39 + .../gulp/node_modules/yargs/locales/fr.json | 37 + .../gulp/node_modules/yargs/locales/hi.json | 39 + .../gulp/node_modules/yargs/locales/hu.json | 39 + .../gulp/node_modules/yargs/locales/id.json | 40 + .../gulp/node_modules/yargs/locales/it.json | 39 + .../gulp/node_modules/yargs/locales/ja.json | 39 + .../gulp/node_modules/yargs/locales/ko.json | 39 + .../gulp/node_modules/yargs/locales/nb.json | 37 + .../gulp/node_modules/yargs/locales/nl.json | 39 + .../node_modules/yargs/locales/pirate.json | 12 + .../gulp/node_modules/yargs/locales/pl.json | 39 + .../gulp/node_modules/yargs/locales/pt.json | 38 + .../node_modules/yargs/locales/pt_BR.json | 40 + .../gulp/node_modules/yargs/locales/ru.json | 39 + .../gulp/node_modules/yargs/locales/th.json | 39 + .../gulp/node_modules/yargs/locales/tr.json | 39 + .../node_modules/yargs/locales/zh_CN.json | 37 + .../node_modules/yargs/locales/zh_TW.json | 40 + .../gulp/node_modules/yargs/package.json | 108 + node_modules/gulp/node_modules/yargs/yargs.js | 1126 ++ node_modules/gulp/package.json | 126 + node_modules/gulplog/CHANGELOG.md | 10 + node_modules/gulplog/LICENSE | 22 + node_modules/gulplog/README.md | 79 + node_modules/gulplog/index.js | 7 + node_modules/gulplog/package.json | 70 + node_modules/has-flag/index.js | 8 + node_modules/has-flag/license | 9 + node_modules/has-flag/package.json | 77 + node_modules/has-flag/readme.md | 70 + node_modules/has-symbols/.eslintrc | 11 + node_modules/has-symbols/.github/FUNDING.yml | 12 + .../has-symbols/.github/workflows/rebase.yml | 15 + node_modules/has-symbols/.travis.yml | 12 + node_modules/has-symbols/CHANGELOG.md | 34 + node_modules/has-symbols/LICENSE | 21 + node_modules/has-symbols/README.md | 45 + node_modules/has-symbols/index.js | 13 + node_modules/has-symbols/package.json | 118 + node_modules/has-symbols/shams.js | 42 + node_modules/has-symbols/test/index.js | 22 + .../has-symbols/test/shams/core-js.js | 28 + .../test/shams/get-own-property-symbols.js | 28 + node_modules/has-symbols/test/tests.js | 54 + node_modules/has-value/LICENSE | 21 + node_modules/has-value/README.md | 149 + node_modules/has-value/index.js | 16 + node_modules/has-value/package.json | 120 + node_modules/has-values/LICENSE | 21 + node_modules/has-values/README.md | 129 + node_modules/has-values/index.js | 60 + .../has-values/node_modules/kind-of/LICENSE | 21 + .../has-values/node_modules/kind-of/README.md | 267 + .../has-values/node_modules/kind-of/index.js | 119 + .../node_modules/kind-of/package.json | 139 + node_modules/has-values/package.json | 115 + node_modules/hash-base/LICENSE | 21 + node_modules/hash-base/README.md | 48 + node_modules/hash-base/index.js | 95 + node_modules/hash-base/package.json | 71 + node_modules/hash.js/.eslintrc.js | 41 + node_modules/hash.js/.travis.yml | 10 + node_modules/hash.js/README.md | 48 + node_modules/hash.js/lib/hash.d.ts | 106 + node_modules/hash.js/lib/hash.js | 15 + node_modules/hash.js/lib/hash/common.js | 92 + node_modules/hash.js/lib/hash/hmac.js | 47 + node_modules/hash.js/lib/hash/ripemd.js | 146 + node_modules/hash.js/lib/hash/sha.js | 7 + node_modules/hash.js/lib/hash/sha/1.js | 74 + node_modules/hash.js/lib/hash/sha/224.js | 30 + node_modules/hash.js/lib/hash/sha/256.js | 105 + node_modules/hash.js/lib/hash/sha/384.js | 35 + node_modules/hash.js/lib/hash/sha/512.js | 330 + node_modules/hash.js/lib/hash/sha/common.js | 49 + node_modules/hash.js/lib/hash/utils.js | 278 + node_modules/hash.js/package.json | 64 + node_modules/hash.js/test/hash-test.js | 140 + node_modules/hash.js/test/hmac-test.js | 62 + node_modules/hmac-drbg/.npmignore | 2 + node_modules/hmac-drbg/.travis.yml | 11 + node_modules/hmac-drbg/README.md | 48 + node_modules/hmac-drbg/lib/hmac-drbg.js | 113 + node_modules/hmac-drbg/package.json | 60 + node_modules/hmac-drbg/test/drbg-test.js | 91 + .../test/fixtures/hmac-drbg-nist.json | 332 + node_modules/homedir-polyfill/LICENSE | 21 + node_modules/homedir-polyfill/README.md | 96 + node_modules/homedir-polyfill/index.js | 9 + node_modules/homedir-polyfill/package.json | 94 + node_modules/homedir-polyfill/polyfill.js | 81 + node_modules/hosted-git-info/CHANGELOG.md | 131 + node_modules/hosted-git-info/LICENSE | 13 + node_modules/hosted-git-info/README.md | 133 + node_modules/hosted-git-info/git-host-info.js | 79 + node_modules/hosted-git-info/git-host.js | 156 + node_modules/hosted-git-info/index.js | 148 + node_modules/hosted-git-info/package.json | 69 + node_modules/https-browserify/LICENSE | 20 + node_modules/https-browserify/index.js | 31 + node_modules/https-browserify/package.json | 56 + node_modules/https-browserify/readme.markdown | 22 + node_modules/ieee754/LICENSE | 11 + node_modules/ieee754/README.md | 53 + node_modules/ieee754/index.js | 84 + node_modules/ieee754/package.json | 69 + node_modules/iferr/.npmignore | 1 + node_modules/iferr/LICENSE | 21 + node_modules/iferr/README.md | 40 + node_modules/iferr/index.coffee | 24 + node_modules/iferr/index.js | 49 + node_modules/iferr/package.json | 56 + node_modules/iferr/test/index.coffee | 42 + node_modules/iferr/test/mocha.opts | 2 + node_modules/import-local/fixtures/cli.js | 7 + node_modules/import-local/index.js | 17 + node_modules/import-local/license | 9 + node_modules/import-local/package.json | 83 + node_modules/import-local/readme.md | 30 + node_modules/imurmurhash/README.md | 122 + node_modules/imurmurhash/imurmurhash.js | 138 + node_modules/imurmurhash/imurmurhash.min.js | 12 + node_modules/imurmurhash/package.json | 64 + node_modules/infer-owner/LICENSE | 15 + node_modules/infer-owner/README.md | 41 + node_modules/infer-owner/index.js | 71 + node_modules/infer-owner/package.json | 62 + node_modules/inflight/LICENSE | 15 + node_modules/inflight/README.md | 37 + node_modules/inflight/inflight.js | 54 + node_modules/inflight/package.json | 58 + node_modules/inherits/LICENSE | 16 + node_modules/inherits/README.md | 42 + node_modules/inherits/inherits.js | 9 + node_modules/inherits/inherits_browser.js | 27 + node_modules/inherits/package.json | 86 + node_modules/ini/LICENSE | 15 + node_modules/ini/README.md | 102 + node_modules/ini/ini.js | 194 + node_modules/ini/package.json | 64 + node_modules/interpret/CHANGELOG | 115 + node_modules/interpret/LICENSE | 22 + node_modules/interpret/README.md | 184 + node_modules/interpret/index.js | 160 + node_modules/interpret/package.json | 116 + node_modules/invert-kv/index.js | 15 + node_modules/invert-kv/license | 9 + node_modules/invert-kv/package.json | 64 + node_modules/invert-kv/readme.md | 25 + node_modules/is-absolute/LICENSE | 22 + node_modules/is-absolute/README.md | 114 + node_modules/is-absolute/index.js | 47 + node_modules/is-absolute/package.json | 135 + node_modules/is-accessor-descriptor/LICENSE | 21 + node_modules/is-accessor-descriptor/README.md | 123 + node_modules/is-accessor-descriptor/index.js | 69 + .../node_modules/kind-of/LICENSE | 21 + .../node_modules/kind-of/README.md | 261 + .../node_modules/kind-of/index.js | 116 + .../node_modules/kind-of/package.json | 139 + .../is-accessor-descriptor/package.json | 94 + node_modules/is-arrayish/.editorconfig | 18 + node_modules/is-arrayish/.istanbul.yml | 4 + node_modules/is-arrayish/.npmignore | 5 + node_modules/is-arrayish/.travis.yml | 17 + node_modules/is-arrayish/LICENSE | 21 + node_modules/is-arrayish/README.md | 16 + node_modules/is-arrayish/index.js | 10 + node_modules/is-arrayish/package.json | 66 + node_modules/is-binary-path/index.js | 12 + node_modules/is-binary-path/license | 21 + node_modules/is-binary-path/package.json | 71 + node_modules/is-binary-path/readme.md | 34 + node_modules/is-buffer/LICENSE | 21 + node_modules/is-buffer/README.md | 53 + node_modules/is-buffer/index.js | 21 + node_modules/is-buffer/package.json | 83 + node_modules/is-buffer/test/basic.js | 24 + node_modules/is-data-descriptor/LICENSE | 21 + node_modules/is-data-descriptor/README.md | 128 + node_modules/is-data-descriptor/index.js | 55 + .../node_modules/kind-of/LICENSE | 21 + .../node_modules/kind-of/README.md | 261 + .../node_modules/kind-of/index.js | 116 + .../node_modules/kind-of/package.json | 139 + node_modules/is-data-descriptor/package.json | 93 + node_modules/is-descriptor/LICENSE | 21 + node_modules/is-descriptor/README.md | 193 + node_modules/is-descriptor/index.js | 22 + .../node_modules/kind-of/LICENSE | 21 + .../node_modules/kind-of/README.md | 342 + .../node_modules/kind-of/index.js | 147 + .../node_modules/kind-of/package.json | 146 + node_modules/is-descriptor/package.json | 118 + node_modules/is-extendable/LICENSE | 21 + node_modules/is-extendable/README.md | 72 + node_modules/is-extendable/index.js | 13 + node_modules/is-extendable/package.json | 89 + node_modules/is-extglob/LICENSE | 21 + node_modules/is-extglob/README.md | 107 + node_modules/is-extglob/index.js | 20 + node_modules/is-extglob/package.json | 101 + node_modules/is-fullwidth-code-point/index.js | 46 + node_modules/is-fullwidth-code-point/license | 21 + .../is-fullwidth-code-point/package.json | 77 + .../is-fullwidth-code-point/readme.md | 39 + node_modules/is-glob/LICENSE | 21 + node_modules/is-glob/README.md | 206 + node_modules/is-glob/index.js | 48 + node_modules/is-glob/package.json | 121 + node_modules/is-negated-glob/LICENSE | 21 + node_modules/is-negated-glob/README.md | 73 + node_modules/is-negated-glob/index.js | 15 + node_modules/is-negated-glob/package.json | 101 + node_modules/is-number/LICENSE | 21 + node_modules/is-number/README.md | 115 + node_modules/is-number/index.js | 22 + .../is-number/node_modules/kind-of/LICENSE | 21 + .../is-number/node_modules/kind-of/README.md | 261 + .../is-number/node_modules/kind-of/index.js | 116 + .../node_modules/kind-of/package.json | 139 + node_modules/is-number/package.json | 125 + node_modules/is-plain-object/LICENSE | 21 + node_modules/is-plain-object/README.md | 104 + node_modules/is-plain-object/index.d.ts | 5 + node_modules/is-plain-object/index.js | 37 + node_modules/is-plain-object/package.json | 123 + node_modules/is-relative/LICENSE | 21 + node_modules/is-relative/README.md | 77 + node_modules/is-relative/index.js | 12 + node_modules/is-relative/package.json | 108 + node_modules/is-stream/index.js | 21 + node_modules/is-stream/license | 21 + node_modules/is-stream/package.json | 70 + node_modules/is-stream/readme.md | 42 + node_modules/is-unc-path/LICENSE | 21 + node_modules/is-unc-path/README.md | 115 + node_modules/is-unc-path/index.js | 10 + node_modules/is-unc-path/package.json | 96 + node_modules/is-utf8/LICENSE | 9 + node_modules/is-utf8/README.md | 16 + node_modules/is-utf8/is-utf8.js | 76 + node_modules/is-utf8/package.json | 54 + node_modules/is-valid-glob/LICENSE | 21 + node_modules/is-valid-glob/README.md | 103 + node_modules/is-valid-glob/index.js | 21 + node_modules/is-valid-glob/package.json | 101 + node_modules/is-windows/LICENSE | 21 + node_modules/is-windows/README.md | 95 + node_modules/is-windows/index.js | 27 + node_modules/is-windows/package.json | 111 + node_modules/is-wsl/index.js | 25 + node_modules/is-wsl/license | 21 + node_modules/is-wsl/package.json | 72 + node_modules/is-wsl/readme.md | 28 + node_modules/isarray/.npmignore | 1 + node_modules/isarray/.travis.yml | 4 + node_modules/isarray/Makefile | 6 + node_modules/isarray/README.md | 60 + node_modules/isarray/component.json | 19 + node_modules/isarray/index.js | 5 + node_modules/isarray/package.json | 75 + node_modules/isarray/test.js | 20 + node_modules/isexe/.npmignore | 2 + node_modules/isexe/LICENSE | 15 + node_modules/isexe/README.md | 51 + node_modules/isexe/index.js | 57 + node_modules/isexe/mode.js | 41 + node_modules/isexe/package.json | 60 + node_modules/isexe/test/basic.js | 221 + node_modules/isexe/windows.js | 42 + node_modules/isobject/LICENSE | 21 + node_modules/isobject/README.md | 122 + node_modules/isobject/index.d.ts | 5 + node_modules/isobject/index.js | 12 + node_modules/isobject/package.json | 129 + .../json-parse-better-errors/CHANGELOG.md | 46 + .../json-parse-better-errors/LICENSE.md | 7 + .../json-parse-better-errors/README.md | 46 + .../json-parse-better-errors/index.js | 38 + .../json-parse-better-errors/package.json | 76 + .../json-schema-traverse/.eslintrc.yml | 27 + node_modules/json-schema-traverse/.travis.yml | 8 + node_modules/json-schema-traverse/LICENSE | 21 + node_modules/json-schema-traverse/README.md | 83 + node_modules/json-schema-traverse/index.js | 89 + .../json-schema-traverse/package.json | 70 + .../json-schema-traverse/spec/.eslintrc.yml | 6 + .../spec/fixtures/schema.js | 125 + .../json-schema-traverse/spec/index.spec.js | 171 + .../.npmignore | 1 + .../.travis.yml | 4 + .../LICENSE | 18 + .../example/key_cmp.js | 7 + .../example/nested.js | 3 + .../example/str.js | 3 + .../example/value_cmp.js | 7 + .../index.js | 82 + .../package.json | 72 + .../readme.markdown | 132 + .../test/cmp.js | 11 + .../test/nested.js | 42 + .../test/replacer.js | 74 + .../test/space.js | 59 + .../test/str.js | 32 + .../test/to-json.js | 20 + node_modules/json5/CHANGELOG.md | 274 + node_modules/json5/LICENSE.md | 23 + node_modules/json5/README.md | 234 + node_modules/json5/dist/index.js | 1 + node_modules/json5/lib/cli.js | 2 + node_modules/json5/lib/index.js | 1 + node_modules/json5/lib/parse.js | 1 + node_modules/json5/lib/register.js | 1 + node_modules/json5/lib/require.js | 1 + node_modules/json5/lib/stringify.js | 1 + node_modules/json5/lib/unicode.js | 1 + node_modules/json5/lib/util.js | 1 + node_modules/json5/package.json | 115 + node_modules/just-debounce/.eslintrc | 3 + node_modules/just-debounce/.npmignore | 25 + node_modules/just-debounce/LICENSE | 21 + node_modules/just-debounce/README.md | 53 + node_modules/just-debounce/index.js | 34 + node_modules/just-debounce/package.json | 56 + node_modules/just-debounce/test.js | 121 + node_modules/kind-of/CHANGELOG.md | 160 + node_modules/kind-of/LICENSE | 21 + node_modules/kind-of/README.md | 367 + node_modules/kind-of/index.js | 129 + node_modules/kind-of/package.json | 156 + node_modules/last-run/LICENSE | 21 + node_modules/last-run/README.md | 81 + node_modules/last-run/index.js | 58 + node_modules/last-run/package.json | 85 + node_modules/lazystream/.npmignore | 4 + node_modules/lazystream/.travis.yml | 9 + node_modules/lazystream/LICENSE-MIT | 23 + node_modules/lazystream/README.md | 110 + node_modules/lazystream/lib/lazystream.js | 54 + node_modules/lazystream/package.json | 69 + node_modules/lazystream/secret | 59 + node_modules/lazystream/test/data.md | 13 + node_modules/lazystream/test/fs_test.js | 69 + node_modules/lazystream/test/helper.js | 39 + node_modules/lazystream/test/pipe_test.js | 36 + node_modules/lazystream/test/readable_test.js | 90 + node_modules/lazystream/test/writable_test.js | 59 + node_modules/lcid/index.js | 23 + node_modules/lcid/lcid.json | 203 + node_modules/lcid/license | 9 + node_modules/lcid/package.json | 79 + node_modules/lcid/readme.md | 35 + node_modules/lead/LICENSE | 21 + node_modules/lead/README.md | 55 + node_modules/lead/index.js | 61 + node_modules/lead/package.json | 85 + node_modules/liftoff/CHANGELOG | 127 + node_modules/liftoff/LICENSE | 22 + node_modules/liftoff/README.md | 535 + node_modules/liftoff/index.js | 231 + node_modules/liftoff/lib/build_config_name.js | 17 + node_modules/liftoff/lib/file_search.js | 14 + node_modules/liftoff/lib/find_config.js | 25 + node_modules/liftoff/lib/find_cwd.js | 18 + node_modules/liftoff/lib/get_node_flags.js | 30 + node_modules/liftoff/lib/parse_options.js | 35 + node_modules/liftoff/lib/register_loader.js | 24 + node_modules/liftoff/lib/silent_require.js | 5 + node_modules/liftoff/package.json | 81 + node_modules/load-json-file/index.js | 21 + node_modules/load-json-file/license | 21 + .../load-json-file/node_modules/pify/index.js | 68 + .../load-json-file/node_modules/pify/license | 21 + .../node_modules/pify/package.json | 80 + .../node_modules/pify/readme.md | 119 + node_modules/load-json-file/package.json | 78 + node_modules/load-json-file/readme.md | 45 + node_modules/loader-runner/LICENSE | 21 + node_modules/loader-runner/README.md | 42 + .../loader-runner/lib/LoaderLoadingError.js | 11 + .../loader-runner/lib/LoaderRunner.js | 381 + node_modules/loader-runner/lib/loadLoader.js | 49 + node_modules/loader-runner/package.json | 75 + node_modules/loader-utils/CHANGELOG.md | 87 + node_modules/loader-utils/LICENSE | 20 + node_modules/loader-utils/README.md | 275 + .../loader-utils/lib/getCurrentRequest.js | 16 + .../loader-utils/lib/getHashDigest.js | 69 + node_modules/loader-utils/lib/getOptions.js | 20 + .../loader-utils/lib/getRemainingRequest.js | 16 + node_modules/loader-utils/lib/index.js | 23 + .../loader-utils/lib/interpolateName.js | 151 + node_modules/loader-utils/lib/isUrlRequest.js | 31 + node_modules/loader-utils/lib/parseQuery.js | 68 + node_modules/loader-utils/lib/parseString.js | 23 + .../loader-utils/lib/stringifyRequest.js | 51 + node_modules/loader-utils/lib/urlToRequest.js | 60 + node_modules/loader-utils/package.json | 70 + node_modules/locate-path/index.js | 24 + node_modules/locate-path/license | 9 + node_modules/locate-path/package.json | 76 + node_modules/locate-path/readme.md | 99 + node_modules/lru-cache/LICENSE | 15 + node_modules/lru-cache/README.md | 166 + node_modules/lru-cache/index.js | 334 + node_modules/lru-cache/package.json | 67 + node_modules/make-dir/index.d.ts | 39 + node_modules/make-dir/index.js | 139 + node_modules/make-dir/license | 9 + node_modules/make-dir/package.json | 91 + node_modules/make-dir/readme.md | 123 + node_modules/make-iterator/LICENSE | 21 + node_modules/make-iterator/README.md | 102 + node_modules/make-iterator/index.js | 99 + node_modules/make-iterator/package.json | 103 + node_modules/mamacro/index.js | 10 + node_modules/mamacro/package.json | 38 + node_modules/map-age-cleaner/dist/index.d.ts | 20 + node_modules/map-age-cleaner/dist/index.js | 92 + node_modules/map-age-cleaner/license | 9 + node_modules/map-age-cleaner/package.json | 91 + node_modules/map-age-cleaner/readme.md | 67 + node_modules/map-cache/LICENSE | 21 + node_modules/map-cache/README.md | 145 + node_modules/map-cache/index.js | 100 + node_modules/map-cache/package.json | 91 + node_modules/map-visit/LICENSE | 21 + node_modules/map-visit/README.md | 155 + node_modules/map-visit/index.js | 37 + node_modules/map-visit/package.json | 113 + node_modules/matchdep/.jshintrc | 15 + node_modules/matchdep/.npmignore | 2 + node_modules/matchdep/.travis.yml | 10 + node_modules/matchdep/LICENSE-MIT | 22 + node_modules/matchdep/README.md | 59 + node_modules/matchdep/lib/matchdep.js | 76 + .../node_modules/findup-sync/README.md | 69 + .../node_modules/findup-sync/index.js | 85 + .../node_modules/findup-sync/package.json | 79 + .../matchdep/node_modules/is-glob/LICENSE | 21 + .../matchdep/node_modules/is-glob/README.md | 142 + .../matchdep/node_modules/is-glob/index.js | 25 + .../node_modules/is-glob/package.json | 119 + node_modules/matchdep/package.json | 72 + node_modules/md5.js/LICENSE | 21 + node_modules/md5.js/README.md | 29 + node_modules/md5.js/index.js | 146 + node_modules/md5.js/package.json | 68 + node_modules/mem/index.d.ts | 96 + node_modules/mem/index.js | 88 + node_modules/mem/license | 9 + node_modules/mem/package.json | 78 + node_modules/mem/readme.md | 167 + node_modules/memory-fs/README.md | 29 + .../memory-fs/lib/MemoryFileSystem.js | 329 + node_modules/memory-fs/lib/join.js | 14 + node_modules/memory-fs/lib/normalize.js | 86 + node_modules/memory-fs/package.json | 70 + node_modules/micromatch/CHANGELOG.md | 37 + node_modules/micromatch/LICENSE | 21 + node_modules/micromatch/README.md | 1150 +++ node_modules/micromatch/index.js | 877 ++ node_modules/micromatch/lib/.DS_Store | Bin 0 -> 6148 bytes node_modules/micromatch/lib/cache.js | 1 + node_modules/micromatch/lib/compilers.js | 77 + node_modules/micromatch/lib/parsers.js | 83 + node_modules/micromatch/lib/utils.js | 309 + node_modules/micromatch/package.json | 218 + node_modules/miller-rabin/.npmignore | 2 + node_modules/miller-rabin/1.js | 7 + node_modules/miller-rabin/README.md | 26 + node_modules/miller-rabin/bin/miller-rabin | 29 + node_modules/miller-rabin/lib/mr.js | 115 + node_modules/miller-rabin/package.json | 62 + node_modules/miller-rabin/test.js | 25 + node_modules/miller-rabin/test/api-test.js | 18 + node_modules/mimic-fn/index.d.ts | 54 + node_modules/mimic-fn/index.js | 13 + node_modules/mimic-fn/license | 9 + node_modules/mimic-fn/package.json | 74 + node_modules/mimic-fn/readme.md | 69 + node_modules/minimalistic-assert/LICENSE | 13 + node_modules/minimalistic-assert/index.js | 11 + node_modules/minimalistic-assert/package.json | 48 + node_modules/minimalistic-assert/readme.md | 4 + .../minimalistic-crypto-utils/.npmignore | 2 + .../minimalistic-crypto-utils/.travis.yml | 11 + .../minimalistic-crypto-utils/README.md | 47 + .../minimalistic-crypto-utils/lib/utils.js | 58 + .../minimalistic-crypto-utils/package.json | 56 + .../test/utils-test.js | 28 + node_modules/minimatch/LICENSE | 15 + node_modules/minimatch/README.md | 209 + node_modules/minimatch/minimatch.js | 923 ++ node_modules/minimatch/package.json | 63 + node_modules/minimist/.travis.yml | 8 + node_modules/minimist/LICENSE | 18 + node_modules/minimist/example/parse.js | 2 + node_modules/minimist/index.js | 236 + node_modules/minimist/package.json | 73 + node_modules/minimist/readme.markdown | 91 + node_modules/minimist/test/all_bool.js | 32 + node_modules/minimist/test/bool.js | 166 + node_modules/minimist/test/dash.js | 31 + node_modules/minimist/test/default_bool.js | 35 + node_modules/minimist/test/dotted.js | 22 + node_modules/minimist/test/kv_short.js | 16 + node_modules/minimist/test/long.js | 31 + node_modules/minimist/test/num.js | 36 + node_modules/minimist/test/parse.js | 197 + node_modules/minimist/test/parse_modified.js | 9 + node_modules/minimist/test/short.js | 67 + node_modules/minimist/test/stop_early.js | 15 + node_modules/minimist/test/unknown.js | 102 + node_modules/minimist/test/whitespace.js | 8 + node_modules/mississippi/changelog.md | 10 + node_modules/mississippi/index.js | 10 + node_modules/mississippi/license | 7 + node_modules/mississippi/package.json | 62 + node_modules/mississippi/readme.md | 411 + node_modules/mixin-deep/LICENSE | 21 + node_modules/mixin-deep/README.md | 80 + node_modules/mixin-deep/index.js | 64 + .../node_modules/is-extendable/LICENSE | 21 + .../node_modules/is-extendable/README.md | 88 + .../node_modules/is-extendable/index.d.ts | 5 + .../node_modules/is-extendable/index.js | 14 + .../node_modules/is-extendable/package.json | 98 + node_modules/mixin-deep/package.json | 98 + node_modules/mkdirp/.travis.yml | 8 + node_modules/mkdirp/LICENSE | 21 + node_modules/mkdirp/bin/cmd.js | 33 + node_modules/mkdirp/bin/usage.txt | 12 + node_modules/mkdirp/examples/pow.js | 6 + node_modules/mkdirp/index.js | 98 + .../mkdirp/node_modules/minimist/.travis.yml | 4 + .../mkdirp/node_modules/minimist/LICENSE | 18 + .../node_modules/minimist/example/parse.js | 2 + .../mkdirp/node_modules/minimist/index.js | 187 + .../mkdirp/node_modules/minimist/package.json | 71 + .../node_modules/minimist/readme.markdown | 73 + .../mkdirp/node_modules/minimist/test/dash.js | 24 + .../minimist/test/default_bool.js | 20 + .../node_modules/minimist/test/dotted.js | 16 + .../mkdirp/node_modules/minimist/test/long.js | 31 + .../node_modules/minimist/test/parse.js | 318 + .../minimist/test/parse_modified.js | 9 + .../node_modules/minimist/test/short.js | 67 + .../node_modules/minimist/test/whitespace.js | 8 + node_modules/mkdirp/package.json | 65 + node_modules/mkdirp/readme.markdown | 100 + node_modules/mkdirp/test/chmod.js | 41 + node_modules/mkdirp/test/clobber.js | 38 + node_modules/mkdirp/test/mkdirp.js | 28 + node_modules/mkdirp/test/opts_fs.js | 29 + node_modules/mkdirp/test/opts_fs_sync.js | 27 + node_modules/mkdirp/test/perm.js | 32 + node_modules/mkdirp/test/perm_sync.js | 36 + node_modules/mkdirp/test/race.js | 37 + node_modules/mkdirp/test/rel.js | 32 + node_modules/mkdirp/test/return.js | 25 + node_modules/mkdirp/test/return_sync.js | 24 + node_modules/mkdirp/test/root.js | 19 + node_modules/mkdirp/test/sync.js | 32 + node_modules/mkdirp/test/umask.js | 28 + node_modules/mkdirp/test/umask_sync.js | 32 + node_modules/move-concurrently/LICENSE | 14 + node_modules/move-concurrently/README.md | 53 + node_modules/move-concurrently/README.md~ | 52 + node_modules/move-concurrently/move.js | 84 + node_modules/move-concurrently/package.json | 71 + node_modules/ms/index.js | 152 + node_modules/ms/license.md | 21 + node_modules/ms/package.json | 69 + node_modules/ms/readme.md | 51 + node_modules/mute-stdout/LICENSE | 22 + node_modules/mute-stdout/README.md | 55 + node_modules/mute-stdout/index.js | 19 + node_modules/mute-stdout/package.json | 79 + node_modules/nanomatch/CHANGELOG.md | 57 + node_modules/nanomatch/LICENSE | 21 + node_modules/nanomatch/README.md | 1148 +++ node_modules/nanomatch/index.js | 838 ++ node_modules/nanomatch/lib/cache.js | 1 + node_modules/nanomatch/lib/compilers.js | 339 + node_modules/nanomatch/lib/parsers.js | 386 + node_modules/nanomatch/lib/utils.js | 379 + node_modules/nanomatch/package.json | 171 + node_modules/neo-async/LICENSE | 22 + node_modules/neo-async/README.md | 268 + node_modules/neo-async/all.js | 3 + node_modules/neo-async/allLimit.js | 3 + node_modules/neo-async/allSeries.js | 3 + node_modules/neo-async/angelFall.js | 3 + node_modules/neo-async/any.js | 3 + node_modules/neo-async/anyLimit.js | 3 + node_modules/neo-async/anySeries.js | 3 + node_modules/neo-async/apply.js | 3 + node_modules/neo-async/applyEach.js | 3 + node_modules/neo-async/applyEachSeries.js | 3 + node_modules/neo-async/async.js | 9182 +++++++++++++++++ node_modules/neo-async/async.min.js | 80 + node_modules/neo-async/asyncify.js | 3 + node_modules/neo-async/auto.js | 3 + node_modules/neo-async/autoInject.js | 3 + node_modules/neo-async/cargo.js | 3 + node_modules/neo-async/compose.js | 3 + node_modules/neo-async/concat.js | 3 + node_modules/neo-async/concatLimit.js | 3 + node_modules/neo-async/concatSeries.js | 3 + node_modules/neo-async/constant.js | 3 + node_modules/neo-async/createLogger.js | 3 + node_modules/neo-async/detect.js | 3 + node_modules/neo-async/detectLimit.js | 3 + node_modules/neo-async/detectSeries.js | 3 + node_modules/neo-async/dir.js | 3 + node_modules/neo-async/doDuring.js | 3 + node_modules/neo-async/doUntil.js | 3 + node_modules/neo-async/doWhilst.js | 3 + node_modules/neo-async/during.js | 3 + node_modules/neo-async/each.js | 3 + node_modules/neo-async/eachLimit.js | 3 + node_modules/neo-async/eachOf.js | 3 + node_modules/neo-async/eachOfLimit.js | 3 + node_modules/neo-async/eachOfSeries.js | 3 + node_modules/neo-async/eachSeries.js | 3 + node_modules/neo-async/ensureAsync.js | 3 + node_modules/neo-async/every.js | 3 + node_modules/neo-async/everyLimit.js | 3 + node_modules/neo-async/everySeries.js | 3 + node_modules/neo-async/fast.js | 3 + node_modules/neo-async/filter.js | 3 + node_modules/neo-async/filterLimit.js | 3 + node_modules/neo-async/filterSeries.js | 3 + node_modules/neo-async/find.js | 3 + node_modules/neo-async/findLimit.js | 3 + node_modules/neo-async/findSeries.js | 3 + node_modules/neo-async/foldl.js | 3 + node_modules/neo-async/foldr.js | 3 + node_modules/neo-async/forEach.js | 3 + node_modules/neo-async/forEachLimit.js | 3 + node_modules/neo-async/forEachOf.js | 3 + node_modules/neo-async/forEachOfLimit.js | 3 + node_modules/neo-async/forEachOfSeries.js | 3 + node_modules/neo-async/forEachSeries.js | 3 + node_modules/neo-async/forever.js | 3 + node_modules/neo-async/groupBy.js | 3 + node_modules/neo-async/groupByLimit.js | 3 + node_modules/neo-async/groupBySeries.js | 3 + node_modules/neo-async/inject.js | 3 + node_modules/neo-async/iterator.js | 3 + node_modules/neo-async/log.js | 3 + node_modules/neo-async/map.js | 3 + node_modules/neo-async/mapLimit.js | 3 + node_modules/neo-async/mapSeries.js | 3 + node_modules/neo-async/mapValues.js | 3 + node_modules/neo-async/mapValuesLimit.js | 3 + node_modules/neo-async/mapValuesSeries.js | 3 + node_modules/neo-async/memoize.js | 3 + node_modules/neo-async/nextTick.js | 3 + node_modules/neo-async/omit.js | 3 + node_modules/neo-async/omitLimit.js | 3 + node_modules/neo-async/omitSeries.js | 3 + node_modules/neo-async/package.json | 87 + node_modules/neo-async/parallel.js | 3 + node_modules/neo-async/parallelLimit.js | 3 + node_modules/neo-async/pick.js | 3 + node_modules/neo-async/pickLimit.js | 3 + node_modules/neo-async/pickSeries.js | 3 + node_modules/neo-async/priorityQueue.js | 3 + node_modules/neo-async/queue.js | 3 + node_modules/neo-async/race.js | 3 + node_modules/neo-async/reduce.js | 3 + node_modules/neo-async/reduceRight.js | 3 + node_modules/neo-async/reflect.js | 3 + node_modules/neo-async/reflectAll.js | 3 + node_modules/neo-async/reject.js | 3 + node_modules/neo-async/rejectLimit.js | 3 + node_modules/neo-async/rejectSeries.js | 3 + node_modules/neo-async/retry.js | 3 + node_modules/neo-async/retryable.js | 3 + node_modules/neo-async/safe.js | 3 + node_modules/neo-async/select.js | 3 + node_modules/neo-async/selectLimit.js | 3 + node_modules/neo-async/selectSeries.js | 3 + node_modules/neo-async/seq.js | 3 + node_modules/neo-async/series.js | 3 + node_modules/neo-async/setImmediate.js | 3 + node_modules/neo-async/some.js | 3 + node_modules/neo-async/someLimit.js | 3 + node_modules/neo-async/someSeries.js | 3 + node_modules/neo-async/sortBy.js | 3 + node_modules/neo-async/sortByLimit.js | 3 + node_modules/neo-async/sortBySeries.js | 3 + node_modules/neo-async/timeout.js | 3 + node_modules/neo-async/times.js | 3 + node_modules/neo-async/timesLimit.js | 3 + node_modules/neo-async/timesSeries.js | 3 + node_modules/neo-async/transform.js | 3 + node_modules/neo-async/transformLimit.js | 3 + node_modules/neo-async/transformSeries.js | 3 + node_modules/neo-async/tryEach.js | 3 + node_modules/neo-async/unmemoize.js | 3 + node_modules/neo-async/until.js | 3 + node_modules/neo-async/waterfall.js | 3 + node_modules/neo-async/whilst.js | 3 + node_modules/neo-async/wrapSync.js | 3 + node_modules/next-tick/.lint | 14 + node_modules/next-tick/.npmignore | 4 + node_modules/next-tick/.travis.yml | 16 + node_modules/next-tick/CHANGES | 24 + node_modules/next-tick/LICENSE | 21 + node_modules/next-tick/README.md | 24 + node_modules/next-tick/index.js | 71 + node_modules/next-tick/package.json | 60 + node_modules/next-tick/test/index.js | 22 + node_modules/nice-try/CHANGELOG.md | 21 + node_modules/nice-try/LICENSE | 21 + node_modules/nice-try/README.md | 32 + node_modules/nice-try/package.json | 61 + node_modules/nice-try/src/index.js | 12 + node_modules/node-libs-browser/LICENSE | 22 + node_modules/node-libs-browser/README.md | 63 + node_modules/node-libs-browser/index.js | 38 + node_modules/node-libs-browser/mock/buffer.js | 10 + .../node-libs-browser/mock/console.js | 12 + node_modules/node-libs-browser/mock/dns.js | 15 + node_modules/node-libs-browser/mock/empty.js | 0 node_modules/node-libs-browser/mock/net.js | 10 + .../node-libs-browser/mock/process.js | 34 + .../node-libs-browser/mock/punycode.js | 6 + node_modules/node-libs-browser/mock/tls.js | 1 + node_modules/node-libs-browser/mock/tty.js | 2 + .../node_modules/punycode/LICENSE-MIT.txt | 20 + .../node_modules/punycode/README.md | 176 + .../node_modules/punycode/package.json | 87 + .../node_modules/punycode/punycode.js | 533 + node_modules/node-libs-browser/package.json | 75 + node_modules/normalize-package-data/AUTHORS | 4 + node_modules/normalize-package-data/LICENSE | 30 + node_modules/normalize-package-data/README.md | 106 + .../lib/extract_description.js | 14 + .../normalize-package-data/lib/fixer.js | 418 + .../lib/make_warning.js | 23 + .../normalize-package-data/lib/normalize.js | 39 + .../normalize-package-data/lib/safe_format.js | 9 + .../normalize-package-data/lib/typos.json | 25 + .../lib/warning_messages.json | 30 + .../normalize-package-data/package.json | 77 + node_modules/normalize-path/LICENSE | 21 + node_modules/normalize-path/README.md | 127 + node_modules/normalize-path/index.js | 35 + node_modules/normalize-path/package.json | 114 + node_modules/now-and-later/LICENSE | 21 + node_modules/now-and-later/README.md | 203 + node_modules/now-and-later/index.js | 6 + node_modules/now-and-later/lib/helpers.js | 41 + node_modules/now-and-later/lib/map.js | 63 + node_modules/now-and-later/lib/mapSeries.js | 63 + node_modules/now-and-later/package.json | 94 + node_modules/npm-run-path/index.js | 39 + node_modules/npm-run-path/license | 21 + node_modules/npm-run-path/package.json | 77 + node_modules/npm-run-path/readme.md | 81 + node_modules/number-is-nan/index.js | 4 + node_modules/number-is-nan/license | 21 + node_modules/number-is-nan/package.json | 67 + node_modules/number-is-nan/readme.md | 28 + node_modules/object-assign/index.js | 90 + node_modules/object-assign/license | 21 + node_modules/object-assign/package.json | 74 + node_modules/object-assign/readme.md | 61 + node_modules/object-copy/LICENSE | 21 + node_modules/object-copy/index.js | 174 + .../node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 77 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 82 + .../object-copy/node_modules/kind-of/LICENSE | 21 + .../node_modules/kind-of/README.md | 261 + .../object-copy/node_modules/kind-of/index.js | 116 + .../node_modules/kind-of/package.json | 139 + node_modules/object-copy/package.json | 81 + node_modules/object-keys/.editorconfig | 13 + node_modules/object-keys/.eslintrc | 17 + node_modules/object-keys/.travis.yml | 277 + node_modules/object-keys/CHANGELOG.md | 232 + node_modules/object-keys/LICENSE | 21 + node_modules/object-keys/README.md | 76 + node_modules/object-keys/implementation.js | 122 + node_modules/object-keys/index.js | 32 + node_modules/object-keys/isArguments.js | 17 + node_modules/object-keys/package.json | 118 + node_modules/object-keys/test/index.js | 5 + node_modules/object-visit/LICENSE | 21 + node_modules/object-visit/README.md | 83 + node_modules/object-visit/index.js | 33 + node_modules/object-visit/package.json | 97 + node_modules/object.assign/.editorconfig | 20 + node_modules/object.assign/.eslintrc | 17 + node_modules/object.assign/CHANGELOG.md | 179 + node_modules/object.assign/LICENSE | 21 + node_modules/object.assign/README.md | 135 + node_modules/object.assign/auto.js | 3 + node_modules/object.assign/dist/browser.js | 492 + node_modules/object.assign/hasSymbols.js | 41 + node_modules/object.assign/implementation.js | 41 + node_modules/object.assign/index.js | 17 + node_modules/object.assign/package.json | 112 + node_modules/object.assign/polyfill.js | 51 + node_modules/object.assign/shim.js | 14 + node_modules/object.assign/test.sh | 53 + node_modules/object.assign/test/.eslintrc | 7 + node_modules/object.assign/test/index.js | 17 + node_modules/object.assign/test/native.js | 47 + node_modules/object.assign/test/shimmed.js | 50 + node_modules/object.assign/test/tests.js | 224 + node_modules/object.defaults/LICENSE | 21 + node_modules/object.defaults/README.md | 85 + node_modules/object.defaults/immutable.js | 20 + node_modules/object.defaults/index.js | 11 + node_modules/object.defaults/mutable.js | 35 + node_modules/object.defaults/package.json | 109 + node_modules/object.map/LICENSE | 24 + node_modules/object.map/README.md | 87 + node_modules/object.map/index.js | 22 + node_modules/object.map/package.json | 99 + node_modules/object.pick/LICENSE | 21 + node_modules/object.pick/README.md | 76 + node_modules/object.pick/index.js | 35 + node_modules/object.pick/package.json | 92 + node_modules/object.reduce/LICENSE | 21 + node_modules/object.reduce/README.md | 95 + node_modules/object.reduce/index.js | 31 + node_modules/object.reduce/package.json | 78 + node_modules/once/LICENSE | 15 + node_modules/once/README.md | 79 + node_modules/once/once.js | 42 + node_modules/once/package.json | 70 + node_modules/ordered-read-streams/LICENSE | 20 + node_modules/ordered-read-streams/README.md | 65 + node_modules/ordered-read-streams/index.js | 99 + .../ordered-read-streams/package.json | 61 + node_modules/os-browserify/.npmignore | 14 + node_modules/os-browserify/LICENSE | 21 + node_modules/os-browserify/README.md | 5 + node_modules/os-browserify/browser.js | 49 + node_modules/os-browserify/main.js | 1 + node_modules/os-browserify/package.json | 53 + node_modules/os-locale/index.js | 114 + node_modules/os-locale/license | 9 + node_modules/os-locale/package.json | 77 + node_modules/os-locale/readme.md | 71 + node_modules/p-defer/index.js | 11 + node_modules/p-defer/license | 21 + node_modules/p-defer/package.json | 73 + node_modules/p-defer/readme.md | 47 + node_modules/p-finally/index.js | 15 + node_modules/p-finally/license | 21 + node_modules/p-finally/package.json | 74 + node_modules/p-finally/readme.md | 47 + node_modules/p-is-promise/index.d.ts | 23 + node_modules/p-is-promise/index.js | 15 + node_modules/p-is-promise/license | 9 + node_modules/p-is-promise/package.json | 74 + node_modules/p-is-promise/readme.md | 43 + node_modules/p-limit/index.d.ts | 29 + node_modules/p-limit/index.js | 52 + node_modules/p-limit/license | 9 + node_modules/p-limit/package.json | 84 + node_modules/p-limit/readme.md | 93 + node_modules/p-locate/index.js | 34 + node_modules/p-locate/license | 9 + node_modules/p-locate/package.json | 83 + node_modules/p-locate/readme.md | 88 + node_modules/p-try/index.d.ts | 39 + node_modules/p-try/index.js | 9 + node_modules/p-try/license | 9 + node_modules/p-try/package.json | 74 + node_modules/p-try/readme.md | 58 + node_modules/pako/CHANGELOG.md | 164 + node_modules/pako/LICENSE | 21 + node_modules/pako/README.md | 191 + node_modules/pako/dist/pako.js | 6818 ++++++++++++ node_modules/pako/dist/pako.min.js | 1 + node_modules/pako/dist/pako_deflate.js | 3997 +++++++ node_modules/pako/dist/pako_deflate.min.js | 1 + node_modules/pako/dist/pako_inflate.js | 3300 ++++++ node_modules/pako/dist/pako_inflate.min.js | 1 + node_modules/pako/index.js | 14 + node_modules/pako/lib/deflate.js | 400 + node_modules/pako/lib/inflate.js | 423 + node_modules/pako/lib/utils/common.js | 105 + node_modules/pako/lib/utils/strings.js | 187 + node_modules/pako/lib/zlib/README | 59 + node_modules/pako/lib/zlib/adler32.js | 51 + node_modules/pako/lib/zlib/constants.js | 68 + node_modules/pako/lib/zlib/crc32.js | 59 + node_modules/pako/lib/zlib/deflate.js | 1874 ++++ node_modules/pako/lib/zlib/gzheader.js | 58 + node_modules/pako/lib/zlib/inffast.js | 345 + node_modules/pako/lib/zlib/inflate.js | 1556 +++ node_modules/pako/lib/zlib/inftrees.js | 343 + node_modules/pako/lib/zlib/messages.js | 32 + node_modules/pako/lib/zlib/trees.js | 1222 +++ node_modules/pako/lib/zlib/zstream.js | 47 + node_modules/pako/package.json | 91 + node_modules/parallel-transform/LICENSE | 20 + node_modules/parallel-transform/README.md | 54 + node_modules/parallel-transform/index.js | 105 + node_modules/parallel-transform/package.json | 55 + node_modules/parse-asn1/LICENSE | 13 + node_modules/parse-asn1/README.md | 8 + node_modules/parse-asn1/aesid.json | 13 + node_modules/parse-asn1/asn1.js | 122 + node_modules/parse-asn1/certificate.js | 89 + node_modules/parse-asn1/fixProc.js | 31 + node_modules/parse-asn1/index.js | 107 + node_modules/parse-asn1/package.json | 66 + node_modules/parse-filepath/LICENSE | 21 + node_modules/parse-filepath/README.md | 111 + node_modules/parse-filepath/index.js | 95 + node_modules/parse-filepath/package.json | 110 + node_modules/parse-json/index.js | 35 + node_modules/parse-json/license | 21 + node_modules/parse-json/package.json | 78 + node_modules/parse-json/readme.md | 83 + node_modules/parse-json/vendor/parse.js | 752 ++ node_modules/parse-json/vendor/unicode.js | 71 + node_modules/parse-node-version/LICENSE | 22 + node_modules/parse-node-version/README.md | 51 + node_modules/parse-node-version/index.js | 20 + node_modules/parse-node-version/package.json | 79 + node_modules/parse-passwd/LICENSE | 21 + node_modules/parse-passwd/README.md | 86 + node_modules/parse-passwd/index.js | 56 + node_modules/parse-passwd/package.json | 86 + node_modules/pascalcase/LICENSE | 21 + node_modules/pascalcase/README.md | 80 + node_modules/pascalcase/index.js | 21 + node_modules/pascalcase/package.json | 77 + node_modules/path-browserify/LICENSE | 18 + node_modules/path-browserify/index.js | 302 + node_modules/path-browserify/package.json | 57 + node_modules/path-browserify/readme.markdown | 3 + .../path-browserify/test/test-path.js | 424 + node_modules/path-dirname/index.js | 143 + node_modules/path-dirname/license | 22 + node_modules/path-dirname/package.json | 63 + node_modules/path-dirname/readme.md | 53 + node_modules/path-exists/index.js | 17 + node_modules/path-exists/license | 21 + node_modules/path-exists/package.json | 72 + node_modules/path-exists/readme.md | 50 + node_modules/path-is-absolute/index.js | 20 + node_modules/path-is-absolute/license | 21 + node_modules/path-is-absolute/package.json | 76 + node_modules/path-is-absolute/readme.md | 59 + node_modules/path-key/index.js | 13 + node_modules/path-key/license | 21 + node_modules/path-key/package.json | 72 + node_modules/path-key/readme.md | 51 + node_modules/path-parse/.travis.yml | 9 + node_modules/path-parse/LICENSE | 21 + node_modules/path-parse/README.md | 42 + node_modules/path-parse/index.js | 93 + node_modules/path-parse/package.json | 61 + node_modules/path-parse/test.js | 77 + node_modules/path-root-regex/LICENSE | 21 + node_modules/path-root-regex/README.md | 53 + node_modules/path-root-regex/index.js | 13 + node_modules/path-root-regex/package.json | 96 + node_modules/path-root/LICENSE | 21 + node_modules/path-root/README.md | 94 + node_modules/path-root/index.js | 21 + node_modules/path-root/package.json | 89 + node_modules/path-type/index.js | 29 + node_modules/path-type/license | 21 + .../path-type/node_modules/pify/index.js | 68 + .../path-type/node_modules/pify/license | 21 + .../path-type/node_modules/pify/package.json | 80 + .../path-type/node_modules/pify/readme.md | 119 + node_modules/path-type/package.json | 84 + node_modules/path-type/readme.md | 42 + node_modules/pbkdf2/LICENSE | 21 + node_modules/pbkdf2/README.md | 30 + node_modules/pbkdf2/browser.js | 2 + node_modules/pbkdf2/index.js | 31 + node_modules/pbkdf2/lib/async.js | 100 + node_modules/pbkdf2/lib/default-encoding.js | 10 + node_modules/pbkdf2/lib/precondition.js | 28 + node_modules/pbkdf2/lib/sync-browser.js | 104 + node_modules/pbkdf2/lib/sync.js | 51 + node_modules/pbkdf2/package.json | 98 + node_modules/pify/index.js | 68 + node_modules/pify/license | 9 + node_modules/pify/package.json | 83 + node_modules/pify/readme.md | 145 + node_modules/pinkie-promise/index.js | 3 + node_modules/pinkie-promise/license | 21 + node_modules/pinkie-promise/package.json | 70 + node_modules/pinkie-promise/readme.md | 28 + node_modules/pinkie/index.js | 292 + node_modules/pinkie/license | 21 + node_modules/pinkie/package.json | 68 + node_modules/pinkie/readme.md | 83 + node_modules/pkg-dir/index.js | 10 + node_modules/pkg-dir/license | 9 + node_modules/pkg-dir/package.json | 85 + node_modules/pkg-dir/readme.md | 66 + node_modules/posix-character-classes/LICENSE | 21 + .../posix-character-classes/README.md | 103 + node_modules/posix-character-classes/index.js | 22 + .../posix-character-classes/package.json | 85 + node_modules/pretty-hrtime/.jshintignore | 1 + node_modules/pretty-hrtime/.npmignore | 10 + node_modules/pretty-hrtime/LICENSE | 20 + node_modules/pretty-hrtime/README.md | 57 + node_modules/pretty-hrtime/index.js | 80 + node_modules/pretty-hrtime/package.json | 59 + node_modules/process-nextick-args/index.js | 45 + node_modules/process-nextick-args/license.md | 19 + .../process-nextick-args/package.json | 50 + node_modules/process-nextick-args/readme.md | 18 + node_modules/process/.eslintrc | 21 + node_modules/process/LICENSE | 22 + node_modules/process/README.md | 26 + node_modules/process/browser.js | 184 + node_modules/process/index.js | 2 + node_modules/process/package.json | 59 + node_modules/process/test.js | 199 + node_modules/promise-inflight/LICENSE | 14 + node_modules/promise-inflight/README.md | 34 + node_modules/promise-inflight/inflight.js | 36 + node_modules/promise-inflight/package.json | 53 + node_modules/prr/.jshintrc | 61 + node_modules/prr/.npmignore | 1 + node_modules/prr/.travis.yml | 10 + node_modules/prr/LICENSE.md | 11 + node_modules/prr/README.md | 47 + node_modules/prr/package.json | 58 + node_modules/prr/prr.js | 63 + node_modules/prr/test.js | 169 + node_modules/public-encrypt/.travis.yml | 6 + node_modules/public-encrypt/LICENSE | 19 + node_modules/public-encrypt/browser.js | 10 + node_modules/public-encrypt/index.js | 18 + node_modules/public-encrypt/mgf.js | 19 + node_modules/public-encrypt/package.json | 64 + node_modules/public-encrypt/privateDecrypt.js | 105 + node_modules/public-encrypt/publicEncrypt.js | 88 + node_modules/public-encrypt/readme.md | 8 + node_modules/public-encrypt/test/1024.priv | 16 + node_modules/public-encrypt/test/1024.pub | 6 + node_modules/public-encrypt/test/ec.pass.priv | 7 + node_modules/public-encrypt/test/ec.priv | 5 + node_modules/public-encrypt/test/ec.pub | 4 + node_modules/public-encrypt/test/index.js | 113 + node_modules/public-encrypt/test/nodeTests.js | 51 + .../public-encrypt/test/pass.1024.priv | 18 + .../public-encrypt/test/pass.1024.pub | 6 + .../public-encrypt/test/rsa.1024.priv | 15 + node_modules/public-encrypt/test/rsa.1024.pub | 5 + .../public-encrypt/test/rsa.2028.priv | 27 + node_modules/public-encrypt/test/rsa.2028.pub | 8 + .../public-encrypt/test/rsa.pass.priv | 30 + node_modules/public-encrypt/test/rsa.pass.pub | 9 + .../public-encrypt/test/test_cert.pem | 20 + node_modules/public-encrypt/test/test_key.pem | 15 + .../public-encrypt/test/test_rsa_privkey.pem | 15 + .../test/test_rsa_privkey_encrypted.pem | 18 + .../public-encrypt/test/test_rsa_pubkey.pem | 6 + node_modules/public-encrypt/withPublic.js | 12 + node_modules/public-encrypt/xor.js | 8 + node_modules/pump/.travis.yml | 5 + node_modules/pump/LICENSE | 21 + node_modules/pump/README.md | 65 + node_modules/pump/index.js | 82 + node_modules/pump/package.json | 59 + node_modules/pump/test-browser.js | 66 + node_modules/pump/test-node.js | 53 + node_modules/pumpify/.travis.yml | 8 + node_modules/pumpify/LICENSE | 21 + node_modules/pumpify/README.md | 56 + node_modules/pumpify/index.js | 60 + .../pumpify/node_modules/pump/.travis.yml | 5 + .../pumpify/node_modules/pump/LICENSE | 21 + .../pumpify/node_modules/pump/README.md | 56 + .../pumpify/node_modules/pump/index.js | 82 + .../pumpify/node_modules/pump/package.json | 59 + .../pumpify/node_modules/pump/test-browser.js | 62 + .../pumpify/node_modules/pump/test-node.js | 53 + node_modules/pumpify/package.json | 67 + node_modules/pumpify/test.js | 235 + node_modules/punycode/LICENSE-MIT.txt | 20 + node_modules/punycode/README.md | 122 + node_modules/punycode/package.json | 85 + node_modules/punycode/punycode.es6.js | 441 + node_modules/punycode/punycode.js | 440 + node_modules/querystring-es3/.travis.yml | 4 + node_modules/querystring-es3/History.md | 20 + node_modules/querystring-es3/License.md | 19 + node_modules/querystring-es3/Readme.md | 15 + node_modules/querystring-es3/decode.js | 84 + node_modules/querystring-es3/encode.js | 85 + node_modules/querystring-es3/index.js | 4 + node_modules/querystring-es3/package.json | 100 + .../querystring-es3/test/common-index.js | 3 + node_modules/querystring-es3/test/index.js | 210 + .../querystring-es3/test/tap-index.js | 3 + node_modules/querystring/.History.md.un~ | Bin 0 -> 7960 bytes node_modules/querystring/.Readme.md.un~ | Bin 0 -> 3225 bytes node_modules/querystring/.package.json.un~ | Bin 0 -> 5710 bytes node_modules/querystring/.travis.yml | 4 + node_modules/querystring/History.md | 20 + node_modules/querystring/License.md | 19 + node_modules/querystring/Readme.md | 15 + node_modules/querystring/decode.js | 80 + node_modules/querystring/encode.js | 64 + node_modules/querystring/index.js | 4 + node_modules/querystring/package.json | 100 + node_modules/querystring/test/.index.js.un~ | Bin 0 -> 975 bytes node_modules/querystring/test/common-index.js | 3 + node_modules/querystring/test/index.js | 210 + node_modules/querystring/test/tap-index.js | 3 + node_modules/randombytes/.travis.yml | 15 + node_modules/randombytes/.zuul.yml | 1 + node_modules/randombytes/LICENSE | 21 + node_modules/randombytes/README.md | 14 + node_modules/randombytes/browser.js | 50 + node_modules/randombytes/index.js | 1 + node_modules/randombytes/package.json | 65 + node_modules/randombytes/test.js | 81 + node_modules/randomfill/.travis.yml | 15 + node_modules/randomfill/.zuul.yml | 1 + node_modules/randomfill/LICENSE | 21 + node_modules/randomfill/README.md | 15 + node_modules/randomfill/browser.js | 108 + node_modules/randomfill/index.js | 7 + node_modules/randomfill/package.json | 62 + node_modules/randomfill/test.js | 28 + node_modules/read-pkg-up/index.js | 31 + node_modules/read-pkg-up/license | 21 + .../read-pkg-up/node_modules/find-up/index.js | 53 + .../read-pkg-up/node_modules/find-up/license | 21 + .../node_modules/find-up/package.json | 83 + .../node_modules/find-up/readme.md | 72 + .../node_modules/path-exists/index.js | 24 + .../node_modules/path-exists/license | 21 + .../node_modules/path-exists/package.json | 72 + .../node_modules/path-exists/readme.md | 45 + node_modules/read-pkg-up/package.json | 93 + node_modules/read-pkg-up/readme.md | 79 + node_modules/read-pkg/index.js | 48 + node_modules/read-pkg/license | 21 + node_modules/read-pkg/package.json | 74 + node_modules/read-pkg/readme.md | 79 + node_modules/readable-stream/.travis.yml | 34 + node_modules/readable-stream/CONTRIBUTING.md | 38 + node_modules/readable-stream/GOVERNANCE.md | 136 + node_modules/readable-stream/LICENSE | 47 + node_modules/readable-stream/README.md | 58 + .../doc/wg-meetings/2015-01-30.md | 60 + .../readable-stream/duplex-browser.js | 1 + node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 131 + .../lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 ++ .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 687 ++ .../lib/internal/streams/BufferList.js | 79 + .../lib/internal/streams/destroy.js | 74 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + node_modules/readable-stream/package.json | 93 + node_modules/readable-stream/passthrough.js | 1 + .../readable-stream/readable-browser.js | 7 + node_modules/readable-stream/readable.js | 19 + node_modules/readable-stream/transform.js | 1 + .../readable-stream/writable-browser.js | 1 + node_modules/readable-stream/writable.js | 8 + node_modules/readdirp/LICENSE | 20 + node_modules/readdirp/README.md | 204 + node_modules/readdirp/package.json | 82 + node_modules/readdirp/readdirp.js | 294 + node_modules/readdirp/stream-api.js | 98 + node_modules/rechoir/.npmignore | 1 + node_modules/rechoir/.travis.yml | 24 + node_modules/rechoir/CHANGELOG | 38 + node_modules/rechoir/LICENSE | 22 + node_modules/rechoir/README.md | 42 + node_modules/rechoir/index.js | 59 + node_modules/rechoir/lib/extension.js | 11 + node_modules/rechoir/lib/normalize.js | 15 + node_modules/rechoir/lib/register.js | 15 + node_modules/rechoir/package.json | 113 + node_modules/regex-not/LICENSE | 21 + node_modules/regex-not/README.md | 133 + node_modules/regex-not/index.js | 72 + node_modules/regex-not/package.json | 98 + node_modules/remove-bom-buffer/LICENSE | 21 + node_modules/remove-bom-buffer/README.md | 65 + node_modules/remove-bom-buffer/index.js | 27 + node_modules/remove-bom-buffer/package.json | 109 + node_modules/remove-bom-stream/LICENSE | 21 + node_modules/remove-bom-stream/README.md | 51 + node_modules/remove-bom-stream/index.js | 51 + node_modules/remove-bom-stream/package.json | 90 + .../remove-trailing-separator/history.md | 17 + .../remove-trailing-separator/index.js | 17 + .../remove-trailing-separator/license | 3 + .../remove-trailing-separator/package.json | 64 + .../remove-trailing-separator/readme.md | 51 + node_modules/repeat-element/LICENSE | 21 + node_modules/repeat-element/README.md | 99 + node_modules/repeat-element/index.js | 18 + node_modules/repeat-element/package.json | 80 + node_modules/repeat-string/LICENSE | 21 + node_modules/repeat-string/README.md | 136 + node_modules/repeat-string/index.js | 70 + node_modules/repeat-string/package.json | 129 + node_modules/replace-ext/LICENSE | 21 + node_modules/replace-ext/README.md | 50 + node_modules/replace-ext/index.js | 18 + node_modules/replace-ext/package.json | 86 + node_modules/replace-homedir/LICENSE | 21 + node_modules/replace-homedir/README.md | 48 + node_modules/replace-homedir/index.js | 29 + node_modules/replace-homedir/package.json | 89 + node_modules/require-directory/.jshintrc | 67 + node_modules/require-directory/.npmignore | 1 + node_modules/require-directory/.travis.yml | 3 + node_modules/require-directory/LICENSE | 22 + .../require-directory/README.markdown | 184 + node_modules/require-directory/index.js | 86 + node_modules/require-directory/package.json | 69 + .../require-main-filename/CHANGELOG.md | 26 + .../require-main-filename/LICENSE.txt | 14 + node_modules/require-main-filename/README.md | 26 + node_modules/require-main-filename/index.js | 18 + .../require-main-filename/package.json | 63 + node_modules/resolve-cwd/index.js | 5 + node_modules/resolve-cwd/license | 21 + node_modules/resolve-cwd/package.json | 73 + node_modules/resolve-cwd/readme.md | 57 + node_modules/resolve-dir/LICENSE | 21 + node_modules/resolve-dir/README.md | 88 + node_modules/resolve-dir/index.js | 22 + .../node_modules/global-modules/LICENSE | 21 + .../node_modules/global-modules/README.md | 75 + .../node_modules/global-modules/index.js | 31 + .../node_modules/global-modules/package.json | 112 + node_modules/resolve-dir/package.json | 109 + node_modules/resolve-from/index.js | 35 + node_modules/resolve-from/license | 21 + node_modules/resolve-from/package.json | 67 + node_modules/resolve-from/readme.md | 71 + node_modules/resolve-options/LICENSE | 21 + node_modules/resolve-options/README.md | 104 + node_modules/resolve-options/index.js | 111 + node_modules/resolve-options/package.json | 89 + node_modules/resolve-url/.jshintrc | 44 + node_modules/resolve-url/LICENSE | 21 + node_modules/resolve-url/bower.json | 15 + node_modules/resolve-url/changelog.md | 15 + node_modules/resolve-url/component.json | 15 + node_modules/resolve-url/package.json | 68 + node_modules/resolve-url/readme.md | 83 + node_modules/resolve-url/resolve-url.js | 47 + node_modules/resolve-url/test/resolve-url.js | 70 + node_modules/resolve/.eslintignore | 1 + node_modules/resolve/.eslintrc | 39 + node_modules/resolve/.travis.yml | 8 + node_modules/resolve/LICENSE | 21 + node_modules/resolve/appveyor.yml | 54 + node_modules/resolve/example/async.js | 5 + node_modules/resolve/example/sync.js | 3 + node_modules/resolve/index.js | 6 + node_modules/resolve/lib/async.js | 290 + node_modules/resolve/lib/caller.js | 8 + node_modules/resolve/lib/core.js | 53 + node_modules/resolve/lib/core.json | 75 + node_modules/resolve/lib/is-core.js | 5 + .../resolve/lib/node-modules-paths.js | 42 + node_modules/resolve/lib/normalize-options.js | 10 + node_modules/resolve/lib/sync.js | 183 + node_modules/resolve/package.json | 79 + node_modules/resolve/readme.markdown | 220 + node_modules/resolve/test/.eslintrc | 5 + node_modules/resolve/test/core.js | 85 + node_modules/resolve/test/dotdot.js | 29 + node_modules/resolve/test/dotdot/abc/index.js | 2 + node_modules/resolve/test/dotdot/index.js | 1 + node_modules/resolve/test/faulty_basedir.js | 29 + node_modules/resolve/test/filter.js | 34 + node_modules/resolve/test/filter_sync.js | 33 + node_modules/resolve/test/mock.js | 169 + node_modules/resolve/test/mock_sync.js | 80 + node_modules/resolve/test/module_dir.js | 56 + .../test/module_dir/xmodules/aaa/index.js | 1 + .../test/module_dir/ymodules/aaa/index.js | 1 + .../test/module_dir/zmodules/bbb/main.js | 1 + .../test/module_dir/zmodules/bbb/package.json | 3 + .../resolve/test/node-modules-paths.js | 143 + node_modules/resolve/test/node_path.js | 70 + .../resolve/test/node_path/x/aaa/index.js | 1 + .../resolve/test/node_path/x/ccc/index.js | 1 + .../resolve/test/node_path/y/bbb/index.js | 1 + .../resolve/test/node_path/y/ccc/index.js | 1 + node_modules/resolve/test/nonstring.js | 9 + node_modules/resolve/test/pathfilter.js | 75 + .../resolve/test/pathfilter/deep_ref/main.js | 0 node_modules/resolve/test/precedence.js | 23 + node_modules/resolve/test/precedence/aaa.js | 1 + .../resolve/test/precedence/aaa/index.js | 1 + .../resolve/test/precedence/aaa/main.js | 1 + node_modules/resolve/test/precedence/bbb.js | 1 + .../resolve/test/precedence/bbb/main.js | 1 + node_modules/resolve/test/resolver.js | 450 + .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 4 + .../resolve/test/resolver/baz/quux.js | 1 + .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 5 + node_modules/resolve/test/resolver/cup.coffee | 1 + .../resolve/test/resolver/dot_main/index.js | 1 + .../test/resolver/dot_main/package.json | 3 + .../test/resolver/dot_slash_main/index.js | 1 + .../test/resolver/dot_slash_main/package.json | 3 + node_modules/resolve/test/resolver/foo.js | 1 + .../test/resolver/incorrect_main/index.js | 2 + .../test/resolver/incorrect_main/package.json | 3 + .../test/resolver/invalid_main/package.json | 7 + node_modules/resolve/test/resolver/mug.coffee | 0 node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/multirepo/lerna.json | 6 + .../test/resolver/multirepo/package.json | 20 + .../multirepo/packages/package-a/index.js | 35 + .../multirepo/packages/package-a/package.json | 14 + .../multirepo/packages/package-b/index.js | 0 .../multirepo/packages/package-b/package.json | 14 + .../resolver/nested_symlinks/mylib/async.js | 26 + .../nested_symlinks/mylib/package.json | 15 + .../resolver/nested_symlinks/mylib/sync.js | 12 + .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 + .../resolve/test/resolver/same_names/foo.js | 1 + .../test/resolver/same_names/foo/index.js | 1 + .../resolver/symlinked/_/node_modules/foo.js | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/symlinked/package/bar.js | 1 + .../resolver/symlinked/package/package.json | 3 + .../test/resolver/without_basedir/main.js | 5 + node_modules/resolve/test/resolver_sync.js | 358 + node_modules/resolve/test/shadowed_core.js | 38 + .../shadowed_core/node_modules/util/index.js | 0 node_modules/resolve/test/subdirs.js | 13 + node_modules/resolve/test/symlinks.js | 173 + node_modules/ret/LICENSE | 19 + node_modules/ret/README.md | 183 + node_modules/ret/lib/index.js | 282 + node_modules/ret/lib/positions.js | 17 + node_modules/ret/lib/sets.js | 82 + node_modules/ret/lib/types.js | 10 + node_modules/ret/lib/util.js | 111 + node_modules/ret/package.json | 67 + node_modules/rimraf/LICENSE | 15 + node_modules/rimraf/README.md | 101 + node_modules/rimraf/bin.js | 50 + node_modules/rimraf/package.json | 69 + node_modules/rimraf/rimraf.js | 372 + node_modules/ripemd160/CHANGELOG.md | 72 + node_modules/ripemd160/LICENSE | 21 + node_modules/ripemd160/README.md | 27 + node_modules/ripemd160/index.js | 163 + node_modules/ripemd160/package.json | 68 + node_modules/run-queue/README.md | 86 + node_modules/run-queue/package.json | 63 + node_modules/run-queue/queue.js | 95 + node_modules/safe-buffer/LICENSE | 21 + node_modules/safe-buffer/README.md | 584 ++ node_modules/safe-buffer/index.d.ts | 187 + node_modules/safe-buffer/index.js | 62 + node_modules/safe-buffer/package.json | 76 + node_modules/safe-regex/.travis.yml | 4 + node_modules/safe-regex/LICENSE | 18 + node_modules/safe-regex/example/safe.js | 3 + node_modules/safe-regex/index.js | 43 + node_modules/safe-regex/package.json | 74 + node_modules/safe-regex/readme.markdown | 65 + node_modules/safe-regex/test/regex.js | 50 + node_modules/schema-utils/CHANGELOG.md | 134 + node_modules/schema-utils/LICENSE | 20 + node_modules/schema-utils/README.md | 149 + node_modules/schema-utils/package.json | 75 + .../schema-utils/src/ValidationError.js | 30 + node_modules/schema-utils/src/index.js | 9 + .../schema-utils/src/validateOptions.js | 38 + .../semver-greatest-satisfied-range/LICENSE | 21 + .../semver-greatest-satisfied-range/README.md | 48 + .../semver-greatest-satisfied-range/index.js | 19 + .../package.json | 87 + node_modules/semver/CHANGELOG.md | 39 + node_modules/semver/LICENSE | 15 + node_modules/semver/README.md | 412 + node_modules/semver/bin/semver | 160 + node_modules/semver/package.json | 60 + node_modules/semver/range.bnf | 16 + node_modules/semver/semver.js | 1483 +++ node_modules/serialize-javascript/LICENSE | 27 + node_modules/serialize-javascript/README.md | 143 + node_modules/serialize-javascript/index.js | 210 + .../serialize-javascript/package.json | 61 + node_modules/set-blocking/CHANGELOG.md | 26 + node_modules/set-blocking/LICENSE.txt | 14 + node_modules/set-blocking/README.md | 31 + node_modules/set-blocking/index.js | 7 + node_modules/set-blocking/package.json | 70 + node_modules/set-value/LICENSE | 21 + node_modules/set-value/README.md | 150 + node_modules/set-value/index.js | 55 + .../node_modules/extend-shallow/LICENSE | 21 + .../node_modules/extend-shallow/README.md | 61 + .../node_modules/extend-shallow/index.js | 33 + .../node_modules/extend-shallow/package.json | 87 + node_modules/set-value/package.json | 121 + node_modules/setimmediate/LICENSE.txt | 20 + node_modules/setimmediate/package.json | 74 + node_modules/setimmediate/setImmediate.js | 186 + node_modules/sha.js/.travis.yml | 17 + node_modules/sha.js/LICENSE | 49 + node_modules/sha.js/README.md | 44 + node_modules/sha.js/bin.js | 41 + node_modules/sha.js/hash.js | 81 + node_modules/sha.js/index.js | 15 + node_modules/sha.js/package.json | 66 + node_modules/sha.js/sha.js | 94 + node_modules/sha.js/sha1.js | 99 + node_modules/sha.js/sha224.js | 53 + node_modules/sha.js/sha256.js | 135 + node_modules/sha.js/sha384.js | 57 + node_modules/sha.js/sha512.js | 260 + node_modules/sha.js/test/hash.js | 75 + node_modules/sha.js/test/test.js | 100 + node_modules/sha.js/test/vectors.js | 72 + node_modules/shebang-command/index.js | 19 + node_modules/shebang-command/license | 21 + node_modules/shebang-command/package.json | 71 + node_modules/shebang-command/readme.md | 39 + node_modules/shebang-regex/index.js | 2 + node_modules/shebang-regex/license | 21 + node_modules/shebang-regex/package.json | 64 + node_modules/shebang-regex/readme.md | 29 + node_modules/signal-exit/CHANGELOG.md | 27 + node_modules/signal-exit/LICENSE.txt | 16 + node_modules/signal-exit/README.md | 40 + node_modules/signal-exit/index.js | 157 + node_modules/signal-exit/package.json | 66 + node_modules/signal-exit/signals.js | 53 + node_modules/snapdragon-node/LICENSE | 21 + node_modules/snapdragon-node/README.md | 453 + node_modules/snapdragon-node/index.js | 492 + .../node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 95 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 93 + .../is-accessor-descriptor/LICENSE | 21 + .../is-accessor-descriptor/README.md | 144 + .../is-accessor-descriptor/index.js | 69 + .../is-accessor-descriptor/package.json | 110 + .../node_modules/is-data-descriptor/LICENSE | 21 + .../node_modules/is-data-descriptor/README.md | 161 + .../node_modules/is-data-descriptor/index.js | 49 + .../is-data-descriptor/package.json | 109 + .../node_modules/is-descriptor/LICENSE | 21 + .../node_modules/is-descriptor/README.md | 193 + .../node_modules/is-descriptor/index.js | 22 + .../node_modules/is-descriptor/package.json | 114 + node_modules/snapdragon-node/package.json | 109 + node_modules/snapdragon-util/LICENSE | 21 + node_modules/snapdragon-util/README.md | 807 ++ node_modules/snapdragon-util/index.js | 1019 ++ .../node_modules/kind-of/LICENSE | 21 + .../node_modules/kind-of/README.md | 261 + .../node_modules/kind-of/index.js | 116 + .../node_modules/kind-of/package.json | 139 + node_modules/snapdragon-util/package.json | 98 + node_modules/snapdragon/LICENSE | 21 + node_modules/snapdragon/README.md | 321 + node_modules/snapdragon/index.js | 174 + node_modules/snapdragon/lib/compiler.js | 177 + node_modules/snapdragon/lib/parser.js | 533 + node_modules/snapdragon/lib/position.js | 14 + node_modules/snapdragon/lib/source-maps.js | 145 + node_modules/snapdragon/lib/utils.js | 48 + .../node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 77 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 82 + .../node_modules/extend-shallow/LICENSE | 21 + .../node_modules/extend-shallow/README.md | 61 + .../node_modules/extend-shallow/index.js | 33 + .../node_modules/extend-shallow/package.json | 87 + node_modules/snapdragon/package.json | 126 + node_modules/source-list-map/LICENSE | 7 + node_modules/source-list-map/README.md | 91 + node_modules/source-list-map/lib/CodeNode.js | 66 + .../source-list-map/lib/MappingsContext.js | 45 + .../source-list-map/lib/SingleLineNode.js | 93 + .../source-list-map/lib/SourceListMap.js | 117 + .../source-list-map/lib/SourceNode.js | 129 + .../source-list-map/lib/base64-vlq.js | 169 + .../lib/fromStringWithSourceMap.js | 102 + node_modules/source-list-map/lib/helpers.js | 23 + node_modules/source-list-map/lib/index.js | 6 + node_modules/source-list-map/package.json | 56 + node_modules/source-map-resolve/LICENSE | 22 + node_modules/source-map-resolve/changelog.md | 108 + .../lib/decode-uri-component.js | 8 + .../source-map-resolve/lib/resolve-url.js | 9 + .../lib/source-map-resolve-node.js | 342 + node_modules/source-map-resolve/package.json | 81 + node_modules/source-map-resolve/readme.md | 231 + .../source-map-resolve/source-map-resolve.js | 348 + node_modules/source-map-support/LICENSE.md | 21 + node_modules/source-map-support/README.md | 284 + .../browser-source-map-support.js | 113 + .../node_modules/source-map/CHANGELOG.md | 301 + .../node_modules/source-map/LICENSE | 28 + .../node_modules/source-map/README.md | 742 ++ .../source-map/dist/source-map.debug.js | 3234 ++++++ .../source-map/dist/source-map.js | 3233 ++++++ .../source-map/dist/source-map.min.js | 2 + .../source-map/dist/source-map.min.js.map | 1 + .../node_modules/source-map/lib/array-set.js | 121 + .../node_modules/source-map/lib/base64-vlq.js | 140 + .../node_modules/source-map/lib/base64.js | 67 + .../source-map/lib/binary-search.js | 111 + .../source-map/lib/mapping-list.js | 79 + .../node_modules/source-map/lib/quick-sort.js | 114 + .../source-map/lib/source-map-consumer.js | 1145 ++ .../source-map/lib/source-map-generator.js | 425 + .../source-map/lib/source-node.js | 413 + .../node_modules/source-map/lib/util.js | 488 + .../node_modules/source-map/package.json | 212 + .../node_modules/source-map/source-map.d.ts | 98 + .../node_modules/source-map/source-map.js | 8 + node_modules/source-map-support/package.json | 57 + node_modules/source-map-support/register.js | 1 + .../source-map-support/source-map-support.js | 587 ++ node_modules/source-map-url/.jshintrc | 43 + node_modules/source-map-url/LICENSE | 21 + node_modules/source-map-url/bower.json | 20 + node_modules/source-map-url/changelog.md | 52 + node_modules/source-map-url/component.json | 18 + node_modules/source-map-url/package.json | 73 + node_modules/source-map-url/readme.md | 97 + node_modules/source-map-url/source-map-url.js | 57 + .../source-map-url/test/source-map-url.js | 402 + node_modules/source-map-url/x-package.json5 | 55 + node_modules/source-map/CHANGELOG.md | 301 + node_modules/source-map/LICENSE | 28 + node_modules/source-map/README.md | 729 ++ .../source-map/dist/source-map.debug.js | 3091 ++++++ node_modules/source-map/dist/source-map.js | 3090 ++++++ .../source-map/dist/source-map.min.js | 2 + .../source-map/dist/source-map.min.js.map | 1 + node_modules/source-map/lib/array-set.js | 121 + node_modules/source-map/lib/base64-vlq.js | 140 + node_modules/source-map/lib/base64.js | 67 + node_modules/source-map/lib/binary-search.js | 111 + node_modules/source-map/lib/mapping-list.js | 79 + node_modules/source-map/lib/quick-sort.js | 114 + .../source-map/lib/source-map-consumer.js | 1082 ++ .../source-map/lib/source-map-generator.js | 416 + node_modules/source-map/lib/source-node.js | 413 + node_modules/source-map/lib/util.js | 417 + node_modules/source-map/package.json | 211 + node_modules/source-map/source-map.js | 8 + node_modules/sparkles/LICENSE | 22 + node_modules/sparkles/README.md | 62 + node_modules/sparkles/index.js | 45 + node_modules/sparkles/package.json | 81 + node_modules/spdx-correct/LICENSE | 202 + node_modules/spdx-correct/README.md | 14 + node_modules/spdx-correct/index.js | 343 + node_modules/spdx-correct/package.json | 88 + node_modules/spdx-exceptions/README.md | 36 + node_modules/spdx-exceptions/index.json | 34 + node_modules/spdx-exceptions/package.json | 49 + node_modules/spdx-exceptions/test.log | 8 + node_modules/spdx-expression-parse/AUTHORS | 4 + node_modules/spdx-expression-parse/LICENSE | 22 + node_modules/spdx-expression-parse/README.md | 91 + node_modules/spdx-expression-parse/index.js | 8 + .../spdx-expression-parse/package.json | 97 + node_modules/spdx-expression-parse/parse.js | 138 + node_modules/spdx-expression-parse/scan.js | 131 + node_modules/spdx-license-ids/README.md | 52 + node_modules/spdx-license-ids/deprecated.json | 24 + node_modules/spdx-license-ids/index.json | 370 + node_modules/spdx-license-ids/package.json | 75 + node_modules/split-string/LICENSE | 21 + node_modules/split-string/README.md | 321 + node_modules/split-string/index.js | 171 + node_modules/split-string/package.json | 103 + node_modules/ssri/CHANGELOG.md | 286 + node_modules/ssri/LICENSE.md | 16 + node_modules/ssri/README.md | 488 + node_modules/ssri/index.js | 395 + node_modules/ssri/package.json | 89 + node_modules/stack-trace/.npmignore | 1 + node_modules/stack-trace/License | 19 + node_modules/stack-trace/Makefile | 11 + node_modules/stack-trace/Readme.md | 98 + node_modules/stack-trace/lib/stack-trace.js | 136 + node_modules/stack-trace/package.json | 53 + node_modules/static-extend/LICENSE | 21 + node_modules/static-extend/index.js | 90 + .../node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 77 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 82 + node_modules/static-extend/package.json | 96 + node_modules/stream-browserify/.travis.yml | 16 + node_modules/stream-browserify/LICENSE | 20 + node_modules/stream-browserify/index.js | 127 + node_modules/stream-browserify/package.json | 80 + .../stream-browserify/readme.markdown | 25 + node_modules/stream-browserify/test/buf.js | 33 + node_modules/stream-each/.travis.yml | 5 + node_modules/stream-each/LICENSE | 21 + node_modules/stream-each/README.md | 41 + node_modules/stream-each/collaborators.md | 7 + node_modules/stream-each/index.js | 59 + node_modules/stream-each/package.json | 57 + node_modules/stream-each/test.js | 143 + node_modules/stream-exhaust/README.md | 33 + node_modules/stream-exhaust/index.js | 34 + node_modules/stream-exhaust/package.json | 52 + node_modules/stream-exhaust/test.js | 209 + node_modules/stream-http/.airtap.yml | 23 + node_modules/stream-http/.travis.yml | 7 + node_modules/stream-http/LICENSE | 24 + node_modules/stream-http/README.md | 144 + node_modules/stream-http/ie8-polyfill.js | 168 + node_modules/stream-http/index.js | 85 + node_modules/stream-http/lib/capability.js | 73 + node_modules/stream-http/lib/request.js | 327 + node_modules/stream-http/lib/response.js | 224 + node_modules/stream-http/package.json | 73 + .../stream-http/test/browser/abort.js | 55 + node_modules/stream-http/test/browser/auth.js | 22 + .../test/browser/binary-streaming.js | 71 + .../stream-http/test/browser/binary.js | 32 + .../stream-http/test/browser/body-empty.js | 29 + .../stream-http/test/browser/cookie.js | 25 + .../stream-http/test/browser/disable-fetch.js | 37 + .../test/browser/error.js.disabled | 12 + .../stream-http/test/browser/headers.js | 116 + .../test/browser/lib/webworker-worker.js | 20 + .../stream-http/test/browser/package.json | 5 + .../stream-http/test/browser/post-binary.js | 41 + .../stream-http/test/browser/post-text.js | 48 + .../test/browser/text-streaming.js | 43 + node_modules/stream-http/test/browser/text.js | 43 + .../stream-http/test/browser/timeout.js | 43 + .../stream-http/test/browser/webworker.js | 31 + .../stream-http/test/node/http-browserify.js | 147 + node_modules/stream-http/test/server/index.js | 137 + .../stream-http/test/server/static/basic.txt | 19 + .../test/server/static/browserify.png | Bin 0 -> 31422 bytes .../test/server/static/test-polyfill.js | 9 + node_modules/stream-shift/.travis.yml | 6 + node_modules/stream-shift/LICENSE | 21 + node_modules/stream-shift/README.md | 25 + node_modules/stream-shift/index.js | 20 + node_modules/stream-shift/package.json | 54 + node_modules/stream-shift/test.js | 48 + node_modules/string-width/index.js | 39 + node_modules/string-width/license | 9 + node_modules/string-width/package.json | 90 + node_modules/string-width/readme.md | 45 + node_modules/string_decoder/.travis.yml | 50 + node_modules/string_decoder/LICENSE | 48 + node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + node_modules/string_decoder/package.json | 60 + node_modules/strip-ansi/index.d.ts | 15 + node_modules/strip-ansi/index.js | 7 + node_modules/strip-ansi/license | 9 + node_modules/strip-ansi/package.json | 88 + node_modules/strip-ansi/readme.md | 61 + node_modules/strip-bom/index.js | 17 + node_modules/strip-bom/license | 21 + node_modules/strip-bom/package.json | 74 + node_modules/strip-bom/readme.md | 39 + node_modules/strip-eof/index.js | 15 + node_modules/strip-eof/license | 21 + node_modules/strip-eof/package.json | 71 + node_modules/strip-eof/readme.md | 28 + node_modules/supports-color/browser.js | 5 + node_modules/supports-color/index.js | 138 + node_modules/supports-color/license | 9 + node_modules/supports-color/package.json | 85 + node_modules/supports-color/readme.md | 85 + node_modules/sver-compat/.npmignore | 2 + node_modules/sver-compat/.travis.yml | 9 + node_modules/sver-compat/LICENSE | 10 + node_modules/sver-compat/README.md | 160 + node_modules/sver-compat/convert-range.js | 132 + node_modules/sver-compat/package.json | 57 + node_modules/sver-compat/sver.js | 400 + node_modules/tapable/LICENSE | 21 + node_modules/tapable/README.md | 294 + .../tapable/lib/AsyncParallelBailHook.js | 80 + node_modules/tapable/lib/AsyncParallelHook.js | 32 + .../tapable/lib/AsyncSeriesBailHook.js | 37 + node_modules/tapable/lib/AsyncSeriesHook.js | 32 + .../tapable/lib/AsyncSeriesLoopHook.js | 32 + .../tapable/lib/AsyncSeriesWaterfallHook.js | 46 + node_modules/tapable/lib/Hook.js | 176 + node_modules/tapable/lib/HookCodeFactory.js | 407 + node_modules/tapable/lib/HookMap.js | 56 + node_modules/tapable/lib/MultiHook.js | 50 + node_modules/tapable/lib/SyncBailHook.js | 42 + node_modules/tapable/lib/SyncHook.js | 37 + node_modules/tapable/lib/SyncLoopHook.js | 37 + node_modules/tapable/lib/SyncWaterfallHook.js | 52 + node_modules/tapable/lib/Tapable.js | 81 + node_modules/tapable/lib/index.js | 19 + node_modules/tapable/package.json | 70 + .../terser-webpack-plugin/CHANGELOG.md | 142 + node_modules/terser-webpack-plugin/LICENSE | 20 + node_modules/terser-webpack-plugin/README.md | 731 ++ .../terser-webpack-plugin/dist/TaskRunner.js | 126 + .../terser-webpack-plugin/dist/cjs.js | 5 + .../terser-webpack-plugin/dist/index.js | 356 + .../terser-webpack-plugin/dist/minify.js | 186 + .../terser-webpack-plugin/dist/options.json | 169 + .../terser-webpack-plugin/dist/worker.js | 17 + .../node_modules/source-map/CHANGELOG.md | 301 + .../node_modules/source-map/LICENSE | 28 + .../node_modules/source-map/README.md | 742 ++ .../source-map/dist/source-map.debug.js | 3234 ++++++ .../source-map/dist/source-map.js | 3233 ++++++ .../source-map/dist/source-map.min.js | 2 + .../source-map/dist/source-map.min.js.map | 1 + .../node_modules/source-map/lib/array-set.js | 121 + .../node_modules/source-map/lib/base64-vlq.js | 140 + .../node_modules/source-map/lib/base64.js | 67 + .../source-map/lib/binary-search.js | 111 + .../source-map/lib/mapping-list.js | 79 + .../node_modules/source-map/lib/quick-sort.js | 114 + .../source-map/lib/source-map-consumer.js | 1145 ++ .../source-map/lib/source-map-generator.js | 425 + .../source-map/lib/source-node.js | 413 + .../node_modules/source-map/lib/util.js | 488 + .../node_modules/source-map/package.json | 212 + .../node_modules/source-map/source-map.d.ts | 98 + .../node_modules/source-map/source-map.js | 8 + .../terser-webpack-plugin/package.json | 126 + node_modules/terser/CHANGELOG.md | 235 + node_modules/terser/LICENSE | 29 + node_modules/terser/PATRONS.md | 15 + node_modules/terser/README.md | 1390 +++ node_modules/terser/bin/terser | 476 + node_modules/terser/bin/uglifyjs | 10 + node_modules/terser/dist/.gitkeep | 0 node_modules/terser/dist/bundle.min.js | 2 + node_modules/terser/dist/bundle.min.js.map | 1 + .../node_modules/source-map/CHANGELOG.md | 301 + .../terser/node_modules/source-map/LICENSE | 28 + .../terser/node_modules/source-map/README.md | 742 ++ .../source-map/dist/source-map.debug.js | 3234 ++++++ .../source-map/dist/source-map.js | 3233 ++++++ .../source-map/dist/source-map.min.js | 2 + .../source-map/dist/source-map.min.js.map | 1 + .../node_modules/source-map/lib/array-set.js | 121 + .../node_modules/source-map/lib/base64-vlq.js | 140 + .../node_modules/source-map/lib/base64.js | 67 + .../source-map/lib/binary-search.js | 111 + .../source-map/lib/mapping-list.js | 79 + .../node_modules/source-map/lib/quick-sort.js | 114 + .../source-map/lib/source-map-consumer.js | 1145 ++ .../source-map/lib/source-map-generator.js | 425 + .../source-map/lib/source-node.js | 413 + .../node_modules/source-map/lib/util.js | 488 + .../node_modules/source-map/package.json | 212 + .../node_modules/source-map/source-map.d.ts | 98 + .../node_modules/source-map/source-map.js | 8 + node_modules/terser/package.json | 160 + .../terser/tools/colorless-console.js | 11 + node_modules/terser/tools/domprops.js | 5619 ++++++++++ node_modules/terser/tools/exit.js | 15 + node_modules/terser/tools/node.js | 19 + node_modules/terser/tools/postinstall.js | 7 + node_modules/terser/tools/props.html | 55 + node_modules/terser/tools/terser.d.ts | 792 ++ node_modules/through2-filter/LICENSE | 9 + node_modules/through2-filter/README.md | 79 + node_modules/through2-filter/index.js | 50 + node_modules/through2-filter/package.json | 76 + node_modules/through2/LICENSE.md | 9 + node_modules/through2/README.md | 134 + node_modules/through2/package.json | 66 + node_modules/through2/through2.js | 96 + node_modules/time-stamp/LICENSE | 21 + node_modules/time-stamp/README.md | 132 + node_modules/time-stamp/index.js | 56 + node_modules/time-stamp/package.json | 117 + node_modules/timers-browserify/.DS_Store | Bin 0 -> 6148 bytes node_modules/timers-browserify/CHANGELOG.md | 146 + node_modules/timers-browserify/LICENSE.md | 46 + node_modules/timers-browserify/README.md | 40 + node_modules/timers-browserify/main.js | 63 + node_modules/timers-browserify/package.json | 122 + node_modules/to-absolute-glob/LICENSE | 21 + node_modules/to-absolute-glob/index.js | 70 + node_modules/to-absolute-glob/package.json | 118 + node_modules/to-absolute-glob/readme.md | 155 + node_modules/to-arraybuffer/.npmignore | 4 + node_modules/to-arraybuffer/.travis.yml | 3 + node_modules/to-arraybuffer/.zuul.yml | 16 + node_modules/to-arraybuffer/LICENSE | 24 + node_modules/to-arraybuffer/README.md | 27 + node_modules/to-arraybuffer/index.js | 27 + node_modules/to-arraybuffer/package.json | 61 + node_modules/to-arraybuffer/test.js | 57 + node_modules/to-object-path/LICENSE | 21 + node_modules/to-object-path/README.md | 71 + node_modules/to-object-path/index.js | 33 + .../node_modules/kind-of/LICENSE | 21 + .../node_modules/kind-of/README.md | 261 + .../node_modules/kind-of/index.js | 116 + .../node_modules/kind-of/package.json | 139 + node_modules/to-object-path/package.json | 81 + node_modules/to-regex-range/LICENSE | 21 + node_modules/to-regex-range/README.md | 281 + node_modules/to-regex-range/index.js | 294 + node_modules/to-regex-range/package.json | 117 + node_modules/to-regex/LICENSE | 21 + node_modules/to-regex/README.md | 205 + node_modules/to-regex/index.js | 155 + node_modules/to-regex/package.json | 97 + node_modules/to-through/LICENSE | 21 + node_modules/to-through/README.md | 56 + node_modules/to-through/index.js | 60 + node_modules/to-through/package.json | 85 + .../tslib/.github/workflows/publish.yaml | 19 + node_modules/tslib/CopyrightNotice.txt | 15 + node_modules/tslib/LICENSE.txt | 55 + node_modules/tslib/README.md | 144 + node_modules/tslib/package.json | 56 + node_modules/tslib/tslib.d.ts | 36 + node_modules/tslib/tslib.es6.html | 1 + node_modules/tslib/tslib.es6.js | 213 + node_modules/tslib/tslib.html | 1 + node_modules/tslib/tslib.js | 276 + node_modules/tty-browserify/LICENSE | 18 + node_modules/tty-browserify/index.js | 11 + node_modules/tty-browserify/package.json | 57 + node_modules/tty-browserify/readme.markdown | 1 + node_modules/type/.editorconfig | 16 + node_modules/type/CHANGELOG.md | 90 + node_modules/type/LICENSE | 15 + node_modules/type/README.md | 761 ++ node_modules/type/array-length/coerce.js | 10 + node_modules/type/array-length/ensure.js | 10 + node_modules/type/array-like/ensure.js | 9 + node_modules/type/array-like/is.js | 21 + node_modules/type/array/ensure.js | 9 + node_modules/type/array/is.js | 27 + node_modules/type/date/ensure.js | 9 + node_modules/type/date/is.js | 26 + node_modules/type/error/ensure.js | 9 + node_modules/type/error/is.js | 45 + node_modules/type/finite/coerce.js | 8 + node_modules/type/finite/ensure.js | 10 + node_modules/type/function/ensure.js | 9 + node_modules/type/function/is.js | 19 + node_modules/type/integer/coerce.js | 11 + node_modules/type/integer/ensure.js | 10 + node_modules/type/iterable/ensure.js | 29 + node_modules/type/iterable/is.js | 32 + .../type/lib/is-to-string-tag-supported.js | 3 + node_modules/type/lib/resolve-exception.js | 21 + node_modules/type/lib/safe-to-string.js | 10 + node_modules/type/lib/to-short-string.js | 29 + node_modules/type/natural-number/coerce.js | 10 + node_modules/type/natural-number/ensure.js | 10 + node_modules/type/number/coerce.js | 14 + node_modules/type/number/ensure.js | 10 + node_modules/type/object/ensure.js | 9 + node_modules/type/object/is.js | 11 + node_modules/type/package.json | 132 + node_modules/type/plain-function/ensure.js | 9 + node_modules/type/plain-function/is.js | 11 + node_modules/type/plain-object/ensure.js | 9 + node_modules/type/plain-object/is.js | 28 + node_modules/type/promise/ensure.js | 9 + node_modules/type/promise/is.js | 27 + node_modules/type/prototype/is.js | 13 + node_modules/type/reg-exp/ensure.js | 9 + node_modules/type/reg-exp/is.js | 37 + node_modules/type/safe-integer/coerce.js | 13 + node_modules/type/safe-integer/ensure.js | 10 + node_modules/type/string/coerce.js | 23 + node_modules/type/string/ensure.js | 10 + .../test/_lib/arrow-function-if-supported.js | 4 + .../type/test/_lib/class-if-supported.js | 4 + node_modules/type/test/array-length/coerce.js | 47 + node_modules/type/test/array-length/ensure.js | 19 + node_modules/type/test/array-like/ensure.js | 24 + node_modules/type/test/array-like/is.js | 47 + node_modules/type/test/array/ensure.js | 20 + node_modules/type/test/array/is.js | 41 + node_modules/type/test/date/ensure.js | 20 + node_modules/type/test/date/is.js | 46 + node_modules/type/test/error/ensure.js | 20 + node_modules/type/test/error/is.js | 50 + node_modules/type/test/finite/coerce.js | 40 + node_modules/type/test/finite/ensure.js | 17 + node_modules/type/test/function/ensure.js | 20 + node_modules/type/test/function/is.js | 46 + node_modules/type/test/integer/coerce.js | 49 + node_modules/type/test/integer/ensure.js | 17 + node_modules/type/test/iterable/ensure.js | 42 + node_modules/type/test/iterable/is.js | 57 + .../test/lib/is-to-string-tag-supported.js | 10 + .../type/test/lib/resolve-exception.js | 39 + node_modules/type/test/lib/safe-to-string.js | 32 + node_modules/type/test/lib/to-short-string.js | 41 + .../type/test/natural-number/coerce.js | 47 + .../type/test/natural-number/ensure.js | 19 + node_modules/type/test/number/coerce.js | 40 + node_modules/type/test/number/ensure.js | 17 + node_modules/type/test/object/ensure.js | 20 + node_modules/type/test/object/is.js | 30 + .../type/test/plain-function/ensure.js | 20 + node_modules/type/test/plain-function/is.js | 56 + node_modules/type/test/plain-object/ensure.js | 20 + node_modules/type/test/plain-object/is.js | 47 + node_modules/type/test/promise/ensure.js | 20 + node_modules/type/test/promise/is.js | 39 + node_modules/type/test/prototype/is.js | 39 + node_modules/type/test/reg-exp/ensure.js | 20 + node_modules/type/test/reg-exp/is.js | 47 + node_modules/type/test/safe-integer/coerce.js | 49 + node_modules/type/test/safe-integer/ensure.js | 19 + node_modules/type/test/string/coerce.js | 36 + node_modules/type/test/string/ensure.js | 17 + node_modules/type/test/thenable/ensure.js | 20 + node_modules/type/test/thenable/is.js | 44 + node_modules/type/test/time-value/coerce.js | 47 + node_modules/type/test/time-value/ensure.js | 17 + node_modules/type/test/value/ensure.js | 20 + node_modules/type/test/value/is.js | 29 + node_modules/type/thenable/ensure.js | 9 + node_modules/type/thenable/is.js | 9 + node_modules/type/time-value/coerce.js | 12 + node_modules/type/time-value/ensure.js | 10 + node_modules/type/value/ensure.js | 9 + node_modules/type/value/is.js | 6 + node_modules/typedarray/.travis.yml | 4 + node_modules/typedarray/LICENSE | 35 + node_modules/typedarray/example/tarray.js | 4 + node_modules/typedarray/index.js | 630 ++ node_modules/typedarray/package.json | 83 + node_modules/typedarray/readme.markdown | 61 + .../typedarray/test/server/undef_globals.js | 19 + node_modules/typedarray/test/tarray.js | 10 + node_modules/unc-path-regex/LICENSE | 21 + node_modules/unc-path-regex/README.md | 88 + node_modules/unc-path-regex/index.js | 5 + node_modules/unc-path-regex/package.json | 84 + node_modules/undertaker-registry/LICENSE | 21 + node_modules/undertaker-registry/README.md | 210 + node_modules/undertaker-registry/index.js | 30 + node_modules/undertaker-registry/package.json | 81 + node_modules/undertaker/LICENSE | 21 + node_modules/undertaker/README.md | 323 + node_modules/undertaker/index.js | 47 + node_modules/undertaker/lib/get-task.js | 7 + .../undertaker/lib/helpers/buildTree.js | 29 + .../lib/helpers/createExtensions.js | 73 + .../undertaker/lib/helpers/metadata.js | 7 + .../undertaker/lib/helpers/normalizeArgs.js | 25 + .../lib/helpers/validateRegistry.js | 41 + node_modules/undertaker/lib/last-run.js | 26 + node_modules/undertaker/lib/parallel.js | 31 + node_modules/undertaker/lib/registry.js | 25 + node_modules/undertaker/lib/series.js | 31 + node_modules/undertaker/lib/set-task.js | 42 + node_modules/undertaker/lib/task.js | 16 + node_modules/undertaker/lib/tree.js | 30 + node_modules/undertaker/package.json | 104 + node_modules/union-value/LICENSE | 21 + node_modules/union-value/README.md | 73 + node_modules/union-value/index.js | 30 + node_modules/union-value/package.json | 101 + .../unique-filename/.nyc_output/54942.json | 1 + .../unique-filename/.nyc_output/54944.json | 1 + node_modules/unique-filename/LICENSE | 5 + node_modules/unique-filename/README.md | 33 + .../coverage/__root__/index.html | 73 + .../coverage/__root__/index.js.html | 69 + .../unique-filename/coverage/base.css | 182 + .../unique-filename/coverage/index.html | 73 + .../unique-filename/coverage/prettify.css | 1 + .../unique-filename/coverage/prettify.js | 1 + .../coverage/sort-arrow-sprite.png | Bin 0 -> 209 bytes .../unique-filename/coverage/sorter.js | 156 + node_modules/unique-filename/index.js | 8 + node_modules/unique-filename/package.json | 56 + node_modules/unique-filename/test/index.js | 23 + node_modules/unique-slug/.travis.yml | 10 + node_modules/unique-slug/LICENSE | 15 + node_modules/unique-slug/README.md | 19 + node_modules/unique-slug/index.js | 11 + node_modules/unique-slug/package.json | 56 + node_modules/unique-slug/test/index.js | 13 + node_modules/unique-stream/LICENSE | 20 + node_modules/unique-stream/README.md | 134 + node_modules/unique-stream/index.js | 48 + node_modules/unique-stream/package.json | 67 + node_modules/unset-value/LICENSE | 21 + node_modules/unset-value/README.md | 131 + node_modules/unset-value/index.js | 32 + .../node_modules/has-value/LICENSE | 21 + .../node_modules/has-value/README.md | 130 + .../node_modules/has-value/index.js | 19 + .../has-value/node_modules/isobject/LICENSE | 21 + .../has-value/node_modules/isobject/README.md | 112 + .../has-value/node_modules/isobject/index.js | 14 + .../node_modules/isobject/package.json | 98 + .../node_modules/has-value/package.json | 114 + .../node_modules/has-values/LICENSE | 21 + .../node_modules/has-values/README.md | 114 + .../node_modules/has-values/index.js | 36 + .../node_modules/has-values/package.json | 106 + node_modules/unset-value/package.json | 112 + node_modules/upath/LICENSE | 22 + node_modules/upath/build/code/upath.js | 171 + node_modules/upath/package.json | 85 + node_modules/upath/readme.md | 342 + node_modules/upath/upath.d.ts | 239 + node_modules/uri-js/README.md | 199 + node_modules/uri-js/bower.json | 47 + node_modules/uri-js/dist/es5/uri.all.d.ts | 59 + node_modules/uri-js/dist/es5/uri.all.js | 1389 +++ node_modules/uri-js/dist/es5/uri.all.js.map | 1 + node_modules/uri-js/dist/es5/uri.all.min.d.ts | 59 + node_modules/uri-js/dist/es5/uri.all.min.js | 3 + .../uri-js/dist/es5/uri.all.min.js.map | 1 + node_modules/uri-js/dist/esnext/index.d.ts | 1 + node_modules/uri-js/dist/esnext/index.js | 13 + node_modules/uri-js/dist/esnext/index.js.map | 1 + .../uri-js/dist/esnext/regexps-iri.d.ts | 3 + .../uri-js/dist/esnext/regexps-iri.js | 3 + .../uri-js/dist/esnext/regexps-iri.js.map | 1 + .../uri-js/dist/esnext/regexps-uri.d.ts | 4 + .../uri-js/dist/esnext/regexps-uri.js | 42 + .../uri-js/dist/esnext/regexps-uri.js.map | 1 + .../uri-js/dist/esnext/schemes/http.d.ts | 3 + .../uri-js/dist/esnext/schemes/http.js | 27 + .../uri-js/dist/esnext/schemes/http.js.map | 1 + .../uri-js/dist/esnext/schemes/https.d.ts | 3 + .../uri-js/dist/esnext/schemes/https.js | 9 + .../uri-js/dist/esnext/schemes/https.js.map | 1 + .../uri-js/dist/esnext/schemes/mailto.d.ts | 12 + .../uri-js/dist/esnext/schemes/mailto.js | 148 + .../uri-js/dist/esnext/schemes/mailto.js.map | 1 + .../uri-js/dist/esnext/schemes/urn-uuid.d.ts | 7 + .../uri-js/dist/esnext/schemes/urn-uuid.js | 23 + .../dist/esnext/schemes/urn-uuid.js.map | 1 + .../uri-js/dist/esnext/schemes/urn.d.ts | 10 + .../uri-js/dist/esnext/schemes/urn.js | 49 + .../uri-js/dist/esnext/schemes/urn.js.map | 1 + node_modules/uri-js/dist/esnext/uri.d.ts | 59 + node_modules/uri-js/dist/esnext/uri.js | 480 + node_modules/uri-js/dist/esnext/uri.js.map | 1 + node_modules/uri-js/dist/esnext/util.d.ts | 6 + node_modules/uri-js/dist/esnext/util.js | 36 + node_modules/uri-js/dist/esnext/util.js.map | 1 + node_modules/uri-js/package.json | 93 + node_modules/uri-js/rollup.config.js | 32 + node_modules/uri-js/src/index.ts | 18 + node_modules/uri-js/src/punycode.d.ts | 24 + node_modules/uri-js/src/regexps-iri.ts | 4 + node_modules/uri-js/src/regexps-uri.ts | 89 + node_modules/uri-js/src/schemes/http.ts | 36 + node_modules/uri-js/src/schemes/https.ts | 11 + node_modules/uri-js/src/schemes/mailto.ts | 182 + node_modules/uri-js/src/schemes/urn-uuid.ts | 36 + node_modules/uri-js/src/schemes/urn.ts | 69 + node_modules/uri-js/src/uri.ts | 556 + node_modules/uri-js/src/util.ts | 40 + node_modules/uri-js/tests/qunit.css | 118 + node_modules/uri-js/tests/qunit.js | 1042 ++ node_modules/uri-js/tests/test-es5-min.html | 17 + node_modules/uri-js/tests/test-es5.html | 17 + node_modules/uri-js/tests/tests.js | 774 ++ node_modules/uri-js/tsconfig.json | 20 + node_modules/uri-js/yarn.lock | 1902 ++++ node_modules/urix/.jshintrc | 42 + node_modules/urix/LICENSE | 21 + node_modules/urix/index.js | 17 + node_modules/urix/package.json | 59 + node_modules/urix/readme.md | 46 + node_modules/urix/test/index.js | 43 + node_modules/url/.npmignore | 1 + node_modules/url/.travis.yml | 7 + node_modules/url/.zuul.yml | 16 + node_modules/url/LICENSE | 21 + node_modules/url/README.md | 108 + .../url/node_modules/punycode/LICENSE-MIT.txt | 20 + .../url/node_modules/punycode/README.md | 176 + .../url/node_modules/punycode/package.json | 80 + .../url/node_modules/punycode/punycode.js | 530 + node_modules/url/package.json | 53 + node_modules/url/test.js | 1599 +++ node_modules/url/url.js | 732 ++ node_modules/url/util.js | 16 + node_modules/use/LICENSE | 21 + node_modules/use/README.md | 90 + node_modules/use/index.js | 155 + node_modules/use/package.json | 108 + node_modules/util-deprecate/History.md | 16 + node_modules/util-deprecate/LICENSE | 24 + node_modules/util-deprecate/README.md | 53 + node_modules/util-deprecate/browser.js | 67 + node_modules/util-deprecate/node.js | 6 + node_modules/util-deprecate/package.json | 56 + node_modules/util/CHANGELOG.md | 15 + node_modules/util/LICENSE | 18 + node_modules/util/README.md | 48 + .../util/node_modules/inherits/LICENSE | 16 + .../util/node_modules/inherits/README.md | 42 + .../util/node_modules/inherits/inherits.js | 7 + .../node_modules/inherits/inherits_browser.js | 23 + .../util/node_modules/inherits/package.json | 61 + node_modules/util/package.json | 67 + node_modules/util/support/isBuffer.js | 3 + node_modules/util/support/isBufferBrowser.js | 6 + node_modules/util/util.js | 703 ++ node_modules/v8-compile-cache/CHANGELOG.md | 37 + node_modules/v8-compile-cache/LICENSE | 21 + node_modules/v8-compile-cache/README.md | 53 + node_modules/v8-compile-cache/package.json | 65 + .../v8-compile-cache/v8-compile-cache.js | 365 + node_modules/v8flags/LICENSE | 21 + node_modules/v8flags/README.md | 64 + node_modules/v8flags/config-path.js | 38 + node_modules/v8flags/index.js | 162 + node_modules/v8flags/package.json | 99 + .../validate-npm-package-license/LICENSE | 202 + .../validate-npm-package-license/README.md | 113 + .../validate-npm-package-license/index.js | 86 + .../validate-npm-package-license/package.json | 67 + node_modules/value-or-function/LICENSE | 21 + node_modules/value-or-function/README.md | 132 + node_modules/value-or-function/index.js | 113 + node_modules/value-or-function/package.json | 86 + node_modules/vinyl-fs/LICENSE | 21 + node_modules/vinyl-fs/README.md | 341 + node_modules/vinyl-fs/index.js | 7 + node_modules/vinyl-fs/lib/constants.js | 6 + node_modules/vinyl-fs/lib/dest/index.js | 45 + node_modules/vinyl-fs/lib/dest/options.js | 41 + node_modules/vinyl-fs/lib/dest/prepare.js | 48 + node_modules/vinyl-fs/lib/dest/sourcemap.js | 38 + .../vinyl-fs/lib/dest/write-contents/index.js | 59 + .../lib/dest/write-contents/write-buffer.js | 31 + .../lib/dest/write-contents/write-dir.js | 51 + .../lib/dest/write-contents/write-stream.js | 62 + .../write-contents/write-symbolic-link.js | 77 + node_modules/vinyl-fs/lib/file-operations.js | 496 + node_modules/vinyl-fs/lib/src/index.js | 38 + node_modules/vinyl-fs/lib/src/options.js | 29 + node_modules/vinyl-fs/lib/src/prepare.js | 22 + .../vinyl-fs/lib/src/read-contents/index.js | 52 + .../lib/src/read-contents/read-buffer.js | 25 + .../lib/src/read-contents/read-dir.js | 8 + .../lib/src/read-contents/read-stream.js | 31 + .../src/read-contents/read-symbolic-link.js | 20 + .../vinyl-fs/lib/src/resolve-symlinks.js | 36 + node_modules/vinyl-fs/lib/src/sourcemap.js | 29 + node_modules/vinyl-fs/lib/src/wrap-vinyl.js | 18 + node_modules/vinyl-fs/lib/symlink/index.js | 43 + .../vinyl-fs/lib/symlink/link-file.js | 89 + node_modules/vinyl-fs/lib/symlink/options.js | 26 + node_modules/vinyl-fs/lib/symlink/prepare.js | 51 + node_modules/vinyl-fs/package.json | 110 + node_modules/vinyl-sourcemap/LICENSE | 21 + node_modules/vinyl-sourcemap/README.md | 79 + node_modules/vinyl-sourcemap/index.js | 66 + node_modules/vinyl-sourcemap/lib/helpers.js | 243 + .../node_modules/normalize-path/LICENSE | 21 + .../node_modules/normalize-path/README.md | 92 + .../node_modules/normalize-path/index.js | 19 + .../node_modules/normalize-path/package.json | 117 + node_modules/vinyl-sourcemap/package.json | 96 + node_modules/vinyl/LICENSE | 21 + node_modules/vinyl/README.md | 446 + node_modules/vinyl/index.js | 334 + node_modules/vinyl/lib/inspect-stream.js | 13 + node_modules/vinyl/lib/is-stream.js | 15 + node_modules/vinyl/lib/normalize.js | 9 + node_modules/vinyl/package.json | 98 + .../vm-browserify/.github/FUNDING.yml | 12 + node_modules/vm-browserify/.travis.yml | 8 + node_modules/vm-browserify/CHANGELOG.md | 23 + node_modules/vm-browserify/LICENSE | 18 + .../vm-browserify/example/run/bundle.js | 160 + .../vm-browserify/example/run/entry.js | 6 + .../vm-browserify/example/run/index.html | 8 + .../vm-browserify/example/run/server.js | 6 + node_modules/vm-browserify/index.js | 149 + node_modules/vm-browserify/package.json | 59 + node_modules/vm-browserify/readme.markdown | 66 + node_modules/vm-browserify/security.md | 10 + node_modules/vm-browserify/test/vm.js | 35 + node_modules/watchpack/LICENSE | 20 + node_modules/watchpack/README.md | 72 + .../watchpack/lib/DirectoryWatcher.js | 377 + node_modules/watchpack/lib/watcherManager.js | 35 + node_modules/watchpack/lib/watchpack.js | 145 + node_modules/watchpack/package.json | 71 + node_modules/webpack-cli/CHANGELOG.md | 1541 +++ node_modules/webpack-cli/LICENSE | 20 + node_modules/webpack-cli/README.md | 112 + node_modules/webpack-cli/bin/.eslintrc.js | 63 + node_modules/webpack-cli/bin/cli.js | 366 + .../webpack-cli/bin/config/config-yargs.js | 504 + .../webpack-cli/bin/config/optionsSchema.json | 1989 ++++ .../config/webpackConfigurationSchema.json | 20 + .../webpack-cli/bin/utils/constants.js | 28 + .../webpack-cli/bin/utils/convert-argv.js | 562 + .../webpack-cli/bin/utils/errorHelpers.js | 33 + .../webpack-cli/bin/utils/prepareOptions.js | 24 + .../webpack-cli/bin/utils/prompt-command.js | 142 + .../webpack-cli/bin/utils/validate-options.js | 21 + .../node_modules/emojis-list/CHANGELOG.md | 70 + .../node_modules/emojis-list/LICENSE.md | 9 + .../node_modules/emojis-list/README.md | 48 + .../node_modules/emojis-list/index.js | 2479 +++++ .../node_modules/emojis-list/package.json | 76 + .../node_modules/enhanced-resolve/LICENSE | 20 + .../node_modules/enhanced-resolve/README.md | 121 + .../enhanced-resolve/lib/AliasFieldPlugin.js | 52 + .../enhanced-resolve/lib/AliasPlugin.js | 56 + .../enhanced-resolve/lib/AppendPlugin.js | 24 + .../lib/CachedInputFileSystem.js | 277 + .../lib/CloneBasenamePlugin.js | 27 + .../lib/ConcordExtensionsPlugin.js | 40 + .../enhanced-resolve/lib/ConcordMainPlugin.js | 33 + .../lib/ConcordModulesPlugin.js | 47 + .../lib/DescriptionFilePlugin.js | 48 + .../lib/DescriptionFileUtils.js | 96 + .../lib/DirectoryExistsPlugin.js | 33 + .../enhanced-resolve/lib/FileExistsPlugin.js | 33 + .../enhanced-resolve/lib/FileKindPlugin.js | 22 + .../enhanced-resolve/lib/JoinRequestPlugin.js | 24 + .../enhanced-resolve/lib/LogInfoPlugin.js | 28 + .../enhanced-resolve/lib/MainFieldPlugin.js | 52 + .../lib/ModuleAppendPlugin.js | 37 + .../enhanced-resolve/lib/ModuleKindPlugin.js | 28 + .../ModulesInHierachicDirectoriesPlugin.js | 44 + .../lib/ModulesInRootPlugin.js | 24 + .../enhanced-resolve/lib/NextPlugin.js | 19 + .../lib/NodeJsInputFileSystem.js | 43 + .../enhanced-resolve/lib/ParsePlugin.js | 30 + .../enhanced-resolve/lib/Resolver.js | 301 + .../enhanced-resolve/lib/ResolverFactory.js | 301 + .../enhanced-resolve/lib/ResultPlugin.js | 22 + .../enhanced-resolve/lib/SymlinkPlugin.js | 49 + .../lib/SyncAsyncFileSystemDecorator.js | 65 + .../enhanced-resolve/lib/TryNextPlugin.js | 20 + .../enhanced-resolve/lib/UnsafeCachePlugin.js | 41 + .../enhanced-resolve/lib/UseFilePlugin.js | 25 + .../enhanced-resolve/lib/concord.js | 195 + .../lib/createInnerCallback.js | 47 + .../lib/createInnerContext.js | 26 + .../enhanced-resolve/lib/forEachBail.js | 65 + .../enhanced-resolve/lib/getInnerRequest.js | 24 + .../enhanced-resolve/lib/getPaths.js | 35 + .../enhanced-resolve/lib/globToRegExp.js | 194 + .../node_modules/enhanced-resolve/lib/node.js | 162 + .../enhanced-resolve/package.json | 82 + .../node_modules/loader-utils/CHANGELOG.md | 67 + .../node_modules/loader-utils/LICENSE | 20 + .../node_modules/loader-utils/README.md | 255 + .../loader-utils/lib/getCurrentRequest.js | 16 + .../loader-utils/lib/getHashDigest.js | 69 + .../loader-utils/lib/getOptions.js | 20 + .../loader-utils/lib/getRemainingRequest.js | 16 + .../node_modules/loader-utils/lib/index.js | 23 + .../loader-utils/lib/interpolateName.js | 133 + .../loader-utils/lib/isUrlRequest.js | 31 + .../loader-utils/lib/parseQuery.js | 68 + .../loader-utils/lib/parseString.js | 23 + .../loader-utils/lib/stringifyRequest.js | 51 + .../loader-utils/lib/urlToRequest.js | 60 + .../node_modules/loader-utils/package.json | 70 + node_modules/webpack-cli/package.json | 210 + node_modules/webpack-sources/LICENSE | 21 + node_modules/webpack-sources/README.md | 230 + .../webpack-sources/lib/CachedSource.js | 80 + .../webpack-sources/lib/ConcatSource.js | 91 + .../lib/LineToLineMappedSource.js | 49 + .../webpack-sources/lib/OriginalSource.js | 70 + .../webpack-sources/lib/PrefixSource.js | 95 + node_modules/webpack-sources/lib/RawSource.js | 38 + .../webpack-sources/lib/ReplaceSource.js | 330 + node_modules/webpack-sources/lib/Source.js | 46 + .../webpack-sources/lib/SourceAndMapMixin.js | 37 + .../webpack-sources/lib/SourceMapSource.js | 57 + .../webpack-sources/lib/applySourceMap.js | 185 + node_modules/webpack-sources/lib/index.js | 15 + .../node_modules/source-map/CHANGELOG.md | 301 + .../node_modules/source-map/LICENSE | 28 + .../node_modules/source-map/README.md | 742 ++ .../source-map/dist/source-map.debug.js | 3234 ++++++ .../source-map/dist/source-map.js | 3233 ++++++ .../source-map/dist/source-map.min.js | 2 + .../source-map/dist/source-map.min.js.map | 1 + .../node_modules/source-map/lib/array-set.js | 121 + .../node_modules/source-map/lib/base64-vlq.js | 140 + .../node_modules/source-map/lib/base64.js | 67 + .../source-map/lib/binary-search.js | 111 + .../source-map/lib/mapping-list.js | 79 + .../node_modules/source-map/lib/quick-sort.js | 114 + .../source-map/lib/source-map-consumer.js | 1145 ++ .../source-map/lib/source-map-generator.js | 425 + .../source-map/lib/source-node.js | 413 + .../node_modules/source-map/lib/util.js | 488 + .../node_modules/source-map/package.json | 212 + .../node_modules/source-map/source-map.d.ts | 98 + .../node_modules/source-map/source-map.js | 8 + node_modules/webpack-sources/package.json | 78 + node_modules/webpack/LICENSE | 20 + node_modules/webpack/README.md | 784 ++ node_modules/webpack/SECURITY.md | 9 + node_modules/webpack/bin/webpack.js | 171 + node_modules/webpack/buildin/amd-define.js | 3 + node_modules/webpack/buildin/amd-options.js | 2 + node_modules/webpack/buildin/global.js | 20 + .../webpack/buildin/harmony-module.js | 24 + node_modules/webpack/buildin/module.js | 22 + node_modules/webpack/buildin/system.js | 7 + .../webpack/declarations/WebpackOptions.d.ts | 1446 +++ .../declarations/plugins/BannerPlugin.d.ts | 49 + .../declarations/plugins/DllPlugin.d.ts | 32 + .../plugins/DllReferencePlugin.d.ts | 126 + .../plugins/HashedModuleIdsPlugin.d.ts | 24 + .../declarations/plugins/IgnorePlugin.d.ts | 27 + .../plugins/LoaderOptionsPlugin.d.ts | 27 + .../declarations/plugins/ProgressPlugin.d.ts | 42 + .../plugins/SourceMapDevToolPlugin.d.ts | 94 + .../plugins/WatchIgnorePlugin.d.ts | 10 + .../plugins/debug/ProfilingPlugin.d.ts | 12 + .../optimize/AggressiveSplittingPlugin.d.ts | 24 + .../optimize/LimitChunkCountPlugin.d.ts | 16 + .../plugins/optimize/MinChunkSizePlugin.d.ts | 12 + .../OccurrenceOrderChunkIdsPlugin.d.ts | 12 + .../OccurrenceOrderModuleIdsPlugin.d.ts | 12 + node_modules/webpack/hot/dev-server.js | 61 + node_modules/webpack/hot/emitter.js | 2 + node_modules/webpack/hot/log-apply-result.js | 44 + node_modules/webpack/hot/log.js | 59 + node_modules/webpack/hot/only-dev-server.js | 102 + node_modules/webpack/hot/poll.js | 37 + node_modules/webpack/hot/signal.js | 62 + node_modules/webpack/lib/APIPlugin.js | 84 + .../webpack/lib/AbstractMethodError.js | 43 + .../webpack/lib/AmdMainTemplatePlugin.js | 106 + .../webpack/lib/AsyncDependenciesBlock.js | 110 + .../lib/AsyncDependencyToInitialChunkError.js | 31 + .../webpack/lib/AutomaticPrefetchPlugin.js | 57 + node_modules/webpack/lib/BannerPlugin.js | 122 + .../webpack/lib/BasicEvaluatedExpression.js | 248 + node_modules/webpack/lib/CachePlugin.js | 100 + .../lib/CaseSensitiveModulesWarning.js | 67 + node_modules/webpack/lib/Chunk.js | 875 ++ node_modules/webpack/lib/ChunkGroup.js | 513 + node_modules/webpack/lib/ChunkRenderError.js | 32 + node_modules/webpack/lib/ChunkTemplate.js | 87 + .../webpack/lib/CommentCompilationWarning.js | 32 + .../webpack/lib/CommonJsStuffPlugin.js | 116 + .../webpack/lib/CompatibilityPlugin.js | 70 + node_modules/webpack/lib/Compilation.js | 2327 +++++ node_modules/webpack/lib/Compiler.js | 735 ++ .../webpack/lib/ConcurrentCompilationError.js | 19 + node_modules/webpack/lib/ConstPlugin.js | 343 + .../webpack/lib/ContextExclusionPlugin.js | 28 + node_modules/webpack/lib/ContextModule.js | 872 ++ .../webpack/lib/ContextModuleFactory.js | 262 + .../webpack/lib/ContextReplacementPlugin.js | 133 + node_modules/webpack/lib/DefinePlugin.js | 289 + node_modules/webpack/lib/DelegatedModule.js | 114 + .../lib/DelegatedModuleFactoryPlugin.js | 95 + node_modules/webpack/lib/DelegatedPlugin.js | 39 + node_modules/webpack/lib/DependenciesBlock.js | 124 + .../webpack/lib/DependenciesBlockVariable.js | 72 + node_modules/webpack/lib/Dependency.js | 89 + node_modules/webpack/lib/DllEntryPlugin.js | 54 + node_modules/webpack/lib/DllModule.js | 60 + node_modules/webpack/lib/DllModuleFactory.js | 29 + node_modules/webpack/lib/DllPlugin.js | 49 + .../webpack/lib/DllReferencePlugin.js | 156 + .../webpack/lib/DynamicEntryPlugin.js | 94 + .../webpack/lib/EntryModuleNotFoundError.js | 21 + node_modules/webpack/lib/EntryOptionPlugin.js | 46 + node_modules/webpack/lib/Entrypoint.js | 64 + node_modules/webpack/lib/EnvironmentPlugin.js | 72 + node_modules/webpack/lib/ErrorHelpers.js | 60 + .../webpack/lib/EvalDevToolModulePlugin.js | 27 + .../lib/EvalDevToolModuleTemplatePlugin.js | 61 + ...valSourceMapDevToolModuleTemplatePlugin.js | 120 + .../webpack/lib/EvalSourceMapDevToolPlugin.js | 41 + .../lib/ExportPropertyMainTemplatePlugin.js | 53 + node_modules/webpack/lib/ExtendedAPIPlugin.js | 88 + node_modules/webpack/lib/ExternalModule.js | 179 + .../lib/ExternalModuleFactoryPlugin.js | 110 + node_modules/webpack/lib/ExternalsPlugin.js | 23 + .../lib/FlagDependencyExportsPlugin.js | 174 + .../webpack/lib/FlagDependencyUsagePlugin.js | 116 + .../lib/FlagInitialModulesAsUsedPlugin.js | 36 + .../webpack/lib/FunctionModulePlugin.js | 19 + .../lib/FunctionModuleTemplatePlugin.js | 102 + node_modules/webpack/lib/Generator.js | 60 + node_modules/webpack/lib/GraphHelpers.js | 65 + .../webpack/lib/HarmonyLinkingError.js | 17 + .../webpack/lib/HashedModuleIdsPlugin.js | 63 + .../lib/HotModuleReplacement.runtime.js | 657 ++ .../webpack/lib/HotModuleReplacementPlugin.js | 425 + node_modules/webpack/lib/HotUpdateChunk.js | 17 + .../webpack/lib/HotUpdateChunkTemplate.js | 78 + node_modules/webpack/lib/IgnorePlugin.js | 91 + .../webpack/lib/JavascriptGenerator.js | 229 + .../webpack/lib/JavascriptModulesPlugin.js | 185 + node_modules/webpack/lib/JsonGenerator.js | 57 + node_modules/webpack/lib/JsonModulesPlugin.js | 30 + node_modules/webpack/lib/JsonParser.js | 27 + node_modules/webpack/lib/LibManifestPlugin.js | 90 + .../webpack/lib/LibraryTemplatePlugin.js | 186 + .../webpack/lib/LoaderOptionsPlugin.js | 58 + .../webpack/lib/LoaderTargetPlugin.js | 24 + node_modules/webpack/lib/MainTemplate.js | 568 + .../webpack/lib/MemoryOutputFileSystem.js | 5 + node_modules/webpack/lib/Module.js | 435 + node_modules/webpack/lib/ModuleBuildError.js | 52 + .../webpack/lib/ModuleDependencyError.js | 35 + .../webpack/lib/ModuleDependencyWarning.js | 25 + node_modules/webpack/lib/ModuleError.js | 36 + .../webpack/lib/ModuleFilenameHelpers.js | 179 + .../webpack/lib/ModuleNotFoundError.js | 23 + node_modules/webpack/lib/ModuleParseError.js | 67 + node_modules/webpack/lib/ModuleReason.js | 48 + node_modules/webpack/lib/ModuleTemplate.js | 93 + node_modules/webpack/lib/ModuleWarning.js | 36 + node_modules/webpack/lib/MultiCompiler.js | 290 + node_modules/webpack/lib/MultiEntryPlugin.js | 80 + node_modules/webpack/lib/MultiModule.js | 87 + .../webpack/lib/MultiModuleFactory.js | 23 + node_modules/webpack/lib/MultiStats.js | 92 + node_modules/webpack/lib/MultiWatching.js | 50 + node_modules/webpack/lib/NamedChunksPlugin.js | 29 + .../webpack/lib/NamedModulesPlugin.js | 58 + .../webpack/lib/NoEmitOnErrorsPlugin.js | 20 + node_modules/webpack/lib/NoModeWarning.js | 23 + node_modules/webpack/lib/NodeStuffPlugin.js | 118 + node_modules/webpack/lib/NormalModule.js | 582 ++ .../webpack/lib/NormalModuleFactory.js | 528 + .../lib/NormalModuleReplacementPlugin.js | 51 + node_modules/webpack/lib/NullFactory.js | 12 + node_modules/webpack/lib/OptionsApply.js | 10 + node_modules/webpack/lib/OptionsDefaulter.js | 141 + node_modules/webpack/lib/Parser.js | 2441 +++++ node_modules/webpack/lib/ParserHelpers.js | 103 + node_modules/webpack/lib/PrefetchPlugin.js | 37 + node_modules/webpack/lib/ProgressPlugin.js | 307 + node_modules/webpack/lib/ProvidePlugin.js | 86 + node_modules/webpack/lib/RawModule.js | 56 + node_modules/webpack/lib/RecordIdsPlugin.js | 230 + .../webpack/lib/RemovedPluginError.js | 11 + node_modules/webpack/lib/RequestShortener.js | 83 + .../webpack/lib/RequireJsStuffPlugin.js | 66 + node_modules/webpack/lib/ResolverFactory.js | 74 + node_modules/webpack/lib/RuleSet.js | 567 + node_modules/webpack/lib/RuntimeTemplate.js | 336 + .../webpack/lib/SetVarMainTemplatePlugin.js | 69 + node_modules/webpack/lib/SingleEntryPlugin.js | 63 + node_modules/webpack/lib/SizeFormatHelpers.js | 24 + .../SourceMapDevToolModuleOptionsPlugin.js | 49 + .../webpack/lib/SourceMapDevToolPlugin.js | 418 + node_modules/webpack/lib/Stats.js | 1685 +++ .../webpack/lib/SystemMainTemplatePlugin.js | 135 + node_modules/webpack/lib/Template.js | 291 + .../webpack/lib/TemplatedPathPlugin.js | 188 + .../webpack/lib/UmdMainTemplatePlugin.js | 305 + .../webpack/lib/UnsupportedFeatureWarning.js | 30 + node_modules/webpack/lib/UseStrictPlugin.js | 54 + .../lib/WarnCaseSensitiveModulesPlugin.js | 37 + .../webpack/lib/WarnNoModeSetPlugin.js | 17 + node_modules/webpack/lib/WatchIgnorePlugin.js | 106 + node_modules/webpack/lib/Watching.js | 211 + node_modules/webpack/lib/WebpackError.js | 31 + .../webpack/lib/WebpackOptionsApply.js | 546 + .../webpack/lib/WebpackOptionsDefaulter.js | 380 + .../lib/WebpackOptionsValidationError.js | 390 + node_modules/webpack/lib/buildChunkGraph.js | 724 ++ node_modules/webpack/lib/compareLocations.js | 52 + .../webpack/lib/debug/ProfilingPlugin.js | 442 + .../lib/dependencies/AMDDefineDependency.js | 137 + .../AMDDefineDependencyParserPlugin.js | 336 + .../webpack/lib/dependencies/AMDPlugin.js | 249 + .../dependencies/AMDRequireArrayDependency.js | 49 + .../AMDRequireContextDependency.js | 20 + .../AMDRequireDependenciesBlock.js | 47 + ...AMDRequireDependenciesBlockParserPlugin.js | 274 + .../lib/dependencies/AMDRequireDependency.js | 135 + .../dependencies/AMDRequireItemDependency.js | 22 + .../lib/dependencies/CommonJsPlugin.js | 158 + .../CommonJsRequireContextDependency.js | 23 + .../dependencies/CommonJsRequireDependency.js | 22 + .../CommonJsRequireDependencyParserPlugin.js | 138 + .../lib/dependencies/ConstDependency.js | 33 + .../lib/dependencies/ContextDependency.js | 68 + .../dependencies/ContextDependencyHelpers.js | 232 + .../ContextDependencyTemplateAsId.js | 43 + .../ContextDependencyTemplateAsRequireCall.js | 39 + .../dependencies/ContextElementDependency.js | 21 + .../dependencies/CriticalDependencyWarning.js | 20 + .../DelegatedExportsDependency.js | 33 + .../dependencies/DelegatedSourceDependency.js | 18 + .../lib/dependencies/DependencyReference.js | 64 + .../lib/dependencies/DllEntryDependency.js | 20 + .../dependencies/HarmonyAcceptDependency.js | 48 + .../HarmonyAcceptImportDependency.js | 23 + .../HarmonyCompatibilityDependency.js | 31 + .../HarmonyDetectionParserPlugin.js | 96 + .../HarmonyExportDependencyParserPlugin.js | 154 + .../HarmonyExportExpressionDependency.js | 58 + .../HarmonyExportHeaderDependency.js | 30 + ...armonyExportImportedSpecifierDependency.js | 655 ++ .../HarmonyExportSpecifierDependency.js | 54 + .../dependencies/HarmonyImportDependency.js | 109 + .../HarmonyImportDependencyParserPlugin.js | 222 + .../HarmonyImportSideEffectDependency.js | 31 + .../HarmonyImportSpecifierDependency.js | 163 + .../lib/dependencies/HarmonyInitDependency.js | 60 + .../lib/dependencies/HarmonyModulesPlugin.js | 143 + .../HarmonyTopLevelThisParserPlugin.js | 26 + .../dependencies/ImportContextDependency.js | 23 + .../dependencies/ImportDependenciesBlock.js | 18 + .../lib/dependencies/ImportDependency.js | 34 + .../lib/dependencies/ImportEagerDependency.js | 32 + .../lib/dependencies/ImportParserPlugin.js | 248 + .../webpack/lib/dependencies/ImportPlugin.js | 79 + .../lib/dependencies/ImportWeakDependency.js | 34 + .../lib/dependencies/JsonExportsDependency.js | 26 + .../lib/dependencies/LoaderDependency.js | 21 + .../webpack/lib/dependencies/LoaderPlugin.js | 115 + .../webpack/lib/dependencies/LocalModule.js | 23 + .../lib/dependencies/LocalModuleDependency.js | 28 + .../lib/dependencies/LocalModulesHelpers.js | 52 + .../lib/dependencies/ModuleDependency.js | 23 + .../ModuleDependencyTemplateAsId.js | 17 + .../ModuleDependencyTemplateAsRequireId.js | 17 + .../dependencies/ModuleHotAcceptDependency.js | 23 + .../ModuleHotDeclineDependency.js | 23 + .../lib/dependencies/MultiEntryDependency.js | 25 + .../lib/dependencies/NullDependency.js | 20 + .../lib/dependencies/PrefetchDependency.js | 18 + .../dependencies/RequireContextDependency.js | 22 + .../RequireContextDependencyParserPlugin.js | 56 + .../lib/dependencies/RequireContextPlugin.js | 143 + .../RequireEnsureDependenciesBlock.js | 33 + ...uireEnsureDependenciesBlockParserPlugin.js | 116 + .../dependencies/RequireEnsureDependency.js | 58 + .../RequireEnsureItemDependency.js | 21 + .../lib/dependencies/RequireEnsurePlugin.js | 74 + .../dependencies/RequireHeaderDependency.js | 26 + .../dependencies/RequireIncludeDependency.js | 39 + .../RequireIncludeDependencyParserPlugin.js | 23 + .../lib/dependencies/RequireIncludePlugin.js | 61 + .../RequireResolveContextDependency.js | 23 + .../dependencies/RequireResolveDependency.js | 22 + .../RequireResolveDependencyParserPlugin.js | 86 + .../RequireResolveHeaderDependency.js | 26 + .../lib/dependencies/SingleEntryDependency.js | 21 + .../webpack/lib/dependencies/SystemPlugin.js | 122 + .../lib/dependencies/UnsupportedDependency.js | 27 + .../WebAssemblyExportImportedDependency.js | 31 + .../WebAssemblyImportDependency.js | 54 + .../lib/dependencies/WebpackMissingModule.js | 20 + .../lib/dependencies/getFunctionExpression.js | 52 + node_modules/webpack/lib/formatLocation.js | 75 + node_modules/webpack/lib/logging/Logger.js | 128 + .../lib/logging/createConsoleLogger.js | 210 + node_modules/webpack/lib/logging/runtime.js | 36 + .../webpack/lib/logging/truncateArgs.js | 76 + .../lib/node/NodeChunkTemplatePlugin.js | 31 + .../webpack/lib/node/NodeEnvironmentPlugin.js | 44 + .../node/NodeHotUpdateChunkTemplatePlugin.js | 36 + .../lib/node/NodeMainTemplate.runtime.js | 32 + .../lib/node/NodeMainTemplateAsync.runtime.js | 50 + .../lib/node/NodeMainTemplatePlugin.js | 321 + .../webpack/lib/node/NodeOutputFileSystem.js | 22 + .../webpack/lib/node/NodeSourcePlugin.js | 141 + .../webpack/lib/node/NodeTargetPlugin.js | 19 + .../webpack/lib/node/NodeTemplatePlugin.js | 31 + .../webpack/lib/node/NodeWatchFileSystem.js | 109 + .../node/ReadFileCompileWasmTemplatePlugin.js | 61 + node_modules/webpack/lib/node/nodeConsole.js | 135 + .../lib/optimize/AggressiveMergingPlugin.js | 87 + .../lib/optimize/AggressiveSplittingPlugin.js | 294 + .../lib/optimize/ChunkModuleIdRangePlugin.js | 66 + .../lib/optimize/ConcatenatedModule.js | 1504 +++ .../optimize/EnsureChunkConditionsPlugin.js | 70 + .../lib/optimize/FlagIncludedChunksPlugin.js | 99 + .../lib/optimize/LimitChunkCountPlugin.js | 231 + .../optimize/MergeDuplicateChunksPlugin.js | 78 + .../lib/optimize/MinChunkSizePlugin.js | 82 + .../webpack/lib/optimize/MinMaxSizeWarning.js | 29 + .../lib/optimize/ModuleConcatenationPlugin.js | 485 + .../lib/optimize/NaturalChunkOrderPlugin.js | 41 + .../optimize/OccurrenceChunkOrderPlugin.js | 66 + .../optimize/OccurrenceModuleOrderPlugin.js | 112 + .../lib/optimize/OccurrenceOrderPlugin.js | 135 + .../lib/optimize/RemoveEmptyChunksPlugin.js | 42 + .../lib/optimize/RemoveParentModulesPlugin.js | 127 + .../lib/optimize/RuntimeChunkPlugin.js | 41 + .../lib/optimize/SideEffectsFlagPlugin.js | 169 + .../webpack/lib/optimize/SplitChunksPlugin.js | 938 ++ .../performance/AssetsOverSizeLimitWarning.js | 30 + .../EntrypointsOverSizeLimitWarning.js | 30 + .../lib/performance/NoAsyncChunksWarning.js | 21 + .../lib/performance/SizeLimitsPlugin.js | 125 + .../webpack/lib/util/LazyBucketSortedSet.js | 235 + node_modules/webpack/lib/util/Queue.js | 46 + node_modules/webpack/lib/util/Semaphore.js | 53 + node_modules/webpack/lib/util/SetHelpers.js | 48 + node_modules/webpack/lib/util/SortableSet.js | 140 + .../webpack/lib/util/StackedSetMap.js | 142 + node_modules/webpack/lib/util/TrackingSet.js | 35 + node_modules/webpack/lib/util/cachedMerge.js | 35 + node_modules/webpack/lib/util/cleverMerge.js | 77 + node_modules/webpack/lib/util/createHash.js | 137 + .../webpack/lib/util/deterministicGrouping.js | 274 + node_modules/webpack/lib/util/identifier.js | 127 + node_modules/webpack/lib/util/objectToMap.js | 16 + node_modules/webpack/lib/validateSchema.js | 67 + .../UnsupportedWebAssemblyFeatureError.js | 17 + .../lib/wasm/WasmFinalizeExportsPlugin.js | 69 + .../lib/wasm/WasmMainTemplatePlugin.js | 341 + .../webpack/lib/wasm/WebAssemblyGenerator.js | 458 + .../wasm/WebAssemblyInInitialChunkError.js | 88 + .../wasm/WebAssemblyJavascriptGenerator.js | 152 + .../lib/wasm/WebAssemblyModulesPlugin.js | 128 + .../webpack/lib/wasm/WebAssemblyParser.js | 175 + .../webpack/lib/wasm/WebAssemblyUtils.js | 59 + .../lib/web/FetchCompileWasmTemplatePlugin.js | 37 + .../lib/web/JsonpChunkTemplatePlugin.js | 71 + .../lib/web/JsonpExportMainTemplatePlugin.js | 50 + .../web/JsonpHotUpdateChunkTemplatePlugin.js | 39 + .../lib/web/JsonpMainTemplate.runtime.js | 71 + .../lib/web/JsonpMainTemplatePlugin.js | 615 ++ .../webpack/lib/web/JsonpTemplatePlugin.js | 23 + .../webpack/lib/web/WebEnvironmentPlugin.js | 18 + node_modules/webpack/lib/webpack.js | 206 + node_modules/webpack/lib/webpack.web.js | 31 + .../webworker/WebWorkerChunkTemplatePlugin.js | 35 + .../WebWorkerHotUpdateChunkTemplatePlugin.js | 40 + .../WebWorkerMainTemplate.runtime.js | 73 + .../webworker/WebWorkerMainTemplatePlugin.js | 192 + .../lib/webworker/WebWorkerTemplatePlugin.js | 25 + node_modules/webpack/package.json | 235 + .../webpack/schemas/WebpackOptions.json | 2269 ++++ .../webpack/schemas/ajv.absolutePath.js | 57 + .../webpack/schemas/plugins/BannerPlugin.json | 101 + .../webpack/schemas/plugins/DllPlugin.json | 36 + .../schemas/plugins/DllReferencePlugin.json | 205 + .../plugins/HashedModuleIdsPlugin.json | 26 + .../webpack/schemas/plugins/IgnorePlugin.json | 37 + .../schemas/plugins/LoaderOptionsPlugin.json | 27 + .../schemas/plugins/ProgressPlugin.json | 52 + .../plugins/SourceMapDevToolPlugin.json | 185 + .../schemas/plugins/WatchIgnorePlugin.json | 18 + .../plugins/debug/ProfilingPlugin.json | 13 + .../optimize/AggressiveSplittingPlugin.json | 23 + .../optimize/LimitChunkCountPlugin.json | 16 + .../plugins/optimize/MinChunkSizePlugin.json | 12 + .../OccurrenceOrderChunkIdsPlugin.json | 11 + .../OccurrenceOrderModuleIdsPlugin.json | 11 + .../webpack/web_modules/node-libs-browser.js | 0 node_modules/which-module/CHANGELOG.md | 26 + node_modules/which-module/LICENSE | 13 + node_modules/which-module/README.md | 55 + node_modules/which-module/index.js | 9 + node_modules/which-module/package.json | 68 + node_modules/which/CHANGELOG.md | 152 + node_modules/which/LICENSE | 15 + node_modules/which/README.md | 51 + node_modules/which/bin/which | 52 + node_modules/which/package.json | 67 + node_modules/which/which.js | 135 + node_modules/worker-farm/.editorconfig | 16 + node_modules/worker-farm/.travis.yml | 12 + node_modules/worker-farm/LICENSE.md | 13 + node_modules/worker-farm/README.md | 150 + .../worker-farm/examples/basic/child.js | 5 + .../worker-farm/examples/basic/index.js | 13 + node_modules/worker-farm/examples/pi/calc.js | 22 + node_modules/worker-farm/examples/pi/index.js | 41 + node_modules/worker-farm/index.d.ts | 55 + node_modules/worker-farm/lib/child/index.js | 56 + node_modules/worker-farm/lib/farm.js | 348 + node_modules/worker-farm/lib/fork.js | 33 + node_modules/worker-farm/lib/index.js | 34 + node_modules/worker-farm/package.json | 59 + node_modules/worker-farm/tests/child.js | 87 + node_modules/worker-farm/tests/debug.js | 12 + node_modules/worker-farm/tests/index.js | 616 ++ node_modules/wrap-ansi/index.js | 188 + node_modules/wrap-ansi/license | 9 + node_modules/wrap-ansi/package.json | 93 + node_modules/wrap-ansi/readme.md | 108 + node_modules/wrappy/LICENSE | 15 + node_modules/wrappy/README.md | 36 + node_modules/wrappy/package.json | 59 + node_modules/wrappy/wrappy.js | 33 + node_modules/xtend/.jshintrc | 30 + node_modules/xtend/LICENSE | 20 + node_modules/xtend/README.md | 32 + node_modules/xtend/immutable.js | 19 + node_modules/xtend/mutable.js | 17 + node_modules/xtend/package.json | 87 + node_modules/xtend/test.js | 103 + node_modules/y18n/CHANGELOG.md | 21 + node_modules/y18n/LICENSE | 13 + node_modules/y18n/README.md | 109 + node_modules/y18n/index.js | 188 + node_modules/y18n/package.json | 67 + node_modules/yallist/LICENSE | 15 + node_modules/yallist/README.md | 204 + node_modules/yallist/iterator.js | 8 + node_modules/yallist/package.json | 62 + node_modules/yallist/yallist.js | 426 + node_modules/yargs-parser/CHANGELOG.md | 467 + node_modules/yargs-parser/LICENSE.txt | 14 + node_modules/yargs-parser/README.md | 396 + node_modules/yargs-parser/index.js | 903 ++ .../yargs-parser/lib/tokenize-arg-string.js | 40 + node_modules/yargs-parser/package.json | 79 + node_modules/yargs/CHANGELOG.md | 1322 +++ node_modules/yargs/LICENSE | 22 + node_modules/yargs/README.md | 122 + node_modules/yargs/index.js | 32 + node_modules/yargs/lib/apply-extends.js | 53 + node_modules/yargs/lib/argsert.js | 68 + node_modules/yargs/lib/command.js | 437 + .../yargs/lib/completion-templates.js | 49 + node_modules/yargs/lib/completion.js | 115 + node_modules/yargs/lib/decamelize.js | 32 + node_modules/yargs/lib/is-promise.js | 3 + node_modules/yargs/lib/levenshtein.js | 58 + node_modules/yargs/lib/middleware.js | 65 + node_modules/yargs/lib/obj-filter.js | 11 + node_modules/yargs/lib/usage.js | 540 + node_modules/yargs/lib/validation.js | 341 + node_modules/yargs/lib/yerror.js | 11 + node_modules/yargs/locales/be.json | 39 + node_modules/yargs/locales/de.json | 39 + node_modules/yargs/locales/en.json | 42 + node_modules/yargs/locales/es.json | 39 + node_modules/yargs/locales/fr.json | 37 + node_modules/yargs/locales/hi.json | 42 + node_modules/yargs/locales/hu.json | 39 + node_modules/yargs/locales/id.json | 43 + node_modules/yargs/locales/it.json | 39 + node_modules/yargs/locales/ja.json | 42 + node_modules/yargs/locales/ko.json | 42 + node_modules/yargs/locales/nb.json | 37 + node_modules/yargs/locales/nl.json | 42 + node_modules/yargs/locales/nn.json | 39 + node_modules/yargs/locales/pirate.json | 13 + node_modules/yargs/locales/pl.json | 42 + node_modules/yargs/locales/pt.json | 38 + node_modules/yargs/locales/pt_BR.json | 42 + node_modules/yargs/locales/ru.json | 39 + node_modules/yargs/locales/th.json | 39 + node_modules/yargs/locales/tr.json | 41 + node_modules/yargs/locales/zh_CN.json | 41 + node_modules/yargs/locales/zh_TW.json | 40 + node_modules/yargs/package.json | 107 + node_modules/yargs/yargs.js | 1205 +++ package-lock.json | 5094 +++++++++ package.json | 20 + src/.index.js.swp | Bin 0 -> 12288 bytes src/.r3.js.swp | Bin 0 -> 12288 bytes src/index.js | 4 + src/r3.js | 2 + webpack.config.js | 9 + 5589 files changed, 557084 insertions(+) create mode 100644 README.md create mode 100644 dist/index.html create mode 100644 dist/r3.js create mode 120000 node_modules/.bin/acorn create mode 120000 node_modules/.bin/atob create mode 120000 node_modules/.bin/color-support create mode 120000 node_modules/.bin/errno create mode 120000 node_modules/.bin/gulp create mode 120000 node_modules/.bin/import-local-fixture create mode 120000 node_modules/.bin/json5 create mode 120000 node_modules/.bin/miller-rabin create mode 120000 node_modules/.bin/mkdirp create mode 120000 node_modules/.bin/rimraf create mode 120000 node_modules/.bin/semver create mode 120000 node_modules/.bin/sha.js create mode 120000 node_modules/.bin/terser create mode 120000 node_modules/.bin/webpack create mode 120000 node_modules/.bin/webpack-cli create mode 120000 node_modules/.bin/which create mode 100644 node_modules/.cache/terser-webpack-plugin/content-v2/sha512/76/02/c7682eb7d0754318658194124338a4f18b1c7d32c3e19c618180c41b3db7f2c4a2add56c320fdc76b0bd87012259640de0859cc1eeb3580d3eb599d96165 create mode 100644 node_modules/.cache/terser-webpack-plugin/index-v5/dc/b2/4bdebd5fd222e445a1bb7d42e57159e6f0672086f4f90ddbd0aa0fa82870 create mode 100644 node_modules/@webassemblyjs/ast/LICENSE create mode 100644 node_modules/@webassemblyjs/ast/README.md create mode 100644 node_modules/@webassemblyjs/ast/esm/clone.js create mode 100644 node_modules/@webassemblyjs/ast/esm/definitions.js create mode 100644 node_modules/@webassemblyjs/ast/esm/index.js create mode 100644 node_modules/@webassemblyjs/ast/esm/node-helpers.js create mode 100644 node_modules/@webassemblyjs/ast/esm/node-path.js create mode 100644 node_modules/@webassemblyjs/ast/esm/nodes.js create mode 100644 node_modules/@webassemblyjs/ast/esm/signatures.js create mode 100644 node_modules/@webassemblyjs/ast/esm/transform/denormalize-type-references/index.js create mode 100644 node_modules/@webassemblyjs/ast/esm/transform/wast-identifier-to-index/index.js create mode 100644 node_modules/@webassemblyjs/ast/esm/traverse.js create mode 100644 node_modules/@webassemblyjs/ast/esm/types/basic.js create mode 100644 node_modules/@webassemblyjs/ast/esm/types/nodes.js create mode 100644 node_modules/@webassemblyjs/ast/esm/types/traverse.js create mode 100644 node_modules/@webassemblyjs/ast/esm/utils.js create mode 100644 node_modules/@webassemblyjs/ast/lib/clone.js create mode 100644 node_modules/@webassemblyjs/ast/lib/definitions.js create mode 100644 node_modules/@webassemblyjs/ast/lib/index.js create mode 100644 node_modules/@webassemblyjs/ast/lib/node-helpers.js create mode 100644 node_modules/@webassemblyjs/ast/lib/node-path.js create mode 100644 node_modules/@webassemblyjs/ast/lib/nodes.js create mode 100644 node_modules/@webassemblyjs/ast/lib/signatures.js create mode 100644 node_modules/@webassemblyjs/ast/lib/transform/denormalize-type-references/index.js create mode 100644 node_modules/@webassemblyjs/ast/lib/transform/wast-identifier-to-index/index.js create mode 100644 node_modules/@webassemblyjs/ast/lib/traverse.js create mode 100644 node_modules/@webassemblyjs/ast/lib/types/basic.js create mode 100644 node_modules/@webassemblyjs/ast/lib/types/nodes.js create mode 100644 node_modules/@webassemblyjs/ast/lib/types/traverse.js create mode 100644 node_modules/@webassemblyjs/ast/lib/utils.js create mode 100644 node_modules/@webassemblyjs/ast/package.json create mode 100644 node_modules/@webassemblyjs/ast/scripts/generateNodeUtils.js create mode 100644 node_modules/@webassemblyjs/ast/scripts/generateTypeDefinitions.js create mode 100644 node_modules/@webassemblyjs/ast/scripts/util.js create mode 100644 node_modules/@webassemblyjs/ast/webassemblyjs-ast-1.7.10.tgz create mode 100644 node_modules/@webassemblyjs/floating-point-hex-parser/LICENSE create mode 100644 node_modules/@webassemblyjs/floating-point-hex-parser/README.md create mode 100644 node_modules/@webassemblyjs/floating-point-hex-parser/esm/index.js create mode 100644 node_modules/@webassemblyjs/floating-point-hex-parser/lib/index.js create mode 100644 node_modules/@webassemblyjs/floating-point-hex-parser/package.json create mode 100644 node_modules/@webassemblyjs/helper-api-error/LICENSE create mode 100644 node_modules/@webassemblyjs/helper-api-error/esm/index.js create mode 100644 node_modules/@webassemblyjs/helper-api-error/lib/index.js create mode 100644 node_modules/@webassemblyjs/helper-api-error/package.json create mode 100644 node_modules/@webassemblyjs/helper-buffer/LICENSE create mode 100644 node_modules/@webassemblyjs/helper-buffer/esm/compare.js create mode 100644 node_modules/@webassemblyjs/helper-buffer/esm/index.js create mode 100644 node_modules/@webassemblyjs/helper-buffer/lib/compare.js create mode 100644 node_modules/@webassemblyjs/helper-buffer/lib/index.js create mode 100644 node_modules/@webassemblyjs/helper-buffer/package.json create mode 100644 node_modules/@webassemblyjs/helper-code-frame/LICENSE create mode 100644 node_modules/@webassemblyjs/helper-code-frame/esm/index.js create mode 100644 node_modules/@webassemblyjs/helper-code-frame/lib/index.js create mode 100644 node_modules/@webassemblyjs/helper-code-frame/package.json create mode 100644 node_modules/@webassemblyjs/helper-code-frame/webassemblyjs-helper-code-frame-1.7.10.tgz create mode 100644 node_modules/@webassemblyjs/helper-fsm/LICENSE create mode 100644 node_modules/@webassemblyjs/helper-fsm/esm/index.js create mode 100644 node_modules/@webassemblyjs/helper-fsm/lib/index.js create mode 100644 node_modules/@webassemblyjs/helper-fsm/package.json create mode 100644 node_modules/@webassemblyjs/helper-module-context/LICENSE create mode 100644 node_modules/@webassemblyjs/helper-module-context/esm/index.js create mode 100644 node_modules/@webassemblyjs/helper-module-context/lib/index.js create mode 100644 node_modules/@webassemblyjs/helper-module-context/package.json create mode 100644 node_modules/@webassemblyjs/helper-module-context/src/index.js create mode 100644 node_modules/@webassemblyjs/helper-module-context/test/index.js create mode 100644 node_modules/@webassemblyjs/helper-wasm-bytecode/LICENSE create mode 100644 node_modules/@webassemblyjs/helper-wasm-bytecode/esm/index.js create mode 100644 node_modules/@webassemblyjs/helper-wasm-bytecode/esm/section.js create mode 100644 node_modules/@webassemblyjs/helper-wasm-bytecode/lib/index.js create mode 100644 node_modules/@webassemblyjs/helper-wasm-bytecode/lib/section.js create mode 100644 node_modules/@webassemblyjs/helper-wasm-bytecode/package.json create mode 100644 node_modules/@webassemblyjs/helper-wasm-bytecode/webassemblyjs-helper-wasm-bytecode-1.7.10.tgz create mode 100644 node_modules/@webassemblyjs/helper-wasm-section/LICENSE create mode 100644 node_modules/@webassemblyjs/helper-wasm-section/esm/create.js create mode 100644 node_modules/@webassemblyjs/helper-wasm-section/esm/index.js create mode 100644 node_modules/@webassemblyjs/helper-wasm-section/esm/remove.js create mode 100644 node_modules/@webassemblyjs/helper-wasm-section/esm/resize.js create mode 100644 node_modules/@webassemblyjs/helper-wasm-section/lib/create.js create mode 100644 node_modules/@webassemblyjs/helper-wasm-section/lib/index.js create mode 100644 node_modules/@webassemblyjs/helper-wasm-section/lib/remove.js create mode 100644 node_modules/@webassemblyjs/helper-wasm-section/lib/resize.js create mode 100644 node_modules/@webassemblyjs/helper-wasm-section/package.json create mode 100644 node_modules/@webassemblyjs/helper-wasm-section/webassemblyjs-helper-wasm-section-1.7.10.tgz create mode 100644 node_modules/@webassemblyjs/ieee754/LICENSE create mode 100644 node_modules/@webassemblyjs/ieee754/esm/index.js create mode 100644 node_modules/@webassemblyjs/ieee754/lib/index.js create mode 100644 node_modules/@webassemblyjs/ieee754/package.json create mode 100644 node_modules/@webassemblyjs/ieee754/src/index.js create mode 100644 node_modules/@webassemblyjs/leb128/LICENSE.txt create mode 100644 node_modules/@webassemblyjs/leb128/esm/bits.js create mode 100644 node_modules/@webassemblyjs/leb128/esm/bufs.js create mode 100644 node_modules/@webassemblyjs/leb128/esm/index.js create mode 100644 node_modules/@webassemblyjs/leb128/esm/leb.js create mode 100644 node_modules/@webassemblyjs/leb128/lib/bits.js create mode 100644 node_modules/@webassemblyjs/leb128/lib/bufs.js create mode 100644 node_modules/@webassemblyjs/leb128/lib/index.js create mode 100644 node_modules/@webassemblyjs/leb128/lib/leb.js create mode 100644 node_modules/@webassemblyjs/leb128/package.json create mode 100644 node_modules/@webassemblyjs/utf8/LICENSE create mode 100644 node_modules/@webassemblyjs/utf8/esm/decoder.js create mode 100644 node_modules/@webassemblyjs/utf8/esm/encoder.js create mode 100644 node_modules/@webassemblyjs/utf8/esm/index.js create mode 100644 node_modules/@webassemblyjs/utf8/lib/decoder.js create mode 100644 node_modules/@webassemblyjs/utf8/lib/encoder.js create mode 100644 node_modules/@webassemblyjs/utf8/lib/index.js create mode 100644 node_modules/@webassemblyjs/utf8/package.json create mode 100644 node_modules/@webassemblyjs/utf8/src/decoder.js create mode 100644 node_modules/@webassemblyjs/utf8/src/encoder.js create mode 100644 node_modules/@webassemblyjs/utf8/src/index.js create mode 100644 node_modules/@webassemblyjs/utf8/test/index.js create mode 100644 node_modules/@webassemblyjs/wasm-edit/LICENSE create mode 100644 node_modules/@webassemblyjs/wasm-edit/README.md create mode 100644 node_modules/@webassemblyjs/wasm-edit/esm/apply.js create mode 100644 node_modules/@webassemblyjs/wasm-edit/esm/index.js create mode 100644 node_modules/@webassemblyjs/wasm-edit/lib/apply.js create mode 100644 node_modules/@webassemblyjs/wasm-edit/lib/index.js create mode 100644 node_modules/@webassemblyjs/wasm-edit/package.json create mode 100644 node_modules/@webassemblyjs/wasm-edit/webassemblyjs-wasm-edit-1.7.10.tgz create mode 100644 node_modules/@webassemblyjs/wasm-gen/LICENSE create mode 100644 node_modules/@webassemblyjs/wasm-gen/esm/encoder/index.js create mode 100644 node_modules/@webassemblyjs/wasm-gen/esm/index.js create mode 100644 node_modules/@webassemblyjs/wasm-gen/lib/encoder/index.js create mode 100644 node_modules/@webassemblyjs/wasm-gen/lib/index.js create mode 100644 node_modules/@webassemblyjs/wasm-gen/package.json create mode 100644 node_modules/@webassemblyjs/wasm-gen/webassemblyjs-wasm-gen-1.7.10.tgz create mode 100644 node_modules/@webassemblyjs/wasm-opt/LICENSE create mode 100644 node_modules/@webassemblyjs/wasm-opt/esm/index.js create mode 100644 node_modules/@webassemblyjs/wasm-opt/esm/leb128.js create mode 100644 node_modules/@webassemblyjs/wasm-opt/lib/index.js create mode 100644 node_modules/@webassemblyjs/wasm-opt/lib/leb128.js create mode 100644 node_modules/@webassemblyjs/wasm-opt/package.json create mode 100644 node_modules/@webassemblyjs/wasm-opt/webassemblyjs-wasm-opt-1.7.10.tgz create mode 100644 node_modules/@webassemblyjs/wasm-parser/LICENSE create mode 100644 node_modules/@webassemblyjs/wasm-parser/README.md create mode 100644 node_modules/@webassemblyjs/wasm-parser/esm/decoder.js create mode 100644 node_modules/@webassemblyjs/wasm-parser/esm/index.js create mode 100644 node_modules/@webassemblyjs/wasm-parser/esm/types/decoder.js create mode 100644 node_modules/@webassemblyjs/wasm-parser/lib/decoder.js create mode 100644 node_modules/@webassemblyjs/wasm-parser/lib/index.js create mode 100644 node_modules/@webassemblyjs/wasm-parser/lib/types/decoder.js create mode 100644 node_modules/@webassemblyjs/wasm-parser/package.json create mode 100644 node_modules/@webassemblyjs/wasm-parser/webassemblyjs-wasm-parser-1.7.10.tgz create mode 100644 node_modules/@webassemblyjs/wast-parser/LICENSE create mode 100644 node_modules/@webassemblyjs/wast-parser/README.md create mode 100644 node_modules/@webassemblyjs/wast-parser/esm/grammar.js create mode 100644 node_modules/@webassemblyjs/wast-parser/esm/index.js create mode 100644 node_modules/@webassemblyjs/wast-parser/esm/number-literals.js create mode 100644 node_modules/@webassemblyjs/wast-parser/esm/string-literals.js create mode 100644 node_modules/@webassemblyjs/wast-parser/esm/tokenizer.js create mode 100644 node_modules/@webassemblyjs/wast-parser/lib/grammar.js create mode 100644 node_modules/@webassemblyjs/wast-parser/lib/index.js create mode 100644 node_modules/@webassemblyjs/wast-parser/lib/number-literals.js create mode 100644 node_modules/@webassemblyjs/wast-parser/lib/string-literals.js create mode 100644 node_modules/@webassemblyjs/wast-parser/lib/tokenizer.js create mode 100644 node_modules/@webassemblyjs/wast-parser/package.json create mode 100644 node_modules/@webassemblyjs/wast-parser/webassemblyjs-wast-parser-1.7.10.tgz create mode 100644 node_modules/@webassemblyjs/wast-printer/LICENSE create mode 100644 node_modules/@webassemblyjs/wast-printer/README.md create mode 100644 node_modules/@webassemblyjs/wast-printer/esm/index.js create mode 100644 node_modules/@webassemblyjs/wast-printer/lib/index.js create mode 100644 node_modules/@webassemblyjs/wast-printer/package.json create mode 100644 node_modules/@webassemblyjs/wast-printer/webassemblyjs-wast-printer-1.7.10.tgz create mode 100644 node_modules/@xtuc/ieee754/LICENSE create mode 100644 node_modules/@xtuc/ieee754/README.md create mode 100644 node_modules/@xtuc/ieee754/dist/.gitkeep create mode 100644 node_modules/@xtuc/ieee754/dist/index.cjs.js create mode 100644 node_modules/@xtuc/ieee754/index.js create mode 100644 node_modules/@xtuc/ieee754/package.json create mode 100644 node_modules/@xtuc/long/LICENSE create mode 100644 node_modules/@xtuc/long/README.md create mode 100644 node_modules/@xtuc/long/dist/long.js create mode 100644 node_modules/@xtuc/long/dist/long.js.map create mode 100644 node_modules/@xtuc/long/index.d.ts create mode 100644 node_modules/@xtuc/long/index.js create mode 100644 node_modules/@xtuc/long/package.json create mode 100644 node_modules/@xtuc/long/src/long.js create mode 100644 node_modules/acorn/CHANGELOG.md create mode 100644 node_modules/acorn/LICENSE create mode 100644 node_modules/acorn/README.md create mode 100755 node_modules/acorn/bin/acorn create mode 100644 node_modules/acorn/dist/acorn.d.ts create mode 100644 node_modules/acorn/dist/acorn.js create mode 100644 node_modules/acorn/dist/acorn.js.map create mode 100644 node_modules/acorn/dist/acorn.mjs create mode 100644 node_modules/acorn/dist/acorn.mjs.map create mode 100644 node_modules/acorn/dist/bin.js create mode 100644 node_modules/acorn/package.json create mode 100644 node_modules/ajv-errors/LICENSE create mode 100644 node_modules/ajv-errors/README.md create mode 100644 node_modules/ajv-errors/index.js create mode 100644 node_modules/ajv-errors/lib/dot/errorMessage.jst create mode 100644 node_modules/ajv-errors/lib/dotjs/README.md create mode 100644 node_modules/ajv-errors/lib/dotjs/errorMessage.js create mode 100644 node_modules/ajv-errors/package.json create mode 100644 node_modules/ajv-keywords/LICENSE create mode 100644 node_modules/ajv-keywords/README.md create mode 100644 node_modules/ajv-keywords/index.js create mode 100644 node_modules/ajv-keywords/keywords/_formatLimit.js create mode 100644 node_modules/ajv-keywords/keywords/_util.js create mode 100644 node_modules/ajv-keywords/keywords/allRequired.js create mode 100644 node_modules/ajv-keywords/keywords/anyRequired.js create mode 100644 node_modules/ajv-keywords/keywords/deepProperties.js create mode 100644 node_modules/ajv-keywords/keywords/deepRequired.js create mode 100644 node_modules/ajv-keywords/keywords/dot/_formatLimit.jst create mode 100644 node_modules/ajv-keywords/keywords/dot/patternRequired.jst create mode 100644 node_modules/ajv-keywords/keywords/dot/switch.jst create mode 100644 node_modules/ajv-keywords/keywords/dotjs/README.md create mode 100644 node_modules/ajv-keywords/keywords/dotjs/_formatLimit.js create mode 100644 node_modules/ajv-keywords/keywords/dotjs/patternRequired.js create mode 100644 node_modules/ajv-keywords/keywords/dotjs/switch.js create mode 100644 node_modules/ajv-keywords/keywords/dynamicDefaults.js create mode 100644 node_modules/ajv-keywords/keywords/formatMaximum.js create mode 100644 node_modules/ajv-keywords/keywords/formatMinimum.js create mode 100644 node_modules/ajv-keywords/keywords/index.js create mode 100644 node_modules/ajv-keywords/keywords/instanceof.js create mode 100644 node_modules/ajv-keywords/keywords/oneRequired.js create mode 100644 node_modules/ajv-keywords/keywords/patternRequired.js create mode 100644 node_modules/ajv-keywords/keywords/prohibited.js create mode 100644 node_modules/ajv-keywords/keywords/range.js create mode 100644 node_modules/ajv-keywords/keywords/regexp.js create mode 100644 node_modules/ajv-keywords/keywords/select.js create mode 100644 node_modules/ajv-keywords/keywords/switch.js create mode 100644 node_modules/ajv-keywords/keywords/transform.js create mode 100644 node_modules/ajv-keywords/keywords/typeof.js create mode 100644 node_modules/ajv-keywords/keywords/uniqueItemProperties.js create mode 100644 node_modules/ajv-keywords/package.json create mode 100644 node_modules/ajv/.tonic_example.js create mode 100644 node_modules/ajv/LICENSE create mode 100644 node_modules/ajv/README.md create mode 100644 node_modules/ajv/dist/ajv.bundle.js create mode 100644 node_modules/ajv/dist/ajv.min.js create mode 100644 node_modules/ajv/dist/ajv.min.js.map create mode 100644 node_modules/ajv/lib/ajv.d.ts create mode 100644 node_modules/ajv/lib/ajv.js create mode 100644 node_modules/ajv/lib/cache.js create mode 100644 node_modules/ajv/lib/compile/async.js create mode 100644 node_modules/ajv/lib/compile/equal.js create mode 100644 node_modules/ajv/lib/compile/error_classes.js create mode 100644 node_modules/ajv/lib/compile/formats.js create mode 100644 node_modules/ajv/lib/compile/index.js create mode 100644 node_modules/ajv/lib/compile/resolve.js create mode 100644 node_modules/ajv/lib/compile/rules.js create mode 100644 node_modules/ajv/lib/compile/schema_obj.js create mode 100644 node_modules/ajv/lib/compile/ucs2length.js create mode 100644 node_modules/ajv/lib/compile/util.js create mode 100644 node_modules/ajv/lib/data.js create mode 100644 node_modules/ajv/lib/definition_schema.js create mode 100644 node_modules/ajv/lib/dot/_limit.jst create mode 100644 node_modules/ajv/lib/dot/_limitItems.jst create mode 100644 node_modules/ajv/lib/dot/_limitLength.jst create mode 100644 node_modules/ajv/lib/dot/_limitProperties.jst create mode 100644 node_modules/ajv/lib/dot/allOf.jst create mode 100644 node_modules/ajv/lib/dot/anyOf.jst create mode 100644 node_modules/ajv/lib/dot/coerce.def create mode 100644 node_modules/ajv/lib/dot/comment.jst create mode 100644 node_modules/ajv/lib/dot/const.jst create mode 100644 node_modules/ajv/lib/dot/contains.jst create mode 100644 node_modules/ajv/lib/dot/custom.jst create mode 100644 node_modules/ajv/lib/dot/defaults.def create mode 100644 node_modules/ajv/lib/dot/definitions.def create mode 100644 node_modules/ajv/lib/dot/dependencies.jst create mode 100644 node_modules/ajv/lib/dot/enum.jst create mode 100644 node_modules/ajv/lib/dot/errors.def create mode 100644 node_modules/ajv/lib/dot/format.jst create mode 100644 node_modules/ajv/lib/dot/if.jst create mode 100644 node_modules/ajv/lib/dot/items.jst create mode 100644 node_modules/ajv/lib/dot/missing.def create mode 100644 node_modules/ajv/lib/dot/multipleOf.jst create mode 100644 node_modules/ajv/lib/dot/not.jst create mode 100644 node_modules/ajv/lib/dot/oneOf.jst create mode 100644 node_modules/ajv/lib/dot/pattern.jst create mode 100644 node_modules/ajv/lib/dot/properties.jst create mode 100644 node_modules/ajv/lib/dot/propertyNames.jst create mode 100644 node_modules/ajv/lib/dot/ref.jst create mode 100644 node_modules/ajv/lib/dot/required.jst create mode 100644 node_modules/ajv/lib/dot/uniqueItems.jst create mode 100644 node_modules/ajv/lib/dot/validate.jst create mode 100644 node_modules/ajv/lib/dotjs/README.md create mode 100644 node_modules/ajv/lib/dotjs/_limit.js create mode 100644 node_modules/ajv/lib/dotjs/_limitItems.js create mode 100644 node_modules/ajv/lib/dotjs/_limitLength.js create mode 100644 node_modules/ajv/lib/dotjs/_limitProperties.js create mode 100644 node_modules/ajv/lib/dotjs/allOf.js create mode 100644 node_modules/ajv/lib/dotjs/anyOf.js create mode 100644 node_modules/ajv/lib/dotjs/comment.js create mode 100644 node_modules/ajv/lib/dotjs/const.js create mode 100644 node_modules/ajv/lib/dotjs/contains.js create mode 100644 node_modules/ajv/lib/dotjs/custom.js create mode 100644 node_modules/ajv/lib/dotjs/dependencies.js create mode 100644 node_modules/ajv/lib/dotjs/enum.js create mode 100644 node_modules/ajv/lib/dotjs/format.js create mode 100644 node_modules/ajv/lib/dotjs/if.js create mode 100644 node_modules/ajv/lib/dotjs/index.js create mode 100644 node_modules/ajv/lib/dotjs/items.js create mode 100644 node_modules/ajv/lib/dotjs/multipleOf.js create mode 100644 node_modules/ajv/lib/dotjs/not.js create mode 100644 node_modules/ajv/lib/dotjs/oneOf.js create mode 100644 node_modules/ajv/lib/dotjs/pattern.js create mode 100644 node_modules/ajv/lib/dotjs/properties.js create mode 100644 node_modules/ajv/lib/dotjs/propertyNames.js create mode 100644 node_modules/ajv/lib/dotjs/ref.js create mode 100644 node_modules/ajv/lib/dotjs/required.js create mode 100644 node_modules/ajv/lib/dotjs/uniqueItems.js create mode 100644 node_modules/ajv/lib/dotjs/validate.js create mode 100644 node_modules/ajv/lib/keyword.js create mode 100644 node_modules/ajv/lib/refs/data.json create mode 100644 node_modules/ajv/lib/refs/json-schema-draft-04.json create mode 100644 node_modules/ajv/lib/refs/json-schema-draft-06.json create mode 100644 node_modules/ajv/lib/refs/json-schema-draft-07.json create mode 100644 node_modules/ajv/lib/refs/json-schema-secure.json create mode 100644 node_modules/ajv/package.json create mode 100644 node_modules/ajv/scripts/.eslintrc.yml create mode 100644 node_modules/ajv/scripts/bundle.js create mode 100644 node_modules/ajv/scripts/compile-dots.js create mode 100755 node_modules/ajv/scripts/info create mode 100755 node_modules/ajv/scripts/prepare-tests create mode 100755 node_modules/ajv/scripts/publish-built-version create mode 100755 node_modules/ajv/scripts/travis-gh-pages create mode 100644 node_modules/ansi-colors/LICENSE create mode 100644 node_modules/ansi-colors/README.md create mode 100644 node_modules/ansi-colors/index.js create mode 100644 node_modules/ansi-colors/package.json create mode 100644 node_modules/ansi-colors/types/index.d.ts create mode 100644 node_modules/ansi-gray/LICENSE create mode 100644 node_modules/ansi-gray/index.js create mode 100644 node_modules/ansi-gray/package.json create mode 100644 node_modules/ansi-gray/readme.md create mode 100644 node_modules/ansi-regex/index.js create mode 100644 node_modules/ansi-regex/license create mode 100644 node_modules/ansi-regex/package.json create mode 100644 node_modules/ansi-regex/readme.md create mode 100644 node_modules/ansi-styles/index.js create mode 100644 node_modules/ansi-styles/license create mode 100644 node_modules/ansi-styles/package.json create mode 100644 node_modules/ansi-styles/readme.md create mode 100644 node_modules/ansi-wrap/LICENSE create mode 100644 node_modules/ansi-wrap/README.md create mode 100644 node_modules/ansi-wrap/index.js create mode 100644 node_modules/ansi-wrap/package.json create mode 100644 node_modules/anymatch/LICENSE create mode 100644 node_modules/anymatch/README.md create mode 100644 node_modules/anymatch/index.js create mode 100644 node_modules/anymatch/node_modules/normalize-path/LICENSE create mode 100644 node_modules/anymatch/node_modules/normalize-path/README.md create mode 100644 node_modules/anymatch/node_modules/normalize-path/index.js create mode 100644 node_modules/anymatch/node_modules/normalize-path/package.json create mode 100644 node_modules/anymatch/package.json create mode 100644 node_modules/append-buffer/LICENSE create mode 100644 node_modules/append-buffer/README.md create mode 100644 node_modules/append-buffer/index.js create mode 100644 node_modules/append-buffer/package.json create mode 100644 node_modules/aproba/LICENSE create mode 100644 node_modules/aproba/README.md create mode 100644 node_modules/aproba/index.js create mode 100644 node_modules/aproba/package.json create mode 100644 node_modules/archy/.travis.yml create mode 100644 node_modules/archy/LICENSE create mode 100644 node_modules/archy/examples/beep.js create mode 100644 node_modules/archy/examples/multi_line.js create mode 100644 node_modules/archy/index.js create mode 100644 node_modules/archy/package.json create mode 100644 node_modules/archy/readme.markdown create mode 100644 node_modules/archy/test/beep.js create mode 100644 node_modules/archy/test/multi_line.js create mode 100644 node_modules/archy/test/non_unicode.js create mode 100755 node_modules/arr-diff/LICENSE create mode 100644 node_modules/arr-diff/README.md create mode 100644 node_modules/arr-diff/index.js create mode 100644 node_modules/arr-diff/package.json create mode 100755 node_modules/arr-filter/LICENSE create mode 100755 node_modules/arr-filter/README.md create mode 100755 node_modules/arr-filter/index.js create mode 100644 node_modules/arr-filter/package.json create mode 100755 node_modules/arr-flatten/LICENSE create mode 100755 node_modules/arr-flatten/README.md create mode 100644 node_modules/arr-flatten/index.js create mode 100644 node_modules/arr-flatten/package.json create mode 100644 node_modules/arr-map/LICENSE create mode 100644 node_modules/arr-map/README.md create mode 100644 node_modules/arr-map/index.js create mode 100644 node_modules/arr-map/package.json create mode 100644 node_modules/arr-union/LICENSE create mode 100644 node_modules/arr-union/README.md create mode 100644 node_modules/arr-union/index.js create mode 100644 node_modules/arr-union/package.json create mode 100644 node_modules/array-each/LICENSE create mode 100644 node_modules/array-each/README.md create mode 100644 node_modules/array-each/index.js create mode 100644 node_modules/array-each/package.json create mode 100644 node_modules/array-initial/.jshintrc create mode 100644 node_modules/array-initial/.npmignore create mode 100644 node_modules/array-initial/.travis.yml create mode 100644 node_modules/array-initial/LICENSE-MIT create mode 100644 node_modules/array-initial/README.md create mode 100644 node_modules/array-initial/index.js create mode 100644 node_modules/array-initial/node_modules/is-number/LICENSE create mode 100644 node_modules/array-initial/node_modules/is-number/README.md create mode 100644 node_modules/array-initial/node_modules/is-number/index.js create mode 100644 node_modules/array-initial/node_modules/is-number/package.json create mode 100644 node_modules/array-initial/package.json create mode 100644 node_modules/array-last/LICENSE create mode 100755 node_modules/array-last/README.md create mode 100644 node_modules/array-last/index.js create mode 100644 node_modules/array-last/node_modules/is-number/LICENSE create mode 100644 node_modules/array-last/node_modules/is-number/README.md create mode 100644 node_modules/array-last/node_modules/is-number/index.js create mode 100644 node_modules/array-last/node_modules/is-number/package.json create mode 100644 node_modules/array-last/package.json create mode 100755 node_modules/array-slice/LICENSE create mode 100755 node_modules/array-slice/README.md create mode 100644 node_modules/array-slice/index.js create mode 100644 node_modules/array-slice/package.json create mode 100644 node_modules/array-sort/LICENSE create mode 100644 node_modules/array-sort/README.md create mode 100644 node_modules/array-sort/index.js create mode 100644 node_modules/array-sort/node_modules/kind-of/LICENSE create mode 100644 node_modules/array-sort/node_modules/kind-of/README.md create mode 100644 node_modules/array-sort/node_modules/kind-of/index.js create mode 100644 node_modules/array-sort/node_modules/kind-of/package.json create mode 100644 node_modules/array-sort/package.json create mode 100755 node_modules/array-unique/LICENSE create mode 100755 node_modules/array-unique/README.md create mode 100644 node_modules/array-unique/index.js create mode 100644 node_modules/array-unique/package.json create mode 100644 node_modules/asn1.js/README.md create mode 100644 node_modules/asn1.js/lib/asn1.js create mode 100644 node_modules/asn1.js/lib/asn1/api.js create mode 100644 node_modules/asn1.js/lib/asn1/base/buffer.js create mode 100644 node_modules/asn1.js/lib/asn1/base/index.js create mode 100644 node_modules/asn1.js/lib/asn1/base/node.js create mode 100644 node_modules/asn1.js/lib/asn1/base/reporter.js create mode 100644 node_modules/asn1.js/lib/asn1/constants/der.js create mode 100644 node_modules/asn1.js/lib/asn1/constants/index.js create mode 100644 node_modules/asn1.js/lib/asn1/decoders/der.js create mode 100644 node_modules/asn1.js/lib/asn1/decoders/index.js create mode 100644 node_modules/asn1.js/lib/asn1/decoders/pem.js create mode 100644 node_modules/asn1.js/lib/asn1/encoders/der.js create mode 100644 node_modules/asn1.js/lib/asn1/encoders/index.js create mode 100644 node_modules/asn1.js/lib/asn1/encoders/pem.js create mode 100644 node_modules/asn1.js/package.json create mode 100644 node_modules/assert/.travis.yml create mode 100644 node_modules/assert/.zuul.yml create mode 100644 node_modules/assert/CHANGELOG.md create mode 100644 node_modules/assert/LICENSE create mode 100644 node_modules/assert/README.md create mode 100644 node_modules/assert/assert.js create mode 100644 node_modules/assert/node_modules/inherits/LICENSE create mode 100644 node_modules/assert/node_modules/inherits/README.md create mode 100644 node_modules/assert/node_modules/inherits/inherits.js create mode 100644 node_modules/assert/node_modules/inherits/inherits_browser.js create mode 100644 node_modules/assert/node_modules/inherits/package.json create mode 100644 node_modules/assert/node_modules/inherits/test.js create mode 100644 node_modules/assert/node_modules/util/.npmignore create mode 100644 node_modules/assert/node_modules/util/.travis.yml create mode 100644 node_modules/assert/node_modules/util/.zuul.yml create mode 100644 node_modules/assert/node_modules/util/LICENSE create mode 100644 node_modules/assert/node_modules/util/README.md create mode 100644 node_modules/assert/node_modules/util/package.json create mode 100644 node_modules/assert/node_modules/util/support/isBuffer.js create mode 100644 node_modules/assert/node_modules/util/support/isBufferBrowser.js create mode 100644 node_modules/assert/node_modules/util/test/browser/inspect.js create mode 100644 node_modules/assert/node_modules/util/test/browser/is.js create mode 100644 node_modules/assert/node_modules/util/test/node/debug.js create mode 100644 node_modules/assert/node_modules/util/test/node/format.js create mode 100644 node_modules/assert/node_modules/util/test/node/inspect.js create mode 100644 node_modules/assert/node_modules/util/test/node/log.js create mode 100644 node_modules/assert/node_modules/util/test/node/util.js create mode 100644 node_modules/assert/node_modules/util/util.js create mode 100644 node_modules/assert/package.json create mode 100644 node_modules/assert/test.js create mode 100644 node_modules/assign-symbols/LICENSE create mode 100644 node_modules/assign-symbols/README.md create mode 100644 node_modules/assign-symbols/index.js create mode 100644 node_modules/assign-symbols/package.json create mode 100644 node_modules/async-done/LICENSE create mode 100644 node_modules/async-done/README.md create mode 100644 node_modules/async-done/index.d.ts create mode 100644 node_modules/async-done/index.js create mode 100644 node_modules/async-done/package.json create mode 100644 node_modules/async-each/README.md create mode 100644 node_modules/async-each/index.js create mode 100644 node_modules/async-each/package.json create mode 100644 node_modules/async-settle/LICENSE create mode 100644 node_modules/async-settle/README.md create mode 100644 node_modules/async-settle/index.js create mode 100644 node_modules/async-settle/package.json create mode 100644 node_modules/atob/LICENSE create mode 100644 node_modules/atob/LICENSE.DOCS create mode 100644 node_modules/atob/README.md create mode 100755 node_modules/atob/bin/atob.js create mode 100644 node_modules/atob/bower.json create mode 100644 node_modules/atob/browser-atob.js create mode 100644 node_modules/atob/node-atob.js create mode 100644 node_modules/atob/package.json create mode 100644 node_modules/atob/test.js create mode 100644 node_modules/bach/LICENSE create mode 100644 node_modules/bach/README.md create mode 100644 node_modules/bach/index.js create mode 100644 node_modules/bach/lib/helpers.js create mode 100644 node_modules/bach/lib/parallel.js create mode 100644 node_modules/bach/lib/series.js create mode 100644 node_modules/bach/lib/settleParallel.js create mode 100644 node_modules/bach/lib/settleSeries.js create mode 100644 node_modules/bach/package.json create mode 100644 node_modules/balanced-match/.npmignore create mode 100644 node_modules/balanced-match/LICENSE.md create mode 100644 node_modules/balanced-match/README.md create mode 100644 node_modules/balanced-match/index.js create mode 100644 node_modules/balanced-match/package.json create mode 100644 node_modules/base/LICENSE create mode 100644 node_modules/base/README.md create mode 100644 node_modules/base/index.js create mode 100644 node_modules/base/node_modules/define-property/LICENSE create mode 100644 node_modules/base/node_modules/define-property/README.md create mode 100644 node_modules/base/node_modules/define-property/index.js create mode 100644 node_modules/base/node_modules/define-property/package.json create mode 100644 node_modules/base/node_modules/is-accessor-descriptor/LICENSE create mode 100644 node_modules/base/node_modules/is-accessor-descriptor/README.md create mode 100644 node_modules/base/node_modules/is-accessor-descriptor/index.js create mode 100644 node_modules/base/node_modules/is-accessor-descriptor/package.json create mode 100644 node_modules/base/node_modules/is-data-descriptor/LICENSE create mode 100644 node_modules/base/node_modules/is-data-descriptor/README.md create mode 100644 node_modules/base/node_modules/is-data-descriptor/index.js create mode 100644 node_modules/base/node_modules/is-data-descriptor/package.json create mode 100644 node_modules/base/node_modules/is-descriptor/LICENSE create mode 100644 node_modules/base/node_modules/is-descriptor/README.md create mode 100644 node_modules/base/node_modules/is-descriptor/index.js create mode 100644 node_modules/base/node_modules/is-descriptor/package.json create mode 100644 node_modules/base/package.json create mode 100644 node_modules/base64-js/LICENSE create mode 100644 node_modules/base64-js/README.md create mode 100644 node_modules/base64-js/base64js.min.js create mode 100644 node_modules/base64-js/index.js create mode 100644 node_modules/base64-js/package.json create mode 100644 node_modules/big.js/CHANGELOG.md create mode 100644 node_modules/big.js/LICENCE create mode 100644 node_modules/big.js/README.md create mode 100644 node_modules/big.js/big.js create mode 100644 node_modules/big.js/big.min.js create mode 100644 node_modules/big.js/big.mjs create mode 100644 node_modules/big.js/package.json create mode 100644 node_modules/binary-extensions/binary-extensions.json create mode 100644 node_modules/binary-extensions/license create mode 100644 node_modules/binary-extensions/package.json create mode 100644 node_modules/binary-extensions/readme.md create mode 100644 node_modules/bluebird/LICENSE create mode 100644 node_modules/bluebird/README.md create mode 100644 node_modules/bluebird/changelog.md create mode 100644 node_modules/bluebird/js/browser/bluebird.core.js create mode 100644 node_modules/bluebird/js/browser/bluebird.core.min.js create mode 100644 node_modules/bluebird/js/browser/bluebird.js create mode 100644 node_modules/bluebird/js/browser/bluebird.min.js create mode 100644 node_modules/bluebird/js/release/any.js create mode 100644 node_modules/bluebird/js/release/assert.js create mode 100644 node_modules/bluebird/js/release/async.js create mode 100644 node_modules/bluebird/js/release/bind.js create mode 100644 node_modules/bluebird/js/release/bluebird.js create mode 100644 node_modules/bluebird/js/release/call_get.js create mode 100644 node_modules/bluebird/js/release/cancel.js create mode 100644 node_modules/bluebird/js/release/catch_filter.js create mode 100644 node_modules/bluebird/js/release/context.js create mode 100644 node_modules/bluebird/js/release/debuggability.js create mode 100644 node_modules/bluebird/js/release/direct_resolve.js create mode 100644 node_modules/bluebird/js/release/each.js create mode 100644 node_modules/bluebird/js/release/errors.js create mode 100644 node_modules/bluebird/js/release/es5.js create mode 100644 node_modules/bluebird/js/release/filter.js create mode 100644 node_modules/bluebird/js/release/finally.js create mode 100644 node_modules/bluebird/js/release/generators.js create mode 100644 node_modules/bluebird/js/release/join.js create mode 100644 node_modules/bluebird/js/release/map.js create mode 100644 node_modules/bluebird/js/release/method.js create mode 100644 node_modules/bluebird/js/release/nodeback.js create mode 100644 node_modules/bluebird/js/release/nodeify.js create mode 100644 node_modules/bluebird/js/release/promise.js create mode 100644 node_modules/bluebird/js/release/promise_array.js create mode 100644 node_modules/bluebird/js/release/promisify.js create mode 100644 node_modules/bluebird/js/release/props.js create mode 100644 node_modules/bluebird/js/release/queue.js create mode 100644 node_modules/bluebird/js/release/race.js create mode 100644 node_modules/bluebird/js/release/reduce.js create mode 100644 node_modules/bluebird/js/release/schedule.js create mode 100644 node_modules/bluebird/js/release/settle.js create mode 100644 node_modules/bluebird/js/release/some.js create mode 100644 node_modules/bluebird/js/release/synchronous_inspection.js create mode 100644 node_modules/bluebird/js/release/thenables.js create mode 100644 node_modules/bluebird/js/release/timers.js create mode 100644 node_modules/bluebird/js/release/using.js create mode 100644 node_modules/bluebird/js/release/util.js create mode 100644 node_modules/bluebird/package.json create mode 100644 node_modules/bn.js/.npmignore create mode 100644 node_modules/bn.js/README.md create mode 100644 node_modules/bn.js/lib/bn.js create mode 100644 node_modules/bn.js/package.json create mode 100644 node_modules/bn.js/util/genCombMulTo.js create mode 100644 node_modules/bn.js/util/genCombMulTo10.js create mode 100644 node_modules/brace-expansion/LICENSE create mode 100644 node_modules/brace-expansion/README.md create mode 100644 node_modules/brace-expansion/index.js create mode 100644 node_modules/brace-expansion/package.json create mode 100644 node_modules/braces/LICENSE create mode 100644 node_modules/braces/README.md create mode 100644 node_modules/braces/index.js create mode 100644 node_modules/braces/lib/braces.js create mode 100644 node_modules/braces/lib/compilers.js create mode 100644 node_modules/braces/lib/parsers.js create mode 100644 node_modules/braces/lib/utils.js create mode 100644 node_modules/braces/node_modules/extend-shallow/LICENSE create mode 100644 node_modules/braces/node_modules/extend-shallow/README.md create mode 100644 node_modules/braces/node_modules/extend-shallow/index.js create mode 100644 node_modules/braces/node_modules/extend-shallow/package.json create mode 100644 node_modules/braces/package.json create mode 100644 node_modules/brorand/.npmignore create mode 100644 node_modules/brorand/README.md create mode 100644 node_modules/brorand/index.js create mode 100644 node_modules/brorand/package.json create mode 100644 node_modules/brorand/test/api-test.js create mode 100644 node_modules/browserify-aes/.travis.yml create mode 100644 node_modules/browserify-aes/LICENSE create mode 100644 node_modules/browserify-aes/README.md create mode 100644 node_modules/browserify-aes/aes.js create mode 100644 node_modules/browserify-aes/authCipher.js create mode 100644 node_modules/browserify-aes/browser.js create mode 100644 node_modules/browserify-aes/decrypter.js create mode 100644 node_modules/browserify-aes/encrypter.js create mode 100644 node_modules/browserify-aes/ghash.js create mode 100644 node_modules/browserify-aes/incr32.js create mode 100644 node_modules/browserify-aes/index.js create mode 100644 node_modules/browserify-aes/modes/cbc.js create mode 100644 node_modules/browserify-aes/modes/cfb.js create mode 100644 node_modules/browserify-aes/modes/cfb1.js create mode 100644 node_modules/browserify-aes/modes/cfb8.js create mode 100644 node_modules/browserify-aes/modes/ctr.js create mode 100644 node_modules/browserify-aes/modes/ecb.js create mode 100644 node_modules/browserify-aes/modes/index.js create mode 100644 node_modules/browserify-aes/modes/list.json create mode 100644 node_modules/browserify-aes/modes/ofb.js create mode 100644 node_modules/browserify-aes/package.json create mode 100644 node_modules/browserify-aes/streamCipher.js create mode 100644 node_modules/browserify-cipher/.travis.yml create mode 100644 node_modules/browserify-cipher/LICENSE create mode 100644 node_modules/browserify-cipher/README.md create mode 100644 node_modules/browserify-cipher/browser.js create mode 100644 node_modules/browserify-cipher/index.js create mode 100644 node_modules/browserify-cipher/package.json create mode 100644 node_modules/browserify-cipher/test.js create mode 100644 node_modules/browserify-des/.travis.yml create mode 100644 node_modules/browserify-des/index.js create mode 100644 node_modules/browserify-des/license create mode 100644 node_modules/browserify-des/modes.js create mode 100644 node_modules/browserify-des/package.json create mode 100644 node_modules/browserify-des/readme.md create mode 100644 node_modules/browserify-des/test.js create mode 100644 node_modules/browserify-rsa/.travis.yml create mode 100644 node_modules/browserify-rsa/LICENSE create mode 100644 node_modules/browserify-rsa/index.js create mode 100644 node_modules/browserify-rsa/package.json create mode 100644 node_modules/browserify-rsa/readme.md create mode 100644 node_modules/browserify-rsa/test.js create mode 100644 node_modules/browserify-sign/LICENSE create mode 100644 node_modules/browserify-sign/README.md create mode 100644 node_modules/browserify-sign/algos.js create mode 100644 node_modules/browserify-sign/browser/algorithms.json create mode 100644 node_modules/browserify-sign/browser/curves.json create mode 100644 node_modules/browserify-sign/browser/index.js create mode 100644 node_modules/browserify-sign/browser/sign.js create mode 100644 node_modules/browserify-sign/browser/verify.js create mode 100644 node_modules/browserify-sign/index.js create mode 100644 node_modules/browserify-sign/package.json create mode 100644 node_modules/browserify-zlib/.npmignore create mode 100644 node_modules/browserify-zlib/.travis.yml create mode 100644 node_modules/browserify-zlib/LICENSE create mode 100644 node_modules/browserify-zlib/README.md create mode 100644 node_modules/browserify-zlib/karma.conf.js create mode 100644 node_modules/browserify-zlib/lib/binding.js create mode 100644 node_modules/browserify-zlib/lib/index.js create mode 100644 node_modules/browserify-zlib/package.json create mode 100644 node_modules/browserify-zlib/src/binding.js create mode 100644 node_modules/browserify-zlib/src/index.js create mode 100644 node_modules/browserify-zlib/yarn.lock create mode 100644 node_modules/buffer-equal/.travis.yml create mode 100644 node_modules/buffer-equal/LICENSE create mode 100644 node_modules/buffer-equal/README.markdown create mode 100644 node_modules/buffer-equal/example/eq.js create mode 100644 node_modules/buffer-equal/index.js create mode 100644 node_modules/buffer-equal/package.json create mode 100644 node_modules/buffer-equal/test/eq.js create mode 100644 node_modules/buffer-from/LICENSE create mode 100644 node_modules/buffer-from/index.js create mode 100644 node_modules/buffer-from/package.json create mode 100644 node_modules/buffer-from/readme.md create mode 100644 node_modules/buffer-xor/.npmignore create mode 100644 node_modules/buffer-xor/.travis.yml create mode 100644 node_modules/buffer-xor/LICENSE create mode 100644 node_modules/buffer-xor/README.md create mode 100644 node_modules/buffer-xor/index.js create mode 100644 node_modules/buffer-xor/inline.js create mode 100644 node_modules/buffer-xor/inplace.js create mode 100644 node_modules/buffer-xor/package.json create mode 100644 node_modules/buffer-xor/test/fixtures.json create mode 100644 node_modules/buffer-xor/test/index.js create mode 100644 node_modules/buffer/.travis.yml create mode 100644 node_modules/buffer/AUTHORS.md create mode 100644 node_modules/buffer/LICENSE create mode 100644 node_modules/buffer/README.md create mode 100755 node_modules/buffer/bin/download-node-tests.js create mode 100644 node_modules/buffer/bin/test.js create mode 100755 node_modules/buffer/bin/update-authors.sh create mode 100644 node_modules/buffer/bin/zuul-es5.yml create mode 100644 node_modules/buffer/bin/zuul-es6.yml create mode 100644 node_modules/buffer/index.js create mode 100644 node_modules/buffer/package.json create mode 100644 node_modules/buffer/test/_polyfill.js create mode 100644 node_modules/buffer/test/base64.js create mode 100644 node_modules/buffer/test/basic.js create mode 100644 node_modules/buffer/test/compare.js create mode 100644 node_modules/buffer/test/constructor.js create mode 100644 node_modules/buffer/test/from-string.js create mode 100644 node_modules/buffer/test/is-buffer.js create mode 100644 node_modules/buffer/test/methods.js create mode 100644 node_modules/buffer/test/node/test-buffer-alloc.js create mode 100644 node_modules/buffer/test/node/test-buffer-arraybuffer.js create mode 100644 node_modules/buffer/test/node/test-buffer-ascii.js create mode 100644 node_modules/buffer/test/node/test-buffer-bad-overload.js create mode 100644 node_modules/buffer/test/node/test-buffer-badhex.js create mode 100644 node_modules/buffer/test/node/test-buffer-bytelength.js create mode 100644 node_modules/buffer/test/node/test-buffer-compare-offset.js create mode 100644 node_modules/buffer/test/node/test-buffer-concat.js create mode 100644 node_modules/buffer/test/node/test-buffer-fill.js create mode 100644 node_modules/buffer/test/node/test-buffer-includes.js create mode 100644 node_modules/buffer/test/node/test-buffer-indexof.js create mode 100644 node_modules/buffer/test/node/test-buffer-inheritance.js create mode 100644 node_modules/buffer/test/node/test-buffer-inspect.js create mode 100644 node_modules/buffer/test/node/test-buffer-iterator.js create mode 100644 node_modules/buffer/test/node/test-buffer-safe-unsafe.js create mode 100644 node_modules/buffer/test/node/test-buffer-slow.js create mode 100644 node_modules/buffer/test/node/test-buffer-swap.js create mode 100644 node_modules/buffer/test/node/test-buffer-zero-fill-cli.js create mode 100644 node_modules/buffer/test/node/test-buffer-zero-fill-reset.js create mode 100644 node_modules/buffer/test/node/test-buffer.js create mode 100644 node_modules/buffer/test/slice.js create mode 100644 node_modules/buffer/test/static.js create mode 100644 node_modules/buffer/test/to-string.js create mode 100644 node_modules/buffer/test/write.js create mode 100644 node_modules/buffer/test/write_infinity.js create mode 100644 node_modules/builtin-status-codes/browser.js create mode 100644 node_modules/builtin-status-codes/build.js create mode 100644 node_modules/builtin-status-codes/index.js create mode 100644 node_modules/builtin-status-codes/license create mode 100644 node_modules/builtin-status-codes/package.json create mode 100644 node_modules/builtin-status-codes/readme.md create mode 100644 node_modules/cacache/CHANGELOG.md create mode 100644 node_modules/cacache/LICENSE.md create mode 100644 node_modules/cacache/README.es.md create mode 100644 node_modules/cacache/README.md create mode 100644 node_modules/cacache/en.js create mode 100644 node_modules/cacache/es.js create mode 100644 node_modules/cacache/get.js create mode 100644 node_modules/cacache/index.js create mode 100644 node_modules/cacache/lib/content/path.js create mode 100644 node_modules/cacache/lib/content/read.js create mode 100644 node_modules/cacache/lib/content/rm.js create mode 100644 node_modules/cacache/lib/content/write.js create mode 100644 node_modules/cacache/lib/entry-index.js create mode 100644 node_modules/cacache/lib/memoization.js create mode 100644 node_modules/cacache/lib/util/fix-owner.js create mode 100644 node_modules/cacache/lib/util/hash-to-segments.js create mode 100644 node_modules/cacache/lib/util/move-file.js create mode 100644 node_modules/cacache/lib/util/tmp.js create mode 100644 node_modules/cacache/lib/util/y.js create mode 100644 node_modules/cacache/lib/verify.js create mode 100644 node_modules/cacache/locales/en.js create mode 100644 node_modules/cacache/locales/en.json create mode 100644 node_modules/cacache/locales/es.js create mode 100644 node_modules/cacache/locales/es.json create mode 100644 node_modules/cacache/ls.js create mode 100644 node_modules/cacache/package.json create mode 100644 node_modules/cacache/put.js create mode 100644 node_modules/cacache/rm.js create mode 100644 node_modules/cacache/verify.js create mode 100644 node_modules/cache-base/LICENSE create mode 100644 node_modules/cache-base/README.md create mode 100644 node_modules/cache-base/index.js create mode 100644 node_modules/cache-base/package.json create mode 100644 node_modules/camelcase/index.d.ts create mode 100644 node_modules/camelcase/index.js create mode 100644 node_modules/camelcase/license create mode 100644 node_modules/camelcase/package.json create mode 100644 node_modules/camelcase/readme.md create mode 100644 node_modules/chalk/index.js create mode 100644 node_modules/chalk/index.js.flow create mode 100644 node_modules/chalk/license create mode 100644 node_modules/chalk/node_modules/supports-color/browser.js create mode 100644 node_modules/chalk/node_modules/supports-color/index.js create mode 100644 node_modules/chalk/node_modules/supports-color/license create mode 100644 node_modules/chalk/node_modules/supports-color/package.json create mode 100644 node_modules/chalk/node_modules/supports-color/readme.md create mode 100644 node_modules/chalk/package.json create mode 100644 node_modules/chalk/readme.md create mode 100644 node_modules/chalk/templates.js create mode 100644 node_modules/chalk/types/index.d.ts create mode 100644 node_modules/chokidar/CHANGELOG.md create mode 100644 node_modules/chokidar/README.md create mode 100644 node_modules/chokidar/index.js create mode 100644 node_modules/chokidar/lib/fsevents-handler.js create mode 100644 node_modules/chokidar/lib/nodefs-handler.js create mode 100644 node_modules/chokidar/package.json create mode 100644 node_modules/chokidar/types/index.d.ts create mode 100644 node_modules/chownr/LICENSE create mode 100644 node_modules/chownr/README.md create mode 100644 node_modules/chownr/chownr.js create mode 100644 node_modules/chownr/package.json create mode 100644 node_modules/chrome-trace-event/.travis.yml create mode 100644 node_modules/chrome-trace-event/CHANGES.md create mode 100644 node_modules/chrome-trace-event/LICENSE.txt create mode 100644 node_modules/chrome-trace-event/Makefile create mode 100644 node_modules/chrome-trace-event/README.md create mode 100644 node_modules/chrome-trace-event/dist/trace-event.d.ts create mode 100644 node_modules/chrome-trace-event/dist/trace-event.js create mode 100644 node_modules/chrome-trace-event/dist/trace-event.js.map create mode 100644 node_modules/chrome-trace-event/package.json create mode 100644 node_modules/chrome-trace-event/tsconfig.json create mode 100644 node_modules/cipher-base/.eslintrc create mode 100644 node_modules/cipher-base/.npmignore create mode 100644 node_modules/cipher-base/.travis.yml create mode 100644 node_modules/cipher-base/LICENSE create mode 100644 node_modules/cipher-base/README.md create mode 100644 node_modules/cipher-base/index.js create mode 100644 node_modules/cipher-base/package.json create mode 100644 node_modules/cipher-base/test.js create mode 100644 node_modules/class-utils/LICENSE create mode 100644 node_modules/class-utils/README.md create mode 100644 node_modules/class-utils/index.js create mode 100644 node_modules/class-utils/node_modules/define-property/LICENSE create mode 100644 node_modules/class-utils/node_modules/define-property/README.md create mode 100644 node_modules/class-utils/node_modules/define-property/index.js create mode 100644 node_modules/class-utils/node_modules/define-property/package.json create mode 100644 node_modules/class-utils/package.json create mode 100644 node_modules/cliui/CHANGELOG.md create mode 100644 node_modules/cliui/LICENSE.txt create mode 100644 node_modules/cliui/README.md create mode 100644 node_modules/cliui/index.js create mode 100644 node_modules/cliui/package.json create mode 100644 node_modules/clone-buffer/LICENSE create mode 100644 node_modules/clone-buffer/README.md create mode 100644 node_modules/clone-buffer/index.js create mode 100644 node_modules/clone-buffer/package.json create mode 100644 node_modules/clone-stats/LICENSE.md create mode 100644 node_modules/clone-stats/README.md create mode 100644 node_modules/clone-stats/index.js create mode 100644 node_modules/clone-stats/package.json create mode 100644 node_modules/clone-stats/test.js create mode 100644 node_modules/clone/.npmignore create mode 100644 node_modules/clone/LICENSE create mode 100644 node_modules/clone/README.md create mode 100644 node_modules/clone/clone.iml create mode 100644 node_modules/clone/clone.js create mode 100644 node_modules/clone/package.json create mode 100644 node_modules/cloneable-readable/.travis.yml create mode 100644 node_modules/cloneable-readable/LICENSE create mode 100644 node_modules/cloneable-readable/README.md create mode 100644 node_modules/cloneable-readable/example.js create mode 100644 node_modules/cloneable-readable/index.js create mode 100644 node_modules/cloneable-readable/package.json create mode 100644 node_modules/cloneable-readable/test.js create mode 100644 node_modules/code-point-at/index.js create mode 100644 node_modules/code-point-at/license create mode 100644 node_modules/code-point-at/package.json create mode 100644 node_modules/code-point-at/readme.md create mode 100644 node_modules/collection-map/LICENSE create mode 100644 node_modules/collection-map/README.md create mode 100644 node_modules/collection-map/index.js create mode 100644 node_modules/collection-map/package.json create mode 100644 node_modules/collection-visit/LICENSE create mode 100644 node_modules/collection-visit/README.md create mode 100644 node_modules/collection-visit/index.js create mode 100644 node_modules/collection-visit/package.json create mode 100644 node_modules/color-convert/CHANGELOG.md create mode 100644 node_modules/color-convert/LICENSE create mode 100644 node_modules/color-convert/README.md create mode 100644 node_modules/color-convert/conversions.js create mode 100644 node_modules/color-convert/index.js create mode 100644 node_modules/color-convert/package.json create mode 100644 node_modules/color-convert/route.js create mode 100644 node_modules/color-name/.eslintrc.json create mode 100644 node_modules/color-name/.npmignore create mode 100644 node_modules/color-name/LICENSE create mode 100644 node_modules/color-name/README.md create mode 100644 node_modules/color-name/index.js create mode 100644 node_modules/color-name/package.json create mode 100644 node_modules/color-name/test.js create mode 100644 node_modules/color-support/LICENSE create mode 100644 node_modules/color-support/README.md create mode 100755 node_modules/color-support/bin.js create mode 100644 node_modules/color-support/browser.js create mode 100644 node_modules/color-support/index.js create mode 100644 node_modules/color-support/package.json create mode 100644 node_modules/commander/CHANGELOG.md create mode 100644 node_modules/commander/LICENSE create mode 100644 node_modules/commander/Readme.md create mode 100644 node_modules/commander/index.js create mode 100644 node_modules/commander/package.json create mode 100644 node_modules/commander/typings/index.d.ts create mode 100644 node_modules/commondir/LICENSE create mode 100644 node_modules/commondir/example/dir.js create mode 100644 node_modules/commondir/index.js create mode 100644 node_modules/commondir/package.json create mode 100644 node_modules/commondir/readme.markdown create mode 100644 node_modules/commondir/test/dirs.js create mode 100644 node_modules/component-emitter/History.md create mode 100644 node_modules/component-emitter/LICENSE create mode 100644 node_modules/component-emitter/Readme.md create mode 100644 node_modules/component-emitter/index.js create mode 100644 node_modules/component-emitter/package.json create mode 100644 node_modules/concat-map/.travis.yml create mode 100644 node_modules/concat-map/LICENSE create mode 100644 node_modules/concat-map/README.markdown create mode 100644 node_modules/concat-map/example/map.js create mode 100644 node_modules/concat-map/index.js create mode 100644 node_modules/concat-map/package.json create mode 100644 node_modules/concat-map/test/map.js create mode 100644 node_modules/concat-stream/LICENSE create mode 100644 node_modules/concat-stream/index.js create mode 100644 node_modules/concat-stream/package.json create mode 100644 node_modules/concat-stream/readme.md create mode 100644 node_modules/console-browserify/.testem.json create mode 100644 node_modules/console-browserify/.travis.yml create mode 100644 node_modules/console-browserify/CHANGELOG.md create mode 100644 node_modules/console-browserify/LICENCE create mode 100644 node_modules/console-browserify/README.md create mode 100644 node_modules/console-browserify/index.js create mode 100644 node_modules/console-browserify/package.json create mode 100644 node_modules/console-browserify/test/index.js create mode 100644 node_modules/console-browserify/test/static/index.html create mode 100644 node_modules/console-browserify/test/static/test-adapter.js create mode 100644 node_modules/constants-browserify/README.md create mode 100755 node_modules/constants-browserify/build.sh create mode 100644 node_modules/constants-browserify/constants.json create mode 100644 node_modules/constants-browserify/package.json create mode 100644 node_modules/constants-browserify/test.js create mode 100644 node_modules/convert-source-map/LICENSE create mode 100644 node_modules/convert-source-map/README.md create mode 100644 node_modules/convert-source-map/index.js create mode 100644 node_modules/convert-source-map/package.json create mode 100644 node_modules/copy-concurrently/LICENSE create mode 100644 node_modules/copy-concurrently/README.md create mode 100644 node_modules/copy-concurrently/README.md~ create mode 100644 node_modules/copy-concurrently/copy.js create mode 100644 node_modules/copy-concurrently/is-windows.js create mode 100644 node_modules/copy-concurrently/package.json create mode 100644 node_modules/copy-descriptor/LICENSE create mode 100644 node_modules/copy-descriptor/index.js create mode 100644 node_modules/copy-descriptor/package.json create mode 100644 node_modules/copy-props/LICENSE create mode 100644 node_modules/copy-props/README.md create mode 100644 node_modules/copy-props/index.js create mode 100644 node_modules/copy-props/package.json create mode 100644 node_modules/core-util-is/LICENSE create mode 100644 node_modules/core-util-is/README.md create mode 100644 node_modules/core-util-is/float.patch create mode 100644 node_modules/core-util-is/lib/util.js create mode 100644 node_modules/core-util-is/package.json create mode 100644 node_modules/core-util-is/test.js create mode 100644 node_modules/create-ecdh/.travis.yml create mode 100644 node_modules/create-ecdh/LICENSE create mode 100644 node_modules/create-ecdh/browser.js create mode 100644 node_modules/create-ecdh/index.js create mode 100644 node_modules/create-ecdh/package.json create mode 100644 node_modules/create-ecdh/readme.md create mode 100644 node_modules/create-hash/.travis.yml create mode 100644 node_modules/create-hash/LICENSE create mode 100644 node_modules/create-hash/README.md create mode 100644 node_modules/create-hash/browser.js create mode 100644 node_modules/create-hash/index.js create mode 100644 node_modules/create-hash/md5.js create mode 100644 node_modules/create-hash/package.json create mode 100644 node_modules/create-hash/test.js create mode 100644 node_modules/create-hmac/LICENSE create mode 100644 node_modules/create-hmac/README.md create mode 100644 node_modules/create-hmac/browser.js create mode 100644 node_modules/create-hmac/index.js create mode 100644 node_modules/create-hmac/legacy.js create mode 100644 node_modules/create-hmac/package.json create mode 100644 node_modules/cross-spawn/CHANGELOG.md create mode 100644 node_modules/cross-spawn/LICENSE create mode 100644 node_modules/cross-spawn/README.md create mode 100644 node_modules/cross-spawn/index.js create mode 100644 node_modules/cross-spawn/lib/enoent.js create mode 100644 node_modules/cross-spawn/lib/parse.js create mode 100644 node_modules/cross-spawn/lib/util/escape.js create mode 100644 node_modules/cross-spawn/lib/util/readShebang.js create mode 100644 node_modules/cross-spawn/lib/util/resolveCommand.js create mode 100644 node_modules/cross-spawn/package.json create mode 100644 node_modules/crypto-browserify/.travis.yml create mode 100644 node_modules/crypto-browserify/.zuul.yml create mode 100644 node_modules/crypto-browserify/LICENSE create mode 100644 node_modules/crypto-browserify/README.md create mode 100644 node_modules/crypto-browserify/example/bundle.js create mode 100644 node_modules/crypto-browserify/example/index.html create mode 100644 node_modules/crypto-browserify/example/test.js create mode 100644 node_modules/crypto-browserify/index.js create mode 100644 node_modules/crypto-browserify/package.json create mode 100644 node_modules/crypto-browserify/test/aes.js create mode 100644 node_modules/crypto-browserify/test/create-hash.js create mode 100644 node_modules/crypto-browserify/test/create-hmac.js create mode 100644 node_modules/crypto-browserify/test/dh.js create mode 100644 node_modules/crypto-browserify/test/ecdh.js create mode 100644 node_modules/crypto-browserify/test/index.js create mode 100644 node_modules/crypto-browserify/test/node/dh.js create mode 100644 node_modules/crypto-browserify/test/pbkdf2.js create mode 100644 node_modules/crypto-browserify/test/public-encrypt.js create mode 100644 node_modules/crypto-browserify/test/random-bytes.js create mode 100644 node_modules/crypto-browserify/test/random-fill.js create mode 100644 node_modules/crypto-browserify/test/sign.js create mode 100644 node_modules/cyclist/.npmignore create mode 100644 node_modules/cyclist/.travis.yml create mode 100644 node_modules/cyclist/LICENSE create mode 100644 node_modules/cyclist/README.md create mode 100644 node_modules/cyclist/index.js create mode 100644 node_modules/cyclist/package.json create mode 100644 node_modules/cyclist/test.js create mode 100755 node_modules/d/.editorconfig create mode 100644 node_modules/d/.github/FUNDING.yml create mode 100644 node_modules/d/CHANGELOG.md create mode 100644 node_modules/d/CHANGES create mode 100644 node_modules/d/LICENSE create mode 100644 node_modules/d/README.md create mode 100644 node_modules/d/auto-bind.js create mode 100644 node_modules/d/index.js create mode 100644 node_modules/d/lazy.js create mode 100644 node_modules/d/package.json create mode 100644 node_modules/d/test/auto-bind.js create mode 100644 node_modules/d/test/index.js create mode 100644 node_modules/d/test/lazy.js create mode 100644 node_modules/debug/.coveralls.yml create mode 100644 node_modules/debug/.eslintrc create mode 100644 node_modules/debug/.npmignore create mode 100644 node_modules/debug/.travis.yml create mode 100644 node_modules/debug/CHANGELOG.md create mode 100644 node_modules/debug/LICENSE create mode 100644 node_modules/debug/Makefile create mode 100644 node_modules/debug/README.md create mode 100644 node_modules/debug/component.json create mode 100644 node_modules/debug/karma.conf.js create mode 100644 node_modules/debug/node.js create mode 100644 node_modules/debug/package.json create mode 100644 node_modules/debug/src/browser.js create mode 100644 node_modules/debug/src/debug.js create mode 100644 node_modules/debug/src/index.js create mode 100644 node_modules/debug/src/inspector-log.js create mode 100644 node_modules/debug/src/node.js create mode 100644 node_modules/decamelize/index.js create mode 100644 node_modules/decamelize/license create mode 100644 node_modules/decamelize/package.json create mode 100644 node_modules/decamelize/readme.md create mode 100644 node_modules/decode-uri-component/index.js create mode 100644 node_modules/decode-uri-component/license create mode 100644 node_modules/decode-uri-component/package.json create mode 100644 node_modules/decode-uri-component/readme.md create mode 100644 node_modules/default-compare/LICENSE create mode 100644 node_modules/default-compare/README.md create mode 100644 node_modules/default-compare/index.js create mode 100644 node_modules/default-compare/node_modules/kind-of/LICENSE create mode 100644 node_modules/default-compare/node_modules/kind-of/README.md create mode 100644 node_modules/default-compare/node_modules/kind-of/index.js create mode 100644 node_modules/default-compare/node_modules/kind-of/package.json create mode 100644 node_modules/default-compare/package.json create mode 100644 node_modules/default-resolution/LICENSE create mode 100644 node_modules/default-resolution/README.md create mode 100644 node_modules/default-resolution/index.js create mode 100644 node_modules/default-resolution/node-version.js create mode 100644 node_modules/default-resolution/package.json create mode 100644 node_modules/define-properties/.editorconfig create mode 100644 node_modules/define-properties/.eslintrc create mode 100644 node_modules/define-properties/.jscs.json create mode 100644 node_modules/define-properties/.travis.yml create mode 100644 node_modules/define-properties/CHANGELOG.md create mode 100644 node_modules/define-properties/LICENSE create mode 100644 node_modules/define-properties/README.md create mode 100644 node_modules/define-properties/index.js create mode 100644 node_modules/define-properties/package.json create mode 100644 node_modules/define-properties/test/index.js create mode 100644 node_modules/define-property/CHANGELOG.md create mode 100644 node_modules/define-property/LICENSE create mode 100644 node_modules/define-property/README.md create mode 100644 node_modules/define-property/index.js create mode 100644 node_modules/define-property/node_modules/is-accessor-descriptor/LICENSE create mode 100644 node_modules/define-property/node_modules/is-accessor-descriptor/README.md create mode 100644 node_modules/define-property/node_modules/is-accessor-descriptor/index.js create mode 100644 node_modules/define-property/node_modules/is-accessor-descriptor/package.json create mode 100644 node_modules/define-property/node_modules/is-data-descriptor/LICENSE create mode 100644 node_modules/define-property/node_modules/is-data-descriptor/README.md create mode 100644 node_modules/define-property/node_modules/is-data-descriptor/index.js create mode 100644 node_modules/define-property/node_modules/is-data-descriptor/package.json create mode 100644 node_modules/define-property/node_modules/is-descriptor/LICENSE create mode 100644 node_modules/define-property/node_modules/is-descriptor/README.md create mode 100644 node_modules/define-property/node_modules/is-descriptor/index.js create mode 100644 node_modules/define-property/node_modules/is-descriptor/package.json create mode 100644 node_modules/define-property/package.json create mode 100644 node_modules/des.js/.jscsrc create mode 100644 node_modules/des.js/.jshintrc create mode 100644 node_modules/des.js/README.md create mode 100644 node_modules/des.js/lib/des.js create mode 100644 node_modules/des.js/lib/des/cbc.js create mode 100644 node_modules/des.js/lib/des/cipher.js create mode 100644 node_modules/des.js/lib/des/des.js create mode 100644 node_modules/des.js/lib/des/ede.js create mode 100644 node_modules/des.js/lib/des/utils.js create mode 100644 node_modules/des.js/package.json create mode 100644 node_modules/des.js/test/cbc-test.js create mode 100644 node_modules/des.js/test/des-test.js create mode 100644 node_modules/des.js/test/ede-test.js create mode 100644 node_modules/des.js/test/fixtures.js create mode 100644 node_modules/des.js/test/utils-test.js create mode 100644 node_modules/detect-file/LICENSE create mode 100644 node_modules/detect-file/README.md create mode 100644 node_modules/detect-file/index.js create mode 100644 node_modules/detect-file/package.json create mode 100644 node_modules/diffie-hellman/.travis.yml create mode 100644 node_modules/diffie-hellman/LICENSE create mode 100644 node_modules/diffie-hellman/browser.js create mode 100644 node_modules/diffie-hellman/index.js create mode 100644 node_modules/diffie-hellman/lib/dh.js create mode 100644 node_modules/diffie-hellman/lib/generatePrime.js create mode 100644 node_modules/diffie-hellman/lib/primes.json create mode 100644 node_modules/diffie-hellman/package.json create mode 100644 node_modules/diffie-hellman/readme.md create mode 100644 node_modules/domain-browser/HISTORY.md create mode 100644 node_modules/domain-browser/LICENSE.md create mode 100644 node_modules/domain-browser/README.md create mode 100644 node_modules/domain-browser/package.json create mode 100644 node_modules/domain-browser/source/index.js create mode 100644 node_modules/duplexify/.travis.yml create mode 100644 node_modules/duplexify/LICENSE create mode 100644 node_modules/duplexify/README.md create mode 100644 node_modules/duplexify/example.js create mode 100644 node_modules/duplexify/index.js create mode 100644 node_modules/duplexify/package.json create mode 100644 node_modules/duplexify/test.js create mode 100644 node_modules/each-props/LICENSE create mode 100644 node_modules/each-props/README.md create mode 100644 node_modules/each-props/index.js create mode 100644 node_modules/each-props/package.json create mode 100644 node_modules/elliptic/README.md create mode 100644 node_modules/elliptic/lib/elliptic.js create mode 100644 node_modules/elliptic/lib/elliptic/curve/base.js create mode 100644 node_modules/elliptic/lib/elliptic/curve/edwards.js create mode 100644 node_modules/elliptic/lib/elliptic/curve/index.js create mode 100644 node_modules/elliptic/lib/elliptic/curve/mont.js create mode 100644 node_modules/elliptic/lib/elliptic/curve/short.js create mode 100644 node_modules/elliptic/lib/elliptic/curves.js create mode 100644 node_modules/elliptic/lib/elliptic/ec/index.js create mode 100644 node_modules/elliptic/lib/elliptic/ec/key.js create mode 100644 node_modules/elliptic/lib/elliptic/ec/signature.js create mode 100644 node_modules/elliptic/lib/elliptic/eddsa/index.js create mode 100644 node_modules/elliptic/lib/elliptic/eddsa/key.js create mode 100644 node_modules/elliptic/lib/elliptic/eddsa/signature.js create mode 100644 node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js create mode 100644 node_modules/elliptic/lib/elliptic/utils.js create mode 100644 node_modules/elliptic/package.json create mode 100644 node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 node_modules/emoji-regex/README.md create mode 100644 node_modules/emoji-regex/es2015/index.js create mode 100644 node_modules/emoji-regex/es2015/text.js create mode 100644 node_modules/emoji-regex/index.d.ts create mode 100644 node_modules/emoji-regex/index.js create mode 100644 node_modules/emoji-regex/package.json create mode 100644 node_modules/emoji-regex/text.js create mode 100644 node_modules/emojis-list/CHANGELOG.md create mode 100755 node_modules/emojis-list/LICENSE.md create mode 100755 node_modules/emojis-list/README.md create mode 100644 node_modules/emojis-list/index.js create mode 100644 node_modules/emojis-list/package.json create mode 100644 node_modules/end-of-stream/LICENSE create mode 100644 node_modules/end-of-stream/README.md create mode 100644 node_modules/end-of-stream/index.js create mode 100644 node_modules/end-of-stream/package.json create mode 100644 node_modules/enhanced-resolve/LICENSE create mode 100644 node_modules/enhanced-resolve/README.md create mode 100644 node_modules/enhanced-resolve/lib/AliasFieldPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/AliasPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/AppendPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/CachedInputFileSystem.js create mode 100644 node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js create mode 100644 node_modules/enhanced-resolve/lib/ConcordExtensionsPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/ConcordMainPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/ConcordModulesPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js create mode 100644 node_modules/enhanced-resolve/lib/DescriptionFileUtils.js create mode 100644 node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/FileExistsPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/FileKindPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/JoinRequestPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/LogInfoPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/MainFieldPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/ModuleAppendPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/ModuleKindPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/NextPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/NodeJsInputFileSystem.js create mode 100644 node_modules/enhanced-resolve/lib/ParsePlugin.js create mode 100644 node_modules/enhanced-resolve/lib/Resolver.js create mode 100644 node_modules/enhanced-resolve/lib/ResolverFactory.js create mode 100644 node_modules/enhanced-resolve/lib/ResultPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/SymlinkPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js create mode 100644 node_modules/enhanced-resolve/lib/TryNextPlugin.js create mode 100644 node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js create mode 100644 node_modules/enhanced-resolve/lib/UseFilePlugin.js create mode 100644 node_modules/enhanced-resolve/lib/concord.js create mode 100644 node_modules/enhanced-resolve/lib/createInnerCallback.js create mode 100644 node_modules/enhanced-resolve/lib/createInnerContext.js create mode 100644 node_modules/enhanced-resolve/lib/forEachBail.js create mode 100644 node_modules/enhanced-resolve/lib/getInnerRequest.js create mode 100644 node_modules/enhanced-resolve/lib/getPaths.js create mode 100644 node_modules/enhanced-resolve/lib/globToRegExp.js create mode 100644 node_modules/enhanced-resolve/lib/node.js create mode 100644 node_modules/enhanced-resolve/node_modules/memory-fs/LICENSE create mode 100644 node_modules/enhanced-resolve/node_modules/memory-fs/README.md create mode 100644 node_modules/enhanced-resolve/node_modules/memory-fs/lib/MemoryFileSystem.js create mode 100644 node_modules/enhanced-resolve/node_modules/memory-fs/lib/MemoryFileSystemError.js create mode 100644 node_modules/enhanced-resolve/node_modules/memory-fs/lib/join.js create mode 100644 node_modules/enhanced-resolve/node_modules/memory-fs/lib/normalize.js create mode 100644 node_modules/enhanced-resolve/node_modules/memory-fs/package.json create mode 100644 node_modules/enhanced-resolve/package.json create mode 100644 node_modules/errno/.jshintrc create mode 100644 node_modules/errno/.travis.yml create mode 100644 node_modules/errno/README.md create mode 100755 node_modules/errno/build.js create mode 100755 node_modules/errno/cli.js create mode 100644 node_modules/errno/custom.js create mode 100644 node_modules/errno/errno.js create mode 100644 node_modules/errno/package.json create mode 100644 node_modules/errno/test.js create mode 100644 node_modules/error-ex/LICENSE create mode 100644 node_modules/error-ex/README.md create mode 100644 node_modules/error-ex/index.js create mode 100644 node_modules/error-ex/package.json create mode 100644 node_modules/es5-ext/.editorconfig create mode 100644 node_modules/es5-ext/.github/FUNDING.yml create mode 100644 node_modules/es5-ext/CHANGELOG.md create mode 100644 node_modules/es5-ext/CHANGES create mode 100644 node_modules/es5-ext/LICENSE create mode 100644 node_modules/es5-ext/README.md create mode 100644 node_modules/es5-ext/array/#/@@iterator/implement.js create mode 100644 node_modules/es5-ext/array/#/@@iterator/index.js create mode 100644 node_modules/es5-ext/array/#/@@iterator/is-implemented.js create mode 100644 node_modules/es5-ext/array/#/@@iterator/shim.js create mode 100644 node_modules/es5-ext/array/#/_compare-by-length.js create mode 100644 node_modules/es5-ext/array/#/binary-search.js create mode 100644 node_modules/es5-ext/array/#/clear.js create mode 100644 node_modules/es5-ext/array/#/compact.js create mode 100644 node_modules/es5-ext/array/#/concat/implement.js create mode 100644 node_modules/es5-ext/array/#/concat/index.js create mode 100644 node_modules/es5-ext/array/#/concat/is-implemented.js create mode 100644 node_modules/es5-ext/array/#/concat/shim.js create mode 100644 node_modules/es5-ext/array/#/contains.js create mode 100644 node_modules/es5-ext/array/#/copy-within/implement.js create mode 100644 node_modules/es5-ext/array/#/copy-within/index.js create mode 100644 node_modules/es5-ext/array/#/copy-within/is-implemented.js create mode 100644 node_modules/es5-ext/array/#/copy-within/shim.js create mode 100644 node_modules/es5-ext/array/#/diff.js create mode 100644 node_modules/es5-ext/array/#/e-index-of.js create mode 100644 node_modules/es5-ext/array/#/e-last-index-of.js create mode 100644 node_modules/es5-ext/array/#/entries/implement.js create mode 100644 node_modules/es5-ext/array/#/entries/index.js create mode 100644 node_modules/es5-ext/array/#/entries/is-implemented.js create mode 100644 node_modules/es5-ext/array/#/entries/shim.js create mode 100644 node_modules/es5-ext/array/#/exclusion.js create mode 100644 node_modules/es5-ext/array/#/fill/implement.js create mode 100644 node_modules/es5-ext/array/#/fill/index.js create mode 100644 node_modules/es5-ext/array/#/fill/is-implemented.js create mode 100644 node_modules/es5-ext/array/#/fill/shim.js create mode 100644 node_modules/es5-ext/array/#/filter/implement.js create mode 100644 node_modules/es5-ext/array/#/filter/index.js create mode 100644 node_modules/es5-ext/array/#/filter/is-implemented.js create mode 100644 node_modules/es5-ext/array/#/filter/shim.js create mode 100644 node_modules/es5-ext/array/#/find-index/implement.js create mode 100644 node_modules/es5-ext/array/#/find-index/index.js create mode 100644 node_modules/es5-ext/array/#/find-index/is-implemented.js create mode 100644 node_modules/es5-ext/array/#/find-index/shim.js create mode 100644 node_modules/es5-ext/array/#/find/implement.js create mode 100644 node_modules/es5-ext/array/#/find/index.js create mode 100644 node_modules/es5-ext/array/#/find/is-implemented.js create mode 100644 node_modules/es5-ext/array/#/find/shim.js create mode 100644 node_modules/es5-ext/array/#/first-index.js create mode 100644 node_modules/es5-ext/array/#/first.js create mode 100644 node_modules/es5-ext/array/#/flatten.js create mode 100644 node_modules/es5-ext/array/#/for-each-right.js create mode 100644 node_modules/es5-ext/array/#/group.js create mode 100644 node_modules/es5-ext/array/#/index.js create mode 100644 node_modules/es5-ext/array/#/indexes-of.js create mode 100644 node_modules/es5-ext/array/#/intersection.js create mode 100644 node_modules/es5-ext/array/#/is-copy.js create mode 100644 node_modules/es5-ext/array/#/is-empty.js create mode 100644 node_modules/es5-ext/array/#/is-uniq.js create mode 100644 node_modules/es5-ext/array/#/keys/implement.js create mode 100644 node_modules/es5-ext/array/#/keys/index.js create mode 100644 node_modules/es5-ext/array/#/keys/is-implemented.js create mode 100644 node_modules/es5-ext/array/#/keys/shim.js create mode 100644 node_modules/es5-ext/array/#/last-index.js create mode 100644 node_modules/es5-ext/array/#/last.js create mode 100644 node_modules/es5-ext/array/#/map/implement.js create mode 100644 node_modules/es5-ext/array/#/map/index.js create mode 100644 node_modules/es5-ext/array/#/map/is-implemented.js create mode 100644 node_modules/es5-ext/array/#/map/shim.js create mode 100644 node_modules/es5-ext/array/#/remove.js create mode 100644 node_modules/es5-ext/array/#/separate.js create mode 100644 node_modules/es5-ext/array/#/slice/implement.js create mode 100644 node_modules/es5-ext/array/#/slice/index.js create mode 100644 node_modules/es5-ext/array/#/slice/is-implemented.js create mode 100644 node_modules/es5-ext/array/#/slice/shim.js create mode 100644 node_modules/es5-ext/array/#/some-right.js create mode 100644 node_modules/es5-ext/array/#/splice/implement.js create mode 100644 node_modules/es5-ext/array/#/splice/index.js create mode 100644 node_modules/es5-ext/array/#/splice/is-implemented.js create mode 100644 node_modules/es5-ext/array/#/splice/shim.js create mode 100644 node_modules/es5-ext/array/#/uniq.js create mode 100644 node_modules/es5-ext/array/#/values/implement.js create mode 100644 node_modules/es5-ext/array/#/values/index.js create mode 100644 node_modules/es5-ext/array/#/values/is-implemented.js create mode 100644 node_modules/es5-ext/array/#/values/shim.js create mode 100644 node_modules/es5-ext/array/_is-extensible.js create mode 100644 node_modules/es5-ext/array/_sub-array-dummy-safe.js create mode 100644 node_modules/es5-ext/array/_sub-array-dummy.js create mode 100644 node_modules/es5-ext/array/from/implement.js create mode 100644 node_modules/es5-ext/array/from/index.js create mode 100644 node_modules/es5-ext/array/from/is-implemented.js create mode 100644 node_modules/es5-ext/array/from/shim.js create mode 100644 node_modules/es5-ext/array/generate.js create mode 100644 node_modules/es5-ext/array/index.js create mode 100644 node_modules/es5-ext/array/is-plain-array.js create mode 100644 node_modules/es5-ext/array/of/implement.js create mode 100644 node_modules/es5-ext/array/of/index.js create mode 100644 node_modules/es5-ext/array/of/is-implemented.js create mode 100644 node_modules/es5-ext/array/of/shim.js create mode 100644 node_modules/es5-ext/array/to-array.js create mode 100644 node_modules/es5-ext/array/valid-array.js create mode 100644 node_modules/es5-ext/boolean/index.js create mode 100644 node_modules/es5-ext/boolean/is-boolean.js create mode 100644 node_modules/es5-ext/date/#/copy.js create mode 100644 node_modules/es5-ext/date/#/days-in-month.js create mode 100644 node_modules/es5-ext/date/#/floor-day.js create mode 100644 node_modules/es5-ext/date/#/floor-month.js create mode 100644 node_modules/es5-ext/date/#/floor-year.js create mode 100644 node_modules/es5-ext/date/#/format.js create mode 100644 node_modules/es5-ext/date/#/index.js create mode 100644 node_modules/es5-ext/date/ensure-time-value.js create mode 100644 node_modules/es5-ext/date/index.js create mode 100644 node_modules/es5-ext/date/is-date.js create mode 100644 node_modules/es5-ext/date/is-time-value.js create mode 100644 node_modules/es5-ext/date/valid-date.js create mode 100644 node_modules/es5-ext/error/#/index.js create mode 100644 node_modules/es5-ext/error/#/throw.js create mode 100644 node_modules/es5-ext/error/custom.js create mode 100644 node_modules/es5-ext/error/index.js create mode 100644 node_modules/es5-ext/error/is-error.js create mode 100644 node_modules/es5-ext/error/valid-error.js create mode 100644 node_modules/es5-ext/function/#/compose.js create mode 100644 node_modules/es5-ext/function/#/copy.js create mode 100644 node_modules/es5-ext/function/#/curry.js create mode 100644 node_modules/es5-ext/function/#/index.js create mode 100644 node_modules/es5-ext/function/#/lock.js create mode 100644 node_modules/es5-ext/function/#/microtask-delay.js create mode 100644 node_modules/es5-ext/function/#/not.js create mode 100644 node_modules/es5-ext/function/#/partial.js create mode 100644 node_modules/es5-ext/function/#/spread.js create mode 100644 node_modules/es5-ext/function/#/to-string-tokens.js create mode 100644 node_modules/es5-ext/function/_define-length.js create mode 100644 node_modules/es5-ext/function/constant.js create mode 100644 node_modules/es5-ext/function/identity.js create mode 100644 node_modules/es5-ext/function/index.js create mode 100644 node_modules/es5-ext/function/invoke.js create mode 100644 node_modules/es5-ext/function/is-arguments.js create mode 100644 node_modules/es5-ext/function/is-function.js create mode 100644 node_modules/es5-ext/function/noop.js create mode 100644 node_modules/es5-ext/function/pluck.js create mode 100644 node_modules/es5-ext/function/valid-function.js create mode 100644 node_modules/es5-ext/global.js create mode 100644 node_modules/es5-ext/index.js create mode 100644 node_modules/es5-ext/iterable/for-each.js create mode 100644 node_modules/es5-ext/iterable/index.js create mode 100644 node_modules/es5-ext/iterable/is.js create mode 100644 node_modules/es5-ext/iterable/validate-object.js create mode 100644 node_modules/es5-ext/iterable/validate.js create mode 100644 node_modules/es5-ext/json/index.js create mode 100644 node_modules/es5-ext/json/safe-stringify.js create mode 100644 node_modules/es5-ext/math/_decimal-adjust.js create mode 100644 node_modules/es5-ext/math/_pack-ieee754.js create mode 100644 node_modules/es5-ext/math/_unpack-ieee754.js create mode 100644 node_modules/es5-ext/math/acosh/implement.js create mode 100644 node_modules/es5-ext/math/acosh/index.js create mode 100644 node_modules/es5-ext/math/acosh/is-implemented.js create mode 100644 node_modules/es5-ext/math/acosh/shim.js create mode 100644 node_modules/es5-ext/math/asinh/implement.js create mode 100644 node_modules/es5-ext/math/asinh/index.js create mode 100644 node_modules/es5-ext/math/asinh/is-implemented.js create mode 100644 node_modules/es5-ext/math/asinh/shim.js create mode 100644 node_modules/es5-ext/math/atanh/implement.js create mode 100644 node_modules/es5-ext/math/atanh/index.js create mode 100644 node_modules/es5-ext/math/atanh/is-implemented.js create mode 100644 node_modules/es5-ext/math/atanh/shim.js create mode 100644 node_modules/es5-ext/math/cbrt/implement.js create mode 100644 node_modules/es5-ext/math/cbrt/index.js create mode 100644 node_modules/es5-ext/math/cbrt/is-implemented.js create mode 100644 node_modules/es5-ext/math/cbrt/shim.js create mode 100644 node_modules/es5-ext/math/ceil-10.js create mode 100644 node_modules/es5-ext/math/clz32/implement.js create mode 100644 node_modules/es5-ext/math/clz32/index.js create mode 100644 node_modules/es5-ext/math/clz32/is-implemented.js create mode 100644 node_modules/es5-ext/math/clz32/shim.js create mode 100644 node_modules/es5-ext/math/cosh/implement.js create mode 100644 node_modules/es5-ext/math/cosh/index.js create mode 100644 node_modules/es5-ext/math/cosh/is-implemented.js create mode 100644 node_modules/es5-ext/math/cosh/shim.js create mode 100644 node_modules/es5-ext/math/expm1/implement.js create mode 100644 node_modules/es5-ext/math/expm1/index.js create mode 100644 node_modules/es5-ext/math/expm1/is-implemented.js create mode 100644 node_modules/es5-ext/math/expm1/shim.js create mode 100644 node_modules/es5-ext/math/floor-10.js create mode 100644 node_modules/es5-ext/math/fround/implement.js create mode 100644 node_modules/es5-ext/math/fround/index.js create mode 100644 node_modules/es5-ext/math/fround/is-implemented.js create mode 100644 node_modules/es5-ext/math/fround/shim.js create mode 100644 node_modules/es5-ext/math/hypot/implement.js create mode 100644 node_modules/es5-ext/math/hypot/index.js create mode 100644 node_modules/es5-ext/math/hypot/is-implemented.js create mode 100644 node_modules/es5-ext/math/hypot/shim.js create mode 100644 node_modules/es5-ext/math/imul/implement.js create mode 100644 node_modules/es5-ext/math/imul/index.js create mode 100644 node_modules/es5-ext/math/imul/is-implemented.js create mode 100644 node_modules/es5-ext/math/imul/shim.js create mode 100644 node_modules/es5-ext/math/index.js create mode 100644 node_modules/es5-ext/math/log10/implement.js create mode 100644 node_modules/es5-ext/math/log10/index.js create mode 100644 node_modules/es5-ext/math/log10/is-implemented.js create mode 100644 node_modules/es5-ext/math/log10/shim.js create mode 100644 node_modules/es5-ext/math/log1p/implement.js create mode 100644 node_modules/es5-ext/math/log1p/index.js create mode 100644 node_modules/es5-ext/math/log1p/is-implemented.js create mode 100644 node_modules/es5-ext/math/log1p/shim.js create mode 100644 node_modules/es5-ext/math/log2/implement.js create mode 100644 node_modules/es5-ext/math/log2/index.js create mode 100644 node_modules/es5-ext/math/log2/is-implemented.js create mode 100644 node_modules/es5-ext/math/log2/shim.js create mode 100644 node_modules/es5-ext/math/round-10.js create mode 100644 node_modules/es5-ext/math/sign/implement.js create mode 100644 node_modules/es5-ext/math/sign/index.js create mode 100644 node_modules/es5-ext/math/sign/is-implemented.js create mode 100644 node_modules/es5-ext/math/sign/shim.js create mode 100644 node_modules/es5-ext/math/sinh/implement.js create mode 100644 node_modules/es5-ext/math/sinh/index.js create mode 100644 node_modules/es5-ext/math/sinh/is-implemented.js create mode 100644 node_modules/es5-ext/math/sinh/shim.js create mode 100644 node_modules/es5-ext/math/tanh/implement.js create mode 100644 node_modules/es5-ext/math/tanh/index.js create mode 100644 node_modules/es5-ext/math/tanh/is-implemented.js create mode 100644 node_modules/es5-ext/math/tanh/shim.js create mode 100644 node_modules/es5-ext/math/trunc/implement.js create mode 100644 node_modules/es5-ext/math/trunc/index.js create mode 100644 node_modules/es5-ext/math/trunc/is-implemented.js create mode 100644 node_modules/es5-ext/math/trunc/shim.js create mode 100644 node_modules/es5-ext/number/#/index.js create mode 100644 node_modules/es5-ext/number/#/pad.js create mode 100644 node_modules/es5-ext/number/epsilon/implement.js create mode 100644 node_modules/es5-ext/number/epsilon/index.js create mode 100644 node_modules/es5-ext/number/epsilon/is-implemented.js create mode 100644 node_modules/es5-ext/number/index.js create mode 100644 node_modules/es5-ext/number/is-finite/implement.js create mode 100644 node_modules/es5-ext/number/is-finite/index.js create mode 100644 node_modules/es5-ext/number/is-finite/is-implemented.js create mode 100644 node_modules/es5-ext/number/is-finite/shim.js create mode 100644 node_modules/es5-ext/number/is-integer/implement.js create mode 100644 node_modules/es5-ext/number/is-integer/index.js create mode 100644 node_modules/es5-ext/number/is-integer/is-implemented.js create mode 100644 node_modules/es5-ext/number/is-integer/shim.js create mode 100644 node_modules/es5-ext/number/is-nan/implement.js create mode 100644 node_modules/es5-ext/number/is-nan/index.js create mode 100644 node_modules/es5-ext/number/is-nan/is-implemented.js create mode 100644 node_modules/es5-ext/number/is-nan/shim.js create mode 100644 node_modules/es5-ext/number/is-natural.js create mode 100644 node_modules/es5-ext/number/is-number.js create mode 100644 node_modules/es5-ext/number/is-safe-integer/implement.js create mode 100644 node_modules/es5-ext/number/is-safe-integer/index.js create mode 100644 node_modules/es5-ext/number/is-safe-integer/is-implemented.js create mode 100644 node_modules/es5-ext/number/is-safe-integer/shim.js create mode 100644 node_modules/es5-ext/number/max-safe-integer/implement.js create mode 100644 node_modules/es5-ext/number/max-safe-integer/index.js create mode 100644 node_modules/es5-ext/number/max-safe-integer/is-implemented.js create mode 100644 node_modules/es5-ext/number/min-safe-integer/implement.js create mode 100644 node_modules/es5-ext/number/min-safe-integer/index.js create mode 100644 node_modules/es5-ext/number/min-safe-integer/is-implemented.js create mode 100644 node_modules/es5-ext/number/to-integer.js create mode 100644 node_modules/es5-ext/number/to-pos-integer.js create mode 100644 node_modules/es5-ext/number/to-uint32.js create mode 100644 node_modules/es5-ext/object/_iterate.js create mode 100644 node_modules/es5-ext/object/assign-deep.js create mode 100644 node_modules/es5-ext/object/assign/implement.js create mode 100644 node_modules/es5-ext/object/assign/index.js create mode 100644 node_modules/es5-ext/object/assign/is-implemented.js create mode 100644 node_modules/es5-ext/object/assign/shim.js create mode 100644 node_modules/es5-ext/object/clear.js create mode 100644 node_modules/es5-ext/object/compact.js create mode 100644 node_modules/es5-ext/object/compare.js create mode 100644 node_modules/es5-ext/object/copy-deep.js create mode 100644 node_modules/es5-ext/object/copy.js create mode 100644 node_modules/es5-ext/object/count.js create mode 100644 node_modules/es5-ext/object/create.js create mode 100644 node_modules/es5-ext/object/ensure-array.js create mode 100644 node_modules/es5-ext/object/ensure-finite-number.js create mode 100644 node_modules/es5-ext/object/ensure-integer.js create mode 100644 node_modules/es5-ext/object/ensure-natural-number-value.js create mode 100644 node_modules/es5-ext/object/ensure-natural-number.js create mode 100644 node_modules/es5-ext/object/ensure-plain-function.js create mode 100644 node_modules/es5-ext/object/ensure-plain-object.js create mode 100644 node_modules/es5-ext/object/ensure-promise.js create mode 100644 node_modules/es5-ext/object/ensure-thenable.js create mode 100644 node_modules/es5-ext/object/entries/implement.js create mode 100644 node_modules/es5-ext/object/entries/index.js create mode 100644 node_modules/es5-ext/object/entries/is-implemented.js create mode 100644 node_modules/es5-ext/object/entries/shim.js create mode 100644 node_modules/es5-ext/object/eq.js create mode 100644 node_modules/es5-ext/object/every.js create mode 100644 node_modules/es5-ext/object/filter.js create mode 100644 node_modules/es5-ext/object/find-key.js create mode 100644 node_modules/es5-ext/object/find.js create mode 100644 node_modules/es5-ext/object/first-key.js create mode 100644 node_modules/es5-ext/object/flatten.js create mode 100644 node_modules/es5-ext/object/for-each.js create mode 100644 node_modules/es5-ext/object/get-property-names.js create mode 100644 node_modules/es5-ext/object/index.js create mode 100644 node_modules/es5-ext/object/is-array-like.js create mode 100644 node_modules/es5-ext/object/is-callable.js create mode 100644 node_modules/es5-ext/object/is-copy-deep.js create mode 100644 node_modules/es5-ext/object/is-copy.js create mode 100644 node_modules/es5-ext/object/is-empty.js create mode 100644 node_modules/es5-ext/object/is-finite-number.js create mode 100644 node_modules/es5-ext/object/is-integer.js create mode 100644 node_modules/es5-ext/object/is-natural-number-value.js create mode 100644 node_modules/es5-ext/object/is-natural-number.js create mode 100644 node_modules/es5-ext/object/is-number-value.js create mode 100644 node_modules/es5-ext/object/is-object.js create mode 100644 node_modules/es5-ext/object/is-plain-function.js create mode 100644 node_modules/es5-ext/object/is-plain-object.js create mode 100644 node_modules/es5-ext/object/is-promise.js create mode 100644 node_modules/es5-ext/object/is-thenable.js create mode 100644 node_modules/es5-ext/object/is-value.js create mode 100644 node_modules/es5-ext/object/is.js create mode 100644 node_modules/es5-ext/object/key-of.js create mode 100644 node_modules/es5-ext/object/keys/implement.js create mode 100644 node_modules/es5-ext/object/keys/index.js create mode 100644 node_modules/es5-ext/object/keys/is-implemented.js create mode 100644 node_modules/es5-ext/object/keys/shim.js create mode 100644 node_modules/es5-ext/object/map-keys.js create mode 100644 node_modules/es5-ext/object/map.js create mode 100644 node_modules/es5-ext/object/mixin-prototypes.js create mode 100644 node_modules/es5-ext/object/mixin.js create mode 100644 node_modules/es5-ext/object/normalize-options.js create mode 100644 node_modules/es5-ext/object/primitive-set.js create mode 100644 node_modules/es5-ext/object/safe-traverse.js create mode 100644 node_modules/es5-ext/object/serialize.js create mode 100644 node_modules/es5-ext/object/set-prototype-of/implement.js create mode 100644 node_modules/es5-ext/object/set-prototype-of/index.js create mode 100644 node_modules/es5-ext/object/set-prototype-of/is-implemented.js create mode 100644 node_modules/es5-ext/object/set-prototype-of/shim.js create mode 100644 node_modules/es5-ext/object/some.js create mode 100644 node_modules/es5-ext/object/to-array.js create mode 100644 node_modules/es5-ext/object/unserialize.js create mode 100644 node_modules/es5-ext/object/valid-callable.js create mode 100644 node_modules/es5-ext/object/valid-object.js create mode 100644 node_modules/es5-ext/object/valid-value.js create mode 100644 node_modules/es5-ext/object/validate-array-like-object.js create mode 100644 node_modules/es5-ext/object/validate-array-like.js create mode 100644 node_modules/es5-ext/object/validate-stringifiable-value.js create mode 100644 node_modules/es5-ext/object/validate-stringifiable.js create mode 100644 node_modules/es5-ext/optional-chaining.js create mode 100644 node_modules/es5-ext/package.json create mode 100644 node_modules/es5-ext/promise/#/as-callback.js create mode 100644 node_modules/es5-ext/promise/#/finally/implement.js create mode 100644 node_modules/es5-ext/promise/#/finally/index.js create mode 100644 node_modules/es5-ext/promise/#/finally/is-implemented.js create mode 100644 node_modules/es5-ext/promise/#/finally/shim.js create mode 100644 node_modules/es5-ext/promise/#/index.js create mode 100644 node_modules/es5-ext/promise/.eslintrc.json create mode 100644 node_modules/es5-ext/promise/index.js create mode 100644 node_modules/es5-ext/promise/lazy.js create mode 100644 node_modules/es5-ext/reg-exp/#/index.js create mode 100644 node_modules/es5-ext/reg-exp/#/is-sticky.js create mode 100644 node_modules/es5-ext/reg-exp/#/is-unicode.js create mode 100644 node_modules/es5-ext/reg-exp/#/match/implement.js create mode 100644 node_modules/es5-ext/reg-exp/#/match/index.js create mode 100644 node_modules/es5-ext/reg-exp/#/match/is-implemented.js create mode 100644 node_modules/es5-ext/reg-exp/#/match/shim.js create mode 100644 node_modules/es5-ext/reg-exp/#/replace/implement.js create mode 100644 node_modules/es5-ext/reg-exp/#/replace/index.js create mode 100644 node_modules/es5-ext/reg-exp/#/replace/is-implemented.js create mode 100644 node_modules/es5-ext/reg-exp/#/replace/shim.js create mode 100644 node_modules/es5-ext/reg-exp/#/search/implement.js create mode 100644 node_modules/es5-ext/reg-exp/#/search/index.js create mode 100644 node_modules/es5-ext/reg-exp/#/search/is-implemented.js create mode 100644 node_modules/es5-ext/reg-exp/#/search/shim.js create mode 100644 node_modules/es5-ext/reg-exp/#/split/implement.js create mode 100644 node_modules/es5-ext/reg-exp/#/split/index.js create mode 100644 node_modules/es5-ext/reg-exp/#/split/is-implemented.js create mode 100644 node_modules/es5-ext/reg-exp/#/split/shim.js create mode 100644 node_modules/es5-ext/reg-exp/#/sticky/implement.js create mode 100644 node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js create mode 100644 node_modules/es5-ext/reg-exp/#/unicode/implement.js create mode 100644 node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js create mode 100644 node_modules/es5-ext/reg-exp/escape.js create mode 100644 node_modules/es5-ext/reg-exp/index.js create mode 100644 node_modules/es5-ext/reg-exp/is-reg-exp.js create mode 100644 node_modules/es5-ext/reg-exp/valid-reg-exp.js create mode 100644 node_modules/es5-ext/safe-to-string.js create mode 100644 node_modules/es5-ext/string/#/@@iterator/implement.js create mode 100644 node_modules/es5-ext/string/#/@@iterator/index.js create mode 100644 node_modules/es5-ext/string/#/@@iterator/is-implemented.js create mode 100644 node_modules/es5-ext/string/#/@@iterator/shim.js create mode 100644 node_modules/es5-ext/string/#/at.js create mode 100644 node_modules/es5-ext/string/#/camel-to-hyphen.js create mode 100644 node_modules/es5-ext/string/#/capitalize.js create mode 100644 node_modules/es5-ext/string/#/case-insensitive-compare.js create mode 100644 node_modules/es5-ext/string/#/code-point-at/implement.js create mode 100644 node_modules/es5-ext/string/#/code-point-at/index.js create mode 100644 node_modules/es5-ext/string/#/code-point-at/is-implemented.js create mode 100644 node_modules/es5-ext/string/#/code-point-at/shim.js create mode 100644 node_modules/es5-ext/string/#/contains/implement.js create mode 100644 node_modules/es5-ext/string/#/contains/index.js create mode 100644 node_modules/es5-ext/string/#/contains/is-implemented.js create mode 100644 node_modules/es5-ext/string/#/contains/shim.js create mode 100644 node_modules/es5-ext/string/#/count.js create mode 100644 node_modules/es5-ext/string/#/ends-with/implement.js create mode 100644 node_modules/es5-ext/string/#/ends-with/index.js create mode 100644 node_modules/es5-ext/string/#/ends-with/is-implemented.js create mode 100644 node_modules/es5-ext/string/#/ends-with/shim.js create mode 100644 node_modules/es5-ext/string/#/hyphen-to-camel.js create mode 100644 node_modules/es5-ext/string/#/indent.js create mode 100644 node_modules/es5-ext/string/#/index.js create mode 100644 node_modules/es5-ext/string/#/last.js create mode 100644 node_modules/es5-ext/string/#/normalize/_data.js create mode 100644 node_modules/es5-ext/string/#/normalize/implement.js create mode 100644 node_modules/es5-ext/string/#/normalize/index.js create mode 100644 node_modules/es5-ext/string/#/normalize/is-implemented.js create mode 100644 node_modules/es5-ext/string/#/normalize/shim.js create mode 100644 node_modules/es5-ext/string/#/pad.js create mode 100644 node_modules/es5-ext/string/#/plain-replace-all.js create mode 100644 node_modules/es5-ext/string/#/plain-replace.js create mode 100644 node_modules/es5-ext/string/#/repeat/implement.js create mode 100644 node_modules/es5-ext/string/#/repeat/index.js create mode 100644 node_modules/es5-ext/string/#/repeat/is-implemented.js create mode 100644 node_modules/es5-ext/string/#/repeat/shim.js create mode 100644 node_modules/es5-ext/string/#/starts-with/implement.js create mode 100644 node_modules/es5-ext/string/#/starts-with/index.js create mode 100644 node_modules/es5-ext/string/#/starts-with/is-implemented.js create mode 100644 node_modules/es5-ext/string/#/starts-with/shim.js create mode 100644 node_modules/es5-ext/string/#/uncapitalize.js create mode 100644 node_modules/es5-ext/string/format-method.js create mode 100644 node_modules/es5-ext/string/from-code-point/implement.js create mode 100644 node_modules/es5-ext/string/from-code-point/index.js create mode 100644 node_modules/es5-ext/string/from-code-point/is-implemented.js create mode 100644 node_modules/es5-ext/string/from-code-point/shim.js create mode 100644 node_modules/es5-ext/string/index.js create mode 100644 node_modules/es5-ext/string/is-string.js create mode 100644 node_modules/es5-ext/string/random-uniq.js create mode 100644 node_modules/es5-ext/string/random.js create mode 100644 node_modules/es5-ext/string/raw/implement.js create mode 100644 node_modules/es5-ext/string/raw/index.js create mode 100644 node_modules/es5-ext/string/raw/is-implemented.js create mode 100644 node_modules/es5-ext/string/raw/shim.js create mode 100644 node_modules/es5-ext/test/.eslintrc.json create mode 100644 node_modules/es5-ext/test/__tad.js create mode 100644 node_modules/es5-ext/test/array/#/@@iterator/implement.js create mode 100644 node_modules/es5-ext/test/array/#/@@iterator/index.js create mode 100644 node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js create mode 100644 node_modules/es5-ext/test/array/#/@@iterator/shim.js create mode 100644 node_modules/es5-ext/test/array/#/_compare-by-length.js create mode 100644 node_modules/es5-ext/test/array/#/binary-search.js create mode 100644 node_modules/es5-ext/test/array/#/clear.js create mode 100644 node_modules/es5-ext/test/array/#/compact.js create mode 100644 node_modules/es5-ext/test/array/#/concat/implement.js create mode 100644 node_modules/es5-ext/test/array/#/concat/index.js create mode 100644 node_modules/es5-ext/test/array/#/concat/is-implemented.js create mode 100644 node_modules/es5-ext/test/array/#/concat/shim.js create mode 100644 node_modules/es5-ext/test/array/#/contains.js create mode 100644 node_modules/es5-ext/test/array/#/copy-within/implement.js create mode 100644 node_modules/es5-ext/test/array/#/copy-within/index.js create mode 100644 node_modules/es5-ext/test/array/#/copy-within/is-implemented.js create mode 100644 node_modules/es5-ext/test/array/#/copy-within/shim.js create mode 100644 node_modules/es5-ext/test/array/#/diff.js create mode 100644 node_modules/es5-ext/test/array/#/e-index-of.js create mode 100644 node_modules/es5-ext/test/array/#/e-last-index-of.js create mode 100644 node_modules/es5-ext/test/array/#/entries/implement.js create mode 100644 node_modules/es5-ext/test/array/#/entries/index.js create mode 100644 node_modules/es5-ext/test/array/#/entries/is-implemented.js create mode 100644 node_modules/es5-ext/test/array/#/entries/shim.js create mode 100644 node_modules/es5-ext/test/array/#/exclusion.js create mode 100644 node_modules/es5-ext/test/array/#/fill/implement.js create mode 100644 node_modules/es5-ext/test/array/#/fill/index.js create mode 100644 node_modules/es5-ext/test/array/#/fill/is-implemented.js create mode 100644 node_modules/es5-ext/test/array/#/fill/shim.js create mode 100644 node_modules/es5-ext/test/array/#/filter/implement.js create mode 100644 node_modules/es5-ext/test/array/#/filter/index.js create mode 100644 node_modules/es5-ext/test/array/#/filter/is-implemented.js create mode 100644 node_modules/es5-ext/test/array/#/filter/shim.js create mode 100644 node_modules/es5-ext/test/array/#/find-index/implement.js create mode 100644 node_modules/es5-ext/test/array/#/find-index/index.js create mode 100644 node_modules/es5-ext/test/array/#/find-index/is-implemented.js create mode 100644 node_modules/es5-ext/test/array/#/find-index/shim.js create mode 100644 node_modules/es5-ext/test/array/#/find/implement.js create mode 100644 node_modules/es5-ext/test/array/#/find/index.js create mode 100644 node_modules/es5-ext/test/array/#/find/is-implemented.js create mode 100644 node_modules/es5-ext/test/array/#/find/shim.js create mode 100644 node_modules/es5-ext/test/array/#/first-index.js create mode 100644 node_modules/es5-ext/test/array/#/first.js create mode 100644 node_modules/es5-ext/test/array/#/flatten.js create mode 100644 node_modules/es5-ext/test/array/#/for-each-right.js create mode 100644 node_modules/es5-ext/test/array/#/group.js create mode 100644 node_modules/es5-ext/test/array/#/indexes-of.js create mode 100644 node_modules/es5-ext/test/array/#/intersection.js create mode 100644 node_modules/es5-ext/test/array/#/is-copy.js create mode 100644 node_modules/es5-ext/test/array/#/is-empty.js create mode 100644 node_modules/es5-ext/test/array/#/is-uniq.js create mode 100644 node_modules/es5-ext/test/array/#/keys/implement.js create mode 100644 node_modules/es5-ext/test/array/#/keys/index.js create mode 100644 node_modules/es5-ext/test/array/#/keys/is-implemented.js create mode 100644 node_modules/es5-ext/test/array/#/keys/shim.js create mode 100644 node_modules/es5-ext/test/array/#/last-index.js create mode 100644 node_modules/es5-ext/test/array/#/last.js create mode 100644 node_modules/es5-ext/test/array/#/map/implement.js create mode 100644 node_modules/es5-ext/test/array/#/map/index.js create mode 100644 node_modules/es5-ext/test/array/#/map/is-implemented.js create mode 100644 node_modules/es5-ext/test/array/#/map/shim.js create mode 100644 node_modules/es5-ext/test/array/#/remove.js create mode 100644 node_modules/es5-ext/test/array/#/separate.js create mode 100644 node_modules/es5-ext/test/array/#/slice/implement.js create mode 100644 node_modules/es5-ext/test/array/#/slice/index.js create mode 100644 node_modules/es5-ext/test/array/#/slice/is-implemented.js create mode 100644 node_modules/es5-ext/test/array/#/slice/shim.js create mode 100644 node_modules/es5-ext/test/array/#/some-right.js create mode 100644 node_modules/es5-ext/test/array/#/splice/implement.js create mode 100644 node_modules/es5-ext/test/array/#/splice/index.js create mode 100644 node_modules/es5-ext/test/array/#/splice/is-implemented.js create mode 100644 node_modules/es5-ext/test/array/#/splice/shim.js create mode 100644 node_modules/es5-ext/test/array/#/uniq.js create mode 100644 node_modules/es5-ext/test/array/#/values/implement.js create mode 100644 node_modules/es5-ext/test/array/#/values/index.js create mode 100644 node_modules/es5-ext/test/array/#/values/is-implemented.js create mode 100644 node_modules/es5-ext/test/array/#/values/shim.js create mode 100644 node_modules/es5-ext/test/array/__scopes.js create mode 100644 node_modules/es5-ext/test/array/_is-extensible.js create mode 100644 node_modules/es5-ext/test/array/_sub-array-dummy-safe.js create mode 100644 node_modules/es5-ext/test/array/_sub-array-dummy.js create mode 100644 node_modules/es5-ext/test/array/from/implement.js create mode 100644 node_modules/es5-ext/test/array/from/index.js create mode 100644 node_modules/es5-ext/test/array/from/is-implemented.js create mode 100644 node_modules/es5-ext/test/array/from/shim.js create mode 100644 node_modules/es5-ext/test/array/generate.js create mode 100644 node_modules/es5-ext/test/array/is-plain-array.js create mode 100644 node_modules/es5-ext/test/array/of/implement.js create mode 100644 node_modules/es5-ext/test/array/of/index.js create mode 100644 node_modules/es5-ext/test/array/of/is-implemented.js create mode 100644 node_modules/es5-ext/test/array/of/shim.js create mode 100644 node_modules/es5-ext/test/array/to-array.js create mode 100644 node_modules/es5-ext/test/array/valid-array.js create mode 100644 node_modules/es5-ext/test/boolean/is-boolean.js create mode 100644 node_modules/es5-ext/test/date/#/copy.js create mode 100644 node_modules/es5-ext/test/date/#/days-in-month.js create mode 100644 node_modules/es5-ext/test/date/#/floor-day.js create mode 100644 node_modules/es5-ext/test/date/#/floor-month.js create mode 100644 node_modules/es5-ext/test/date/#/floor-year.js create mode 100644 node_modules/es5-ext/test/date/#/format.js create mode 100644 node_modules/es5-ext/test/date/ensure-time-value.js create mode 100644 node_modules/es5-ext/test/date/is-date.js create mode 100644 node_modules/es5-ext/test/date/is-time-value.js create mode 100644 node_modules/es5-ext/test/date/valid-date.js create mode 100644 node_modules/es5-ext/test/error/#/throw.js create mode 100644 node_modules/es5-ext/test/error/custom.js create mode 100644 node_modules/es5-ext/test/error/is-error.js create mode 100644 node_modules/es5-ext/test/error/valid-error.js create mode 100644 node_modules/es5-ext/test/function/#/compose.js create mode 100644 node_modules/es5-ext/test/function/#/copy.js create mode 100644 node_modules/es5-ext/test/function/#/curry.js create mode 100644 node_modules/es5-ext/test/function/#/lock.js create mode 100644 node_modules/es5-ext/test/function/#/microtask-delay.js create mode 100644 node_modules/es5-ext/test/function/#/not.js create mode 100644 node_modules/es5-ext/test/function/#/partial.js create mode 100644 node_modules/es5-ext/test/function/#/spread.js create mode 100644 node_modules/es5-ext/test/function/#/to-string-tokens.js create mode 100644 node_modules/es5-ext/test/function/_define-length.js create mode 100644 node_modules/es5-ext/test/function/constant.js create mode 100644 node_modules/es5-ext/test/function/identity.js create mode 100644 node_modules/es5-ext/test/function/invoke.js create mode 100644 node_modules/es5-ext/test/function/is-arguments.js create mode 100644 node_modules/es5-ext/test/function/is-function.js create mode 100644 node_modules/es5-ext/test/function/noop.js create mode 100644 node_modules/es5-ext/test/function/pluck.js create mode 100644 node_modules/es5-ext/test/function/valid-function.js create mode 100644 node_modules/es5-ext/test/global.js create mode 100644 node_modules/es5-ext/test/iterable/for-each.js create mode 100644 node_modules/es5-ext/test/iterable/is.js create mode 100644 node_modules/es5-ext/test/iterable/validate-object.js create mode 100644 node_modules/es5-ext/test/iterable/validate.js create mode 100644 node_modules/es5-ext/test/json/safe-stringify.js create mode 100644 node_modules/es5-ext/test/math/_decimal-adjust.js create mode 100644 node_modules/es5-ext/test/math/_pack-ieee754.js create mode 100644 node_modules/es5-ext/test/math/_unpack-ieee754.js create mode 100644 node_modules/es5-ext/test/math/acosh/implement.js create mode 100644 node_modules/es5-ext/test/math/acosh/index.js create mode 100644 node_modules/es5-ext/test/math/acosh/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/acosh/shim.js create mode 100644 node_modules/es5-ext/test/math/asinh/implement.js create mode 100644 node_modules/es5-ext/test/math/asinh/index.js create mode 100644 node_modules/es5-ext/test/math/asinh/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/asinh/shim.js create mode 100644 node_modules/es5-ext/test/math/atanh/implement.js create mode 100644 node_modules/es5-ext/test/math/atanh/index.js create mode 100644 node_modules/es5-ext/test/math/atanh/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/atanh/shim.js create mode 100644 node_modules/es5-ext/test/math/cbrt/implement.js create mode 100644 node_modules/es5-ext/test/math/cbrt/index.js create mode 100644 node_modules/es5-ext/test/math/cbrt/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/cbrt/shim.js create mode 100644 node_modules/es5-ext/test/math/ceil-10.js create mode 100644 node_modules/es5-ext/test/math/clz32/implement.js create mode 100644 node_modules/es5-ext/test/math/clz32/index.js create mode 100644 node_modules/es5-ext/test/math/clz32/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/clz32/shim.js create mode 100644 node_modules/es5-ext/test/math/cosh/implement.js create mode 100644 node_modules/es5-ext/test/math/cosh/index.js create mode 100644 node_modules/es5-ext/test/math/cosh/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/cosh/shim.js create mode 100644 node_modules/es5-ext/test/math/expm1/implement.js create mode 100644 node_modules/es5-ext/test/math/expm1/index.js create mode 100644 node_modules/es5-ext/test/math/expm1/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/expm1/shim.js create mode 100644 node_modules/es5-ext/test/math/floor-10.js create mode 100644 node_modules/es5-ext/test/math/fround/implement.js create mode 100644 node_modules/es5-ext/test/math/fround/index.js create mode 100644 node_modules/es5-ext/test/math/fround/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/fround/shim.js create mode 100644 node_modules/es5-ext/test/math/hypot/implement.js create mode 100644 node_modules/es5-ext/test/math/hypot/index.js create mode 100644 node_modules/es5-ext/test/math/hypot/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/hypot/shim.js create mode 100644 node_modules/es5-ext/test/math/imul/implement.js create mode 100644 node_modules/es5-ext/test/math/imul/index.js create mode 100644 node_modules/es5-ext/test/math/imul/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/imul/shim.js create mode 100644 node_modules/es5-ext/test/math/log10/implement.js create mode 100644 node_modules/es5-ext/test/math/log10/index.js create mode 100644 node_modules/es5-ext/test/math/log10/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/log10/shim.js create mode 100644 node_modules/es5-ext/test/math/log1p/implement.js create mode 100644 node_modules/es5-ext/test/math/log1p/index.js create mode 100644 node_modules/es5-ext/test/math/log1p/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/log1p/shim.js create mode 100644 node_modules/es5-ext/test/math/log2/implement.js create mode 100644 node_modules/es5-ext/test/math/log2/index.js create mode 100644 node_modules/es5-ext/test/math/log2/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/log2/shim.js create mode 100644 node_modules/es5-ext/test/math/round-10.js create mode 100644 node_modules/es5-ext/test/math/sign/implement.js create mode 100644 node_modules/es5-ext/test/math/sign/index.js create mode 100644 node_modules/es5-ext/test/math/sign/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/sign/shim.js create mode 100644 node_modules/es5-ext/test/math/sinh/implement.js create mode 100644 node_modules/es5-ext/test/math/sinh/index.js create mode 100644 node_modules/es5-ext/test/math/sinh/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/sinh/shim.js create mode 100644 node_modules/es5-ext/test/math/tanh/implement.js create mode 100644 node_modules/es5-ext/test/math/tanh/index.js create mode 100644 node_modules/es5-ext/test/math/tanh/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/tanh/shim.js create mode 100644 node_modules/es5-ext/test/math/trunc/implement.js create mode 100644 node_modules/es5-ext/test/math/trunc/index.js create mode 100644 node_modules/es5-ext/test/math/trunc/is-implemented.js create mode 100644 node_modules/es5-ext/test/math/trunc/shim.js create mode 100644 node_modules/es5-ext/test/number/#/pad.js create mode 100644 node_modules/es5-ext/test/number/epsilon/implement.js create mode 100644 node_modules/es5-ext/test/number/epsilon/index.js create mode 100644 node_modules/es5-ext/test/number/epsilon/is-implemented.js create mode 100644 node_modules/es5-ext/test/number/is-finite/implement.js create mode 100644 node_modules/es5-ext/test/number/is-finite/index.js create mode 100644 node_modules/es5-ext/test/number/is-finite/is-implemented.js create mode 100644 node_modules/es5-ext/test/number/is-finite/shim.js create mode 100644 node_modules/es5-ext/test/number/is-integer/implement.js create mode 100644 node_modules/es5-ext/test/number/is-integer/index.js create mode 100644 node_modules/es5-ext/test/number/is-integer/is-implemented.js create mode 100644 node_modules/es5-ext/test/number/is-integer/shim.js create mode 100644 node_modules/es5-ext/test/number/is-nan/implement.js create mode 100644 node_modules/es5-ext/test/number/is-nan/index.js create mode 100644 node_modules/es5-ext/test/number/is-nan/is-implemented.js create mode 100644 node_modules/es5-ext/test/number/is-nan/shim.js create mode 100644 node_modules/es5-ext/test/number/is-natural.js create mode 100644 node_modules/es5-ext/test/number/is-number.js create mode 100644 node_modules/es5-ext/test/number/is-safe-integer/implement.js create mode 100644 node_modules/es5-ext/test/number/is-safe-integer/index.js create mode 100644 node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js create mode 100644 node_modules/es5-ext/test/number/is-safe-integer/shim.js create mode 100644 node_modules/es5-ext/test/number/max-safe-integer/implement.js create mode 100644 node_modules/es5-ext/test/number/max-safe-integer/index.js create mode 100644 node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js create mode 100644 node_modules/es5-ext/test/number/min-safe-integer/implement.js create mode 100644 node_modules/es5-ext/test/number/min-safe-integer/index.js create mode 100644 node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js create mode 100644 node_modules/es5-ext/test/number/to-integer.js create mode 100644 node_modules/es5-ext/test/number/to-pos-integer.js create mode 100644 node_modules/es5-ext/test/number/to-uint32.js create mode 100644 node_modules/es5-ext/test/object/_iterate.js create mode 100644 node_modules/es5-ext/test/object/assign-deep.js create mode 100644 node_modules/es5-ext/test/object/assign/implement.js create mode 100644 node_modules/es5-ext/test/object/assign/index.js create mode 100644 node_modules/es5-ext/test/object/assign/is-implemented.js create mode 100644 node_modules/es5-ext/test/object/assign/shim.js create mode 100644 node_modules/es5-ext/test/object/clear.js create mode 100644 node_modules/es5-ext/test/object/compact.js create mode 100644 node_modules/es5-ext/test/object/compare.js create mode 100644 node_modules/es5-ext/test/object/copy-deep.js create mode 100644 node_modules/es5-ext/test/object/copy.js create mode 100644 node_modules/es5-ext/test/object/count.js create mode 100644 node_modules/es5-ext/test/object/create.js create mode 100644 node_modules/es5-ext/test/object/ensure-array.js create mode 100644 node_modules/es5-ext/test/object/ensure-finite-number.js create mode 100644 node_modules/es5-ext/test/object/ensure-integer.js create mode 100644 node_modules/es5-ext/test/object/ensure-natural-number-value.js create mode 100644 node_modules/es5-ext/test/object/ensure-natural-number.js create mode 100644 node_modules/es5-ext/test/object/ensure-plain-function.js create mode 100644 node_modules/es5-ext/test/object/ensure-plain-object.js create mode 100644 node_modules/es5-ext/test/object/ensure-promise.js create mode 100644 node_modules/es5-ext/test/object/ensure-thenable.js create mode 100644 node_modules/es5-ext/test/object/entries/implement.js create mode 100644 node_modules/es5-ext/test/object/entries/index.js create mode 100644 node_modules/es5-ext/test/object/entries/is-implemented.js create mode 100644 node_modules/es5-ext/test/object/entries/shim.js create mode 100644 node_modules/es5-ext/test/object/eq.js create mode 100644 node_modules/es5-ext/test/object/every.js create mode 100644 node_modules/es5-ext/test/object/filter.js create mode 100644 node_modules/es5-ext/test/object/find-key.js create mode 100644 node_modules/es5-ext/test/object/find.js create mode 100644 node_modules/es5-ext/test/object/first-key.js create mode 100644 node_modules/es5-ext/test/object/flatten.js create mode 100644 node_modules/es5-ext/test/object/for-each.js create mode 100644 node_modules/es5-ext/test/object/get-property-names.js create mode 100644 node_modules/es5-ext/test/object/is-array-like.js create mode 100644 node_modules/es5-ext/test/object/is-callable.js create mode 100644 node_modules/es5-ext/test/object/is-copy-deep.js create mode 100644 node_modules/es5-ext/test/object/is-copy.js create mode 100644 node_modules/es5-ext/test/object/is-empty.js create mode 100644 node_modules/es5-ext/test/object/is-finite-number.js create mode 100644 node_modules/es5-ext/test/object/is-integer.js create mode 100644 node_modules/es5-ext/test/object/is-natural-number-value.js create mode 100644 node_modules/es5-ext/test/object/is-natural-number.js create mode 100644 node_modules/es5-ext/test/object/is-number-value.js create mode 100644 node_modules/es5-ext/test/object/is-object.js create mode 100644 node_modules/es5-ext/test/object/is-plain-function.js create mode 100644 node_modules/es5-ext/test/object/is-plain-object.js create mode 100644 node_modules/es5-ext/test/object/is-promise.js create mode 100644 node_modules/es5-ext/test/object/is-thenable.js create mode 100644 node_modules/es5-ext/test/object/is-value.js create mode 100644 node_modules/es5-ext/test/object/is.js create mode 100644 node_modules/es5-ext/test/object/key-of.js create mode 100644 node_modules/es5-ext/test/object/keys/implement.js create mode 100644 node_modules/es5-ext/test/object/keys/index.js create mode 100644 node_modules/es5-ext/test/object/keys/is-implemented.js create mode 100644 node_modules/es5-ext/test/object/keys/shim.js create mode 100644 node_modules/es5-ext/test/object/map-keys.js create mode 100644 node_modules/es5-ext/test/object/map.js create mode 100644 node_modules/es5-ext/test/object/mixin-prototypes.js create mode 100644 node_modules/es5-ext/test/object/mixin.js create mode 100644 node_modules/es5-ext/test/object/normalize-options.js create mode 100644 node_modules/es5-ext/test/object/primitive-set.js create mode 100644 node_modules/es5-ext/test/object/safe-traverse.js create mode 100644 node_modules/es5-ext/test/object/serialize.js create mode 100644 node_modules/es5-ext/test/object/set-prototype-of/implement.js create mode 100644 node_modules/es5-ext/test/object/set-prototype-of/index.js create mode 100644 node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js create mode 100644 node_modules/es5-ext/test/object/set-prototype-of/shim.js create mode 100644 node_modules/es5-ext/test/object/some.js create mode 100644 node_modules/es5-ext/test/object/to-array.js create mode 100644 node_modules/es5-ext/test/object/unserialize.js create mode 100644 node_modules/es5-ext/test/object/valid-callable.js create mode 100644 node_modules/es5-ext/test/object/valid-object.js create mode 100644 node_modules/es5-ext/test/object/valid-value.js create mode 100644 node_modules/es5-ext/test/object/validate-array-like-object.js create mode 100644 node_modules/es5-ext/test/object/validate-array-like.js create mode 100644 node_modules/es5-ext/test/object/validate-stringifiable-value.js create mode 100644 node_modules/es5-ext/test/object/validate-stringifiable.js create mode 100644 node_modules/es5-ext/test/optional-chaining.js create mode 100644 node_modules/es5-ext/test/promise/#/as-callback.js create mode 100644 node_modules/es5-ext/test/promise/#/finally/implement.js create mode 100644 node_modules/es5-ext/test/promise/#/finally/index.js create mode 100644 node_modules/es5-ext/test/promise/#/finally/is-implemented.js create mode 100644 node_modules/es5-ext/test/promise/#/finally/shim.js create mode 100644 node_modules/es5-ext/test/promise/.eslintrc.json create mode 100644 node_modules/es5-ext/test/promise/lazy.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/index.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/is-sticky.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/is-unicode.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/match/implement.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/match/index.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/match/shim.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/replace/implement.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/replace/index.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/replace/shim.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/search/implement.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/search/index.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/search/shim.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/split/implement.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/split/index.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/split/shim.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/sticky/implement.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/unicode/implement.js create mode 100644 node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js create mode 100644 node_modules/es5-ext/test/reg-exp/escape.js create mode 100644 node_modules/es5-ext/test/reg-exp/is-reg-exp.js create mode 100644 node_modules/es5-ext/test/reg-exp/valid-reg-exp.js create mode 100644 node_modules/es5-ext/test/safe-to-string.js create mode 100644 node_modules/es5-ext/test/string/#/@@iterator/implement.js create mode 100644 node_modules/es5-ext/test/string/#/@@iterator/index.js create mode 100644 node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js create mode 100644 node_modules/es5-ext/test/string/#/@@iterator/shim.js create mode 100644 node_modules/es5-ext/test/string/#/at.js create mode 100644 node_modules/es5-ext/test/string/#/camel-to-hyphen.js create mode 100644 node_modules/es5-ext/test/string/#/capitalize.js create mode 100644 node_modules/es5-ext/test/string/#/case-insensitive-compare.js create mode 100644 node_modules/es5-ext/test/string/#/code-point-at/implement.js create mode 100644 node_modules/es5-ext/test/string/#/code-point-at/index.js create mode 100644 node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js create mode 100644 node_modules/es5-ext/test/string/#/code-point-at/shim.js create mode 100644 node_modules/es5-ext/test/string/#/contains/implement.js create mode 100644 node_modules/es5-ext/test/string/#/contains/index.js create mode 100644 node_modules/es5-ext/test/string/#/contains/is-implemented.js create mode 100644 node_modules/es5-ext/test/string/#/contains/shim.js create mode 100644 node_modules/es5-ext/test/string/#/count.js create mode 100644 node_modules/es5-ext/test/string/#/ends-with/implement.js create mode 100644 node_modules/es5-ext/test/string/#/ends-with/index.js create mode 100644 node_modules/es5-ext/test/string/#/ends-with/is-implemented.js create mode 100644 node_modules/es5-ext/test/string/#/ends-with/shim.js create mode 100644 node_modules/es5-ext/test/string/#/hyphen-to-camel.js create mode 100644 node_modules/es5-ext/test/string/#/indent.js create mode 100644 node_modules/es5-ext/test/string/#/last.js create mode 100644 node_modules/es5-ext/test/string/#/normalize/_data.js create mode 100644 node_modules/es5-ext/test/string/#/normalize/implement.js create mode 100644 node_modules/es5-ext/test/string/#/normalize/index.js create mode 100644 node_modules/es5-ext/test/string/#/normalize/is-implemented.js create mode 100644 node_modules/es5-ext/test/string/#/normalize/shim.js create mode 100644 node_modules/es5-ext/test/string/#/pad.js create mode 100644 node_modules/es5-ext/test/string/#/plain-replace-all.js create mode 100644 node_modules/es5-ext/test/string/#/plain-replace.js create mode 100644 node_modules/es5-ext/test/string/#/repeat/implement.js create mode 100644 node_modules/es5-ext/test/string/#/repeat/index.js create mode 100644 node_modules/es5-ext/test/string/#/repeat/is-implemented.js create mode 100644 node_modules/es5-ext/test/string/#/repeat/shim.js create mode 100644 node_modules/es5-ext/test/string/#/starts-with/implement.js create mode 100644 node_modules/es5-ext/test/string/#/starts-with/index.js create mode 100644 node_modules/es5-ext/test/string/#/starts-with/is-implemented.js create mode 100644 node_modules/es5-ext/test/string/#/starts-with/shim.js create mode 100644 node_modules/es5-ext/test/string/#/uncapitalize.js create mode 100644 node_modules/es5-ext/test/string/format-method.js create mode 100644 node_modules/es5-ext/test/string/from-code-point/implement.js create mode 100644 node_modules/es5-ext/test/string/from-code-point/index.js create mode 100644 node_modules/es5-ext/test/string/from-code-point/is-implemented.js create mode 100644 node_modules/es5-ext/test/string/from-code-point/shim.js create mode 100644 node_modules/es5-ext/test/string/is-string.js create mode 100644 node_modules/es5-ext/test/string/random-uniq.js create mode 100644 node_modules/es5-ext/test/string/random.js create mode 100644 node_modules/es5-ext/test/string/raw/implement.js create mode 100644 node_modules/es5-ext/test/string/raw/index.js create mode 100644 node_modules/es5-ext/test/string/raw/is-implemented.js create mode 100644 node_modules/es5-ext/test/string/raw/shim.js create mode 100644 node_modules/es5-ext/test/to-short-string-representation.js create mode 100644 node_modules/es5-ext/to-short-string-representation.js create mode 100644 node_modules/es6-iterator/#/chain.js create mode 100644 node_modules/es6-iterator/.editorconfig create mode 100644 node_modules/es6-iterator/.npmignore create mode 100644 node_modules/es6-iterator/CHANGELOG.md create mode 100644 node_modules/es6-iterator/CHANGES create mode 100644 node_modules/es6-iterator/LICENSE create mode 100644 node_modules/es6-iterator/README.md create mode 100644 node_modules/es6-iterator/appveyor.yml create mode 100644 node_modules/es6-iterator/array.js create mode 100644 node_modules/es6-iterator/for-of.js create mode 100644 node_modules/es6-iterator/get.js create mode 100644 node_modules/es6-iterator/index.js create mode 100644 node_modules/es6-iterator/is-iterable.js create mode 100644 node_modules/es6-iterator/package.json create mode 100644 node_modules/es6-iterator/string.js create mode 100644 node_modules/es6-iterator/test/#/chain.js create mode 100644 node_modules/es6-iterator/test/.eslintrc.json create mode 100644 node_modules/es6-iterator/test/array.js create mode 100644 node_modules/es6-iterator/test/for-of.js create mode 100644 node_modules/es6-iterator/test/get.js create mode 100644 node_modules/es6-iterator/test/index.js create mode 100644 node_modules/es6-iterator/test/is-iterable.js create mode 100644 node_modules/es6-iterator/test/string.js create mode 100644 node_modules/es6-iterator/test/valid-iterable.js create mode 100644 node_modules/es6-iterator/valid-iterable.js create mode 100755 node_modules/es6-symbol/.editorconfig create mode 100644 node_modules/es6-symbol/.github/FUNDING.yml create mode 100644 node_modules/es6-symbol/.testignore create mode 100644 node_modules/es6-symbol/CHANGELOG.md create mode 100644 node_modules/es6-symbol/CHANGES create mode 100644 node_modules/es6-symbol/LICENSE create mode 100644 node_modules/es6-symbol/README.md create mode 100644 node_modules/es6-symbol/implement.js create mode 100644 node_modules/es6-symbol/index.js create mode 100644 node_modules/es6-symbol/is-implemented.js create mode 100644 node_modules/es6-symbol/is-native-implemented.js create mode 100644 node_modules/es6-symbol/is-symbol.js create mode 100644 node_modules/es6-symbol/lib/private/generate-name.js create mode 100644 node_modules/es6-symbol/lib/private/setup/standard-symbols.js create mode 100644 node_modules/es6-symbol/lib/private/setup/symbol-registry.js create mode 100644 node_modules/es6-symbol/package.json create mode 100644 node_modules/es6-symbol/polyfill.js create mode 100644 node_modules/es6-symbol/test/implement.js create mode 100644 node_modules/es6-symbol/test/index.js create mode 100644 node_modules/es6-symbol/test/is-implemented.js create mode 100644 node_modules/es6-symbol/test/is-native-implemented.js create mode 100644 node_modules/es6-symbol/test/is-symbol.js create mode 100644 node_modules/es6-symbol/test/polyfill.js create mode 100644 node_modules/es6-symbol/test/validate-symbol.js create mode 100644 node_modules/es6-symbol/validate-symbol.js create mode 100644 node_modules/es6-weak-map/.editorconfig create mode 100644 node_modules/es6-weak-map/CHANGELOG.md create mode 100644 node_modules/es6-weak-map/CHANGES create mode 100644 node_modules/es6-weak-map/LICENSE create mode 100644 node_modules/es6-weak-map/README.md create mode 100644 node_modules/es6-weak-map/implement.js create mode 100644 node_modules/es6-weak-map/index.js create mode 100644 node_modules/es6-weak-map/is-implemented.js create mode 100644 node_modules/es6-weak-map/is-native-implemented.js create mode 100644 node_modules/es6-weak-map/is-weak-map.js create mode 100644 node_modules/es6-weak-map/package.json create mode 100644 node_modules/es6-weak-map/polyfill.js create mode 100644 node_modules/es6-weak-map/test/implement.js create mode 100644 node_modules/es6-weak-map/test/index.js create mode 100644 node_modules/es6-weak-map/test/is-implemented.js create mode 100644 node_modules/es6-weak-map/test/is-native-implemented.js create mode 100644 node_modules/es6-weak-map/test/is-weak-map.js create mode 100644 node_modules/es6-weak-map/test/polyfill.js create mode 100644 node_modules/es6-weak-map/test/valid-weak-map.js create mode 100644 node_modules/es6-weak-map/valid-weak-map.js create mode 100644 node_modules/escape-string-regexp/index.js create mode 100644 node_modules/escape-string-regexp/license create mode 100644 node_modules/escape-string-regexp/package.json create mode 100644 node_modules/escape-string-regexp/readme.md create mode 100644 node_modules/eslint-scope/CHANGELOG.md create mode 100644 node_modules/eslint-scope/LICENSE create mode 100644 node_modules/eslint-scope/README.md create mode 100644 node_modules/eslint-scope/lib/definition.js create mode 100644 node_modules/eslint-scope/lib/index.js create mode 100644 node_modules/eslint-scope/lib/pattern-visitor.js create mode 100644 node_modules/eslint-scope/lib/reference.js create mode 100644 node_modules/eslint-scope/lib/referencer.js create mode 100644 node_modules/eslint-scope/lib/scope-manager.js create mode 100644 node_modules/eslint-scope/lib/scope.js create mode 100644 node_modules/eslint-scope/lib/variable.js create mode 100644 node_modules/eslint-scope/package.json create mode 100644 node_modules/esrecurse/.babelrc create mode 100644 node_modules/esrecurse/README.md create mode 100644 node_modules/esrecurse/esrecurse.js create mode 100644 node_modules/esrecurse/gulpfile.babel.js create mode 100755 node_modules/esrecurse/package.json create mode 100644 node_modules/estraverse/.jshintrc create mode 100644 node_modules/estraverse/LICENSE.BSD create mode 100644 node_modules/estraverse/README.md create mode 100644 node_modules/estraverse/estraverse.js create mode 100644 node_modules/estraverse/gulpfile.js create mode 100644 node_modules/estraverse/package.json create mode 100644 node_modules/events/.airtap.yml create mode 100644 node_modules/events/.github/FUNDING.yml create mode 100644 node_modules/events/.travis.yml create mode 100644 node_modules/events/History.md create mode 100644 node_modules/events/LICENSE create mode 100644 node_modules/events/Readme.md create mode 100644 node_modules/events/events.js create mode 100644 node_modules/events/package.json create mode 100644 node_modules/events/security.md create mode 100644 node_modules/events/tests/add-listeners.js create mode 100644 node_modules/events/tests/check-listener-leaks.js create mode 100644 node_modules/events/tests/common.js create mode 100644 node_modules/events/tests/errors.js create mode 100644 node_modules/events/tests/events-list.js create mode 100644 node_modules/events/tests/index.js create mode 100644 node_modules/events/tests/legacy-compat.js create mode 100644 node_modules/events/tests/listener-count.js create mode 100644 node_modules/events/tests/listeners-side-effects.js create mode 100644 node_modules/events/tests/listeners.js create mode 100644 node_modules/events/tests/max-listeners.js create mode 100644 node_modules/events/tests/method-names.js create mode 100644 node_modules/events/tests/modify-in-emit.js create mode 100644 node_modules/events/tests/num-args.js create mode 100644 node_modules/events/tests/once.js create mode 100644 node_modules/events/tests/prepend.js create mode 100644 node_modules/events/tests/remove-all-listeners.js create mode 100644 node_modules/events/tests/remove-listeners.js create mode 100644 node_modules/events/tests/set-max-listeners-side-effects.js create mode 100644 node_modules/events/tests/special-event-names.js create mode 100644 node_modules/events/tests/subclass.js create mode 100644 node_modules/events/tests/symbols.js create mode 100644 node_modules/evp_bytestokey/LICENSE create mode 100644 node_modules/evp_bytestokey/README.md create mode 100644 node_modules/evp_bytestokey/index.js create mode 100644 node_modules/evp_bytestokey/package.json create mode 100644 node_modules/execa/index.js create mode 100644 node_modules/execa/lib/errname.js create mode 100644 node_modules/execa/lib/stdio.js create mode 100644 node_modules/execa/license create mode 100644 node_modules/execa/package.json create mode 100644 node_modules/execa/readme.md create mode 100644 node_modules/expand-brackets/LICENSE create mode 100644 node_modules/expand-brackets/README.md create mode 100644 node_modules/expand-brackets/changelog.md create mode 100644 node_modules/expand-brackets/index.js create mode 100644 node_modules/expand-brackets/lib/compilers.js create mode 100644 node_modules/expand-brackets/lib/parsers.js create mode 100644 node_modules/expand-brackets/lib/utils.js create mode 100644 node_modules/expand-brackets/node_modules/define-property/LICENSE create mode 100644 node_modules/expand-brackets/node_modules/define-property/README.md create mode 100644 node_modules/expand-brackets/node_modules/define-property/index.js create mode 100644 node_modules/expand-brackets/node_modules/define-property/package.json create mode 100644 node_modules/expand-brackets/node_modules/extend-shallow/LICENSE create mode 100644 node_modules/expand-brackets/node_modules/extend-shallow/README.md create mode 100644 node_modules/expand-brackets/node_modules/extend-shallow/index.js create mode 100644 node_modules/expand-brackets/node_modules/extend-shallow/package.json create mode 100644 node_modules/expand-brackets/package.json create mode 100644 node_modules/expand-tilde/LICENSE create mode 100644 node_modules/expand-tilde/README.md create mode 100644 node_modules/expand-tilde/index.js create mode 100644 node_modules/expand-tilde/package.json create mode 100644 node_modules/ext/.editorconfig create mode 100644 node_modules/ext/CHANGELOG.md create mode 100644 node_modules/ext/LICENSE create mode 100644 node_modules/ext/README.md create mode 100644 node_modules/ext/docs/function/identity.md create mode 100644 node_modules/ext/docs/global-this.md create mode 100644 node_modules/ext/docs/math/ceil-10.md create mode 100644 node_modules/ext/docs/math/floor-10.md create mode 100644 node_modules/ext/docs/math/round-10.md create mode 100644 node_modules/ext/docs/object/entries.md create mode 100644 node_modules/ext/docs/string/random.md create mode 100644 node_modules/ext/docs/string_/includes.md create mode 100644 node_modules/ext/docs/thenable_/finally.md create mode 100644 node_modules/ext/function/identity.js create mode 100644 node_modules/ext/global-this/implementation.js create mode 100644 node_modules/ext/global-this/index.js create mode 100644 node_modules/ext/global-this/is-implemented.js create mode 100644 node_modules/ext/lib/private/decimal-adjust.js create mode 100644 node_modules/ext/math/ceil-10.js create mode 100644 node_modules/ext/math/floor-10.js create mode 100644 node_modules/ext/math/round-10.js create mode 100644 node_modules/ext/node_modules/type/.editorconfig create mode 100644 node_modules/ext/node_modules/type/CHANGELOG.md create mode 100644 node_modules/ext/node_modules/type/LICENSE create mode 100644 node_modules/ext/node_modules/type/README.md create mode 100644 node_modules/ext/node_modules/type/array-length/coerce.js create mode 100644 node_modules/ext/node_modules/type/array-length/ensure.js create mode 100644 node_modules/ext/node_modules/type/array-like/ensure.js create mode 100644 node_modules/ext/node_modules/type/array-like/is.js create mode 100644 node_modules/ext/node_modules/type/array/ensure.js create mode 100644 node_modules/ext/node_modules/type/array/is.js create mode 100644 node_modules/ext/node_modules/type/date/ensure.js create mode 100644 node_modules/ext/node_modules/type/date/is.js create mode 100644 node_modules/ext/node_modules/type/error/ensure.js create mode 100644 node_modules/ext/node_modules/type/error/is.js create mode 100644 node_modules/ext/node_modules/type/finite/coerce.js create mode 100644 node_modules/ext/node_modules/type/finite/ensure.js create mode 100644 node_modules/ext/node_modules/type/function/ensure.js create mode 100644 node_modules/ext/node_modules/type/function/is.js create mode 100644 node_modules/ext/node_modules/type/integer/coerce.js create mode 100644 node_modules/ext/node_modules/type/integer/ensure.js create mode 100644 node_modules/ext/node_modules/type/iterable/ensure.js create mode 100644 node_modules/ext/node_modules/type/iterable/is.js create mode 100644 node_modules/ext/node_modules/type/lib/is-to-string-tag-supported.js create mode 100644 node_modules/ext/node_modules/type/lib/resolve-error-message.js create mode 100644 node_modules/ext/node_modules/type/lib/resolve-exception.js create mode 100644 node_modules/ext/node_modules/type/lib/safe-to-string.js create mode 100644 node_modules/ext/node_modules/type/lib/to-short-string.js create mode 100644 node_modules/ext/node_modules/type/natural-number/coerce.js create mode 100644 node_modules/ext/node_modules/type/natural-number/ensure.js create mode 100644 node_modules/ext/node_modules/type/number/coerce.js create mode 100644 node_modules/ext/node_modules/type/number/ensure.js create mode 100644 node_modules/ext/node_modules/type/object/ensure.js create mode 100644 node_modules/ext/node_modules/type/object/is.js create mode 100644 node_modules/ext/node_modules/type/package.json create mode 100644 node_modules/ext/node_modules/type/plain-function/ensure.js create mode 100644 node_modules/ext/node_modules/type/plain-function/is.js create mode 100644 node_modules/ext/node_modules/type/plain-object/ensure.js create mode 100644 node_modules/ext/node_modules/type/plain-object/is.js create mode 100644 node_modules/ext/node_modules/type/promise/ensure.js create mode 100644 node_modules/ext/node_modules/type/promise/is.js create mode 100644 node_modules/ext/node_modules/type/prototype/is.js create mode 100644 node_modules/ext/node_modules/type/reg-exp/ensure.js create mode 100644 node_modules/ext/node_modules/type/reg-exp/is.js create mode 100644 node_modules/ext/node_modules/type/safe-integer/coerce.js create mode 100644 node_modules/ext/node_modules/type/safe-integer/ensure.js create mode 100644 node_modules/ext/node_modules/type/string/coerce.js create mode 100644 node_modules/ext/node_modules/type/string/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/_lib/arrow-function-if-supported.js create mode 100644 node_modules/ext/node_modules/type/test/_lib/class-if-supported.js create mode 100644 node_modules/ext/node_modules/type/test/array-length/coerce.js create mode 100644 node_modules/ext/node_modules/type/test/array-length/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/array-like/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/array-like/is.js create mode 100644 node_modules/ext/node_modules/type/test/array/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/array/is.js create mode 100644 node_modules/ext/node_modules/type/test/date/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/date/is.js create mode 100644 node_modules/ext/node_modules/type/test/error/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/error/is.js create mode 100644 node_modules/ext/node_modules/type/test/finite/coerce.js create mode 100644 node_modules/ext/node_modules/type/test/finite/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/function/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/function/is.js create mode 100644 node_modules/ext/node_modules/type/test/integer/coerce.js create mode 100644 node_modules/ext/node_modules/type/test/integer/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/iterable/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/iterable/is.js create mode 100644 node_modules/ext/node_modules/type/test/lib/is-to-string-tag-supported.js create mode 100644 node_modules/ext/node_modules/type/test/lib/resolve-error-message.js create mode 100644 node_modules/ext/node_modules/type/test/lib/resolve-exception.js create mode 100644 node_modules/ext/node_modules/type/test/lib/safe-to-string.js create mode 100644 node_modules/ext/node_modules/type/test/lib/to-short-string.js create mode 100644 node_modules/ext/node_modules/type/test/natural-number/coerce.js create mode 100644 node_modules/ext/node_modules/type/test/natural-number/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/number/coerce.js create mode 100644 node_modules/ext/node_modules/type/test/number/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/object/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/object/is.js create mode 100644 node_modules/ext/node_modules/type/test/plain-function/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/plain-function/is.js create mode 100644 node_modules/ext/node_modules/type/test/plain-object/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/plain-object/is.js create mode 100644 node_modules/ext/node_modules/type/test/promise/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/promise/is.js create mode 100644 node_modules/ext/node_modules/type/test/prototype/is.js create mode 100644 node_modules/ext/node_modules/type/test/reg-exp/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/reg-exp/is.js create mode 100644 node_modules/ext/node_modules/type/test/safe-integer/coerce.js create mode 100644 node_modules/ext/node_modules/type/test/safe-integer/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/string/coerce.js create mode 100644 node_modules/ext/node_modules/type/test/string/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/thenable/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/thenable/is.js create mode 100644 node_modules/ext/node_modules/type/test/time-value/coerce.js create mode 100644 node_modules/ext/node_modules/type/test/time-value/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/value/ensure.js create mode 100644 node_modules/ext/node_modules/type/test/value/is.js create mode 100644 node_modules/ext/node_modules/type/thenable/ensure.js create mode 100644 node_modules/ext/node_modules/type/thenable/is.js create mode 100644 node_modules/ext/node_modules/type/time-value/coerce.js create mode 100644 node_modules/ext/node_modules/type/time-value/ensure.js create mode 100644 node_modules/ext/node_modules/type/value/ensure.js create mode 100644 node_modules/ext/node_modules/type/value/is.js create mode 100644 node_modules/ext/object/entries/implement.js create mode 100644 node_modules/ext/object/entries/implementation.js create mode 100644 node_modules/ext/object/entries/index.js create mode 100644 node_modules/ext/object/entries/is-implemented.js create mode 100644 node_modules/ext/package.json create mode 100644 node_modules/ext/string/random.js create mode 100644 node_modules/ext/string_/includes/implementation.js create mode 100644 node_modules/ext/string_/includes/index.js create mode 100644 node_modules/ext/string_/includes/is-implemented.js create mode 100644 node_modules/ext/test/function/identity.js create mode 100644 node_modules/ext/test/global-this/implementation.js create mode 100644 node_modules/ext/test/global-this/index.js create mode 100644 node_modules/ext/test/global-this/is-implemented.js create mode 100644 node_modules/ext/test/math/ceil-10.js create mode 100644 node_modules/ext/test/math/floor-10.js create mode 100644 node_modules/ext/test/math/round-10.js create mode 100644 node_modules/ext/test/object/entries/_tests.js create mode 100644 node_modules/ext/test/object/entries/implementation.js create mode 100644 node_modules/ext/test/object/entries/index.js create mode 100644 node_modules/ext/test/object/entries/is-implemented.js create mode 100644 node_modules/ext/test/string/random.js create mode 100644 node_modules/ext/test/string_/includes/_tests.js create mode 100644 node_modules/ext/test/string_/includes/implementation.js create mode 100644 node_modules/ext/test/string_/includes/index.js create mode 100644 node_modules/ext/test/string_/includes/is-implemented.js create mode 100644 node_modules/ext/test/thenable_/finally.js create mode 100644 node_modules/ext/thenable_/finally.js create mode 100644 node_modules/extend-shallow/LICENSE create mode 100644 node_modules/extend-shallow/README.md create mode 100644 node_modules/extend-shallow/index.js create mode 100644 node_modules/extend-shallow/node_modules/is-extendable/LICENSE create mode 100644 node_modules/extend-shallow/node_modules/is-extendable/README.md create mode 100644 node_modules/extend-shallow/node_modules/is-extendable/index.d.ts create mode 100644 node_modules/extend-shallow/node_modules/is-extendable/index.js create mode 100644 node_modules/extend-shallow/node_modules/is-extendable/package.json create mode 100644 node_modules/extend-shallow/package.json create mode 100644 node_modules/extend/.editorconfig create mode 100644 node_modules/extend/.eslintrc create mode 100644 node_modules/extend/.jscs.json create mode 100644 node_modules/extend/.travis.yml create mode 100644 node_modules/extend/CHANGELOG.md create mode 100644 node_modules/extend/LICENSE create mode 100644 node_modules/extend/README.md create mode 100644 node_modules/extend/component.json create mode 100644 node_modules/extend/index.js create mode 100644 node_modules/extend/package.json create mode 100644 node_modules/extglob/LICENSE create mode 100644 node_modules/extglob/README.md create mode 100644 node_modules/extglob/changelog.md create mode 100644 node_modules/extglob/index.js create mode 100644 node_modules/extglob/lib/.DS_Store create mode 100644 node_modules/extglob/lib/compilers.js create mode 100644 node_modules/extglob/lib/extglob.js create mode 100644 node_modules/extglob/lib/parsers.js create mode 100644 node_modules/extglob/lib/utils.js create mode 100644 node_modules/extglob/node_modules/define-property/LICENSE create mode 100644 node_modules/extglob/node_modules/define-property/README.md create mode 100644 node_modules/extglob/node_modules/define-property/index.js create mode 100644 node_modules/extglob/node_modules/define-property/package.json create mode 100644 node_modules/extglob/node_modules/extend-shallow/LICENSE create mode 100644 node_modules/extglob/node_modules/extend-shallow/README.md create mode 100644 node_modules/extglob/node_modules/extend-shallow/index.js create mode 100644 node_modules/extglob/node_modules/extend-shallow/package.json create mode 100644 node_modules/extglob/node_modules/is-accessor-descriptor/LICENSE create mode 100644 node_modules/extglob/node_modules/is-accessor-descriptor/README.md create mode 100644 node_modules/extglob/node_modules/is-accessor-descriptor/index.js create mode 100644 node_modules/extglob/node_modules/is-accessor-descriptor/package.json create mode 100644 node_modules/extglob/node_modules/is-data-descriptor/LICENSE create mode 100644 node_modules/extglob/node_modules/is-data-descriptor/README.md create mode 100644 node_modules/extglob/node_modules/is-data-descriptor/index.js create mode 100644 node_modules/extglob/node_modules/is-data-descriptor/package.json create mode 100644 node_modules/extglob/node_modules/is-descriptor/LICENSE create mode 100644 node_modules/extglob/node_modules/is-descriptor/README.md create mode 100644 node_modules/extglob/node_modules/is-descriptor/index.js create mode 100644 node_modules/extglob/node_modules/is-descriptor/package.json create mode 100644 node_modules/extglob/package.json create mode 100644 node_modules/fancy-log/LICENSE create mode 100644 node_modules/fancy-log/README.md create mode 100644 node_modules/fancy-log/index.js create mode 100644 node_modules/fancy-log/package.json create mode 100644 node_modules/fast-deep-equal/LICENSE create mode 100644 node_modules/fast-deep-equal/README.md create mode 100644 node_modules/fast-deep-equal/es6/index.d.ts create mode 100644 node_modules/fast-deep-equal/es6/index.js create mode 100644 node_modules/fast-deep-equal/es6/react.d.ts create mode 100644 node_modules/fast-deep-equal/es6/react.js create mode 100644 node_modules/fast-deep-equal/index.d.ts create mode 100644 node_modules/fast-deep-equal/index.js create mode 100644 node_modules/fast-deep-equal/package.json create mode 100644 node_modules/fast-deep-equal/react.d.ts create mode 100644 node_modules/fast-deep-equal/react.js create mode 100644 node_modules/fast-json-stable-stringify/.eslintrc.yml create mode 100644 node_modules/fast-json-stable-stringify/.github/FUNDING.yml create mode 100644 node_modules/fast-json-stable-stringify/.travis.yml create mode 100644 node_modules/fast-json-stable-stringify/LICENSE create mode 100644 node_modules/fast-json-stable-stringify/README.md create mode 100644 node_modules/fast-json-stable-stringify/benchmark/index.js create mode 100644 node_modules/fast-json-stable-stringify/benchmark/test.json create mode 100644 node_modules/fast-json-stable-stringify/example/key_cmp.js create mode 100644 node_modules/fast-json-stable-stringify/example/nested.js create mode 100644 node_modules/fast-json-stable-stringify/example/str.js create mode 100644 node_modules/fast-json-stable-stringify/example/value_cmp.js create mode 100644 node_modules/fast-json-stable-stringify/index.d.ts create mode 100644 node_modules/fast-json-stable-stringify/index.js create mode 100644 node_modules/fast-json-stable-stringify/package.json create mode 100644 node_modules/fast-json-stable-stringify/test/cmp.js create mode 100644 node_modules/fast-json-stable-stringify/test/nested.js create mode 100644 node_modules/fast-json-stable-stringify/test/str.js create mode 100644 node_modules/fast-json-stable-stringify/test/to-json.js create mode 100644 node_modules/figgy-pudding/CHANGELOG.md create mode 100644 node_modules/figgy-pudding/LICENSE.md create mode 100644 node_modules/figgy-pudding/README.md create mode 100644 node_modules/figgy-pudding/index.js create mode 100644 node_modules/figgy-pudding/package.json create mode 100644 node_modules/fill-range/LICENSE create mode 100644 node_modules/fill-range/README.md create mode 100644 node_modules/fill-range/index.js create mode 100644 node_modules/fill-range/node_modules/extend-shallow/LICENSE create mode 100644 node_modules/fill-range/node_modules/extend-shallow/README.md create mode 100644 node_modules/fill-range/node_modules/extend-shallow/index.js create mode 100644 node_modules/fill-range/node_modules/extend-shallow/package.json create mode 100644 node_modules/fill-range/package.json create mode 100644 node_modules/find-cache-dir/index.js create mode 100644 node_modules/find-cache-dir/license create mode 100644 node_modules/find-cache-dir/package.json create mode 100644 node_modules/find-cache-dir/readme.md create mode 100644 node_modules/find-up/index.js create mode 100644 node_modules/find-up/license create mode 100644 node_modules/find-up/package.json create mode 100644 node_modules/find-up/readme.md create mode 100644 node_modules/findup-sync/LICENSE create mode 100644 node_modules/findup-sync/README.md create mode 100644 node_modules/findup-sync/index.js create mode 100644 node_modules/findup-sync/package.json create mode 100644 node_modules/fined/LICENSE create mode 100644 node_modules/fined/README.md create mode 100644 node_modules/fined/index.js create mode 100644 node_modules/fined/package.json create mode 100644 node_modules/flagged-respawn/LICENSE create mode 100644 node_modules/flagged-respawn/README.md create mode 100644 node_modules/flagged-respawn/index.js create mode 100644 node_modules/flagged-respawn/lib/is-v8flags.js create mode 100644 node_modules/flagged-respawn/lib/remover.js create mode 100644 node_modules/flagged-respawn/lib/reorder.js create mode 100644 node_modules/flagged-respawn/lib/respawn.js create mode 100644 node_modules/flagged-respawn/package.json create mode 100644 node_modules/flush-write-stream/.travis.yml create mode 100644 node_modules/flush-write-stream/LICENSE create mode 100644 node_modules/flush-write-stream/README.md create mode 100644 node_modules/flush-write-stream/example.js create mode 100644 node_modules/flush-write-stream/index.js create mode 100644 node_modules/flush-write-stream/package.json create mode 100644 node_modules/flush-write-stream/test.js create mode 100644 node_modules/for-in/LICENSE create mode 100644 node_modules/for-in/README.md create mode 100644 node_modules/for-in/index.js create mode 100644 node_modules/for-in/package.json create mode 100644 node_modules/for-own/LICENSE create mode 100644 node_modules/for-own/README.md create mode 100644 node_modules/for-own/index.js create mode 100644 node_modules/for-own/package.json create mode 100644 node_modules/fragment-cache/LICENSE create mode 100644 node_modules/fragment-cache/README.md create mode 100644 node_modules/fragment-cache/index.js create mode 100644 node_modules/fragment-cache/package.json create mode 100644 node_modules/from2/.travis.yml create mode 100644 node_modules/from2/LICENSE.md create mode 100644 node_modules/from2/README.md create mode 100644 node_modules/from2/index.js create mode 100644 node_modules/from2/package.json create mode 100644 node_modules/from2/test.js create mode 100644 node_modules/fs-mkdirp-stream/LICENSE create mode 100644 node_modules/fs-mkdirp-stream/README.md create mode 100644 node_modules/fs-mkdirp-stream/index.js create mode 100644 node_modules/fs-mkdirp-stream/mkdirp.js create mode 100644 node_modules/fs-mkdirp-stream/package.json create mode 100644 node_modules/fs-write-stream-atomic/.npmignore create mode 100644 node_modules/fs-write-stream-atomic/.travis.yml create mode 100644 node_modules/fs-write-stream-atomic/LICENSE create mode 100644 node_modules/fs-write-stream-atomic/README.md create mode 100644 node_modules/fs-write-stream-atomic/index.js create mode 100644 node_modules/fs-write-stream-atomic/package.json create mode 100644 node_modules/fs-write-stream-atomic/test/basic.js create mode 100644 node_modules/fs-write-stream-atomic/test/chown.js create mode 100644 node_modules/fs-write-stream-atomic/test/rename-eperm.js create mode 100644 node_modules/fs-write-stream-atomic/test/rename-fail.js create mode 100644 node_modules/fs-write-stream-atomic/test/slow-close.js create mode 100644 node_modules/fs-write-stream-atomic/test/toolong.js create mode 100644 node_modules/fs.realpath/LICENSE create mode 100644 node_modules/fs.realpath/README.md create mode 100644 node_modules/fs.realpath/index.js create mode 100644 node_modules/fs.realpath/old.js create mode 100644 node_modules/fs.realpath/package.json create mode 100644 node_modules/function-bind/.editorconfig create mode 100644 node_modules/function-bind/.eslintrc create mode 100644 node_modules/function-bind/.jscs.json create mode 100644 node_modules/function-bind/.npmignore create mode 100644 node_modules/function-bind/.travis.yml create mode 100644 node_modules/function-bind/LICENSE create mode 100644 node_modules/function-bind/README.md create mode 100644 node_modules/function-bind/implementation.js create mode 100644 node_modules/function-bind/index.js create mode 100644 node_modules/function-bind/package.json create mode 100644 node_modules/function-bind/test/.eslintrc create mode 100644 node_modules/function-bind/test/index.js create mode 100644 node_modules/get-caller-file/LICENSE.md create mode 100644 node_modules/get-caller-file/README.md create mode 100644 node_modules/get-caller-file/index.d.ts create mode 100644 node_modules/get-caller-file/index.js create mode 100644 node_modules/get-caller-file/index.js.map create mode 100644 node_modules/get-caller-file/package.json create mode 100644 node_modules/get-stream/buffer-stream.js create mode 100644 node_modules/get-stream/index.js create mode 100644 node_modules/get-stream/license create mode 100644 node_modules/get-stream/package.json create mode 100644 node_modules/get-stream/readme.md create mode 100644 node_modules/get-value/LICENSE create mode 100644 node_modules/get-value/index.js create mode 100644 node_modules/get-value/package.json create mode 100644 node_modules/glob-parent/LICENSE create mode 100644 node_modules/glob-parent/README.md create mode 100644 node_modules/glob-parent/index.js create mode 100644 node_modules/glob-parent/node_modules/is-glob/LICENSE create mode 100644 node_modules/glob-parent/node_modules/is-glob/README.md create mode 100644 node_modules/glob-parent/node_modules/is-glob/index.js create mode 100644 node_modules/glob-parent/node_modules/is-glob/package.json create mode 100644 node_modules/glob-parent/package.json create mode 100755 node_modules/glob-stream/LICENSE create mode 100644 node_modules/glob-stream/README.md create mode 100644 node_modules/glob-stream/index.js create mode 100644 node_modules/glob-stream/package.json create mode 100644 node_modules/glob-stream/readable.js create mode 100755 node_modules/glob-watcher/LICENSE create mode 100644 node_modules/glob-watcher/README.md create mode 100644 node_modules/glob-watcher/index.js create mode 100644 node_modules/glob-watcher/package.json create mode 100644 node_modules/glob/LICENSE create mode 100644 node_modules/glob/README.md create mode 100644 node_modules/glob/changelog.md create mode 100644 node_modules/glob/common.js create mode 100644 node_modules/glob/glob.js create mode 100644 node_modules/glob/package.json create mode 100644 node_modules/glob/sync.js create mode 100644 node_modules/global-modules/LICENSE create mode 100644 node_modules/global-modules/README.md create mode 100644 node_modules/global-modules/index.js create mode 100644 node_modules/global-modules/node_modules/global-prefix/LICENSE create mode 100644 node_modules/global-modules/node_modules/global-prefix/README.md create mode 100644 node_modules/global-modules/node_modules/global-prefix/index.js create mode 100644 node_modules/global-modules/node_modules/global-prefix/package.json create mode 100644 node_modules/global-modules/package.json create mode 100644 node_modules/global-prefix/LICENSE create mode 100644 node_modules/global-prefix/README.md create mode 100644 node_modules/global-prefix/index.js create mode 100644 node_modules/global-prefix/package.json create mode 100644 node_modules/glogg/LICENSE create mode 100644 node_modules/glogg/README.md create mode 100644 node_modules/glogg/index.js create mode 100644 node_modules/glogg/package.json create mode 100644 node_modules/graceful-fs/LICENSE create mode 100644 node_modules/graceful-fs/README.md create mode 100644 node_modules/graceful-fs/clone.js create mode 100644 node_modules/graceful-fs/graceful-fs.js create mode 100644 node_modules/graceful-fs/legacy-streams.js create mode 100644 node_modules/graceful-fs/package.json create mode 100644 node_modules/graceful-fs/polyfills.js create mode 100644 node_modules/gulp/CHANGELOG.md create mode 100644 node_modules/gulp/LICENSE create mode 100644 node_modules/gulp/README.md create mode 100755 node_modules/gulp/bin/gulp.js create mode 100644 node_modules/gulp/index.js create mode 120000 node_modules/gulp/node_modules/.bin/gulp create mode 100644 node_modules/gulp/node_modules/ansi-regex/index.js create mode 100644 node_modules/gulp/node_modules/ansi-regex/license create mode 100644 node_modules/gulp/node_modules/ansi-regex/package.json create mode 100644 node_modules/gulp/node_modules/ansi-regex/readme.md create mode 100644 node_modules/gulp/node_modules/camelcase/index.js create mode 100644 node_modules/gulp/node_modules/camelcase/license create mode 100644 node_modules/gulp/node_modules/camelcase/package.json create mode 100644 node_modules/gulp/node_modules/camelcase/readme.md create mode 100644 node_modules/gulp/node_modules/cliui/CHANGELOG.md create mode 100644 node_modules/gulp/node_modules/cliui/LICENSE.txt create mode 100644 node_modules/gulp/node_modules/cliui/README.md create mode 100644 node_modules/gulp/node_modules/cliui/index.js create mode 100644 node_modules/gulp/node_modules/cliui/package.json create mode 100644 node_modules/gulp/node_modules/get-caller-file/LICENSE.md create mode 100644 node_modules/gulp/node_modules/get-caller-file/README.md create mode 100644 node_modules/gulp/node_modules/get-caller-file/index.js create mode 100644 node_modules/gulp/node_modules/get-caller-file/package.json create mode 100644 node_modules/gulp/node_modules/gulp-cli/LICENSE create mode 100644 node_modules/gulp/node_modules/gulp-cli/README.md create mode 100755 node_modules/gulp/node_modules/gulp-cli/bin/gulp.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/completion/README.md create mode 100644 node_modules/gulp/node_modules/gulp-cli/completion/bash create mode 100644 node_modules/gulp/node_modules/gulp-cli/completion/fish create mode 100644 node_modules/gulp/node_modules/gulp-cli/completion/powershell create mode 100644 node_modules/gulp/node_modules/gulp-cli/completion/zsh create mode 100644 node_modules/gulp/node_modules/gulp-cli/gulp.1 create mode 100644 node_modules/gulp/node_modules/gulp-cli/index.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/ansi.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/cli-options.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/completion.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/config/cli-flags.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/config/env-flags.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/config/load-files.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/exit.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/get-blacklist.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/log/blacklist-error.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/log/copy-tree.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/log/tasks.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/log/to-console.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/log/verify.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/make-title.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/register-exports.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/tildify.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/shared/verify-dependencies.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/format-error.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/index.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/log/events.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/log/tasks-simple.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/task-tree.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0-alpha.1/index.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0-alpha.2/index.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/format-error.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/events.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/get-task.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/sync-task.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/tasks-simple.js create mode 100644 node_modules/gulp/node_modules/gulp-cli/package.json create mode 100644 node_modules/gulp/node_modules/invert-kv/index.js create mode 100644 node_modules/gulp/node_modules/invert-kv/package.json create mode 100644 node_modules/gulp/node_modules/invert-kv/readme.md create mode 100644 node_modules/gulp/node_modules/is-fullwidth-code-point/index.js create mode 100644 node_modules/gulp/node_modules/is-fullwidth-code-point/license create mode 100644 node_modules/gulp/node_modules/is-fullwidth-code-point/package.json create mode 100644 node_modules/gulp/node_modules/is-fullwidth-code-point/readme.md create mode 100644 node_modules/gulp/node_modules/lcid/index.js create mode 100644 node_modules/gulp/node_modules/lcid/lcid.json create mode 100644 node_modules/gulp/node_modules/lcid/license create mode 100644 node_modules/gulp/node_modules/lcid/package.json create mode 100644 node_modules/gulp/node_modules/lcid/readme.md create mode 100644 node_modules/gulp/node_modules/os-locale/index.js create mode 100644 node_modules/gulp/node_modules/os-locale/license create mode 100644 node_modules/gulp/node_modules/os-locale/package.json create mode 100644 node_modules/gulp/node_modules/os-locale/readme.md create mode 100644 node_modules/gulp/node_modules/require-main-filename/.npmignore create mode 100644 node_modules/gulp/node_modules/require-main-filename/.travis.yml create mode 100644 node_modules/gulp/node_modules/require-main-filename/LICENSE.txt create mode 100644 node_modules/gulp/node_modules/require-main-filename/README.md create mode 100644 node_modules/gulp/node_modules/require-main-filename/index.js create mode 100644 node_modules/gulp/node_modules/require-main-filename/package.json create mode 100644 node_modules/gulp/node_modules/require-main-filename/test.js create mode 100644 node_modules/gulp/node_modules/string-width/index.js create mode 100644 node_modules/gulp/node_modules/string-width/license create mode 100644 node_modules/gulp/node_modules/string-width/package.json create mode 100644 node_modules/gulp/node_modules/string-width/readme.md create mode 100644 node_modules/gulp/node_modules/strip-ansi/index.js create mode 100644 node_modules/gulp/node_modules/strip-ansi/license create mode 100644 node_modules/gulp/node_modules/strip-ansi/package.json create mode 100644 node_modules/gulp/node_modules/strip-ansi/readme.md create mode 100644 node_modules/gulp/node_modules/which-module/CHANGELOG.md create mode 100644 node_modules/gulp/node_modules/which-module/LICENSE create mode 100644 node_modules/gulp/node_modules/which-module/README.md create mode 100644 node_modules/gulp/node_modules/which-module/index.js create mode 100644 node_modules/gulp/node_modules/which-module/package.json create mode 100755 node_modules/gulp/node_modules/wrap-ansi/index.js create mode 100644 node_modules/gulp/node_modules/wrap-ansi/license create mode 100644 node_modules/gulp/node_modules/wrap-ansi/package.json create mode 100644 node_modules/gulp/node_modules/wrap-ansi/readme.md create mode 100644 node_modules/gulp/node_modules/y18n/LICENSE create mode 100644 node_modules/gulp/node_modules/y18n/README.md create mode 100644 node_modules/gulp/node_modules/y18n/index.js create mode 100644 node_modules/gulp/node_modules/y18n/package.json create mode 100644 node_modules/gulp/node_modules/yargs-parser/CHANGELOG.md create mode 100644 node_modules/gulp/node_modules/yargs-parser/LICENSE.txt create mode 100644 node_modules/gulp/node_modules/yargs-parser/README.md create mode 100644 node_modules/gulp/node_modules/yargs-parser/index.js create mode 100644 node_modules/gulp/node_modules/yargs-parser/lib/tokenize-arg-string.js create mode 100644 node_modules/gulp/node_modules/yargs-parser/package.json create mode 100644 node_modules/gulp/node_modules/yargs/CHANGELOG.md create mode 100644 node_modules/gulp/node_modules/yargs/LICENSE create mode 100644 node_modules/gulp/node_modules/yargs/README.md create mode 100644 node_modules/gulp/node_modules/yargs/completion.sh.hbs create mode 100644 node_modules/gulp/node_modules/yargs/index.js create mode 100644 node_modules/gulp/node_modules/yargs/lib/apply-extends.js create mode 100644 node_modules/gulp/node_modules/yargs/lib/argsert.js create mode 100644 node_modules/gulp/node_modules/yargs/lib/assign.js create mode 100644 node_modules/gulp/node_modules/yargs/lib/command.js create mode 100644 node_modules/gulp/node_modules/yargs/lib/completion.js create mode 100644 node_modules/gulp/node_modules/yargs/lib/levenshtein.js create mode 100644 node_modules/gulp/node_modules/yargs/lib/obj-filter.js create mode 100644 node_modules/gulp/node_modules/yargs/lib/usage.js create mode 100644 node_modules/gulp/node_modules/yargs/lib/validation.js create mode 100644 node_modules/gulp/node_modules/yargs/lib/yerror.js create mode 100644 node_modules/gulp/node_modules/yargs/locales/be.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/de.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/en.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/es.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/fr.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/hi.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/hu.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/id.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/it.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/ja.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/ko.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/nb.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/nl.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/pirate.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/pl.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/pt.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/pt_BR.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/ru.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/th.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/tr.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/zh_CN.json create mode 100644 node_modules/gulp/node_modules/yargs/locales/zh_TW.json create mode 100644 node_modules/gulp/node_modules/yargs/package.json create mode 100644 node_modules/gulp/node_modules/yargs/yargs.js create mode 100644 node_modules/gulp/package.json create mode 100644 node_modules/gulplog/CHANGELOG.md create mode 100644 node_modules/gulplog/LICENSE create mode 100644 node_modules/gulplog/README.md create mode 100644 node_modules/gulplog/index.js create mode 100644 node_modules/gulplog/package.json create mode 100644 node_modules/has-flag/index.js create mode 100644 node_modules/has-flag/license create mode 100644 node_modules/has-flag/package.json create mode 100644 node_modules/has-flag/readme.md create mode 100644 node_modules/has-symbols/.eslintrc create mode 100644 node_modules/has-symbols/.github/FUNDING.yml create mode 100644 node_modules/has-symbols/.github/workflows/rebase.yml create mode 100644 node_modules/has-symbols/.travis.yml create mode 100644 node_modules/has-symbols/CHANGELOG.md create mode 100644 node_modules/has-symbols/LICENSE create mode 100644 node_modules/has-symbols/README.md create mode 100644 node_modules/has-symbols/index.js create mode 100644 node_modules/has-symbols/package.json create mode 100644 node_modules/has-symbols/shams.js create mode 100644 node_modules/has-symbols/test/index.js create mode 100644 node_modules/has-symbols/test/shams/core-js.js create mode 100644 node_modules/has-symbols/test/shams/get-own-property-symbols.js create mode 100644 node_modules/has-symbols/test/tests.js create mode 100644 node_modules/has-value/LICENSE create mode 100644 node_modules/has-value/README.md create mode 100644 node_modules/has-value/index.js create mode 100644 node_modules/has-value/package.json create mode 100644 node_modules/has-values/LICENSE create mode 100644 node_modules/has-values/README.md create mode 100644 node_modules/has-values/index.js create mode 100644 node_modules/has-values/node_modules/kind-of/LICENSE create mode 100644 node_modules/has-values/node_modules/kind-of/README.md create mode 100644 node_modules/has-values/node_modules/kind-of/index.js create mode 100644 node_modules/has-values/node_modules/kind-of/package.json create mode 100644 node_modules/has-values/package.json create mode 100644 node_modules/hash-base/LICENSE create mode 100644 node_modules/hash-base/README.md create mode 100644 node_modules/hash-base/index.js create mode 100644 node_modules/hash-base/package.json create mode 100644 node_modules/hash.js/.eslintrc.js create mode 100644 node_modules/hash.js/.travis.yml create mode 100644 node_modules/hash.js/README.md create mode 100644 node_modules/hash.js/lib/hash.d.ts create mode 100644 node_modules/hash.js/lib/hash.js create mode 100644 node_modules/hash.js/lib/hash/common.js create mode 100644 node_modules/hash.js/lib/hash/hmac.js create mode 100644 node_modules/hash.js/lib/hash/ripemd.js create mode 100644 node_modules/hash.js/lib/hash/sha.js create mode 100644 node_modules/hash.js/lib/hash/sha/1.js create mode 100644 node_modules/hash.js/lib/hash/sha/224.js create mode 100644 node_modules/hash.js/lib/hash/sha/256.js create mode 100644 node_modules/hash.js/lib/hash/sha/384.js create mode 100644 node_modules/hash.js/lib/hash/sha/512.js create mode 100644 node_modules/hash.js/lib/hash/sha/common.js create mode 100644 node_modules/hash.js/lib/hash/utils.js create mode 100644 node_modules/hash.js/package.json create mode 100644 node_modules/hash.js/test/hash-test.js create mode 100644 node_modules/hash.js/test/hmac-test.js create mode 100644 node_modules/hmac-drbg/.npmignore create mode 100644 node_modules/hmac-drbg/.travis.yml create mode 100644 node_modules/hmac-drbg/README.md create mode 100644 node_modules/hmac-drbg/lib/hmac-drbg.js create mode 100644 node_modules/hmac-drbg/package.json create mode 100644 node_modules/hmac-drbg/test/drbg-test.js create mode 100644 node_modules/hmac-drbg/test/fixtures/hmac-drbg-nist.json create mode 100644 node_modules/homedir-polyfill/LICENSE create mode 100644 node_modules/homedir-polyfill/README.md create mode 100644 node_modules/homedir-polyfill/index.js create mode 100644 node_modules/homedir-polyfill/package.json create mode 100644 node_modules/homedir-polyfill/polyfill.js create mode 100644 node_modules/hosted-git-info/CHANGELOG.md create mode 100644 node_modules/hosted-git-info/LICENSE create mode 100644 node_modules/hosted-git-info/README.md create mode 100644 node_modules/hosted-git-info/git-host-info.js create mode 100644 node_modules/hosted-git-info/git-host.js create mode 100644 node_modules/hosted-git-info/index.js create mode 100644 node_modules/hosted-git-info/package.json create mode 100644 node_modules/https-browserify/LICENSE create mode 100644 node_modules/https-browserify/index.js create mode 100644 node_modules/https-browserify/package.json create mode 100644 node_modules/https-browserify/readme.markdown create mode 100644 node_modules/ieee754/LICENSE create mode 100644 node_modules/ieee754/README.md create mode 100644 node_modules/ieee754/index.js create mode 100644 node_modules/ieee754/package.json create mode 100644 node_modules/iferr/.npmignore create mode 100644 node_modules/iferr/LICENSE create mode 100644 node_modules/iferr/README.md create mode 100644 node_modules/iferr/index.coffee create mode 100644 node_modules/iferr/index.js create mode 100644 node_modules/iferr/package.json create mode 100644 node_modules/iferr/test/index.coffee create mode 100644 node_modules/iferr/test/mocha.opts create mode 100755 node_modules/import-local/fixtures/cli.js create mode 100644 node_modules/import-local/index.js create mode 100644 node_modules/import-local/license create mode 100644 node_modules/import-local/package.json create mode 100644 node_modules/import-local/readme.md create mode 100644 node_modules/imurmurhash/README.md create mode 100644 node_modules/imurmurhash/imurmurhash.js create mode 100644 node_modules/imurmurhash/imurmurhash.min.js create mode 100644 node_modules/imurmurhash/package.json create mode 100644 node_modules/infer-owner/LICENSE create mode 100644 node_modules/infer-owner/README.md create mode 100644 node_modules/infer-owner/index.js create mode 100644 node_modules/infer-owner/package.json create mode 100644 node_modules/inflight/LICENSE create mode 100644 node_modules/inflight/README.md create mode 100644 node_modules/inflight/inflight.js create mode 100644 node_modules/inflight/package.json create mode 100644 node_modules/inherits/LICENSE create mode 100644 node_modules/inherits/README.md create mode 100644 node_modules/inherits/inherits.js create mode 100644 node_modules/inherits/inherits_browser.js create mode 100644 node_modules/inherits/package.json create mode 100644 node_modules/ini/LICENSE create mode 100644 node_modules/ini/README.md create mode 100644 node_modules/ini/ini.js create mode 100644 node_modules/ini/package.json create mode 100644 node_modules/interpret/CHANGELOG create mode 100644 node_modules/interpret/LICENSE create mode 100644 node_modules/interpret/README.md create mode 100644 node_modules/interpret/index.js create mode 100644 node_modules/interpret/package.json create mode 100644 node_modules/invert-kv/index.js create mode 100644 node_modules/invert-kv/license create mode 100644 node_modules/invert-kv/package.json create mode 100644 node_modules/invert-kv/readme.md create mode 100644 node_modules/is-absolute/LICENSE create mode 100644 node_modules/is-absolute/README.md create mode 100644 node_modules/is-absolute/index.js create mode 100644 node_modules/is-absolute/package.json create mode 100644 node_modules/is-accessor-descriptor/LICENSE create mode 100644 node_modules/is-accessor-descriptor/README.md create mode 100644 node_modules/is-accessor-descriptor/index.js create mode 100644 node_modules/is-accessor-descriptor/node_modules/kind-of/LICENSE create mode 100644 node_modules/is-accessor-descriptor/node_modules/kind-of/README.md create mode 100644 node_modules/is-accessor-descriptor/node_modules/kind-of/index.js create mode 100644 node_modules/is-accessor-descriptor/node_modules/kind-of/package.json create mode 100644 node_modules/is-accessor-descriptor/package.json create mode 100644 node_modules/is-arrayish/.editorconfig create mode 100644 node_modules/is-arrayish/.istanbul.yml create mode 100644 node_modules/is-arrayish/.npmignore create mode 100644 node_modules/is-arrayish/.travis.yml create mode 100644 node_modules/is-arrayish/LICENSE create mode 100644 node_modules/is-arrayish/README.md create mode 100644 node_modules/is-arrayish/index.js create mode 100644 node_modules/is-arrayish/package.json create mode 100644 node_modules/is-binary-path/index.js create mode 100644 node_modules/is-binary-path/license create mode 100644 node_modules/is-binary-path/package.json create mode 100644 node_modules/is-binary-path/readme.md create mode 100644 node_modules/is-buffer/LICENSE create mode 100644 node_modules/is-buffer/README.md create mode 100644 node_modules/is-buffer/index.js create mode 100644 node_modules/is-buffer/package.json create mode 100644 node_modules/is-buffer/test/basic.js create mode 100644 node_modules/is-data-descriptor/LICENSE create mode 100644 node_modules/is-data-descriptor/README.md create mode 100644 node_modules/is-data-descriptor/index.js create mode 100644 node_modules/is-data-descriptor/node_modules/kind-of/LICENSE create mode 100644 node_modules/is-data-descriptor/node_modules/kind-of/README.md create mode 100644 node_modules/is-data-descriptor/node_modules/kind-of/index.js create mode 100644 node_modules/is-data-descriptor/node_modules/kind-of/package.json create mode 100644 node_modules/is-data-descriptor/package.json create mode 100644 node_modules/is-descriptor/LICENSE create mode 100644 node_modules/is-descriptor/README.md create mode 100644 node_modules/is-descriptor/index.js create mode 100644 node_modules/is-descriptor/node_modules/kind-of/LICENSE create mode 100644 node_modules/is-descriptor/node_modules/kind-of/README.md create mode 100644 node_modules/is-descriptor/node_modules/kind-of/index.js create mode 100644 node_modules/is-descriptor/node_modules/kind-of/package.json create mode 100644 node_modules/is-descriptor/package.json create mode 100644 node_modules/is-extendable/LICENSE create mode 100644 node_modules/is-extendable/README.md create mode 100644 node_modules/is-extendable/index.js create mode 100644 node_modules/is-extendable/package.json create mode 100644 node_modules/is-extglob/LICENSE create mode 100644 node_modules/is-extglob/README.md create mode 100644 node_modules/is-extglob/index.js create mode 100644 node_modules/is-extglob/package.json create mode 100644 node_modules/is-fullwidth-code-point/index.js create mode 100644 node_modules/is-fullwidth-code-point/license create mode 100644 node_modules/is-fullwidth-code-point/package.json create mode 100644 node_modules/is-fullwidth-code-point/readme.md create mode 100644 node_modules/is-glob/LICENSE create mode 100644 node_modules/is-glob/README.md create mode 100644 node_modules/is-glob/index.js create mode 100644 node_modules/is-glob/package.json create mode 100644 node_modules/is-negated-glob/LICENSE create mode 100644 node_modules/is-negated-glob/README.md create mode 100644 node_modules/is-negated-glob/index.js create mode 100644 node_modules/is-negated-glob/package.json create mode 100644 node_modules/is-number/LICENSE create mode 100644 node_modules/is-number/README.md create mode 100644 node_modules/is-number/index.js create mode 100644 node_modules/is-number/node_modules/kind-of/LICENSE create mode 100644 node_modules/is-number/node_modules/kind-of/README.md create mode 100644 node_modules/is-number/node_modules/kind-of/index.js create mode 100644 node_modules/is-number/node_modules/kind-of/package.json create mode 100644 node_modules/is-number/package.json create mode 100644 node_modules/is-plain-object/LICENSE create mode 100644 node_modules/is-plain-object/README.md create mode 100644 node_modules/is-plain-object/index.d.ts create mode 100644 node_modules/is-plain-object/index.js create mode 100644 node_modules/is-plain-object/package.json create mode 100644 node_modules/is-relative/LICENSE create mode 100644 node_modules/is-relative/README.md create mode 100644 node_modules/is-relative/index.js create mode 100644 node_modules/is-relative/package.json create mode 100644 node_modules/is-stream/index.js create mode 100644 node_modules/is-stream/license create mode 100644 node_modules/is-stream/package.json create mode 100644 node_modules/is-stream/readme.md create mode 100644 node_modules/is-unc-path/LICENSE create mode 100644 node_modules/is-unc-path/README.md create mode 100644 node_modules/is-unc-path/index.js create mode 100644 node_modules/is-unc-path/package.json create mode 100644 node_modules/is-utf8/LICENSE create mode 100644 node_modules/is-utf8/README.md create mode 100644 node_modules/is-utf8/is-utf8.js create mode 100644 node_modules/is-utf8/package.json create mode 100644 node_modules/is-valid-glob/LICENSE create mode 100644 node_modules/is-valid-glob/README.md create mode 100644 node_modules/is-valid-glob/index.js create mode 100644 node_modules/is-valid-glob/package.json create mode 100644 node_modules/is-windows/LICENSE create mode 100644 node_modules/is-windows/README.md create mode 100644 node_modules/is-windows/index.js create mode 100644 node_modules/is-windows/package.json create mode 100644 node_modules/is-wsl/index.js create mode 100644 node_modules/is-wsl/license create mode 100644 node_modules/is-wsl/package.json create mode 100644 node_modules/is-wsl/readme.md create mode 100644 node_modules/isarray/.npmignore create mode 100644 node_modules/isarray/.travis.yml create mode 100644 node_modules/isarray/Makefile create mode 100644 node_modules/isarray/README.md create mode 100644 node_modules/isarray/component.json create mode 100644 node_modules/isarray/index.js create mode 100644 node_modules/isarray/package.json create mode 100644 node_modules/isarray/test.js create mode 100644 node_modules/isexe/.npmignore create mode 100644 node_modules/isexe/LICENSE create mode 100644 node_modules/isexe/README.md create mode 100644 node_modules/isexe/index.js create mode 100644 node_modules/isexe/mode.js create mode 100644 node_modules/isexe/package.json create mode 100644 node_modules/isexe/test/basic.js create mode 100644 node_modules/isexe/windows.js create mode 100644 node_modules/isobject/LICENSE create mode 100644 node_modules/isobject/README.md create mode 100644 node_modules/isobject/index.d.ts create mode 100644 node_modules/isobject/index.js create mode 100644 node_modules/isobject/package.json create mode 100644 node_modules/json-parse-better-errors/CHANGELOG.md create mode 100644 node_modules/json-parse-better-errors/LICENSE.md create mode 100644 node_modules/json-parse-better-errors/README.md create mode 100644 node_modules/json-parse-better-errors/index.js create mode 100644 node_modules/json-parse-better-errors/package.json create mode 100644 node_modules/json-schema-traverse/.eslintrc.yml create mode 100644 node_modules/json-schema-traverse/.travis.yml create mode 100644 node_modules/json-schema-traverse/LICENSE create mode 100644 node_modules/json-schema-traverse/README.md create mode 100644 node_modules/json-schema-traverse/index.js create mode 100644 node_modules/json-schema-traverse/package.json create mode 100644 node_modules/json-schema-traverse/spec/.eslintrc.yml create mode 100644 node_modules/json-schema-traverse/spec/fixtures/schema.js create mode 100644 node_modules/json-schema-traverse/spec/index.spec.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/.npmignore create mode 100644 node_modules/json-stable-stringify-without-jsonify/.travis.yml create mode 100644 node_modules/json-stable-stringify-without-jsonify/LICENSE create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/key_cmp.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/nested.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/str.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/value_cmp.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/index.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/package.json create mode 100644 node_modules/json-stable-stringify-without-jsonify/readme.markdown create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/cmp.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/nested.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/replacer.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/space.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/str.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/to-json.js create mode 100644 node_modules/json5/CHANGELOG.md create mode 100644 node_modules/json5/LICENSE.md create mode 100644 node_modules/json5/README.md create mode 100644 node_modules/json5/dist/index.js create mode 100755 node_modules/json5/lib/cli.js create mode 100644 node_modules/json5/lib/index.js create mode 100644 node_modules/json5/lib/parse.js create mode 100644 node_modules/json5/lib/register.js create mode 100644 node_modules/json5/lib/require.js create mode 100644 node_modules/json5/lib/stringify.js create mode 100644 node_modules/json5/lib/unicode.js create mode 100644 node_modules/json5/lib/util.js create mode 100644 node_modules/json5/package.json create mode 100644 node_modules/just-debounce/.eslintrc create mode 100644 node_modules/just-debounce/.npmignore create mode 100644 node_modules/just-debounce/LICENSE create mode 100644 node_modules/just-debounce/README.md create mode 100644 node_modules/just-debounce/index.js create mode 100644 node_modules/just-debounce/package.json create mode 100644 node_modules/just-debounce/test.js create mode 100644 node_modules/kind-of/CHANGELOG.md create mode 100644 node_modules/kind-of/LICENSE create mode 100644 node_modules/kind-of/README.md create mode 100644 node_modules/kind-of/index.js create mode 100644 node_modules/kind-of/package.json create mode 100644 node_modules/last-run/LICENSE create mode 100644 node_modules/last-run/README.md create mode 100644 node_modules/last-run/index.js create mode 100644 node_modules/last-run/package.json create mode 100644 node_modules/lazystream/.npmignore create mode 100644 node_modules/lazystream/.travis.yml create mode 100644 node_modules/lazystream/LICENSE-MIT create mode 100644 node_modules/lazystream/README.md create mode 100644 node_modules/lazystream/lib/lazystream.js create mode 100644 node_modules/lazystream/package.json create mode 100644 node_modules/lazystream/secret create mode 100644 node_modules/lazystream/test/data.md create mode 100644 node_modules/lazystream/test/fs_test.js create mode 100644 node_modules/lazystream/test/helper.js create mode 100644 node_modules/lazystream/test/pipe_test.js create mode 100644 node_modules/lazystream/test/readable_test.js create mode 100644 node_modules/lazystream/test/writable_test.js create mode 100644 node_modules/lcid/index.js create mode 100644 node_modules/lcid/lcid.json create mode 100644 node_modules/lcid/license create mode 100644 node_modules/lcid/package.json create mode 100644 node_modules/lcid/readme.md create mode 100644 node_modules/lead/LICENSE create mode 100644 node_modules/lead/README.md create mode 100644 node_modules/lead/index.js create mode 100644 node_modules/lead/package.json create mode 100644 node_modules/liftoff/CHANGELOG create mode 100644 node_modules/liftoff/LICENSE create mode 100644 node_modules/liftoff/README.md create mode 100644 node_modules/liftoff/index.js create mode 100644 node_modules/liftoff/lib/build_config_name.js create mode 100644 node_modules/liftoff/lib/file_search.js create mode 100644 node_modules/liftoff/lib/find_config.js create mode 100644 node_modules/liftoff/lib/find_cwd.js create mode 100644 node_modules/liftoff/lib/get_node_flags.js create mode 100644 node_modules/liftoff/lib/parse_options.js create mode 100644 node_modules/liftoff/lib/register_loader.js create mode 100644 node_modules/liftoff/lib/silent_require.js create mode 100644 node_modules/liftoff/package.json create mode 100644 node_modules/load-json-file/index.js create mode 100644 node_modules/load-json-file/license create mode 100644 node_modules/load-json-file/node_modules/pify/index.js create mode 100644 node_modules/load-json-file/node_modules/pify/license create mode 100644 node_modules/load-json-file/node_modules/pify/package.json create mode 100644 node_modules/load-json-file/node_modules/pify/readme.md create mode 100644 node_modules/load-json-file/package.json create mode 100644 node_modules/load-json-file/readme.md create mode 100644 node_modules/loader-runner/LICENSE create mode 100644 node_modules/loader-runner/README.md create mode 100644 node_modules/loader-runner/lib/LoaderLoadingError.js create mode 100644 node_modules/loader-runner/lib/LoaderRunner.js create mode 100644 node_modules/loader-runner/lib/loadLoader.js create mode 100644 node_modules/loader-runner/package.json create mode 100644 node_modules/loader-utils/CHANGELOG.md create mode 100644 node_modules/loader-utils/LICENSE create mode 100644 node_modules/loader-utils/README.md create mode 100644 node_modules/loader-utils/lib/getCurrentRequest.js create mode 100644 node_modules/loader-utils/lib/getHashDigest.js create mode 100644 node_modules/loader-utils/lib/getOptions.js create mode 100644 node_modules/loader-utils/lib/getRemainingRequest.js create mode 100644 node_modules/loader-utils/lib/index.js create mode 100644 node_modules/loader-utils/lib/interpolateName.js create mode 100644 node_modules/loader-utils/lib/isUrlRequest.js create mode 100644 node_modules/loader-utils/lib/parseQuery.js create mode 100644 node_modules/loader-utils/lib/parseString.js create mode 100644 node_modules/loader-utils/lib/stringifyRequest.js create mode 100644 node_modules/loader-utils/lib/urlToRequest.js create mode 100644 node_modules/loader-utils/package.json create mode 100644 node_modules/locate-path/index.js create mode 100644 node_modules/locate-path/license create mode 100644 node_modules/locate-path/package.json create mode 100644 node_modules/locate-path/readme.md create mode 100644 node_modules/lru-cache/LICENSE create mode 100644 node_modules/lru-cache/README.md create mode 100644 node_modules/lru-cache/index.js create mode 100644 node_modules/lru-cache/package.json create mode 100644 node_modules/make-dir/index.d.ts create mode 100644 node_modules/make-dir/index.js create mode 100644 node_modules/make-dir/license create mode 100644 node_modules/make-dir/package.json create mode 100644 node_modules/make-dir/readme.md create mode 100644 node_modules/make-iterator/LICENSE create mode 100644 node_modules/make-iterator/README.md create mode 100644 node_modules/make-iterator/index.js create mode 100644 node_modules/make-iterator/package.json create mode 100644 node_modules/mamacro/index.js create mode 100644 node_modules/mamacro/package.json create mode 100644 node_modules/map-age-cleaner/dist/index.d.ts create mode 100644 node_modules/map-age-cleaner/dist/index.js create mode 100644 node_modules/map-age-cleaner/license create mode 100644 node_modules/map-age-cleaner/package.json create mode 100644 node_modules/map-age-cleaner/readme.md create mode 100644 node_modules/map-cache/LICENSE create mode 100644 node_modules/map-cache/README.md create mode 100644 node_modules/map-cache/index.js create mode 100644 node_modules/map-cache/package.json create mode 100644 node_modules/map-visit/LICENSE create mode 100644 node_modules/map-visit/README.md create mode 100644 node_modules/map-visit/index.js create mode 100644 node_modules/map-visit/package.json create mode 100644 node_modules/matchdep/.jshintrc create mode 100644 node_modules/matchdep/.npmignore create mode 100644 node_modules/matchdep/.travis.yml create mode 100644 node_modules/matchdep/LICENSE-MIT create mode 100644 node_modules/matchdep/README.md create mode 100644 node_modules/matchdep/lib/matchdep.js create mode 100644 node_modules/matchdep/node_modules/findup-sync/README.md create mode 100644 node_modules/matchdep/node_modules/findup-sync/index.js create mode 100644 node_modules/matchdep/node_modules/findup-sync/package.json create mode 100644 node_modules/matchdep/node_modules/is-glob/LICENSE create mode 100644 node_modules/matchdep/node_modules/is-glob/README.md create mode 100644 node_modules/matchdep/node_modules/is-glob/index.js create mode 100644 node_modules/matchdep/node_modules/is-glob/package.json create mode 100644 node_modules/matchdep/package.json create mode 100644 node_modules/md5.js/LICENSE create mode 100644 node_modules/md5.js/README.md create mode 100644 node_modules/md5.js/index.js create mode 100644 node_modules/md5.js/package.json create mode 100644 node_modules/mem/index.d.ts create mode 100644 node_modules/mem/index.js create mode 100644 node_modules/mem/license create mode 100644 node_modules/mem/package.json create mode 100644 node_modules/mem/readme.md create mode 100644 node_modules/memory-fs/README.md create mode 100644 node_modules/memory-fs/lib/MemoryFileSystem.js create mode 100644 node_modules/memory-fs/lib/join.js create mode 100644 node_modules/memory-fs/lib/normalize.js create mode 100644 node_modules/memory-fs/package.json create mode 100644 node_modules/micromatch/CHANGELOG.md create mode 100755 node_modules/micromatch/LICENSE create mode 100644 node_modules/micromatch/README.md create mode 100644 node_modules/micromatch/index.js create mode 100644 node_modules/micromatch/lib/.DS_Store create mode 100644 node_modules/micromatch/lib/cache.js create mode 100644 node_modules/micromatch/lib/compilers.js create mode 100644 node_modules/micromatch/lib/parsers.js create mode 100644 node_modules/micromatch/lib/utils.js create mode 100644 node_modules/micromatch/package.json create mode 100644 node_modules/miller-rabin/.npmignore create mode 100644 node_modules/miller-rabin/1.js create mode 100644 node_modules/miller-rabin/README.md create mode 100755 node_modules/miller-rabin/bin/miller-rabin create mode 100644 node_modules/miller-rabin/lib/mr.js create mode 100644 node_modules/miller-rabin/package.json create mode 100644 node_modules/miller-rabin/test.js create mode 100644 node_modules/miller-rabin/test/api-test.js create mode 100644 node_modules/mimic-fn/index.d.ts create mode 100644 node_modules/mimic-fn/index.js create mode 100644 node_modules/mimic-fn/license create mode 100644 node_modules/mimic-fn/package.json create mode 100644 node_modules/mimic-fn/readme.md create mode 100644 node_modules/minimalistic-assert/LICENSE create mode 100644 node_modules/minimalistic-assert/index.js create mode 100644 node_modules/minimalistic-assert/package.json create mode 100644 node_modules/minimalistic-assert/readme.md create mode 100644 node_modules/minimalistic-crypto-utils/.npmignore create mode 100644 node_modules/minimalistic-crypto-utils/.travis.yml create mode 100644 node_modules/minimalistic-crypto-utils/README.md create mode 100644 node_modules/minimalistic-crypto-utils/lib/utils.js create mode 100644 node_modules/minimalistic-crypto-utils/package.json create mode 100644 node_modules/minimalistic-crypto-utils/test/utils-test.js create mode 100644 node_modules/minimatch/LICENSE create mode 100644 node_modules/minimatch/README.md create mode 100644 node_modules/minimatch/minimatch.js create mode 100644 node_modules/minimatch/package.json create mode 100644 node_modules/minimist/.travis.yml create mode 100644 node_modules/minimist/LICENSE create mode 100644 node_modules/minimist/example/parse.js create mode 100644 node_modules/minimist/index.js create mode 100644 node_modules/minimist/package.json create mode 100644 node_modules/minimist/readme.markdown create mode 100644 node_modules/minimist/test/all_bool.js create mode 100644 node_modules/minimist/test/bool.js create mode 100644 node_modules/minimist/test/dash.js create mode 100644 node_modules/minimist/test/default_bool.js create mode 100644 node_modules/minimist/test/dotted.js create mode 100644 node_modules/minimist/test/kv_short.js create mode 100644 node_modules/minimist/test/long.js create mode 100644 node_modules/minimist/test/num.js create mode 100644 node_modules/minimist/test/parse.js create mode 100644 node_modules/minimist/test/parse_modified.js create mode 100644 node_modules/minimist/test/short.js create mode 100644 node_modules/minimist/test/stop_early.js create mode 100644 node_modules/minimist/test/unknown.js create mode 100644 node_modules/minimist/test/whitespace.js create mode 100644 node_modules/mississippi/changelog.md create mode 100644 node_modules/mississippi/index.js create mode 100644 node_modules/mississippi/license create mode 100644 node_modules/mississippi/package.json create mode 100644 node_modules/mississippi/readme.md create mode 100644 node_modules/mixin-deep/LICENSE create mode 100644 node_modules/mixin-deep/README.md create mode 100644 node_modules/mixin-deep/index.js create mode 100644 node_modules/mixin-deep/node_modules/is-extendable/LICENSE create mode 100644 node_modules/mixin-deep/node_modules/is-extendable/README.md create mode 100644 node_modules/mixin-deep/node_modules/is-extendable/index.d.ts create mode 100644 node_modules/mixin-deep/node_modules/is-extendable/index.js create mode 100644 node_modules/mixin-deep/node_modules/is-extendable/package.json create mode 100644 node_modules/mixin-deep/package.json create mode 100644 node_modules/mkdirp/.travis.yml create mode 100644 node_modules/mkdirp/LICENSE create mode 100755 node_modules/mkdirp/bin/cmd.js create mode 100644 node_modules/mkdirp/bin/usage.txt create mode 100644 node_modules/mkdirp/examples/pow.js create mode 100644 node_modules/mkdirp/index.js create mode 100644 node_modules/mkdirp/node_modules/minimist/.travis.yml create mode 100644 node_modules/mkdirp/node_modules/minimist/LICENSE create mode 100644 node_modules/mkdirp/node_modules/minimist/example/parse.js create mode 100644 node_modules/mkdirp/node_modules/minimist/index.js create mode 100644 node_modules/mkdirp/node_modules/minimist/package.json create mode 100644 node_modules/mkdirp/node_modules/minimist/readme.markdown create mode 100644 node_modules/mkdirp/node_modules/minimist/test/dash.js create mode 100644 node_modules/mkdirp/node_modules/minimist/test/default_bool.js create mode 100644 node_modules/mkdirp/node_modules/minimist/test/dotted.js create mode 100644 node_modules/mkdirp/node_modules/minimist/test/long.js create mode 100644 node_modules/mkdirp/node_modules/minimist/test/parse.js create mode 100644 node_modules/mkdirp/node_modules/minimist/test/parse_modified.js create mode 100644 node_modules/mkdirp/node_modules/minimist/test/short.js create mode 100644 node_modules/mkdirp/node_modules/minimist/test/whitespace.js create mode 100644 node_modules/mkdirp/package.json create mode 100644 node_modules/mkdirp/readme.markdown create mode 100644 node_modules/mkdirp/test/chmod.js create mode 100644 node_modules/mkdirp/test/clobber.js create mode 100644 node_modules/mkdirp/test/mkdirp.js create mode 100644 node_modules/mkdirp/test/opts_fs.js create mode 100644 node_modules/mkdirp/test/opts_fs_sync.js create mode 100644 node_modules/mkdirp/test/perm.js create mode 100644 node_modules/mkdirp/test/perm_sync.js create mode 100644 node_modules/mkdirp/test/race.js create mode 100644 node_modules/mkdirp/test/rel.js create mode 100644 node_modules/mkdirp/test/return.js create mode 100644 node_modules/mkdirp/test/return_sync.js create mode 100644 node_modules/mkdirp/test/root.js create mode 100644 node_modules/mkdirp/test/sync.js create mode 100644 node_modules/mkdirp/test/umask.js create mode 100644 node_modules/mkdirp/test/umask_sync.js create mode 100644 node_modules/move-concurrently/LICENSE create mode 100644 node_modules/move-concurrently/README.md create mode 100644 node_modules/move-concurrently/README.md~ create mode 100644 node_modules/move-concurrently/move.js create mode 100644 node_modules/move-concurrently/package.json create mode 100644 node_modules/ms/index.js create mode 100644 node_modules/ms/license.md create mode 100644 node_modules/ms/package.json create mode 100644 node_modules/ms/readme.md create mode 100644 node_modules/mute-stdout/LICENSE create mode 100644 node_modules/mute-stdout/README.md create mode 100644 node_modules/mute-stdout/index.js create mode 100644 node_modules/mute-stdout/package.json create mode 100644 node_modules/nanomatch/CHANGELOG.md create mode 100644 node_modules/nanomatch/LICENSE create mode 100644 node_modules/nanomatch/README.md create mode 100644 node_modules/nanomatch/index.js create mode 100644 node_modules/nanomatch/lib/cache.js create mode 100644 node_modules/nanomatch/lib/compilers.js create mode 100644 node_modules/nanomatch/lib/parsers.js create mode 100644 node_modules/nanomatch/lib/utils.js create mode 100644 node_modules/nanomatch/package.json create mode 100644 node_modules/neo-async/LICENSE create mode 100644 node_modules/neo-async/README.md create mode 100644 node_modules/neo-async/all.js create mode 100644 node_modules/neo-async/allLimit.js create mode 100644 node_modules/neo-async/allSeries.js create mode 100644 node_modules/neo-async/angelFall.js create mode 100644 node_modules/neo-async/any.js create mode 100644 node_modules/neo-async/anyLimit.js create mode 100644 node_modules/neo-async/anySeries.js create mode 100644 node_modules/neo-async/apply.js create mode 100644 node_modules/neo-async/applyEach.js create mode 100644 node_modules/neo-async/applyEachSeries.js create mode 100644 node_modules/neo-async/async.js create mode 100644 node_modules/neo-async/async.min.js create mode 100644 node_modules/neo-async/asyncify.js create mode 100644 node_modules/neo-async/auto.js create mode 100644 node_modules/neo-async/autoInject.js create mode 100644 node_modules/neo-async/cargo.js create mode 100644 node_modules/neo-async/compose.js create mode 100644 node_modules/neo-async/concat.js create mode 100644 node_modules/neo-async/concatLimit.js create mode 100644 node_modules/neo-async/concatSeries.js create mode 100644 node_modules/neo-async/constant.js create mode 100644 node_modules/neo-async/createLogger.js create mode 100644 node_modules/neo-async/detect.js create mode 100644 node_modules/neo-async/detectLimit.js create mode 100644 node_modules/neo-async/detectSeries.js create mode 100644 node_modules/neo-async/dir.js create mode 100644 node_modules/neo-async/doDuring.js create mode 100644 node_modules/neo-async/doUntil.js create mode 100644 node_modules/neo-async/doWhilst.js create mode 100644 node_modules/neo-async/during.js create mode 100644 node_modules/neo-async/each.js create mode 100644 node_modules/neo-async/eachLimit.js create mode 100644 node_modules/neo-async/eachOf.js create mode 100644 node_modules/neo-async/eachOfLimit.js create mode 100644 node_modules/neo-async/eachOfSeries.js create mode 100644 node_modules/neo-async/eachSeries.js create mode 100644 node_modules/neo-async/ensureAsync.js create mode 100644 node_modules/neo-async/every.js create mode 100644 node_modules/neo-async/everyLimit.js create mode 100644 node_modules/neo-async/everySeries.js create mode 100644 node_modules/neo-async/fast.js create mode 100644 node_modules/neo-async/filter.js create mode 100644 node_modules/neo-async/filterLimit.js create mode 100644 node_modules/neo-async/filterSeries.js create mode 100644 node_modules/neo-async/find.js create mode 100644 node_modules/neo-async/findLimit.js create mode 100644 node_modules/neo-async/findSeries.js create mode 100644 node_modules/neo-async/foldl.js create mode 100644 node_modules/neo-async/foldr.js create mode 100644 node_modules/neo-async/forEach.js create mode 100644 node_modules/neo-async/forEachLimit.js create mode 100644 node_modules/neo-async/forEachOf.js create mode 100644 node_modules/neo-async/forEachOfLimit.js create mode 100644 node_modules/neo-async/forEachOfSeries.js create mode 100644 node_modules/neo-async/forEachSeries.js create mode 100644 node_modules/neo-async/forever.js create mode 100644 node_modules/neo-async/groupBy.js create mode 100644 node_modules/neo-async/groupByLimit.js create mode 100644 node_modules/neo-async/groupBySeries.js create mode 100644 node_modules/neo-async/inject.js create mode 100644 node_modules/neo-async/iterator.js create mode 100644 node_modules/neo-async/log.js create mode 100644 node_modules/neo-async/map.js create mode 100644 node_modules/neo-async/mapLimit.js create mode 100644 node_modules/neo-async/mapSeries.js create mode 100644 node_modules/neo-async/mapValues.js create mode 100644 node_modules/neo-async/mapValuesLimit.js create mode 100644 node_modules/neo-async/mapValuesSeries.js create mode 100644 node_modules/neo-async/memoize.js create mode 100644 node_modules/neo-async/nextTick.js create mode 100644 node_modules/neo-async/omit.js create mode 100644 node_modules/neo-async/omitLimit.js create mode 100644 node_modules/neo-async/omitSeries.js create mode 100644 node_modules/neo-async/package.json create mode 100644 node_modules/neo-async/parallel.js create mode 100644 node_modules/neo-async/parallelLimit.js create mode 100644 node_modules/neo-async/pick.js create mode 100644 node_modules/neo-async/pickLimit.js create mode 100644 node_modules/neo-async/pickSeries.js create mode 100644 node_modules/neo-async/priorityQueue.js create mode 100644 node_modules/neo-async/queue.js create mode 100644 node_modules/neo-async/race.js create mode 100644 node_modules/neo-async/reduce.js create mode 100644 node_modules/neo-async/reduceRight.js create mode 100644 node_modules/neo-async/reflect.js create mode 100644 node_modules/neo-async/reflectAll.js create mode 100644 node_modules/neo-async/reject.js create mode 100644 node_modules/neo-async/rejectLimit.js create mode 100644 node_modules/neo-async/rejectSeries.js create mode 100644 node_modules/neo-async/retry.js create mode 100644 node_modules/neo-async/retryable.js create mode 100644 node_modules/neo-async/safe.js create mode 100644 node_modules/neo-async/select.js create mode 100644 node_modules/neo-async/selectLimit.js create mode 100644 node_modules/neo-async/selectSeries.js create mode 100644 node_modules/neo-async/seq.js create mode 100644 node_modules/neo-async/series.js create mode 100644 node_modules/neo-async/setImmediate.js create mode 100644 node_modules/neo-async/some.js create mode 100644 node_modules/neo-async/someLimit.js create mode 100644 node_modules/neo-async/someSeries.js create mode 100644 node_modules/neo-async/sortBy.js create mode 100644 node_modules/neo-async/sortByLimit.js create mode 100644 node_modules/neo-async/sortBySeries.js create mode 100644 node_modules/neo-async/timeout.js create mode 100644 node_modules/neo-async/times.js create mode 100644 node_modules/neo-async/timesLimit.js create mode 100644 node_modules/neo-async/timesSeries.js create mode 100644 node_modules/neo-async/transform.js create mode 100644 node_modules/neo-async/transformLimit.js create mode 100644 node_modules/neo-async/transformSeries.js create mode 100644 node_modules/neo-async/tryEach.js create mode 100644 node_modules/neo-async/unmemoize.js create mode 100644 node_modules/neo-async/until.js create mode 100644 node_modules/neo-async/waterfall.js create mode 100644 node_modules/neo-async/whilst.js create mode 100644 node_modules/neo-async/wrapSync.js create mode 100644 node_modules/next-tick/.lint create mode 100644 node_modules/next-tick/.npmignore create mode 100644 node_modules/next-tick/.travis.yml create mode 100644 node_modules/next-tick/CHANGES create mode 100644 node_modules/next-tick/LICENSE create mode 100644 node_modules/next-tick/README.md create mode 100644 node_modules/next-tick/index.js create mode 100644 node_modules/next-tick/package.json create mode 100644 node_modules/next-tick/test/index.js create mode 100644 node_modules/nice-try/CHANGELOG.md create mode 100644 node_modules/nice-try/LICENSE create mode 100644 node_modules/nice-try/README.md create mode 100644 node_modules/nice-try/package.json create mode 100644 node_modules/nice-try/src/index.js create mode 100644 node_modules/node-libs-browser/LICENSE create mode 100644 node_modules/node-libs-browser/README.md create mode 100644 node_modules/node-libs-browser/index.js create mode 100644 node_modules/node-libs-browser/mock/buffer.js create mode 100644 node_modules/node-libs-browser/mock/console.js create mode 100644 node_modules/node-libs-browser/mock/dns.js create mode 100644 node_modules/node-libs-browser/mock/empty.js create mode 100644 node_modules/node-libs-browser/mock/net.js create mode 100644 node_modules/node-libs-browser/mock/process.js create mode 100644 node_modules/node-libs-browser/mock/punycode.js create mode 100644 node_modules/node-libs-browser/mock/tls.js create mode 100644 node_modules/node-libs-browser/mock/tty.js create mode 100644 node_modules/node-libs-browser/node_modules/punycode/LICENSE-MIT.txt create mode 100644 node_modules/node-libs-browser/node_modules/punycode/README.md create mode 100644 node_modules/node-libs-browser/node_modules/punycode/package.json create mode 100644 node_modules/node-libs-browser/node_modules/punycode/punycode.js create mode 100644 node_modules/node-libs-browser/package.json create mode 100644 node_modules/normalize-package-data/AUTHORS create mode 100644 node_modules/normalize-package-data/LICENSE create mode 100644 node_modules/normalize-package-data/README.md create mode 100644 node_modules/normalize-package-data/lib/extract_description.js create mode 100644 node_modules/normalize-package-data/lib/fixer.js create mode 100644 node_modules/normalize-package-data/lib/make_warning.js create mode 100644 node_modules/normalize-package-data/lib/normalize.js create mode 100644 node_modules/normalize-package-data/lib/safe_format.js create mode 100644 node_modules/normalize-package-data/lib/typos.json create mode 100644 node_modules/normalize-package-data/lib/warning_messages.json create mode 100644 node_modules/normalize-package-data/package.json create mode 100644 node_modules/normalize-path/LICENSE create mode 100644 node_modules/normalize-path/README.md create mode 100644 node_modules/normalize-path/index.js create mode 100644 node_modules/normalize-path/package.json create mode 100644 node_modules/now-and-later/LICENSE create mode 100644 node_modules/now-and-later/README.md create mode 100644 node_modules/now-and-later/index.js create mode 100644 node_modules/now-and-later/lib/helpers.js create mode 100644 node_modules/now-and-later/lib/map.js create mode 100644 node_modules/now-and-later/lib/mapSeries.js create mode 100644 node_modules/now-and-later/package.json create mode 100644 node_modules/npm-run-path/index.js create mode 100644 node_modules/npm-run-path/license create mode 100644 node_modules/npm-run-path/package.json create mode 100644 node_modules/npm-run-path/readme.md create mode 100644 node_modules/number-is-nan/index.js create mode 100644 node_modules/number-is-nan/license create mode 100644 node_modules/number-is-nan/package.json create mode 100644 node_modules/number-is-nan/readme.md create mode 100644 node_modules/object-assign/index.js create mode 100644 node_modules/object-assign/license create mode 100644 node_modules/object-assign/package.json create mode 100644 node_modules/object-assign/readme.md create mode 100644 node_modules/object-copy/LICENSE create mode 100644 node_modules/object-copy/index.js create mode 100644 node_modules/object-copy/node_modules/define-property/LICENSE create mode 100644 node_modules/object-copy/node_modules/define-property/README.md create mode 100644 node_modules/object-copy/node_modules/define-property/index.js create mode 100644 node_modules/object-copy/node_modules/define-property/package.json create mode 100644 node_modules/object-copy/node_modules/kind-of/LICENSE create mode 100644 node_modules/object-copy/node_modules/kind-of/README.md create mode 100644 node_modules/object-copy/node_modules/kind-of/index.js create mode 100644 node_modules/object-copy/node_modules/kind-of/package.json create mode 100644 node_modules/object-copy/package.json create mode 100644 node_modules/object-keys/.editorconfig create mode 100644 node_modules/object-keys/.eslintrc create mode 100644 node_modules/object-keys/.travis.yml create mode 100644 node_modules/object-keys/CHANGELOG.md create mode 100644 node_modules/object-keys/LICENSE create mode 100644 node_modules/object-keys/README.md create mode 100644 node_modules/object-keys/implementation.js create mode 100644 node_modules/object-keys/index.js create mode 100644 node_modules/object-keys/isArguments.js create mode 100644 node_modules/object-keys/package.json create mode 100644 node_modules/object-keys/test/index.js create mode 100644 node_modules/object-visit/LICENSE create mode 100644 node_modules/object-visit/README.md create mode 100644 node_modules/object-visit/index.js create mode 100644 node_modules/object-visit/package.json create mode 100644 node_modules/object.assign/.editorconfig create mode 100644 node_modules/object.assign/.eslintrc create mode 100644 node_modules/object.assign/CHANGELOG.md create mode 100644 node_modules/object.assign/LICENSE create mode 100644 node_modules/object.assign/README.md create mode 100644 node_modules/object.assign/auto.js create mode 100644 node_modules/object.assign/dist/browser.js create mode 100644 node_modules/object.assign/hasSymbols.js create mode 100644 node_modules/object.assign/implementation.js create mode 100644 node_modules/object.assign/index.js create mode 100644 node_modules/object.assign/package.json create mode 100644 node_modules/object.assign/polyfill.js create mode 100644 node_modules/object.assign/shim.js create mode 100644 node_modules/object.assign/test.sh create mode 100644 node_modules/object.assign/test/.eslintrc create mode 100644 node_modules/object.assign/test/index.js create mode 100644 node_modules/object.assign/test/native.js create mode 100644 node_modules/object.assign/test/shimmed.js create mode 100644 node_modules/object.assign/test/tests.js create mode 100644 node_modules/object.defaults/LICENSE create mode 100644 node_modules/object.defaults/README.md create mode 100644 node_modules/object.defaults/immutable.js create mode 100644 node_modules/object.defaults/index.js create mode 100644 node_modules/object.defaults/mutable.js create mode 100644 node_modules/object.defaults/package.json create mode 100644 node_modules/object.map/LICENSE create mode 100644 node_modules/object.map/README.md create mode 100644 node_modules/object.map/index.js create mode 100644 node_modules/object.map/package.json create mode 100644 node_modules/object.pick/LICENSE create mode 100644 node_modules/object.pick/README.md create mode 100644 node_modules/object.pick/index.js create mode 100644 node_modules/object.pick/package.json create mode 100644 node_modules/object.reduce/LICENSE create mode 100644 node_modules/object.reduce/README.md create mode 100644 node_modules/object.reduce/index.js create mode 100644 node_modules/object.reduce/package.json create mode 100644 node_modules/once/LICENSE create mode 100644 node_modules/once/README.md create mode 100644 node_modules/once/once.js create mode 100644 node_modules/once/package.json create mode 100644 node_modules/ordered-read-streams/LICENSE create mode 100644 node_modules/ordered-read-streams/README.md create mode 100644 node_modules/ordered-read-streams/index.js create mode 100644 node_modules/ordered-read-streams/package.json create mode 100644 node_modules/os-browserify/.npmignore create mode 100644 node_modules/os-browserify/LICENSE create mode 100644 node_modules/os-browserify/README.md create mode 100644 node_modules/os-browserify/browser.js create mode 100644 node_modules/os-browserify/main.js create mode 100644 node_modules/os-browserify/package.json create mode 100644 node_modules/os-locale/index.js create mode 100644 node_modules/os-locale/license create mode 100644 node_modules/os-locale/package.json create mode 100644 node_modules/os-locale/readme.md create mode 100644 node_modules/p-defer/index.js create mode 100644 node_modules/p-defer/license create mode 100644 node_modules/p-defer/package.json create mode 100644 node_modules/p-defer/readme.md create mode 100644 node_modules/p-finally/index.js create mode 100644 node_modules/p-finally/license create mode 100644 node_modules/p-finally/package.json create mode 100644 node_modules/p-finally/readme.md create mode 100644 node_modules/p-is-promise/index.d.ts create mode 100644 node_modules/p-is-promise/index.js create mode 100644 node_modules/p-is-promise/license create mode 100644 node_modules/p-is-promise/package.json create mode 100644 node_modules/p-is-promise/readme.md create mode 100644 node_modules/p-limit/index.d.ts create mode 100644 node_modules/p-limit/index.js create mode 100644 node_modules/p-limit/license create mode 100644 node_modules/p-limit/package.json create mode 100644 node_modules/p-limit/readme.md create mode 100644 node_modules/p-locate/index.js create mode 100644 node_modules/p-locate/license create mode 100644 node_modules/p-locate/package.json create mode 100644 node_modules/p-locate/readme.md create mode 100644 node_modules/p-try/index.d.ts create mode 100644 node_modules/p-try/index.js create mode 100644 node_modules/p-try/license create mode 100644 node_modules/p-try/package.json create mode 100644 node_modules/p-try/readme.md create mode 100644 node_modules/pako/CHANGELOG.md create mode 100644 node_modules/pako/LICENSE create mode 100644 node_modules/pako/README.md create mode 100644 node_modules/pako/dist/pako.js create mode 100644 node_modules/pako/dist/pako.min.js create mode 100644 node_modules/pako/dist/pako_deflate.js create mode 100644 node_modules/pako/dist/pako_deflate.min.js create mode 100644 node_modules/pako/dist/pako_inflate.js create mode 100644 node_modules/pako/dist/pako_inflate.min.js create mode 100644 node_modules/pako/index.js create mode 100644 node_modules/pako/lib/deflate.js create mode 100644 node_modules/pako/lib/inflate.js create mode 100644 node_modules/pako/lib/utils/common.js create mode 100644 node_modules/pako/lib/utils/strings.js create mode 100644 node_modules/pako/lib/zlib/README create mode 100644 node_modules/pako/lib/zlib/adler32.js create mode 100644 node_modules/pako/lib/zlib/constants.js create mode 100644 node_modules/pako/lib/zlib/crc32.js create mode 100644 node_modules/pako/lib/zlib/deflate.js create mode 100644 node_modules/pako/lib/zlib/gzheader.js create mode 100644 node_modules/pako/lib/zlib/inffast.js create mode 100644 node_modules/pako/lib/zlib/inflate.js create mode 100644 node_modules/pako/lib/zlib/inftrees.js create mode 100644 node_modules/pako/lib/zlib/messages.js create mode 100644 node_modules/pako/lib/zlib/trees.js create mode 100644 node_modules/pako/lib/zlib/zstream.js create mode 100644 node_modules/pako/package.json create mode 100644 node_modules/parallel-transform/LICENSE create mode 100644 node_modules/parallel-transform/README.md create mode 100644 node_modules/parallel-transform/index.js create mode 100644 node_modules/parallel-transform/package.json create mode 100644 node_modules/parse-asn1/LICENSE create mode 100644 node_modules/parse-asn1/README.md create mode 100644 node_modules/parse-asn1/aesid.json create mode 100644 node_modules/parse-asn1/asn1.js create mode 100644 node_modules/parse-asn1/certificate.js create mode 100644 node_modules/parse-asn1/fixProc.js create mode 100644 node_modules/parse-asn1/index.js create mode 100644 node_modules/parse-asn1/package.json create mode 100644 node_modules/parse-filepath/LICENSE create mode 100644 node_modules/parse-filepath/README.md create mode 100644 node_modules/parse-filepath/index.js create mode 100644 node_modules/parse-filepath/package.json create mode 100644 node_modules/parse-json/index.js create mode 100644 node_modules/parse-json/license create mode 100644 node_modules/parse-json/package.json create mode 100644 node_modules/parse-json/readme.md create mode 100644 node_modules/parse-json/vendor/parse.js create mode 100644 node_modules/parse-json/vendor/unicode.js create mode 100644 node_modules/parse-node-version/LICENSE create mode 100644 node_modules/parse-node-version/README.md create mode 100644 node_modules/parse-node-version/index.js create mode 100644 node_modules/parse-node-version/package.json create mode 100644 node_modules/parse-passwd/LICENSE create mode 100644 node_modules/parse-passwd/README.md create mode 100644 node_modules/parse-passwd/index.js create mode 100644 node_modules/parse-passwd/package.json create mode 100644 node_modules/pascalcase/LICENSE create mode 100644 node_modules/pascalcase/README.md create mode 100644 node_modules/pascalcase/index.js create mode 100644 node_modules/pascalcase/package.json create mode 100644 node_modules/path-browserify/LICENSE create mode 100644 node_modules/path-browserify/index.js create mode 100644 node_modules/path-browserify/package.json create mode 100644 node_modules/path-browserify/readme.markdown create mode 100644 node_modules/path-browserify/test/test-path.js create mode 100644 node_modules/path-dirname/index.js create mode 100644 node_modules/path-dirname/license create mode 100644 node_modules/path-dirname/package.json create mode 100644 node_modules/path-dirname/readme.md create mode 100644 node_modules/path-exists/index.js create mode 100644 node_modules/path-exists/license create mode 100644 node_modules/path-exists/package.json create mode 100644 node_modules/path-exists/readme.md create mode 100644 node_modules/path-is-absolute/index.js create mode 100644 node_modules/path-is-absolute/license create mode 100644 node_modules/path-is-absolute/package.json create mode 100644 node_modules/path-is-absolute/readme.md create mode 100644 node_modules/path-key/index.js create mode 100644 node_modules/path-key/license create mode 100644 node_modules/path-key/package.json create mode 100644 node_modules/path-key/readme.md create mode 100644 node_modules/path-parse/.travis.yml create mode 100644 node_modules/path-parse/LICENSE create mode 100644 node_modules/path-parse/README.md create mode 100644 node_modules/path-parse/index.js create mode 100644 node_modules/path-parse/package.json create mode 100644 node_modules/path-parse/test.js create mode 100644 node_modules/path-root-regex/LICENSE create mode 100644 node_modules/path-root-regex/README.md create mode 100644 node_modules/path-root-regex/index.js create mode 100644 node_modules/path-root-regex/package.json create mode 100644 node_modules/path-root/LICENSE create mode 100644 node_modules/path-root/README.md create mode 100644 node_modules/path-root/index.js create mode 100644 node_modules/path-root/package.json create mode 100644 node_modules/path-type/index.js create mode 100644 node_modules/path-type/license create mode 100644 node_modules/path-type/node_modules/pify/index.js create mode 100644 node_modules/path-type/node_modules/pify/license create mode 100644 node_modules/path-type/node_modules/pify/package.json create mode 100644 node_modules/path-type/node_modules/pify/readme.md create mode 100644 node_modules/path-type/package.json create mode 100644 node_modules/path-type/readme.md create mode 100644 node_modules/pbkdf2/LICENSE create mode 100644 node_modules/pbkdf2/README.md create mode 100644 node_modules/pbkdf2/browser.js create mode 100644 node_modules/pbkdf2/index.js create mode 100644 node_modules/pbkdf2/lib/async.js create mode 100644 node_modules/pbkdf2/lib/default-encoding.js create mode 100644 node_modules/pbkdf2/lib/precondition.js create mode 100644 node_modules/pbkdf2/lib/sync-browser.js create mode 100644 node_modules/pbkdf2/lib/sync.js create mode 100644 node_modules/pbkdf2/package.json create mode 100644 node_modules/pify/index.js create mode 100644 node_modules/pify/license create mode 100644 node_modules/pify/package.json create mode 100644 node_modules/pify/readme.md create mode 100644 node_modules/pinkie-promise/index.js create mode 100644 node_modules/pinkie-promise/license create mode 100644 node_modules/pinkie-promise/package.json create mode 100644 node_modules/pinkie-promise/readme.md create mode 100644 node_modules/pinkie/index.js create mode 100644 node_modules/pinkie/license create mode 100644 node_modules/pinkie/package.json create mode 100644 node_modules/pinkie/readme.md create mode 100644 node_modules/pkg-dir/index.js create mode 100644 node_modules/pkg-dir/license create mode 100644 node_modules/pkg-dir/package.json create mode 100644 node_modules/pkg-dir/readme.md create mode 100644 node_modules/posix-character-classes/LICENSE create mode 100644 node_modules/posix-character-classes/README.md create mode 100644 node_modules/posix-character-classes/index.js create mode 100644 node_modules/posix-character-classes/package.json create mode 100644 node_modules/pretty-hrtime/.jshintignore create mode 100644 node_modules/pretty-hrtime/.npmignore create mode 100644 node_modules/pretty-hrtime/LICENSE create mode 100644 node_modules/pretty-hrtime/README.md create mode 100644 node_modules/pretty-hrtime/index.js create mode 100644 node_modules/pretty-hrtime/package.json create mode 100644 node_modules/process-nextick-args/index.js create mode 100644 node_modules/process-nextick-args/license.md create mode 100644 node_modules/process-nextick-args/package.json create mode 100644 node_modules/process-nextick-args/readme.md create mode 100644 node_modules/process/.eslintrc create mode 100644 node_modules/process/LICENSE create mode 100644 node_modules/process/README.md create mode 100644 node_modules/process/browser.js create mode 100644 node_modules/process/index.js create mode 100644 node_modules/process/package.json create mode 100644 node_modules/process/test.js create mode 100644 node_modules/promise-inflight/LICENSE create mode 100644 node_modules/promise-inflight/README.md create mode 100644 node_modules/promise-inflight/inflight.js create mode 100644 node_modules/promise-inflight/package.json create mode 100644 node_modules/prr/.jshintrc create mode 100644 node_modules/prr/.npmignore create mode 100644 node_modules/prr/.travis.yml create mode 100644 node_modules/prr/LICENSE.md create mode 100644 node_modules/prr/README.md create mode 100644 node_modules/prr/package.json create mode 100644 node_modules/prr/prr.js create mode 100644 node_modules/prr/test.js create mode 100644 node_modules/public-encrypt/.travis.yml create mode 100644 node_modules/public-encrypt/LICENSE create mode 100644 node_modules/public-encrypt/browser.js create mode 100644 node_modules/public-encrypt/index.js create mode 100644 node_modules/public-encrypt/mgf.js create mode 100644 node_modules/public-encrypt/package.json create mode 100644 node_modules/public-encrypt/privateDecrypt.js create mode 100644 node_modules/public-encrypt/publicEncrypt.js create mode 100644 node_modules/public-encrypt/readme.md create mode 100644 node_modules/public-encrypt/test/1024.priv create mode 100644 node_modules/public-encrypt/test/1024.pub create mode 100644 node_modules/public-encrypt/test/ec.pass.priv create mode 100644 node_modules/public-encrypt/test/ec.priv create mode 100644 node_modules/public-encrypt/test/ec.pub create mode 100644 node_modules/public-encrypt/test/index.js create mode 100644 node_modules/public-encrypt/test/nodeTests.js create mode 100644 node_modules/public-encrypt/test/pass.1024.priv create mode 100644 node_modules/public-encrypt/test/pass.1024.pub create mode 100644 node_modules/public-encrypt/test/rsa.1024.priv create mode 100644 node_modules/public-encrypt/test/rsa.1024.pub create mode 100644 node_modules/public-encrypt/test/rsa.2028.priv create mode 100644 node_modules/public-encrypt/test/rsa.2028.pub create mode 100644 node_modules/public-encrypt/test/rsa.pass.priv create mode 100644 node_modules/public-encrypt/test/rsa.pass.pub create mode 100644 node_modules/public-encrypt/test/test_cert.pem create mode 100644 node_modules/public-encrypt/test/test_key.pem create mode 100644 node_modules/public-encrypt/test/test_rsa_privkey.pem create mode 100644 node_modules/public-encrypt/test/test_rsa_privkey_encrypted.pem create mode 100644 node_modules/public-encrypt/test/test_rsa_pubkey.pem create mode 100644 node_modules/public-encrypt/withPublic.js create mode 100644 node_modules/public-encrypt/xor.js create mode 100644 node_modules/pump/.travis.yml create mode 100644 node_modules/pump/LICENSE create mode 100644 node_modules/pump/README.md create mode 100644 node_modules/pump/index.js create mode 100644 node_modules/pump/package.json create mode 100644 node_modules/pump/test-browser.js create mode 100644 node_modules/pump/test-node.js create mode 100644 node_modules/pumpify/.travis.yml create mode 100644 node_modules/pumpify/LICENSE create mode 100644 node_modules/pumpify/README.md create mode 100644 node_modules/pumpify/index.js create mode 100644 node_modules/pumpify/node_modules/pump/.travis.yml create mode 100644 node_modules/pumpify/node_modules/pump/LICENSE create mode 100644 node_modules/pumpify/node_modules/pump/README.md create mode 100644 node_modules/pumpify/node_modules/pump/index.js create mode 100644 node_modules/pumpify/node_modules/pump/package.json create mode 100644 node_modules/pumpify/node_modules/pump/test-browser.js create mode 100644 node_modules/pumpify/node_modules/pump/test-node.js create mode 100644 node_modules/pumpify/package.json create mode 100644 node_modules/pumpify/test.js create mode 100644 node_modules/punycode/LICENSE-MIT.txt create mode 100644 node_modules/punycode/README.md create mode 100644 node_modules/punycode/package.json create mode 100644 node_modules/punycode/punycode.es6.js create mode 100644 node_modules/punycode/punycode.js create mode 100644 node_modules/querystring-es3/.travis.yml create mode 100644 node_modules/querystring-es3/History.md create mode 100644 node_modules/querystring-es3/License.md create mode 100644 node_modules/querystring-es3/Readme.md create mode 100644 node_modules/querystring-es3/decode.js create mode 100644 node_modules/querystring-es3/encode.js create mode 100644 node_modules/querystring-es3/index.js create mode 100644 node_modules/querystring-es3/package.json create mode 100644 node_modules/querystring-es3/test/common-index.js create mode 100644 node_modules/querystring-es3/test/index.js create mode 100644 node_modules/querystring-es3/test/tap-index.js create mode 100644 node_modules/querystring/.History.md.un~ create mode 100644 node_modules/querystring/.Readme.md.un~ create mode 100644 node_modules/querystring/.package.json.un~ create mode 100644 node_modules/querystring/.travis.yml create mode 100644 node_modules/querystring/History.md create mode 100644 node_modules/querystring/License.md create mode 100644 node_modules/querystring/Readme.md create mode 100644 node_modules/querystring/decode.js create mode 100644 node_modules/querystring/encode.js create mode 100644 node_modules/querystring/index.js create mode 100644 node_modules/querystring/package.json create mode 100644 node_modules/querystring/test/.index.js.un~ create mode 100644 node_modules/querystring/test/common-index.js create mode 100644 node_modules/querystring/test/index.js create mode 100644 node_modules/querystring/test/tap-index.js create mode 100644 node_modules/randombytes/.travis.yml create mode 100644 node_modules/randombytes/.zuul.yml create mode 100644 node_modules/randombytes/LICENSE create mode 100644 node_modules/randombytes/README.md create mode 100644 node_modules/randombytes/browser.js create mode 100644 node_modules/randombytes/index.js create mode 100644 node_modules/randombytes/package.json create mode 100644 node_modules/randombytes/test.js create mode 100644 node_modules/randomfill/.travis.yml create mode 100644 node_modules/randomfill/.zuul.yml create mode 100644 node_modules/randomfill/LICENSE create mode 100644 node_modules/randomfill/README.md create mode 100644 node_modules/randomfill/browser.js create mode 100644 node_modules/randomfill/index.js create mode 100644 node_modules/randomfill/package.json create mode 100644 node_modules/randomfill/test.js create mode 100644 node_modules/read-pkg-up/index.js create mode 100644 node_modules/read-pkg-up/license create mode 100644 node_modules/read-pkg-up/node_modules/find-up/index.js create mode 100644 node_modules/read-pkg-up/node_modules/find-up/license create mode 100644 node_modules/read-pkg-up/node_modules/find-up/package.json create mode 100644 node_modules/read-pkg-up/node_modules/find-up/readme.md create mode 100644 node_modules/read-pkg-up/node_modules/path-exists/index.js create mode 100644 node_modules/read-pkg-up/node_modules/path-exists/license create mode 100644 node_modules/read-pkg-up/node_modules/path-exists/package.json create mode 100644 node_modules/read-pkg-up/node_modules/path-exists/readme.md create mode 100644 node_modules/read-pkg-up/package.json create mode 100644 node_modules/read-pkg-up/readme.md create mode 100644 node_modules/read-pkg/index.js create mode 100644 node_modules/read-pkg/license create mode 100644 node_modules/read-pkg/package.json create mode 100644 node_modules/read-pkg/readme.md create mode 100644 node_modules/readable-stream/.travis.yml create mode 100644 node_modules/readable-stream/CONTRIBUTING.md create mode 100644 node_modules/readable-stream/GOVERNANCE.md create mode 100644 node_modules/readable-stream/LICENSE create mode 100644 node_modules/readable-stream/README.md create mode 100644 node_modules/readable-stream/doc/wg-meetings/2015-01-30.md create mode 100644 node_modules/readable-stream/duplex-browser.js create mode 100644 node_modules/readable-stream/duplex.js create mode 100644 node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 node_modules/readable-stream/lib/_stream_readable.js create mode 100644 node_modules/readable-stream/lib/_stream_transform.js create mode 100644 node_modules/readable-stream/lib/_stream_writable.js create mode 100644 node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 node_modules/readable-stream/package.json create mode 100644 node_modules/readable-stream/passthrough.js create mode 100644 node_modules/readable-stream/readable-browser.js create mode 100644 node_modules/readable-stream/readable.js create mode 100644 node_modules/readable-stream/transform.js create mode 100644 node_modules/readable-stream/writable-browser.js create mode 100644 node_modules/readable-stream/writable.js create mode 100644 node_modules/readdirp/LICENSE create mode 100644 node_modules/readdirp/README.md create mode 100644 node_modules/readdirp/package.json create mode 100644 node_modules/readdirp/readdirp.js create mode 100644 node_modules/readdirp/stream-api.js create mode 100644 node_modules/rechoir/.npmignore create mode 100644 node_modules/rechoir/.travis.yml create mode 100644 node_modules/rechoir/CHANGELOG create mode 100644 node_modules/rechoir/LICENSE create mode 100644 node_modules/rechoir/README.md create mode 100644 node_modules/rechoir/index.js create mode 100644 node_modules/rechoir/lib/extension.js create mode 100644 node_modules/rechoir/lib/normalize.js create mode 100644 node_modules/rechoir/lib/register.js create mode 100644 node_modules/rechoir/package.json create mode 100644 node_modules/regex-not/LICENSE create mode 100644 node_modules/regex-not/README.md create mode 100644 node_modules/regex-not/index.js create mode 100644 node_modules/regex-not/package.json create mode 100644 node_modules/remove-bom-buffer/LICENSE create mode 100644 node_modules/remove-bom-buffer/README.md create mode 100644 node_modules/remove-bom-buffer/index.js create mode 100644 node_modules/remove-bom-buffer/package.json create mode 100644 node_modules/remove-bom-stream/LICENSE create mode 100644 node_modules/remove-bom-stream/README.md create mode 100644 node_modules/remove-bom-stream/index.js create mode 100644 node_modules/remove-bom-stream/package.json create mode 100644 node_modules/remove-trailing-separator/history.md create mode 100644 node_modules/remove-trailing-separator/index.js create mode 100644 node_modules/remove-trailing-separator/license create mode 100644 node_modules/remove-trailing-separator/package.json create mode 100644 node_modules/remove-trailing-separator/readme.md create mode 100644 node_modules/repeat-element/LICENSE create mode 100644 node_modules/repeat-element/README.md create mode 100644 node_modules/repeat-element/index.js create mode 100644 node_modules/repeat-element/package.json create mode 100644 node_modules/repeat-string/LICENSE create mode 100644 node_modules/repeat-string/README.md create mode 100644 node_modules/repeat-string/index.js create mode 100644 node_modules/repeat-string/package.json create mode 100755 node_modules/replace-ext/LICENSE create mode 100644 node_modules/replace-ext/README.md create mode 100644 node_modules/replace-ext/index.js create mode 100644 node_modules/replace-ext/package.json create mode 100644 node_modules/replace-homedir/LICENSE create mode 100644 node_modules/replace-homedir/README.md create mode 100644 node_modules/replace-homedir/index.js create mode 100644 node_modules/replace-homedir/package.json create mode 100644 node_modules/require-directory/.jshintrc create mode 100644 node_modules/require-directory/.npmignore create mode 100644 node_modules/require-directory/.travis.yml create mode 100644 node_modules/require-directory/LICENSE create mode 100644 node_modules/require-directory/README.markdown create mode 100644 node_modules/require-directory/index.js create mode 100644 node_modules/require-directory/package.json create mode 100644 node_modules/require-main-filename/CHANGELOG.md create mode 100644 node_modules/require-main-filename/LICENSE.txt create mode 100644 node_modules/require-main-filename/README.md create mode 100644 node_modules/require-main-filename/index.js create mode 100644 node_modules/require-main-filename/package.json create mode 100644 node_modules/resolve-cwd/index.js create mode 100644 node_modules/resolve-cwd/license create mode 100644 node_modules/resolve-cwd/package.json create mode 100644 node_modules/resolve-cwd/readme.md create mode 100644 node_modules/resolve-dir/LICENSE create mode 100644 node_modules/resolve-dir/README.md create mode 100644 node_modules/resolve-dir/index.js create mode 100644 node_modules/resolve-dir/node_modules/global-modules/LICENSE create mode 100644 node_modules/resolve-dir/node_modules/global-modules/README.md create mode 100644 node_modules/resolve-dir/node_modules/global-modules/index.js create mode 100644 node_modules/resolve-dir/node_modules/global-modules/package.json create mode 100644 node_modules/resolve-dir/package.json create mode 100644 node_modules/resolve-from/index.js create mode 100644 node_modules/resolve-from/license create mode 100644 node_modules/resolve-from/package.json create mode 100644 node_modules/resolve-from/readme.md create mode 100644 node_modules/resolve-options/LICENSE create mode 100644 node_modules/resolve-options/README.md create mode 100644 node_modules/resolve-options/index.js create mode 100644 node_modules/resolve-options/package.json create mode 100644 node_modules/resolve-url/.jshintrc create mode 100644 node_modules/resolve-url/LICENSE create mode 100644 node_modules/resolve-url/bower.json create mode 100644 node_modules/resolve-url/changelog.md create mode 100644 node_modules/resolve-url/component.json create mode 100644 node_modules/resolve-url/package.json create mode 100644 node_modules/resolve-url/readme.md create mode 100644 node_modules/resolve-url/resolve-url.js create mode 100644 node_modules/resolve-url/test/resolve-url.js create mode 100644 node_modules/resolve/.eslintignore create mode 100644 node_modules/resolve/.eslintrc create mode 100644 node_modules/resolve/.travis.yml create mode 100644 node_modules/resolve/LICENSE create mode 100644 node_modules/resolve/appveyor.yml create mode 100644 node_modules/resolve/example/async.js create mode 100644 node_modules/resolve/example/sync.js create mode 100644 node_modules/resolve/index.js create mode 100644 node_modules/resolve/lib/async.js create mode 100644 node_modules/resolve/lib/caller.js create mode 100644 node_modules/resolve/lib/core.js create mode 100644 node_modules/resolve/lib/core.json create mode 100644 node_modules/resolve/lib/is-core.js create mode 100644 node_modules/resolve/lib/node-modules-paths.js create mode 100644 node_modules/resolve/lib/normalize-options.js create mode 100644 node_modules/resolve/lib/sync.js create mode 100644 node_modules/resolve/package.json create mode 100644 node_modules/resolve/readme.markdown create mode 100644 node_modules/resolve/test/.eslintrc create mode 100644 node_modules/resolve/test/core.js create mode 100644 node_modules/resolve/test/dotdot.js create mode 100644 node_modules/resolve/test/dotdot/abc/index.js create mode 100644 node_modules/resolve/test/dotdot/index.js create mode 100644 node_modules/resolve/test/faulty_basedir.js create mode 100644 node_modules/resolve/test/filter.js create mode 100644 node_modules/resolve/test/filter_sync.js create mode 100644 node_modules/resolve/test/mock.js create mode 100644 node_modules/resolve/test/mock_sync.js create mode 100644 node_modules/resolve/test/module_dir.js create mode 100644 node_modules/resolve/test/module_dir/xmodules/aaa/index.js create mode 100644 node_modules/resolve/test/module_dir/ymodules/aaa/index.js create mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/main.js create mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/package.json create mode 100644 node_modules/resolve/test/node-modules-paths.js create mode 100644 node_modules/resolve/test/node_path.js create mode 100644 node_modules/resolve/test/node_path/x/aaa/index.js create mode 100644 node_modules/resolve/test/node_path/x/ccc/index.js create mode 100644 node_modules/resolve/test/node_path/y/bbb/index.js create mode 100644 node_modules/resolve/test/node_path/y/ccc/index.js create mode 100644 node_modules/resolve/test/nonstring.js create mode 100644 node_modules/resolve/test/pathfilter.js create mode 100644 node_modules/resolve/test/pathfilter/deep_ref/main.js create mode 100644 node_modules/resolve/test/precedence.js create mode 100644 node_modules/resolve/test/precedence/aaa.js create mode 100644 node_modules/resolve/test/precedence/aaa/index.js create mode 100644 node_modules/resolve/test/precedence/aaa/main.js create mode 100644 node_modules/resolve/test/precedence/bbb.js create mode 100644 node_modules/resolve/test/precedence/bbb/main.js create mode 100644 node_modules/resolve/test/resolver.js create mode 100644 node_modules/resolve/test/resolver/baz/doom.js create mode 100644 node_modules/resolve/test/resolver/baz/package.json create mode 100644 node_modules/resolve/test/resolver/baz/quux.js create mode 100644 node_modules/resolve/test/resolver/browser_field/a.js create mode 100644 node_modules/resolve/test/resolver/browser_field/b.js create mode 100644 node_modules/resolve/test/resolver/browser_field/package.json create mode 100644 node_modules/resolve/test/resolver/cup.coffee create mode 100644 node_modules/resolve/test/resolver/dot_main/index.js create mode 100644 node_modules/resolve/test/resolver/dot_main/package.json create mode 100644 node_modules/resolve/test/resolver/dot_slash_main/index.js create mode 100644 node_modules/resolve/test/resolver/dot_slash_main/package.json create mode 100644 node_modules/resolve/test/resolver/foo.js create mode 100644 node_modules/resolve/test/resolver/incorrect_main/index.js create mode 100644 node_modules/resolve/test/resolver/incorrect_main/package.json create mode 100644 node_modules/resolve/test/resolver/invalid_main/package.json create mode 100644 node_modules/resolve/test/resolver/mug.coffee create mode 100644 node_modules/resolve/test/resolver/mug.js create mode 100644 node_modules/resolve/test/resolver/multirepo/lerna.json create mode 100644 node_modules/resolve/test/resolver/multirepo/package.json create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js create mode 100644 node_modules/resolve/test/resolver/other_path/lib/other-lib.js create mode 100644 node_modules/resolve/test/resolver/other_path/root.js create mode 100644 node_modules/resolve/test/resolver/quux/foo/index.js create mode 100644 node_modules/resolve/test/resolver/same_names/foo.js create mode 100644 node_modules/resolve/test/resolver/same_names/foo/index.js create mode 100644 node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js create mode 100644 node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep create mode 100644 node_modules/resolve/test/resolver/symlinked/package/bar.js create mode 100644 node_modules/resolve/test/resolver/symlinked/package/package.json create mode 100644 node_modules/resolve/test/resolver/without_basedir/main.js create mode 100644 node_modules/resolve/test/resolver_sync.js create mode 100644 node_modules/resolve/test/shadowed_core.js create mode 100644 node_modules/resolve/test/shadowed_core/node_modules/util/index.js create mode 100644 node_modules/resolve/test/subdirs.js create mode 100644 node_modules/resolve/test/symlinks.js create mode 100644 node_modules/ret/LICENSE create mode 100644 node_modules/ret/README.md create mode 100644 node_modules/ret/lib/index.js create mode 100644 node_modules/ret/lib/positions.js create mode 100644 node_modules/ret/lib/sets.js create mode 100644 node_modules/ret/lib/types.js create mode 100644 node_modules/ret/lib/util.js create mode 100644 node_modules/ret/package.json create mode 100644 node_modules/rimraf/LICENSE create mode 100644 node_modules/rimraf/README.md create mode 100755 node_modules/rimraf/bin.js create mode 100644 node_modules/rimraf/package.json create mode 100644 node_modules/rimraf/rimraf.js create mode 100644 node_modules/ripemd160/CHANGELOG.md create mode 100644 node_modules/ripemd160/LICENSE create mode 100644 node_modules/ripemd160/README.md create mode 100644 node_modules/ripemd160/index.js create mode 100644 node_modules/ripemd160/package.json create mode 100644 node_modules/run-queue/README.md create mode 100644 node_modules/run-queue/package.json create mode 100644 node_modules/run-queue/queue.js create mode 100644 node_modules/safe-buffer/LICENSE create mode 100644 node_modules/safe-buffer/README.md create mode 100644 node_modules/safe-buffer/index.d.ts create mode 100644 node_modules/safe-buffer/index.js create mode 100644 node_modules/safe-buffer/package.json create mode 100644 node_modules/safe-regex/.travis.yml create mode 100644 node_modules/safe-regex/LICENSE create mode 100644 node_modules/safe-regex/example/safe.js create mode 100644 node_modules/safe-regex/index.js create mode 100644 node_modules/safe-regex/package.json create mode 100644 node_modules/safe-regex/readme.markdown create mode 100644 node_modules/safe-regex/test/regex.js create mode 100644 node_modules/schema-utils/CHANGELOG.md create mode 100644 node_modules/schema-utils/LICENSE create mode 100644 node_modules/schema-utils/README.md create mode 100644 node_modules/schema-utils/package.json create mode 100644 node_modules/schema-utils/src/ValidationError.js create mode 100644 node_modules/schema-utils/src/index.js create mode 100644 node_modules/schema-utils/src/validateOptions.js create mode 100644 node_modules/semver-greatest-satisfied-range/LICENSE create mode 100644 node_modules/semver-greatest-satisfied-range/README.md create mode 100644 node_modules/semver-greatest-satisfied-range/index.js create mode 100644 node_modules/semver-greatest-satisfied-range/package.json create mode 100644 node_modules/semver/CHANGELOG.md create mode 100644 node_modules/semver/LICENSE create mode 100644 node_modules/semver/README.md create mode 100755 node_modules/semver/bin/semver create mode 100644 node_modules/semver/package.json create mode 100644 node_modules/semver/range.bnf create mode 100644 node_modules/semver/semver.js create mode 100644 node_modules/serialize-javascript/LICENSE create mode 100644 node_modules/serialize-javascript/README.md create mode 100644 node_modules/serialize-javascript/index.js create mode 100644 node_modules/serialize-javascript/package.json create mode 100644 node_modules/set-blocking/CHANGELOG.md create mode 100644 node_modules/set-blocking/LICENSE.txt create mode 100644 node_modules/set-blocking/README.md create mode 100644 node_modules/set-blocking/index.js create mode 100644 node_modules/set-blocking/package.json create mode 100644 node_modules/set-value/LICENSE create mode 100644 node_modules/set-value/README.md create mode 100644 node_modules/set-value/index.js create mode 100644 node_modules/set-value/node_modules/extend-shallow/LICENSE create mode 100644 node_modules/set-value/node_modules/extend-shallow/README.md create mode 100644 node_modules/set-value/node_modules/extend-shallow/index.js create mode 100644 node_modules/set-value/node_modules/extend-shallow/package.json create mode 100644 node_modules/set-value/package.json create mode 100644 node_modules/setimmediate/LICENSE.txt create mode 100644 node_modules/setimmediate/package.json create mode 100644 node_modules/setimmediate/setImmediate.js create mode 100644 node_modules/sha.js/.travis.yml create mode 100644 node_modules/sha.js/LICENSE create mode 100644 node_modules/sha.js/README.md create mode 100755 node_modules/sha.js/bin.js create mode 100644 node_modules/sha.js/hash.js create mode 100644 node_modules/sha.js/index.js create mode 100644 node_modules/sha.js/package.json create mode 100644 node_modules/sha.js/sha.js create mode 100644 node_modules/sha.js/sha1.js create mode 100644 node_modules/sha.js/sha224.js create mode 100644 node_modules/sha.js/sha256.js create mode 100644 node_modules/sha.js/sha384.js create mode 100644 node_modules/sha.js/sha512.js create mode 100644 node_modules/sha.js/test/hash.js create mode 100644 node_modules/sha.js/test/test.js create mode 100644 node_modules/sha.js/test/vectors.js create mode 100644 node_modules/shebang-command/index.js create mode 100644 node_modules/shebang-command/license create mode 100644 node_modules/shebang-command/package.json create mode 100644 node_modules/shebang-command/readme.md create mode 100644 node_modules/shebang-regex/index.js create mode 100644 node_modules/shebang-regex/license create mode 100644 node_modules/shebang-regex/package.json create mode 100644 node_modules/shebang-regex/readme.md create mode 100644 node_modules/signal-exit/CHANGELOG.md create mode 100644 node_modules/signal-exit/LICENSE.txt create mode 100644 node_modules/signal-exit/README.md create mode 100644 node_modules/signal-exit/index.js create mode 100644 node_modules/signal-exit/package.json create mode 100644 node_modules/signal-exit/signals.js create mode 100644 node_modules/snapdragon-node/LICENSE create mode 100644 node_modules/snapdragon-node/README.md create mode 100644 node_modules/snapdragon-node/index.js create mode 100644 node_modules/snapdragon-node/node_modules/define-property/LICENSE create mode 100644 node_modules/snapdragon-node/node_modules/define-property/README.md create mode 100644 node_modules/snapdragon-node/node_modules/define-property/index.js create mode 100644 node_modules/snapdragon-node/node_modules/define-property/package.json create mode 100644 node_modules/snapdragon-node/node_modules/is-accessor-descriptor/LICENSE create mode 100644 node_modules/snapdragon-node/node_modules/is-accessor-descriptor/README.md create mode 100644 node_modules/snapdragon-node/node_modules/is-accessor-descriptor/index.js create mode 100644 node_modules/snapdragon-node/node_modules/is-accessor-descriptor/package.json create mode 100644 node_modules/snapdragon-node/node_modules/is-data-descriptor/LICENSE create mode 100644 node_modules/snapdragon-node/node_modules/is-data-descriptor/README.md create mode 100644 node_modules/snapdragon-node/node_modules/is-data-descriptor/index.js create mode 100644 node_modules/snapdragon-node/node_modules/is-data-descriptor/package.json create mode 100644 node_modules/snapdragon-node/node_modules/is-descriptor/LICENSE create mode 100644 node_modules/snapdragon-node/node_modules/is-descriptor/README.md create mode 100644 node_modules/snapdragon-node/node_modules/is-descriptor/index.js create mode 100644 node_modules/snapdragon-node/node_modules/is-descriptor/package.json create mode 100644 node_modules/snapdragon-node/package.json create mode 100644 node_modules/snapdragon-util/LICENSE create mode 100644 node_modules/snapdragon-util/README.md create mode 100644 node_modules/snapdragon-util/index.js create mode 100644 node_modules/snapdragon-util/node_modules/kind-of/LICENSE create mode 100644 node_modules/snapdragon-util/node_modules/kind-of/README.md create mode 100644 node_modules/snapdragon-util/node_modules/kind-of/index.js create mode 100644 node_modules/snapdragon-util/node_modules/kind-of/package.json create mode 100644 node_modules/snapdragon-util/package.json create mode 100644 node_modules/snapdragon/LICENSE create mode 100644 node_modules/snapdragon/README.md create mode 100644 node_modules/snapdragon/index.js create mode 100644 node_modules/snapdragon/lib/compiler.js create mode 100644 node_modules/snapdragon/lib/parser.js create mode 100644 node_modules/snapdragon/lib/position.js create mode 100644 node_modules/snapdragon/lib/source-maps.js create mode 100644 node_modules/snapdragon/lib/utils.js create mode 100644 node_modules/snapdragon/node_modules/define-property/LICENSE create mode 100644 node_modules/snapdragon/node_modules/define-property/README.md create mode 100644 node_modules/snapdragon/node_modules/define-property/index.js create mode 100644 node_modules/snapdragon/node_modules/define-property/package.json create mode 100644 node_modules/snapdragon/node_modules/extend-shallow/LICENSE create mode 100644 node_modules/snapdragon/node_modules/extend-shallow/README.md create mode 100644 node_modules/snapdragon/node_modules/extend-shallow/index.js create mode 100644 node_modules/snapdragon/node_modules/extend-shallow/package.json create mode 100644 node_modules/snapdragon/package.json create mode 100644 node_modules/source-list-map/LICENSE create mode 100644 node_modules/source-list-map/README.md create mode 100644 node_modules/source-list-map/lib/CodeNode.js create mode 100644 node_modules/source-list-map/lib/MappingsContext.js create mode 100644 node_modules/source-list-map/lib/SingleLineNode.js create mode 100644 node_modules/source-list-map/lib/SourceListMap.js create mode 100644 node_modules/source-list-map/lib/SourceNode.js create mode 100644 node_modules/source-list-map/lib/base64-vlq.js create mode 100644 node_modules/source-list-map/lib/fromStringWithSourceMap.js create mode 100644 node_modules/source-list-map/lib/helpers.js create mode 100644 node_modules/source-list-map/lib/index.js create mode 100644 node_modules/source-list-map/package.json create mode 100644 node_modules/source-map-resolve/LICENSE create mode 100644 node_modules/source-map-resolve/changelog.md create mode 100644 node_modules/source-map-resolve/lib/decode-uri-component.js create mode 100644 node_modules/source-map-resolve/lib/resolve-url.js create mode 100644 node_modules/source-map-resolve/lib/source-map-resolve-node.js create mode 100644 node_modules/source-map-resolve/package.json create mode 100644 node_modules/source-map-resolve/readme.md create mode 100644 node_modules/source-map-resolve/source-map-resolve.js create mode 100644 node_modules/source-map-support/LICENSE.md create mode 100644 node_modules/source-map-support/README.md create mode 100644 node_modules/source-map-support/browser-source-map-support.js create mode 100644 node_modules/source-map-support/node_modules/source-map/CHANGELOG.md create mode 100644 node_modules/source-map-support/node_modules/source-map/LICENSE create mode 100644 node_modules/source-map-support/node_modules/source-map/README.md create mode 100644 node_modules/source-map-support/node_modules/source-map/dist/source-map.debug.js create mode 100644 node_modules/source-map-support/node_modules/source-map/dist/source-map.js create mode 100644 node_modules/source-map-support/node_modules/source-map/dist/source-map.min.js create mode 100644 node_modules/source-map-support/node_modules/source-map/dist/source-map.min.js.map create mode 100644 node_modules/source-map-support/node_modules/source-map/lib/array-set.js create mode 100644 node_modules/source-map-support/node_modules/source-map/lib/base64-vlq.js create mode 100644 node_modules/source-map-support/node_modules/source-map/lib/base64.js create mode 100644 node_modules/source-map-support/node_modules/source-map/lib/binary-search.js create mode 100644 node_modules/source-map-support/node_modules/source-map/lib/mapping-list.js create mode 100644 node_modules/source-map-support/node_modules/source-map/lib/quick-sort.js create mode 100644 node_modules/source-map-support/node_modules/source-map/lib/source-map-consumer.js create mode 100644 node_modules/source-map-support/node_modules/source-map/lib/source-map-generator.js create mode 100644 node_modules/source-map-support/node_modules/source-map/lib/source-node.js create mode 100644 node_modules/source-map-support/node_modules/source-map/lib/util.js create mode 100644 node_modules/source-map-support/node_modules/source-map/package.json create mode 100644 node_modules/source-map-support/node_modules/source-map/source-map.d.ts create mode 100644 node_modules/source-map-support/node_modules/source-map/source-map.js create mode 100644 node_modules/source-map-support/package.json create mode 100644 node_modules/source-map-support/register.js create mode 100644 node_modules/source-map-support/source-map-support.js create mode 100644 node_modules/source-map-url/.jshintrc create mode 100644 node_modules/source-map-url/LICENSE create mode 100644 node_modules/source-map-url/bower.json create mode 100644 node_modules/source-map-url/changelog.md create mode 100644 node_modules/source-map-url/component.json create mode 100644 node_modules/source-map-url/package.json create mode 100644 node_modules/source-map-url/readme.md create mode 100644 node_modules/source-map-url/source-map-url.js create mode 100644 node_modules/source-map-url/test/source-map-url.js create mode 100644 node_modules/source-map-url/x-package.json5 create mode 100644 node_modules/source-map/CHANGELOG.md create mode 100644 node_modules/source-map/LICENSE create mode 100644 node_modules/source-map/README.md create mode 100644 node_modules/source-map/dist/source-map.debug.js create mode 100644 node_modules/source-map/dist/source-map.js create mode 100644 node_modules/source-map/dist/source-map.min.js create mode 100644 node_modules/source-map/dist/source-map.min.js.map create mode 100644 node_modules/source-map/lib/array-set.js create mode 100644 node_modules/source-map/lib/base64-vlq.js create mode 100644 node_modules/source-map/lib/base64.js create mode 100644 node_modules/source-map/lib/binary-search.js create mode 100644 node_modules/source-map/lib/mapping-list.js create mode 100644 node_modules/source-map/lib/quick-sort.js create mode 100644 node_modules/source-map/lib/source-map-consumer.js create mode 100644 node_modules/source-map/lib/source-map-generator.js create mode 100644 node_modules/source-map/lib/source-node.js create mode 100644 node_modules/source-map/lib/util.js create mode 100644 node_modules/source-map/package.json create mode 100644 node_modules/source-map/source-map.js create mode 100644 node_modules/sparkles/LICENSE create mode 100644 node_modules/sparkles/README.md create mode 100644 node_modules/sparkles/index.js create mode 100644 node_modules/sparkles/package.json create mode 100644 node_modules/spdx-correct/LICENSE create mode 100644 node_modules/spdx-correct/README.md create mode 100644 node_modules/spdx-correct/index.js create mode 100644 node_modules/spdx-correct/package.json create mode 100644 node_modules/spdx-exceptions/README.md create mode 100644 node_modules/spdx-exceptions/index.json create mode 100644 node_modules/spdx-exceptions/package.json create mode 100644 node_modules/spdx-exceptions/test.log create mode 100644 node_modules/spdx-expression-parse/AUTHORS create mode 100644 node_modules/spdx-expression-parse/LICENSE create mode 100644 node_modules/spdx-expression-parse/README.md create mode 100644 node_modules/spdx-expression-parse/index.js create mode 100644 node_modules/spdx-expression-parse/package.json create mode 100644 node_modules/spdx-expression-parse/parse.js create mode 100644 node_modules/spdx-expression-parse/scan.js create mode 100644 node_modules/spdx-license-ids/README.md create mode 100644 node_modules/spdx-license-ids/deprecated.json create mode 100644 node_modules/spdx-license-ids/index.json create mode 100644 node_modules/spdx-license-ids/package.json create mode 100644 node_modules/split-string/LICENSE create mode 100644 node_modules/split-string/README.md create mode 100644 node_modules/split-string/index.js create mode 100644 node_modules/split-string/package.json create mode 100644 node_modules/ssri/CHANGELOG.md create mode 100644 node_modules/ssri/LICENSE.md create mode 100644 node_modules/ssri/README.md create mode 100644 node_modules/ssri/index.js create mode 100644 node_modules/ssri/package.json create mode 100644 node_modules/stack-trace/.npmignore create mode 100644 node_modules/stack-trace/License create mode 100644 node_modules/stack-trace/Makefile create mode 100644 node_modules/stack-trace/Readme.md create mode 100644 node_modules/stack-trace/lib/stack-trace.js create mode 100644 node_modules/stack-trace/package.json create mode 100644 node_modules/static-extend/LICENSE create mode 100644 node_modules/static-extend/index.js create mode 100644 node_modules/static-extend/node_modules/define-property/LICENSE create mode 100644 node_modules/static-extend/node_modules/define-property/README.md create mode 100644 node_modules/static-extend/node_modules/define-property/index.js create mode 100644 node_modules/static-extend/node_modules/define-property/package.json create mode 100644 node_modules/static-extend/package.json create mode 100644 node_modules/stream-browserify/.travis.yml create mode 100644 node_modules/stream-browserify/LICENSE create mode 100644 node_modules/stream-browserify/index.js create mode 100644 node_modules/stream-browserify/package.json create mode 100644 node_modules/stream-browserify/readme.markdown create mode 100644 node_modules/stream-browserify/test/buf.js create mode 100644 node_modules/stream-each/.travis.yml create mode 100644 node_modules/stream-each/LICENSE create mode 100644 node_modules/stream-each/README.md create mode 100644 node_modules/stream-each/collaborators.md create mode 100644 node_modules/stream-each/index.js create mode 100644 node_modules/stream-each/package.json create mode 100644 node_modules/stream-each/test.js create mode 100644 node_modules/stream-exhaust/README.md create mode 100644 node_modules/stream-exhaust/index.js create mode 100644 node_modules/stream-exhaust/package.json create mode 100644 node_modules/stream-exhaust/test.js create mode 100644 node_modules/stream-http/.airtap.yml create mode 100644 node_modules/stream-http/.travis.yml create mode 100644 node_modules/stream-http/LICENSE create mode 100644 node_modules/stream-http/README.md create mode 100644 node_modules/stream-http/ie8-polyfill.js create mode 100644 node_modules/stream-http/index.js create mode 100644 node_modules/stream-http/lib/capability.js create mode 100644 node_modules/stream-http/lib/request.js create mode 100644 node_modules/stream-http/lib/response.js create mode 100644 node_modules/stream-http/package.json create mode 100644 node_modules/stream-http/test/browser/abort.js create mode 100644 node_modules/stream-http/test/browser/auth.js create mode 100644 node_modules/stream-http/test/browser/binary-streaming.js create mode 100644 node_modules/stream-http/test/browser/binary.js create mode 100644 node_modules/stream-http/test/browser/body-empty.js create mode 100644 node_modules/stream-http/test/browser/cookie.js create mode 100644 node_modules/stream-http/test/browser/disable-fetch.js create mode 100644 node_modules/stream-http/test/browser/error.js.disabled create mode 100644 node_modules/stream-http/test/browser/headers.js create mode 100644 node_modules/stream-http/test/browser/lib/webworker-worker.js create mode 100644 node_modules/stream-http/test/browser/package.json create mode 100644 node_modules/stream-http/test/browser/post-binary.js create mode 100644 node_modules/stream-http/test/browser/post-text.js create mode 100644 node_modules/stream-http/test/browser/text-streaming.js create mode 100644 node_modules/stream-http/test/browser/text.js create mode 100644 node_modules/stream-http/test/browser/timeout.js create mode 100644 node_modules/stream-http/test/browser/webworker.js create mode 100644 node_modules/stream-http/test/node/http-browserify.js create mode 100644 node_modules/stream-http/test/server/index.js create mode 100644 node_modules/stream-http/test/server/static/basic.txt create mode 100644 node_modules/stream-http/test/server/static/browserify.png create mode 100644 node_modules/stream-http/test/server/static/test-polyfill.js create mode 100644 node_modules/stream-shift/.travis.yml create mode 100644 node_modules/stream-shift/LICENSE create mode 100644 node_modules/stream-shift/README.md create mode 100644 node_modules/stream-shift/index.js create mode 100644 node_modules/stream-shift/package.json create mode 100644 node_modules/stream-shift/test.js create mode 100644 node_modules/string-width/index.js create mode 100644 node_modules/string-width/license create mode 100644 node_modules/string-width/package.json create mode 100644 node_modules/string-width/readme.md create mode 100644 node_modules/string_decoder/.travis.yml create mode 100644 node_modules/string_decoder/LICENSE create mode 100644 node_modules/string_decoder/README.md create mode 100644 node_modules/string_decoder/lib/string_decoder.js create mode 100644 node_modules/string_decoder/package.json create mode 100644 node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/strip-ansi/index.js create mode 100644 node_modules/strip-ansi/license create mode 100644 node_modules/strip-ansi/package.json create mode 100644 node_modules/strip-ansi/readme.md create mode 100644 node_modules/strip-bom/index.js create mode 100644 node_modules/strip-bom/license create mode 100644 node_modules/strip-bom/package.json create mode 100644 node_modules/strip-bom/readme.md create mode 100644 node_modules/strip-eof/index.js create mode 100644 node_modules/strip-eof/license create mode 100644 node_modules/strip-eof/package.json create mode 100644 node_modules/strip-eof/readme.md create mode 100644 node_modules/supports-color/browser.js create mode 100644 node_modules/supports-color/index.js create mode 100644 node_modules/supports-color/license create mode 100644 node_modules/supports-color/package.json create mode 100644 node_modules/supports-color/readme.md create mode 100644 node_modules/sver-compat/.npmignore create mode 100644 node_modules/sver-compat/.travis.yml create mode 100644 node_modules/sver-compat/LICENSE create mode 100644 node_modules/sver-compat/README.md create mode 100644 node_modules/sver-compat/convert-range.js create mode 100644 node_modules/sver-compat/package.json create mode 100644 node_modules/sver-compat/sver.js create mode 100644 node_modules/tapable/LICENSE create mode 100644 node_modules/tapable/README.md create mode 100644 node_modules/tapable/lib/AsyncParallelBailHook.js create mode 100644 node_modules/tapable/lib/AsyncParallelHook.js create mode 100644 node_modules/tapable/lib/AsyncSeriesBailHook.js create mode 100644 node_modules/tapable/lib/AsyncSeriesHook.js create mode 100644 node_modules/tapable/lib/AsyncSeriesLoopHook.js create mode 100644 node_modules/tapable/lib/AsyncSeriesWaterfallHook.js create mode 100644 node_modules/tapable/lib/Hook.js create mode 100644 node_modules/tapable/lib/HookCodeFactory.js create mode 100644 node_modules/tapable/lib/HookMap.js create mode 100644 node_modules/tapable/lib/MultiHook.js create mode 100644 node_modules/tapable/lib/SyncBailHook.js create mode 100644 node_modules/tapable/lib/SyncHook.js create mode 100644 node_modules/tapable/lib/SyncLoopHook.js create mode 100644 node_modules/tapable/lib/SyncWaterfallHook.js create mode 100644 node_modules/tapable/lib/Tapable.js create mode 100644 node_modules/tapable/lib/index.js create mode 100644 node_modules/tapable/package.json create mode 100644 node_modules/terser-webpack-plugin/CHANGELOG.md create mode 100644 node_modules/terser-webpack-plugin/LICENSE create mode 100644 node_modules/terser-webpack-plugin/README.md create mode 100644 node_modules/terser-webpack-plugin/dist/TaskRunner.js create mode 100644 node_modules/terser-webpack-plugin/dist/cjs.js create mode 100644 node_modules/terser-webpack-plugin/dist/index.js create mode 100644 node_modules/terser-webpack-plugin/dist/minify.js create mode 100644 node_modules/terser-webpack-plugin/dist/options.json create mode 100644 node_modules/terser-webpack-plugin/dist/worker.js create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/CHANGELOG.md create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/LICENSE create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/README.md create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/dist/source-map.debug.js create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/dist/source-map.js create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/dist/source-map.min.js create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/dist/source-map.min.js.map create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/lib/array-set.js create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/lib/base64-vlq.js create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/lib/base64.js create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/lib/binary-search.js create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/lib/mapping-list.js create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/lib/quick-sort.js create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/lib/source-map-consumer.js create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/lib/source-map-generator.js create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/lib/source-node.js create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/lib/util.js create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/package.json create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/source-map.d.ts create mode 100644 node_modules/terser-webpack-plugin/node_modules/source-map/source-map.js create mode 100644 node_modules/terser-webpack-plugin/package.json create mode 100644 node_modules/terser/CHANGELOG.md create mode 100644 node_modules/terser/LICENSE create mode 100644 node_modules/terser/PATRONS.md create mode 100644 node_modules/terser/README.md create mode 100755 node_modules/terser/bin/terser create mode 100755 node_modules/terser/bin/uglifyjs create mode 100644 node_modules/terser/dist/.gitkeep create mode 100644 node_modules/terser/dist/bundle.min.js create mode 100644 node_modules/terser/dist/bundle.min.js.map create mode 100644 node_modules/terser/node_modules/source-map/CHANGELOG.md create mode 100644 node_modules/terser/node_modules/source-map/LICENSE create mode 100644 node_modules/terser/node_modules/source-map/README.md create mode 100644 node_modules/terser/node_modules/source-map/dist/source-map.debug.js create mode 100644 node_modules/terser/node_modules/source-map/dist/source-map.js create mode 100644 node_modules/terser/node_modules/source-map/dist/source-map.min.js create mode 100644 node_modules/terser/node_modules/source-map/dist/source-map.min.js.map create mode 100644 node_modules/terser/node_modules/source-map/lib/array-set.js create mode 100644 node_modules/terser/node_modules/source-map/lib/base64-vlq.js create mode 100644 node_modules/terser/node_modules/source-map/lib/base64.js create mode 100644 node_modules/terser/node_modules/source-map/lib/binary-search.js create mode 100644 node_modules/terser/node_modules/source-map/lib/mapping-list.js create mode 100644 node_modules/terser/node_modules/source-map/lib/quick-sort.js create mode 100644 node_modules/terser/node_modules/source-map/lib/source-map-consumer.js create mode 100644 node_modules/terser/node_modules/source-map/lib/source-map-generator.js create mode 100644 node_modules/terser/node_modules/source-map/lib/source-node.js create mode 100644 node_modules/terser/node_modules/source-map/lib/util.js create mode 100644 node_modules/terser/node_modules/source-map/package.json create mode 100644 node_modules/terser/node_modules/source-map/source-map.d.ts create mode 100644 node_modules/terser/node_modules/source-map/source-map.js create mode 100644 node_modules/terser/package.json create mode 100644 node_modules/terser/tools/colorless-console.js create mode 100644 node_modules/terser/tools/domprops.js create mode 100644 node_modules/terser/tools/exit.js create mode 100644 node_modules/terser/tools/node.js create mode 100644 node_modules/terser/tools/postinstall.js create mode 100644 node_modules/terser/tools/props.html create mode 100644 node_modules/terser/tools/terser.d.ts create mode 100644 node_modules/through2-filter/LICENSE create mode 100644 node_modules/through2-filter/README.md create mode 100644 node_modules/through2-filter/index.js create mode 100644 node_modules/through2-filter/package.json create mode 100644 node_modules/through2/LICENSE.md create mode 100644 node_modules/through2/README.md create mode 100644 node_modules/through2/package.json create mode 100644 node_modules/through2/through2.js create mode 100644 node_modules/time-stamp/LICENSE create mode 100644 node_modules/time-stamp/README.md create mode 100644 node_modules/time-stamp/index.js create mode 100644 node_modules/time-stamp/package.json create mode 100644 node_modules/timers-browserify/.DS_Store create mode 100644 node_modules/timers-browserify/CHANGELOG.md create mode 100644 node_modules/timers-browserify/LICENSE.md create mode 100644 node_modules/timers-browserify/README.md create mode 100644 node_modules/timers-browserify/main.js create mode 100644 node_modules/timers-browserify/package.json create mode 100644 node_modules/to-absolute-glob/LICENSE create mode 100644 node_modules/to-absolute-glob/index.js create mode 100644 node_modules/to-absolute-glob/package.json create mode 100644 node_modules/to-absolute-glob/readme.md create mode 100644 node_modules/to-arraybuffer/.npmignore create mode 100644 node_modules/to-arraybuffer/.travis.yml create mode 100644 node_modules/to-arraybuffer/.zuul.yml create mode 100644 node_modules/to-arraybuffer/LICENSE create mode 100644 node_modules/to-arraybuffer/README.md create mode 100644 node_modules/to-arraybuffer/index.js create mode 100644 node_modules/to-arraybuffer/package.json create mode 100644 node_modules/to-arraybuffer/test.js create mode 100644 node_modules/to-object-path/LICENSE create mode 100644 node_modules/to-object-path/README.md create mode 100644 node_modules/to-object-path/index.js create mode 100644 node_modules/to-object-path/node_modules/kind-of/LICENSE create mode 100644 node_modules/to-object-path/node_modules/kind-of/README.md create mode 100644 node_modules/to-object-path/node_modules/kind-of/index.js create mode 100644 node_modules/to-object-path/node_modules/kind-of/package.json create mode 100644 node_modules/to-object-path/package.json create mode 100644 node_modules/to-regex-range/LICENSE create mode 100644 node_modules/to-regex-range/README.md create mode 100644 node_modules/to-regex-range/index.js create mode 100644 node_modules/to-regex-range/package.json create mode 100644 node_modules/to-regex/LICENSE create mode 100644 node_modules/to-regex/README.md create mode 100644 node_modules/to-regex/index.js create mode 100644 node_modules/to-regex/package.json create mode 100644 node_modules/to-through/LICENSE create mode 100644 node_modules/to-through/README.md create mode 100644 node_modules/to-through/index.js create mode 100644 node_modules/to-through/package.json create mode 100644 node_modules/tslib/.github/workflows/publish.yaml create mode 100644 node_modules/tslib/CopyrightNotice.txt create mode 100644 node_modules/tslib/LICENSE.txt create mode 100644 node_modules/tslib/README.md create mode 100644 node_modules/tslib/package.json create mode 100644 node_modules/tslib/tslib.d.ts create mode 100644 node_modules/tslib/tslib.es6.html create mode 100644 node_modules/tslib/tslib.es6.js create mode 100644 node_modules/tslib/tslib.html create mode 100644 node_modules/tslib/tslib.js create mode 100644 node_modules/tty-browserify/LICENSE create mode 100644 node_modules/tty-browserify/index.js create mode 100644 node_modules/tty-browserify/package.json create mode 100644 node_modules/tty-browserify/readme.markdown create mode 100644 node_modules/type/.editorconfig create mode 100644 node_modules/type/CHANGELOG.md create mode 100644 node_modules/type/LICENSE create mode 100644 node_modules/type/README.md create mode 100644 node_modules/type/array-length/coerce.js create mode 100644 node_modules/type/array-length/ensure.js create mode 100644 node_modules/type/array-like/ensure.js create mode 100644 node_modules/type/array-like/is.js create mode 100644 node_modules/type/array/ensure.js create mode 100644 node_modules/type/array/is.js create mode 100644 node_modules/type/date/ensure.js create mode 100644 node_modules/type/date/is.js create mode 100644 node_modules/type/error/ensure.js create mode 100644 node_modules/type/error/is.js create mode 100644 node_modules/type/finite/coerce.js create mode 100644 node_modules/type/finite/ensure.js create mode 100644 node_modules/type/function/ensure.js create mode 100644 node_modules/type/function/is.js create mode 100644 node_modules/type/integer/coerce.js create mode 100644 node_modules/type/integer/ensure.js create mode 100644 node_modules/type/iterable/ensure.js create mode 100644 node_modules/type/iterable/is.js create mode 100644 node_modules/type/lib/is-to-string-tag-supported.js create mode 100644 node_modules/type/lib/resolve-exception.js create mode 100644 node_modules/type/lib/safe-to-string.js create mode 100644 node_modules/type/lib/to-short-string.js create mode 100644 node_modules/type/natural-number/coerce.js create mode 100644 node_modules/type/natural-number/ensure.js create mode 100644 node_modules/type/number/coerce.js create mode 100644 node_modules/type/number/ensure.js create mode 100644 node_modules/type/object/ensure.js create mode 100644 node_modules/type/object/is.js create mode 100644 node_modules/type/package.json create mode 100644 node_modules/type/plain-function/ensure.js create mode 100644 node_modules/type/plain-function/is.js create mode 100644 node_modules/type/plain-object/ensure.js create mode 100644 node_modules/type/plain-object/is.js create mode 100644 node_modules/type/promise/ensure.js create mode 100644 node_modules/type/promise/is.js create mode 100644 node_modules/type/prototype/is.js create mode 100644 node_modules/type/reg-exp/ensure.js create mode 100644 node_modules/type/reg-exp/is.js create mode 100644 node_modules/type/safe-integer/coerce.js create mode 100644 node_modules/type/safe-integer/ensure.js create mode 100644 node_modules/type/string/coerce.js create mode 100644 node_modules/type/string/ensure.js create mode 100644 node_modules/type/test/_lib/arrow-function-if-supported.js create mode 100644 node_modules/type/test/_lib/class-if-supported.js create mode 100644 node_modules/type/test/array-length/coerce.js create mode 100644 node_modules/type/test/array-length/ensure.js create mode 100644 node_modules/type/test/array-like/ensure.js create mode 100644 node_modules/type/test/array-like/is.js create mode 100644 node_modules/type/test/array/ensure.js create mode 100644 node_modules/type/test/array/is.js create mode 100644 node_modules/type/test/date/ensure.js create mode 100644 node_modules/type/test/date/is.js create mode 100644 node_modules/type/test/error/ensure.js create mode 100644 node_modules/type/test/error/is.js create mode 100644 node_modules/type/test/finite/coerce.js create mode 100644 node_modules/type/test/finite/ensure.js create mode 100644 node_modules/type/test/function/ensure.js create mode 100644 node_modules/type/test/function/is.js create mode 100644 node_modules/type/test/integer/coerce.js create mode 100644 node_modules/type/test/integer/ensure.js create mode 100644 node_modules/type/test/iterable/ensure.js create mode 100644 node_modules/type/test/iterable/is.js create mode 100644 node_modules/type/test/lib/is-to-string-tag-supported.js create mode 100644 node_modules/type/test/lib/resolve-exception.js create mode 100644 node_modules/type/test/lib/safe-to-string.js create mode 100644 node_modules/type/test/lib/to-short-string.js create mode 100644 node_modules/type/test/natural-number/coerce.js create mode 100644 node_modules/type/test/natural-number/ensure.js create mode 100644 node_modules/type/test/number/coerce.js create mode 100644 node_modules/type/test/number/ensure.js create mode 100644 node_modules/type/test/object/ensure.js create mode 100644 node_modules/type/test/object/is.js create mode 100644 node_modules/type/test/plain-function/ensure.js create mode 100644 node_modules/type/test/plain-function/is.js create mode 100644 node_modules/type/test/plain-object/ensure.js create mode 100644 node_modules/type/test/plain-object/is.js create mode 100644 node_modules/type/test/promise/ensure.js create mode 100644 node_modules/type/test/promise/is.js create mode 100644 node_modules/type/test/prototype/is.js create mode 100644 node_modules/type/test/reg-exp/ensure.js create mode 100644 node_modules/type/test/reg-exp/is.js create mode 100644 node_modules/type/test/safe-integer/coerce.js create mode 100644 node_modules/type/test/safe-integer/ensure.js create mode 100644 node_modules/type/test/string/coerce.js create mode 100644 node_modules/type/test/string/ensure.js create mode 100644 node_modules/type/test/thenable/ensure.js create mode 100644 node_modules/type/test/thenable/is.js create mode 100644 node_modules/type/test/time-value/coerce.js create mode 100644 node_modules/type/test/time-value/ensure.js create mode 100644 node_modules/type/test/value/ensure.js create mode 100644 node_modules/type/test/value/is.js create mode 100644 node_modules/type/thenable/ensure.js create mode 100644 node_modules/type/thenable/is.js create mode 100644 node_modules/type/time-value/coerce.js create mode 100644 node_modules/type/time-value/ensure.js create mode 100644 node_modules/type/value/ensure.js create mode 100644 node_modules/type/value/is.js create mode 100644 node_modules/typedarray/.travis.yml create mode 100644 node_modules/typedarray/LICENSE create mode 100644 node_modules/typedarray/example/tarray.js create mode 100644 node_modules/typedarray/index.js create mode 100644 node_modules/typedarray/package.json create mode 100644 node_modules/typedarray/readme.markdown create mode 100644 node_modules/typedarray/test/server/undef_globals.js create mode 100644 node_modules/typedarray/test/tarray.js create mode 100644 node_modules/unc-path-regex/LICENSE create mode 100644 node_modules/unc-path-regex/README.md create mode 100644 node_modules/unc-path-regex/index.js create mode 100644 node_modules/unc-path-regex/package.json create mode 100644 node_modules/undertaker-registry/LICENSE create mode 100644 node_modules/undertaker-registry/README.md create mode 100644 node_modules/undertaker-registry/index.js create mode 100644 node_modules/undertaker-registry/package.json create mode 100644 node_modules/undertaker/LICENSE create mode 100644 node_modules/undertaker/README.md create mode 100644 node_modules/undertaker/index.js create mode 100644 node_modules/undertaker/lib/get-task.js create mode 100644 node_modules/undertaker/lib/helpers/buildTree.js create mode 100644 node_modules/undertaker/lib/helpers/createExtensions.js create mode 100644 node_modules/undertaker/lib/helpers/metadata.js create mode 100644 node_modules/undertaker/lib/helpers/normalizeArgs.js create mode 100644 node_modules/undertaker/lib/helpers/validateRegistry.js create mode 100644 node_modules/undertaker/lib/last-run.js create mode 100644 node_modules/undertaker/lib/parallel.js create mode 100644 node_modules/undertaker/lib/registry.js create mode 100644 node_modules/undertaker/lib/series.js create mode 100644 node_modules/undertaker/lib/set-task.js create mode 100644 node_modules/undertaker/lib/task.js create mode 100644 node_modules/undertaker/lib/tree.js create mode 100644 node_modules/undertaker/package.json create mode 100644 node_modules/union-value/LICENSE create mode 100644 node_modules/union-value/README.md create mode 100644 node_modules/union-value/index.js create mode 100644 node_modules/union-value/package.json create mode 100644 node_modules/unique-filename/.nyc_output/54942.json create mode 100644 node_modules/unique-filename/.nyc_output/54944.json create mode 100644 node_modules/unique-filename/LICENSE create mode 100644 node_modules/unique-filename/README.md create mode 100644 node_modules/unique-filename/coverage/__root__/index.html create mode 100644 node_modules/unique-filename/coverage/__root__/index.js.html create mode 100644 node_modules/unique-filename/coverage/base.css create mode 100644 node_modules/unique-filename/coverage/index.html create mode 100644 node_modules/unique-filename/coverage/prettify.css create mode 100644 node_modules/unique-filename/coverage/prettify.js create mode 100644 node_modules/unique-filename/coverage/sort-arrow-sprite.png create mode 100644 node_modules/unique-filename/coverage/sorter.js create mode 100644 node_modules/unique-filename/index.js create mode 100644 node_modules/unique-filename/package.json create mode 100644 node_modules/unique-filename/test/index.js create mode 100644 node_modules/unique-slug/.travis.yml create mode 100644 node_modules/unique-slug/LICENSE create mode 100644 node_modules/unique-slug/README.md create mode 100644 node_modules/unique-slug/index.js create mode 100644 node_modules/unique-slug/package.json create mode 100644 node_modules/unique-slug/test/index.js create mode 100644 node_modules/unique-stream/LICENSE create mode 100644 node_modules/unique-stream/README.md create mode 100644 node_modules/unique-stream/index.js create mode 100644 node_modules/unique-stream/package.json create mode 100644 node_modules/unset-value/LICENSE create mode 100644 node_modules/unset-value/README.md create mode 100644 node_modules/unset-value/index.js create mode 100644 node_modules/unset-value/node_modules/has-value/LICENSE create mode 100644 node_modules/unset-value/node_modules/has-value/README.md create mode 100644 node_modules/unset-value/node_modules/has-value/index.js create mode 100644 node_modules/unset-value/node_modules/has-value/node_modules/isobject/LICENSE create mode 100644 node_modules/unset-value/node_modules/has-value/node_modules/isobject/README.md create mode 100644 node_modules/unset-value/node_modules/has-value/node_modules/isobject/index.js create mode 100644 node_modules/unset-value/node_modules/has-value/node_modules/isobject/package.json create mode 100644 node_modules/unset-value/node_modules/has-value/package.json create mode 100644 node_modules/unset-value/node_modules/has-values/LICENSE create mode 100644 node_modules/unset-value/node_modules/has-values/README.md create mode 100644 node_modules/unset-value/node_modules/has-values/index.js create mode 100644 node_modules/unset-value/node_modules/has-values/package.json create mode 100644 node_modules/unset-value/package.json create mode 100755 node_modules/upath/LICENSE create mode 100644 node_modules/upath/build/code/upath.js create mode 100644 node_modules/upath/package.json create mode 100644 node_modules/upath/readme.md create mode 100644 node_modules/upath/upath.d.ts create mode 100644 node_modules/uri-js/README.md create mode 100644 node_modules/uri-js/bower.json create mode 100644 node_modules/uri-js/dist/es5/uri.all.d.ts create mode 100644 node_modules/uri-js/dist/es5/uri.all.js create mode 100644 node_modules/uri-js/dist/es5/uri.all.js.map create mode 100644 node_modules/uri-js/dist/es5/uri.all.min.d.ts create mode 100644 node_modules/uri-js/dist/es5/uri.all.min.js create mode 100644 node_modules/uri-js/dist/es5/uri.all.min.js.map create mode 100644 node_modules/uri-js/dist/esnext/index.d.ts create mode 100644 node_modules/uri-js/dist/esnext/index.js create mode 100644 node_modules/uri-js/dist/esnext/index.js.map create mode 100644 node_modules/uri-js/dist/esnext/regexps-iri.d.ts create mode 100644 node_modules/uri-js/dist/esnext/regexps-iri.js create mode 100644 node_modules/uri-js/dist/esnext/regexps-iri.js.map create mode 100644 node_modules/uri-js/dist/esnext/regexps-uri.d.ts create mode 100644 node_modules/uri-js/dist/esnext/regexps-uri.js create mode 100644 node_modules/uri-js/dist/esnext/regexps-uri.js.map create mode 100644 node_modules/uri-js/dist/esnext/schemes/http.d.ts create mode 100644 node_modules/uri-js/dist/esnext/schemes/http.js create mode 100644 node_modules/uri-js/dist/esnext/schemes/http.js.map create mode 100644 node_modules/uri-js/dist/esnext/schemes/https.d.ts create mode 100644 node_modules/uri-js/dist/esnext/schemes/https.js create mode 100644 node_modules/uri-js/dist/esnext/schemes/https.js.map create mode 100644 node_modules/uri-js/dist/esnext/schemes/mailto.d.ts create mode 100644 node_modules/uri-js/dist/esnext/schemes/mailto.js create mode 100644 node_modules/uri-js/dist/esnext/schemes/mailto.js.map create mode 100644 node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts create mode 100644 node_modules/uri-js/dist/esnext/schemes/urn-uuid.js create mode 100644 node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map create mode 100644 node_modules/uri-js/dist/esnext/schemes/urn.d.ts create mode 100644 node_modules/uri-js/dist/esnext/schemes/urn.js create mode 100644 node_modules/uri-js/dist/esnext/schemes/urn.js.map create mode 100644 node_modules/uri-js/dist/esnext/uri.d.ts create mode 100644 node_modules/uri-js/dist/esnext/uri.js create mode 100644 node_modules/uri-js/dist/esnext/uri.js.map create mode 100644 node_modules/uri-js/dist/esnext/util.d.ts create mode 100644 node_modules/uri-js/dist/esnext/util.js create mode 100644 node_modules/uri-js/dist/esnext/util.js.map create mode 100644 node_modules/uri-js/package.json create mode 100644 node_modules/uri-js/rollup.config.js create mode 100644 node_modules/uri-js/src/index.ts create mode 100644 node_modules/uri-js/src/punycode.d.ts create mode 100644 node_modules/uri-js/src/regexps-iri.ts create mode 100644 node_modules/uri-js/src/regexps-uri.ts create mode 100644 node_modules/uri-js/src/schemes/http.ts create mode 100644 node_modules/uri-js/src/schemes/https.ts create mode 100644 node_modules/uri-js/src/schemes/mailto.ts create mode 100644 node_modules/uri-js/src/schemes/urn-uuid.ts create mode 100644 node_modules/uri-js/src/schemes/urn.ts create mode 100644 node_modules/uri-js/src/uri.ts create mode 100644 node_modules/uri-js/src/util.ts create mode 100644 node_modules/uri-js/tests/qunit.css create mode 100644 node_modules/uri-js/tests/qunit.js create mode 100644 node_modules/uri-js/tests/test-es5-min.html create mode 100644 node_modules/uri-js/tests/test-es5.html create mode 100644 node_modules/uri-js/tests/tests.js create mode 100644 node_modules/uri-js/tsconfig.json create mode 100644 node_modules/uri-js/yarn.lock create mode 100644 node_modules/urix/.jshintrc create mode 100644 node_modules/urix/LICENSE create mode 100644 node_modules/urix/index.js create mode 100644 node_modules/urix/package.json create mode 100644 node_modules/urix/readme.md create mode 100644 node_modules/urix/test/index.js create mode 100644 node_modules/url/.npmignore create mode 100644 node_modules/url/.travis.yml create mode 100644 node_modules/url/.zuul.yml create mode 100644 node_modules/url/LICENSE create mode 100644 node_modules/url/README.md create mode 100644 node_modules/url/node_modules/punycode/LICENSE-MIT.txt create mode 100644 node_modules/url/node_modules/punycode/README.md create mode 100644 node_modules/url/node_modules/punycode/package.json create mode 100644 node_modules/url/node_modules/punycode/punycode.js create mode 100644 node_modules/url/package.json create mode 100644 node_modules/url/test.js create mode 100644 node_modules/url/url.js create mode 100644 node_modules/url/util.js create mode 100644 node_modules/use/LICENSE create mode 100644 node_modules/use/README.md create mode 100644 node_modules/use/index.js create mode 100644 node_modules/use/package.json create mode 100644 node_modules/util-deprecate/History.md create mode 100644 node_modules/util-deprecate/LICENSE create mode 100644 node_modules/util-deprecate/README.md create mode 100644 node_modules/util-deprecate/browser.js create mode 100644 node_modules/util-deprecate/node.js create mode 100644 node_modules/util-deprecate/package.json create mode 100644 node_modules/util/CHANGELOG.md create mode 100644 node_modules/util/LICENSE create mode 100644 node_modules/util/README.md create mode 100644 node_modules/util/node_modules/inherits/LICENSE create mode 100644 node_modules/util/node_modules/inherits/README.md create mode 100644 node_modules/util/node_modules/inherits/inherits.js create mode 100644 node_modules/util/node_modules/inherits/inherits_browser.js create mode 100644 node_modules/util/node_modules/inherits/package.json create mode 100644 node_modules/util/package.json create mode 100644 node_modules/util/support/isBuffer.js create mode 100644 node_modules/util/support/isBufferBrowser.js create mode 100644 node_modules/util/util.js create mode 100644 node_modules/v8-compile-cache/CHANGELOG.md create mode 100644 node_modules/v8-compile-cache/LICENSE create mode 100644 node_modules/v8-compile-cache/README.md create mode 100644 node_modules/v8-compile-cache/package.json create mode 100644 node_modules/v8-compile-cache/v8-compile-cache.js create mode 100644 node_modules/v8flags/LICENSE create mode 100644 node_modules/v8flags/README.md create mode 100644 node_modules/v8flags/config-path.js create mode 100644 node_modules/v8flags/index.js create mode 100644 node_modules/v8flags/package.json create mode 100644 node_modules/validate-npm-package-license/LICENSE create mode 100644 node_modules/validate-npm-package-license/README.md create mode 100644 node_modules/validate-npm-package-license/index.js create mode 100644 node_modules/validate-npm-package-license/package.json create mode 100644 node_modules/value-or-function/LICENSE create mode 100644 node_modules/value-or-function/README.md create mode 100644 node_modules/value-or-function/index.js create mode 100644 node_modules/value-or-function/package.json create mode 100644 node_modules/vinyl-fs/LICENSE create mode 100644 node_modules/vinyl-fs/README.md create mode 100644 node_modules/vinyl-fs/index.js create mode 100644 node_modules/vinyl-fs/lib/constants.js create mode 100644 node_modules/vinyl-fs/lib/dest/index.js create mode 100644 node_modules/vinyl-fs/lib/dest/options.js create mode 100644 node_modules/vinyl-fs/lib/dest/prepare.js create mode 100644 node_modules/vinyl-fs/lib/dest/sourcemap.js create mode 100644 node_modules/vinyl-fs/lib/dest/write-contents/index.js create mode 100644 node_modules/vinyl-fs/lib/dest/write-contents/write-buffer.js create mode 100644 node_modules/vinyl-fs/lib/dest/write-contents/write-dir.js create mode 100644 node_modules/vinyl-fs/lib/dest/write-contents/write-stream.js create mode 100644 node_modules/vinyl-fs/lib/dest/write-contents/write-symbolic-link.js create mode 100644 node_modules/vinyl-fs/lib/file-operations.js create mode 100644 node_modules/vinyl-fs/lib/src/index.js create mode 100644 node_modules/vinyl-fs/lib/src/options.js create mode 100644 node_modules/vinyl-fs/lib/src/prepare.js create mode 100644 node_modules/vinyl-fs/lib/src/read-contents/index.js create mode 100644 node_modules/vinyl-fs/lib/src/read-contents/read-buffer.js create mode 100644 node_modules/vinyl-fs/lib/src/read-contents/read-dir.js create mode 100644 node_modules/vinyl-fs/lib/src/read-contents/read-stream.js create mode 100644 node_modules/vinyl-fs/lib/src/read-contents/read-symbolic-link.js create mode 100644 node_modules/vinyl-fs/lib/src/resolve-symlinks.js create mode 100644 node_modules/vinyl-fs/lib/src/sourcemap.js create mode 100644 node_modules/vinyl-fs/lib/src/wrap-vinyl.js create mode 100644 node_modules/vinyl-fs/lib/symlink/index.js create mode 100644 node_modules/vinyl-fs/lib/symlink/link-file.js create mode 100644 node_modules/vinyl-fs/lib/symlink/options.js create mode 100644 node_modules/vinyl-fs/lib/symlink/prepare.js create mode 100644 node_modules/vinyl-fs/package.json create mode 100644 node_modules/vinyl-sourcemap/LICENSE create mode 100644 node_modules/vinyl-sourcemap/README.md create mode 100644 node_modules/vinyl-sourcemap/index.js create mode 100644 node_modules/vinyl-sourcemap/lib/helpers.js create mode 100644 node_modules/vinyl-sourcemap/node_modules/normalize-path/LICENSE create mode 100644 node_modules/vinyl-sourcemap/node_modules/normalize-path/README.md create mode 100644 node_modules/vinyl-sourcemap/node_modules/normalize-path/index.js create mode 100644 node_modules/vinyl-sourcemap/node_modules/normalize-path/package.json create mode 100644 node_modules/vinyl-sourcemap/package.json create mode 100644 node_modules/vinyl/LICENSE create mode 100644 node_modules/vinyl/README.md create mode 100644 node_modules/vinyl/index.js create mode 100644 node_modules/vinyl/lib/inspect-stream.js create mode 100644 node_modules/vinyl/lib/is-stream.js create mode 100644 node_modules/vinyl/lib/normalize.js create mode 100644 node_modules/vinyl/package.json create mode 100644 node_modules/vm-browserify/.github/FUNDING.yml create mode 100644 node_modules/vm-browserify/.travis.yml create mode 100644 node_modules/vm-browserify/CHANGELOG.md create mode 100644 node_modules/vm-browserify/LICENSE create mode 100644 node_modules/vm-browserify/example/run/bundle.js create mode 100644 node_modules/vm-browserify/example/run/entry.js create mode 100644 node_modules/vm-browserify/example/run/index.html create mode 100644 node_modules/vm-browserify/example/run/server.js create mode 100644 node_modules/vm-browserify/index.js create mode 100644 node_modules/vm-browserify/package.json create mode 100644 node_modules/vm-browserify/readme.markdown create mode 100644 node_modules/vm-browserify/security.md create mode 100644 node_modules/vm-browserify/test/vm.js create mode 100644 node_modules/watchpack/LICENSE create mode 100644 node_modules/watchpack/README.md create mode 100644 node_modules/watchpack/lib/DirectoryWatcher.js create mode 100644 node_modules/watchpack/lib/watcherManager.js create mode 100644 node_modules/watchpack/lib/watchpack.js create mode 100644 node_modules/watchpack/package.json create mode 100644 node_modules/webpack-cli/CHANGELOG.md create mode 100644 node_modules/webpack-cli/LICENSE create mode 100644 node_modules/webpack-cli/README.md create mode 100644 node_modules/webpack-cli/bin/.eslintrc.js create mode 100755 node_modules/webpack-cli/bin/cli.js create mode 100644 node_modules/webpack-cli/bin/config/config-yargs.js create mode 100644 node_modules/webpack-cli/bin/config/optionsSchema.json create mode 100644 node_modules/webpack-cli/bin/config/webpackConfigurationSchema.json create mode 100644 node_modules/webpack-cli/bin/utils/constants.js create mode 100644 node_modules/webpack-cli/bin/utils/convert-argv.js create mode 100644 node_modules/webpack-cli/bin/utils/errorHelpers.js create mode 100644 node_modules/webpack-cli/bin/utils/prepareOptions.js create mode 100644 node_modules/webpack-cli/bin/utils/prompt-command.js create mode 100644 node_modules/webpack-cli/bin/utils/validate-options.js create mode 100644 node_modules/webpack-cli/node_modules/emojis-list/CHANGELOG.md create mode 100755 node_modules/webpack-cli/node_modules/emojis-list/LICENSE.md create mode 100755 node_modules/webpack-cli/node_modules/emojis-list/README.md create mode 100644 node_modules/webpack-cli/node_modules/emojis-list/index.js create mode 100644 node_modules/webpack-cli/node_modules/emojis-list/package.json create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/LICENSE create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/README.md create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/AliasPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/AppendPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/ConcordExtensionsPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/ConcordMainPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/ConcordModulesPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/FileExistsPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/FileKindPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/JoinRequestPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/LogInfoPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/MainFieldPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/ModuleAppendPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/ModuleKindPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/NextPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/NodeJsInputFileSystem.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/ParsePlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/Resolver.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/ResolverFactory.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/ResultPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/SymlinkPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/TryNextPlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/UseFilePlugin.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/concord.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/createInnerCallback.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/createInnerContext.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/forEachBail.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/getInnerRequest.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/getPaths.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/globToRegExp.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/lib/node.js create mode 100644 node_modules/webpack-cli/node_modules/enhanced-resolve/package.json create mode 100644 node_modules/webpack-cli/node_modules/loader-utils/CHANGELOG.md create mode 100644 node_modules/webpack-cli/node_modules/loader-utils/LICENSE create mode 100644 node_modules/webpack-cli/node_modules/loader-utils/README.md create mode 100644 node_modules/webpack-cli/node_modules/loader-utils/lib/getCurrentRequest.js create mode 100644 node_modules/webpack-cli/node_modules/loader-utils/lib/getHashDigest.js create mode 100644 node_modules/webpack-cli/node_modules/loader-utils/lib/getOptions.js create mode 100644 node_modules/webpack-cli/node_modules/loader-utils/lib/getRemainingRequest.js create mode 100644 node_modules/webpack-cli/node_modules/loader-utils/lib/index.js create mode 100644 node_modules/webpack-cli/node_modules/loader-utils/lib/interpolateName.js create mode 100644 node_modules/webpack-cli/node_modules/loader-utils/lib/isUrlRequest.js create mode 100644 node_modules/webpack-cli/node_modules/loader-utils/lib/parseQuery.js create mode 100644 node_modules/webpack-cli/node_modules/loader-utils/lib/parseString.js create mode 100644 node_modules/webpack-cli/node_modules/loader-utils/lib/stringifyRequest.js create mode 100644 node_modules/webpack-cli/node_modules/loader-utils/lib/urlToRequest.js create mode 100644 node_modules/webpack-cli/node_modules/loader-utils/package.json create mode 100644 node_modules/webpack-cli/package.json create mode 100644 node_modules/webpack-sources/LICENSE create mode 100644 node_modules/webpack-sources/README.md create mode 100644 node_modules/webpack-sources/lib/CachedSource.js create mode 100644 node_modules/webpack-sources/lib/ConcatSource.js create mode 100644 node_modules/webpack-sources/lib/LineToLineMappedSource.js create mode 100644 node_modules/webpack-sources/lib/OriginalSource.js create mode 100644 node_modules/webpack-sources/lib/PrefixSource.js create mode 100644 node_modules/webpack-sources/lib/RawSource.js create mode 100644 node_modules/webpack-sources/lib/ReplaceSource.js create mode 100644 node_modules/webpack-sources/lib/Source.js create mode 100644 node_modules/webpack-sources/lib/SourceAndMapMixin.js create mode 100644 node_modules/webpack-sources/lib/SourceMapSource.js create mode 100644 node_modules/webpack-sources/lib/applySourceMap.js create mode 100644 node_modules/webpack-sources/lib/index.js create mode 100644 node_modules/webpack-sources/node_modules/source-map/CHANGELOG.md create mode 100644 node_modules/webpack-sources/node_modules/source-map/LICENSE create mode 100644 node_modules/webpack-sources/node_modules/source-map/README.md create mode 100644 node_modules/webpack-sources/node_modules/source-map/dist/source-map.debug.js create mode 100644 node_modules/webpack-sources/node_modules/source-map/dist/source-map.js create mode 100644 node_modules/webpack-sources/node_modules/source-map/dist/source-map.min.js create mode 100644 node_modules/webpack-sources/node_modules/source-map/dist/source-map.min.js.map create mode 100644 node_modules/webpack-sources/node_modules/source-map/lib/array-set.js create mode 100644 node_modules/webpack-sources/node_modules/source-map/lib/base64-vlq.js create mode 100644 node_modules/webpack-sources/node_modules/source-map/lib/base64.js create mode 100644 node_modules/webpack-sources/node_modules/source-map/lib/binary-search.js create mode 100644 node_modules/webpack-sources/node_modules/source-map/lib/mapping-list.js create mode 100644 node_modules/webpack-sources/node_modules/source-map/lib/quick-sort.js create mode 100644 node_modules/webpack-sources/node_modules/source-map/lib/source-map-consumer.js create mode 100644 node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js create mode 100644 node_modules/webpack-sources/node_modules/source-map/lib/source-node.js create mode 100644 node_modules/webpack-sources/node_modules/source-map/lib/util.js create mode 100644 node_modules/webpack-sources/node_modules/source-map/package.json create mode 100644 node_modules/webpack-sources/node_modules/source-map/source-map.d.ts create mode 100644 node_modules/webpack-sources/node_modules/source-map/source-map.js create mode 100644 node_modules/webpack-sources/package.json create mode 100644 node_modules/webpack/LICENSE create mode 100644 node_modules/webpack/README.md create mode 100644 node_modules/webpack/SECURITY.md create mode 100755 node_modules/webpack/bin/webpack.js create mode 100644 node_modules/webpack/buildin/amd-define.js create mode 100644 node_modules/webpack/buildin/amd-options.js create mode 100644 node_modules/webpack/buildin/global.js create mode 100644 node_modules/webpack/buildin/harmony-module.js create mode 100644 node_modules/webpack/buildin/module.js create mode 100644 node_modules/webpack/buildin/system.js create mode 100644 node_modules/webpack/declarations/WebpackOptions.d.ts create mode 100644 node_modules/webpack/declarations/plugins/BannerPlugin.d.ts create mode 100644 node_modules/webpack/declarations/plugins/DllPlugin.d.ts create mode 100644 node_modules/webpack/declarations/plugins/DllReferencePlugin.d.ts create mode 100644 node_modules/webpack/declarations/plugins/HashedModuleIdsPlugin.d.ts create mode 100644 node_modules/webpack/declarations/plugins/IgnorePlugin.d.ts create mode 100644 node_modules/webpack/declarations/plugins/LoaderOptionsPlugin.d.ts create mode 100644 node_modules/webpack/declarations/plugins/ProgressPlugin.d.ts create mode 100644 node_modules/webpack/declarations/plugins/SourceMapDevToolPlugin.d.ts create mode 100644 node_modules/webpack/declarations/plugins/WatchIgnorePlugin.d.ts create mode 100644 node_modules/webpack/declarations/plugins/debug/ProfilingPlugin.d.ts create mode 100644 node_modules/webpack/declarations/plugins/optimize/AggressiveSplittingPlugin.d.ts create mode 100644 node_modules/webpack/declarations/plugins/optimize/LimitChunkCountPlugin.d.ts create mode 100644 node_modules/webpack/declarations/plugins/optimize/MinChunkSizePlugin.d.ts create mode 100644 node_modules/webpack/declarations/plugins/optimize/OccurrenceOrderChunkIdsPlugin.d.ts create mode 100644 node_modules/webpack/declarations/plugins/optimize/OccurrenceOrderModuleIdsPlugin.d.ts create mode 100644 node_modules/webpack/hot/dev-server.js create mode 100644 node_modules/webpack/hot/emitter.js create mode 100644 node_modules/webpack/hot/log-apply-result.js create mode 100644 node_modules/webpack/hot/log.js create mode 100644 node_modules/webpack/hot/only-dev-server.js create mode 100644 node_modules/webpack/hot/poll.js create mode 100644 node_modules/webpack/hot/signal.js create mode 100644 node_modules/webpack/lib/APIPlugin.js create mode 100644 node_modules/webpack/lib/AbstractMethodError.js create mode 100644 node_modules/webpack/lib/AmdMainTemplatePlugin.js create mode 100644 node_modules/webpack/lib/AsyncDependenciesBlock.js create mode 100644 node_modules/webpack/lib/AsyncDependencyToInitialChunkError.js create mode 100644 node_modules/webpack/lib/AutomaticPrefetchPlugin.js create mode 100644 node_modules/webpack/lib/BannerPlugin.js create mode 100644 node_modules/webpack/lib/BasicEvaluatedExpression.js create mode 100644 node_modules/webpack/lib/CachePlugin.js create mode 100644 node_modules/webpack/lib/CaseSensitiveModulesWarning.js create mode 100644 node_modules/webpack/lib/Chunk.js create mode 100644 node_modules/webpack/lib/ChunkGroup.js create mode 100644 node_modules/webpack/lib/ChunkRenderError.js create mode 100644 node_modules/webpack/lib/ChunkTemplate.js create mode 100644 node_modules/webpack/lib/CommentCompilationWarning.js create mode 100644 node_modules/webpack/lib/CommonJsStuffPlugin.js create mode 100644 node_modules/webpack/lib/CompatibilityPlugin.js create mode 100644 node_modules/webpack/lib/Compilation.js create mode 100644 node_modules/webpack/lib/Compiler.js create mode 100644 node_modules/webpack/lib/ConcurrentCompilationError.js create mode 100644 node_modules/webpack/lib/ConstPlugin.js create mode 100644 node_modules/webpack/lib/ContextExclusionPlugin.js create mode 100644 node_modules/webpack/lib/ContextModule.js create mode 100644 node_modules/webpack/lib/ContextModuleFactory.js create mode 100644 node_modules/webpack/lib/ContextReplacementPlugin.js create mode 100644 node_modules/webpack/lib/DefinePlugin.js create mode 100644 node_modules/webpack/lib/DelegatedModule.js create mode 100644 node_modules/webpack/lib/DelegatedModuleFactoryPlugin.js create mode 100644 node_modules/webpack/lib/DelegatedPlugin.js create mode 100644 node_modules/webpack/lib/DependenciesBlock.js create mode 100644 node_modules/webpack/lib/DependenciesBlockVariable.js create mode 100644 node_modules/webpack/lib/Dependency.js create mode 100644 node_modules/webpack/lib/DllEntryPlugin.js create mode 100644 node_modules/webpack/lib/DllModule.js create mode 100644 node_modules/webpack/lib/DllModuleFactory.js create mode 100644 node_modules/webpack/lib/DllPlugin.js create mode 100644 node_modules/webpack/lib/DllReferencePlugin.js create mode 100644 node_modules/webpack/lib/DynamicEntryPlugin.js create mode 100644 node_modules/webpack/lib/EntryModuleNotFoundError.js create mode 100644 node_modules/webpack/lib/EntryOptionPlugin.js create mode 100644 node_modules/webpack/lib/Entrypoint.js create mode 100644 node_modules/webpack/lib/EnvironmentPlugin.js create mode 100644 node_modules/webpack/lib/ErrorHelpers.js create mode 100644 node_modules/webpack/lib/EvalDevToolModulePlugin.js create mode 100644 node_modules/webpack/lib/EvalDevToolModuleTemplatePlugin.js create mode 100644 node_modules/webpack/lib/EvalSourceMapDevToolModuleTemplatePlugin.js create mode 100644 node_modules/webpack/lib/EvalSourceMapDevToolPlugin.js create mode 100644 node_modules/webpack/lib/ExportPropertyMainTemplatePlugin.js create mode 100644 node_modules/webpack/lib/ExtendedAPIPlugin.js create mode 100644 node_modules/webpack/lib/ExternalModule.js create mode 100644 node_modules/webpack/lib/ExternalModuleFactoryPlugin.js create mode 100644 node_modules/webpack/lib/ExternalsPlugin.js create mode 100644 node_modules/webpack/lib/FlagDependencyExportsPlugin.js create mode 100644 node_modules/webpack/lib/FlagDependencyUsagePlugin.js create mode 100644 node_modules/webpack/lib/FlagInitialModulesAsUsedPlugin.js create mode 100644 node_modules/webpack/lib/FunctionModulePlugin.js create mode 100644 node_modules/webpack/lib/FunctionModuleTemplatePlugin.js create mode 100644 node_modules/webpack/lib/Generator.js create mode 100644 node_modules/webpack/lib/GraphHelpers.js create mode 100644 node_modules/webpack/lib/HarmonyLinkingError.js create mode 100644 node_modules/webpack/lib/HashedModuleIdsPlugin.js create mode 100644 node_modules/webpack/lib/HotModuleReplacement.runtime.js create mode 100644 node_modules/webpack/lib/HotModuleReplacementPlugin.js create mode 100644 node_modules/webpack/lib/HotUpdateChunk.js create mode 100644 node_modules/webpack/lib/HotUpdateChunkTemplate.js create mode 100644 node_modules/webpack/lib/IgnorePlugin.js create mode 100644 node_modules/webpack/lib/JavascriptGenerator.js create mode 100644 node_modules/webpack/lib/JavascriptModulesPlugin.js create mode 100644 node_modules/webpack/lib/JsonGenerator.js create mode 100644 node_modules/webpack/lib/JsonModulesPlugin.js create mode 100644 node_modules/webpack/lib/JsonParser.js create mode 100644 node_modules/webpack/lib/LibManifestPlugin.js create mode 100644 node_modules/webpack/lib/LibraryTemplatePlugin.js create mode 100644 node_modules/webpack/lib/LoaderOptionsPlugin.js create mode 100644 node_modules/webpack/lib/LoaderTargetPlugin.js create mode 100644 node_modules/webpack/lib/MainTemplate.js create mode 100644 node_modules/webpack/lib/MemoryOutputFileSystem.js create mode 100644 node_modules/webpack/lib/Module.js create mode 100644 node_modules/webpack/lib/ModuleBuildError.js create mode 100644 node_modules/webpack/lib/ModuleDependencyError.js create mode 100644 node_modules/webpack/lib/ModuleDependencyWarning.js create mode 100644 node_modules/webpack/lib/ModuleError.js create mode 100644 node_modules/webpack/lib/ModuleFilenameHelpers.js create mode 100644 node_modules/webpack/lib/ModuleNotFoundError.js create mode 100644 node_modules/webpack/lib/ModuleParseError.js create mode 100644 node_modules/webpack/lib/ModuleReason.js create mode 100644 node_modules/webpack/lib/ModuleTemplate.js create mode 100644 node_modules/webpack/lib/ModuleWarning.js create mode 100644 node_modules/webpack/lib/MultiCompiler.js create mode 100644 node_modules/webpack/lib/MultiEntryPlugin.js create mode 100644 node_modules/webpack/lib/MultiModule.js create mode 100644 node_modules/webpack/lib/MultiModuleFactory.js create mode 100644 node_modules/webpack/lib/MultiStats.js create mode 100644 node_modules/webpack/lib/MultiWatching.js create mode 100644 node_modules/webpack/lib/NamedChunksPlugin.js create mode 100644 node_modules/webpack/lib/NamedModulesPlugin.js create mode 100644 node_modules/webpack/lib/NoEmitOnErrorsPlugin.js create mode 100644 node_modules/webpack/lib/NoModeWarning.js create mode 100644 node_modules/webpack/lib/NodeStuffPlugin.js create mode 100644 node_modules/webpack/lib/NormalModule.js create mode 100644 node_modules/webpack/lib/NormalModuleFactory.js create mode 100644 node_modules/webpack/lib/NormalModuleReplacementPlugin.js create mode 100644 node_modules/webpack/lib/NullFactory.js create mode 100644 node_modules/webpack/lib/OptionsApply.js create mode 100644 node_modules/webpack/lib/OptionsDefaulter.js create mode 100644 node_modules/webpack/lib/Parser.js create mode 100644 node_modules/webpack/lib/ParserHelpers.js create mode 100644 node_modules/webpack/lib/PrefetchPlugin.js create mode 100644 node_modules/webpack/lib/ProgressPlugin.js create mode 100644 node_modules/webpack/lib/ProvidePlugin.js create mode 100644 node_modules/webpack/lib/RawModule.js create mode 100644 node_modules/webpack/lib/RecordIdsPlugin.js create mode 100644 node_modules/webpack/lib/RemovedPluginError.js create mode 100644 node_modules/webpack/lib/RequestShortener.js create mode 100644 node_modules/webpack/lib/RequireJsStuffPlugin.js create mode 100644 node_modules/webpack/lib/ResolverFactory.js create mode 100644 node_modules/webpack/lib/RuleSet.js create mode 100644 node_modules/webpack/lib/RuntimeTemplate.js create mode 100644 node_modules/webpack/lib/SetVarMainTemplatePlugin.js create mode 100644 node_modules/webpack/lib/SingleEntryPlugin.js create mode 100644 node_modules/webpack/lib/SizeFormatHelpers.js create mode 100644 node_modules/webpack/lib/SourceMapDevToolModuleOptionsPlugin.js create mode 100644 node_modules/webpack/lib/SourceMapDevToolPlugin.js create mode 100644 node_modules/webpack/lib/Stats.js create mode 100644 node_modules/webpack/lib/SystemMainTemplatePlugin.js create mode 100644 node_modules/webpack/lib/Template.js create mode 100644 node_modules/webpack/lib/TemplatedPathPlugin.js create mode 100644 node_modules/webpack/lib/UmdMainTemplatePlugin.js create mode 100644 node_modules/webpack/lib/UnsupportedFeatureWarning.js create mode 100644 node_modules/webpack/lib/UseStrictPlugin.js create mode 100644 node_modules/webpack/lib/WarnCaseSensitiveModulesPlugin.js create mode 100644 node_modules/webpack/lib/WarnNoModeSetPlugin.js create mode 100644 node_modules/webpack/lib/WatchIgnorePlugin.js create mode 100644 node_modules/webpack/lib/Watching.js create mode 100644 node_modules/webpack/lib/WebpackError.js create mode 100644 node_modules/webpack/lib/WebpackOptionsApply.js create mode 100644 node_modules/webpack/lib/WebpackOptionsDefaulter.js create mode 100644 node_modules/webpack/lib/WebpackOptionsValidationError.js create mode 100644 node_modules/webpack/lib/buildChunkGraph.js create mode 100644 node_modules/webpack/lib/compareLocations.js create mode 100644 node_modules/webpack/lib/debug/ProfilingPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/AMDDefineDependency.js create mode 100644 node_modules/webpack/lib/dependencies/AMDDefineDependencyParserPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/AMDPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/AMDRequireArrayDependency.js create mode 100644 node_modules/webpack/lib/dependencies/AMDRequireContextDependency.js create mode 100644 node_modules/webpack/lib/dependencies/AMDRequireDependenciesBlock.js create mode 100644 node_modules/webpack/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/AMDRequireDependency.js create mode 100644 node_modules/webpack/lib/dependencies/AMDRequireItemDependency.js create mode 100644 node_modules/webpack/lib/dependencies/CommonJsPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/CommonJsRequireContextDependency.js create mode 100644 node_modules/webpack/lib/dependencies/CommonJsRequireDependency.js create mode 100644 node_modules/webpack/lib/dependencies/CommonJsRequireDependencyParserPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/ConstDependency.js create mode 100644 node_modules/webpack/lib/dependencies/ContextDependency.js create mode 100644 node_modules/webpack/lib/dependencies/ContextDependencyHelpers.js create mode 100644 node_modules/webpack/lib/dependencies/ContextDependencyTemplateAsId.js create mode 100644 node_modules/webpack/lib/dependencies/ContextDependencyTemplateAsRequireCall.js create mode 100644 node_modules/webpack/lib/dependencies/ContextElementDependency.js create mode 100644 node_modules/webpack/lib/dependencies/CriticalDependencyWarning.js create mode 100644 node_modules/webpack/lib/dependencies/DelegatedExportsDependency.js create mode 100644 node_modules/webpack/lib/dependencies/DelegatedSourceDependency.js create mode 100644 node_modules/webpack/lib/dependencies/DependencyReference.js create mode 100644 node_modules/webpack/lib/dependencies/DllEntryDependency.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyAcceptDependency.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyAcceptImportDependency.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyCompatibilityDependency.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyDetectionParserPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyExportDependencyParserPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyExportExpressionDependency.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyExportHeaderDependency.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyExportSpecifierDependency.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyImportDependency.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyImportDependencyParserPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyImportSideEffectDependency.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyInitDependency.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyModulesPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/HarmonyTopLevelThisParserPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/ImportContextDependency.js create mode 100644 node_modules/webpack/lib/dependencies/ImportDependenciesBlock.js create mode 100644 node_modules/webpack/lib/dependencies/ImportDependency.js create mode 100644 node_modules/webpack/lib/dependencies/ImportEagerDependency.js create mode 100644 node_modules/webpack/lib/dependencies/ImportParserPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/ImportPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/ImportWeakDependency.js create mode 100644 node_modules/webpack/lib/dependencies/JsonExportsDependency.js create mode 100644 node_modules/webpack/lib/dependencies/LoaderDependency.js create mode 100644 node_modules/webpack/lib/dependencies/LoaderPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/LocalModule.js create mode 100644 node_modules/webpack/lib/dependencies/LocalModuleDependency.js create mode 100644 node_modules/webpack/lib/dependencies/LocalModulesHelpers.js create mode 100644 node_modules/webpack/lib/dependencies/ModuleDependency.js create mode 100644 node_modules/webpack/lib/dependencies/ModuleDependencyTemplateAsId.js create mode 100644 node_modules/webpack/lib/dependencies/ModuleDependencyTemplateAsRequireId.js create mode 100644 node_modules/webpack/lib/dependencies/ModuleHotAcceptDependency.js create mode 100644 node_modules/webpack/lib/dependencies/ModuleHotDeclineDependency.js create mode 100644 node_modules/webpack/lib/dependencies/MultiEntryDependency.js create mode 100644 node_modules/webpack/lib/dependencies/NullDependency.js create mode 100644 node_modules/webpack/lib/dependencies/PrefetchDependency.js create mode 100644 node_modules/webpack/lib/dependencies/RequireContextDependency.js create mode 100644 node_modules/webpack/lib/dependencies/RequireContextDependencyParserPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/RequireContextPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/RequireEnsureDependenciesBlock.js create mode 100644 node_modules/webpack/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/RequireEnsureDependency.js create mode 100644 node_modules/webpack/lib/dependencies/RequireEnsureItemDependency.js create mode 100644 node_modules/webpack/lib/dependencies/RequireEnsurePlugin.js create mode 100644 node_modules/webpack/lib/dependencies/RequireHeaderDependency.js create mode 100644 node_modules/webpack/lib/dependencies/RequireIncludeDependency.js create mode 100644 node_modules/webpack/lib/dependencies/RequireIncludeDependencyParserPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/RequireIncludePlugin.js create mode 100644 node_modules/webpack/lib/dependencies/RequireResolveContextDependency.js create mode 100644 node_modules/webpack/lib/dependencies/RequireResolveDependency.js create mode 100644 node_modules/webpack/lib/dependencies/RequireResolveDependencyParserPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/RequireResolveHeaderDependency.js create mode 100644 node_modules/webpack/lib/dependencies/SingleEntryDependency.js create mode 100644 node_modules/webpack/lib/dependencies/SystemPlugin.js create mode 100644 node_modules/webpack/lib/dependencies/UnsupportedDependency.js create mode 100644 node_modules/webpack/lib/dependencies/WebAssemblyExportImportedDependency.js create mode 100644 node_modules/webpack/lib/dependencies/WebAssemblyImportDependency.js create mode 100644 node_modules/webpack/lib/dependencies/WebpackMissingModule.js create mode 100644 node_modules/webpack/lib/dependencies/getFunctionExpression.js create mode 100644 node_modules/webpack/lib/formatLocation.js create mode 100644 node_modules/webpack/lib/logging/Logger.js create mode 100644 node_modules/webpack/lib/logging/createConsoleLogger.js create mode 100644 node_modules/webpack/lib/logging/runtime.js create mode 100644 node_modules/webpack/lib/logging/truncateArgs.js create mode 100644 node_modules/webpack/lib/node/NodeChunkTemplatePlugin.js create mode 100644 node_modules/webpack/lib/node/NodeEnvironmentPlugin.js create mode 100644 node_modules/webpack/lib/node/NodeHotUpdateChunkTemplatePlugin.js create mode 100644 node_modules/webpack/lib/node/NodeMainTemplate.runtime.js create mode 100644 node_modules/webpack/lib/node/NodeMainTemplateAsync.runtime.js create mode 100644 node_modules/webpack/lib/node/NodeMainTemplatePlugin.js create mode 100644 node_modules/webpack/lib/node/NodeOutputFileSystem.js create mode 100644 node_modules/webpack/lib/node/NodeSourcePlugin.js create mode 100644 node_modules/webpack/lib/node/NodeTargetPlugin.js create mode 100644 node_modules/webpack/lib/node/NodeTemplatePlugin.js create mode 100644 node_modules/webpack/lib/node/NodeWatchFileSystem.js create mode 100644 node_modules/webpack/lib/node/ReadFileCompileWasmTemplatePlugin.js create mode 100644 node_modules/webpack/lib/node/nodeConsole.js create mode 100644 node_modules/webpack/lib/optimize/AggressiveMergingPlugin.js create mode 100644 node_modules/webpack/lib/optimize/AggressiveSplittingPlugin.js create mode 100644 node_modules/webpack/lib/optimize/ChunkModuleIdRangePlugin.js create mode 100644 node_modules/webpack/lib/optimize/ConcatenatedModule.js create mode 100644 node_modules/webpack/lib/optimize/EnsureChunkConditionsPlugin.js create mode 100644 node_modules/webpack/lib/optimize/FlagIncludedChunksPlugin.js create mode 100644 node_modules/webpack/lib/optimize/LimitChunkCountPlugin.js create mode 100644 node_modules/webpack/lib/optimize/MergeDuplicateChunksPlugin.js create mode 100644 node_modules/webpack/lib/optimize/MinChunkSizePlugin.js create mode 100644 node_modules/webpack/lib/optimize/MinMaxSizeWarning.js create mode 100644 node_modules/webpack/lib/optimize/ModuleConcatenationPlugin.js create mode 100644 node_modules/webpack/lib/optimize/NaturalChunkOrderPlugin.js create mode 100644 node_modules/webpack/lib/optimize/OccurrenceChunkOrderPlugin.js create mode 100644 node_modules/webpack/lib/optimize/OccurrenceModuleOrderPlugin.js create mode 100644 node_modules/webpack/lib/optimize/OccurrenceOrderPlugin.js create mode 100644 node_modules/webpack/lib/optimize/RemoveEmptyChunksPlugin.js create mode 100644 node_modules/webpack/lib/optimize/RemoveParentModulesPlugin.js create mode 100644 node_modules/webpack/lib/optimize/RuntimeChunkPlugin.js create mode 100644 node_modules/webpack/lib/optimize/SideEffectsFlagPlugin.js create mode 100644 node_modules/webpack/lib/optimize/SplitChunksPlugin.js create mode 100644 node_modules/webpack/lib/performance/AssetsOverSizeLimitWarning.js create mode 100644 node_modules/webpack/lib/performance/EntrypointsOverSizeLimitWarning.js create mode 100644 node_modules/webpack/lib/performance/NoAsyncChunksWarning.js create mode 100644 node_modules/webpack/lib/performance/SizeLimitsPlugin.js create mode 100644 node_modules/webpack/lib/util/LazyBucketSortedSet.js create mode 100644 node_modules/webpack/lib/util/Queue.js create mode 100644 node_modules/webpack/lib/util/Semaphore.js create mode 100644 node_modules/webpack/lib/util/SetHelpers.js create mode 100644 node_modules/webpack/lib/util/SortableSet.js create mode 100644 node_modules/webpack/lib/util/StackedSetMap.js create mode 100644 node_modules/webpack/lib/util/TrackingSet.js create mode 100644 node_modules/webpack/lib/util/cachedMerge.js create mode 100644 node_modules/webpack/lib/util/cleverMerge.js create mode 100644 node_modules/webpack/lib/util/createHash.js create mode 100644 node_modules/webpack/lib/util/deterministicGrouping.js create mode 100644 node_modules/webpack/lib/util/identifier.js create mode 100644 node_modules/webpack/lib/util/objectToMap.js create mode 100644 node_modules/webpack/lib/validateSchema.js create mode 100644 node_modules/webpack/lib/wasm/UnsupportedWebAssemblyFeatureError.js create mode 100644 node_modules/webpack/lib/wasm/WasmFinalizeExportsPlugin.js create mode 100644 node_modules/webpack/lib/wasm/WasmMainTemplatePlugin.js create mode 100644 node_modules/webpack/lib/wasm/WebAssemblyGenerator.js create mode 100644 node_modules/webpack/lib/wasm/WebAssemblyInInitialChunkError.js create mode 100644 node_modules/webpack/lib/wasm/WebAssemblyJavascriptGenerator.js create mode 100644 node_modules/webpack/lib/wasm/WebAssemblyModulesPlugin.js create mode 100644 node_modules/webpack/lib/wasm/WebAssemblyParser.js create mode 100644 node_modules/webpack/lib/wasm/WebAssemblyUtils.js create mode 100644 node_modules/webpack/lib/web/FetchCompileWasmTemplatePlugin.js create mode 100644 node_modules/webpack/lib/web/JsonpChunkTemplatePlugin.js create mode 100644 node_modules/webpack/lib/web/JsonpExportMainTemplatePlugin.js create mode 100644 node_modules/webpack/lib/web/JsonpHotUpdateChunkTemplatePlugin.js create mode 100644 node_modules/webpack/lib/web/JsonpMainTemplate.runtime.js create mode 100644 node_modules/webpack/lib/web/JsonpMainTemplatePlugin.js create mode 100644 node_modules/webpack/lib/web/JsonpTemplatePlugin.js create mode 100644 node_modules/webpack/lib/web/WebEnvironmentPlugin.js create mode 100644 node_modules/webpack/lib/webpack.js create mode 100644 node_modules/webpack/lib/webpack.web.js create mode 100644 node_modules/webpack/lib/webworker/WebWorkerChunkTemplatePlugin.js create mode 100644 node_modules/webpack/lib/webworker/WebWorkerHotUpdateChunkTemplatePlugin.js create mode 100644 node_modules/webpack/lib/webworker/WebWorkerMainTemplate.runtime.js create mode 100644 node_modules/webpack/lib/webworker/WebWorkerMainTemplatePlugin.js create mode 100644 node_modules/webpack/lib/webworker/WebWorkerTemplatePlugin.js create mode 100644 node_modules/webpack/package.json create mode 100644 node_modules/webpack/schemas/WebpackOptions.json create mode 100644 node_modules/webpack/schemas/ajv.absolutePath.js create mode 100644 node_modules/webpack/schemas/plugins/BannerPlugin.json create mode 100644 node_modules/webpack/schemas/plugins/DllPlugin.json create mode 100644 node_modules/webpack/schemas/plugins/DllReferencePlugin.json create mode 100644 node_modules/webpack/schemas/plugins/HashedModuleIdsPlugin.json create mode 100644 node_modules/webpack/schemas/plugins/IgnorePlugin.json create mode 100644 node_modules/webpack/schemas/plugins/LoaderOptionsPlugin.json create mode 100644 node_modules/webpack/schemas/plugins/ProgressPlugin.json create mode 100644 node_modules/webpack/schemas/plugins/SourceMapDevToolPlugin.json create mode 100644 node_modules/webpack/schemas/plugins/WatchIgnorePlugin.json create mode 100644 node_modules/webpack/schemas/plugins/debug/ProfilingPlugin.json create mode 100644 node_modules/webpack/schemas/plugins/optimize/AggressiveSplittingPlugin.json create mode 100644 node_modules/webpack/schemas/plugins/optimize/LimitChunkCountPlugin.json create mode 100644 node_modules/webpack/schemas/plugins/optimize/MinChunkSizePlugin.json create mode 100644 node_modules/webpack/schemas/plugins/optimize/OccurrenceOrderChunkIdsPlugin.json create mode 100644 node_modules/webpack/schemas/plugins/optimize/OccurrenceOrderModuleIdsPlugin.json create mode 100644 node_modules/webpack/web_modules/node-libs-browser.js create mode 100644 node_modules/which-module/CHANGELOG.md create mode 100644 node_modules/which-module/LICENSE create mode 100644 node_modules/which-module/README.md create mode 100644 node_modules/which-module/index.js create mode 100644 node_modules/which-module/package.json create mode 100644 node_modules/which/CHANGELOG.md create mode 100644 node_modules/which/LICENSE create mode 100644 node_modules/which/README.md create mode 100755 node_modules/which/bin/which create mode 100644 node_modules/which/package.json create mode 100644 node_modules/which/which.js create mode 100644 node_modules/worker-farm/.editorconfig create mode 100644 node_modules/worker-farm/.travis.yml create mode 100644 node_modules/worker-farm/LICENSE.md create mode 100644 node_modules/worker-farm/README.md create mode 100644 node_modules/worker-farm/examples/basic/child.js create mode 100644 node_modules/worker-farm/examples/basic/index.js create mode 100644 node_modules/worker-farm/examples/pi/calc.js create mode 100644 node_modules/worker-farm/examples/pi/index.js create mode 100644 node_modules/worker-farm/index.d.ts create mode 100644 node_modules/worker-farm/lib/child/index.js create mode 100644 node_modules/worker-farm/lib/farm.js create mode 100644 node_modules/worker-farm/lib/fork.js create mode 100644 node_modules/worker-farm/lib/index.js create mode 100644 node_modules/worker-farm/package.json create mode 100644 node_modules/worker-farm/tests/child.js create mode 100644 node_modules/worker-farm/tests/debug.js create mode 100644 node_modules/worker-farm/tests/index.js create mode 100755 node_modules/wrap-ansi/index.js create mode 100644 node_modules/wrap-ansi/license create mode 100644 node_modules/wrap-ansi/package.json create mode 100644 node_modules/wrap-ansi/readme.md create mode 100644 node_modules/wrappy/LICENSE create mode 100644 node_modules/wrappy/README.md create mode 100644 node_modules/wrappy/package.json create mode 100644 node_modules/wrappy/wrappy.js create mode 100644 node_modules/xtend/.jshintrc create mode 100644 node_modules/xtend/LICENSE create mode 100644 node_modules/xtend/README.md create mode 100644 node_modules/xtend/immutable.js create mode 100644 node_modules/xtend/mutable.js create mode 100644 node_modules/xtend/package.json create mode 100644 node_modules/xtend/test.js create mode 100644 node_modules/y18n/CHANGELOG.md create mode 100644 node_modules/y18n/LICENSE create mode 100644 node_modules/y18n/README.md create mode 100644 node_modules/y18n/index.js create mode 100644 node_modules/y18n/package.json create mode 100644 node_modules/yallist/LICENSE create mode 100644 node_modules/yallist/README.md create mode 100644 node_modules/yallist/iterator.js create mode 100644 node_modules/yallist/package.json create mode 100644 node_modules/yallist/yallist.js create mode 100644 node_modules/yargs-parser/CHANGELOG.md create mode 100644 node_modules/yargs-parser/LICENSE.txt create mode 100644 node_modules/yargs-parser/README.md create mode 100644 node_modules/yargs-parser/index.js create mode 100644 node_modules/yargs-parser/lib/tokenize-arg-string.js create mode 100644 node_modules/yargs-parser/package.json create mode 100644 node_modules/yargs/CHANGELOG.md create mode 100644 node_modules/yargs/LICENSE create mode 100644 node_modules/yargs/README.md create mode 100644 node_modules/yargs/index.js create mode 100644 node_modules/yargs/lib/apply-extends.js create mode 100644 node_modules/yargs/lib/argsert.js create mode 100644 node_modules/yargs/lib/command.js create mode 100644 node_modules/yargs/lib/completion-templates.js create mode 100644 node_modules/yargs/lib/completion.js create mode 100644 node_modules/yargs/lib/decamelize.js create mode 100644 node_modules/yargs/lib/is-promise.js create mode 100644 node_modules/yargs/lib/levenshtein.js create mode 100644 node_modules/yargs/lib/middleware.js create mode 100644 node_modules/yargs/lib/obj-filter.js create mode 100644 node_modules/yargs/lib/usage.js create mode 100644 node_modules/yargs/lib/validation.js create mode 100644 node_modules/yargs/lib/yerror.js create mode 100644 node_modules/yargs/locales/be.json create mode 100644 node_modules/yargs/locales/de.json create mode 100644 node_modules/yargs/locales/en.json create mode 100644 node_modules/yargs/locales/es.json create mode 100644 node_modules/yargs/locales/fr.json create mode 100644 node_modules/yargs/locales/hi.json create mode 100644 node_modules/yargs/locales/hu.json create mode 100644 node_modules/yargs/locales/id.json create mode 100644 node_modules/yargs/locales/it.json create mode 100644 node_modules/yargs/locales/ja.json create mode 100644 node_modules/yargs/locales/ko.json create mode 100644 node_modules/yargs/locales/nb.json create mode 100644 node_modules/yargs/locales/nl.json create mode 100644 node_modules/yargs/locales/nn.json create mode 100644 node_modules/yargs/locales/pirate.json create mode 100644 node_modules/yargs/locales/pl.json create mode 100644 node_modules/yargs/locales/pt.json create mode 100644 node_modules/yargs/locales/pt_BR.json create mode 100644 node_modules/yargs/locales/ru.json create mode 100644 node_modules/yargs/locales/th.json create mode 100644 node_modules/yargs/locales/tr.json create mode 100644 node_modules/yargs/locales/zh_CN.json create mode 100644 node_modules/yargs/locales/zh_TW.json create mode 100644 node_modules/yargs/package.json create mode 100644 node_modules/yargs/yargs.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 src/.index.js.swp create mode 100644 src/.r3.js.swp create mode 100644 src/index.js create mode 100644 src/r3.js create mode 100644 webpack.config.js diff --git a/README.md b/README.md new file mode 100644 index 0000000..41ec0dc --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +[R3 v2.0] + diff --git a/dist/index.html b/dist/index.html new file mode 100644 index 0000000..22a4723 --- /dev/null +++ b/dist/index.html @@ -0,0 +1,9 @@ + + + + Getting Started + + + + + diff --git a/dist/r3.js b/dist/r3.js new file mode 100644 index 0000000..05e4c3f --- /dev/null +++ b/dist/r3.js @@ -0,0 +1 @@ +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t)}]); \ No newline at end of file diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn new file mode 120000 index 0000000..cf76760 --- /dev/null +++ b/node_modules/.bin/acorn @@ -0,0 +1 @@ +../acorn/bin/acorn \ No newline at end of file diff --git a/node_modules/.bin/atob b/node_modules/.bin/atob new file mode 120000 index 0000000..a68344a --- /dev/null +++ b/node_modules/.bin/atob @@ -0,0 +1 @@ +../atob/bin/atob.js \ No newline at end of file diff --git a/node_modules/.bin/color-support b/node_modules/.bin/color-support new file mode 120000 index 0000000..fcbcb28 --- /dev/null +++ b/node_modules/.bin/color-support @@ -0,0 +1 @@ +../color-support/bin.js \ No newline at end of file diff --git a/node_modules/.bin/errno b/node_modules/.bin/errno new file mode 120000 index 0000000..5a98e53 --- /dev/null +++ b/node_modules/.bin/errno @@ -0,0 +1 @@ +../errno/cli.js \ No newline at end of file diff --git a/node_modules/.bin/gulp b/node_modules/.bin/gulp new file mode 120000 index 0000000..5de7332 --- /dev/null +++ b/node_modules/.bin/gulp @@ -0,0 +1 @@ +../gulp/bin/gulp.js \ No newline at end of file diff --git a/node_modules/.bin/import-local-fixture b/node_modules/.bin/import-local-fixture new file mode 120000 index 0000000..ff4b104 --- /dev/null +++ b/node_modules/.bin/import-local-fixture @@ -0,0 +1 @@ +../import-local/fixtures/cli.js \ No newline at end of file diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 new file mode 120000 index 0000000..217f379 --- /dev/null +++ b/node_modules/.bin/json5 @@ -0,0 +1 @@ +../json5/lib/cli.js \ No newline at end of file diff --git a/node_modules/.bin/miller-rabin b/node_modules/.bin/miller-rabin new file mode 120000 index 0000000..c175fe9 --- /dev/null +++ b/node_modules/.bin/miller-rabin @@ -0,0 +1 @@ +../miller-rabin/bin/miller-rabin \ No newline at end of file diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp new file mode 120000 index 0000000..017896c --- /dev/null +++ b/node_modules/.bin/mkdirp @@ -0,0 +1 @@ +../mkdirp/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf new file mode 120000 index 0000000..4cd49a4 --- /dev/null +++ b/node_modules/.bin/rimraf @@ -0,0 +1 @@ +../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver new file mode 120000 index 0000000..317eb29 --- /dev/null +++ b/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver \ No newline at end of file diff --git a/node_modules/.bin/sha.js b/node_modules/.bin/sha.js new file mode 120000 index 0000000..3c76105 --- /dev/null +++ b/node_modules/.bin/sha.js @@ -0,0 +1 @@ +../sha.js/bin.js \ No newline at end of file diff --git a/node_modules/.bin/terser b/node_modules/.bin/terser new file mode 120000 index 0000000..0792ff4 --- /dev/null +++ b/node_modules/.bin/terser @@ -0,0 +1 @@ +../terser/bin/terser \ No newline at end of file diff --git a/node_modules/.bin/webpack b/node_modules/.bin/webpack new file mode 120000 index 0000000..d462c1d --- /dev/null +++ b/node_modules/.bin/webpack @@ -0,0 +1 @@ +../webpack/bin/webpack.js \ No newline at end of file diff --git a/node_modules/.bin/webpack-cli b/node_modules/.bin/webpack-cli new file mode 120000 index 0000000..2511f70 --- /dev/null +++ b/node_modules/.bin/webpack-cli @@ -0,0 +1 @@ +../webpack-cli/bin/cli.js \ No newline at end of file diff --git a/node_modules/.bin/which b/node_modules/.bin/which new file mode 120000 index 0000000..f62471c --- /dev/null +++ b/node_modules/.bin/which @@ -0,0 +1 @@ +../which/bin/which \ No newline at end of file diff --git a/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/76/02/c7682eb7d0754318658194124338a4f18b1c7d32c3e19c618180c41b3db7f2c4a2add56c320fdc76b0bd87012259640de0859cc1eeb3580d3eb599d96165 b/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/76/02/c7682eb7d0754318658194124338a4f18b1c7d32c3e19c618180c41b3db7f2c4a2add56c320fdc76b0bd87012259640de0859cc1eeb3580d3eb599d96165 new file mode 100644 index 0000000..3dcb582 --- /dev/null +++ b/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/76/02/c7682eb7d0754318658194124338a4f18b1c7d32c3e19c618180c41b3db7f2c4a2add56c320fdc76b0bd87012259640de0859cc1eeb3580d3eb599d96165 @@ -0,0 +1 @@ +{"code":"!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=0)}([function(e,t,r){\"use strict\";r.r(t)}]);","extractedComments":[]} \ No newline at end of file diff --git a/node_modules/.cache/terser-webpack-plugin/index-v5/dc/b2/4bdebd5fd222e445a1bb7d42e57159e6f0672086f4f90ddbd0aa0fa82870 b/node_modules/.cache/terser-webpack-plugin/index-v5/dc/b2/4bdebd5fd222e445a1bb7d42e57159e6f0672086f4f90ddbd0aa0fa82870 new file mode 100644 index 0000000..467a9b5 --- /dev/null +++ b/node_modules/.cache/terser-webpack-plugin/index-v5/dc/b2/4bdebd5fd222e445a1bb7d42e57159e6f0672086f4f90ddbd0aa0fa82870 @@ -0,0 +1,2 @@ + +425550abe802c0e5432ee7d0dd4a7d8992e40952 {"key":"{\"terser\":\"4.6.4\",\"node_version\":\"v12.14.1\",\"terser-webpack-plugin\":\"1.4.3\",\"terser-webpack-plugin-options\":{\"test\":new RegExp(\"\\\\.m?js(\\\\?.*)?$\", \"i\"),\"chunkFilter\":() => true,\"warningsFilter\":() => true,\"extractComments\":false,\"sourceMap\":false,\"cache\":true,\"cacheKeys\":defaultCacheKeys => defaultCacheKeys,\"parallel\":true,\"include\":undefined,\"exclude\":undefined,\"minify\":undefined,\"terserOptions\":{\"output\":{\"comments\":new RegExp(\"^\\\\**!|@preserve|@license|@cc_on\", \"i\")}}},\"hash\":\"e2a106666b8e46967cc981a0068be341\"}","integrity":"sha512-dgLHaC630HVDGGWBlBJDOKTxixx9MsPhnGGBgMQbPbfyxKKt1WwyD9x2sL2HASJZZA3ghZzB7rNYDT61mdlhZQ==","time":1582812309139,"size":1003} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/LICENSE b/node_modules/@webassemblyjs/ast/LICENSE new file mode 100644 index 0000000..87e7e1f --- /dev/null +++ b/node_modules/@webassemblyjs/ast/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sven Sauleau + +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. diff --git a/node_modules/@webassemblyjs/ast/README.md b/node_modules/@webassemblyjs/ast/README.md new file mode 100644 index 0000000..7560244 --- /dev/null +++ b/node_modules/@webassemblyjs/ast/README.md @@ -0,0 +1,167 @@ +# @webassemblyjs/ast + +> AST utils for webassemblyjs + +## Installation + +```sh +yarn add @webassemblyjs/ast +``` + +## Usage + +### Traverse + +```js +import { traverse } from "@webassemblyjs/ast"; + +traverse(ast, { + Module(path) { + console.log(path.node); + } +}); +``` + +### Instruction signatures + +```js +import { signatures } from "@webassemblyjs/ast"; + +console.log(signatures); +``` + +### Path methods + +- `findParent: NodeLocator` +- `replaceWith: Node => void` +- `remove: () => void` +- `insertBefore: Node => void` +- `insertAfter: Node => void` +- `stop: () => void` + +### AST utils + +- function `module(id, fields, metadata)` +- function `moduleMetadata(sections, functionNames, localNames)` +- function `moduleNameMetadata(value)` +- function `functionNameMetadata(value, index)` +- function `localNameMetadata(value, localIndex, functionIndex)` +- function `binaryModule(id, blob)` +- function `quoteModule(id, string)` +- function `sectionMetadata(section, startOffset, size, vectorOfSize)` +- function `loopInstruction(label, resulttype, instr)` +- function `instruction(id, args, namedArgs)` +- function `objectInstruction(id, object, args, namedArgs)` +- function `ifInstruction(testLabel, test, result, consequent, alternate)` +- function `stringLiteral(value)` +- function `numberLiteralFromRaw(value, raw)` +- function `longNumberLiteral(value, raw)` +- function `floatLiteral(value, nan, inf, raw)` +- function `elem(table, offset, funcs)` +- function `indexInFuncSection(index)` +- function `valtypeLiteral(name)` +- function `typeInstruction(id, functype)` +- function `start(index)` +- function `globalType(valtype, mutability)` +- function `leadingComment(value)` +- function `blockComment(value)` +- function `data(memoryIndex, offset, init)` +- function `global(globalType, init, name)` +- function `table(elementType, limits, name, elements)` +- function `memory(limits, id)` +- function `funcImportDescr(id, signature)` +- function `moduleImport(module, name, descr)` +- function `moduleExportDescr(exportType, id)` +- function `moduleExport(name, descr)` +- function `limit(min, max)` +- function `signature(params, results)` +- function `program(body)` +- function `identifier(value, raw)` +- function `blockInstruction(label, instr, result)` +- function `callInstruction(index, instrArgs)` +- function `callIndirectInstruction(signature, intrs)` +- function `byteArray(values)` +- function `func(name, signature, body, isExternal, metadata)` +- Constant`isModule` +- Constant`isModuleMetadata` +- Constant`isModuleNameMetadata` +- Constant`isFunctionNameMetadata` +- Constant`isLocalNameMetadata` +- Constant`isBinaryModule` +- Constant`isQuoteModule` +- Constant`isSectionMetadata` +- Constant`isLoopInstruction` +- Constant`isInstruction` +- Constant`isObjectInstruction` +- Constant`isIfInstruction` +- Constant`isStringLiteral` +- Constant`isNumberLiteral` +- Constant`isLongNumberLiteral` +- Constant`isFloatLiteral` +- Constant`isElem` +- Constant`isIndexInFuncSection` +- Constant`isValtypeLiteral` +- Constant`isTypeInstruction` +- Constant`isStart` +- Constant`isGlobalType` +- Constant`isLeadingComment` +- Constant`isBlockComment` +- Constant`isData` +- Constant`isGlobal` +- Constant`isTable` +- Constant`isMemory` +- Constant`isFuncImportDescr` +- Constant`isModuleImport` +- Constant`isModuleExportDescr` +- Constant`isModuleExport` +- Constant`isLimit` +- Constant`isSignature` +- Constant`isProgram` +- Constant`isIdentifier` +- Constant`isBlockInstruction` +- Constant`isCallInstruction` +- Constant`isCallIndirectInstruction` +- Constant`isByteArray` +- Constant`isFunc` +- Constant`assertModule` +- Constant`assertModuleMetadata` +- Constant`assertModuleNameMetadata` +- Constant`assertFunctionNameMetadata` +- Constant`assertLocalNameMetadata` +- Constant`assertBinaryModule` +- Constant`assertQuoteModule` +- Constant`assertSectionMetadata` +- Constant`assertLoopInstruction` +- Constant`assertInstruction` +- Constant`assertObjectInstruction` +- Constant`assertIfInstruction` +- Constant`assertStringLiteral` +- Constant`assertNumberLiteral` +- Constant`assertLongNumberLiteral` +- Constant`assertFloatLiteral` +- Constant`assertElem` +- Constant`assertIndexInFuncSection` +- Constant`assertValtypeLiteral` +- Constant`assertTypeInstruction` +- Constant`assertStart` +- Constant`assertGlobalType` +- Constant`assertLeadingComment` +- Constant`assertBlockComment` +- Constant`assertData` +- Constant`assertGlobal` +- Constant`assertTable` +- Constant`assertMemory` +- Constant`assertFuncImportDescr` +- Constant`assertModuleImport` +- Constant`assertModuleExportDescr` +- Constant`assertModuleExport` +- Constant`assertLimit` +- Constant`assertSignature` +- Constant`assertProgram` +- Constant`assertIdentifier` +- Constant`assertBlockInstruction` +- Constant`assertCallInstruction` +- Constant`assertCallIndirectInstruction` +- Constant`assertByteArray` +- Constant`assertFunc` + diff --git a/node_modules/@webassemblyjs/ast/esm/clone.js b/node_modules/@webassemblyjs/ast/esm/clone.js new file mode 100644 index 0000000..92c3f5f --- /dev/null +++ b/node_modules/@webassemblyjs/ast/esm/clone.js @@ -0,0 +1,10 @@ +export function cloneNode(n) { + // $FlowIgnore + var newObj = {}; + + for (var k in n) { + newObj[k] = n[k]; + } + + return newObj; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/esm/definitions.js b/node_modules/@webassemblyjs/ast/esm/definitions.js new file mode 100644 index 0000000..120311b --- /dev/null +++ b/node_modules/@webassemblyjs/ast/esm/definitions.js @@ -0,0 +1,663 @@ +var definitions = {}; + +function defineType(typeName, metadata) { + definitions[typeName] = metadata; +} + +defineType("Module", { + spec: { + wasm: "https://webassembly.github.io/spec/core/binary/modules.html#binary-module", + wat: "https://webassembly.github.io/spec/core/text/modules.html#text-module" + }, + doc: "A module consists of a sequence of sections (termed fields in the text format).", + unionType: ["Node"], + fields: { + id: { + maybe: true, + type: "string" + }, + fields: { + array: true, + type: "Node" + }, + metadata: { + optional: true, + type: "ModuleMetadata" + } + } +}); +defineType("ModuleMetadata", { + unionType: ["Node"], + fields: { + sections: { + array: true, + type: "SectionMetadata" + }, + functionNames: { + optional: true, + array: true, + type: "FunctionNameMetadata" + }, + localNames: { + optional: true, + array: true, + type: "ModuleMetadata" + }, + producers: { + optional: true, + array: true, + type: "ProducersSectionMetadata" + } + } +}); +defineType("ModuleNameMetadata", { + unionType: ["Node"], + fields: { + value: { + type: "string" + } + } +}); +defineType("FunctionNameMetadata", { + unionType: ["Node"], + fields: { + value: { + type: "string" + }, + index: { + type: "number" + } + } +}); +defineType("LocalNameMetadata", { + unionType: ["Node"], + fields: { + value: { + type: "string" + }, + localIndex: { + type: "number" + }, + functionIndex: { + type: "number" + } + } +}); +defineType("BinaryModule", { + unionType: ["Node"], + fields: { + id: { + maybe: true, + type: "string" + }, + blob: { + array: true, + type: "string" + } + } +}); +defineType("QuoteModule", { + unionType: ["Node"], + fields: { + id: { + maybe: true, + type: "string" + }, + string: { + array: true, + type: "string" + } + } +}); +defineType("SectionMetadata", { + unionType: ["Node"], + fields: { + section: { + type: "SectionName" + }, + startOffset: { + type: "number" + }, + size: { + type: "NumberLiteral" + }, + vectorOfSize: { + comment: "Size of the vector in the section (if any)", + type: "NumberLiteral" + } + } +}); +defineType("ProducersSectionMetadata", { + unionType: ["Node"], + fields: { + producers: { + array: true, + type: "ProducerMetadata" + } + } +}); +defineType("ProducerMetadata", { + unionType: ["Node"], + fields: { + language: { + type: "ProducerMetadataVersionedName", + array: true + }, + processedBy: { + type: "ProducerMetadataVersionedName", + array: true + }, + sdk: { + type: "ProducerMetadataVersionedName", + array: true + } + } +}); +defineType("ProducerMetadataVersionedName", { + unionType: ["Node"], + fields: { + name: { + type: "string" + }, + version: { + type: "string" + } + } +}); +/* +Instructions +*/ + +defineType("LoopInstruction", { + unionType: ["Node", "Block", "Instruction"], + fields: { + id: { + constant: true, + type: "string", + value: "loop" + }, + label: { + maybe: true, + type: "Identifier" + }, + resulttype: { + maybe: true, + type: "Valtype" + }, + instr: { + array: true, + type: "Instruction" + } + } +}); +defineType("Instr", { + unionType: ["Node", "Expression", "Instruction"], + fields: { + id: { + type: "string" + }, + object: { + optional: true, + type: "Valtype" + }, + args: { + array: true, + type: "Expression" + }, + namedArgs: { + optional: true, + type: "Object" + } + } +}); +defineType("IfInstruction", { + unionType: ["Node", "Instruction"], + fields: { + id: { + constant: true, + type: "string", + value: "if" + }, + testLabel: { + comment: "only for WAST", + type: "Identifier" + }, + test: { + array: true, + type: "Instruction" + }, + result: { + maybe: true, + type: "Valtype" + }, + consequent: { + array: true, + type: "Instruction" + }, + alternate: { + array: true, + type: "Instruction" + } + } +}); +/* +Concrete value types +*/ + +defineType("StringLiteral", { + unionType: ["Node", "Expression"], + fields: { + value: { + type: "string" + } + } +}); +defineType("NumberLiteral", { + unionType: ["Node", "NumericLiteral", "Expression"], + fields: { + value: { + type: "number" + }, + raw: { + type: "string" + } + } +}); +defineType("LongNumberLiteral", { + unionType: ["Node", "NumericLiteral", "Expression"], + fields: { + value: { + type: "LongNumber" + }, + raw: { + type: "string" + } + } +}); +defineType("FloatLiteral", { + unionType: ["Node", "NumericLiteral", "Expression"], + fields: { + value: { + type: "number" + }, + nan: { + optional: true, + type: "boolean" + }, + inf: { + optional: true, + type: "boolean" + }, + raw: { + type: "string" + } + } +}); +defineType("Elem", { + unionType: ["Node"], + fields: { + table: { + type: "Index" + }, + offset: { + array: true, + type: "Instruction" + }, + funcs: { + array: true, + type: "Index" + } + } +}); +defineType("IndexInFuncSection", { + unionType: ["Node"], + fields: { + index: { + type: "Index" + } + } +}); +defineType("ValtypeLiteral", { + unionType: ["Node", "Expression"], + fields: { + name: { + type: "Valtype" + } + } +}); +defineType("TypeInstruction", { + unionType: ["Node", "Instruction"], + fields: { + id: { + maybe: true, + type: "Index" + }, + functype: { + type: "Signature" + } + } +}); +defineType("Start", { + unionType: ["Node"], + fields: { + index: { + type: "Index" + } + } +}); +defineType("GlobalType", { + unionType: ["Node", "ImportDescr"], + fields: { + valtype: { + type: "Valtype" + }, + mutability: { + type: "Mutability" + } + } +}); +defineType("LeadingComment", { + unionType: ["Node"], + fields: { + value: { + type: "string" + } + } +}); +defineType("BlockComment", { + unionType: ["Node"], + fields: { + value: { + type: "string" + } + } +}); +defineType("Data", { + unionType: ["Node"], + fields: { + memoryIndex: { + type: "Memidx" + }, + offset: { + type: "Instruction" + }, + init: { + type: "ByteArray" + } + } +}); +defineType("Global", { + unionType: ["Node"], + fields: { + globalType: { + type: "GlobalType" + }, + init: { + array: true, + type: "Instruction" + }, + name: { + maybe: true, + type: "Identifier" + } + } +}); +defineType("Table", { + unionType: ["Node", "ImportDescr"], + fields: { + elementType: { + type: "TableElementType" + }, + limits: { + assertNodeType: true, + type: "Limit" + }, + name: { + maybe: true, + type: "Identifier" + }, + elements: { + array: true, + optional: true, + type: "Index" + } + } +}); +defineType("Memory", { + unionType: ["Node", "ImportDescr"], + fields: { + limits: { + type: "Limit" + }, + id: { + maybe: true, + type: "Index" + } + } +}); +defineType("FuncImportDescr", { + unionType: ["Node", "ImportDescr"], + fields: { + id: { + type: "Identifier" + }, + signature: { + type: "Signature" + } + } +}); +defineType("ModuleImport", { + unionType: ["Node"], + fields: { + module: { + type: "string" + }, + name: { + type: "string" + }, + descr: { + type: "ImportDescr" + } + } +}); +defineType("ModuleExportDescr", { + unionType: ["Node"], + fields: { + exportType: { + type: "ExportDescrType" + }, + id: { + type: "Index" + } + } +}); +defineType("ModuleExport", { + unionType: ["Node"], + fields: { + name: { + type: "string" + }, + descr: { + type: "ModuleExportDescr" + } + } +}); +defineType("Limit", { + unionType: ["Node"], + fields: { + min: { + type: "number" + }, + max: { + optional: true, + type: "number" + } + } +}); +defineType("Signature", { + unionType: ["Node"], + fields: { + params: { + array: true, + type: "FuncParam" + }, + results: { + array: true, + type: "Valtype" + } + } +}); +defineType("Program", { + unionType: ["Node"], + fields: { + body: { + array: true, + type: "Node" + } + } +}); +defineType("Identifier", { + unionType: ["Node", "Expression"], + fields: { + value: { + type: "string" + }, + raw: { + optional: true, + type: "string" + } + } +}); +defineType("BlockInstruction", { + unionType: ["Node", "Block", "Instruction"], + fields: { + id: { + constant: true, + type: "string", + value: "block" + }, + label: { + maybe: true, + type: "Identifier" + }, + instr: { + array: true, + type: "Instruction" + }, + result: { + maybe: true, + type: "Valtype" + } + } +}); +defineType("CallInstruction", { + unionType: ["Node", "Instruction"], + fields: { + id: { + constant: true, + type: "string", + value: "call" + }, + index: { + type: "Index" + }, + instrArgs: { + array: true, + optional: true, + type: "Expression" + }, + numeric: { + type: "Index", + optional: true + } + } +}); +defineType("CallIndirectInstruction", { + unionType: ["Node", "Instruction"], + fields: { + id: { + constant: true, + type: "string", + value: "call_indirect" + }, + signature: { + type: "SignatureOrTypeRef" + }, + intrs: { + array: true, + optional: true, + type: "Expression" + } + } +}); +defineType("ByteArray", { + unionType: ["Node"], + fields: { + values: { + array: true, + type: "Byte" + } + } +}); +defineType("Func", { + unionType: ["Node", "Block"], + fields: { + name: { + maybe: true, + type: "Index" + }, + signature: { + type: "SignatureOrTypeRef" + }, + body: { + array: true, + type: "Instruction" + }, + isExternal: { + comment: "means that it has been imported from the outside js", + optional: true, + type: "boolean" + }, + metadata: { + optional: true, + type: "FuncMetadata" + } + } +}); +/** + * Intrinsics + */ + +defineType("InternalBrUnless", { + unionType: ["Node", "Intrinsic"], + fields: { + target: { + type: "number" + } + } +}); +defineType("InternalGoto", { + unionType: ["Node", "Intrinsic"], + fields: { + target: { + type: "number" + } + } +}); +defineType("InternalCallExtern", { + unionType: ["Node", "Intrinsic"], + fields: { + target: { + type: "number" + } + } +}); // function bodies are terminated by an `end` instruction but are missing a +// return instruction +// +// Since we can't inject a new instruction we are injecting a new instruction. + +defineType("InternalEndAndReturn", { + unionType: ["Node", "Intrinsic"], + fields: {} +}); +module.exports = definitions; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/esm/index.js b/node_modules/@webassemblyjs/ast/esm/index.js new file mode 100644 index 0000000..3bce891 --- /dev/null +++ b/node_modules/@webassemblyjs/ast/esm/index.js @@ -0,0 +1,6 @@ +export * from "./nodes"; +export { numberLiteralFromRaw, withLoc, withRaw, funcParam, indexLiteral, memIndexLiteral, instruction, objectInstruction } from "./node-helpers.js"; +export { traverse } from "./traverse"; +export { signatures } from "./signatures"; +export * from "./utils"; +export { cloneNode } from "./clone"; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/esm/node-helpers.js b/node_modules/@webassemblyjs/ast/esm/node-helpers.js new file mode 100644 index 0000000..fb91cae --- /dev/null +++ b/node_modules/@webassemblyjs/ast/esm/node-helpers.js @@ -0,0 +1,84 @@ +import { parse32F, parse64F, parse32I, parse64I, parseU32, isNanLiteral, isInfLiteral } from "@webassemblyjs/wast-parser"; +import { longNumberLiteral, floatLiteral, numberLiteral, instr } from "./nodes"; +export function numberLiteralFromRaw(rawValue) { + var instructionType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "i32"; + var original = rawValue; // Remove numeric separators _ + + if (typeof rawValue === "string") { + rawValue = rawValue.replace(/_/g, ""); + } + + if (typeof rawValue === "number") { + return numberLiteral(rawValue, String(original)); + } else { + switch (instructionType) { + case "i32": + { + return numberLiteral(parse32I(rawValue), String(original)); + } + + case "u32": + { + return numberLiteral(parseU32(rawValue), String(original)); + } + + case "i64": + { + return longNumberLiteral(parse64I(rawValue), String(original)); + } + + case "f32": + { + return floatLiteral(parse32F(rawValue), isNanLiteral(rawValue), isInfLiteral(rawValue), String(original)); + } + // f64 + + default: + { + return floatLiteral(parse64F(rawValue), isNanLiteral(rawValue), isInfLiteral(rawValue), String(original)); + } + } + } +} +export function instruction(id) { + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var namedArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + return instr(id, undefined, args, namedArgs); +} +export function objectInstruction(id, object) { + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + var namedArgs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + return instr(id, object, args, namedArgs); +} +/** + * Decorators + */ + +export function withLoc(n, end, start) { + var loc = { + start: start, + end: end + }; + n.loc = loc; + return n; +} +export function withRaw(n, raw) { + n.raw = raw; + return n; +} +export function funcParam(valtype, id) { + return { + id: id, + valtype: valtype + }; +} +export function indexLiteral(value) { + // $FlowIgnore + var x = numberLiteralFromRaw(value, "u32"); + return x; +} +export function memIndexLiteral(value) { + // $FlowIgnore + var x = numberLiteralFromRaw(value, "u32"); + return x; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/esm/node-path.js b/node_modules/@webassemblyjs/ast/esm/node-path.js new file mode 100644 index 0000000..5a93bbc --- /dev/null +++ b/node_modules/@webassemblyjs/ast/esm/node-path.js @@ -0,0 +1,135 @@ +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function findParent(_ref, cb) { + var parentPath = _ref.parentPath; + + if (parentPath == null) { + throw new Error("node is root"); + } + + var currentPath = parentPath; + + while (cb(currentPath) !== false) { + // Hit the root node, stop + // $FlowIgnore + if (currentPath.parentPath == null) { + return null; + } // $FlowIgnore + + + currentPath = currentPath.parentPath; + } + + return currentPath.node; +} + +function insertBefore(context, newNode) { + return insert(context, newNode); +} + +function insertAfter(context, newNode) { + return insert(context, newNode, 1); +} + +function insert(_ref2, newNode) { + var node = _ref2.node, + inList = _ref2.inList, + parentPath = _ref2.parentPath, + parentKey = _ref2.parentKey; + var indexOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + + if (!inList) { + throw new Error('inList' + " error: " + ("insert can only be used for nodes that are within lists" || "unknown")); + } + + if (!(parentPath != null)) { + throw new Error('parentPath != null' + " error: " + ("Can not remove root node" || "unknown")); + } + + // $FlowIgnore + var parentList = parentPath.node[parentKey]; + var indexInList = parentList.findIndex(function (n) { + return n === node; + }); + parentList.splice(indexInList + indexOffset, 0, newNode); +} + +function remove(_ref3) { + var node = _ref3.node, + parentKey = _ref3.parentKey, + parentPath = _ref3.parentPath; + + if (!(parentPath != null)) { + throw new Error('parentPath != null' + " error: " + ("Can not remove root node" || "unknown")); + } + + // $FlowIgnore + var parentNode = parentPath.node; // $FlowIgnore + + var parentProperty = parentNode[parentKey]; + + if (Array.isArray(parentProperty)) { + // $FlowIgnore + parentNode[parentKey] = parentProperty.filter(function (n) { + return n !== node; + }); + } else { + // $FlowIgnore + delete parentNode[parentKey]; + } + + node._deleted = true; +} + +function stop(context) { + context.shouldStop = true; +} + +function replaceWith(context, newNode) { + // $FlowIgnore + var parentNode = context.parentPath.node; // $FlowIgnore + + var parentProperty = parentNode[context.parentKey]; + + if (Array.isArray(parentProperty)) { + var indexInList = parentProperty.findIndex(function (n) { + return n === context.node; + }); + parentProperty.splice(indexInList, 1, newNode); + } else { + // $FlowIgnore + parentNode[context.parentKey] = newNode; + } + + context.node._deleted = true; + context.node = newNode; +} // bind the context to the first argument of node operations + + +function bindNodeOperations(operations, context) { + var keys = Object.keys(operations); + var boundOperations = {}; + keys.forEach(function (key) { + boundOperations[key] = operations[key].bind(null, context); + }); + return boundOperations; +} + +function createPathOperations(context) { + // $FlowIgnore + return bindNodeOperations({ + findParent: findParent, + replaceWith: replaceWith, + remove: remove, + insertBefore: insertBefore, + insertAfter: insertAfter, + stop: stop + }, context); +} + +export function createPath(context) { + var path = _extends({}, context); + + Object.assign(path, createPathOperations(path)); + return path; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/esm/nodes.js b/node_modules/@webassemblyjs/ast/esm/nodes.js new file mode 100644 index 0000000..0f70793 --- /dev/null +++ b/node_modules/@webassemblyjs/ast/esm/nodes.js @@ -0,0 +1,915 @@ +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +// THIS FILE IS AUTOGENERATED +// see scripts/generateNodeUtils.js +function isTypeOf(t) { + return function (n) { + return n.type === t; + }; +} + +function assertTypeOf(t) { + return function (n) { + return function () { + if (!(n.type === t)) { + throw new Error('n.type === t' + " error: " + (undefined || "unknown")); + } + }(); + }; +} + +export function module(id, fields, metadata) { + if (id !== null && id !== undefined) { + if (!(typeof id === "string")) { + throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown")); + } + } + + if (!(_typeof(fields) === "object" && typeof fields.length !== "undefined")) { + throw new Error('typeof fields === "object" && typeof fields.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "Module", + id: id, + fields: fields + }; + + if (typeof metadata !== "undefined") { + node.metadata = metadata; + } + + return node; +} +export function moduleMetadata(sections, functionNames, localNames, producers) { + if (!(_typeof(sections) === "object" && typeof sections.length !== "undefined")) { + throw new Error('typeof sections === "object" && typeof sections.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (functionNames !== null && functionNames !== undefined) { + if (!(_typeof(functionNames) === "object" && typeof functionNames.length !== "undefined")) { + throw new Error('typeof functionNames === "object" && typeof functionNames.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + } + + if (localNames !== null && localNames !== undefined) { + if (!(_typeof(localNames) === "object" && typeof localNames.length !== "undefined")) { + throw new Error('typeof localNames === "object" && typeof localNames.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + } + + if (producers !== null && producers !== undefined) { + if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) { + throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + } + + var node = { + type: "ModuleMetadata", + sections: sections + }; + + if (typeof functionNames !== "undefined" && functionNames.length > 0) { + node.functionNames = functionNames; + } + + if (typeof localNames !== "undefined" && localNames.length > 0) { + node.localNames = localNames; + } + + if (typeof producers !== "undefined" && producers.length > 0) { + node.producers = producers; + } + + return node; +} +export function moduleNameMetadata(value) { + if (!(typeof value === "string")) { + throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown")); + } + + var node = { + type: "ModuleNameMetadata", + value: value + }; + return node; +} +export function functionNameMetadata(value, index) { + if (!(typeof value === "string")) { + throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown")); + } + + if (!(typeof index === "number")) { + throw new Error('typeof index === "number"' + " error: " + ("Argument index must be of type number, given: " + _typeof(index) || "unknown")); + } + + var node = { + type: "FunctionNameMetadata", + value: value, + index: index + }; + return node; +} +export function localNameMetadata(value, localIndex, functionIndex) { + if (!(typeof value === "string")) { + throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown")); + } + + if (!(typeof localIndex === "number")) { + throw new Error('typeof localIndex === "number"' + " error: " + ("Argument localIndex must be of type number, given: " + _typeof(localIndex) || "unknown")); + } + + if (!(typeof functionIndex === "number")) { + throw new Error('typeof functionIndex === "number"' + " error: " + ("Argument functionIndex must be of type number, given: " + _typeof(functionIndex) || "unknown")); + } + + var node = { + type: "LocalNameMetadata", + value: value, + localIndex: localIndex, + functionIndex: functionIndex + }; + return node; +} +export function binaryModule(id, blob) { + if (id !== null && id !== undefined) { + if (!(typeof id === "string")) { + throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown")); + } + } + + if (!(_typeof(blob) === "object" && typeof blob.length !== "undefined")) { + throw new Error('typeof blob === "object" && typeof blob.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "BinaryModule", + id: id, + blob: blob + }; + return node; +} +export function quoteModule(id, string) { + if (id !== null && id !== undefined) { + if (!(typeof id === "string")) { + throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown")); + } + } + + if (!(_typeof(string) === "object" && typeof string.length !== "undefined")) { + throw new Error('typeof string === "object" && typeof string.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "QuoteModule", + id: id, + string: string + }; + return node; +} +export function sectionMetadata(section, startOffset, size, vectorOfSize) { + if (!(typeof startOffset === "number")) { + throw new Error('typeof startOffset === "number"' + " error: " + ("Argument startOffset must be of type number, given: " + _typeof(startOffset) || "unknown")); + } + + var node = { + type: "SectionMetadata", + section: section, + startOffset: startOffset, + size: size, + vectorOfSize: vectorOfSize + }; + return node; +} +export function producersSectionMetadata(producers) { + if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) { + throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "ProducersSectionMetadata", + producers: producers + }; + return node; +} +export function producerMetadata(language, processedBy, sdk) { + if (!(_typeof(language) === "object" && typeof language.length !== "undefined")) { + throw new Error('typeof language === "object" && typeof language.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (!(_typeof(processedBy) === "object" && typeof processedBy.length !== "undefined")) { + throw new Error('typeof processedBy === "object" && typeof processedBy.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (!(_typeof(sdk) === "object" && typeof sdk.length !== "undefined")) { + throw new Error('typeof sdk === "object" && typeof sdk.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "ProducerMetadata", + language: language, + processedBy: processedBy, + sdk: sdk + }; + return node; +} +export function producerMetadataVersionedName(name, version) { + if (!(typeof name === "string")) { + throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown")); + } + + if (!(typeof version === "string")) { + throw new Error('typeof version === "string"' + " error: " + ("Argument version must be of type string, given: " + _typeof(version) || "unknown")); + } + + var node = { + type: "ProducerMetadataVersionedName", + name: name, + version: version + }; + return node; +} +export function loopInstruction(label, resulttype, instr) { + if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) { + throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "LoopInstruction", + id: "loop", + label: label, + resulttype: resulttype, + instr: instr + }; + return node; +} +export function instr(id, object, args, namedArgs) { + if (!(typeof id === "string")) { + throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown")); + } + + if (!(_typeof(args) === "object" && typeof args.length !== "undefined")) { + throw new Error('typeof args === "object" && typeof args.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "Instr", + id: id, + args: args + }; + + if (typeof object !== "undefined") { + node.object = object; + } + + if (typeof namedArgs !== "undefined" && Object.keys(namedArgs).length !== 0) { + node.namedArgs = namedArgs; + } + + return node; +} +export function ifInstruction(testLabel, test, result, consequent, alternate) { + if (!(_typeof(test) === "object" && typeof test.length !== "undefined")) { + throw new Error('typeof test === "object" && typeof test.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (!(_typeof(consequent) === "object" && typeof consequent.length !== "undefined")) { + throw new Error('typeof consequent === "object" && typeof consequent.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (!(_typeof(alternate) === "object" && typeof alternate.length !== "undefined")) { + throw new Error('typeof alternate === "object" && typeof alternate.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "IfInstruction", + id: "if", + testLabel: testLabel, + test: test, + result: result, + consequent: consequent, + alternate: alternate + }; + return node; +} +export function stringLiteral(value) { + if (!(typeof value === "string")) { + throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown")); + } + + var node = { + type: "StringLiteral", + value: value + }; + return node; +} +export function numberLiteral(value, raw) { + if (!(typeof value === "number")) { + throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || "unknown")); + } + + if (!(typeof raw === "string")) { + throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown")); + } + + var node = { + type: "NumberLiteral", + value: value, + raw: raw + }; + return node; +} +export function longNumberLiteral(value, raw) { + if (!(typeof raw === "string")) { + throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown")); + } + + var node = { + type: "LongNumberLiteral", + value: value, + raw: raw + }; + return node; +} +export function floatLiteral(value, nan, inf, raw) { + if (!(typeof value === "number")) { + throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || "unknown")); + } + + if (nan !== null && nan !== undefined) { + if (!(typeof nan === "boolean")) { + throw new Error('typeof nan === "boolean"' + " error: " + ("Argument nan must be of type boolean, given: " + _typeof(nan) || "unknown")); + } + } + + if (inf !== null && inf !== undefined) { + if (!(typeof inf === "boolean")) { + throw new Error('typeof inf === "boolean"' + " error: " + ("Argument inf must be of type boolean, given: " + _typeof(inf) || "unknown")); + } + } + + if (!(typeof raw === "string")) { + throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown")); + } + + var node = { + type: "FloatLiteral", + value: value, + raw: raw + }; + + if (nan === true) { + node.nan = true; + } + + if (inf === true) { + node.inf = true; + } + + return node; +} +export function elem(table, offset, funcs) { + if (!(_typeof(offset) === "object" && typeof offset.length !== "undefined")) { + throw new Error('typeof offset === "object" && typeof offset.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (!(_typeof(funcs) === "object" && typeof funcs.length !== "undefined")) { + throw new Error('typeof funcs === "object" && typeof funcs.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "Elem", + table: table, + offset: offset, + funcs: funcs + }; + return node; +} +export function indexInFuncSection(index) { + var node = { + type: "IndexInFuncSection", + index: index + }; + return node; +} +export function valtypeLiteral(name) { + var node = { + type: "ValtypeLiteral", + name: name + }; + return node; +} +export function typeInstruction(id, functype) { + var node = { + type: "TypeInstruction", + id: id, + functype: functype + }; + return node; +} +export function start(index) { + var node = { + type: "Start", + index: index + }; + return node; +} +export function globalType(valtype, mutability) { + var node = { + type: "GlobalType", + valtype: valtype, + mutability: mutability + }; + return node; +} +export function leadingComment(value) { + if (!(typeof value === "string")) { + throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown")); + } + + var node = { + type: "LeadingComment", + value: value + }; + return node; +} +export function blockComment(value) { + if (!(typeof value === "string")) { + throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown")); + } + + var node = { + type: "BlockComment", + value: value + }; + return node; +} +export function data(memoryIndex, offset, init) { + var node = { + type: "Data", + memoryIndex: memoryIndex, + offset: offset, + init: init + }; + return node; +} +export function global(globalType, init, name) { + if (!(_typeof(init) === "object" && typeof init.length !== "undefined")) { + throw new Error('typeof init === "object" && typeof init.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "Global", + globalType: globalType, + init: init, + name: name + }; + return node; +} +export function table(elementType, limits, name, elements) { + if (!(limits.type === "Limit")) { + throw new Error('limits.type === "Limit"' + " error: " + ("Argument limits must be of type Limit, given: " + limits.type || "unknown")); + } + + if (elements !== null && elements !== undefined) { + if (!(_typeof(elements) === "object" && typeof elements.length !== "undefined")) { + throw new Error('typeof elements === "object" && typeof elements.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + } + + var node = { + type: "Table", + elementType: elementType, + limits: limits, + name: name + }; + + if (typeof elements !== "undefined" && elements.length > 0) { + node.elements = elements; + } + + return node; +} +export function memory(limits, id) { + var node = { + type: "Memory", + limits: limits, + id: id + }; + return node; +} +export function funcImportDescr(id, signature) { + var node = { + type: "FuncImportDescr", + id: id, + signature: signature + }; + return node; +} +export function moduleImport(module, name, descr) { + if (!(typeof module === "string")) { + throw new Error('typeof module === "string"' + " error: " + ("Argument module must be of type string, given: " + _typeof(module) || "unknown")); + } + + if (!(typeof name === "string")) { + throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown")); + } + + var node = { + type: "ModuleImport", + module: module, + name: name, + descr: descr + }; + return node; +} +export function moduleExportDescr(exportType, id) { + var node = { + type: "ModuleExportDescr", + exportType: exportType, + id: id + }; + return node; +} +export function moduleExport(name, descr) { + if (!(typeof name === "string")) { + throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown")); + } + + var node = { + type: "ModuleExport", + name: name, + descr: descr + }; + return node; +} +export function limit(min, max) { + if (!(typeof min === "number")) { + throw new Error('typeof min === "number"' + " error: " + ("Argument min must be of type number, given: " + _typeof(min) || "unknown")); + } + + if (max !== null && max !== undefined) { + if (!(typeof max === "number")) { + throw new Error('typeof max === "number"' + " error: " + ("Argument max must be of type number, given: " + _typeof(max) || "unknown")); + } + } + + var node = { + type: "Limit", + min: min + }; + + if (typeof max !== "undefined") { + node.max = max; + } + + return node; +} +export function signature(params, results) { + if (!(_typeof(params) === "object" && typeof params.length !== "undefined")) { + throw new Error('typeof params === "object" && typeof params.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (!(_typeof(results) === "object" && typeof results.length !== "undefined")) { + throw new Error('typeof results === "object" && typeof results.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "Signature", + params: params, + results: results + }; + return node; +} +export function program(body) { + if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) { + throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "Program", + body: body + }; + return node; +} +export function identifier(value, raw) { + if (!(typeof value === "string")) { + throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown")); + } + + if (raw !== null && raw !== undefined) { + if (!(typeof raw === "string")) { + throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown")); + } + } + + var node = { + type: "Identifier", + value: value + }; + + if (typeof raw !== "undefined") { + node.raw = raw; + } + + return node; +} +export function blockInstruction(label, instr, result) { + if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) { + throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "BlockInstruction", + id: "block", + label: label, + instr: instr, + result: result + }; + return node; +} +export function callInstruction(index, instrArgs, numeric) { + if (instrArgs !== null && instrArgs !== undefined) { + if (!(_typeof(instrArgs) === "object" && typeof instrArgs.length !== "undefined")) { + throw new Error('typeof instrArgs === "object" && typeof instrArgs.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + } + + var node = { + type: "CallInstruction", + id: "call", + index: index + }; + + if (typeof instrArgs !== "undefined" && instrArgs.length > 0) { + node.instrArgs = instrArgs; + } + + if (typeof numeric !== "undefined") { + node.numeric = numeric; + } + + return node; +} +export function callIndirectInstruction(signature, intrs) { + if (intrs !== null && intrs !== undefined) { + if (!(_typeof(intrs) === "object" && typeof intrs.length !== "undefined")) { + throw new Error('typeof intrs === "object" && typeof intrs.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + } + + var node = { + type: "CallIndirectInstruction", + id: "call_indirect", + signature: signature + }; + + if (typeof intrs !== "undefined" && intrs.length > 0) { + node.intrs = intrs; + } + + return node; +} +export function byteArray(values) { + if (!(_typeof(values) === "object" && typeof values.length !== "undefined")) { + throw new Error('typeof values === "object" && typeof values.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "ByteArray", + values: values + }; + return node; +} +export function func(name, signature, body, isExternal, metadata) { + if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) { + throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (isExternal !== null && isExternal !== undefined) { + if (!(typeof isExternal === "boolean")) { + throw new Error('typeof isExternal === "boolean"' + " error: " + ("Argument isExternal must be of type boolean, given: " + _typeof(isExternal) || "unknown")); + } + } + + var node = { + type: "Func", + name: name, + signature: signature, + body: body + }; + + if (isExternal === true) { + node.isExternal = true; + } + + if (typeof metadata !== "undefined") { + node.metadata = metadata; + } + + return node; +} +export function internalBrUnless(target) { + if (!(typeof target === "number")) { + throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown")); + } + + var node = { + type: "InternalBrUnless", + target: target + }; + return node; +} +export function internalGoto(target) { + if (!(typeof target === "number")) { + throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown")); + } + + var node = { + type: "InternalGoto", + target: target + }; + return node; +} +export function internalCallExtern(target) { + if (!(typeof target === "number")) { + throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown")); + } + + var node = { + type: "InternalCallExtern", + target: target + }; + return node; +} +export function internalEndAndReturn() { + var node = { + type: "InternalEndAndReturn" + }; + return node; +} +export var isModule = isTypeOf("Module"); +export var isModuleMetadata = isTypeOf("ModuleMetadata"); +export var isModuleNameMetadata = isTypeOf("ModuleNameMetadata"); +export var isFunctionNameMetadata = isTypeOf("FunctionNameMetadata"); +export var isLocalNameMetadata = isTypeOf("LocalNameMetadata"); +export var isBinaryModule = isTypeOf("BinaryModule"); +export var isQuoteModule = isTypeOf("QuoteModule"); +export var isSectionMetadata = isTypeOf("SectionMetadata"); +export var isProducersSectionMetadata = isTypeOf("ProducersSectionMetadata"); +export var isProducerMetadata = isTypeOf("ProducerMetadata"); +export var isProducerMetadataVersionedName = isTypeOf("ProducerMetadataVersionedName"); +export var isLoopInstruction = isTypeOf("LoopInstruction"); +export var isInstr = isTypeOf("Instr"); +export var isIfInstruction = isTypeOf("IfInstruction"); +export var isStringLiteral = isTypeOf("StringLiteral"); +export var isNumberLiteral = isTypeOf("NumberLiteral"); +export var isLongNumberLiteral = isTypeOf("LongNumberLiteral"); +export var isFloatLiteral = isTypeOf("FloatLiteral"); +export var isElem = isTypeOf("Elem"); +export var isIndexInFuncSection = isTypeOf("IndexInFuncSection"); +export var isValtypeLiteral = isTypeOf("ValtypeLiteral"); +export var isTypeInstruction = isTypeOf("TypeInstruction"); +export var isStart = isTypeOf("Start"); +export var isGlobalType = isTypeOf("GlobalType"); +export var isLeadingComment = isTypeOf("LeadingComment"); +export var isBlockComment = isTypeOf("BlockComment"); +export var isData = isTypeOf("Data"); +export var isGlobal = isTypeOf("Global"); +export var isTable = isTypeOf("Table"); +export var isMemory = isTypeOf("Memory"); +export var isFuncImportDescr = isTypeOf("FuncImportDescr"); +export var isModuleImport = isTypeOf("ModuleImport"); +export var isModuleExportDescr = isTypeOf("ModuleExportDescr"); +export var isModuleExport = isTypeOf("ModuleExport"); +export var isLimit = isTypeOf("Limit"); +export var isSignature = isTypeOf("Signature"); +export var isProgram = isTypeOf("Program"); +export var isIdentifier = isTypeOf("Identifier"); +export var isBlockInstruction = isTypeOf("BlockInstruction"); +export var isCallInstruction = isTypeOf("CallInstruction"); +export var isCallIndirectInstruction = isTypeOf("CallIndirectInstruction"); +export var isByteArray = isTypeOf("ByteArray"); +export var isFunc = isTypeOf("Func"); +export var isInternalBrUnless = isTypeOf("InternalBrUnless"); +export var isInternalGoto = isTypeOf("InternalGoto"); +export var isInternalCallExtern = isTypeOf("InternalCallExtern"); +export var isInternalEndAndReturn = isTypeOf("InternalEndAndReturn"); +export var isNode = function isNode(node) { + return isModule(node) || isModuleMetadata(node) || isModuleNameMetadata(node) || isFunctionNameMetadata(node) || isLocalNameMetadata(node) || isBinaryModule(node) || isQuoteModule(node) || isSectionMetadata(node) || isProducersSectionMetadata(node) || isProducerMetadata(node) || isProducerMetadataVersionedName(node) || isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isElem(node) || isIndexInFuncSection(node) || isValtypeLiteral(node) || isTypeInstruction(node) || isStart(node) || isGlobalType(node) || isLeadingComment(node) || isBlockComment(node) || isData(node) || isGlobal(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node) || isModuleImport(node) || isModuleExportDescr(node) || isModuleExport(node) || isLimit(node) || isSignature(node) || isProgram(node) || isIdentifier(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node) || isByteArray(node) || isFunc(node) || isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node); +}; +export var isBlock = function isBlock(node) { + return isLoopInstruction(node) || isBlockInstruction(node) || isFunc(node); +}; +export var isInstruction = function isInstruction(node) { + return isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isTypeInstruction(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node); +}; +export var isExpression = function isExpression(node) { + return isInstr(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isValtypeLiteral(node) || isIdentifier(node); +}; +export var isNumericLiteral = function isNumericLiteral(node) { + return isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node); +}; +export var isImportDescr = function isImportDescr(node) { + return isGlobalType(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node); +}; +export var isIntrinsic = function isIntrinsic(node) { + return isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node); +}; +export var assertModule = assertTypeOf("Module"); +export var assertModuleMetadata = assertTypeOf("ModuleMetadata"); +export var assertModuleNameMetadata = assertTypeOf("ModuleNameMetadata"); +export var assertFunctionNameMetadata = assertTypeOf("FunctionNameMetadata"); +export var assertLocalNameMetadata = assertTypeOf("LocalNameMetadata"); +export var assertBinaryModule = assertTypeOf("BinaryModule"); +export var assertQuoteModule = assertTypeOf("QuoteModule"); +export var assertSectionMetadata = assertTypeOf("SectionMetadata"); +export var assertProducersSectionMetadata = assertTypeOf("ProducersSectionMetadata"); +export var assertProducerMetadata = assertTypeOf("ProducerMetadata"); +export var assertProducerMetadataVersionedName = assertTypeOf("ProducerMetadataVersionedName"); +export var assertLoopInstruction = assertTypeOf("LoopInstruction"); +export var assertInstr = assertTypeOf("Instr"); +export var assertIfInstruction = assertTypeOf("IfInstruction"); +export var assertStringLiteral = assertTypeOf("StringLiteral"); +export var assertNumberLiteral = assertTypeOf("NumberLiteral"); +export var assertLongNumberLiteral = assertTypeOf("LongNumberLiteral"); +export var assertFloatLiteral = assertTypeOf("FloatLiteral"); +export var assertElem = assertTypeOf("Elem"); +export var assertIndexInFuncSection = assertTypeOf("IndexInFuncSection"); +export var assertValtypeLiteral = assertTypeOf("ValtypeLiteral"); +export var assertTypeInstruction = assertTypeOf("TypeInstruction"); +export var assertStart = assertTypeOf("Start"); +export var assertGlobalType = assertTypeOf("GlobalType"); +export var assertLeadingComment = assertTypeOf("LeadingComment"); +export var assertBlockComment = assertTypeOf("BlockComment"); +export var assertData = assertTypeOf("Data"); +export var assertGlobal = assertTypeOf("Global"); +export var assertTable = assertTypeOf("Table"); +export var assertMemory = assertTypeOf("Memory"); +export var assertFuncImportDescr = assertTypeOf("FuncImportDescr"); +export var assertModuleImport = assertTypeOf("ModuleImport"); +export var assertModuleExportDescr = assertTypeOf("ModuleExportDescr"); +export var assertModuleExport = assertTypeOf("ModuleExport"); +export var assertLimit = assertTypeOf("Limit"); +export var assertSignature = assertTypeOf("Signature"); +export var assertProgram = assertTypeOf("Program"); +export var assertIdentifier = assertTypeOf("Identifier"); +export var assertBlockInstruction = assertTypeOf("BlockInstruction"); +export var assertCallInstruction = assertTypeOf("CallInstruction"); +export var assertCallIndirectInstruction = assertTypeOf("CallIndirectInstruction"); +export var assertByteArray = assertTypeOf("ByteArray"); +export var assertFunc = assertTypeOf("Func"); +export var assertInternalBrUnless = assertTypeOf("InternalBrUnless"); +export var assertInternalGoto = assertTypeOf("InternalGoto"); +export var assertInternalCallExtern = assertTypeOf("InternalCallExtern"); +export var assertInternalEndAndReturn = assertTypeOf("InternalEndAndReturn"); +export var unionTypesMap = { + Module: ["Node"], + ModuleMetadata: ["Node"], + ModuleNameMetadata: ["Node"], + FunctionNameMetadata: ["Node"], + LocalNameMetadata: ["Node"], + BinaryModule: ["Node"], + QuoteModule: ["Node"], + SectionMetadata: ["Node"], + ProducersSectionMetadata: ["Node"], + ProducerMetadata: ["Node"], + ProducerMetadataVersionedName: ["Node"], + LoopInstruction: ["Node", "Block", "Instruction"], + Instr: ["Node", "Expression", "Instruction"], + IfInstruction: ["Node", "Instruction"], + StringLiteral: ["Node", "Expression"], + NumberLiteral: ["Node", "NumericLiteral", "Expression"], + LongNumberLiteral: ["Node", "NumericLiteral", "Expression"], + FloatLiteral: ["Node", "NumericLiteral", "Expression"], + Elem: ["Node"], + IndexInFuncSection: ["Node"], + ValtypeLiteral: ["Node", "Expression"], + TypeInstruction: ["Node", "Instruction"], + Start: ["Node"], + GlobalType: ["Node", "ImportDescr"], + LeadingComment: ["Node"], + BlockComment: ["Node"], + Data: ["Node"], + Global: ["Node"], + Table: ["Node", "ImportDescr"], + Memory: ["Node", "ImportDescr"], + FuncImportDescr: ["Node", "ImportDescr"], + ModuleImport: ["Node"], + ModuleExportDescr: ["Node"], + ModuleExport: ["Node"], + Limit: ["Node"], + Signature: ["Node"], + Program: ["Node"], + Identifier: ["Node", "Expression"], + BlockInstruction: ["Node", "Block", "Instruction"], + CallInstruction: ["Node", "Instruction"], + CallIndirectInstruction: ["Node", "Instruction"], + ByteArray: ["Node"], + Func: ["Node", "Block"], + InternalBrUnless: ["Node", "Intrinsic"], + InternalGoto: ["Node", "Intrinsic"], + InternalCallExtern: ["Node", "Intrinsic"], + InternalEndAndReturn: ["Node", "Intrinsic"] +}; +export var nodeAndUnionTypes = ["Module", "ModuleMetadata", "ModuleNameMetadata", "FunctionNameMetadata", "LocalNameMetadata", "BinaryModule", "QuoteModule", "SectionMetadata", "ProducersSectionMetadata", "ProducerMetadata", "ProducerMetadataVersionedName", "LoopInstruction", "Instr", "IfInstruction", "StringLiteral", "NumberLiteral", "LongNumberLiteral", "FloatLiteral", "Elem", "IndexInFuncSection", "ValtypeLiteral", "TypeInstruction", "Start", "GlobalType", "LeadingComment", "BlockComment", "Data", "Global", "Table", "Memory", "FuncImportDescr", "ModuleImport", "ModuleExportDescr", "ModuleExport", "Limit", "Signature", "Program", "Identifier", "BlockInstruction", "CallInstruction", "CallIndirectInstruction", "ByteArray", "Func", "InternalBrUnless", "InternalGoto", "InternalCallExtern", "InternalEndAndReturn", "Node", "Block", "Instruction", "Expression", "NumericLiteral", "ImportDescr", "Intrinsic"]; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/esm/signatures.js b/node_modules/@webassemblyjs/ast/esm/signatures.js new file mode 100644 index 0000000..2f2750b --- /dev/null +++ b/node_modules/@webassemblyjs/ast/esm/signatures.js @@ -0,0 +1,199 @@ +function sign(input, output) { + return [input, output]; +} + +var u32 = "u32"; +var i32 = "i32"; +var i64 = "i64"; +var f32 = "f32"; +var f64 = "f64"; + +var vector = function vector(t) { + var vecType = [t]; // $FlowIgnore + + vecType.vector = true; + return vecType; +}; + +var controlInstructions = { + unreachable: sign([], []), + nop: sign([], []), + // block ? + // loop ? + // if ? + // if else ? + br: sign([u32], []), + br_if: sign([u32], []), + br_table: sign(vector(u32), []), + return: sign([], []), + call: sign([u32], []), + call_indirect: sign([u32], []) +}; +var parametricInstructions = { + drop: sign([], []), + select: sign([], []) +}; +var variableInstructions = { + get_local: sign([u32], []), + set_local: sign([u32], []), + tee_local: sign([u32], []), + get_global: sign([u32], []), + set_global: sign([u32], []) +}; +var memoryInstructions = { + "i32.load": sign([u32, u32], [i32]), + "i64.load": sign([u32, u32], []), + "f32.load": sign([u32, u32], []), + "f64.load": sign([u32, u32], []), + "i32.load8_s": sign([u32, u32], [i32]), + "i32.load8_u": sign([u32, u32], [i32]), + "i32.load16_s": sign([u32, u32], [i32]), + "i32.load16_u": sign([u32, u32], [i32]), + "i64.load8_s": sign([u32, u32], [i64]), + "i64.load8_u": sign([u32, u32], [i64]), + "i64.load16_s": sign([u32, u32], [i64]), + "i64.load16_u": sign([u32, u32], [i64]), + "i64.load32_s": sign([u32, u32], [i64]), + "i64.load32_u": sign([u32, u32], [i64]), + "i32.store": sign([u32, u32], []), + "i64.store": sign([u32, u32], []), + "f32.store": sign([u32, u32], []), + "f64.store": sign([u32, u32], []), + "i32.store8": sign([u32, u32], []), + "i32.store16": sign([u32, u32], []), + "i64.store8": sign([u32, u32], []), + "i64.store16": sign([u32, u32], []), + "i64.store32": sign([u32, u32], []), + current_memory: sign([], []), + grow_memory: sign([], []) +}; +var numericInstructions = { + "i32.const": sign([i32], [i32]), + "i64.const": sign([i64], [i64]), + "f32.const": sign([f32], [f32]), + "f64.const": sign([f64], [f64]), + "i32.eqz": sign([i32], [i32]), + "i32.eq": sign([i32, i32], [i32]), + "i32.ne": sign([i32, i32], [i32]), + "i32.lt_s": sign([i32, i32], [i32]), + "i32.lt_u": sign([i32, i32], [i32]), + "i32.gt_s": sign([i32, i32], [i32]), + "i32.gt_u": sign([i32, i32], [i32]), + "i32.le_s": sign([i32, i32], [i32]), + "i32.le_u": sign([i32, i32], [i32]), + "i32.ge_s": sign([i32, i32], [i32]), + "i32.ge_u": sign([i32, i32], [i32]), + "i64.eqz": sign([i64], [i64]), + "i64.eq": sign([i64, i64], [i32]), + "i64.ne": sign([i64, i64], [i32]), + "i64.lt_s": sign([i64, i64], [i32]), + "i64.lt_u": sign([i64, i64], [i32]), + "i64.gt_s": sign([i64, i64], [i32]), + "i64.gt_u": sign([i64, i64], [i32]), + "i64.le_s": sign([i64, i64], [i32]), + "i64.le_u": sign([i64, i64], [i32]), + "i64.ge_s": sign([i64, i64], [i32]), + "i64.ge_u": sign([i64, i64], [i32]), + "f32.eq": sign([f32, f32], [i32]), + "f32.ne": sign([f32, f32], [i32]), + "f32.lt": sign([f32, f32], [i32]), + "f32.gt": sign([f32, f32], [i32]), + "f32.le": sign([f32, f32], [i32]), + "f32.ge": sign([f32, f32], [i32]), + "f64.eq": sign([f64, f64], [i32]), + "f64.ne": sign([f64, f64], [i32]), + "f64.lt": sign([f64, f64], [i32]), + "f64.gt": sign([f64, f64], [i32]), + "f64.le": sign([f64, f64], [i32]), + "f64.ge": sign([f64, f64], [i32]), + "i32.clz": sign([i32], [i32]), + "i32.ctz": sign([i32], [i32]), + "i32.popcnt": sign([i32], [i32]), + "i32.add": sign([i32, i32], [i32]), + "i32.sub": sign([i32, i32], [i32]), + "i32.mul": sign([i32, i32], [i32]), + "i32.div_s": sign([i32, i32], [i32]), + "i32.div_u": sign([i32, i32], [i32]), + "i32.rem_s": sign([i32, i32], [i32]), + "i32.rem_u": sign([i32, i32], [i32]), + "i32.and": sign([i32, i32], [i32]), + "i32.or": sign([i32, i32], [i32]), + "i32.xor": sign([i32, i32], [i32]), + "i32.shl": sign([i32, i32], [i32]), + "i32.shr_s": sign([i32, i32], [i32]), + "i32.shr_u": sign([i32, i32], [i32]), + "i32.rotl": sign([i32, i32], [i32]), + "i32.rotr": sign([i32, i32], [i32]), + "i64.clz": sign([i64], [i64]), + "i64.ctz": sign([i64], [i64]), + "i64.popcnt": sign([i64], [i64]), + "i64.add": sign([i64, i64], [i64]), + "i64.sub": sign([i64, i64], [i64]), + "i64.mul": sign([i64, i64], [i64]), + "i64.div_s": sign([i64, i64], [i64]), + "i64.div_u": sign([i64, i64], [i64]), + "i64.rem_s": sign([i64, i64], [i64]), + "i64.rem_u": sign([i64, i64], [i64]), + "i64.and": sign([i64, i64], [i64]), + "i64.or": sign([i64, i64], [i64]), + "i64.xor": sign([i64, i64], [i64]), + "i64.shl": sign([i64, i64], [i64]), + "i64.shr_s": sign([i64, i64], [i64]), + "i64.shr_u": sign([i64, i64], [i64]), + "i64.rotl": sign([i64, i64], [i64]), + "i64.rotr": sign([i64, i64], [i64]), + "f32.abs": sign([f32], [f32]), + "f32.neg": sign([f32], [f32]), + "f32.ceil": sign([f32], [f32]), + "f32.floor": sign([f32], [f32]), + "f32.trunc": sign([f32], [f32]), + "f32.nearest": sign([f32], [f32]), + "f32.sqrt": sign([f32], [f32]), + "f32.add": sign([f32, f32], [f32]), + "f32.sub": sign([f32, f32], [f32]), + "f32.mul": sign([f32, f32], [f32]), + "f32.div": sign([f32, f32], [f32]), + "f32.min": sign([f32, f32], [f32]), + "f32.max": sign([f32, f32], [f32]), + "f32.copysign": sign([f32, f32], [f32]), + "f64.abs": sign([f64], [f64]), + "f64.neg": sign([f64], [f64]), + "f64.ceil": sign([f64], [f64]), + "f64.floor": sign([f64], [f64]), + "f64.trunc": sign([f64], [f64]), + "f64.nearest": sign([f64], [f64]), + "f64.sqrt": sign([f64], [f64]), + "f64.add": sign([f64, f64], [f64]), + "f64.sub": sign([f64, f64], [f64]), + "f64.mul": sign([f64, f64], [f64]), + "f64.div": sign([f64, f64], [f64]), + "f64.min": sign([f64, f64], [f64]), + "f64.max": sign([f64, f64], [f64]), + "f64.copysign": sign([f64, f64], [f64]), + "i32.wrap/i64": sign([i64], [i32]), + "i32.trunc_s/f32": sign([f32], [i32]), + "i32.trunc_u/f32": sign([f32], [i32]), + "i32.trunc_s/f64": sign([f32], [i32]), + "i32.trunc_u/f64": sign([f64], [i32]), + "i64.extend_s/i32": sign([i32], [i64]), + "i64.extend_u/i32": sign([i32], [i64]), + "i64.trunc_s/f32": sign([f32], [i64]), + "i64.trunc_u/f32": sign([f32], [i64]), + "i64.trunc_s/f64": sign([f64], [i64]), + "i64.trunc_u/f64": sign([f64], [i64]), + "f32.convert_s/i32": sign([i32], [f32]), + "f32.convert_u/i32": sign([i32], [f32]), + "f32.convert_s/i64": sign([i64], [f32]), + "f32.convert_u/i64": sign([i64], [f32]), + "f32.demote/f64": sign([f64], [f32]), + "f64.convert_s/i32": sign([i32], [f64]), + "f64.convert_u/i32": sign([i32], [f64]), + "f64.convert_s/i64": sign([i64], [f64]), + "f64.convert_u/i64": sign([i64], [f64]), + "f64.promote/f32": sign([f32], [f64]), + "i32.reinterpret/f32": sign([f32], [i32]), + "i64.reinterpret/f64": sign([f64], [i64]), + "f32.reinterpret/i32": sign([i32], [f32]), + "f64.reinterpret/i64": sign([i64], [f64]) +}; +export var signatures = Object.assign({}, controlInstructions, parametricInstructions, variableInstructions, memoryInstructions, numericInstructions); \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/esm/transform/denormalize-type-references/index.js b/node_modules/@webassemblyjs/ast/esm/transform/denormalize-type-references/index.js new file mode 100644 index 0000000..26891f9 --- /dev/null +++ b/node_modules/@webassemblyjs/ast/esm/transform/denormalize-type-references/index.js @@ -0,0 +1,76 @@ +var t = require("../../index"); // func and call_indirect instructions can either define a signature inline, or +// reference a signature, e.g. +// +// ;; inline signature +// (func (result i64) +// (i64.const 2) +// ) +// ;; signature reference +// (type (func (result i64))) +// (func (type 0) +// (i64.const 2)) +// ) +// +// this AST transform denormalises the type references, making all signatures within the module +// inline. + + +export function transform(ast) { + var typeInstructions = []; + t.traverse(ast, { + TypeInstruction: function TypeInstruction(_ref) { + var node = _ref.node; + typeInstructions.push(node); + } + }); + + if (!typeInstructions.length) { + return; + } + + function denormalizeSignature(signature) { + // signature referenced by identifier + if (signature.type === "Identifier") { + var identifier = signature; + var typeInstruction = typeInstructions.find(function (t) { + return t.id.type === identifier.type && t.id.value === identifier.value; + }); + + if (!typeInstruction) { + throw new Error("A type instruction reference was not found ".concat(JSON.stringify(signature))); + } + + return typeInstruction.functype; + } // signature referenced by index + + + if (signature.type === "NumberLiteral") { + var signatureRef = signature; + var _typeInstruction = typeInstructions[signatureRef.value]; + return _typeInstruction.functype; + } + + return signature; + } + + t.traverse(ast, { + Func: function (_Func) { + function Func(_x) { + return _Func.apply(this, arguments); + } + + Func.toString = function () { + return _Func.toString(); + }; + + return Func; + }(function (_ref2) { + var node = _ref2.node; + node.signature = denormalizeSignature(node.signature); + }), + CallIndirectInstruction: function CallIndirectInstruction(_ref3) { + var node = _ref3.node; + node.signature = denormalizeSignature(node.signature); + } + }); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/esm/transform/wast-identifier-to-index/index.js b/node_modules/@webassemblyjs/ast/esm/transform/wast-identifier-to-index/index.js new file mode 100644 index 0000000..bea35f3 --- /dev/null +++ b/node_modules/@webassemblyjs/ast/esm/transform/wast-identifier-to-index/index.js @@ -0,0 +1,216 @@ +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } + +import { isBlock, isFunc, isIdentifier, numberLiteralFromRaw, traverse } from "../../index"; +import { moduleContextFromModuleAST } from "@webassemblyjs/helper-module-context"; // FIXME(sven): do the same with all block instructions, must be more generic here + +function newUnexpectedFunction(i) { + return new Error("unknown function at offset: " + i); +} + +export function transform(ast) { + var module; + traverse(ast, { + Module: function (_Module) { + function Module(_x) { + return _Module.apply(this, arguments); + } + + Module.toString = function () { + return _Module.toString(); + }; + + return Module; + }(function (path) { + module = path.node; + }) + }); + var moduleContext = moduleContextFromModuleAST(module); // Transform the actual instruction in function bodies + + traverse(ast, { + Func: function (_Func) { + function Func(_x2) { + return _Func.apply(this, arguments); + } + + Func.toString = function () { + return _Func.toString(); + }; + + return Func; + }(function (path) { + transformFuncPath(path, moduleContext); + }), + Start: function (_Start) { + function Start(_x3) { + return _Start.apply(this, arguments); + } + + Start.toString = function () { + return _Start.toString(); + }; + + return Start; + }(function (path) { + var index = path.node.index; + + if (isIdentifier(index) === true) { + var offsetInModule = moduleContext.getFunctionOffsetByIdentifier(index.value); + + if (typeof offsetInModule === "undefined") { + throw newUnexpectedFunction(index.value); + } // Replace the index Identifier + // $FlowIgnore: reference? + + + path.node.index = numberLiteralFromRaw(offsetInModule); + } + }) + }); +} + +function transformFuncPath(funcPath, moduleContext) { + var funcNode = funcPath.node; + var signature = funcNode.signature; + + if (signature.type !== "Signature") { + throw new Error("Function signatures must be denormalised before execution"); + } + + var params = signature.params; // Add func locals in the context + + params.forEach(function (p) { + return moduleContext.addLocal(p.valtype); + }); + traverse(funcNode, { + Instr: function (_Instr) { + function Instr(_x4) { + return _Instr.apply(this, arguments); + } + + Instr.toString = function () { + return _Instr.toString(); + }; + + return Instr; + }(function (instrPath) { + var instrNode = instrPath.node; + /** + * Local access + */ + + if (instrNode.id === "get_local" || instrNode.id === "set_local" || instrNode.id === "tee_local") { + var _instrNode$args = _slicedToArray(instrNode.args, 1), + firstArg = _instrNode$args[0]; + + if (firstArg.type === "Identifier") { + var offsetInParams = params.findIndex(function (_ref) { + var id = _ref.id; + return id === firstArg.value; + }); + + if (offsetInParams === -1) { + throw new Error("".concat(firstArg.value, " not found in ").concat(instrNode.id, ": not declared in func params")); + } // Replace the Identifer node by our new NumberLiteral node + + + instrNode.args[0] = numberLiteralFromRaw(offsetInParams); + } + } + /** + * Global access + */ + + + if (instrNode.id === "get_global" || instrNode.id === "set_global") { + var _instrNode$args2 = _slicedToArray(instrNode.args, 1), + _firstArg = _instrNode$args2[0]; + + if (isIdentifier(_firstArg) === true) { + var globalOffset = moduleContext.getGlobalOffsetByIdentifier( // $FlowIgnore: reference? + _firstArg.value); + + if (typeof globalOffset === "undefined") { + // $FlowIgnore: reference? + throw new Error("global ".concat(_firstArg.value, " not found in module")); + } // Replace the Identifer node by our new NumberLiteral node + + + instrNode.args[0] = numberLiteralFromRaw(globalOffset); + } + } + /** + * Labels lookup + */ + + + if (instrNode.id === "br") { + var _instrNode$args3 = _slicedToArray(instrNode.args, 1), + _firstArg2 = _instrNode$args3[0]; + + if (isIdentifier(_firstArg2) === true) { + // if the labels is not found it is going to be replaced with -1 + // which is invalid. + var relativeBlockCount = -1; // $FlowIgnore: reference? + + instrPath.findParent(function (_ref2) { + var node = _ref2.node; + + if (isBlock(node)) { + relativeBlockCount++; // $FlowIgnore: reference? + + var name = node.label || node.name; + + if (_typeof(name) === "object") { + // $FlowIgnore: isIdentifier ensures that + if (name.value === _firstArg2.value) { + // Found it + return false; + } + } + } + + if (isFunc(node)) { + return false; + } + }); // Replace the Identifer node by our new NumberLiteral node + + instrNode.args[0] = numberLiteralFromRaw(relativeBlockCount); + } + } + }), + + /** + * Func lookup + */ + CallInstruction: function (_CallInstruction) { + function CallInstruction(_x5) { + return _CallInstruction.apply(this, arguments); + } + + CallInstruction.toString = function () { + return _CallInstruction.toString(); + }; + + return CallInstruction; + }(function (_ref3) { + var node = _ref3.node; + var index = node.index; + + if (isIdentifier(index) === true) { + var offsetInModule = moduleContext.getFunctionOffsetByIdentifier(index.value); + + if (typeof offsetInModule === "undefined") { + throw newUnexpectedFunction(index.value); + } // Replace the index Identifier + // $FlowIgnore: reference? + + + node.index = numberLiteralFromRaw(offsetInModule); + } + }) + }); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/esm/traverse.js b/node_modules/@webassemblyjs/ast/esm/traverse.js new file mode 100644 index 0000000..328dc09 --- /dev/null +++ b/node_modules/@webassemblyjs/ast/esm/traverse.js @@ -0,0 +1,96 @@ +import { createPath } from "./node-path"; +import { unionTypesMap, nodeAndUnionTypes } from "./nodes"; // recursively walks the AST starting at the given node. The callback is invoked for +// and object that has a 'type' property. + +function walk(context, callback) { + var stop = false; + + function innerWalk(context, callback) { + if (stop) { + return; + } + + var node = context.node; + + if (node === undefined) { + console.warn("traversing with an empty context"); + return; + } + + if (node._deleted === true) { + return; + } + + var path = createPath(context); + callback(node.type, path); + + if (path.shouldStop) { + stop = true; + return; + } + + Object.keys(node).forEach(function (prop) { + var value = node[prop]; + + if (value === null || value === undefined) { + return; + } + + var valueAsArray = Array.isArray(value) ? value : [value]; + valueAsArray.forEach(function (childNode) { + if (typeof childNode.type === "string") { + var childContext = { + node: childNode, + parentKey: prop, + parentPath: path, + shouldStop: false, + inList: Array.isArray(value) + }; + innerWalk(childContext, callback); + } + }); + }); + } + + innerWalk(context, callback); +} + +var noop = function noop() {}; + +export function traverse(node, visitors) { + var before = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop; + var after = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : noop; + Object.keys(visitors).forEach(function (visitor) { + if (!nodeAndUnionTypes.includes(visitor)) { + throw new Error("Unexpected visitor ".concat(visitor)); + } + }); + var context = { + node: node, + inList: false, + shouldStop: false, + parentPath: null, + parentKey: null + }; + walk(context, function (type, path) { + if (typeof visitors[type] === "function") { + before(type, path); + visitors[type](path); + after(type, path); + } + + var unionTypes = unionTypesMap[type]; + + if (!unionTypes) { + throw new Error("Unexpected node type ".concat(type)); + } + + unionTypes.forEach(function (unionType) { + if (typeof visitors[unionType] === "function") { + before(unionType, path); + visitors[unionType](path); + after(unionType, path); + } + }); + }); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/esm/types/basic.js b/node_modules/@webassemblyjs/ast/esm/types/basic.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/@webassemblyjs/ast/esm/types/nodes.js b/node_modules/@webassemblyjs/ast/esm/types/nodes.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/@webassemblyjs/ast/esm/types/traverse.js b/node_modules/@webassemblyjs/ast/esm/types/traverse.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/@webassemblyjs/ast/esm/utils.js b/node_modules/@webassemblyjs/ast/esm/utils.js new file mode 100644 index 0000000..850410e --- /dev/null +++ b/node_modules/@webassemblyjs/ast/esm/utils.js @@ -0,0 +1,265 @@ +function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +import { signatures } from "./signatures"; +import { traverse } from "./traverse"; +import constants from "@webassemblyjs/helper-wasm-bytecode"; +import { getSectionForNode } from "@webassemblyjs/helper-wasm-bytecode"; +export function isAnonymous(ident) { + return ident.raw === ""; +} +export function getSectionMetadata(ast, name) { + var section; + traverse(ast, { + SectionMetadata: function (_SectionMetadata) { + function SectionMetadata(_x) { + return _SectionMetadata.apply(this, arguments); + } + + SectionMetadata.toString = function () { + return _SectionMetadata.toString(); + }; + + return SectionMetadata; + }(function (_ref) { + var node = _ref.node; + + if (node.section === name) { + section = node; + } + }) + }); + return section; +} +export function getSectionMetadatas(ast, name) { + var sections = []; + traverse(ast, { + SectionMetadata: function (_SectionMetadata2) { + function SectionMetadata(_x2) { + return _SectionMetadata2.apply(this, arguments); + } + + SectionMetadata.toString = function () { + return _SectionMetadata2.toString(); + }; + + return SectionMetadata; + }(function (_ref2) { + var node = _ref2.node; + + if (node.section === name) { + sections.push(node); + } + }) + }); + return sections; +} +export function sortSectionMetadata(m) { + if (m.metadata == null) { + console.warn("sortSectionMetadata: no metadata to sort"); + return; + } // $FlowIgnore + + + m.metadata.sections.sort(function (a, b) { + var aId = constants.sections[a.section]; + var bId = constants.sections[b.section]; + + if (typeof aId !== "number" || typeof bId !== "number") { + throw new Error("Section id not found"); + } + + return aId - bId; + }); +} +export function orderedInsertNode(m, n) { + assertHasLoc(n); + var didInsert = false; + + if (n.type === "ModuleExport") { + m.fields.push(n); + return; + } + + m.fields = m.fields.reduce(function (acc, field) { + var fieldEndCol = Infinity; + + if (field.loc != null) { + // $FlowIgnore + fieldEndCol = field.loc.end.column; + } // $FlowIgnore: assertHasLoc ensures that + + + if (didInsert === false && n.loc.start.column < fieldEndCol) { + didInsert = true; + acc.push(n); + } + + acc.push(field); + return acc; + }, []); // Handles empty modules or n is the last element + + if (didInsert === false) { + m.fields.push(n); + } +} +export function assertHasLoc(n) { + if (n.loc == null || n.loc.start == null || n.loc.end == null) { + throw new Error("Internal failure: node (".concat(JSON.stringify(n.type), ") has no location information")); + } +} +export function getEndOfSection(s) { + assertHasLoc(s.size); + return s.startOffset + s.size.value + ( // $FlowIgnore + s.size.loc.end.column - s.size.loc.start.column); +} +export function shiftLoc(node, delta) { + // $FlowIgnore + node.loc.start.column += delta; // $FlowIgnore + + node.loc.end.column += delta; +} +export function shiftSection(ast, node, delta) { + if (node.type !== "SectionMetadata") { + throw new Error("Can not shift node " + JSON.stringify(node.type)); + } + + node.startOffset += delta; + + if (_typeof(node.size.loc) === "object") { + shiftLoc(node.size, delta); + } // Custom sections doesn't have vectorOfSize + + + if (_typeof(node.vectorOfSize) === "object" && _typeof(node.vectorOfSize.loc) === "object") { + shiftLoc(node.vectorOfSize, delta); + } + + var sectionName = node.section; // shift node locations within that section + + traverse(ast, { + Node: function Node(_ref3) { + var node = _ref3.node; + var section = getSectionForNode(node); + + if (section === sectionName && _typeof(node.loc) === "object") { + shiftLoc(node, delta); + } + } + }); +} +export function signatureForOpcode(object, name) { + var opcodeName = name; + + if (object !== undefined && object !== "") { + opcodeName = object + "." + name; + } + + var sign = signatures[opcodeName]; + + if (sign == undefined) { + // TODO: Uncomment this when br_table and others has been done + //throw new Error("Invalid opcode: "+opcodeName); + return [object, object]; + } + + return sign[0]; +} +export function getUniqueNameGenerator() { + var inc = {}; + return function () { + var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp"; + + if (!(prefix in inc)) { + inc[prefix] = 0; + } else { + inc[prefix] = inc[prefix] + 1; + } + + return prefix + "_" + inc[prefix]; + }; +} +export function getStartByteOffset(n) { + // $FlowIgnore + if (typeof n.loc === "undefined" || typeof n.loc.start === "undefined") { + throw new Error( // $FlowIgnore + "Can not get byte offset without loc informations, node: " + String(n.id)); + } + + return n.loc.start.column; +} +export function getEndByteOffset(n) { + // $FlowIgnore + if (typeof n.loc === "undefined" || typeof n.loc.end === "undefined") { + throw new Error("Can not get byte offset without loc informations, node: " + n.type); + } + + return n.loc.end.column; +} +export function getFunctionBeginingByteOffset(n) { + if (!(n.body.length > 0)) { + throw new Error('n.body.length > 0' + " error: " + (undefined || "unknown")); + } + + var _n$body = _slicedToArray(n.body, 1), + firstInstruction = _n$body[0]; + + return getStartByteOffset(firstInstruction); +} +export function getEndBlockByteOffset(n) { + // $FlowIgnore + if (!(n.instr.length > 0 || n.body.length > 0)) { + throw new Error('n.instr.length > 0 || n.body.length > 0' + " error: " + (undefined || "unknown")); + } + + var lastInstruction; + + if (n.instr) { + // $FlowIgnore + lastInstruction = n.instr[n.instr.length - 1]; + } + + if (n.body) { + // $FlowIgnore + lastInstruction = n.body[n.body.length - 1]; + } + + if (!(_typeof(lastInstruction) === "object")) { + throw new Error('typeof lastInstruction === "object"' + " error: " + (undefined || "unknown")); + } + + // $FlowIgnore + return getStartByteOffset(lastInstruction); +} +export function getStartBlockByteOffset(n) { + // $FlowIgnore + if (!(n.instr.length > 0 || n.body.length > 0)) { + throw new Error('n.instr.length > 0 || n.body.length > 0' + " error: " + (undefined || "unknown")); + } + + var fistInstruction; + + if (n.instr) { + // $FlowIgnore + var _n$instr = _slicedToArray(n.instr, 1); + + fistInstruction = _n$instr[0]; + } + + if (n.body) { + // $FlowIgnore + var _n$body2 = _slicedToArray(n.body, 1); + + fistInstruction = _n$body2[0]; + } + + if (!(_typeof(fistInstruction) === "object")) { + throw new Error('typeof fistInstruction === "object"' + " error: " + (undefined || "unknown")); + } + + // $FlowIgnore + return getStartByteOffset(fistInstruction); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/lib/clone.js b/node_modules/@webassemblyjs/ast/lib/clone.js new file mode 100644 index 0000000..7c386a4 --- /dev/null +++ b/node_modules/@webassemblyjs/ast/lib/clone.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cloneNode = cloneNode; + +function cloneNode(n) { + // $FlowIgnore + var newObj = {}; + + for (var k in n) { + newObj[k] = n[k]; + } + + return newObj; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/lib/definitions.js b/node_modules/@webassemblyjs/ast/lib/definitions.js new file mode 100644 index 0000000..120311b --- /dev/null +++ b/node_modules/@webassemblyjs/ast/lib/definitions.js @@ -0,0 +1,663 @@ +var definitions = {}; + +function defineType(typeName, metadata) { + definitions[typeName] = metadata; +} + +defineType("Module", { + spec: { + wasm: "https://webassembly.github.io/spec/core/binary/modules.html#binary-module", + wat: "https://webassembly.github.io/spec/core/text/modules.html#text-module" + }, + doc: "A module consists of a sequence of sections (termed fields in the text format).", + unionType: ["Node"], + fields: { + id: { + maybe: true, + type: "string" + }, + fields: { + array: true, + type: "Node" + }, + metadata: { + optional: true, + type: "ModuleMetadata" + } + } +}); +defineType("ModuleMetadata", { + unionType: ["Node"], + fields: { + sections: { + array: true, + type: "SectionMetadata" + }, + functionNames: { + optional: true, + array: true, + type: "FunctionNameMetadata" + }, + localNames: { + optional: true, + array: true, + type: "ModuleMetadata" + }, + producers: { + optional: true, + array: true, + type: "ProducersSectionMetadata" + } + } +}); +defineType("ModuleNameMetadata", { + unionType: ["Node"], + fields: { + value: { + type: "string" + } + } +}); +defineType("FunctionNameMetadata", { + unionType: ["Node"], + fields: { + value: { + type: "string" + }, + index: { + type: "number" + } + } +}); +defineType("LocalNameMetadata", { + unionType: ["Node"], + fields: { + value: { + type: "string" + }, + localIndex: { + type: "number" + }, + functionIndex: { + type: "number" + } + } +}); +defineType("BinaryModule", { + unionType: ["Node"], + fields: { + id: { + maybe: true, + type: "string" + }, + blob: { + array: true, + type: "string" + } + } +}); +defineType("QuoteModule", { + unionType: ["Node"], + fields: { + id: { + maybe: true, + type: "string" + }, + string: { + array: true, + type: "string" + } + } +}); +defineType("SectionMetadata", { + unionType: ["Node"], + fields: { + section: { + type: "SectionName" + }, + startOffset: { + type: "number" + }, + size: { + type: "NumberLiteral" + }, + vectorOfSize: { + comment: "Size of the vector in the section (if any)", + type: "NumberLiteral" + } + } +}); +defineType("ProducersSectionMetadata", { + unionType: ["Node"], + fields: { + producers: { + array: true, + type: "ProducerMetadata" + } + } +}); +defineType("ProducerMetadata", { + unionType: ["Node"], + fields: { + language: { + type: "ProducerMetadataVersionedName", + array: true + }, + processedBy: { + type: "ProducerMetadataVersionedName", + array: true + }, + sdk: { + type: "ProducerMetadataVersionedName", + array: true + } + } +}); +defineType("ProducerMetadataVersionedName", { + unionType: ["Node"], + fields: { + name: { + type: "string" + }, + version: { + type: "string" + } + } +}); +/* +Instructions +*/ + +defineType("LoopInstruction", { + unionType: ["Node", "Block", "Instruction"], + fields: { + id: { + constant: true, + type: "string", + value: "loop" + }, + label: { + maybe: true, + type: "Identifier" + }, + resulttype: { + maybe: true, + type: "Valtype" + }, + instr: { + array: true, + type: "Instruction" + } + } +}); +defineType("Instr", { + unionType: ["Node", "Expression", "Instruction"], + fields: { + id: { + type: "string" + }, + object: { + optional: true, + type: "Valtype" + }, + args: { + array: true, + type: "Expression" + }, + namedArgs: { + optional: true, + type: "Object" + } + } +}); +defineType("IfInstruction", { + unionType: ["Node", "Instruction"], + fields: { + id: { + constant: true, + type: "string", + value: "if" + }, + testLabel: { + comment: "only for WAST", + type: "Identifier" + }, + test: { + array: true, + type: "Instruction" + }, + result: { + maybe: true, + type: "Valtype" + }, + consequent: { + array: true, + type: "Instruction" + }, + alternate: { + array: true, + type: "Instruction" + } + } +}); +/* +Concrete value types +*/ + +defineType("StringLiteral", { + unionType: ["Node", "Expression"], + fields: { + value: { + type: "string" + } + } +}); +defineType("NumberLiteral", { + unionType: ["Node", "NumericLiteral", "Expression"], + fields: { + value: { + type: "number" + }, + raw: { + type: "string" + } + } +}); +defineType("LongNumberLiteral", { + unionType: ["Node", "NumericLiteral", "Expression"], + fields: { + value: { + type: "LongNumber" + }, + raw: { + type: "string" + } + } +}); +defineType("FloatLiteral", { + unionType: ["Node", "NumericLiteral", "Expression"], + fields: { + value: { + type: "number" + }, + nan: { + optional: true, + type: "boolean" + }, + inf: { + optional: true, + type: "boolean" + }, + raw: { + type: "string" + } + } +}); +defineType("Elem", { + unionType: ["Node"], + fields: { + table: { + type: "Index" + }, + offset: { + array: true, + type: "Instruction" + }, + funcs: { + array: true, + type: "Index" + } + } +}); +defineType("IndexInFuncSection", { + unionType: ["Node"], + fields: { + index: { + type: "Index" + } + } +}); +defineType("ValtypeLiteral", { + unionType: ["Node", "Expression"], + fields: { + name: { + type: "Valtype" + } + } +}); +defineType("TypeInstruction", { + unionType: ["Node", "Instruction"], + fields: { + id: { + maybe: true, + type: "Index" + }, + functype: { + type: "Signature" + } + } +}); +defineType("Start", { + unionType: ["Node"], + fields: { + index: { + type: "Index" + } + } +}); +defineType("GlobalType", { + unionType: ["Node", "ImportDescr"], + fields: { + valtype: { + type: "Valtype" + }, + mutability: { + type: "Mutability" + } + } +}); +defineType("LeadingComment", { + unionType: ["Node"], + fields: { + value: { + type: "string" + } + } +}); +defineType("BlockComment", { + unionType: ["Node"], + fields: { + value: { + type: "string" + } + } +}); +defineType("Data", { + unionType: ["Node"], + fields: { + memoryIndex: { + type: "Memidx" + }, + offset: { + type: "Instruction" + }, + init: { + type: "ByteArray" + } + } +}); +defineType("Global", { + unionType: ["Node"], + fields: { + globalType: { + type: "GlobalType" + }, + init: { + array: true, + type: "Instruction" + }, + name: { + maybe: true, + type: "Identifier" + } + } +}); +defineType("Table", { + unionType: ["Node", "ImportDescr"], + fields: { + elementType: { + type: "TableElementType" + }, + limits: { + assertNodeType: true, + type: "Limit" + }, + name: { + maybe: true, + type: "Identifier" + }, + elements: { + array: true, + optional: true, + type: "Index" + } + } +}); +defineType("Memory", { + unionType: ["Node", "ImportDescr"], + fields: { + limits: { + type: "Limit" + }, + id: { + maybe: true, + type: "Index" + } + } +}); +defineType("FuncImportDescr", { + unionType: ["Node", "ImportDescr"], + fields: { + id: { + type: "Identifier" + }, + signature: { + type: "Signature" + } + } +}); +defineType("ModuleImport", { + unionType: ["Node"], + fields: { + module: { + type: "string" + }, + name: { + type: "string" + }, + descr: { + type: "ImportDescr" + } + } +}); +defineType("ModuleExportDescr", { + unionType: ["Node"], + fields: { + exportType: { + type: "ExportDescrType" + }, + id: { + type: "Index" + } + } +}); +defineType("ModuleExport", { + unionType: ["Node"], + fields: { + name: { + type: "string" + }, + descr: { + type: "ModuleExportDescr" + } + } +}); +defineType("Limit", { + unionType: ["Node"], + fields: { + min: { + type: "number" + }, + max: { + optional: true, + type: "number" + } + } +}); +defineType("Signature", { + unionType: ["Node"], + fields: { + params: { + array: true, + type: "FuncParam" + }, + results: { + array: true, + type: "Valtype" + } + } +}); +defineType("Program", { + unionType: ["Node"], + fields: { + body: { + array: true, + type: "Node" + } + } +}); +defineType("Identifier", { + unionType: ["Node", "Expression"], + fields: { + value: { + type: "string" + }, + raw: { + optional: true, + type: "string" + } + } +}); +defineType("BlockInstruction", { + unionType: ["Node", "Block", "Instruction"], + fields: { + id: { + constant: true, + type: "string", + value: "block" + }, + label: { + maybe: true, + type: "Identifier" + }, + instr: { + array: true, + type: "Instruction" + }, + result: { + maybe: true, + type: "Valtype" + } + } +}); +defineType("CallInstruction", { + unionType: ["Node", "Instruction"], + fields: { + id: { + constant: true, + type: "string", + value: "call" + }, + index: { + type: "Index" + }, + instrArgs: { + array: true, + optional: true, + type: "Expression" + }, + numeric: { + type: "Index", + optional: true + } + } +}); +defineType("CallIndirectInstruction", { + unionType: ["Node", "Instruction"], + fields: { + id: { + constant: true, + type: "string", + value: "call_indirect" + }, + signature: { + type: "SignatureOrTypeRef" + }, + intrs: { + array: true, + optional: true, + type: "Expression" + } + } +}); +defineType("ByteArray", { + unionType: ["Node"], + fields: { + values: { + array: true, + type: "Byte" + } + } +}); +defineType("Func", { + unionType: ["Node", "Block"], + fields: { + name: { + maybe: true, + type: "Index" + }, + signature: { + type: "SignatureOrTypeRef" + }, + body: { + array: true, + type: "Instruction" + }, + isExternal: { + comment: "means that it has been imported from the outside js", + optional: true, + type: "boolean" + }, + metadata: { + optional: true, + type: "FuncMetadata" + } + } +}); +/** + * Intrinsics + */ + +defineType("InternalBrUnless", { + unionType: ["Node", "Intrinsic"], + fields: { + target: { + type: "number" + } + } +}); +defineType("InternalGoto", { + unionType: ["Node", "Intrinsic"], + fields: { + target: { + type: "number" + } + } +}); +defineType("InternalCallExtern", { + unionType: ["Node", "Intrinsic"], + fields: { + target: { + type: "number" + } + } +}); // function bodies are terminated by an `end` instruction but are missing a +// return instruction +// +// Since we can't inject a new instruction we are injecting a new instruction. + +defineType("InternalEndAndReturn", { + unionType: ["Node", "Intrinsic"], + fields: {} +}); +module.exports = definitions; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/lib/index.js b/node_modules/@webassemblyjs/ast/lib/index.js new file mode 100644 index 0000000..e5dda7e --- /dev/null +++ b/node_modules/@webassemblyjs/ast/lib/index.js @@ -0,0 +1,118 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _exportNames = { + numberLiteralFromRaw: true, + withLoc: true, + withRaw: true, + funcParam: true, + indexLiteral: true, + memIndexLiteral: true, + instruction: true, + objectInstruction: true, + traverse: true, + signatures: true, + cloneNode: true +}; +Object.defineProperty(exports, "numberLiteralFromRaw", { + enumerable: true, + get: function get() { + return _nodeHelpers.numberLiteralFromRaw; + } +}); +Object.defineProperty(exports, "withLoc", { + enumerable: true, + get: function get() { + return _nodeHelpers.withLoc; + } +}); +Object.defineProperty(exports, "withRaw", { + enumerable: true, + get: function get() { + return _nodeHelpers.withRaw; + } +}); +Object.defineProperty(exports, "funcParam", { + enumerable: true, + get: function get() { + return _nodeHelpers.funcParam; + } +}); +Object.defineProperty(exports, "indexLiteral", { + enumerable: true, + get: function get() { + return _nodeHelpers.indexLiteral; + } +}); +Object.defineProperty(exports, "memIndexLiteral", { + enumerable: true, + get: function get() { + return _nodeHelpers.memIndexLiteral; + } +}); +Object.defineProperty(exports, "instruction", { + enumerable: true, + get: function get() { + return _nodeHelpers.instruction; + } +}); +Object.defineProperty(exports, "objectInstruction", { + enumerable: true, + get: function get() { + return _nodeHelpers.objectInstruction; + } +}); +Object.defineProperty(exports, "traverse", { + enumerable: true, + get: function get() { + return _traverse.traverse; + } +}); +Object.defineProperty(exports, "signatures", { + enumerable: true, + get: function get() { + return _signatures.signatures; + } +}); +Object.defineProperty(exports, "cloneNode", { + enumerable: true, + get: function get() { + return _clone.cloneNode; + } +}); + +var _nodes = require("./nodes"); + +Object.keys(_nodes).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _nodes[key]; + } + }); +}); + +var _nodeHelpers = require("./node-helpers.js"); + +var _traverse = require("./traverse"); + +var _signatures = require("./signatures"); + +var _utils = require("./utils"); + +Object.keys(_utils).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _utils[key]; + } + }); +}); + +var _clone = require("./clone"); \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/lib/node-helpers.js b/node_modules/@webassemblyjs/ast/lib/node-helpers.js new file mode 100644 index 0000000..50dab1f --- /dev/null +++ b/node_modules/@webassemblyjs/ast/lib/node-helpers.js @@ -0,0 +1,107 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.numberLiteralFromRaw = numberLiteralFromRaw; +exports.instruction = instruction; +exports.objectInstruction = objectInstruction; +exports.withLoc = withLoc; +exports.withRaw = withRaw; +exports.funcParam = funcParam; +exports.indexLiteral = indexLiteral; +exports.memIndexLiteral = memIndexLiteral; + +var _wastParser = require("@webassemblyjs/wast-parser"); + +var _nodes = require("./nodes"); + +function numberLiteralFromRaw(rawValue) { + var instructionType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "i32"; + var original = rawValue; // Remove numeric separators _ + + if (typeof rawValue === "string") { + rawValue = rawValue.replace(/_/g, ""); + } + + if (typeof rawValue === "number") { + return (0, _nodes.numberLiteral)(rawValue, String(original)); + } else { + switch (instructionType) { + case "i32": + { + return (0, _nodes.numberLiteral)((0, _wastParser.parse32I)(rawValue), String(original)); + } + + case "u32": + { + return (0, _nodes.numberLiteral)((0, _wastParser.parseU32)(rawValue), String(original)); + } + + case "i64": + { + return (0, _nodes.longNumberLiteral)((0, _wastParser.parse64I)(rawValue), String(original)); + } + + case "f32": + { + return (0, _nodes.floatLiteral)((0, _wastParser.parse32F)(rawValue), (0, _wastParser.isNanLiteral)(rawValue), (0, _wastParser.isInfLiteral)(rawValue), String(original)); + } + // f64 + + default: + { + return (0, _nodes.floatLiteral)((0, _wastParser.parse64F)(rawValue), (0, _wastParser.isNanLiteral)(rawValue), (0, _wastParser.isInfLiteral)(rawValue), String(original)); + } + } + } +} + +function instruction(id) { + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var namedArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + return (0, _nodes.instr)(id, undefined, args, namedArgs); +} + +function objectInstruction(id, object) { + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + var namedArgs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + return (0, _nodes.instr)(id, object, args, namedArgs); +} +/** + * Decorators + */ + + +function withLoc(n, end, start) { + var loc = { + start: start, + end: end + }; + n.loc = loc; + return n; +} + +function withRaw(n, raw) { + n.raw = raw; + return n; +} + +function funcParam(valtype, id) { + return { + id: id, + valtype: valtype + }; +} + +function indexLiteral(value) { + // $FlowIgnore + var x = numberLiteralFromRaw(value, "u32"); + return x; +} + +function memIndexLiteral(value) { + // $FlowIgnore + var x = numberLiteralFromRaw(value, "u32"); + return x; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/lib/node-path.js b/node_modules/@webassemblyjs/ast/lib/node-path.js new file mode 100644 index 0000000..181e1f7 --- /dev/null +++ b/node_modules/@webassemblyjs/ast/lib/node-path.js @@ -0,0 +1,142 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createPath = createPath; + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function findParent(_ref, cb) { + var parentPath = _ref.parentPath; + + if (parentPath == null) { + throw new Error("node is root"); + } + + var currentPath = parentPath; + + while (cb(currentPath) !== false) { + // Hit the root node, stop + // $FlowIgnore + if (currentPath.parentPath == null) { + return null; + } // $FlowIgnore + + + currentPath = currentPath.parentPath; + } + + return currentPath.node; +} + +function insertBefore(context, newNode) { + return insert(context, newNode); +} + +function insertAfter(context, newNode) { + return insert(context, newNode, 1); +} + +function insert(_ref2, newNode) { + var node = _ref2.node, + inList = _ref2.inList, + parentPath = _ref2.parentPath, + parentKey = _ref2.parentKey; + var indexOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + + if (!inList) { + throw new Error('inList' + " error: " + ("insert can only be used for nodes that are within lists" || "unknown")); + } + + if (!(parentPath != null)) { + throw new Error('parentPath != null' + " error: " + ("Can not remove root node" || "unknown")); + } + + // $FlowIgnore + var parentList = parentPath.node[parentKey]; + var indexInList = parentList.findIndex(function (n) { + return n === node; + }); + parentList.splice(indexInList + indexOffset, 0, newNode); +} + +function remove(_ref3) { + var node = _ref3.node, + parentKey = _ref3.parentKey, + parentPath = _ref3.parentPath; + + if (!(parentPath != null)) { + throw new Error('parentPath != null' + " error: " + ("Can not remove root node" || "unknown")); + } + + // $FlowIgnore + var parentNode = parentPath.node; // $FlowIgnore + + var parentProperty = parentNode[parentKey]; + + if (Array.isArray(parentProperty)) { + // $FlowIgnore + parentNode[parentKey] = parentProperty.filter(function (n) { + return n !== node; + }); + } else { + // $FlowIgnore + delete parentNode[parentKey]; + } + + node._deleted = true; +} + +function stop(context) { + context.shouldStop = true; +} + +function replaceWith(context, newNode) { + // $FlowIgnore + var parentNode = context.parentPath.node; // $FlowIgnore + + var parentProperty = parentNode[context.parentKey]; + + if (Array.isArray(parentProperty)) { + var indexInList = parentProperty.findIndex(function (n) { + return n === context.node; + }); + parentProperty.splice(indexInList, 1, newNode); + } else { + // $FlowIgnore + parentNode[context.parentKey] = newNode; + } + + context.node._deleted = true; + context.node = newNode; +} // bind the context to the first argument of node operations + + +function bindNodeOperations(operations, context) { + var keys = Object.keys(operations); + var boundOperations = {}; + keys.forEach(function (key) { + boundOperations[key] = operations[key].bind(null, context); + }); + return boundOperations; +} + +function createPathOperations(context) { + // $FlowIgnore + return bindNodeOperations({ + findParent: findParent, + replaceWith: replaceWith, + remove: remove, + insertBefore: insertBefore, + insertAfter: insertAfter, + stop: stop + }, context); +} + +function createPath(context) { + var path = _extends({}, context); + + Object.assign(path, createPathOperations(path)); + return path; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/lib/nodes.js b/node_modules/@webassemblyjs/ast/lib/nodes.js new file mode 100644 index 0000000..d99db0f --- /dev/null +++ b/node_modules/@webassemblyjs/ast/lib/nodes.js @@ -0,0 +1,1134 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.module = _module; +exports.moduleMetadata = moduleMetadata; +exports.moduleNameMetadata = moduleNameMetadata; +exports.functionNameMetadata = functionNameMetadata; +exports.localNameMetadata = localNameMetadata; +exports.binaryModule = binaryModule; +exports.quoteModule = quoteModule; +exports.sectionMetadata = sectionMetadata; +exports.producersSectionMetadata = producersSectionMetadata; +exports.producerMetadata = producerMetadata; +exports.producerMetadataVersionedName = producerMetadataVersionedName; +exports.loopInstruction = loopInstruction; +exports.instr = instr; +exports.ifInstruction = ifInstruction; +exports.stringLiteral = stringLiteral; +exports.numberLiteral = numberLiteral; +exports.longNumberLiteral = longNumberLiteral; +exports.floatLiteral = floatLiteral; +exports.elem = elem; +exports.indexInFuncSection = indexInFuncSection; +exports.valtypeLiteral = valtypeLiteral; +exports.typeInstruction = typeInstruction; +exports.start = start; +exports.globalType = globalType; +exports.leadingComment = leadingComment; +exports.blockComment = blockComment; +exports.data = data; +exports.global = global; +exports.table = table; +exports.memory = memory; +exports.funcImportDescr = funcImportDescr; +exports.moduleImport = moduleImport; +exports.moduleExportDescr = moduleExportDescr; +exports.moduleExport = moduleExport; +exports.limit = limit; +exports.signature = signature; +exports.program = program; +exports.identifier = identifier; +exports.blockInstruction = blockInstruction; +exports.callInstruction = callInstruction; +exports.callIndirectInstruction = callIndirectInstruction; +exports.byteArray = byteArray; +exports.func = func; +exports.internalBrUnless = internalBrUnless; +exports.internalGoto = internalGoto; +exports.internalCallExtern = internalCallExtern; +exports.internalEndAndReturn = internalEndAndReturn; +exports.assertInternalCallExtern = exports.assertInternalGoto = exports.assertInternalBrUnless = exports.assertFunc = exports.assertByteArray = exports.assertCallIndirectInstruction = exports.assertCallInstruction = exports.assertBlockInstruction = exports.assertIdentifier = exports.assertProgram = exports.assertSignature = exports.assertLimit = exports.assertModuleExport = exports.assertModuleExportDescr = exports.assertModuleImport = exports.assertFuncImportDescr = exports.assertMemory = exports.assertTable = exports.assertGlobal = exports.assertData = exports.assertBlockComment = exports.assertLeadingComment = exports.assertGlobalType = exports.assertStart = exports.assertTypeInstruction = exports.assertValtypeLiteral = exports.assertIndexInFuncSection = exports.assertElem = exports.assertFloatLiteral = exports.assertLongNumberLiteral = exports.assertNumberLiteral = exports.assertStringLiteral = exports.assertIfInstruction = exports.assertInstr = exports.assertLoopInstruction = exports.assertProducerMetadataVersionedName = exports.assertProducerMetadata = exports.assertProducersSectionMetadata = exports.assertSectionMetadata = exports.assertQuoteModule = exports.assertBinaryModule = exports.assertLocalNameMetadata = exports.assertFunctionNameMetadata = exports.assertModuleNameMetadata = exports.assertModuleMetadata = exports.assertModule = exports.isIntrinsic = exports.isImportDescr = exports.isNumericLiteral = exports.isExpression = exports.isInstruction = exports.isBlock = exports.isNode = exports.isInternalEndAndReturn = exports.isInternalCallExtern = exports.isInternalGoto = exports.isInternalBrUnless = exports.isFunc = exports.isByteArray = exports.isCallIndirectInstruction = exports.isCallInstruction = exports.isBlockInstruction = exports.isIdentifier = exports.isProgram = exports.isSignature = exports.isLimit = exports.isModuleExport = exports.isModuleExportDescr = exports.isModuleImport = exports.isFuncImportDescr = exports.isMemory = exports.isTable = exports.isGlobal = exports.isData = exports.isBlockComment = exports.isLeadingComment = exports.isGlobalType = exports.isStart = exports.isTypeInstruction = exports.isValtypeLiteral = exports.isIndexInFuncSection = exports.isElem = exports.isFloatLiteral = exports.isLongNumberLiteral = exports.isNumberLiteral = exports.isStringLiteral = exports.isIfInstruction = exports.isInstr = exports.isLoopInstruction = exports.isProducerMetadataVersionedName = exports.isProducerMetadata = exports.isProducersSectionMetadata = exports.isSectionMetadata = exports.isQuoteModule = exports.isBinaryModule = exports.isLocalNameMetadata = exports.isFunctionNameMetadata = exports.isModuleNameMetadata = exports.isModuleMetadata = exports.isModule = void 0; +exports.nodeAndUnionTypes = exports.unionTypesMap = exports.assertInternalEndAndReturn = void 0; + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +// THIS FILE IS AUTOGENERATED +// see scripts/generateNodeUtils.js +function isTypeOf(t) { + return function (n) { + return n.type === t; + }; +} + +function assertTypeOf(t) { + return function (n) { + return function () { + if (!(n.type === t)) { + throw new Error('n.type === t' + " error: " + (undefined || "unknown")); + } + }(); + }; +} + +function _module(id, fields, metadata) { + if (id !== null && id !== undefined) { + if (!(typeof id === "string")) { + throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown")); + } + } + + if (!(_typeof(fields) === "object" && typeof fields.length !== "undefined")) { + throw new Error('typeof fields === "object" && typeof fields.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "Module", + id: id, + fields: fields + }; + + if (typeof metadata !== "undefined") { + node.metadata = metadata; + } + + return node; +} + +function moduleMetadata(sections, functionNames, localNames, producers) { + if (!(_typeof(sections) === "object" && typeof sections.length !== "undefined")) { + throw new Error('typeof sections === "object" && typeof sections.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (functionNames !== null && functionNames !== undefined) { + if (!(_typeof(functionNames) === "object" && typeof functionNames.length !== "undefined")) { + throw new Error('typeof functionNames === "object" && typeof functionNames.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + } + + if (localNames !== null && localNames !== undefined) { + if (!(_typeof(localNames) === "object" && typeof localNames.length !== "undefined")) { + throw new Error('typeof localNames === "object" && typeof localNames.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + } + + if (producers !== null && producers !== undefined) { + if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) { + throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + } + + var node = { + type: "ModuleMetadata", + sections: sections + }; + + if (typeof functionNames !== "undefined" && functionNames.length > 0) { + node.functionNames = functionNames; + } + + if (typeof localNames !== "undefined" && localNames.length > 0) { + node.localNames = localNames; + } + + if (typeof producers !== "undefined" && producers.length > 0) { + node.producers = producers; + } + + return node; +} + +function moduleNameMetadata(value) { + if (!(typeof value === "string")) { + throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown")); + } + + var node = { + type: "ModuleNameMetadata", + value: value + }; + return node; +} + +function functionNameMetadata(value, index) { + if (!(typeof value === "string")) { + throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown")); + } + + if (!(typeof index === "number")) { + throw new Error('typeof index === "number"' + " error: " + ("Argument index must be of type number, given: " + _typeof(index) || "unknown")); + } + + var node = { + type: "FunctionNameMetadata", + value: value, + index: index + }; + return node; +} + +function localNameMetadata(value, localIndex, functionIndex) { + if (!(typeof value === "string")) { + throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown")); + } + + if (!(typeof localIndex === "number")) { + throw new Error('typeof localIndex === "number"' + " error: " + ("Argument localIndex must be of type number, given: " + _typeof(localIndex) || "unknown")); + } + + if (!(typeof functionIndex === "number")) { + throw new Error('typeof functionIndex === "number"' + " error: " + ("Argument functionIndex must be of type number, given: " + _typeof(functionIndex) || "unknown")); + } + + var node = { + type: "LocalNameMetadata", + value: value, + localIndex: localIndex, + functionIndex: functionIndex + }; + return node; +} + +function binaryModule(id, blob) { + if (id !== null && id !== undefined) { + if (!(typeof id === "string")) { + throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown")); + } + } + + if (!(_typeof(blob) === "object" && typeof blob.length !== "undefined")) { + throw new Error('typeof blob === "object" && typeof blob.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "BinaryModule", + id: id, + blob: blob + }; + return node; +} + +function quoteModule(id, string) { + if (id !== null && id !== undefined) { + if (!(typeof id === "string")) { + throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown")); + } + } + + if (!(_typeof(string) === "object" && typeof string.length !== "undefined")) { + throw new Error('typeof string === "object" && typeof string.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "QuoteModule", + id: id, + string: string + }; + return node; +} + +function sectionMetadata(section, startOffset, size, vectorOfSize) { + if (!(typeof startOffset === "number")) { + throw new Error('typeof startOffset === "number"' + " error: " + ("Argument startOffset must be of type number, given: " + _typeof(startOffset) || "unknown")); + } + + var node = { + type: "SectionMetadata", + section: section, + startOffset: startOffset, + size: size, + vectorOfSize: vectorOfSize + }; + return node; +} + +function producersSectionMetadata(producers) { + if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) { + throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "ProducersSectionMetadata", + producers: producers + }; + return node; +} + +function producerMetadata(language, processedBy, sdk) { + if (!(_typeof(language) === "object" && typeof language.length !== "undefined")) { + throw new Error('typeof language === "object" && typeof language.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (!(_typeof(processedBy) === "object" && typeof processedBy.length !== "undefined")) { + throw new Error('typeof processedBy === "object" && typeof processedBy.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (!(_typeof(sdk) === "object" && typeof sdk.length !== "undefined")) { + throw new Error('typeof sdk === "object" && typeof sdk.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "ProducerMetadata", + language: language, + processedBy: processedBy, + sdk: sdk + }; + return node; +} + +function producerMetadataVersionedName(name, version) { + if (!(typeof name === "string")) { + throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown")); + } + + if (!(typeof version === "string")) { + throw new Error('typeof version === "string"' + " error: " + ("Argument version must be of type string, given: " + _typeof(version) || "unknown")); + } + + var node = { + type: "ProducerMetadataVersionedName", + name: name, + version: version + }; + return node; +} + +function loopInstruction(label, resulttype, instr) { + if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) { + throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "LoopInstruction", + id: "loop", + label: label, + resulttype: resulttype, + instr: instr + }; + return node; +} + +function instr(id, object, args, namedArgs) { + if (!(typeof id === "string")) { + throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown")); + } + + if (!(_typeof(args) === "object" && typeof args.length !== "undefined")) { + throw new Error('typeof args === "object" && typeof args.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "Instr", + id: id, + args: args + }; + + if (typeof object !== "undefined") { + node.object = object; + } + + if (typeof namedArgs !== "undefined" && Object.keys(namedArgs).length !== 0) { + node.namedArgs = namedArgs; + } + + return node; +} + +function ifInstruction(testLabel, test, result, consequent, alternate) { + if (!(_typeof(test) === "object" && typeof test.length !== "undefined")) { + throw new Error('typeof test === "object" && typeof test.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (!(_typeof(consequent) === "object" && typeof consequent.length !== "undefined")) { + throw new Error('typeof consequent === "object" && typeof consequent.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (!(_typeof(alternate) === "object" && typeof alternate.length !== "undefined")) { + throw new Error('typeof alternate === "object" && typeof alternate.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "IfInstruction", + id: "if", + testLabel: testLabel, + test: test, + result: result, + consequent: consequent, + alternate: alternate + }; + return node; +} + +function stringLiteral(value) { + if (!(typeof value === "string")) { + throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown")); + } + + var node = { + type: "StringLiteral", + value: value + }; + return node; +} + +function numberLiteral(value, raw) { + if (!(typeof value === "number")) { + throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || "unknown")); + } + + if (!(typeof raw === "string")) { + throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown")); + } + + var node = { + type: "NumberLiteral", + value: value, + raw: raw + }; + return node; +} + +function longNumberLiteral(value, raw) { + if (!(typeof raw === "string")) { + throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown")); + } + + var node = { + type: "LongNumberLiteral", + value: value, + raw: raw + }; + return node; +} + +function floatLiteral(value, nan, inf, raw) { + if (!(typeof value === "number")) { + throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || "unknown")); + } + + if (nan !== null && nan !== undefined) { + if (!(typeof nan === "boolean")) { + throw new Error('typeof nan === "boolean"' + " error: " + ("Argument nan must be of type boolean, given: " + _typeof(nan) || "unknown")); + } + } + + if (inf !== null && inf !== undefined) { + if (!(typeof inf === "boolean")) { + throw new Error('typeof inf === "boolean"' + " error: " + ("Argument inf must be of type boolean, given: " + _typeof(inf) || "unknown")); + } + } + + if (!(typeof raw === "string")) { + throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown")); + } + + var node = { + type: "FloatLiteral", + value: value, + raw: raw + }; + + if (nan === true) { + node.nan = true; + } + + if (inf === true) { + node.inf = true; + } + + return node; +} + +function elem(table, offset, funcs) { + if (!(_typeof(offset) === "object" && typeof offset.length !== "undefined")) { + throw new Error('typeof offset === "object" && typeof offset.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (!(_typeof(funcs) === "object" && typeof funcs.length !== "undefined")) { + throw new Error('typeof funcs === "object" && typeof funcs.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "Elem", + table: table, + offset: offset, + funcs: funcs + }; + return node; +} + +function indexInFuncSection(index) { + var node = { + type: "IndexInFuncSection", + index: index + }; + return node; +} + +function valtypeLiteral(name) { + var node = { + type: "ValtypeLiteral", + name: name + }; + return node; +} + +function typeInstruction(id, functype) { + var node = { + type: "TypeInstruction", + id: id, + functype: functype + }; + return node; +} + +function start(index) { + var node = { + type: "Start", + index: index + }; + return node; +} + +function globalType(valtype, mutability) { + var node = { + type: "GlobalType", + valtype: valtype, + mutability: mutability + }; + return node; +} + +function leadingComment(value) { + if (!(typeof value === "string")) { + throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown")); + } + + var node = { + type: "LeadingComment", + value: value + }; + return node; +} + +function blockComment(value) { + if (!(typeof value === "string")) { + throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown")); + } + + var node = { + type: "BlockComment", + value: value + }; + return node; +} + +function data(memoryIndex, offset, init) { + var node = { + type: "Data", + memoryIndex: memoryIndex, + offset: offset, + init: init + }; + return node; +} + +function global(globalType, init, name) { + if (!(_typeof(init) === "object" && typeof init.length !== "undefined")) { + throw new Error('typeof init === "object" && typeof init.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "Global", + globalType: globalType, + init: init, + name: name + }; + return node; +} + +function table(elementType, limits, name, elements) { + if (!(limits.type === "Limit")) { + throw new Error('limits.type === "Limit"' + " error: " + ("Argument limits must be of type Limit, given: " + limits.type || "unknown")); + } + + if (elements !== null && elements !== undefined) { + if (!(_typeof(elements) === "object" && typeof elements.length !== "undefined")) { + throw new Error('typeof elements === "object" && typeof elements.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + } + + var node = { + type: "Table", + elementType: elementType, + limits: limits, + name: name + }; + + if (typeof elements !== "undefined" && elements.length > 0) { + node.elements = elements; + } + + return node; +} + +function memory(limits, id) { + var node = { + type: "Memory", + limits: limits, + id: id + }; + return node; +} + +function funcImportDescr(id, signature) { + var node = { + type: "FuncImportDescr", + id: id, + signature: signature + }; + return node; +} + +function moduleImport(module, name, descr) { + if (!(typeof module === "string")) { + throw new Error('typeof module === "string"' + " error: " + ("Argument module must be of type string, given: " + _typeof(module) || "unknown")); + } + + if (!(typeof name === "string")) { + throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown")); + } + + var node = { + type: "ModuleImport", + module: module, + name: name, + descr: descr + }; + return node; +} + +function moduleExportDescr(exportType, id) { + var node = { + type: "ModuleExportDescr", + exportType: exportType, + id: id + }; + return node; +} + +function moduleExport(name, descr) { + if (!(typeof name === "string")) { + throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown")); + } + + var node = { + type: "ModuleExport", + name: name, + descr: descr + }; + return node; +} + +function limit(min, max) { + if (!(typeof min === "number")) { + throw new Error('typeof min === "number"' + " error: " + ("Argument min must be of type number, given: " + _typeof(min) || "unknown")); + } + + if (max !== null && max !== undefined) { + if (!(typeof max === "number")) { + throw new Error('typeof max === "number"' + " error: " + ("Argument max must be of type number, given: " + _typeof(max) || "unknown")); + } + } + + var node = { + type: "Limit", + min: min + }; + + if (typeof max !== "undefined") { + node.max = max; + } + + return node; +} + +function signature(params, results) { + if (!(_typeof(params) === "object" && typeof params.length !== "undefined")) { + throw new Error('typeof params === "object" && typeof params.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (!(_typeof(results) === "object" && typeof results.length !== "undefined")) { + throw new Error('typeof results === "object" && typeof results.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "Signature", + params: params, + results: results + }; + return node; +} + +function program(body) { + if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) { + throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "Program", + body: body + }; + return node; +} + +function identifier(value, raw) { + if (!(typeof value === "string")) { + throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown")); + } + + if (raw !== null && raw !== undefined) { + if (!(typeof raw === "string")) { + throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown")); + } + } + + var node = { + type: "Identifier", + value: value + }; + + if (typeof raw !== "undefined") { + node.raw = raw; + } + + return node; +} + +function blockInstruction(label, instr, result) { + if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) { + throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "BlockInstruction", + id: "block", + label: label, + instr: instr, + result: result + }; + return node; +} + +function callInstruction(index, instrArgs, numeric) { + if (instrArgs !== null && instrArgs !== undefined) { + if (!(_typeof(instrArgs) === "object" && typeof instrArgs.length !== "undefined")) { + throw new Error('typeof instrArgs === "object" && typeof instrArgs.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + } + + var node = { + type: "CallInstruction", + id: "call", + index: index + }; + + if (typeof instrArgs !== "undefined" && instrArgs.length > 0) { + node.instrArgs = instrArgs; + } + + if (typeof numeric !== "undefined") { + node.numeric = numeric; + } + + return node; +} + +function callIndirectInstruction(signature, intrs) { + if (intrs !== null && intrs !== undefined) { + if (!(_typeof(intrs) === "object" && typeof intrs.length !== "undefined")) { + throw new Error('typeof intrs === "object" && typeof intrs.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + } + + var node = { + type: "CallIndirectInstruction", + id: "call_indirect", + signature: signature + }; + + if (typeof intrs !== "undefined" && intrs.length > 0) { + node.intrs = intrs; + } + + return node; +} + +function byteArray(values) { + if (!(_typeof(values) === "object" && typeof values.length !== "undefined")) { + throw new Error('typeof values === "object" && typeof values.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + var node = { + type: "ByteArray", + values: values + }; + return node; +} + +function func(name, signature, body, isExternal, metadata) { + if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) { + throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown")); + } + + if (isExternal !== null && isExternal !== undefined) { + if (!(typeof isExternal === "boolean")) { + throw new Error('typeof isExternal === "boolean"' + " error: " + ("Argument isExternal must be of type boolean, given: " + _typeof(isExternal) || "unknown")); + } + } + + var node = { + type: "Func", + name: name, + signature: signature, + body: body + }; + + if (isExternal === true) { + node.isExternal = true; + } + + if (typeof metadata !== "undefined") { + node.metadata = metadata; + } + + return node; +} + +function internalBrUnless(target) { + if (!(typeof target === "number")) { + throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown")); + } + + var node = { + type: "InternalBrUnless", + target: target + }; + return node; +} + +function internalGoto(target) { + if (!(typeof target === "number")) { + throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown")); + } + + var node = { + type: "InternalGoto", + target: target + }; + return node; +} + +function internalCallExtern(target) { + if (!(typeof target === "number")) { + throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown")); + } + + var node = { + type: "InternalCallExtern", + target: target + }; + return node; +} + +function internalEndAndReturn() { + var node = { + type: "InternalEndAndReturn" + }; + return node; +} + +var isModule = isTypeOf("Module"); +exports.isModule = isModule; +var isModuleMetadata = isTypeOf("ModuleMetadata"); +exports.isModuleMetadata = isModuleMetadata; +var isModuleNameMetadata = isTypeOf("ModuleNameMetadata"); +exports.isModuleNameMetadata = isModuleNameMetadata; +var isFunctionNameMetadata = isTypeOf("FunctionNameMetadata"); +exports.isFunctionNameMetadata = isFunctionNameMetadata; +var isLocalNameMetadata = isTypeOf("LocalNameMetadata"); +exports.isLocalNameMetadata = isLocalNameMetadata; +var isBinaryModule = isTypeOf("BinaryModule"); +exports.isBinaryModule = isBinaryModule; +var isQuoteModule = isTypeOf("QuoteModule"); +exports.isQuoteModule = isQuoteModule; +var isSectionMetadata = isTypeOf("SectionMetadata"); +exports.isSectionMetadata = isSectionMetadata; +var isProducersSectionMetadata = isTypeOf("ProducersSectionMetadata"); +exports.isProducersSectionMetadata = isProducersSectionMetadata; +var isProducerMetadata = isTypeOf("ProducerMetadata"); +exports.isProducerMetadata = isProducerMetadata; +var isProducerMetadataVersionedName = isTypeOf("ProducerMetadataVersionedName"); +exports.isProducerMetadataVersionedName = isProducerMetadataVersionedName; +var isLoopInstruction = isTypeOf("LoopInstruction"); +exports.isLoopInstruction = isLoopInstruction; +var isInstr = isTypeOf("Instr"); +exports.isInstr = isInstr; +var isIfInstruction = isTypeOf("IfInstruction"); +exports.isIfInstruction = isIfInstruction; +var isStringLiteral = isTypeOf("StringLiteral"); +exports.isStringLiteral = isStringLiteral; +var isNumberLiteral = isTypeOf("NumberLiteral"); +exports.isNumberLiteral = isNumberLiteral; +var isLongNumberLiteral = isTypeOf("LongNumberLiteral"); +exports.isLongNumberLiteral = isLongNumberLiteral; +var isFloatLiteral = isTypeOf("FloatLiteral"); +exports.isFloatLiteral = isFloatLiteral; +var isElem = isTypeOf("Elem"); +exports.isElem = isElem; +var isIndexInFuncSection = isTypeOf("IndexInFuncSection"); +exports.isIndexInFuncSection = isIndexInFuncSection; +var isValtypeLiteral = isTypeOf("ValtypeLiteral"); +exports.isValtypeLiteral = isValtypeLiteral; +var isTypeInstruction = isTypeOf("TypeInstruction"); +exports.isTypeInstruction = isTypeInstruction; +var isStart = isTypeOf("Start"); +exports.isStart = isStart; +var isGlobalType = isTypeOf("GlobalType"); +exports.isGlobalType = isGlobalType; +var isLeadingComment = isTypeOf("LeadingComment"); +exports.isLeadingComment = isLeadingComment; +var isBlockComment = isTypeOf("BlockComment"); +exports.isBlockComment = isBlockComment; +var isData = isTypeOf("Data"); +exports.isData = isData; +var isGlobal = isTypeOf("Global"); +exports.isGlobal = isGlobal; +var isTable = isTypeOf("Table"); +exports.isTable = isTable; +var isMemory = isTypeOf("Memory"); +exports.isMemory = isMemory; +var isFuncImportDescr = isTypeOf("FuncImportDescr"); +exports.isFuncImportDescr = isFuncImportDescr; +var isModuleImport = isTypeOf("ModuleImport"); +exports.isModuleImport = isModuleImport; +var isModuleExportDescr = isTypeOf("ModuleExportDescr"); +exports.isModuleExportDescr = isModuleExportDescr; +var isModuleExport = isTypeOf("ModuleExport"); +exports.isModuleExport = isModuleExport; +var isLimit = isTypeOf("Limit"); +exports.isLimit = isLimit; +var isSignature = isTypeOf("Signature"); +exports.isSignature = isSignature; +var isProgram = isTypeOf("Program"); +exports.isProgram = isProgram; +var isIdentifier = isTypeOf("Identifier"); +exports.isIdentifier = isIdentifier; +var isBlockInstruction = isTypeOf("BlockInstruction"); +exports.isBlockInstruction = isBlockInstruction; +var isCallInstruction = isTypeOf("CallInstruction"); +exports.isCallInstruction = isCallInstruction; +var isCallIndirectInstruction = isTypeOf("CallIndirectInstruction"); +exports.isCallIndirectInstruction = isCallIndirectInstruction; +var isByteArray = isTypeOf("ByteArray"); +exports.isByteArray = isByteArray; +var isFunc = isTypeOf("Func"); +exports.isFunc = isFunc; +var isInternalBrUnless = isTypeOf("InternalBrUnless"); +exports.isInternalBrUnless = isInternalBrUnless; +var isInternalGoto = isTypeOf("InternalGoto"); +exports.isInternalGoto = isInternalGoto; +var isInternalCallExtern = isTypeOf("InternalCallExtern"); +exports.isInternalCallExtern = isInternalCallExtern; +var isInternalEndAndReturn = isTypeOf("InternalEndAndReturn"); +exports.isInternalEndAndReturn = isInternalEndAndReturn; + +var isNode = function isNode(node) { + return isModule(node) || isModuleMetadata(node) || isModuleNameMetadata(node) || isFunctionNameMetadata(node) || isLocalNameMetadata(node) || isBinaryModule(node) || isQuoteModule(node) || isSectionMetadata(node) || isProducersSectionMetadata(node) || isProducerMetadata(node) || isProducerMetadataVersionedName(node) || isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isElem(node) || isIndexInFuncSection(node) || isValtypeLiteral(node) || isTypeInstruction(node) || isStart(node) || isGlobalType(node) || isLeadingComment(node) || isBlockComment(node) || isData(node) || isGlobal(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node) || isModuleImport(node) || isModuleExportDescr(node) || isModuleExport(node) || isLimit(node) || isSignature(node) || isProgram(node) || isIdentifier(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node) || isByteArray(node) || isFunc(node) || isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node); +}; + +exports.isNode = isNode; + +var isBlock = function isBlock(node) { + return isLoopInstruction(node) || isBlockInstruction(node) || isFunc(node); +}; + +exports.isBlock = isBlock; + +var isInstruction = function isInstruction(node) { + return isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isTypeInstruction(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node); +}; + +exports.isInstruction = isInstruction; + +var isExpression = function isExpression(node) { + return isInstr(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isValtypeLiteral(node) || isIdentifier(node); +}; + +exports.isExpression = isExpression; + +var isNumericLiteral = function isNumericLiteral(node) { + return isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node); +}; + +exports.isNumericLiteral = isNumericLiteral; + +var isImportDescr = function isImportDescr(node) { + return isGlobalType(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node); +}; + +exports.isImportDescr = isImportDescr; + +var isIntrinsic = function isIntrinsic(node) { + return isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node); +}; + +exports.isIntrinsic = isIntrinsic; +var assertModule = assertTypeOf("Module"); +exports.assertModule = assertModule; +var assertModuleMetadata = assertTypeOf("ModuleMetadata"); +exports.assertModuleMetadata = assertModuleMetadata; +var assertModuleNameMetadata = assertTypeOf("ModuleNameMetadata"); +exports.assertModuleNameMetadata = assertModuleNameMetadata; +var assertFunctionNameMetadata = assertTypeOf("FunctionNameMetadata"); +exports.assertFunctionNameMetadata = assertFunctionNameMetadata; +var assertLocalNameMetadata = assertTypeOf("LocalNameMetadata"); +exports.assertLocalNameMetadata = assertLocalNameMetadata; +var assertBinaryModule = assertTypeOf("BinaryModule"); +exports.assertBinaryModule = assertBinaryModule; +var assertQuoteModule = assertTypeOf("QuoteModule"); +exports.assertQuoteModule = assertQuoteModule; +var assertSectionMetadata = assertTypeOf("SectionMetadata"); +exports.assertSectionMetadata = assertSectionMetadata; +var assertProducersSectionMetadata = assertTypeOf("ProducersSectionMetadata"); +exports.assertProducersSectionMetadata = assertProducersSectionMetadata; +var assertProducerMetadata = assertTypeOf("ProducerMetadata"); +exports.assertProducerMetadata = assertProducerMetadata; +var assertProducerMetadataVersionedName = assertTypeOf("ProducerMetadataVersionedName"); +exports.assertProducerMetadataVersionedName = assertProducerMetadataVersionedName; +var assertLoopInstruction = assertTypeOf("LoopInstruction"); +exports.assertLoopInstruction = assertLoopInstruction; +var assertInstr = assertTypeOf("Instr"); +exports.assertInstr = assertInstr; +var assertIfInstruction = assertTypeOf("IfInstruction"); +exports.assertIfInstruction = assertIfInstruction; +var assertStringLiteral = assertTypeOf("StringLiteral"); +exports.assertStringLiteral = assertStringLiteral; +var assertNumberLiteral = assertTypeOf("NumberLiteral"); +exports.assertNumberLiteral = assertNumberLiteral; +var assertLongNumberLiteral = assertTypeOf("LongNumberLiteral"); +exports.assertLongNumberLiteral = assertLongNumberLiteral; +var assertFloatLiteral = assertTypeOf("FloatLiteral"); +exports.assertFloatLiteral = assertFloatLiteral; +var assertElem = assertTypeOf("Elem"); +exports.assertElem = assertElem; +var assertIndexInFuncSection = assertTypeOf("IndexInFuncSection"); +exports.assertIndexInFuncSection = assertIndexInFuncSection; +var assertValtypeLiteral = assertTypeOf("ValtypeLiteral"); +exports.assertValtypeLiteral = assertValtypeLiteral; +var assertTypeInstruction = assertTypeOf("TypeInstruction"); +exports.assertTypeInstruction = assertTypeInstruction; +var assertStart = assertTypeOf("Start"); +exports.assertStart = assertStart; +var assertGlobalType = assertTypeOf("GlobalType"); +exports.assertGlobalType = assertGlobalType; +var assertLeadingComment = assertTypeOf("LeadingComment"); +exports.assertLeadingComment = assertLeadingComment; +var assertBlockComment = assertTypeOf("BlockComment"); +exports.assertBlockComment = assertBlockComment; +var assertData = assertTypeOf("Data"); +exports.assertData = assertData; +var assertGlobal = assertTypeOf("Global"); +exports.assertGlobal = assertGlobal; +var assertTable = assertTypeOf("Table"); +exports.assertTable = assertTable; +var assertMemory = assertTypeOf("Memory"); +exports.assertMemory = assertMemory; +var assertFuncImportDescr = assertTypeOf("FuncImportDescr"); +exports.assertFuncImportDescr = assertFuncImportDescr; +var assertModuleImport = assertTypeOf("ModuleImport"); +exports.assertModuleImport = assertModuleImport; +var assertModuleExportDescr = assertTypeOf("ModuleExportDescr"); +exports.assertModuleExportDescr = assertModuleExportDescr; +var assertModuleExport = assertTypeOf("ModuleExport"); +exports.assertModuleExport = assertModuleExport; +var assertLimit = assertTypeOf("Limit"); +exports.assertLimit = assertLimit; +var assertSignature = assertTypeOf("Signature"); +exports.assertSignature = assertSignature; +var assertProgram = assertTypeOf("Program"); +exports.assertProgram = assertProgram; +var assertIdentifier = assertTypeOf("Identifier"); +exports.assertIdentifier = assertIdentifier; +var assertBlockInstruction = assertTypeOf("BlockInstruction"); +exports.assertBlockInstruction = assertBlockInstruction; +var assertCallInstruction = assertTypeOf("CallInstruction"); +exports.assertCallInstruction = assertCallInstruction; +var assertCallIndirectInstruction = assertTypeOf("CallIndirectInstruction"); +exports.assertCallIndirectInstruction = assertCallIndirectInstruction; +var assertByteArray = assertTypeOf("ByteArray"); +exports.assertByteArray = assertByteArray; +var assertFunc = assertTypeOf("Func"); +exports.assertFunc = assertFunc; +var assertInternalBrUnless = assertTypeOf("InternalBrUnless"); +exports.assertInternalBrUnless = assertInternalBrUnless; +var assertInternalGoto = assertTypeOf("InternalGoto"); +exports.assertInternalGoto = assertInternalGoto; +var assertInternalCallExtern = assertTypeOf("InternalCallExtern"); +exports.assertInternalCallExtern = assertInternalCallExtern; +var assertInternalEndAndReturn = assertTypeOf("InternalEndAndReturn"); +exports.assertInternalEndAndReturn = assertInternalEndAndReturn; +var unionTypesMap = { + Module: ["Node"], + ModuleMetadata: ["Node"], + ModuleNameMetadata: ["Node"], + FunctionNameMetadata: ["Node"], + LocalNameMetadata: ["Node"], + BinaryModule: ["Node"], + QuoteModule: ["Node"], + SectionMetadata: ["Node"], + ProducersSectionMetadata: ["Node"], + ProducerMetadata: ["Node"], + ProducerMetadataVersionedName: ["Node"], + LoopInstruction: ["Node", "Block", "Instruction"], + Instr: ["Node", "Expression", "Instruction"], + IfInstruction: ["Node", "Instruction"], + StringLiteral: ["Node", "Expression"], + NumberLiteral: ["Node", "NumericLiteral", "Expression"], + LongNumberLiteral: ["Node", "NumericLiteral", "Expression"], + FloatLiteral: ["Node", "NumericLiteral", "Expression"], + Elem: ["Node"], + IndexInFuncSection: ["Node"], + ValtypeLiteral: ["Node", "Expression"], + TypeInstruction: ["Node", "Instruction"], + Start: ["Node"], + GlobalType: ["Node", "ImportDescr"], + LeadingComment: ["Node"], + BlockComment: ["Node"], + Data: ["Node"], + Global: ["Node"], + Table: ["Node", "ImportDescr"], + Memory: ["Node", "ImportDescr"], + FuncImportDescr: ["Node", "ImportDescr"], + ModuleImport: ["Node"], + ModuleExportDescr: ["Node"], + ModuleExport: ["Node"], + Limit: ["Node"], + Signature: ["Node"], + Program: ["Node"], + Identifier: ["Node", "Expression"], + BlockInstruction: ["Node", "Block", "Instruction"], + CallInstruction: ["Node", "Instruction"], + CallIndirectInstruction: ["Node", "Instruction"], + ByteArray: ["Node"], + Func: ["Node", "Block"], + InternalBrUnless: ["Node", "Intrinsic"], + InternalGoto: ["Node", "Intrinsic"], + InternalCallExtern: ["Node", "Intrinsic"], + InternalEndAndReturn: ["Node", "Intrinsic"] +}; +exports.unionTypesMap = unionTypesMap; +var nodeAndUnionTypes = ["Module", "ModuleMetadata", "ModuleNameMetadata", "FunctionNameMetadata", "LocalNameMetadata", "BinaryModule", "QuoteModule", "SectionMetadata", "ProducersSectionMetadata", "ProducerMetadata", "ProducerMetadataVersionedName", "LoopInstruction", "Instr", "IfInstruction", "StringLiteral", "NumberLiteral", "LongNumberLiteral", "FloatLiteral", "Elem", "IndexInFuncSection", "ValtypeLiteral", "TypeInstruction", "Start", "GlobalType", "LeadingComment", "BlockComment", "Data", "Global", "Table", "Memory", "FuncImportDescr", "ModuleImport", "ModuleExportDescr", "ModuleExport", "Limit", "Signature", "Program", "Identifier", "BlockInstruction", "CallInstruction", "CallIndirectInstruction", "ByteArray", "Func", "InternalBrUnless", "InternalGoto", "InternalCallExtern", "InternalEndAndReturn", "Node", "Block", "Instruction", "Expression", "NumericLiteral", "ImportDescr", "Intrinsic"]; +exports.nodeAndUnionTypes = nodeAndUnionTypes; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/lib/signatures.js b/node_modules/@webassemblyjs/ast/lib/signatures.js new file mode 100644 index 0000000..0efc766 --- /dev/null +++ b/node_modules/@webassemblyjs/ast/lib/signatures.js @@ -0,0 +1,207 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.signatures = void 0; + +function sign(input, output) { + return [input, output]; +} + +var u32 = "u32"; +var i32 = "i32"; +var i64 = "i64"; +var f32 = "f32"; +var f64 = "f64"; + +var vector = function vector(t) { + var vecType = [t]; // $FlowIgnore + + vecType.vector = true; + return vecType; +}; + +var controlInstructions = { + unreachable: sign([], []), + nop: sign([], []), + // block ? + // loop ? + // if ? + // if else ? + br: sign([u32], []), + br_if: sign([u32], []), + br_table: sign(vector(u32), []), + return: sign([], []), + call: sign([u32], []), + call_indirect: sign([u32], []) +}; +var parametricInstructions = { + drop: sign([], []), + select: sign([], []) +}; +var variableInstructions = { + get_local: sign([u32], []), + set_local: sign([u32], []), + tee_local: sign([u32], []), + get_global: sign([u32], []), + set_global: sign([u32], []) +}; +var memoryInstructions = { + "i32.load": sign([u32, u32], [i32]), + "i64.load": sign([u32, u32], []), + "f32.load": sign([u32, u32], []), + "f64.load": sign([u32, u32], []), + "i32.load8_s": sign([u32, u32], [i32]), + "i32.load8_u": sign([u32, u32], [i32]), + "i32.load16_s": sign([u32, u32], [i32]), + "i32.load16_u": sign([u32, u32], [i32]), + "i64.load8_s": sign([u32, u32], [i64]), + "i64.load8_u": sign([u32, u32], [i64]), + "i64.load16_s": sign([u32, u32], [i64]), + "i64.load16_u": sign([u32, u32], [i64]), + "i64.load32_s": sign([u32, u32], [i64]), + "i64.load32_u": sign([u32, u32], [i64]), + "i32.store": sign([u32, u32], []), + "i64.store": sign([u32, u32], []), + "f32.store": sign([u32, u32], []), + "f64.store": sign([u32, u32], []), + "i32.store8": sign([u32, u32], []), + "i32.store16": sign([u32, u32], []), + "i64.store8": sign([u32, u32], []), + "i64.store16": sign([u32, u32], []), + "i64.store32": sign([u32, u32], []), + current_memory: sign([], []), + grow_memory: sign([], []) +}; +var numericInstructions = { + "i32.const": sign([i32], [i32]), + "i64.const": sign([i64], [i64]), + "f32.const": sign([f32], [f32]), + "f64.const": sign([f64], [f64]), + "i32.eqz": sign([i32], [i32]), + "i32.eq": sign([i32, i32], [i32]), + "i32.ne": sign([i32, i32], [i32]), + "i32.lt_s": sign([i32, i32], [i32]), + "i32.lt_u": sign([i32, i32], [i32]), + "i32.gt_s": sign([i32, i32], [i32]), + "i32.gt_u": sign([i32, i32], [i32]), + "i32.le_s": sign([i32, i32], [i32]), + "i32.le_u": sign([i32, i32], [i32]), + "i32.ge_s": sign([i32, i32], [i32]), + "i32.ge_u": sign([i32, i32], [i32]), + "i64.eqz": sign([i64], [i64]), + "i64.eq": sign([i64, i64], [i32]), + "i64.ne": sign([i64, i64], [i32]), + "i64.lt_s": sign([i64, i64], [i32]), + "i64.lt_u": sign([i64, i64], [i32]), + "i64.gt_s": sign([i64, i64], [i32]), + "i64.gt_u": sign([i64, i64], [i32]), + "i64.le_s": sign([i64, i64], [i32]), + "i64.le_u": sign([i64, i64], [i32]), + "i64.ge_s": sign([i64, i64], [i32]), + "i64.ge_u": sign([i64, i64], [i32]), + "f32.eq": sign([f32, f32], [i32]), + "f32.ne": sign([f32, f32], [i32]), + "f32.lt": sign([f32, f32], [i32]), + "f32.gt": sign([f32, f32], [i32]), + "f32.le": sign([f32, f32], [i32]), + "f32.ge": sign([f32, f32], [i32]), + "f64.eq": sign([f64, f64], [i32]), + "f64.ne": sign([f64, f64], [i32]), + "f64.lt": sign([f64, f64], [i32]), + "f64.gt": sign([f64, f64], [i32]), + "f64.le": sign([f64, f64], [i32]), + "f64.ge": sign([f64, f64], [i32]), + "i32.clz": sign([i32], [i32]), + "i32.ctz": sign([i32], [i32]), + "i32.popcnt": sign([i32], [i32]), + "i32.add": sign([i32, i32], [i32]), + "i32.sub": sign([i32, i32], [i32]), + "i32.mul": sign([i32, i32], [i32]), + "i32.div_s": sign([i32, i32], [i32]), + "i32.div_u": sign([i32, i32], [i32]), + "i32.rem_s": sign([i32, i32], [i32]), + "i32.rem_u": sign([i32, i32], [i32]), + "i32.and": sign([i32, i32], [i32]), + "i32.or": sign([i32, i32], [i32]), + "i32.xor": sign([i32, i32], [i32]), + "i32.shl": sign([i32, i32], [i32]), + "i32.shr_s": sign([i32, i32], [i32]), + "i32.shr_u": sign([i32, i32], [i32]), + "i32.rotl": sign([i32, i32], [i32]), + "i32.rotr": sign([i32, i32], [i32]), + "i64.clz": sign([i64], [i64]), + "i64.ctz": sign([i64], [i64]), + "i64.popcnt": sign([i64], [i64]), + "i64.add": sign([i64, i64], [i64]), + "i64.sub": sign([i64, i64], [i64]), + "i64.mul": sign([i64, i64], [i64]), + "i64.div_s": sign([i64, i64], [i64]), + "i64.div_u": sign([i64, i64], [i64]), + "i64.rem_s": sign([i64, i64], [i64]), + "i64.rem_u": sign([i64, i64], [i64]), + "i64.and": sign([i64, i64], [i64]), + "i64.or": sign([i64, i64], [i64]), + "i64.xor": sign([i64, i64], [i64]), + "i64.shl": sign([i64, i64], [i64]), + "i64.shr_s": sign([i64, i64], [i64]), + "i64.shr_u": sign([i64, i64], [i64]), + "i64.rotl": sign([i64, i64], [i64]), + "i64.rotr": sign([i64, i64], [i64]), + "f32.abs": sign([f32], [f32]), + "f32.neg": sign([f32], [f32]), + "f32.ceil": sign([f32], [f32]), + "f32.floor": sign([f32], [f32]), + "f32.trunc": sign([f32], [f32]), + "f32.nearest": sign([f32], [f32]), + "f32.sqrt": sign([f32], [f32]), + "f32.add": sign([f32, f32], [f32]), + "f32.sub": sign([f32, f32], [f32]), + "f32.mul": sign([f32, f32], [f32]), + "f32.div": sign([f32, f32], [f32]), + "f32.min": sign([f32, f32], [f32]), + "f32.max": sign([f32, f32], [f32]), + "f32.copysign": sign([f32, f32], [f32]), + "f64.abs": sign([f64], [f64]), + "f64.neg": sign([f64], [f64]), + "f64.ceil": sign([f64], [f64]), + "f64.floor": sign([f64], [f64]), + "f64.trunc": sign([f64], [f64]), + "f64.nearest": sign([f64], [f64]), + "f64.sqrt": sign([f64], [f64]), + "f64.add": sign([f64, f64], [f64]), + "f64.sub": sign([f64, f64], [f64]), + "f64.mul": sign([f64, f64], [f64]), + "f64.div": sign([f64, f64], [f64]), + "f64.min": sign([f64, f64], [f64]), + "f64.max": sign([f64, f64], [f64]), + "f64.copysign": sign([f64, f64], [f64]), + "i32.wrap/i64": sign([i64], [i32]), + "i32.trunc_s/f32": sign([f32], [i32]), + "i32.trunc_u/f32": sign([f32], [i32]), + "i32.trunc_s/f64": sign([f32], [i32]), + "i32.trunc_u/f64": sign([f64], [i32]), + "i64.extend_s/i32": sign([i32], [i64]), + "i64.extend_u/i32": sign([i32], [i64]), + "i64.trunc_s/f32": sign([f32], [i64]), + "i64.trunc_u/f32": sign([f32], [i64]), + "i64.trunc_s/f64": sign([f64], [i64]), + "i64.trunc_u/f64": sign([f64], [i64]), + "f32.convert_s/i32": sign([i32], [f32]), + "f32.convert_u/i32": sign([i32], [f32]), + "f32.convert_s/i64": sign([i64], [f32]), + "f32.convert_u/i64": sign([i64], [f32]), + "f32.demote/f64": sign([f64], [f32]), + "f64.convert_s/i32": sign([i32], [f64]), + "f64.convert_u/i32": sign([i32], [f64]), + "f64.convert_s/i64": sign([i64], [f64]), + "f64.convert_u/i64": sign([i64], [f64]), + "f64.promote/f32": sign([f32], [f64]), + "i32.reinterpret/f32": sign([f32], [i32]), + "i64.reinterpret/f64": sign([f64], [i64]), + "f32.reinterpret/i32": sign([i32], [f32]), + "f64.reinterpret/i64": sign([i64], [f64]) +}; +var signatures = Object.assign({}, controlInstructions, parametricInstructions, variableInstructions, memoryInstructions, numericInstructions); +exports.signatures = signatures; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/lib/transform/denormalize-type-references/index.js b/node_modules/@webassemblyjs/ast/lib/transform/denormalize-type-references/index.js new file mode 100644 index 0000000..3258f84 --- /dev/null +++ b/node_modules/@webassemblyjs/ast/lib/transform/denormalize-type-references/index.js @@ -0,0 +1,83 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.transform = transform; + +var t = require("../../index"); // func and call_indirect instructions can either define a signature inline, or +// reference a signature, e.g. +// +// ;; inline signature +// (func (result i64) +// (i64.const 2) +// ) +// ;; signature reference +// (type (func (result i64))) +// (func (type 0) +// (i64.const 2)) +// ) +// +// this AST transform denormalises the type references, making all signatures within the module +// inline. + + +function transform(ast) { + var typeInstructions = []; + t.traverse(ast, { + TypeInstruction: function TypeInstruction(_ref) { + var node = _ref.node; + typeInstructions.push(node); + } + }); + + if (!typeInstructions.length) { + return; + } + + function denormalizeSignature(signature) { + // signature referenced by identifier + if (signature.type === "Identifier") { + var identifier = signature; + var typeInstruction = typeInstructions.find(function (t) { + return t.id.type === identifier.type && t.id.value === identifier.value; + }); + + if (!typeInstruction) { + throw new Error("A type instruction reference was not found ".concat(JSON.stringify(signature))); + } + + return typeInstruction.functype; + } // signature referenced by index + + + if (signature.type === "NumberLiteral") { + var signatureRef = signature; + var _typeInstruction = typeInstructions[signatureRef.value]; + return _typeInstruction.functype; + } + + return signature; + } + + t.traverse(ast, { + Func: function (_Func) { + function Func(_x) { + return _Func.apply(this, arguments); + } + + Func.toString = function () { + return _Func.toString(); + }; + + return Func; + }(function (_ref2) { + var node = _ref2.node; + node.signature = denormalizeSignature(node.signature); + }), + CallIndirectInstruction: function CallIndirectInstruction(_ref3) { + var node = _ref3.node; + node.signature = denormalizeSignature(node.signature); + } + }); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/lib/transform/wast-identifier-to-index/index.js b/node_modules/@webassemblyjs/ast/lib/transform/wast-identifier-to-index/index.js new file mode 100644 index 0000000..33130bf --- /dev/null +++ b/node_modules/@webassemblyjs/ast/lib/transform/wast-identifier-to-index/index.js @@ -0,0 +1,225 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.transform = transform; + +var _index = require("../../index"); + +var _helperModuleContext = require("@webassemblyjs/helper-module-context"); + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } + +// FIXME(sven): do the same with all block instructions, must be more generic here +function newUnexpectedFunction(i) { + return new Error("unknown function at offset: " + i); +} + +function transform(ast) { + var module; + (0, _index.traverse)(ast, { + Module: function (_Module) { + function Module(_x) { + return _Module.apply(this, arguments); + } + + Module.toString = function () { + return _Module.toString(); + }; + + return Module; + }(function (path) { + module = path.node; + }) + }); + var moduleContext = (0, _helperModuleContext.moduleContextFromModuleAST)(module); // Transform the actual instruction in function bodies + + (0, _index.traverse)(ast, { + Func: function (_Func) { + function Func(_x2) { + return _Func.apply(this, arguments); + } + + Func.toString = function () { + return _Func.toString(); + }; + + return Func; + }(function (path) { + transformFuncPath(path, moduleContext); + }), + Start: function (_Start) { + function Start(_x3) { + return _Start.apply(this, arguments); + } + + Start.toString = function () { + return _Start.toString(); + }; + + return Start; + }(function (path) { + var index = path.node.index; + + if ((0, _index.isIdentifier)(index) === true) { + var offsetInModule = moduleContext.getFunctionOffsetByIdentifier(index.value); + + if (typeof offsetInModule === "undefined") { + throw newUnexpectedFunction(index.value); + } // Replace the index Identifier + // $FlowIgnore: reference? + + + path.node.index = (0, _index.numberLiteralFromRaw)(offsetInModule); + } + }) + }); +} + +function transformFuncPath(funcPath, moduleContext) { + var funcNode = funcPath.node; + var signature = funcNode.signature; + + if (signature.type !== "Signature") { + throw new Error("Function signatures must be denormalised before execution"); + } + + var params = signature.params; // Add func locals in the context + + params.forEach(function (p) { + return moduleContext.addLocal(p.valtype); + }); + (0, _index.traverse)(funcNode, { + Instr: function (_Instr) { + function Instr(_x4) { + return _Instr.apply(this, arguments); + } + + Instr.toString = function () { + return _Instr.toString(); + }; + + return Instr; + }(function (instrPath) { + var instrNode = instrPath.node; + /** + * Local access + */ + + if (instrNode.id === "get_local" || instrNode.id === "set_local" || instrNode.id === "tee_local") { + var _instrNode$args = _slicedToArray(instrNode.args, 1), + firstArg = _instrNode$args[0]; + + if (firstArg.type === "Identifier") { + var offsetInParams = params.findIndex(function (_ref) { + var id = _ref.id; + return id === firstArg.value; + }); + + if (offsetInParams === -1) { + throw new Error("".concat(firstArg.value, " not found in ").concat(instrNode.id, ": not declared in func params")); + } // Replace the Identifer node by our new NumberLiteral node + + + instrNode.args[0] = (0, _index.numberLiteralFromRaw)(offsetInParams); + } + } + /** + * Global access + */ + + + if (instrNode.id === "get_global" || instrNode.id === "set_global") { + var _instrNode$args2 = _slicedToArray(instrNode.args, 1), + _firstArg = _instrNode$args2[0]; + + if ((0, _index.isIdentifier)(_firstArg) === true) { + var globalOffset = moduleContext.getGlobalOffsetByIdentifier( // $FlowIgnore: reference? + _firstArg.value); + + if (typeof globalOffset === "undefined") { + // $FlowIgnore: reference? + throw new Error("global ".concat(_firstArg.value, " not found in module")); + } // Replace the Identifer node by our new NumberLiteral node + + + instrNode.args[0] = (0, _index.numberLiteralFromRaw)(globalOffset); + } + } + /** + * Labels lookup + */ + + + if (instrNode.id === "br") { + var _instrNode$args3 = _slicedToArray(instrNode.args, 1), + _firstArg2 = _instrNode$args3[0]; + + if ((0, _index.isIdentifier)(_firstArg2) === true) { + // if the labels is not found it is going to be replaced with -1 + // which is invalid. + var relativeBlockCount = -1; // $FlowIgnore: reference? + + instrPath.findParent(function (_ref2) { + var node = _ref2.node; + + if ((0, _index.isBlock)(node)) { + relativeBlockCount++; // $FlowIgnore: reference? + + var name = node.label || node.name; + + if (_typeof(name) === "object") { + // $FlowIgnore: isIdentifier ensures that + if (name.value === _firstArg2.value) { + // Found it + return false; + } + } + } + + if ((0, _index.isFunc)(node)) { + return false; + } + }); // Replace the Identifer node by our new NumberLiteral node + + instrNode.args[0] = (0, _index.numberLiteralFromRaw)(relativeBlockCount); + } + } + }), + + /** + * Func lookup + */ + CallInstruction: function (_CallInstruction) { + function CallInstruction(_x5) { + return _CallInstruction.apply(this, arguments); + } + + CallInstruction.toString = function () { + return _CallInstruction.toString(); + }; + + return CallInstruction; + }(function (_ref3) { + var node = _ref3.node; + var index = node.index; + + if ((0, _index.isIdentifier)(index) === true) { + var offsetInModule = moduleContext.getFunctionOffsetByIdentifier(index.value); + + if (typeof offsetInModule === "undefined") { + throw newUnexpectedFunction(index.value); + } // Replace the index Identifier + // $FlowIgnore: reference? + + + node.index = (0, _index.numberLiteralFromRaw)(offsetInModule); + } + }) + }); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/lib/traverse.js b/node_modules/@webassemblyjs/ast/lib/traverse.js new file mode 100644 index 0000000..86803ce --- /dev/null +++ b/node_modules/@webassemblyjs/ast/lib/traverse.js @@ -0,0 +1,105 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.traverse = traverse; + +var _nodePath = require("./node-path"); + +var _nodes = require("./nodes"); + +// recursively walks the AST starting at the given node. The callback is invoked for +// and object that has a 'type' property. +function walk(context, callback) { + var stop = false; + + function innerWalk(context, callback) { + if (stop) { + return; + } + + var node = context.node; + + if (node === undefined) { + console.warn("traversing with an empty context"); + return; + } + + if (node._deleted === true) { + return; + } + + var path = (0, _nodePath.createPath)(context); + callback(node.type, path); + + if (path.shouldStop) { + stop = true; + return; + } + + Object.keys(node).forEach(function (prop) { + var value = node[prop]; + + if (value === null || value === undefined) { + return; + } + + var valueAsArray = Array.isArray(value) ? value : [value]; + valueAsArray.forEach(function (childNode) { + if (typeof childNode.type === "string") { + var childContext = { + node: childNode, + parentKey: prop, + parentPath: path, + shouldStop: false, + inList: Array.isArray(value) + }; + innerWalk(childContext, callback); + } + }); + }); + } + + innerWalk(context, callback); +} + +var noop = function noop() {}; + +function traverse(node, visitors) { + var before = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop; + var after = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : noop; + Object.keys(visitors).forEach(function (visitor) { + if (!_nodes.nodeAndUnionTypes.includes(visitor)) { + throw new Error("Unexpected visitor ".concat(visitor)); + } + }); + var context = { + node: node, + inList: false, + shouldStop: false, + parentPath: null, + parentKey: null + }; + walk(context, function (type, path) { + if (typeof visitors[type] === "function") { + before(type, path); + visitors[type](path); + after(type, path); + } + + var unionTypes = _nodes.unionTypesMap[type]; + + if (!unionTypes) { + throw new Error("Unexpected node type ".concat(type)); + } + + unionTypes.forEach(function (unionType) { + if (typeof visitors[unionType] === "function") { + before(unionType, path); + visitors[unionType](path); + after(unionType, path); + } + }); + }); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/lib/types/basic.js b/node_modules/@webassemblyjs/ast/lib/types/basic.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/@webassemblyjs/ast/lib/types/nodes.js b/node_modules/@webassemblyjs/ast/lib/types/nodes.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/@webassemblyjs/ast/lib/types/traverse.js b/node_modules/@webassemblyjs/ast/lib/types/traverse.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/@webassemblyjs/ast/lib/utils.js b/node_modules/@webassemblyjs/ast/lib/utils.js new file mode 100644 index 0000000..d8330fc --- /dev/null +++ b/node_modules/@webassemblyjs/ast/lib/utils.js @@ -0,0 +1,306 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isAnonymous = isAnonymous; +exports.getSectionMetadata = getSectionMetadata; +exports.getSectionMetadatas = getSectionMetadatas; +exports.sortSectionMetadata = sortSectionMetadata; +exports.orderedInsertNode = orderedInsertNode; +exports.assertHasLoc = assertHasLoc; +exports.getEndOfSection = getEndOfSection; +exports.shiftLoc = shiftLoc; +exports.shiftSection = shiftSection; +exports.signatureForOpcode = signatureForOpcode; +exports.getUniqueNameGenerator = getUniqueNameGenerator; +exports.getStartByteOffset = getStartByteOffset; +exports.getEndByteOffset = getEndByteOffset; +exports.getFunctionBeginingByteOffset = getFunctionBeginingByteOffset; +exports.getEndBlockByteOffset = getEndBlockByteOffset; +exports.getStartBlockByteOffset = getStartBlockByteOffset; + +var _signatures = require("./signatures"); + +var _traverse = require("./traverse"); + +var _helperWasmBytecode = _interopRequireWildcard(require("@webassemblyjs/helper-wasm-bytecode")); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + +function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function isAnonymous(ident) { + return ident.raw === ""; +} + +function getSectionMetadata(ast, name) { + var section; + (0, _traverse.traverse)(ast, { + SectionMetadata: function (_SectionMetadata) { + function SectionMetadata(_x) { + return _SectionMetadata.apply(this, arguments); + } + + SectionMetadata.toString = function () { + return _SectionMetadata.toString(); + }; + + return SectionMetadata; + }(function (_ref) { + var node = _ref.node; + + if (node.section === name) { + section = node; + } + }) + }); + return section; +} + +function getSectionMetadatas(ast, name) { + var sections = []; + (0, _traverse.traverse)(ast, { + SectionMetadata: function (_SectionMetadata2) { + function SectionMetadata(_x2) { + return _SectionMetadata2.apply(this, arguments); + } + + SectionMetadata.toString = function () { + return _SectionMetadata2.toString(); + }; + + return SectionMetadata; + }(function (_ref2) { + var node = _ref2.node; + + if (node.section === name) { + sections.push(node); + } + }) + }); + return sections; +} + +function sortSectionMetadata(m) { + if (m.metadata == null) { + console.warn("sortSectionMetadata: no metadata to sort"); + return; + } // $FlowIgnore + + + m.metadata.sections.sort(function (a, b) { + var aId = _helperWasmBytecode.default.sections[a.section]; + var bId = _helperWasmBytecode.default.sections[b.section]; + + if (typeof aId !== "number" || typeof bId !== "number") { + throw new Error("Section id not found"); + } + + return aId - bId; + }); +} + +function orderedInsertNode(m, n) { + assertHasLoc(n); + var didInsert = false; + + if (n.type === "ModuleExport") { + m.fields.push(n); + return; + } + + m.fields = m.fields.reduce(function (acc, field) { + var fieldEndCol = Infinity; + + if (field.loc != null) { + // $FlowIgnore + fieldEndCol = field.loc.end.column; + } // $FlowIgnore: assertHasLoc ensures that + + + if (didInsert === false && n.loc.start.column < fieldEndCol) { + didInsert = true; + acc.push(n); + } + + acc.push(field); + return acc; + }, []); // Handles empty modules or n is the last element + + if (didInsert === false) { + m.fields.push(n); + } +} + +function assertHasLoc(n) { + if (n.loc == null || n.loc.start == null || n.loc.end == null) { + throw new Error("Internal failure: node (".concat(JSON.stringify(n.type), ") has no location information")); + } +} + +function getEndOfSection(s) { + assertHasLoc(s.size); + return s.startOffset + s.size.value + ( // $FlowIgnore + s.size.loc.end.column - s.size.loc.start.column); +} + +function shiftLoc(node, delta) { + // $FlowIgnore + node.loc.start.column += delta; // $FlowIgnore + + node.loc.end.column += delta; +} + +function shiftSection(ast, node, delta) { + if (node.type !== "SectionMetadata") { + throw new Error("Can not shift node " + JSON.stringify(node.type)); + } + + node.startOffset += delta; + + if (_typeof(node.size.loc) === "object") { + shiftLoc(node.size, delta); + } // Custom sections doesn't have vectorOfSize + + + if (_typeof(node.vectorOfSize) === "object" && _typeof(node.vectorOfSize.loc) === "object") { + shiftLoc(node.vectorOfSize, delta); + } + + var sectionName = node.section; // shift node locations within that section + + (0, _traverse.traverse)(ast, { + Node: function Node(_ref3) { + var node = _ref3.node; + var section = (0, _helperWasmBytecode.getSectionForNode)(node); + + if (section === sectionName && _typeof(node.loc) === "object") { + shiftLoc(node, delta); + } + } + }); +} + +function signatureForOpcode(object, name) { + var opcodeName = name; + + if (object !== undefined && object !== "") { + opcodeName = object + "." + name; + } + + var sign = _signatures.signatures[opcodeName]; + + if (sign == undefined) { + // TODO: Uncomment this when br_table and others has been done + //throw new Error("Invalid opcode: "+opcodeName); + return [object, object]; + } + + return sign[0]; +} + +function getUniqueNameGenerator() { + var inc = {}; + return function () { + var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp"; + + if (!(prefix in inc)) { + inc[prefix] = 0; + } else { + inc[prefix] = inc[prefix] + 1; + } + + return prefix + "_" + inc[prefix]; + }; +} + +function getStartByteOffset(n) { + // $FlowIgnore + if (typeof n.loc === "undefined" || typeof n.loc.start === "undefined") { + throw new Error( // $FlowIgnore + "Can not get byte offset without loc informations, node: " + String(n.id)); + } + + return n.loc.start.column; +} + +function getEndByteOffset(n) { + // $FlowIgnore + if (typeof n.loc === "undefined" || typeof n.loc.end === "undefined") { + throw new Error("Can not get byte offset without loc informations, node: " + n.type); + } + + return n.loc.end.column; +} + +function getFunctionBeginingByteOffset(n) { + if (!(n.body.length > 0)) { + throw new Error('n.body.length > 0' + " error: " + (undefined || "unknown")); + } + + var _n$body = _slicedToArray(n.body, 1), + firstInstruction = _n$body[0]; + + return getStartByteOffset(firstInstruction); +} + +function getEndBlockByteOffset(n) { + // $FlowIgnore + if (!(n.instr.length > 0 || n.body.length > 0)) { + throw new Error('n.instr.length > 0 || n.body.length > 0' + " error: " + (undefined || "unknown")); + } + + var lastInstruction; + + if (n.instr) { + // $FlowIgnore + lastInstruction = n.instr[n.instr.length - 1]; + } + + if (n.body) { + // $FlowIgnore + lastInstruction = n.body[n.body.length - 1]; + } + + if (!(_typeof(lastInstruction) === "object")) { + throw new Error('typeof lastInstruction === "object"' + " error: " + (undefined || "unknown")); + } + + // $FlowIgnore + return getStartByteOffset(lastInstruction); +} + +function getStartBlockByteOffset(n) { + // $FlowIgnore + if (!(n.instr.length > 0 || n.body.length > 0)) { + throw new Error('n.instr.length > 0 || n.body.length > 0' + " error: " + (undefined || "unknown")); + } + + var fistInstruction; + + if (n.instr) { + // $FlowIgnore + var _n$instr = _slicedToArray(n.instr, 1); + + fistInstruction = _n$instr[0]; + } + + if (n.body) { + // $FlowIgnore + var _n$body2 = _slicedToArray(n.body, 1); + + fistInstruction = _n$body2[0]; + } + + if (!(_typeof(fistInstruction) === "object")) { + throw new Error('typeof fistInstruction === "object"' + " error: " + (undefined || "unknown")); + } + + // $FlowIgnore + return getStartByteOffset(fistInstruction); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ast/package.json b/node_modules/@webassemblyjs/ast/package.json new file mode 100644 index 0000000..b6d426c --- /dev/null +++ b/node_modules/@webassemblyjs/ast/package.json @@ -0,0 +1,73 @@ +{ + "_from": "@webassemblyjs/ast@1.8.5", + "_id": "@webassemblyjs/ast@1.8.5", + "_inBundle": false, + "_integrity": "sha512-aJMfngIZ65+t71C3y2nBBg5FFG0Okt9m0XEgWZ7Ywgn1oMAT8cNwx00Uv1cQyHtidq0Xn94R4TAywO+LCQ+ZAQ==", + "_location": "/@webassemblyjs/ast", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/ast@1.8.5", + "name": "@webassemblyjs/ast", + "escapedName": "@webassemblyjs%2fast", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/helper-module-context", + "/@webassemblyjs/helper-wasm-section", + "/@webassemblyjs/wasm-edit", + "/@webassemblyjs/wasm-gen", + "/@webassemblyjs/wasm-opt", + "/@webassemblyjs/wasm-parser", + "/@webassemblyjs/wast-parser", + "/@webassemblyjs/wast-printer", + "/webpack" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", + "_shasum": "51b1c5fe6576a34953bf4b253df9f0d490d9e359", + "_spec": "@webassemblyjs/ast@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/webpack", + "author": { + "name": "Sven Sauleau" + }, + "bugs": { + "url": "https://github.com/xtuc/webassemblyjs/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@webassemblyjs/helper-module-context": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/wast-parser": "1.8.5" + }, + "deprecated": false, + "description": "AST utils for webassemblyjs", + "devDependencies": { + "@webassemblyjs/helper-test-framework": "1.8.5", + "array.prototype.flatmap": "^1.2.1", + "dump-exports": "^0.1.0", + "mamacro": "^0.0.3" + }, + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "homepage": "https://github.com/xtuc/webassemblyjs#readme", + "keywords": [ + "webassembly", + "javascript", + "ast" + ], + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/ast", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/xtuc/webassemblyjs.git" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/ast/scripts/generateNodeUtils.js b/node_modules/@webassemblyjs/ast/scripts/generateNodeUtils.js new file mode 100644 index 0000000..46178a9 --- /dev/null +++ b/node_modules/@webassemblyjs/ast/scripts/generateNodeUtils.js @@ -0,0 +1,219 @@ +const definitions = require("../src/definitions"); +const flatMap = require("array.prototype.flatmap"); +const { + typeSignature, + iterateProps, + mapProps, + filterProps, + unique +} = require("./util"); + +const stdout = process.stdout; + +const jsTypes = ["string", "number", "boolean"]; + +const quote = value => `"${value}"`; + +function params(fields) { + const optionalDefault = field => (field.default ? ` = ${field.default}` : ""); + return mapProps(fields) + .map(field => `${typeSignature(field)}${optionalDefault(field)}`) + .join(","); +} + +function assertParamType({ assertNodeType, array, name, type }) { + if (array) { + // TODO - assert contents of array? + return `assert(typeof ${name} === "object" && typeof ${name}.length !== "undefined")\n`; + } else { + if (jsTypes.includes(type)) { + return `assert( + typeof ${name} === "${type}", + "Argument ${name} must be of type ${type}, given: " + typeof ${name} + )`; + } + + if (assertNodeType === true) { + return `assert( + ${name}.type === "${type}", + "Argument ${name} must be of type ${type}, given: " + ${name}.type + )`; + } + + return ""; + } +} + +function assertParam(meta) { + const paramAssertion = assertParamType(meta); + + if (paramAssertion === "") { + return ""; + } + + if (meta.maybe || meta.optional) { + return ` + if (${meta.name} !== null && ${meta.name} !== undefined) { + ${paramAssertion}; + } + `; + } else { + return paramAssertion; + } +} + +function assertParams(fields) { + return mapProps(fields) + .map(assertParam) + .join("\n"); +} + +function buildObject(typeDef) { + const optionalField = meta => { + if (meta.array) { + // omit optional array properties if the constructor function was supplied + // with an empty array + return ` + if (typeof ${meta.name} !== "undefined" && ${meta.name}.length > 0) { + node.${meta.name} = ${meta.name}; + } + `; + } else if (meta.type === "Object") { + // omit optional object properties if they have no keys + return ` + if (typeof ${meta.name} !== "undefined" && Object.keys(${ + meta.name + }).length !== 0) { + node.${meta.name} = ${meta.name}; + } + `; + } else if (meta.type === "boolean") { + // omit optional boolean properties if they are not true + return ` + if (${meta.name} === true) { + node.${meta.name} = true; + } + `; + } else { + return ` + if (typeof ${meta.name} !== "undefined") { + node.${meta.name} = ${meta.name}; + } + `; + } + }; + + const fields = mapProps(typeDef.fields) + .filter(f => !f.optional && !f.constant) + .map(f => f.name); + + const constants = mapProps(typeDef.fields) + .filter(f => f.constant) + .map(f => `${f.name}: "${f.value}"`); + + return ` + const node: ${typeDef.flowTypeName || typeDef.name} = { + type: "${typeDef.name}", + ${constants.concat(fields).join(",")} + } + + ${mapProps(typeDef.fields) + .filter(f => f.optional) + .map(optionalField) + .join("")} + `; +} + +function lowerCamelCase(name) { + return name.substring(0, 1).toLowerCase() + name.substring(1); +} + +function generate() { + stdout.write(` + // @flow + + // THIS FILE IS AUTOGENERATED + // see scripts/generateNodeUtils.js + + import { assert } from "mamacro"; + + function isTypeOf(t: string) { + return (n: Node) => n.type === t; + } + + function assertTypeOf(t: string) { + return (n: Node) => assert(n.type === t); + } + `); + + // Node builders + iterateProps(definitions, typeDefinition => { + stdout.write(` + export function ${lowerCamelCase(typeDefinition.name)} ( + ${params(filterProps(typeDefinition.fields, f => !f.constant))} + ): ${typeDefinition.name} { + + ${assertParams(filterProps(typeDefinition.fields, f => !f.constant))} + ${buildObject(typeDefinition)} + + return node; + } + `); + }); + + // Node testers + iterateProps(definitions, typeDefinition => { + stdout.write(` + export const is${typeDefinition.name} = + isTypeOf("${typeDefinition.name}"); + `); + }); + + // Node union type testers + const unionTypes = unique( + flatMap(mapProps(definitions).filter(d => d.unionType), d => d.unionType) + ); + unionTypes.forEach(unionType => { + stdout.write( + ` + export const is${unionType} = (node: Node) => ` + + mapProps(definitions) + .filter(d => d.unionType && d.unionType.includes(unionType)) + .map(d => `is${d.name}(node) `) + .join("||") + + ";\n\n" + ); + }); + + // Node assertion + iterateProps(definitions, typeDefinition => { + stdout.write(` + export const assert${typeDefinition.name} = + assertTypeOf("${typeDefinition.name}"); + `); + }); + + // a map from node type to its set of union types + stdout.write( + ` + export const unionTypesMap = {` + + mapProps(definitions) + .filter(d => d.unionType) + .map(t => `"${t.name}": [${t.unionType.map(quote).join(",")}]\n`) + + `}; + ` + ); + + // an array of all node and union types + stdout.write( + ` + export const nodeAndUnionTypes = [` + + mapProps(definitions) + .map(t => `"${t.name}"`) + .concat(unionTypes.map(quote)) + .join(",") + + `];` + ); +} + +generate(); diff --git a/node_modules/@webassemblyjs/ast/scripts/generateTypeDefinitions.js b/node_modules/@webassemblyjs/ast/scripts/generateTypeDefinitions.js new file mode 100644 index 0000000..99ba0ae --- /dev/null +++ b/node_modules/@webassemblyjs/ast/scripts/generateTypeDefinitions.js @@ -0,0 +1,47 @@ +const definitions = require("../src/definitions"); +const flatMap = require("array.prototype.flatmap"); +const { typeSignature, mapProps, iterateProps, unique } = require("./util"); + +const stdout = process.stdout; + +function params(fields) { + return mapProps(fields) + .map(typeSignature) + .join(","); +} + +function generate() { + stdout.write(` + // @flow + /* eslint no-unused-vars: off */ + + // THIS FILE IS AUTOGENERATED + // see scripts/generateTypeDefinitions.js + `); + + // generate union types + const unionTypes = unique( + flatMap(mapProps(definitions).filter(d => d.unionType), d => d.unionType) + ); + unionTypes.forEach(unionType => { + stdout.write( + `type ${unionType} = ` + + mapProps(definitions) + .filter(d => d.unionType && d.unionType.includes(unionType)) + .map(d => d.name) + .join("|") + + ";\n\n" + ); + }); + + // generate the type definitions + iterateProps(definitions, typeDef => { + stdout.write(`type ${typeDef.name} = { + ...BaseNode, + type: "${typeDef.name}", + ${params(typeDef.fields)} + };\n\n`); + }); +} + +generate(); diff --git a/node_modules/@webassemblyjs/ast/scripts/util.js b/node_modules/@webassemblyjs/ast/scripts/util.js new file mode 100644 index 0000000..c2ccfa0 --- /dev/null +++ b/node_modules/@webassemblyjs/ast/scripts/util.js @@ -0,0 +1,38 @@ +function iterateProps(obj, iterator) { + Object.keys(obj).forEach(key => iterator({ ...obj[key], name: key })); +} + +function mapProps(obj) { + return Object.keys(obj).map(key => ({ ...obj[key], name: key })); +} + +function filterProps(obj, filter) { + const ret = {}; + Object.keys(obj).forEach(key => { + if (filter(obj[key])) { + ret[key] = obj[key]; + } + }); + return ret; +} + +function typeSignature(meta) { + const type = meta.array ? `Array<${meta.type}>` : meta.type; + if (meta.optional) { + return `${meta.name}?: ${type}`; + } else if (meta.maybe) { + return `${meta.name}: ?${type}`; + } else { + return `${meta.name}: ${type}`; + } +} + +const unique = items => Array.from(new Set(items)); + +module.exports = { + iterateProps, + mapProps, + filterProps, + typeSignature, + unique +}; diff --git a/node_modules/@webassemblyjs/ast/webassemblyjs-ast-1.7.10.tgz b/node_modules/@webassemblyjs/ast/webassemblyjs-ast-1.7.10.tgz new file mode 100644 index 0000000000000000000000000000000000000000..82c5a86cda9d0d512b8a53c74765723b60510c33 GIT binary patch literal 30081 zcma&NQ*bU!v}haKw(Vrawr$%^R&3k0ZQEI~ZQC}!^Y4A{c|Tn>t6#cizjW2?9&VLnYg%6ZNWtydyX3eH2G|3dHfI@`}6{*nb79SWd#M*pA{Urp}%pM$Yf3L5v zxBLA$pi86YZg=YYq<`%IyFa-*J6~_^U^(y3cfWP--4|gY{Lx)fv)2mTZGbyL>Lu=^?xIweR%&?HHI@_Qu_>g9re{G<@UHN=%%3`_xdEGPfV!_mcdSEpB&Xxm<>`=*1OEr zu>=-iong1U;EVxGWla{^#KUK7qpV5`%*ij7x2=Tx=Muw>aL7m_*1?o?>dJsH#@b_UdX>HZB zxrQm5As$W|khPt%W>U zkxMnuWtZ~jm3(z`1EeW>W`29q`~677_6s_G``TQ2s?R*(q=l2!Cr{N(&N?JT)1WUp zvdEUHrIDYoVjGmLh_TCNu}DQ{i%xqMT9BQ1lK%75*Cn%J!Ekke9zRtssGPF;o2#A) zlt(74n{vd9{+=Yor9a(VBxN)sRrWzwo$U8F6S}ib`Wd1rNh)o&?U5vqH#b!mHc*2h zs|01SY;r8XB;$C*qb)-a*X5Ni|EvmviUC^L0lFkw`x$7HOEzSFuKb=Oc}MxtDMQv- z(6`T0)R^9kM9~fEXB{KjICsWe2P7CNGV;3GE;l5w%m7#jSF8v}xsGv)>rP7FK@L-m zxN6!oQ;J%W!seR`mm>jWf61Ahw!YBD*eUCHzWCG7<|=hudTxp%^BOkJU5UM@avcmS zfR?9crKwh8U`}uOL7;|i5 zV(R!K+5*7o>G6%k3iZ&;I<`#94r%IEQWd=C#Nm+z79ML8?vLznR**U%^Qd8G-4!mLa@$Oyh3 zzmEjpjm#B0C=lfLeBK?b7AI>c0G}0GFeVire=J06P$K$y_&k$%{tic<&FK?FUlPK! zDEzmh7qK;$pY!+gisUlQV$zX+1mVQgT|9w6SXEn`A5yJ9@Qn-sulMgBqkP}juiE2J z^B7{h*kSuvk(tCEKmTZzXgL8dKes1~ECB%@*XONfnioYw&pHT`t={9&+gJkF3w|Vk zpoiP@6|L)Ge`865@!wqG`AM`!*?BxAV|@6;LUeMvV1fi=9v`+nFqc@Q1xh5<+cQ=p zP$eom2?&@U;Qn!)=)dHId>9@2!bays5ClIDm;?R~@%jJ*JVHJnXWlFYenI@&E5Pk7 z!7UVaJBkaS#_T@ouk*^$K4Af-%SmYb$(MD6yIv~fypn@kX_ zo?TQ4#sUWn9r?kt=@!jW@LfvD@{1Js-)I3oMJ!*g6ieVe5S}z`frn?Z&wdpBkjR2@ zLXQ-=^em7uMMnVz&vH%e2tAc^;Az;DibHJ=WC8oUjEk42k>vkAYIxlZ{q$1g#03R) z=os*b#8A>jfpXPnnlD;r!G_m91jLSZBYK*=*nO$}Jn?Djp)}qsEEc*cxIX zxFc-KHRYoOQ9}Y!BQ&c#=T#3s< z1vyctX-<>2G)j(+bdSrLiFnYWKRnf`BP5Iu`y}gMpfoO8CAtp}sp*j+b7v=8oC=~; zZ|Ta2-)+-ozT~|4Q5{QhWX4}AKZ`LT1G+3dcco%jd%|DrmmFcAm#a{__M#yg6cZ}#{{w;+UbpF*HZ@mleL=YcS8;vW0=v7cNfBl*R^?Znwx|M6t9I;mDz-k$d?v%8^#y!@dj-G$BZF+=rj z^HS0`eMoefM{7*j(!=*Jcn9b`B1Kp3w1%#=Hy>KirqtK0q(HllEMB*WJXmA$%RHf6 z&9EJfq-wfOX$zbq6>_2w#MrkX266!Xhy9t*WaskIpH(UUxS?r$3DPm)lIZvaP=@lL z&OA-$>Um`X$-<&Nn{7}nux2mp!f6XZXtE=Q0&tO730C;|6~&_t~%H-OWv zL_N<9czb=lz3F=LzpL(5`1L0|0ZmSe>CRgeCm8RM-TV>6^`W6B7_A^a}c~Nho5r4sVp=f=C|&OD>J&uE)K&O`x!>BaoTH^zBQ04kh55 zqqy`SQ<|j?!2Nf|YX?EPu`5PA5U2<_VTDNMq~OJG%q&;wQ`ApB!Q0D)IUrm<8Ael? zIO1)IemC(?XZpx8Nz`i<9CoV8N{KJ8&5_zyU`eZich8wd_H=vZ3=%ZbXCV?Ut3&Ve z$QFl7?R;UW>35_W>Ly-`?^V|3M_Rp<)@B-}CDmMEYZ^%g+y)-SsQHCNtYl{m^xxmS zHVCiNNW?{MZ|n74(b)ie7_cwV8R}{m3p*|li)=mf9cMq{vb^|3XW32JExpX9uJgxH z?Lx3$mn^$kziuY990YI2>8yVP7tBrc?Bb-bEz%`68vG$Euo;&Ui*x1sn_TCeQ<4Sp zB2zbvZ4qn*yPwA1Q<+uMF_@)yOczprzs40%-3?Z9=bt+ouY_XO zriP}rpFQX$P*vxULW${gGqIA(!D`4fuxk_c_oCF+If<$hd-$jqjR{JukcfggvYiWq zF1l%Nzf-x`g5X5xRC3;ocM@h8JyBm(I5k7bJvC+QjL&?>|95Tg{KGZWAK=J$TKwJ5 zaHn&Y@Mab4MC&=H)$$|O^in`KsK5 za;1{0U%y~~CwV;FzN6k5__}nIwHIT>sR zndrr4;E1PY?OI5j+tx+gkSc+p`^IZeF2~tnp{Y$Ru%}}HF*td#GAriV;CJ@!C_-x* z{dv+D;1=}c>gXG_TJ;qy{EIv~L6Fv#G)^EX4kp@AUP!*u_2Rj&Agf-TVoupXID9G? zA0i;`i>R@EjVvIZU$()U-!fH39t2fWPtd?6p*O2j{rs;>(~Av7Jht85m3iu93TCUi zVL9;RfR6&@0rv%p$caz~s824%uQ&wh9F)XbOgE5VLgaU5-dGZMug|iz?nLpC+Vby;slzrg$K;_T*woZZ+$}PsF)Ox!p)=vkAKTxbKvSVKD_QTj0d~CeqN6~O$Za>GLcCOVmHC`D9*jnDXe|s6`7M<3M zRbIn?I!}AY%MjSIFN0MUZ#mU>0$r2l0{k*b+I2hV^vX4uiE8)=^fW@x-vA;qKbTw7=Hwh+9;y~?{Ku9(^qv0`uV2F13 z-G{bnwL8LRUg!*~fdq}AtpAtom#}3&ANo@ne09?SR?TG+1Z;4j3>>P9(fL&!d_xdf zHgsVOlyxI}3}bSi$bO)jmI^Q}v}=JfN;0Nhpt&?pQexY_gxiLCn`SY~;LVj<+Ft*b zekP&0s6xvNO%B5qKCF6CId5&Wymg*^x%*k$fx+O}(wDod$ViCP;9{dTZ7AnwL9J>w zl0wM6A*Z@|K>J1**vN$qJ$VeGHr5ltSkGFRCnD3Z9D<0-1}b*Szm)r^~(e#D*0@I`9(&i5~-czJW%Hdza$x~60QOl;4 ze`v=Xn;}X`O!4;#UFkGr5%vl9g)9x3g*_e^tsIbX@Jf9}dXaR+)RkiXY3RbFp>uF| z!(SG6>Y_JO&E;xl*6%3=78T-Ku1FEOQ*vzY5t$sffwn=C0 z_k)0ggoqWj)l_V;-ltmp-1KzA7q1{oKHGa9#CTYGE zoXb^=9lpkuW_iw|F?gPNt-lQM()c)y^$ocmnzO%d%mSu|D_->H{e@m0vigl3!(Rhx)=_*p8(3TDa57d7K%vEL>Rp%HBCPSqa(ary(n2O7aX#)Ol))ZlGxBG*fY`b?Qw+RsQJLZv^C` z!4dey2x?2oRXUV<9^8JFDgjX@S|;0K3n>{0Iezii9?DD-51Uf5+a*9GO}qv7^v-!~ zolN^qWhx=;Axf?9eKZ(@>APzp@*Rw?qP4zeIxFbOEBdBGHW&AdCWQ6e2aNk_G(a|P zs$Z76XAQ$=A#ou4ea74;pHi7K!7K|*m^-FZEOLpd3UYIc%tu<{bxa{6_xp&ts^Ma3#aX`~$4P;+B+w@fCc<|y-)2xSC>y9pq{d5! zpZLs6gRYMfGYq4&*zw!k`)KQ4lALw=K$0#go(jeGRN*#<4f<+o;dx~qf~ya41%Ns7 z|LOFF<&?$xLz9|*zI7ixfY>4_z&PS;tyJZKA4$iDVzcYS-A5(@son4(YC_&BuKSpR z%-W5(ILp2;>Cg6!K*Mh`s+Pu%?Z|b(bydsJgHx-(Y|9NFW8ZHxMva1%`#s-@g@q5m zStCI~&;2d>prPabDD>es)pRL^-BTvn`7|e%iSFar)v#_|{Hk+@%LFp!VZ`q7!=k8* zaaR~Sldkj1r9;2{^>0q}zhCMC^!o#T?f1X^@0NZ6#Xi@+gz+JtCm(ZO{j~^@`n%I} zQ`iK^R`&#!pLG6Y^p;3iKnfM6#tJy7XxnR2H7vd05}b)t?FU{`=W&AHkDKV0?LfFv zW4uh3)ey9X)2UfemuZdc5j)Yhsq38{b}Qnbi%eF;NJF3=Ow(w1P zn}-diJlg#hE_GVLldM(thD_jwsQFGLiH6WnMO;A=IyPB`M-Ht(aMtj^ zLVnQ#oxbFieaUcOb_fODbFxv}-c(58XE<`N2RRhlUX0t7(Y^J~l-;r{v3l9(YdJ(; z)50IV2S(=^3?8Vp?SmKHuZSQVs{l*eKlc8M?Bz@%bqznyC)oqepE{D(@7Gc|mk;%=$+t|6hYiS#XpfstVXKu(H{i0-P))%;YW>%R{kI^mknNYn$Rh8OZtCK?}qtxC}Ju;xN3RHQ}j$Cy!Ck#P`5d$--~f98(zUz$|JO` zg_U)3<+@tjl5vl>tX#C;n{kdrcWi(dw!|BM8*Ivk z%^kDZMXRGjLZIfdR=mGUjOO=NV)&|G+mgYEROE_!tmYuQdXbsBCbMK?>KZJgJ;RPm zCSN)MEXsRY63Sn*0c|N&T_;TQ(>flT``Ia+3=U3<9?Kr{ zT|-q}3~AsC3Kh!`9bt)5%Bcb9M};wD?c0tUg^CQi-(1PV062Lw2@+6*%qwRUugm%v z_h6rrLs)NROp*7Yeqs~Ywzd_)YQaAB2I8&AUS%Yv-1%nrDY+D)?F8XF%8Wa`8LGRN zPba~5!A7cK!P71{P_wmx?lR_exA9lrO?ucS`!l+*)+>*@xFn<485#J-*OE1;)mo$E zC4U?((Z|Y9F=N#&Pa|ih#PAuVX0ft`gn84~f{4bzyqUGSOTGQb2Z6pH@~XlIpp`2e zo)0_eM>rSSlP>FSzr+>lwW5PM!_Fj*I(2N9c0rwCV7E}<^kY4zj@*Jx0^ z8tLwK9Ubibc==&L$H$rZM7?k|GP*?&c9JE5C0i6VSJgTSVg#1^J72q@0vs?WR_}?3dQ0OX)1kyL?%xzy#hI@HdZ~!_fBP zL8Z3oEJYEK-$aZ+&^=4=Fk>Pi(rY{8(IKLmr4_FP%x6Z*WD)8DDzmp9TMJoQCAw38 zds?m6_F-9L-xn&HKI9WbtF;d$u*y9&7@kvR5olEUKj*SM#sq(E9sO;0n9t*X+#}vK2&TpxpIT9>~gx_0@+JXn-g7fu|Eo*?wQO}csX0LS(sOR=s z+@u!kF1P@%N<+P@t%N&v=>T8Sf?n%SkHECFj8dfu)z9OApIx;X(>eI>3wQI|E0`<$ znc0bKXn(Jw2S}1t@=V@UVh67E6SN`Kwz-h-*PP&92%!ZrGq%1$AV3|f#h2TqG3tUO z0e{!{Q8d44oxfwE1m-tJ53Vlu3n?Z`Y@dNp#gU@tjv0vhHoqr{aYf!A!7juZP&gMb zq#>_=)rPlDL*g(kUfts)yR6CJ8+64TIxRFih;6|}kuu+M^u#1Jg}|$CY-}@H^q^7(6S6CGH4p+kRcU1!?jSEmxx;W*P=hobUt zie+*jRQKo@+H?yu-_SccwIBMCZm`onrDaDX?P>A#ern*D)-Q%pIARtgO=~>I`Kg>C zyf+K&^_eaiV!zGQR4U`qRA76TsL|~8d$S$>c}{C{-L}>-rJ7fBPsUL36(OfS`ZeZx zuCOh$uiG42Z5ig^9#_1We1^2WzdQETU=@alI-ePC?ylhLYM&VpJK8*S+m}xGDNy(J zaqpBZP&QSf_3=VyKvh?d*6Mlu{K3V!AVF?CV3C(98NGEV@uh1+Kf7)`OJ|ZdH2ynv zm4{bGd;1KbyzykoFH;iM=Vn=+Gm^d+RMB`Fa52X|j0_PWnP&J%Byt&WiQuN+g6F0j(+=D(ucQbT-ZzOEc-u+cBo()3~9D8xE_k!R}~ zTeVHQt?Tc_GKt5JLCEbTcZFcVJw8;dI+Q~)Zk@S?lG8nqwDwc+BT2+`ej;r%Q@5jJ z8`)lXeBhZZXP_sd?|%m2?P#5h<1h=}A@$K^ciLXSwg03=h|iVlkc+4n#)uGy|A(r*7pSo zeX54I=*vraJ710qd1sDUkPtaVoa6C0yh!2+#KKA$gu#w$x$9ukNi0MIi=M$MYkgWO z1Rf2k&Oqbp;27>M)Y6~wnFG4+CnLrRT8-wi<45a;&kEVzz&aV&V|h(NbT&7}n}%*F zICNLH?!X-1y-DgZwO3AOIAA;?DEY*n$=R*d$w0_Uo}(9i_XM3{CXsQntF7L-=oaB8 z;HiOG_jC@dDD;M{xV6fxnwnvrtl#+@lgN{`hFC!+Rzqi=_cX09_pGH`HEx7gU6Y3d@u;C4p= zZo$E)z^vRICU>|5NI}?y9)%Ua!m({OA&y~PGf0JGU>xF{C?xg?f&<}&mH14u^M2x= zSOoB9C61#+h82pBy12A>*aR$^nw>KmVg{yT@R%;>%%jospUA9+^NZUN$im1Rrtcow zN+DcQ*lc(ZFj(wp@u){(!)M5#kiuG|kc{Z;E>s_avG{Si5!k#??(K4C%>ORb{}CB`@{gY*JQs~WP=9?&d6mlNZ#dew(h z$T6N2@>W&ceaXEE555B*_DR_>rnEFF~o(%C`otNC$}zRNmD;@#fd>+dVsCT#}2XIixN{ z^^szpOG-7N5M8XpTscx`@p;aQ#9uXV=e@$*wYM+FU1`%sH2bv{lgg-BVkDze<=sqE zXbR?RSj?4LHE9FkxiKB~+EwTg@7m3BD|e>~ktlbz#v~5*4Lsq#Z*HIr^M6!id>fKA zAoZ7@o?rsl!X2-FHJRQF$!s__8&G-Kk!DztXqH6zo)7aq8{2v;We4Yl?deePfl2Tj z1`$J$pyUim!0)}kepCOx@wfKv*xqesUB$hw8tiZ8dSB3ZbWZdZnlP9$<$E4p&g6QF zAd~_FhB5B`oQ{?7$t1l-9@o0`OJ z0m|*38njAC22KREuq=6q>|n>tGDUGvYswVs)EhO4}LuDO8z(w1RY_YlGW4e9hAEH&HW( zl26$!g9?lUwK{+r8B&F5iCq<^43uD}q(66MO52PG6Q9`q&Rv{FFx^l@q+LRB(wQqfCz}ll`X_b@}#3-p)aytdRS^ z{8D(fJr(;S=gpm)m|cq(MKtxnnO=366@4QV-9B=w%lYA&o50A!GvdCNMwujOm4hrV z4YJ5nDG&0mR{}cPB*2!xOwb_cT95@=B3S+CwhO@5MYwIz_UqtY_0$Q5mx%#S8hDngEKzR4Sk2;vRJh`SyKX_o)0-e_u9s!QHBQb<=60YutB{(yi+{J+4FpnY z55;%}IHxRbke0Nh&auIexjmTmR})$$wOg$+9{SZ~h|YTorz(TPr?WZHaygu+m zhX+N*1Ykx+|2N{I&0gNpug7^f*1(v0 zz~JJ_t~}x}Sep>04%sysP$^uMI*ju^jQ=TMCkb{x2tZ+9_@h|o@>nLg1x?I76IB%3 zP8tkEmJMe{^W6XNlxn5~DK~m-n-ueTizQ|9@$?<8RFGJ=%du9?3N+Lrb05R=6k2Jf zqA9BDs%o@Y1WFb~0@53S!0idOAph3z?VuB-p zhXYM}Ga47>c%PA118@?0{cfpRDJe`@_wh}@JW%GI0H$vP)&_EEvdz`hWBxGX4)hw9 zf*!6u?dAS_8FZfYdv|xgxe4U{Pghx1)6t=}$pF(c^~Jk*q3vA(!P$W*UhM#m9eIn~ zk28WexrN>*2SX~2BV8-i&@h^;)mboLR&kS+wb2PJ63`=*|dBGgbMh#9m5khm)8dk zb224!aybTyVgguk?)rac!N@<5vH_f{vY`j#c?wnwMC2aCuVmQLW(twLp7y$&jSIt} zLnHn<-V45bH&zivxlwin8x5X^mfYM(VJC7(kkizvdteOa!C?!~Xy>XlDXPLt0FtEU+N+I?M>K1_xZJE$NVxR_Oa_A7* zWqM^+4(7m|w)w0bEWutuBp%jRK5(Fqm~Q6UHV*J9Fva;e=o5} z@$h>Ea;e^l9L@!Y6WUQrTp1i{`wDl;><N5X<+=>fS&qM^cfcK|=OL*!GKvb8o^_a5xb zMm)QVzX`nBbW;fMWJ7C2NUrz0{C(40I9kCV)_P`u5neB ziiN5E8>GlW%>mQFVwUmz5EM>CGbA7J9*L*Pc! zx+o_qws;|DeX|Qj!9<-#TFcRNDS>L5NGoG*avq{2VA*FONtJUTHxX-!BIp1!?M~ILWBy?vg zpzdTrsz=LDN7%590LSi?9zjrz%{3`v$$W*R7OSQYwPaTE9&uu9ER6Ufy4&%p19hqj z%Sy#4FO=$Y`#4Ody$cTv5p;jUabb4250jnvD(7F4UIGg3H6ZTjmXI4HM0)4#W?rgj zaYxh?@pj*J+>0cDQ*Q3?N!Q26_34?{7fZHY48-_w<|Fs7rcvb9$w2f73J4V^Ab1Xclh-E4fnKqWZyHa`v8=#FCQrGkv-46=_ao zxJ|kZe>Xjc7;iyJ7OdkL4cGKnrq+9k6>uQ~xf6i!9I(%wH)=>NaJ$KzH)^C+f{CI#F2QDxZbuXzdR( z+Tg9nesk!w?I6e{*9XI@=D$VWL$Q?a(j<}(oZVJ_9y)g*ZvzPi9q^SWMQtFU4XCu) z{YhgOBO?|8&hE`C?6>e#Hd^~8z?0BM0Uk1Ka$~Q?x>tS*mPk@T%-BYAbq)HWVac>5SC-7w_90p zB2h4v7R)mws%dU_7x}Ai?v_dkwXK!sc#q*p0_^Kal3sWQTu73H-j0oA&huZ}6Lu$q zkqIF{b7NFXFMHXJB9L_`QIYthgyYTHiv=$=-GFg|!`;TK4vgo|Kz{jqTTrp7j%k8` ztlP?Gp})J+RoHq!Zgt!tQo&?8a zTV9!J+afh$vD96|0qq-Ucd-lEjgJ5PWM`#`(+5tOgzgdUX->hIOO}N=)k4}C48YWB za8%imLPY5w5JsO?S!nQvkh3>+i_d1xwYv}7IaU}I)*3ZK*v5m3KOrqqcar=|)SGFS zf=|9T!54%**mj!|)p7IO)C~yUP)=>8&eLi&ZF^Z8)OKA>pC%sP6=74Q{d9HQ&7YpF zF~M(p!NG4n7`u0qL*C2;quotRNPn)Kn7JuFB%sf=dqrRSq)@VcNkVQ;UURoBu# z-ch2CE!DBPnoB3mt&;mER8xXOV}RT&)_P5+U(_wePqN^zqLB2F9@)LJjH=;tteCJ$ zaG|FzNu)sN0gqF4Gwd@73N42pAtmhNA|J5M2sw>1@| zep|X_u^K3sLEPh7KogK@(_O;L)yKE?rVR$hlAKm8x6H;Pydi{fF`Q&JH6-M>c zHASbqMSp<}UJk+_5bGjgU82<^7gJ8?1TB*wbf;(DkWswq`lLaKHiwvo@V&ICn8+pU zgqb#_70Dj$7cH;1PpaC?Ohm?S!D(NUB|N;j%~^H!<77@Ni$!w}Rnz5I+Tr97C6cD6 zIp5lJmPkpLu&5ee<-XwD9K{A5Y7rw*BdMfO22dro#Ev3)zKadAK!PRJ6rAMB;<2_t zTJ**-`Bg+wbX)lDbd}d*FHd3gCfZ#k zPrH$6C5IaR3O75Iz=7K35eE!F$ayli-SR+iY&8AD_Hj8R;%!whSs_NP)k}0^t6s*? zdv(NBl4v<_WbDmI!@2t*e`6*v2dGfiFb^VXSh8Q&TULJ;6;^~9!FbwvaFENUVT(TD9sgMOUYL9SVd>JW3;94HO*|j$ zg_J|#M~nq5aT~nHx6yc>+5#(l?am0=8NW?bKmMwC8Uq}MjXtR@)`9%wA`y{gRStMU zN9lS}wEv-tO(`*PTvkU`N%{R(>yd(KWH8;5MUa}DWmv)7BbmT^XoRl8ykffTjhK(9 zkH2|yH++_ELYkj!A?Y1f9H~h%o5YJTr9R6%Uc*JQhrC(bZGA zKuFv#v4AWfoOqXC;mW6Hf&M?UBL1=o7vS_(t?&sLdw)M-bba0P`M%o)u>KMr9mNAq zYk{ic0l&W*`QQBlli_iIq6rIJgdbXgn_ocpm%+~8F+v7#9~?mZ!^bfI5cmU#-H3U& z*8NOf23dyr6zMTu>7EH6r<$EZuYk5iQcAh*T+XS zb!4VTcQHC3JfuGonW>hpapLhk2K5da>X`1Dq|UZ`R9MovWODIAf1G7wg9q1Pv?ymtrrirKZ4^rpy0kJRL2nb2I*o8HGAo zHhiqxE|vwPKwj{5vdLM5N2W|0LCIYxsmq2`vFJ>{2t~Vx$VHCjTG-k^k@u^&fXS67 zsEr?Ss7XEEwUD>XxKN#AClnx1HXgzz$EEO?PP3$~DcFZ28R!te`{iRKXIipt+jcAE zLALH^fVIG!JgadC<4y}ESyMo{RN1{dfXZGlzhM%TG3sbpQGor5HtD>nQ3|Hgq0%>!m8mwbZrsbS8tuJG)rWtk%E968|M!aWLsv?3mpHg5tKz)oYG5qfiOSAZmw67VDq%m=0^4zFn1q-NV{7ggVM2UO;ux905O% zq#xDj<%$9J*2O0a?X(Kdxg&^Coi%mZ+@D0~_EYqzfbB8wt@V`PlDASjGy@C;Hu8r% znNwDFZiR{g` zkdmA7VS#tcuRA({J%TwfN`Kq0yV=>_-g@4zyPbOe4S#{j@^&N@xMze$`H0FYT`5O- z0SyEfUo_6vdGWc~rcGX-$U`y9Fi2;W23H$>sXB?I^ksbUr=J9m!%Wdy5AUixUH)d9 z1v2s;(X2=(kU~O~BgQzx@_xxRw}&zGybOTV=ocY3;H2Wra`@fyKgi(ijdZod1^BT( zTlxl25n5R`9@SakL^eVt0r6UuI6uh9;s+7Ec{;y`%H$4Pq zjs8c!pTnlgI;#-d+9$aFoeNu@Mn5U(+lvI=G$J8yojq#p+Lp-mdr5G5Kp;bXHaGB9_WW!p3xpH$2xGJFC5ILpQegn5zSHdUr9sAZ8Q8hxu3_-z<%Ml^w#)4&=4TA z4tkk?x?a3hn5uPg$7{Kl)oO3-wKk|WtP&x!>(sv@=bAe337W0hTN$25-p#bjBfLyJ zQaD3gD-x|!o`pWn?r7=6<;+b!F*MtA_1}*z3;0YiTm7+nGw?G|bMZ9!S=4sRF~=P? zzzhS4&Vw8)-cxq8mTMkKAqLYXUo>J1CYR|gufbrlOTCQ7_tV~n^SWh0saTqK{)(o@ z;dY0ut9z={)_<^A8GerC8}18ncy83*I=@n7d+@$b`17AtF4hIhm^4n-!V5tpk#QpV z8wl)zCqzYhLT6zqorO`CW@y)Ps<2frc>i7_TCMTFQhCSLb|^&2O$%oRDy0ORgbk`= z@wW7cmBj4N09>|$mPB@qJ;C3!)}N}XP!;dTaMV40htcsq_M7VS@Q>5ZzFU?R?9!w0=r zI&aD2MY1=Gku#2_wQC+Iw|6N?gf^b817yD>AU9bVpuQLq>>XB`N@Ml8%L1h?U+>0H z75p;XpKU;_v&!Hayp6b7>c=f$ubPn&&!6qb7-igzX5ApE4K}^>>X`;2 zq;;(LstRf6VP(wWL0D=$N?>jga3L>KBLI%2f>d`V@O@KodnuK_x2-k5BNa?oD}=8 z-vFZLP^CRC&PqsnLWj<^KY-Tk34%rN+fNdM25rX6v~JC`vc>N18mrFD1eD=Br%y{*z{tEnhjBVIP>3Qr z5lo+AyxUJ>hf90V50OXAw16RvJ(@(c-3M+5GP3DD^LTZgKJ~@xD{*_p4l;lldZ$>nYBy++BKHT)>-Q(~V&@NPVR zBSx)Y@xV||AO(0s9aFKct05@-qobPxf|?NfJW7;3`D`K1oOwr>v2LJAL|iMhI`O%> z?LTt}(PC|*o5sx}h)c?K^~3Ohx-RTCC?b84M_h7GRFPxin_Z&f%zh1?`#Pr1jmqjV z`~o-<+E+id*DI3xran(tV?&Ni7JV+^u%gsxTUb8VW;5xnO|OZo~&qkiimb1&NH40YB($ar66rBenv# za#|X>H}3#@-Q7n!fW5EF-}3i4P%dVrCE3~RhR>Bs&*8az<*^s#^qyJ+BMT9bj}FYjIv zH8HIdOiyB~!Yhq>7^EiEYiqwllHqOl;e>ZQHhOI}E-!EX3)NRx;%b*(ozo5_bl|XNc$!aQ|kZ<&KX9!Anz0(!W}}ug`>5_Iz{U`(4Z{D5u-+ znd7FI+lq2AVS3n?zu`ckN4F0aC;TqrajNq^aX*wW)eyC3++bV|@$GiFi-t}FbxmXo z%A0En%G?D@Q4?ReE8gUI)Qxg#^2X4GI0~s1voOMY@hR%)7dyQJ&gLLh%N1E*xzs~c z!TKGn@x5hhNkTM1B_#j9=>IrK_dn6UsCj858(fJ*6+Azult=(BWS5aDWT5Pw5RDO~~L&Z>%Q`_OZ72+B`2W4U830~@Qp;TLpxIEuSUG#@Hqj_ z@<2O5b3Zxnf+gd9`JD5HUBUul=r?)B0~YLrLN<{K^K$dGtOag2glE4{+1Q46eWt&4 zC<5#g#OH!g7uWyFeKP7~)9^HhTngdvNsbCM)(MFaUsT#1Yh1Wp>i8rkaGyB*!%qpqmh z7#MR^u84C|VvGy6Nn1bh>K`Pke+XStsVeaI8;Ps zN2N+#i3>z;C*Pm4)?JKN|3V3n#SGIsNP=9Z2bBOhWl7p<^B)RkDpK-@=%tH0r0ezw zJ;mSoXrPuQ_VBmkX_fz-s6|HaF$t6T)j+sqQEI)`h3*QCm_={v#pgEdcn(!9yrB=3 zY9GJ(d#|ZKPDAkJ3pmq{AA>)x>6o%;?ScLk1C*$_3Hp_5|Gb}Y`cI%A5;6Y_^(IB9 z>^bxp`)fn$B~`k&oDV@+mA_OL`b3J}4cPgVB=9!Y0`&g#tncP_eZ8{{*!4>(O_t># ze|R+pejzF%3@mLJg7=dXUZ%K53f=+8;s8%XM%kmWCvMm8G~c9JLriU14Vp&)tnj{a zU{`PwZ%bewmLi*Q*!NR`%fE3rndIMswZ;SUC!ZS7#{z`AKL80LJF*cbAH=Skmq z4mS63w=9}+L^L++sbUZaxdelS$OPz6AnH*wZpR$P3>KD}m7%1YA$RJ>&A`&BH2Oos zsKHHQ%M>;z+V*dY$0)b#C2z-*UWLks4NX8JG{AoGemj7}j(cwwj7;GK8nl%9F7mw= zFRWoR$9dEyuOM<)hckHlCalw2S|*^oT^pumw7e`ql9I?FkW0b`@x%w`qQF9q!}v|y zn(P036HcD#9qj*-kOOwXT{8X9d*1;=IM}lkw%?ed0OJVts)sc6`B0|=G?%e z+(D?EkK9+CSax_nD1M>k0yOS0Pcp!e6M#!u2Z)Fd9X5JsETPgvTZ<-PI zCXf~NAYiO0Vnm?T^+GNb?`I2Y6658Z_)w<+!2L-}vuKgVydeB4wji{$I(9iC@E=%V z=5s#h)kShiWi>KYYW8hnwQzgOXBKF@z`k_h0|bsW^WTv^SL0?&{)-rf4@kt)jgpRf zVN~LJfV~dd%XJ9m{q(@%87nR{PFvQUbqMj72xicMw6&>_+)xV(Nm>@_v-?dfM-PH; z_8wPoZQZdj?790%{G{{oG7We45Sn^j!nAdKps8!Iw@RY-6iH|LGUgWDvHjni9fMQM zl~fdtT~s7Mty*BH2jX=&VTD5=lg>n<6cTxfCL&h@3e3bs8h>H73Yrh7_ zLch~G=NGp33$a_GvS)&(8Mhe^nC4GY-KWoUf6vcj?AEO$08c)>oyvOU>Rw0m9m3V& zx0|{bPkgyGh3cf68qR(2RIqnVx=<_ifkcrbm+}L(>ALxIh+UL5~$_AqwnBlvx6W#uH-jf=&twfe1 z-!9O5mA}?wAJNZrn!taLk`EBu?x*4D762a}P#QWS^-IFg5CmXya)e4aO(AcwaV`${ zbf_H~9D?W*ARd2`BlbZ@&fxt-j`;YJ)=fJL5jpg;TjA_2m8DrOhaYkq?wlIs zwpJ;IfCZivJc977@JntiBmFMrt+IE*iQLhxUEVj3#|xU@OHRn&WNqZvaf zgP35H`1DgvUFeCs0vJDSc1dV@(*4FWCU}}|9OG*7M8^Tr9}|wLi`@)|J)|5Icn7(U z=VBsNZxjz(T8UO0;Gr!r|ENYTUZ1QA!jg`+EuZ$4iUadF%=pqM$6M2h-C0nq=+dM*vSFEOVx z4m~*BDc@iNLD3w(p3xiayq(8)mA*lUW8YvkeY2ym_wT`-EQI&^`oZ6p&DMD zRuGq~^%D^SF|_!vDj%eAb^oO*eb6PQQ8Gn#IY}EqgCo5Lw!QS~hvjztc{{EXydHX!niiyi@51PD}m z8Lhcs^;`0)^y`YCy91u2qp?}x%QqD4q@XR9WbTE??&0=sdFYPncGVFsrVkcd+7?U%|JZpsi=s?OZu&>x^_QbN9Z48y0+NK;8# z*&heKc6?fo?IR_IK2#Lc-AE^h7c+YhRT#z?yt=XNGBhb%)#Ry+8}z(n6+G+8I>^8I zxr}1%4z`uF3iOXvlJselvaX*jJE$5ezY&!O`=zPDgluESG6PO5C1>i~C*p_F2b~Oh zUDgeXRhL43FYbC0z-{rkun+Egle|!U4aLZMm8?E*NeNFcmK#@!xe4|%sN-cUz2^D4 zjrjao+t6G15##6SxX=Z6i6TwdwFfDCj9-u@?#|Sbb3?T01QWRL{~11|C+J5EyyE2e z>l$fzIG;?wuQh%+#qp(8>f^=JuK#J3Lxol9O6^Ge_#1j3b*#^N%O@d|Z!#edscQx+ z`vZ)Mnlc{3FqbYnNofIE61X(;7j~pk?nzRZ#!it3whPhD0_&ea6!dpD&B5V}Ay68- zZA+|XJ-F=GYczE#G@oR&j$c2mn&`M-pflY9b=pVd2(Zs{M4;R9YM)C=l0bEP=>#QL z)_%)^yFvG0Qn)kh@ToYZZZW;ku{&qab6jj@?dkZ#6AWyP4bQBV&=q1`e(l`IKfx}e zX$ZL($Ev2z3ud&w*7mDwh&G6F0LY!~T28zuHftyVDVecR8(O~2oVK1csglqabv#$M zZTL&z?@I|B*vKJ92yBNnfuFh^W1GtyXotOtQdPWOSP1dR&+(|#w#v^tH>{hbs-%0OIw_VLb~v_eGg-_6Fl5s4ve(_=+X@qM^^Hc7pEZ* zZAa`yWjnOjterqhI{u@Y=Bjx;nz87cy%?eZ|Kuk`B*&oz_c)Tk8s+JrBtH{RHoF*c z9SjiOYQsgn?zTwGR#wUE9F7*MZ$*7C58^pa1m&~5tJF~&8nM&Hzq$hM5qw$Z!IF!WiL+hHV3EFN#Tt38jPIB={FfeQ#-Lr91GeZ}n7FolC zb1?n!XouE>I~3BRqML?hHlsFVo7jlkO}g8Ny%wG}=F((-PA3w&LU*grO3i-oa5%2n zeND$5%A+zb+0^WIxUM(}$kIpJ{s@fQX8f%Y7Mp9vbQnV%ItP|xP;INa8nbNUAX8)m zfX|Tuzj7o4{dU1T=PsvRha$buzWow}$>By}+WsLdXKl}C>U$)@ZCTsZ$YNVCs8^W) z%ll560J&_JI0e!+PKMcue^<#Fhne@_VdRc5-VkkD>p_FQmCcxXT5@8qS>K*leF-4d z-0Z|(V^x#SUl+(uzX&IaAL0BxamY3d2la|?TKen@$*wbtkMA#P>{67yLec zTpg`+r9?N}HrO;&KxI#T5M$9U01yZ{IQ}T*H}7B^G3yTv)RC_@kXP~dszScSZqdQW zAA8Ql+{1KUY>zbpJL=qw;YL9^V=IP{-E;TQ(8J>5n?hXP!+cT_aS^MESlc7va1s+E zp;U&@O<1316pUjU?8^j@*D_^1pS%Rk`9Qrd@BGxEV)tU} zpR}@~J#owo%8NIH8t09Jm7Dv0KIhg}o>hK%XQZ%Ysndj4MWJ#V@V6PXh728kt7fY0 z9O43jEb<7)Gm&~bIDYiKpJv>@uLb$LM#nxZyuL7YgMB%N@%MC2SVMT4k3#2NN7W^< z<8ay9u8?~t4QjeXyv_7^Z#ya>mUB7(QZ$oXN*->`x=`qRVol}@3K_C^8MG3d_g2EH z)t*UlNfEn>1n2oNckmu~Nb+Z**r~o5hh>Z%wA&;qShXaBnN#{>XXEl4R!P6Jd4jt} zHOVr?Nr5x%(^~`=FF?BNYo5pX@-ubfL?;!2HnnDS9hjs_Vron{pRS9=H%}7qhP=xmWM&jrG(cJ$cWp$-3!+0l08c%0!H(Py-bkboVb( zFm~fFt6IFqCpI3)lqzP^D4poC(|@+!%n|Jdm;rXsDh@36?;Zp@;c8B|%;cy|_P5(a zdN$L%zm=9b(86{I4^~8{NA3c1H#na@QR~V^ynn|MoBxdMnK+8oSq zaD+)u<K<;NmnoIcXgPZE|`Mqcw9jJURWkVR3%3q1RJiR{5>QY4AO^5B69^GI(HHM5ZwiQi|%kL=IyyozN+hP=T4(=F^InkZ%E_rCC2Hz7o;scVU@ z1zu-SlgG&uF(+G>HeWyV$*=B zc+u$xUsJ1=D>kSfMoyZV$2l~AGH*oshokEtP#b1>9BGYb<1iej-_p(Lp75ReyNT%g zr{67C3R=C)_~0}D7LDjM2_&%Cz)NPm`oTutGJ%}DV*2RWOgRYh1nxC}%)n_rh`6*7 zB0Gz$d&=aSi&g`X_C>}Z8-!;Y0x;x-eqp8B%T$vPK3ka9tMV#xNXmN|*#GGv%w+9} zgFRmGA)Q0MGUN(wTR7Tqwi~X3%n=(xG2NUVfMT)|)v4=#cvT6Inb-SJ=29@BYgk z{bH4nETkenPnSBgr&K&}|9|%AP_<<_c2e#~cu{e45t-Icb4)Zb;{VvAfSe7p54|sY z^zmhns?@d=x_-#Eab414)F6CAJ+3i{R(OKU-R)m9s9F);Na^~+5oyYJONfy~Bohn5 z!*;{;#!wTYzZS{YiSF$->O(T@@kDZqD@4546Jc;I#`jg1%{iG# z1VM+AJuQlGsM!6^sA5}8LGUsD^N6WH(KFkOQ?WvE9oiXq$czCT{kJx@yWD`eFI@xdq5|;Yiqx6+ zz3#?luHOL9$oJ=TmfhHVww__y+7}Tp-43L~%PH&DzsuX1TH+zh%rtG(&=82o?0AM$ zQ){#vEgHI$gL75F{`@cPM9`GmSiN@gZOYJ(A>aqoUoXC6pAgs%S(Iof*yo$d;4kKc zIE+qG`c1fWZ;9&x9b5U0JT_NCk$pyaA=lW8=T(Q+a*Ya0Ow;7v6%{NRf!U`^{0lxE z1~3@lr->=2s5Gxx0$ZsoX$kZTEoo?6-aON@dkOt*m6Fwc3(aG@*Rs8X1oldBKlt(z z?d~_+Up(|IXamzR7d%{2<&C%yEfNajL2$59{#5L8xBK7>Pt=-tq6pFuCnKmOfJQ-? zvsDN`lsDlFj4wn0Pv;Xr8l$SYl5XxHwYA$$*fm!Z;nNwGKS=_)6Kk?+f>=CbpiYQj zKP(r?Ou{0BiJ2SV(!V({LbBM1l>Fk}TabO*((I{Lg>qa#b$s?UEB=R@R}3JESCnQXy#+5?yb{q&u`y3RsvQeCXHS8Hsx>vf&` zDSsv)CQQM?2m-<)pbRz6P{aaWP+9`$xczmVhg=sB@rVl9>*Z`NL%+V;tu%S$%GhHS zJh96Bk_UoKrQq{oSoxZ17xbxM4xgD|u%(2soPHw#rn1oaQS^dM^eeiw;E9Xwt)gJD zSrj1Z$1CmTXlG!QIWpW5!JZB~pq9PqF8-NEcHELA{+Fc7mDW43MEx!UX_&gyN@@iD zUs$P4pZI3&l#=2AGM}O)QsM^CuVv9eM6->X$Dhh&;+V=-+bfZ=3e^>HQ zb&Wl0!1NxzsZGdbU>uVbdSv4-^e;n2Jz7ntpju|jJ&j8RZS=K{V&daJLc!N&19(*K zAk}LIk8bi_MPkZH3Cb!KzBk9S9iEO?-WeFGH0 z*LI(QrSx8bu+i7qf|%k^%iwZ}9Or>_xob{SG;BFw<4HM19L(!UYSj^?qWXtE#QcSpK@A0MmW} zL&1Ptwauv5zraTDsdXYULNFt#^AT+3*$}2f18HOR2E?F!_g8elbud#a=y$xKtZK_a z0=HwZKqxOls2Y)J)R9gE=fs&QO8CbKmdNIZiT%e`en_DqpU7XjP@bwO>ok66uPRlI z-R6xKm6Mqi0Fm!}5bike3VTlpE{tQ`WiiI_Msn%P9jaQ=FaOlj-6W%9G9yARECM*? zmwIBw;(2To@EtSTdw6fFSS-vh^r?%MJX%&O>(jv~ris4X(VoI6}+rtNODhrf2f8W8O^nnIyAgUVAz6nRLDf`#Z*9~8@Ai>kzYDj3wV*7Ly8asVuKAfq}fE&HIY zutgR`TTKVIC8c?Y8`aYA7m(NniP^jHw?J*~$x2WPhKhy1V9_94J+uZ=gx_Gw%os0! z_eNSUpJ(w~oI<@*Q-zo&%UgR{*Q7(;S%UWWataa~7uqHic0^ELHixYK`5AvjKmtrW zmovR}(So-%PqgSj0V{-dGR|iI0DjzWEGg3YpaISiac~JB)MBWwzS}KI^jTD5m$|T- zNZi$|7C2vfH!iT=GBjFP^UkFrpV5p2J^1;I^PC$xcy)-a=eCKMhL|yXj%oem4uaSc zNg^qV%kDv}&!Am6}DLlD@>kJmJo z^AFyLn#|>+^fpG9*YoX`F+7kTDbRiF^C^Rr?*UOEN$ z8GP$QX__JU@%x7Ln1JSCRpAq8lL0*a*xuGv2kvg{?gEQ}e$jJw1;9K>`bax4^koxv zv=t*8s2N-wkM+iw}DrQC+z9-mDpIjje7Uk~a%Duh?8 z>~Zsm0OF2pX*)Uh7^E36R$Zeq>QrUSg)T6h3GURZFPRNzBcA*RMYHa>Jq{GYE&u|5P4+I{=%C*e!XO*ij?|jt_+n#ib*@9@jV~}^~2m0 z$MloSzp2O%eaoRZ@(2_G^&q>2p_Fs3 zG~zt@kG}*I;{tR;tO#^Ho)Q(NEXbc%3*_@nFS=1t{$)mkiVsk6(2zMw@Dk2ElXWCM z_KNBSyrhY$Z{VvNOrX5XHpy$0c7hs+iX>rR^*pe{JE$We+Kkgs!CN)6$X)^^&w1#9 z53l5sS(I7&Y?8`@Ug?PeLN+v$2eH+-U}*g(#26Ru@`f1O7@KcJNkG6+yMEt9PjrxCJboyDoG3gqWgkqceP{7k zCqBh`1b$IDZl;GV?{7zX?{#ky?C8y@#ut&F-yo!nvtGRTUmU)@(JC6{m7hBE<>)}3 zBUl}$Z>Tb;&*!i?LHCMr_!)N2wg9S@ZCB6$ln!7MqWe7r)Fmm43$;XvnE@px!yrVe z$M{WgdcC-3rx7I{7b%(>{zFOwIp@(=YEH~gr^n=T7d1#l?FY4%H*w812jFJdg#LL^ zv>5_NWXFG!m#_5yE1*J^`2Ifug<(;aBe8fK;<1&B`~-1L zeg!KHF!K!rj-%TyPOOCiFdlpi$y1&M*;*w+kPF>m8(Uo@9mFhMllTzVv`(DvQPYYG zK%ES-w3<`U0kTAwWkbY4YpE@L?*cpk0@C<1yevE}ei)R5x7L3{-s% zxv7{_PbKqf%xP+dA)Zl*SRo>)v!-}&$8krOc&*|D3p|#YB7f5D{@8XzwBwsUoh@F> zgV=i>x*`QU73-)p zdhlkG9@#b^u^^!obw-Yh!!4|sM*&ToL_$meRAY-90neb?rD0$igFvq;dH<#tgmplf zpb9vX`Jfg|D<)3>_fHA<*VrQ#f?^vBWap7Jwe;S>tcB8=<_q+iB*@G9Ff}u2${C%J zkqRGRTC$Btj5jPE3Y= zrSTJ*EzlOlT}tLd19_RM^F{mEm?ONIh}626m@(OOrzoH=56aHd=2yC>Q7EXsPcY09 ztkrs0aJ@L*wQc$6)n(ROghC~%)fj0`)NanKW@wZEtR`siD~latV&ffQk@fb*Lm^Uj z2JZz5=ox=!*3Itj|5`9?JoqQ0Ja7D6wnf`Vxb3J6A+^~t^%%urk743!saBTH?k0Bb z2L2Eb4KLqm6B+xyRX;k+0!wI&n-=m?-+((^ZHFU%n_GX;f#*fu{Clr`M-;rDY5I>H z{NY3j>>1$w?8Q5v($y{?{>7VNl@!6we+U>VwW_b0vW~cOJ_2{@_VD42HYL*5ewI#{ z9V%W^)b)2$tJMI|k-$r&bU#VaZ)iN>gASQ0{gk4l>6f@A(Ozpm^pk#wB_y<53Xk}h z)Z*g~uZC-LeAP*trg|kFipDE(bR#LRYQ**M;Vz17@cf!e7^Ia^(luz@zU&jG85&k# z(#8$^_qs|tchjVjyVB*%%(u5z z<=qbbGw3Lp$7XRbAU1{puyIu3kubR=B*V}2vryi;AB861s)Bm$>T66KlW12&f8uK2 z&y)k&@r!>1@E{$n19W(9p*cz1UG;cpFHeXi*gA{yvk;jhB;v+p;HdweSTAHNH_M8l zdDl`qP~!E0+~F;sZHf3!2O%|u@JhNTt$8S`wWL5_G#^=2^;?}L_ECB5p&BmAKkH2m z;SL1_I%%8)SO@YWN|hmwCO+R?J9YoHaet=KX- zP&zVSZ^_Wa&`es~oRe|5uBv?5`ekE$K4{-`!ZsL+dRhws<6MOF#~ zKX02`;wG|lhM%tm7IpqP10IY~eE^NT-|xghZ?(T@)NI)u5Sz&Fox=`N!{`0^`NroS z_~in)KfjIuvf+GadvD$auJ?JZ;Q_b3@=kzbuin&u#&HY9O2Cx{X$Zu0oYGMeueP4ja2>Cak-x5p9BZNQi`y(Fhd)~QB4 zykSw(`D(KGbO3}>S*M$?ugoPEuW`YqFJ(|*vN}WkQJi6(fLxWN--K$uRlxCVhcMYT z^>|GIXx_nR&bcM_ej}w}i zbH?giEj%B%xIqkvvj{cMyt-v@A$#k9{7Z32YZU@hG(?*BC|O@1>Zd7Aa1ApTV^84M zfV{@!k=rdKDjnPu5_zO3bMoHTu#;(SBroR_-HLkm0vK?}TQEa-KDaL7>}hs{1wUv@ zKCPR7hk}80>hFCdbr%eo@=sOIn5!!XDsz3cLkt+_9!5$hx`pJT+69RqEUNCbgEI=y zT&zy|Jyt4jmeGI<@1TB~)em~1VuP(3FgLy=1x2?-dksWGje);=o)w^n?Koub>D|GE z`#fWV?Ct)9ORlcv+Ajk?u{UVd|F{@N?SrB&zXj8GkJZC)&#HSFh9;*Y>?Ad(m*pR5{B4{eCaETv?w2Pw>3J&A*l?x5mlRtlKYbW#C7-5PXbn}kw-S?9z=hKc;pJCPAqUE7 z8*a&j1?FzTUD$v75zBZk(IGNQY2;yX>k1QRAmKJ}vt-DORuh`l&oQZ9g^8c!|5@X z&IhwY&W)H5T;)UAL@}*F}4699g(O#@J0h+7lhz}0)Dk=tQE?ptIwr! zm^r)m%nl$1q%Bz|L+RPf8BWVjOJ-T_@_Ep631BIgWzY?tOgn;1JUm~YM zSEmAAfA!vXx4ZPO{2tHWPmR18$E&mRJJ=iN>vde%b|^dQXNE|ZG&lE_PN8^He7#mf z5s3j0lc@n7a9oscATLSl#VlVA?Uxf+uqSZW9g1z!PJyEk{m(1 zzAd1%JM#=eBmtdlh>X;)6GWOWF?MIC98*gmd7W#d-r?-Z;oXlh-=2@kc1~}O;IQ{tDY1d{Vwj9{GO8mh5~&G&YK}Im=S$W+YpZ zC2Vq}`@OvrkhN}lZ2NxBTEx!2Nd9{5n2z$bTX({A|IIRfIVU*q$&&(B2&S7)4!-9o zAnI19UBxyfV}^=>2QeJ*>1n7d(JuuWzpKFYfhKIhGJ1NGAE_xhiA|>rvp(OI4G3Kv` z-}N=w6H#N9*l*2RXuIPJ&Dv89Ib!$jDO;94gs5&47!-ILs&lVR^vA|ocp}4<98|%^ zHA5MbaWWfz7G1IocC(opCH&Qy%#)h^`93X|U2Y&R9PIOz2Q~uzO-36U!pajzXzqS) z_bzqEv1RL2yJoCjsiyeoz@mbcgd)TFr7z?M;Vjmxbs^Z`fV;r*7@`gYzwjM74V=>C ztbimjB}H*I^=SuPOry~5(0B;8dRz557j{RMBGu!;g=MN4S`^CR0LEl1IVv~Wa5OYi zjwiT;Xe3X+DA`Hwvm;=H(Psuu>sg6!&d)HimLw^sa_%?c*Pv?)$Gy30(AH~VaMOk- zIC=igLEe^amT+bovGnZT8DLUn3J z-4TWP2BmC~4F;4^mqUJrr7#;B!QUc*);cvVYI-0>#WV|*C!tHMsjxv)lYR&?R6_OB z*5>uG=r-*;8@p9gmd?;?Yvi{82_dIDOPT_pWC*kHt5GihMohUaY*c#^Yw>%<4}M@8 zEiGJQqip8uWf#dInpSTQl+zFyF)146Bd|c2yX|Gt*gsd$B9(W<)&6J@KLZwHi~&J9 z?Qq!c|0bnP6eW#~MZ9=D3{{!!5(x15Iy_vw6oi&H(OPWnd`GlI8WW39vm`mPRGm%Q z;mrX8uXLsDwipq5pVeVTkY-b%B;t?vtm*0n>W5sl;W;&U^9A<}8@i;kfc%Q+M2RM+ zimX>qmrCoZFa$ch&dYYMz;_d@weAZ2Z{A;zn8R& zWaXbS)|aCEg1h2)DimA=Ba0jn`dy2K|SEAltyf)8CpyuQf zrBhU1osq6afvex@G|J?Uk|Js4msc<0v~zr*$AjttC4uNdN{pV56Q{rB6dom&UEn4a zI(gq{F{X$aEq$D9JsC|NCp}OnND}j`wVHi-CSGAt0q=%{2MEdJprcAXyDorFD)2?Z ze?Nkp@dptnA_{FAEg5k4rwPoYp3lpzMkOBN)z?#B^>>@AaM4Mix)b&ezq&aZ5hNxY zkNcqkkG`Miz4}|*v07STFlIVZ`%+^q8k+ z=$1Gev<08ABqk{9vNHaWZaw&iz5EMKMK=HfW{O~^_HYngd|Kp31=@Ub&nc;7g`sw1 z;IbTMqbgf22+4=(xkc-wYIMZ$hSgBDU90mxa5t#ushe8R?{m)j%>nfg79bh0d5TOe6>pCFc$ZGCxs}Tz@5LSkD>gc~~+Fan* z#vR}}#XVVUYO~vemTQsU07(GTL(>6lPnD}!xOy~RR{Bm+SRs8|<)giEk1HmwG!p!f zlIsa_l={_SUsELw;1vp=S`fUq+qkhROrub2@1xSyK%vpxr_Z``Z$dwy6?Yb0=nXKp z7$&!bB1Zaep(wSAE$;8IV&c@D_-WG+l$BXRp=O2eSWrPuX?LvzVi!rrY^DMcj<%1G z-`1X;1pne5IH2#t6QpdmYnR=vFVVwMC>=k-Ad*I-wl!{G$HLze{K-25M-{5(M{+0a zH6#BCMFsgAQZkR%{id)k&0fi$sDKA4+*yo)?a5C}a8oS|cgWs+_r}R7<;6$;BcFR3 zdW)=YJ4ZLQW{>+#+K&dE^C4czyf;Pm A JavaScript function to parse floating point hexadecimals as defined by the [WebAssembly specification](https://webassembly.github.io/spec/core/text/values.html#text-hexfloat). + +## Usage + +```javascript +import parseHexFloat from '@webassemblyjs/floating-point-hex-parser' + +parseHexFloat('0x1p-1') // 0.5 +parseHexFloat('0x1.921fb54442d18p+2') // 6.283185307179586 +``` + +## Tests + +This module is tested in two ways. The first one is through a small set of test cases that can be found in [test/regular.test.js](https://github.com/maurobringolf/@webassemblyjs/floating-point-hex-parser/blob/master/test/regular.test.js). The second one is non-deterministic (sometimes called *fuzzing*): + +1. Generate a random IEEE754 double precision value `x`. +1. Compute its representation `y` in floating point hexadecimal format using the C standard library function `printf` since C supports this format. +1. Give both values to JS testcase and see if `parseHexFloat(y) === x`. + +By default one `npm test` run tests 100 random samples. If you want to do more, you can set the environment variable `FUZZ_AMOUNT` to whatever number of runs you'd like. Because it uses one child process for each sample, it is really slow though. For more details about the randomized tests see [the source](https://github.com/maurobringolf/@webassemblyjs/floating-point-hex-parser/tree/master/test/fuzzing). + +## Links + +* [maurobringolf.ch/2017/12/hexadecimal-floating-point-notation/](https://maurobringolf.ch/2017/12/hexadecimal-floating-point-notation/) + +* [github.com/xtuc/js-webassembly-interpreter/issues/32](https://github.com/xtuc/js-webassembly-interpreter/issues/32) + +* [github.com/WebAssembly/design/issues/292](https://github.com/WebAssembly/design/issues/292) diff --git a/node_modules/@webassemblyjs/floating-point-hex-parser/esm/index.js b/node_modules/@webassemblyjs/floating-point-hex-parser/esm/index.js new file mode 100644 index 0000000..d8d858d --- /dev/null +++ b/node_modules/@webassemblyjs/floating-point-hex-parser/esm/index.js @@ -0,0 +1,42 @@ +export default function parse(input) { + input = input.toUpperCase(); + var splitIndex = input.indexOf("P"); + var mantissa, exponent; + + if (splitIndex !== -1) { + mantissa = input.substring(0, splitIndex); + exponent = parseInt(input.substring(splitIndex + 1)); + } else { + mantissa = input; + exponent = 0; + } + + var dotIndex = mantissa.indexOf("."); + + if (dotIndex !== -1) { + var integerPart = parseInt(mantissa.substring(0, dotIndex), 16); + var sign = Math.sign(integerPart); + integerPart = sign * integerPart; + var fractionLength = mantissa.length - dotIndex - 1; + var fractionalPart = parseInt(mantissa.substring(dotIndex + 1), 16); + var fraction = fractionLength > 0 ? fractionalPart / Math.pow(16, fractionLength) : 0; + + if (sign === 0) { + if (fraction === 0) { + mantissa = sign; + } else { + if (Object.is(sign, -0)) { + mantissa = -fraction; + } else { + mantissa = fraction; + } + } + } else { + mantissa = sign * (integerPart + fraction); + } + } else { + mantissa = parseInt(mantissa, 16); + } + + return mantissa * (splitIndex !== -1 ? Math.pow(2, exponent) : 1); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/floating-point-hex-parser/lib/index.js b/node_modules/@webassemblyjs/floating-point-hex-parser/lib/index.js new file mode 100644 index 0000000..a867699 --- /dev/null +++ b/node_modules/@webassemblyjs/floating-point-hex-parser/lib/index.js @@ -0,0 +1,49 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = parse; + +function parse(input) { + input = input.toUpperCase(); + var splitIndex = input.indexOf("P"); + var mantissa, exponent; + + if (splitIndex !== -1) { + mantissa = input.substring(0, splitIndex); + exponent = parseInt(input.substring(splitIndex + 1)); + } else { + mantissa = input; + exponent = 0; + } + + var dotIndex = mantissa.indexOf("."); + + if (dotIndex !== -1) { + var integerPart = parseInt(mantissa.substring(0, dotIndex), 16); + var sign = Math.sign(integerPart); + integerPart = sign * integerPart; + var fractionLength = mantissa.length - dotIndex - 1; + var fractionalPart = parseInt(mantissa.substring(dotIndex + 1), 16); + var fraction = fractionLength > 0 ? fractionalPart / Math.pow(16, fractionLength) : 0; + + if (sign === 0) { + if (fraction === 0) { + mantissa = sign; + } else { + if (Object.is(sign, -0)) { + mantissa = -fraction; + } else { + mantissa = fraction; + } + } + } else { + mantissa = sign * (integerPart + fraction); + } + } else { + mantissa = parseInt(mantissa, 16); + } + + return mantissa * (splitIndex !== -1 ? Math.pow(2, exponent) : 1); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/floating-point-hex-parser/package.json b/node_modules/@webassemblyjs/floating-point-hex-parser/package.json new file mode 100644 index 0000000..2b1705b --- /dev/null +++ b/node_modules/@webassemblyjs/floating-point-hex-parser/package.json @@ -0,0 +1,56 @@ +{ + "_from": "@webassemblyjs/floating-point-hex-parser@1.8.5", + "_id": "@webassemblyjs/floating-point-hex-parser@1.8.5", + "_inBundle": false, + "_integrity": "sha512-9p+79WHru1oqBh9ewP9zW95E3XAo+90oth7S5Re3eQnECGq59ly1Ri5tsIipKGpiStHsUYmY3zMLqtk3gTcOtQ==", + "_location": "/@webassemblyjs/floating-point-hex-parser", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/floating-point-hex-parser@1.8.5", + "name": "@webassemblyjs/floating-point-hex-parser", + "escapedName": "@webassemblyjs%2ffloating-point-hex-parser", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/wast-parser" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.8.5.tgz", + "_shasum": "1ba926a2923613edce496fd5b02e8ce8a5f49721", + "_spec": "@webassemblyjs/floating-point-hex-parser@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/wast-parser", + "author": { + "name": "Mauro Bringolf" + }, + "bugs": { + "url": "https://github.com/xtuc/webassemblyjs/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A function to parse floating point hexadecimal strings as defined by the WebAssembly specification", + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "homepage": "https://github.com/xtuc/webassemblyjs#readme", + "keywords": [ + "webassembly", + "floating-point" + ], + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/floating-point-hex-parser", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/xtuc/webassemblyjs.git" + }, + "scripts": { + "build-fuzzer": "[ -f ./test/fuzzing/parse.out ] || gcc ./test/fuzzing/parse.c -o ./test/fuzzing/parse.out -lm -Wall" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/helper-api-error/LICENSE b/node_modules/@webassemblyjs/helper-api-error/LICENSE new file mode 100644 index 0000000..87e7e1f --- /dev/null +++ b/node_modules/@webassemblyjs/helper-api-error/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sven Sauleau + +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. diff --git a/node_modules/@webassemblyjs/helper-api-error/esm/index.js b/node_modules/@webassemblyjs/helper-api-error/esm/index.js new file mode 100644 index 0000000..869d480 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-api-error/esm/index.js @@ -0,0 +1,47 @@ +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +export var RuntimeError = +/*#__PURE__*/ +function (_Error) { + _inherits(RuntimeError, _Error); + + function RuntimeError() { + _classCallCheck(this, RuntimeError); + + return _possibleConstructorReturn(this, (RuntimeError.__proto__ || Object.getPrototypeOf(RuntimeError)).apply(this, arguments)); + } + + return RuntimeError; +}(Error); +export var CompileError = +/*#__PURE__*/ +function (_Error2) { + _inherits(CompileError, _Error2); + + function CompileError() { + _classCallCheck(this, CompileError); + + return _possibleConstructorReturn(this, (CompileError.__proto__ || Object.getPrototypeOf(CompileError)).apply(this, arguments)); + } + + return CompileError; +}(Error); +export var LinkError = +/*#__PURE__*/ +function (_Error3) { + _inherits(LinkError, _Error3); + + function LinkError() { + _classCallCheck(this, LinkError); + + return _possibleConstructorReturn(this, (LinkError.__proto__ || Object.getPrototypeOf(LinkError)).apply(this, arguments)); + } + + return LinkError; +}(Error); \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-api-error/lib/index.js b/node_modules/@webassemblyjs/helper-api-error/lib/index.js new file mode 100644 index 0000000..926ec47 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-api-error/lib/index.js @@ -0,0 +1,62 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LinkError = exports.CompileError = exports.RuntimeError = void 0; + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var RuntimeError = +/*#__PURE__*/ +function (_Error) { + _inherits(RuntimeError, _Error); + + function RuntimeError() { + _classCallCheck(this, RuntimeError); + + return _possibleConstructorReturn(this, (RuntimeError.__proto__ || Object.getPrototypeOf(RuntimeError)).apply(this, arguments)); + } + + return RuntimeError; +}(Error); + +exports.RuntimeError = RuntimeError; + +var CompileError = +/*#__PURE__*/ +function (_Error2) { + _inherits(CompileError, _Error2); + + function CompileError() { + _classCallCheck(this, CompileError); + + return _possibleConstructorReturn(this, (CompileError.__proto__ || Object.getPrototypeOf(CompileError)).apply(this, arguments)); + } + + return CompileError; +}(Error); + +exports.CompileError = CompileError; + +var LinkError = +/*#__PURE__*/ +function (_Error3) { + _inherits(LinkError, _Error3); + + function LinkError() { + _classCallCheck(this, LinkError); + + return _possibleConstructorReturn(this, (LinkError.__proto__ || Object.getPrototypeOf(LinkError)).apply(this, arguments)); + } + + return LinkError; +}(Error); + +exports.LinkError = LinkError; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-api-error/package.json b/node_modules/@webassemblyjs/helper-api-error/package.json new file mode 100644 index 0000000..5cb8336 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-api-error/package.json @@ -0,0 +1,42 @@ +{ + "_from": "@webassemblyjs/helper-api-error@1.8.5", + "_id": "@webassemblyjs/helper-api-error@1.8.5", + "_inBundle": false, + "_integrity": "sha512-Za/tnzsvnqdaSPOUXHyKJ2XI7PDX64kWtURyGiJJZKVEdFOsdKUCPTNEVFZq3zJ2R0G5wc2PZ5gvdTRFgm81zA==", + "_location": "/@webassemblyjs/helper-api-error", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/helper-api-error@1.8.5", + "name": "@webassemblyjs/helper-api-error", + "escapedName": "@webassemblyjs%2fhelper-api-error", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/wasm-parser", + "/@webassemblyjs/wast-parser" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.8.5.tgz", + "_shasum": "c49dad22f645227c5edb610bdb9697f1aab721f7", + "_spec": "@webassemblyjs/helper-api-error@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/wast-parser", + "author": { + "name": "Sven Sauleau" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Common API errors", + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/helper-api-error", + "publishConfig": { + "access": "public" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/helper-buffer/LICENSE b/node_modules/@webassemblyjs/helper-buffer/LICENSE new file mode 100644 index 0000000..87e7e1f --- /dev/null +++ b/node_modules/@webassemblyjs/helper-buffer/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sven Sauleau + +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. diff --git a/node_modules/@webassemblyjs/helper-buffer/esm/compare.js b/node_modules/@webassemblyjs/helper-buffer/esm/compare.js new file mode 100644 index 0000000..8cea6b3 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-buffer/esm/compare.js @@ -0,0 +1,65 @@ +// this are dev dependencies +var diff = require("jest-diff"); + +var _require = require("jest-diff/build/constants"), + NO_DIFF_MESSAGE = _require.NO_DIFF_MESSAGE; + +var _require2 = require("@webassemblyjs/wasm-parser"), + decode = _require2.decode; + +var oldConsoleLog = console.log; +export function compareArrayBuffers(l, r) { + /** + * Decode left + */ + var bufferL = ""; + + console.log = function () { + for (var _len = arguments.length, texts = new Array(_len), _key = 0; _key < _len; _key++) { + texts[_key] = arguments[_key]; + } + + return bufferL += texts.join("") + "\n"; + }; + + try { + decode(l, { + dump: true + }); + } catch (e) { + console.error(bufferL); + console.error(e); + throw e; + } + /** + * Decode right + */ + + + var bufferR = ""; + + console.log = function () { + for (var _len2 = arguments.length, texts = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + texts[_key2] = arguments[_key2]; + } + + return bufferR += texts.join("") + "\n"; + }; + + try { + decode(r, { + dump: true + }); + } catch (e) { + console.error(bufferR); + console.error(e); + throw e; + } + + console.log = oldConsoleLog; + var out = diff(bufferL, bufferR); + + if (out !== null && out !== NO_DIFF_MESSAGE) { + throw new Error("\n" + out); + } +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-buffer/esm/index.js b/node_modules/@webassemblyjs/helper-buffer/esm/index.js new file mode 100644 index 0000000..2c35b9e --- /dev/null +++ b/node_modules/@webassemblyjs/helper-buffer/esm/index.js @@ -0,0 +1,67 @@ +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function concatUint8Arrays() { + for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) { + arrays[_key] = arguments[_key]; + } + + var totalLength = arrays.reduce(function (a, b) { + return a + b.length; + }, 0); + var result = new Uint8Array(totalLength); + var offset = 0; + + for (var _i = 0; _i < arrays.length; _i++) { + var arr = arrays[_i]; + + if (arr instanceof Uint8Array === false) { + throw new Error("arr must be of type Uint8Array"); + } + + result.set(arr, offset); + offset += arr.length; + } + + return result; +} + +export function overrideBytesInBuffer(buffer, startLoc, endLoc, newBytes) { + var beforeBytes = buffer.slice(0, startLoc); + var afterBytes = buffer.slice(endLoc, buffer.length); // replacement is empty, we can omit it + + if (newBytes.length === 0) { + return concatUint8Arrays(beforeBytes, afterBytes); + } + + var replacement = Uint8Array.from(newBytes); + return concatUint8Arrays(beforeBytes, replacement, afterBytes); +} +export function makeBuffer() { + for (var _len2 = arguments.length, splitedBytes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + splitedBytes[_key2] = arguments[_key2]; + } + + var bytes = [].concat.apply([], splitedBytes); + return new Uint8Array(bytes).buffer; +} +export function fromHexdump(str) { + var lines = str.split("\n"); // remove any leading left whitespace + + lines = lines.map(function (line) { + return line.trim(); + }); + var bytes = lines.reduce(function (acc, line) { + var cols = line.split(" "); // remove the offset, left column + + cols.shift(); + cols = cols.filter(function (x) { + return x !== ""; + }); + var bytes = cols.map(function (x) { + return parseInt(x, 16); + }); + acc.push.apply(acc, _toConsumableArray(bytes)); + return acc; + }, []); + return Buffer.from(bytes); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-buffer/lib/compare.js b/node_modules/@webassemblyjs/helper-buffer/lib/compare.js new file mode 100644 index 0000000..b30dc07 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-buffer/lib/compare.js @@ -0,0 +1,73 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compareArrayBuffers = compareArrayBuffers; + +// this are dev dependencies +var diff = require("jest-diff"); + +var _require = require("jest-diff/build/constants"), + NO_DIFF_MESSAGE = _require.NO_DIFF_MESSAGE; + +var _require2 = require("@webassemblyjs/wasm-parser"), + decode = _require2.decode; + +var oldConsoleLog = console.log; + +function compareArrayBuffers(l, r) { + /** + * Decode left + */ + var bufferL = ""; + + console.log = function () { + for (var _len = arguments.length, texts = new Array(_len), _key = 0; _key < _len; _key++) { + texts[_key] = arguments[_key]; + } + + return bufferL += texts.join("") + "\n"; + }; + + try { + decode(l, { + dump: true + }); + } catch (e) { + console.error(bufferL); + console.error(e); + throw e; + } + /** + * Decode right + */ + + + var bufferR = ""; + + console.log = function () { + for (var _len2 = arguments.length, texts = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + texts[_key2] = arguments[_key2]; + } + + return bufferR += texts.join("") + "\n"; + }; + + try { + decode(r, { + dump: true + }); + } catch (e) { + console.error(bufferR); + console.error(e); + throw e; + } + + console.log = oldConsoleLog; + var out = diff(bufferL, bufferR); + + if (out !== null && out !== NO_DIFF_MESSAGE) { + throw new Error("\n" + out); + } +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-buffer/lib/index.js b/node_modules/@webassemblyjs/helper-buffer/lib/index.js new file mode 100644 index 0000000..b735b1f --- /dev/null +++ b/node_modules/@webassemblyjs/helper-buffer/lib/index.js @@ -0,0 +1,78 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.overrideBytesInBuffer = overrideBytesInBuffer; +exports.makeBuffer = makeBuffer; +exports.fromHexdump = fromHexdump; + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function concatUint8Arrays() { + for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) { + arrays[_key] = arguments[_key]; + } + + var totalLength = arrays.reduce(function (a, b) { + return a + b.length; + }, 0); + var result = new Uint8Array(totalLength); + var offset = 0; + + for (var _i = 0; _i < arrays.length; _i++) { + var arr = arrays[_i]; + + if (arr instanceof Uint8Array === false) { + throw new Error("arr must be of type Uint8Array"); + } + + result.set(arr, offset); + offset += arr.length; + } + + return result; +} + +function overrideBytesInBuffer(buffer, startLoc, endLoc, newBytes) { + var beforeBytes = buffer.slice(0, startLoc); + var afterBytes = buffer.slice(endLoc, buffer.length); // replacement is empty, we can omit it + + if (newBytes.length === 0) { + return concatUint8Arrays(beforeBytes, afterBytes); + } + + var replacement = Uint8Array.from(newBytes); + return concatUint8Arrays(beforeBytes, replacement, afterBytes); +} + +function makeBuffer() { + for (var _len2 = arguments.length, splitedBytes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + splitedBytes[_key2] = arguments[_key2]; + } + + var bytes = [].concat.apply([], splitedBytes); + return new Uint8Array(bytes).buffer; +} + +function fromHexdump(str) { + var lines = str.split("\n"); // remove any leading left whitespace + + lines = lines.map(function (line) { + return line.trim(); + }); + var bytes = lines.reduce(function (acc, line) { + var cols = line.split(" "); // remove the offset, left column + + cols.shift(); + cols = cols.filter(function (x) { + return x !== ""; + }); + var bytes = cols.map(function (x) { + return parseInt(x, 16); + }); + acc.push.apply(acc, _toConsumableArray(bytes)); + return acc; + }, []); + return Buffer.from(bytes); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-buffer/package.json b/node_modules/@webassemblyjs/helper-buffer/package.json new file mode 100644 index 0000000..dd2f142 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-buffer/package.json @@ -0,0 +1,58 @@ +{ + "_from": "@webassemblyjs/helper-buffer@1.8.5", + "_id": "@webassemblyjs/helper-buffer@1.8.5", + "_inBundle": false, + "_integrity": "sha512-Ri2R8nOS0U6G49Q86goFIPNgjyl6+oE1abW1pS84BuhP1Qcr5JqMwRFT3Ah3ADDDYGEgGs1iyb1DGX+kAi/c/Q==", + "_location": "/@webassemblyjs/helper-buffer", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/helper-buffer@1.8.5", + "name": "@webassemblyjs/helper-buffer", + "escapedName": "@webassemblyjs%2fhelper-buffer", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/helper-wasm-section", + "/@webassemblyjs/wasm-edit", + "/@webassemblyjs/wasm-opt" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.8.5.tgz", + "_shasum": "fea93e429863dd5e4338555f42292385a653f204", + "_spec": "@webassemblyjs/helper-buffer@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/wasm-edit", + "author": { + "name": "Sven Sauleau" + }, + "bugs": { + "url": "https://github.com/xtuc/webassemblyjs/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Buffer manipulation utility", + "devDependencies": { + "@webassemblyjs/wasm-parser": "1.8.5", + "jest-diff": "^22.4.0" + }, + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "homepage": "https://github.com/xtuc/webassemblyjs#readme", + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/helper-buffer", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/xtuc/webassemblyjs.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/helper-code-frame/LICENSE b/node_modules/@webassemblyjs/helper-code-frame/LICENSE new file mode 100644 index 0000000..87e7e1f --- /dev/null +++ b/node_modules/@webassemblyjs/helper-code-frame/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sven Sauleau + +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. diff --git a/node_modules/@webassemblyjs/helper-code-frame/esm/index.js b/node_modules/@webassemblyjs/helper-code-frame/esm/index.js new file mode 100644 index 0000000..791c65e --- /dev/null +++ b/node_modules/@webassemblyjs/helper-code-frame/esm/index.js @@ -0,0 +1,37 @@ +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +import { print } from "@webassemblyjs/wast-printer"; +var SHOW_LINES_AROUND_POINTER = 5; + +function repeat(char, nb) { + return Array(nb).fill(char).join(""); +} // TODO(sven): allow arbitrary ast nodes + + +export function codeFrameFromAst(ast, loc) { + return codeFrameFromSource(print(ast), loc); +} +export function codeFrameFromSource(source, loc) { + var start = loc.start, + end = loc.end; + var length = 1; + + if (_typeof(end) === "object") { + length = end.column - start.column + 1; + } + + return source.split("\n").reduce(function (acc, line, lineNbr) { + if (Math.abs(start.line - lineNbr) < SHOW_LINES_AROUND_POINTER) { + acc += line + "\n"; + } // Add a new line with the pointer padded left + + + if (lineNbr === start.line - 1) { + acc += repeat(" ", start.column - 1); + acc += repeat("^", length); + acc += "\n"; + } + + return acc; + }, ""); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-code-frame/lib/index.js b/node_modules/@webassemblyjs/helper-code-frame/lib/index.js new file mode 100644 index 0000000..977de89 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-code-frame/lib/index.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.codeFrameFromAst = codeFrameFromAst; +exports.codeFrameFromSource = codeFrameFromSource; + +var _wastPrinter = require("@webassemblyjs/wast-printer"); + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +var SHOW_LINES_AROUND_POINTER = 5; + +function repeat(char, nb) { + return Array(nb).fill(char).join(""); +} // TODO(sven): allow arbitrary ast nodes + + +function codeFrameFromAst(ast, loc) { + return codeFrameFromSource((0, _wastPrinter.print)(ast), loc); +} + +function codeFrameFromSource(source, loc) { + var start = loc.start, + end = loc.end; + var length = 1; + + if (_typeof(end) === "object") { + length = end.column - start.column + 1; + } + + return source.split("\n").reduce(function (acc, line, lineNbr) { + if (Math.abs(start.line - lineNbr) < SHOW_LINES_AROUND_POINTER) { + acc += line + "\n"; + } // Add a new line with the pointer padded left + + + if (lineNbr === start.line - 1) { + acc += repeat(" ", start.column - 1); + acc += repeat("^", length); + acc += "\n"; + } + + return acc; + }, ""); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-code-frame/package.json b/node_modules/@webassemblyjs/helper-code-frame/package.json new file mode 100644 index 0000000..18d9479 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-code-frame/package.json @@ -0,0 +1,55 @@ +{ + "_from": "@webassemblyjs/helper-code-frame@1.8.5", + "_id": "@webassemblyjs/helper-code-frame@1.8.5", + "_inBundle": false, + "_integrity": "sha512-VQAadSubZIhNpH46IR3yWO4kZZjMxN1opDrzePLdVKAZ+DFjkGD/rf4v1jap744uPVU6yjL/smZbRIIJTOUnKQ==", + "_location": "/@webassemblyjs/helper-code-frame", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/helper-code-frame@1.8.5", + "name": "@webassemblyjs/helper-code-frame", + "escapedName": "@webassemblyjs%2fhelper-code-frame", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/wast-parser" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.8.5.tgz", + "_shasum": "9a740ff48e3faa3022b1dff54423df9aa293c25e", + "_spec": "@webassemblyjs/helper-code-frame@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/wast-parser", + "author": { + "name": "Sven Sauleau" + }, + "bugs": { + "url": "https://github.com/xtuc/webassemblyjs/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@webassemblyjs/wast-printer": "1.8.5" + }, + "deprecated": false, + "description": "", + "devDependencies": { + "@webassemblyjs/ast": "1.8.5" + }, + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "homepage": "https://github.com/xtuc/webassemblyjs#readme", + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/helper-code-frame", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/xtuc/webassemblyjs.git" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/helper-code-frame/webassemblyjs-helper-code-frame-1.7.10.tgz b/node_modules/@webassemblyjs/helper-code-frame/webassemblyjs-helper-code-frame-1.7.10.tgz new file mode 100644 index 0000000000000000000000000000000000000000..5b83fc8ac0ec6ad847fde811c8136ea8d4577242 GIT binary patch literal 1756 zcmV<21|#_&iwFP!000001MOICZ{xTTzR&sia zq5&;YF;iJoNh(?6kpJExB|CPK-D}a@-YsAvh^*nmnP*1S%uof1|3z+SyQr?tt>pQ4 zuRJ=P&S21om*hCQon8;VdwVqKbi0E=2XXl0sQ(tPuTA8oQA$MwQu%-NRL;Qm`i+cV zEPzH%R+e?}iRJ@6KLf@o9V{DDSqe3#C>jhos*y(mEaYAJ* zSfT2vO1L7-++}RhW_dzC;RdT`cv5D@DwV4zbAlFJGR4Ij=QTr=sdZt{H%u82ib|1b z$x^98p0wLIvn&@*%vbGCs*Kxv&NzAh}ve-ht&BGsEhuv}5G6V0vBgx-z* z8$GDzrRC`H1tp1|N{^1-#e=xhKkmLePJ4aQ>vcM0(dly=mnACN{pD|9f4XF8A|)r#I*v^8eQun6Y47B{0hx@?tI6%~C-# zZb7fpeFwYg4t|t)_miydbfW!>WzDEqF{ujzFbPX4=wb~wf?!fhY)A#Az*C5qMBGpt z6bF*80m};Z8Ne3`>jTSgfIy74Ekvp%s*yZZ_e4+xCxDrb$BdvpNO)YXXs(E^GLW*2 zN@%Jj#k5?nXta!xgp$l+Iq12~6x?Hh;H3gVr4lUGI&5HhoRx{@u$j)-iq#hMauX0~ zq0&;K2b!l1SiM-Puhh6z*Ap8Ord2OWg+gg+h>onS{b+Lml4hBO8ZeuK@%53N!D#A* z4ydX_B(>yz$yfWHFlnWw$k8Ms@!7L1Z_D9|b8g7L54I8ff`9*L!2SkMKbp8>7b8x30;cxzQWP|tjS?EO( z1fk_mW@Fz&nLizlFGv3L1H8v|(*QTMk6Rm+&I8Z}YgN7%X=M{H9A4n9``#b>^N+T5 z?$4)M=Xnr<3o|#I`@_qz8^Y`|oCT4G=0~V@>QB!@wBk*?>D)o9Cp}VD>TeKU~b=A{dW66u$S6nfre1Ri@CX;n?*jHjLbf`@u7-0@M;(8dkA` zs|!zyv^^L9hI2odYBz?#bROcZjb4WH?b0hh@@#NJKhgm?4}*zq>2TtTz$n3WQ?JsZ zLk)XR1R?tVGV-0=1z3uO)kq*(uNFLmv$HciNYwBKeE&V{%{vTFF$B+S6;K*s zL#wJa!x?(IZ!?CW39q zc)Z784;ArJ#I$J~)$mq@Mxo*wn-(L@gb%kj=`JMxfm-@W;<@k&PArv;aSx znMFua(>OIV=E=JWcGr;8`)Xb{z@}L%xY>wMkVH3n8BLXCZE4j6OsMvlb)T87w`K#d zsoRT}2A{r+{U>6ph(AT_u&>zEk;Z8gd>g7w{d?!sZ)t4m|LzC6*S7I1^?%UoKCA!z z1f4nlT{1zNUo5Jv-I94|c7B^? y=MUMpyh6j$?AUvo&M~{H^`wRQjHN^Ka%f%-&C6jN#$o*7#(w}R9mm%IA^-p>n|-4I literal 0 HcmV?d00001 diff --git a/node_modules/@webassemblyjs/helper-fsm/LICENSE b/node_modules/@webassemblyjs/helper-fsm/LICENSE new file mode 100644 index 0000000..87e7e1f --- /dev/null +++ b/node_modules/@webassemblyjs/helper-fsm/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sven Sauleau + +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. diff --git a/node_modules/@webassemblyjs/helper-fsm/esm/index.js b/node_modules/@webassemblyjs/helper-fsm/esm/index.js new file mode 100644 index 0000000..c7266b8 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-fsm/esm/index.js @@ -0,0 +1,101 @@ +function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +var STOP = Symbol("STOP"); + +function makeTransition(regex, nextState) { + var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, + _ref$n = _ref.n, + n = _ref$n === void 0 ? 1 : _ref$n, + allowedSeparator = _ref.allowedSeparator; + + return function (instance) { + if (allowedSeparator) { + if (instance.input[instance.ptr] === allowedSeparator) { + if (regex.test(instance.input.substring(instance.ptr - 1, instance.ptr))) { + // Consume the separator and stay in current state + return [instance.currentState, 1]; + } else { + return [instance.terminatingState, 0]; + } + } + } + + if (regex.test(instance.input.substring(instance.ptr, instance.ptr + n))) { + return [nextState, n]; + } + + return false; + }; +} + +function combineTransitions(transitions) { + return function () { + var match = false; + var currentTransitions = transitions[this.currentState] || []; + + for (var i = 0; i < currentTransitions.length; ++i) { + match = currentTransitions[i](this); + + if (match !== false) { + break; + } + } + + return match || [this.terminatingState, 0]; + }; +} + +var FSM = +/*#__PURE__*/ +function () { + function FSM(transitions, initialState) { + var terminatingState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : STOP; + + _classCallCheck(this, FSM); + + this.initialState = initialState; + this.terminatingState = terminatingState; + + if (terminatingState === STOP || !transitions[terminatingState]) { + transitions[terminatingState] = []; + } + + this.transitionFunction = combineTransitions.call(this, transitions); + } + + _createClass(FSM, [{ + key: "run", + value: function run(input) { + this.input = input; + this.ptr = 0; + this.currentState = this.initialState; + var value = ""; + var eatLength, nextState; + + while (this.currentState !== this.terminatingState && this.ptr < this.input.length) { + var _transitionFunction = this.transitionFunction(); + + var _transitionFunction2 = _slicedToArray(_transitionFunction, 2); + + nextState = _transitionFunction2[0]; + eatLength = _transitionFunction2[1]; + value += this.input.substring(this.ptr, this.ptr += eatLength); + this.currentState = nextState; + } + + return value; + } + }]); + + return FSM; +}(); + +export { makeTransition, FSM }; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-fsm/lib/index.js b/node_modules/@webassemblyjs/helper-fsm/lib/index.js new file mode 100644 index 0000000..c23120d --- /dev/null +++ b/node_modules/@webassemblyjs/helper-fsm/lib/index.js @@ -0,0 +1,109 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.makeTransition = makeTransition; +exports.FSM = void 0; + +function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +var STOP = Symbol("STOP"); + +function makeTransition(regex, nextState) { + var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, + _ref$n = _ref.n, + n = _ref$n === void 0 ? 1 : _ref$n, + allowedSeparator = _ref.allowedSeparator; + + return function (instance) { + if (allowedSeparator) { + if (instance.input[instance.ptr] === allowedSeparator) { + if (regex.test(instance.input.substring(instance.ptr - 1, instance.ptr))) { + // Consume the separator and stay in current state + return [instance.currentState, 1]; + } else { + return [instance.terminatingState, 0]; + } + } + } + + if (regex.test(instance.input.substring(instance.ptr, instance.ptr + n))) { + return [nextState, n]; + } + + return false; + }; +} + +function combineTransitions(transitions) { + return function () { + var match = false; + var currentTransitions = transitions[this.currentState] || []; + + for (var i = 0; i < currentTransitions.length; ++i) { + match = currentTransitions[i](this); + + if (match !== false) { + break; + } + } + + return match || [this.terminatingState, 0]; + }; +} + +var FSM = +/*#__PURE__*/ +function () { + function FSM(transitions, initialState) { + var terminatingState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : STOP; + + _classCallCheck(this, FSM); + + this.initialState = initialState; + this.terminatingState = terminatingState; + + if (terminatingState === STOP || !transitions[terminatingState]) { + transitions[terminatingState] = []; + } + + this.transitionFunction = combineTransitions.call(this, transitions); + } + + _createClass(FSM, [{ + key: "run", + value: function run(input) { + this.input = input; + this.ptr = 0; + this.currentState = this.initialState; + var value = ""; + var eatLength, nextState; + + while (this.currentState !== this.terminatingState && this.ptr < this.input.length) { + var _transitionFunction = this.transitionFunction(); + + var _transitionFunction2 = _slicedToArray(_transitionFunction, 2); + + nextState = _transitionFunction2[0]; + eatLength = _transitionFunction2[1]; + value += this.input.substring(this.ptr, this.ptr += eatLength); + this.currentState = nextState; + } + + return value; + } + }]); + + return FSM; +}(); + +exports.FSM = FSM; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-fsm/package.json b/node_modules/@webassemblyjs/helper-fsm/package.json new file mode 100644 index 0000000..942f277 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-fsm/package.json @@ -0,0 +1,41 @@ +{ + "_from": "@webassemblyjs/helper-fsm@1.8.5", + "_id": "@webassemblyjs/helper-fsm@1.8.5", + "_inBundle": false, + "_integrity": "sha512-kRuX/saORcg8se/ft6Q2UbRpZwP4y7YrWsLXPbbmtepKr22i8Z4O3V5QE9DbZK908dh5Xya4Un57SDIKwB9eow==", + "_location": "/@webassemblyjs/helper-fsm", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/helper-fsm@1.8.5", + "name": "@webassemblyjs/helper-fsm", + "escapedName": "@webassemblyjs%2fhelper-fsm", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/wast-parser" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.8.5.tgz", + "_shasum": "ba0b7d3b3f7e4733da6059c9332275d860702452", + "_spec": "@webassemblyjs/helper-fsm@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/wast-parser", + "author": { + "name": "Mauro Bringolf" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "FSM implementation", + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "license": "ISC", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/helper-fsm", + "publishConfig": { + "access": "public" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/helper-module-context/LICENSE b/node_modules/@webassemblyjs/helper-module-context/LICENSE new file mode 100644 index 0000000..87e7e1f --- /dev/null +++ b/node_modules/@webassemblyjs/helper-module-context/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sven Sauleau + +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. diff --git a/node_modules/@webassemblyjs/helper-module-context/esm/index.js b/node_modules/@webassemblyjs/helper-module-context/esm/index.js new file mode 100644 index 0000000..0f730e6 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-module-context/esm/index.js @@ -0,0 +1,378 @@ +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +// TODO(sven): add flow in here +import { isSignature, isNumberLiteral } from "@webassemblyjs/ast"; +export function moduleContextFromModuleAST(m) { + var moduleContext = new ModuleContext(); + + if (!(m.type === "Module")) { + throw new Error('m.type === "Module"' + " error: " + (undefined || "unknown")); + } + + m.fields.forEach(function (field) { + switch (field.type) { + case "Start": + { + moduleContext.setStart(field.index); + break; + } + + case "TypeInstruction": + { + moduleContext.addType(field); + break; + } + + case "Func": + { + moduleContext.addFunction(field); + break; + } + + case "Global": + { + moduleContext.defineGlobal(field); + break; + } + + case "ModuleImport": + { + switch (field.descr.type) { + case "GlobalType": + { + moduleContext.importGlobal(field.descr.valtype, field.descr.mutability); + break; + } + + case "Memory": + { + moduleContext.addMemory(field.descr.limits.min, field.descr.limits.max); + break; + } + + case "FuncImportDescr": + { + moduleContext.importFunction(field.descr); + break; + } + + case "Table": + { + // FIXME(sven): not implemented yet + break; + } + + default: + throw new Error("Unsupported ModuleImport of type " + JSON.stringify(field.descr.type)); + } + + break; + } + + case "Memory": + { + moduleContext.addMemory(field.limits.min, field.limits.max); + break; + } + } + }); + return moduleContext; +} +/** + * Module context for type checking + */ + +export var ModuleContext = +/*#__PURE__*/ +function () { + function ModuleContext() { + _classCallCheck(this, ModuleContext); + + this.funcs = []; + this.funcsOffsetByIdentifier = []; + this.types = []; + this.globals = []; + this.globalsOffsetByIdentifier = []; + this.mems = []; // Current stack frame + + this.locals = []; + this.labels = []; + this.return = []; + this.debugName = "unknown"; + this.start = null; + } + /** + * Set start segment + */ + + + _createClass(ModuleContext, [{ + key: "setStart", + value: function setStart(index) { + this.start = index.value; + } + /** + * Get start function + */ + + }, { + key: "getStart", + value: function getStart() { + return this.start; + } + /** + * Reset the active stack frame + */ + + }, { + key: "newContext", + value: function newContext(debugName, expectedResult) { + this.locals = []; + this.labels = [expectedResult]; + this.return = expectedResult; + this.debugName = debugName; + } + /** + * Functions + */ + + }, { + key: "addFunction", + value: function addFunction(func + /*: Func*/ + ) { + // eslint-disable-next-line prefer-const + var _ref = func.signature || {}, + _ref$params = _ref.params, + args = _ref$params === void 0 ? [] : _ref$params, + _ref$results = _ref.results, + result = _ref$results === void 0 ? [] : _ref$results; + + args = args.map(function (arg) { + return arg.valtype; + }); + this.funcs.push({ + args: args, + result: result + }); + + if (typeof func.name !== "undefined") { + this.funcsOffsetByIdentifier[func.name.value] = this.funcs.length - 1; + } + } + }, { + key: "importFunction", + value: function importFunction(funcimport) { + if (isSignature(funcimport.signature)) { + // eslint-disable-next-line prefer-const + var _funcimport$signature = funcimport.signature, + args = _funcimport$signature.params, + result = _funcimport$signature.results; + args = args.map(function (arg) { + return arg.valtype; + }); + this.funcs.push({ + args: args, + result: result + }); + } else { + if (!isNumberLiteral(funcimport.signature)) { + throw new Error('isNumberLiteral(funcimport.signature)' + " error: " + (undefined || "unknown")); + } + + var typeId = funcimport.signature.value; + + if (!this.hasType(typeId)) { + throw new Error('this.hasType(typeId)' + " error: " + (undefined || "unknown")); + } + + var signature = this.getType(typeId); + this.funcs.push({ + args: signature.params.map(function (arg) { + return arg.valtype; + }), + result: signature.results + }); + } + + if (typeof funcimport.id !== "undefined") { + // imports are first, we can assume their index in the array + this.funcsOffsetByIdentifier[funcimport.id.value] = this.funcs.length - 1; + } + } + }, { + key: "hasFunction", + value: function hasFunction(index) { + return typeof this.getFunction(index) !== "undefined"; + } + }, { + key: "getFunction", + value: function getFunction(index) { + if (typeof index !== "number") { + throw new Error("getFunction only supported for number index"); + } + + return this.funcs[index]; + } + }, { + key: "getFunctionOffsetByIdentifier", + value: function getFunctionOffsetByIdentifier(name) { + if (!(typeof name === "string")) { + throw new Error('typeof name === "string"' + " error: " + (undefined || "unknown")); + } + + return this.funcsOffsetByIdentifier[name]; + } + /** + * Labels + */ + + }, { + key: "addLabel", + value: function addLabel(result) { + this.labels.unshift(result); + } + }, { + key: "hasLabel", + value: function hasLabel(index) { + return this.labels.length > index && index >= 0; + } + }, { + key: "getLabel", + value: function getLabel(index) { + return this.labels[index]; + } + }, { + key: "popLabel", + value: function popLabel() { + this.labels.shift(); + } + /** + * Locals + */ + + }, { + key: "hasLocal", + value: function hasLocal(index) { + return typeof this.getLocal(index) !== "undefined"; + } + }, { + key: "getLocal", + value: function getLocal(index) { + return this.locals[index]; + } + }, { + key: "addLocal", + value: function addLocal(type) { + this.locals.push(type); + } + /** + * Types + */ + + }, { + key: "addType", + value: function addType(type) { + if (!(type.functype.type === "Signature")) { + throw new Error('type.functype.type === "Signature"' + " error: " + (undefined || "unknown")); + } + + this.types.push(type.functype); + } + }, { + key: "hasType", + value: function hasType(index) { + return this.types[index] !== undefined; + } + }, { + key: "getType", + value: function getType(index) { + return this.types[index]; + } + /** + * Globals + */ + + }, { + key: "hasGlobal", + value: function hasGlobal(index) { + return this.globals.length > index && index >= 0; + } + }, { + key: "getGlobal", + value: function getGlobal(index) { + return this.globals[index].type; + } + }, { + key: "getGlobalOffsetByIdentifier", + value: function getGlobalOffsetByIdentifier(name) { + if (!(typeof name === "string")) { + throw new Error('typeof name === "string"' + " error: " + (undefined || "unknown")); + } + + return this.globalsOffsetByIdentifier[name]; + } + }, { + key: "defineGlobal", + value: function defineGlobal(global + /*: Global*/ + ) { + var type = global.globalType.valtype; + var mutability = global.globalType.mutability; + this.globals.push({ + type: type, + mutability: mutability + }); + + if (typeof global.name !== "undefined") { + this.globalsOffsetByIdentifier[global.name.value] = this.globals.length - 1; + } + } + }, { + key: "importGlobal", + value: function importGlobal(type, mutability) { + this.globals.push({ + type: type, + mutability: mutability + }); + } + }, { + key: "isMutableGlobal", + value: function isMutableGlobal(index) { + return this.globals[index].mutability === "var"; + } + }, { + key: "isImmutableGlobal", + value: function isImmutableGlobal(index) { + return this.globals[index].mutability === "const"; + } + /** + * Memories + */ + + }, { + key: "hasMemory", + value: function hasMemory(index) { + return this.mems.length > index && index >= 0; + } + }, { + key: "addMemory", + value: function addMemory(min, max) { + this.mems.push({ + min: min, + max: max + }); + } + }, { + key: "getMemory", + value: function getMemory(index) { + return this.mems[index]; + } + }]); + + return ModuleContext; +}(); \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-module-context/lib/index.js b/node_modules/@webassemblyjs/helper-module-context/lib/index.js new file mode 100644 index 0000000..189e719 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-module-context/lib/index.js @@ -0,0 +1,389 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.moduleContextFromModuleAST = moduleContextFromModuleAST; +exports.ModuleContext = void 0; + +var _ast = require("@webassemblyjs/ast"); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function moduleContextFromModuleAST(m) { + var moduleContext = new ModuleContext(); + + if (!(m.type === "Module")) { + throw new Error('m.type === "Module"' + " error: " + (undefined || "unknown")); + } + + m.fields.forEach(function (field) { + switch (field.type) { + case "Start": + { + moduleContext.setStart(field.index); + break; + } + + case "TypeInstruction": + { + moduleContext.addType(field); + break; + } + + case "Func": + { + moduleContext.addFunction(field); + break; + } + + case "Global": + { + moduleContext.defineGlobal(field); + break; + } + + case "ModuleImport": + { + switch (field.descr.type) { + case "GlobalType": + { + moduleContext.importGlobal(field.descr.valtype, field.descr.mutability); + break; + } + + case "Memory": + { + moduleContext.addMemory(field.descr.limits.min, field.descr.limits.max); + break; + } + + case "FuncImportDescr": + { + moduleContext.importFunction(field.descr); + break; + } + + case "Table": + { + // FIXME(sven): not implemented yet + break; + } + + default: + throw new Error("Unsupported ModuleImport of type " + JSON.stringify(field.descr.type)); + } + + break; + } + + case "Memory": + { + moduleContext.addMemory(field.limits.min, field.limits.max); + break; + } + } + }); + return moduleContext; +} +/** + * Module context for type checking + */ + + +var ModuleContext = +/*#__PURE__*/ +function () { + function ModuleContext() { + _classCallCheck(this, ModuleContext); + + this.funcs = []; + this.funcsOffsetByIdentifier = []; + this.types = []; + this.globals = []; + this.globalsOffsetByIdentifier = []; + this.mems = []; // Current stack frame + + this.locals = []; + this.labels = []; + this.return = []; + this.debugName = "unknown"; + this.start = null; + } + /** + * Set start segment + */ + + + _createClass(ModuleContext, [{ + key: "setStart", + value: function setStart(index) { + this.start = index.value; + } + /** + * Get start function + */ + + }, { + key: "getStart", + value: function getStart() { + return this.start; + } + /** + * Reset the active stack frame + */ + + }, { + key: "newContext", + value: function newContext(debugName, expectedResult) { + this.locals = []; + this.labels = [expectedResult]; + this.return = expectedResult; + this.debugName = debugName; + } + /** + * Functions + */ + + }, { + key: "addFunction", + value: function addFunction(func + /*: Func*/ + ) { + // eslint-disable-next-line prefer-const + var _ref = func.signature || {}, + _ref$params = _ref.params, + args = _ref$params === void 0 ? [] : _ref$params, + _ref$results = _ref.results, + result = _ref$results === void 0 ? [] : _ref$results; + + args = args.map(function (arg) { + return arg.valtype; + }); + this.funcs.push({ + args: args, + result: result + }); + + if (typeof func.name !== "undefined") { + this.funcsOffsetByIdentifier[func.name.value] = this.funcs.length - 1; + } + } + }, { + key: "importFunction", + value: function importFunction(funcimport) { + if ((0, _ast.isSignature)(funcimport.signature)) { + // eslint-disable-next-line prefer-const + var _funcimport$signature = funcimport.signature, + args = _funcimport$signature.params, + result = _funcimport$signature.results; + args = args.map(function (arg) { + return arg.valtype; + }); + this.funcs.push({ + args: args, + result: result + }); + } else { + if (!(0, _ast.isNumberLiteral)(funcimport.signature)) { + throw new Error('isNumberLiteral(funcimport.signature)' + " error: " + (undefined || "unknown")); + } + + var typeId = funcimport.signature.value; + + if (!this.hasType(typeId)) { + throw new Error('this.hasType(typeId)' + " error: " + (undefined || "unknown")); + } + + var signature = this.getType(typeId); + this.funcs.push({ + args: signature.params.map(function (arg) { + return arg.valtype; + }), + result: signature.results + }); + } + + if (typeof funcimport.id !== "undefined") { + // imports are first, we can assume their index in the array + this.funcsOffsetByIdentifier[funcimport.id.value] = this.funcs.length - 1; + } + } + }, { + key: "hasFunction", + value: function hasFunction(index) { + return typeof this.getFunction(index) !== "undefined"; + } + }, { + key: "getFunction", + value: function getFunction(index) { + if (typeof index !== "number") { + throw new Error("getFunction only supported for number index"); + } + + return this.funcs[index]; + } + }, { + key: "getFunctionOffsetByIdentifier", + value: function getFunctionOffsetByIdentifier(name) { + if (!(typeof name === "string")) { + throw new Error('typeof name === "string"' + " error: " + (undefined || "unknown")); + } + + return this.funcsOffsetByIdentifier[name]; + } + /** + * Labels + */ + + }, { + key: "addLabel", + value: function addLabel(result) { + this.labels.unshift(result); + } + }, { + key: "hasLabel", + value: function hasLabel(index) { + return this.labels.length > index && index >= 0; + } + }, { + key: "getLabel", + value: function getLabel(index) { + return this.labels[index]; + } + }, { + key: "popLabel", + value: function popLabel() { + this.labels.shift(); + } + /** + * Locals + */ + + }, { + key: "hasLocal", + value: function hasLocal(index) { + return typeof this.getLocal(index) !== "undefined"; + } + }, { + key: "getLocal", + value: function getLocal(index) { + return this.locals[index]; + } + }, { + key: "addLocal", + value: function addLocal(type) { + this.locals.push(type); + } + /** + * Types + */ + + }, { + key: "addType", + value: function addType(type) { + if (!(type.functype.type === "Signature")) { + throw new Error('type.functype.type === "Signature"' + " error: " + (undefined || "unknown")); + } + + this.types.push(type.functype); + } + }, { + key: "hasType", + value: function hasType(index) { + return this.types[index] !== undefined; + } + }, { + key: "getType", + value: function getType(index) { + return this.types[index]; + } + /** + * Globals + */ + + }, { + key: "hasGlobal", + value: function hasGlobal(index) { + return this.globals.length > index && index >= 0; + } + }, { + key: "getGlobal", + value: function getGlobal(index) { + return this.globals[index].type; + } + }, { + key: "getGlobalOffsetByIdentifier", + value: function getGlobalOffsetByIdentifier(name) { + if (!(typeof name === "string")) { + throw new Error('typeof name === "string"' + " error: " + (undefined || "unknown")); + } + + return this.globalsOffsetByIdentifier[name]; + } + }, { + key: "defineGlobal", + value: function defineGlobal(global + /*: Global*/ + ) { + var type = global.globalType.valtype; + var mutability = global.globalType.mutability; + this.globals.push({ + type: type, + mutability: mutability + }); + + if (typeof global.name !== "undefined") { + this.globalsOffsetByIdentifier[global.name.value] = this.globals.length - 1; + } + } + }, { + key: "importGlobal", + value: function importGlobal(type, mutability) { + this.globals.push({ + type: type, + mutability: mutability + }); + } + }, { + key: "isMutableGlobal", + value: function isMutableGlobal(index) { + return this.globals[index].mutability === "var"; + } + }, { + key: "isImmutableGlobal", + value: function isImmutableGlobal(index) { + return this.globals[index].mutability === "const"; + } + /** + * Memories + */ + + }, { + key: "hasMemory", + value: function hasMemory(index) { + return this.mems.length > index && index >= 0; + } + }, { + key: "addMemory", + value: function addMemory(min, max) { + this.mems.push({ + min: min, + max: max + }); + } + }, { + key: "getMemory", + value: function getMemory(index) { + return this.mems[index]; + } + }]); + + return ModuleContext; +}(); + +exports.ModuleContext = ModuleContext; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-module-context/package.json b/node_modules/@webassemblyjs/helper-module-context/package.json new file mode 100644 index 0000000..42ade47 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-module-context/package.json @@ -0,0 +1,60 @@ +{ + "_from": "@webassemblyjs/helper-module-context@1.8.5", + "_id": "@webassemblyjs/helper-module-context@1.8.5", + "_inBundle": false, + "_integrity": "sha512-/O1B236mN7UNEU4t9X7Pj38i4VoU8CcMHyy3l2cV/kIF4U5KoHXDVqcDuOs1ltkac90IM4vZdHc52t1x8Yfs3g==", + "_location": "/@webassemblyjs/helper-module-context", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/helper-module-context@1.8.5", + "name": "@webassemblyjs/helper-module-context", + "escapedName": "@webassemblyjs%2fhelper-module-context", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/ast", + "/webpack" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.8.5.tgz", + "_shasum": "def4b9927b0101dc8cbbd8d1edb5b7b9c82eb245", + "_spec": "@webassemblyjs/helper-module-context@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/webpack", + "author": { + "name": "Sven Sauleau" + }, + "bugs": { + "url": "https://github.com/xtuc/webassemblyjs/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "mamacro": "^0.0.3" + }, + "deprecated": false, + "description": "", + "devDependencies": { + "@webassemblyjs/wast-parser": "1.8.5" + }, + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "homepage": "https://github.com/xtuc/webassemblyjs#readme", + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/helper-module-context", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/xtuc/webassemblyjs.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/helper-module-context/src/index.js b/node_modules/@webassemblyjs/helper-module-context/src/index.js new file mode 100644 index 0000000..e3171de --- /dev/null +++ b/node_modules/@webassemblyjs/helper-module-context/src/index.js @@ -0,0 +1,287 @@ +// TODO(sven): add flow in here + +import { isSignature, isNumberLiteral } from "@webassemblyjs/ast"; +import { assert } from "mamacro"; + +export function moduleContextFromModuleAST(m) { + const moduleContext = new ModuleContext(); + + assert(m.type === "Module"); + + m.fields.forEach(field => { + switch (field.type) { + case "Start": { + moduleContext.setStart(field.index); + break; + } + case "TypeInstruction": { + moduleContext.addType(field); + break; + } + case "Func": { + moduleContext.addFunction(field); + break; + } + case "Global": { + moduleContext.defineGlobal(field); + break; + } + case "ModuleImport": { + switch (field.descr.type) { + case "GlobalType": { + moduleContext.importGlobal( + field.descr.valtype, + field.descr.mutability + ); + break; + } + case "Memory": { + moduleContext.addMemory( + field.descr.limits.min, + field.descr.limits.max + ); + break; + } + case "FuncImportDescr": { + moduleContext.importFunction(field.descr); + break; + } + + case "Table": { + // FIXME(sven): not implemented yet + break; + } + + default: + throw new Error( + "Unsupported ModuleImport of type " + + JSON.stringify(field.descr.type) + ); + } + break; + } + case "Memory": { + moduleContext.addMemory(field.limits.min, field.limits.max); + break; + } + } + }); + + return moduleContext; +} + +/** + * Module context for type checking + */ +export class ModuleContext { + constructor() { + this.funcs = []; + this.funcsOffsetByIdentifier = []; + + this.types = []; + + this.globals = []; + this.globalsOffsetByIdentifier = []; + + this.mems = []; + + // Current stack frame + this.locals = []; + this.labels = []; + this.return = []; + + this.debugName = "unknown"; + + this.start = null; + } + + /** + * Set start segment + */ + setStart(index) { + this.start = index.value; + } + + /** + * Get start function + */ + getStart() { + return this.start; + } + + /** + * Reset the active stack frame + */ + newContext(debugName, expectedResult) { + this.locals = []; + this.labels = [expectedResult]; + this.return = expectedResult; + this.debugName = debugName; + } + + /** + * Functions + */ + addFunction(func /*: Func*/) { + // eslint-disable-next-line prefer-const + let { params: args = [], results: result = [] } = func.signature || {}; + + args = args.map(arg => arg.valtype); + + this.funcs.push({ args, result }); + + if (typeof func.name !== "undefined") { + this.funcsOffsetByIdentifier[func.name.value] = this.funcs.length - 1; + } + } + + importFunction(funcimport) { + if (isSignature(funcimport.signature)) { + // eslint-disable-next-line prefer-const + let { params: args, results: result } = funcimport.signature; + args = args.map(arg => arg.valtype); + + this.funcs.push({ args, result }); + } else { + assert(isNumberLiteral(funcimport.signature)); + + const typeId = funcimport.signature.value; + assert(this.hasType(typeId)); + + const signature = this.getType(typeId); + this.funcs.push({ + args: signature.params.map(arg => arg.valtype), + result: signature.results + }); + } + + if (typeof funcimport.id !== "undefined") { + // imports are first, we can assume their index in the array + this.funcsOffsetByIdentifier[funcimport.id.value] = this.funcs.length - 1; + } + } + + hasFunction(index) { + return typeof this.getFunction(index) !== "undefined"; + } + + getFunction(index) { + if (typeof index !== "number") { + throw new Error("getFunction only supported for number index"); + } + + return this.funcs[index]; + } + + getFunctionOffsetByIdentifier(name) { + assert(typeof name === "string"); + + return this.funcsOffsetByIdentifier[name]; + } + + /** + * Labels + */ + addLabel(result) { + this.labels.unshift(result); + } + + hasLabel(index) { + return this.labels.length > index && index >= 0; + } + + getLabel(index) { + return this.labels[index]; + } + + popLabel() { + this.labels.shift(); + } + + /** + * Locals + */ + hasLocal(index) { + return typeof this.getLocal(index) !== "undefined"; + } + + getLocal(index) { + return this.locals[index]; + } + + addLocal(type) { + this.locals.push(type); + } + + /** + * Types + */ + addType(type) { + assert(type.functype.type === "Signature"); + this.types.push(type.functype); + } + + hasType(index) { + return this.types[index] !== undefined; + } + + getType(index) { + return this.types[index]; + } + + /** + * Globals + */ + hasGlobal(index) { + return this.globals.length > index && index >= 0; + } + + getGlobal(index) { + return this.globals[index].type; + } + + getGlobalOffsetByIdentifier(name) { + assert(typeof name === "string"); + + return this.globalsOffsetByIdentifier[name]; + } + + defineGlobal(global /*: Global*/) { + const type = global.globalType.valtype; + const mutability = global.globalType.mutability; + + this.globals.push({ type, mutability }); + + if (typeof global.name !== "undefined") { + this.globalsOffsetByIdentifier[global.name.value] = + this.globals.length - 1; + } + } + + importGlobal(type, mutability) { + this.globals.push({ type, mutability }); + } + + isMutableGlobal(index) { + return this.globals[index].mutability === "var"; + } + + isImmutableGlobal(index) { + return this.globals[index].mutability === "const"; + } + + /** + * Memories + */ + hasMemory(index) { + return this.mems.length > index && index >= 0; + } + + addMemory(min, max) { + this.mems.push({ min, max }); + } + + getMemory(index) { + return this.mems[index]; + } +} diff --git a/node_modules/@webassemblyjs/helper-module-context/test/index.js b/node_modules/@webassemblyjs/helper-module-context/test/index.js new file mode 100644 index 0000000..2fbf58c --- /dev/null +++ b/node_modules/@webassemblyjs/helper-module-context/test/index.js @@ -0,0 +1,100 @@ +const { assert } = require("chai"); +const { parse } = require("@webassemblyjs/wast-parser"); + +const { moduleContextFromModuleAST } = require("../lib"); + +const contextFromWast = wast => moduleContextFromModuleAST(parse(wast).body[0]); + +describe("module context", () => { + describe("start segment", () => { + it("should return the start function offset", () => { + const context = contextFromWast(` + (module + (func) + (func) + (start 1) + ) + `); + + assert.isOk(context.getStart()); + assert.typeOf(context.getStart(), "number"); + assert.equal(context.getStart(), 1); + }); + + it("should return null if no start function", () => { + const context = contextFromWast(` + (module (func)) + `); + + assert.isNull(context.getStart()); + }); + + it("should retrive the type of implemented functions", () => { + const context = contextFromWast(` + (module + (func (param i32) (result i64)) + (func (param i64) (result i32)) + (func (result i64)) + (func) + ) + `); + + assert.deepEqual(context.getFunction(0), { + args: ["i32"], + result: ["i64"] + }); + assert.deepEqual(context.getFunction(1), { + args: ["i64"], + result: ["i32"] + }); + assert.deepEqual(context.getFunction(2), { args: [], result: ["i64"] }); + assert.deepEqual(context.getFunction(3), { args: [], result: [] }); + }); + + it("should retrive the type of imported functions", () => { + const context = contextFromWast(` + (module + (import "a" "a" (func (param i32) (result i32))) + (import "a" "b" (func (result i64))) + (import "a" "c" (func)) + (func (result f32)) + ) + `); + + assert.deepEqual(context.getFunction(0), { + args: ["i32"], + result: ["i32"] + }); + assert.deepEqual(context.getFunction(1), { + args: [], + result: ["i64"] + }); + assert.deepEqual(context.getFunction(2), { args: [], result: [] }); + assert.deepEqual(context.getFunction(3), { args: [], result: ["f32"] }); + }); + + it("should retrive the type of functions with type ref", () => { + const context = contextFromWast(` + (module + (type (func (param i32) (result i32))) + (type (func (result i64))) + (type (func)) + + (import "a" "a" (func (type 0))) + (import "a" "b" (func (type 1))) + (func (type 2)) + ) + `); + + assert.deepEqual(context.getFunction(0), { + args: ["i32"], + result: ["i32"] + }); + assert.deepEqual(context.getFunction(1), { + args: [], + result: ["i64"] + }); + assert.deepEqual(context.getFunction(2), { args: [], result: [] }); + }); + }); +}); diff --git a/node_modules/@webassemblyjs/helper-wasm-bytecode/LICENSE b/node_modules/@webassemblyjs/helper-wasm-bytecode/LICENSE new file mode 100644 index 0000000..87e7e1f --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-bytecode/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sven Sauleau + +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. diff --git a/node_modules/@webassemblyjs/helper-wasm-bytecode/esm/index.js b/node_modules/@webassemblyjs/helper-wasm-bytecode/esm/index.js new file mode 100644 index 0000000..ff459c6 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-bytecode/esm/index.js @@ -0,0 +1,323 @@ +var illegalop = "illegal"; +var magicModuleHeader = [0x00, 0x61, 0x73, 0x6d]; +var moduleVersion = [0x01, 0x00, 0x00, 0x00]; + +function invertMap(obj) { + var keyModifierFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (k) { + return k; + }; + var result = {}; + var keys = Object.keys(obj); + + for (var i = 0, length = keys.length; i < length; i++) { + result[keyModifierFn(obj[keys[i]])] = keys[i]; + } + + return result; +} + +function createSymbolObject(name +/*: string */ +, object +/*: string */ +) +/*: Symbol*/ +{ + var numberOfArgs + /*: number*/ + = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + return { + name: name, + object: object, + numberOfArgs: numberOfArgs + }; +} + +function createSymbol(name +/*: string */ +) +/*: Symbol*/ +{ + var numberOfArgs + /*: number*/ + = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + return { + name: name, + numberOfArgs: numberOfArgs + }; +} + +var types = { + func: 0x60, + result: 0x40 +}; +var exportTypes = { + 0x00: "Func", + 0x01: "Table", + 0x02: "Mem", + 0x03: "Global" +}; +var exportTypesByName = invertMap(exportTypes); +var valtypes = { + 0x7f: "i32", + 0x7e: "i64", + 0x7d: "f32", + 0x7c: "f64" +}; +var valtypesByString = invertMap(valtypes); +var tableTypes = { + 0x70: "anyfunc" +}; +var blockTypes = Object.assign({}, valtypes, { + // https://webassembly.github.io/spec/core/binary/types.html#binary-blocktype + 0x40: null, + // https://webassembly.github.io/spec/core/binary/types.html#binary-valtype + 0x7f: "i32", + 0x7e: "i64", + 0x7d: "f32", + 0x7c: "f64" +}); +var globalTypes = { + 0x00: "const", + 0x01: "var" +}; +var globalTypesByString = invertMap(globalTypes); +var importTypes = { + 0x00: "func", + 0x01: "table", + 0x02: "mem", + 0x03: "global" +}; +var sections = { + custom: 0, + type: 1, + import: 2, + func: 3, + table: 4, + memory: 5, + global: 6, + export: 7, + start: 8, + element: 9, + code: 10, + data: 11 +}; +var symbolsByByte = { + 0x00: createSymbol("unreachable"), + 0x01: createSymbol("nop"), + 0x02: createSymbol("block"), + 0x03: createSymbol("loop"), + 0x04: createSymbol("if"), + 0x05: createSymbol("else"), + 0x06: illegalop, + 0x07: illegalop, + 0x08: illegalop, + 0x09: illegalop, + 0x0a: illegalop, + 0x0b: createSymbol("end"), + 0x0c: createSymbol("br", 1), + 0x0d: createSymbol("br_if", 1), + 0x0e: createSymbol("br_table"), + 0x0f: createSymbol("return"), + 0x10: createSymbol("call", 1), + 0x11: createSymbol("call_indirect", 2), + 0x12: illegalop, + 0x13: illegalop, + 0x14: illegalop, + 0x15: illegalop, + 0x16: illegalop, + 0x17: illegalop, + 0x18: illegalop, + 0x19: illegalop, + 0x1a: createSymbol("drop"), + 0x1b: createSymbol("select"), + 0x1c: illegalop, + 0x1d: illegalop, + 0x1e: illegalop, + 0x1f: illegalop, + 0x20: createSymbol("get_local", 1), + 0x21: createSymbol("set_local", 1), + 0x22: createSymbol("tee_local", 1), + 0x23: createSymbol("get_global", 1), + 0x24: createSymbol("set_global", 1), + 0x25: illegalop, + 0x26: illegalop, + 0x27: illegalop, + 0x28: createSymbolObject("load", "u32", 1), + 0x29: createSymbolObject("load", "u64", 1), + 0x2a: createSymbolObject("load", "f32", 1), + 0x2b: createSymbolObject("load", "f64", 1), + 0x2c: createSymbolObject("load8_s", "u32", 1), + 0x2d: createSymbolObject("load8_u", "u32", 1), + 0x2e: createSymbolObject("load16_s", "u32", 1), + 0x2f: createSymbolObject("load16_u", "u32", 1), + 0x30: createSymbolObject("load8_s", "u64", 1), + 0x31: createSymbolObject("load8_u", "u64", 1), + 0x32: createSymbolObject("load16_s", "u64", 1), + 0x33: createSymbolObject("load16_u", "u64", 1), + 0x34: createSymbolObject("load32_s", "u64", 1), + 0x35: createSymbolObject("load32_u", "u64", 1), + 0x36: createSymbolObject("store", "u32", 1), + 0x37: createSymbolObject("store", "u64", 1), + 0x38: createSymbolObject("store", "f32", 1), + 0x39: createSymbolObject("store", "f64", 1), + 0x3a: createSymbolObject("store8", "u32", 1), + 0x3b: createSymbolObject("store16", "u32", 1), + 0x3c: createSymbolObject("store8", "u64", 1), + 0x3d: createSymbolObject("store16", "u64", 1), + 0x3e: createSymbolObject("store32", "u64", 1), + 0x3f: createSymbolObject("current_memory"), + 0x40: createSymbolObject("grow_memory"), + 0x41: createSymbolObject("const", "i32", 1), + 0x42: createSymbolObject("const", "i64", 1), + 0x43: createSymbolObject("const", "f32", 1), + 0x44: createSymbolObject("const", "f64", 1), + 0x45: createSymbolObject("eqz", "i32"), + 0x46: createSymbolObject("eq", "i32"), + 0x47: createSymbolObject("ne", "i32"), + 0x48: createSymbolObject("lt_s", "i32"), + 0x49: createSymbolObject("lt_u", "i32"), + 0x4a: createSymbolObject("gt_s", "i32"), + 0x4b: createSymbolObject("gt_u", "i32"), + 0x4c: createSymbolObject("le_s", "i32"), + 0x4d: createSymbolObject("le_u", "i32"), + 0x4e: createSymbolObject("ge_s", "i32"), + 0x4f: createSymbolObject("ge_u", "i32"), + 0x50: createSymbolObject("eqz", "i64"), + 0x51: createSymbolObject("eq", "i64"), + 0x52: createSymbolObject("ne", "i64"), + 0x53: createSymbolObject("lt_s", "i64"), + 0x54: createSymbolObject("lt_u", "i64"), + 0x55: createSymbolObject("gt_s", "i64"), + 0x56: createSymbolObject("gt_u", "i64"), + 0x57: createSymbolObject("le_s", "i64"), + 0x58: createSymbolObject("le_u", "i64"), + 0x59: createSymbolObject("ge_s", "i64"), + 0x5a: createSymbolObject("ge_u", "i64"), + 0x5b: createSymbolObject("eq", "f32"), + 0x5c: createSymbolObject("ne", "f32"), + 0x5d: createSymbolObject("lt", "f32"), + 0x5e: createSymbolObject("gt", "f32"), + 0x5f: createSymbolObject("le", "f32"), + 0x60: createSymbolObject("ge", "f32"), + 0x61: createSymbolObject("eq", "f64"), + 0x62: createSymbolObject("ne", "f64"), + 0x63: createSymbolObject("lt", "f64"), + 0x64: createSymbolObject("gt", "f64"), + 0x65: createSymbolObject("le", "f64"), + 0x66: createSymbolObject("ge", "f64"), + 0x67: createSymbolObject("clz", "i32"), + 0x68: createSymbolObject("ctz", "i32"), + 0x69: createSymbolObject("popcnt", "i32"), + 0x6a: createSymbolObject("add", "i32"), + 0x6b: createSymbolObject("sub", "i32"), + 0x6c: createSymbolObject("mul", "i32"), + 0x6d: createSymbolObject("div_s", "i32"), + 0x6e: createSymbolObject("div_u", "i32"), + 0x6f: createSymbolObject("rem_s", "i32"), + 0x70: createSymbolObject("rem_u", "i32"), + 0x71: createSymbolObject("and", "i32"), + 0x72: createSymbolObject("or", "i32"), + 0x73: createSymbolObject("xor", "i32"), + 0x74: createSymbolObject("shl", "i32"), + 0x75: createSymbolObject("shr_s", "i32"), + 0x76: createSymbolObject("shr_u", "i32"), + 0x77: createSymbolObject("rotl", "i32"), + 0x78: createSymbolObject("rotr", "i32"), + 0x79: createSymbolObject("clz", "i64"), + 0x7a: createSymbolObject("ctz", "i64"), + 0x7b: createSymbolObject("popcnt", "i64"), + 0x7c: createSymbolObject("add", "i64"), + 0x7d: createSymbolObject("sub", "i64"), + 0x7e: createSymbolObject("mul", "i64"), + 0x7f: createSymbolObject("div_s", "i64"), + 0x80: createSymbolObject("div_u", "i64"), + 0x81: createSymbolObject("rem_s", "i64"), + 0x82: createSymbolObject("rem_u", "i64"), + 0x83: createSymbolObject("and", "i64"), + 0x84: createSymbolObject("or", "i64"), + 0x85: createSymbolObject("xor", "i64"), + 0x86: createSymbolObject("shl", "i64"), + 0x87: createSymbolObject("shr_s", "i64"), + 0x88: createSymbolObject("shr_u", "i64"), + 0x89: createSymbolObject("rotl", "i64"), + 0x8a: createSymbolObject("rotr", "i64"), + 0x8b: createSymbolObject("abs", "f32"), + 0x8c: createSymbolObject("neg", "f32"), + 0x8d: createSymbolObject("ceil", "f32"), + 0x8e: createSymbolObject("floor", "f32"), + 0x8f: createSymbolObject("trunc", "f32"), + 0x90: createSymbolObject("nearest", "f32"), + 0x91: createSymbolObject("sqrt", "f32"), + 0x92: createSymbolObject("add", "f32"), + 0x93: createSymbolObject("sub", "f32"), + 0x94: createSymbolObject("mul", "f32"), + 0x95: createSymbolObject("div", "f32"), + 0x96: createSymbolObject("min", "f32"), + 0x97: createSymbolObject("max", "f32"), + 0x98: createSymbolObject("copysign", "f32"), + 0x99: createSymbolObject("abs", "f64"), + 0x9a: createSymbolObject("neg", "f64"), + 0x9b: createSymbolObject("ceil", "f64"), + 0x9c: createSymbolObject("floor", "f64"), + 0x9d: createSymbolObject("trunc", "f64"), + 0x9e: createSymbolObject("nearest", "f64"), + 0x9f: createSymbolObject("sqrt", "f64"), + 0xa0: createSymbolObject("add", "f64"), + 0xa1: createSymbolObject("sub", "f64"), + 0xa2: createSymbolObject("mul", "f64"), + 0xa3: createSymbolObject("div", "f64"), + 0xa4: createSymbolObject("min", "f64"), + 0xa5: createSymbolObject("max", "f64"), + 0xa6: createSymbolObject("copysign", "f64"), + 0xa7: createSymbolObject("wrap/i64", "i32"), + 0xa8: createSymbolObject("trunc_s/f32", "i32"), + 0xa9: createSymbolObject("trunc_u/f32", "i32"), + 0xaa: createSymbolObject("trunc_s/f64", "i32"), + 0xab: createSymbolObject("trunc_u/f64", "i32"), + 0xac: createSymbolObject("extend_s/i32", "i64"), + 0xad: createSymbolObject("extend_u/i32", "i64"), + 0xae: createSymbolObject("trunc_s/f32", "i64"), + 0xaf: createSymbolObject("trunc_u/f32", "i64"), + 0xb0: createSymbolObject("trunc_s/f64", "i64"), + 0xb1: createSymbolObject("trunc_u/f64", "i64"), + 0xb2: createSymbolObject("convert_s/i32", "f32"), + 0xb3: createSymbolObject("convert_u/i32", "f32"), + 0xb4: createSymbolObject("convert_s/i64", "f32"), + 0xb5: createSymbolObject("convert_u/i64", "f32"), + 0xb6: createSymbolObject("demote/f64", "f32"), + 0xb7: createSymbolObject("convert_s/i32", "f64"), + 0xb8: createSymbolObject("convert_u/i32", "f64"), + 0xb9: createSymbolObject("convert_s/i64", "f64"), + 0xba: createSymbolObject("convert_u/i64", "f64"), + 0xbb: createSymbolObject("promote/f32", "f64"), + 0xbc: createSymbolObject("reinterpret/f32", "i32"), + 0xbd: createSymbolObject("reinterpret/f64", "i64"), + 0xbe: createSymbolObject("reinterpret/i32", "f32"), + 0xbf: createSymbolObject("reinterpret/i64", "f64") +}; +var symbolsByName = invertMap(symbolsByByte, function (obj) { + if (typeof obj.object === "string") { + return "".concat(obj.object, ".").concat(obj.name); + } + + return obj.name; +}); +export default { + symbolsByByte: symbolsByByte, + sections: sections, + magicModuleHeader: magicModuleHeader, + moduleVersion: moduleVersion, + types: types, + valtypes: valtypes, + exportTypes: exportTypes, + blockTypes: blockTypes, + tableTypes: tableTypes, + globalTypes: globalTypes, + importTypes: importTypes, + valtypesByString: valtypesByString, + globalTypesByString: globalTypesByString, + exportTypesByName: exportTypesByName, + symbolsByName: symbolsByName +}; +export { getSectionForNode } from "./section"; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-wasm-bytecode/esm/section.js b/node_modules/@webassemblyjs/helper-wasm-bytecode/esm/section.js new file mode 100644 index 0000000..abdc4cf --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-bytecode/esm/section.js @@ -0,0 +1,31 @@ +export function getSectionForNode(n) { + switch (n.type) { + case "ModuleImport": + return "import"; + + case "CallInstruction": + case "CallIndirectInstruction": + case "Func": + case "Instr": + return "code"; + + case "ModuleExport": + return "export"; + + case "Start": + return "start"; + + case "TypeInstruction": + return "type"; + + case "IndexInFuncSection": + return "func"; + + case "Global": + return "global"; + // No section + + default: + return; + } +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/index.js b/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/index.js new file mode 100644 index 0000000..11f81d3 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/index.js @@ -0,0 +1,338 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "getSectionForNode", { + enumerable: true, + get: function get() { + return _section.getSectionForNode; + } +}); +exports.default = void 0; + +var _section = require("./section"); + +var illegalop = "illegal"; +var magicModuleHeader = [0x00, 0x61, 0x73, 0x6d]; +var moduleVersion = [0x01, 0x00, 0x00, 0x00]; + +function invertMap(obj) { + var keyModifierFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (k) { + return k; + }; + var result = {}; + var keys = Object.keys(obj); + + for (var i = 0, length = keys.length; i < length; i++) { + result[keyModifierFn(obj[keys[i]])] = keys[i]; + } + + return result; +} + +function createSymbolObject(name +/*: string */ +, object +/*: string */ +) +/*: Symbol*/ +{ + var numberOfArgs + /*: number*/ + = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + return { + name: name, + object: object, + numberOfArgs: numberOfArgs + }; +} + +function createSymbol(name +/*: string */ +) +/*: Symbol*/ +{ + var numberOfArgs + /*: number*/ + = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + return { + name: name, + numberOfArgs: numberOfArgs + }; +} + +var types = { + func: 0x60, + result: 0x40 +}; +var exportTypes = { + 0x00: "Func", + 0x01: "Table", + 0x02: "Mem", + 0x03: "Global" +}; +var exportTypesByName = invertMap(exportTypes); +var valtypes = { + 0x7f: "i32", + 0x7e: "i64", + 0x7d: "f32", + 0x7c: "f64" +}; +var valtypesByString = invertMap(valtypes); +var tableTypes = { + 0x70: "anyfunc" +}; +var blockTypes = Object.assign({}, valtypes, { + // https://webassembly.github.io/spec/core/binary/types.html#binary-blocktype + 0x40: null, + // https://webassembly.github.io/spec/core/binary/types.html#binary-valtype + 0x7f: "i32", + 0x7e: "i64", + 0x7d: "f32", + 0x7c: "f64" +}); +var globalTypes = { + 0x00: "const", + 0x01: "var" +}; +var globalTypesByString = invertMap(globalTypes); +var importTypes = { + 0x00: "func", + 0x01: "table", + 0x02: "mem", + 0x03: "global" +}; +var sections = { + custom: 0, + type: 1, + import: 2, + func: 3, + table: 4, + memory: 5, + global: 6, + export: 7, + start: 8, + element: 9, + code: 10, + data: 11 +}; +var symbolsByByte = { + 0x00: createSymbol("unreachable"), + 0x01: createSymbol("nop"), + 0x02: createSymbol("block"), + 0x03: createSymbol("loop"), + 0x04: createSymbol("if"), + 0x05: createSymbol("else"), + 0x06: illegalop, + 0x07: illegalop, + 0x08: illegalop, + 0x09: illegalop, + 0x0a: illegalop, + 0x0b: createSymbol("end"), + 0x0c: createSymbol("br", 1), + 0x0d: createSymbol("br_if", 1), + 0x0e: createSymbol("br_table"), + 0x0f: createSymbol("return"), + 0x10: createSymbol("call", 1), + 0x11: createSymbol("call_indirect", 2), + 0x12: illegalop, + 0x13: illegalop, + 0x14: illegalop, + 0x15: illegalop, + 0x16: illegalop, + 0x17: illegalop, + 0x18: illegalop, + 0x19: illegalop, + 0x1a: createSymbol("drop"), + 0x1b: createSymbol("select"), + 0x1c: illegalop, + 0x1d: illegalop, + 0x1e: illegalop, + 0x1f: illegalop, + 0x20: createSymbol("get_local", 1), + 0x21: createSymbol("set_local", 1), + 0x22: createSymbol("tee_local", 1), + 0x23: createSymbol("get_global", 1), + 0x24: createSymbol("set_global", 1), + 0x25: illegalop, + 0x26: illegalop, + 0x27: illegalop, + 0x28: createSymbolObject("load", "u32", 1), + 0x29: createSymbolObject("load", "u64", 1), + 0x2a: createSymbolObject("load", "f32", 1), + 0x2b: createSymbolObject("load", "f64", 1), + 0x2c: createSymbolObject("load8_s", "u32", 1), + 0x2d: createSymbolObject("load8_u", "u32", 1), + 0x2e: createSymbolObject("load16_s", "u32", 1), + 0x2f: createSymbolObject("load16_u", "u32", 1), + 0x30: createSymbolObject("load8_s", "u64", 1), + 0x31: createSymbolObject("load8_u", "u64", 1), + 0x32: createSymbolObject("load16_s", "u64", 1), + 0x33: createSymbolObject("load16_u", "u64", 1), + 0x34: createSymbolObject("load32_s", "u64", 1), + 0x35: createSymbolObject("load32_u", "u64", 1), + 0x36: createSymbolObject("store", "u32", 1), + 0x37: createSymbolObject("store", "u64", 1), + 0x38: createSymbolObject("store", "f32", 1), + 0x39: createSymbolObject("store", "f64", 1), + 0x3a: createSymbolObject("store8", "u32", 1), + 0x3b: createSymbolObject("store16", "u32", 1), + 0x3c: createSymbolObject("store8", "u64", 1), + 0x3d: createSymbolObject("store16", "u64", 1), + 0x3e: createSymbolObject("store32", "u64", 1), + 0x3f: createSymbolObject("current_memory"), + 0x40: createSymbolObject("grow_memory"), + 0x41: createSymbolObject("const", "i32", 1), + 0x42: createSymbolObject("const", "i64", 1), + 0x43: createSymbolObject("const", "f32", 1), + 0x44: createSymbolObject("const", "f64", 1), + 0x45: createSymbolObject("eqz", "i32"), + 0x46: createSymbolObject("eq", "i32"), + 0x47: createSymbolObject("ne", "i32"), + 0x48: createSymbolObject("lt_s", "i32"), + 0x49: createSymbolObject("lt_u", "i32"), + 0x4a: createSymbolObject("gt_s", "i32"), + 0x4b: createSymbolObject("gt_u", "i32"), + 0x4c: createSymbolObject("le_s", "i32"), + 0x4d: createSymbolObject("le_u", "i32"), + 0x4e: createSymbolObject("ge_s", "i32"), + 0x4f: createSymbolObject("ge_u", "i32"), + 0x50: createSymbolObject("eqz", "i64"), + 0x51: createSymbolObject("eq", "i64"), + 0x52: createSymbolObject("ne", "i64"), + 0x53: createSymbolObject("lt_s", "i64"), + 0x54: createSymbolObject("lt_u", "i64"), + 0x55: createSymbolObject("gt_s", "i64"), + 0x56: createSymbolObject("gt_u", "i64"), + 0x57: createSymbolObject("le_s", "i64"), + 0x58: createSymbolObject("le_u", "i64"), + 0x59: createSymbolObject("ge_s", "i64"), + 0x5a: createSymbolObject("ge_u", "i64"), + 0x5b: createSymbolObject("eq", "f32"), + 0x5c: createSymbolObject("ne", "f32"), + 0x5d: createSymbolObject("lt", "f32"), + 0x5e: createSymbolObject("gt", "f32"), + 0x5f: createSymbolObject("le", "f32"), + 0x60: createSymbolObject("ge", "f32"), + 0x61: createSymbolObject("eq", "f64"), + 0x62: createSymbolObject("ne", "f64"), + 0x63: createSymbolObject("lt", "f64"), + 0x64: createSymbolObject("gt", "f64"), + 0x65: createSymbolObject("le", "f64"), + 0x66: createSymbolObject("ge", "f64"), + 0x67: createSymbolObject("clz", "i32"), + 0x68: createSymbolObject("ctz", "i32"), + 0x69: createSymbolObject("popcnt", "i32"), + 0x6a: createSymbolObject("add", "i32"), + 0x6b: createSymbolObject("sub", "i32"), + 0x6c: createSymbolObject("mul", "i32"), + 0x6d: createSymbolObject("div_s", "i32"), + 0x6e: createSymbolObject("div_u", "i32"), + 0x6f: createSymbolObject("rem_s", "i32"), + 0x70: createSymbolObject("rem_u", "i32"), + 0x71: createSymbolObject("and", "i32"), + 0x72: createSymbolObject("or", "i32"), + 0x73: createSymbolObject("xor", "i32"), + 0x74: createSymbolObject("shl", "i32"), + 0x75: createSymbolObject("shr_s", "i32"), + 0x76: createSymbolObject("shr_u", "i32"), + 0x77: createSymbolObject("rotl", "i32"), + 0x78: createSymbolObject("rotr", "i32"), + 0x79: createSymbolObject("clz", "i64"), + 0x7a: createSymbolObject("ctz", "i64"), + 0x7b: createSymbolObject("popcnt", "i64"), + 0x7c: createSymbolObject("add", "i64"), + 0x7d: createSymbolObject("sub", "i64"), + 0x7e: createSymbolObject("mul", "i64"), + 0x7f: createSymbolObject("div_s", "i64"), + 0x80: createSymbolObject("div_u", "i64"), + 0x81: createSymbolObject("rem_s", "i64"), + 0x82: createSymbolObject("rem_u", "i64"), + 0x83: createSymbolObject("and", "i64"), + 0x84: createSymbolObject("or", "i64"), + 0x85: createSymbolObject("xor", "i64"), + 0x86: createSymbolObject("shl", "i64"), + 0x87: createSymbolObject("shr_s", "i64"), + 0x88: createSymbolObject("shr_u", "i64"), + 0x89: createSymbolObject("rotl", "i64"), + 0x8a: createSymbolObject("rotr", "i64"), + 0x8b: createSymbolObject("abs", "f32"), + 0x8c: createSymbolObject("neg", "f32"), + 0x8d: createSymbolObject("ceil", "f32"), + 0x8e: createSymbolObject("floor", "f32"), + 0x8f: createSymbolObject("trunc", "f32"), + 0x90: createSymbolObject("nearest", "f32"), + 0x91: createSymbolObject("sqrt", "f32"), + 0x92: createSymbolObject("add", "f32"), + 0x93: createSymbolObject("sub", "f32"), + 0x94: createSymbolObject("mul", "f32"), + 0x95: createSymbolObject("div", "f32"), + 0x96: createSymbolObject("min", "f32"), + 0x97: createSymbolObject("max", "f32"), + 0x98: createSymbolObject("copysign", "f32"), + 0x99: createSymbolObject("abs", "f64"), + 0x9a: createSymbolObject("neg", "f64"), + 0x9b: createSymbolObject("ceil", "f64"), + 0x9c: createSymbolObject("floor", "f64"), + 0x9d: createSymbolObject("trunc", "f64"), + 0x9e: createSymbolObject("nearest", "f64"), + 0x9f: createSymbolObject("sqrt", "f64"), + 0xa0: createSymbolObject("add", "f64"), + 0xa1: createSymbolObject("sub", "f64"), + 0xa2: createSymbolObject("mul", "f64"), + 0xa3: createSymbolObject("div", "f64"), + 0xa4: createSymbolObject("min", "f64"), + 0xa5: createSymbolObject("max", "f64"), + 0xa6: createSymbolObject("copysign", "f64"), + 0xa7: createSymbolObject("wrap/i64", "i32"), + 0xa8: createSymbolObject("trunc_s/f32", "i32"), + 0xa9: createSymbolObject("trunc_u/f32", "i32"), + 0xaa: createSymbolObject("trunc_s/f64", "i32"), + 0xab: createSymbolObject("trunc_u/f64", "i32"), + 0xac: createSymbolObject("extend_s/i32", "i64"), + 0xad: createSymbolObject("extend_u/i32", "i64"), + 0xae: createSymbolObject("trunc_s/f32", "i64"), + 0xaf: createSymbolObject("trunc_u/f32", "i64"), + 0xb0: createSymbolObject("trunc_s/f64", "i64"), + 0xb1: createSymbolObject("trunc_u/f64", "i64"), + 0xb2: createSymbolObject("convert_s/i32", "f32"), + 0xb3: createSymbolObject("convert_u/i32", "f32"), + 0xb4: createSymbolObject("convert_s/i64", "f32"), + 0xb5: createSymbolObject("convert_u/i64", "f32"), + 0xb6: createSymbolObject("demote/f64", "f32"), + 0xb7: createSymbolObject("convert_s/i32", "f64"), + 0xb8: createSymbolObject("convert_u/i32", "f64"), + 0xb9: createSymbolObject("convert_s/i64", "f64"), + 0xba: createSymbolObject("convert_u/i64", "f64"), + 0xbb: createSymbolObject("promote/f32", "f64"), + 0xbc: createSymbolObject("reinterpret/f32", "i32"), + 0xbd: createSymbolObject("reinterpret/f64", "i64"), + 0xbe: createSymbolObject("reinterpret/i32", "f32"), + 0xbf: createSymbolObject("reinterpret/i64", "f64") +}; +var symbolsByName = invertMap(symbolsByByte, function (obj) { + if (typeof obj.object === "string") { + return "".concat(obj.object, ".").concat(obj.name); + } + + return obj.name; +}); +var _default = { + symbolsByByte: symbolsByByte, + sections: sections, + magicModuleHeader: magicModuleHeader, + moduleVersion: moduleVersion, + types: types, + valtypes: valtypes, + exportTypes: exportTypes, + blockTypes: blockTypes, + tableTypes: tableTypes, + globalTypes: globalTypes, + importTypes: importTypes, + valtypesByString: valtypesByString, + globalTypesByString: globalTypesByString, + exportTypesByName: exportTypesByName, + symbolsByName: symbolsByName +}; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/section.js b/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/section.js new file mode 100644 index 0000000..23f6b2b --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/section.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getSectionForNode = getSectionForNode; + +function getSectionForNode(n) { + switch (n.type) { + case "ModuleImport": + return "import"; + + case "CallInstruction": + case "CallIndirectInstruction": + case "Func": + case "Instr": + return "code"; + + case "ModuleExport": + return "export"; + + case "Start": + return "start"; + + case "TypeInstruction": + return "type"; + + case "IndexInFuncSection": + return "func"; + + case "Global": + return "global"; + // No section + + default: + return; + } +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-wasm-bytecode/package.json b/node_modules/@webassemblyjs/helper-wasm-bytecode/package.json new file mode 100644 index 0000000..d149934 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-bytecode/package.json @@ -0,0 +1,56 @@ +{ + "_from": "@webassemblyjs/helper-wasm-bytecode@1.8.5", + "_id": "@webassemblyjs/helper-wasm-bytecode@1.8.5", + "_inBundle": false, + "_integrity": "sha512-Cu4YMYG3Ddl72CbmpjU/wbP6SACcOPVbHN1dI4VJNJVgFwaKf1ppeFJrwydOG3NDHxVGuCfPlLZNyEdIYlQ6QQ==", + "_location": "/@webassemblyjs/helper-wasm-bytecode", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/helper-wasm-bytecode@1.8.5", + "name": "@webassemblyjs/helper-wasm-bytecode", + "escapedName": "@webassemblyjs%2fhelper-wasm-bytecode", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/ast", + "/@webassemblyjs/helper-wasm-section", + "/@webassemblyjs/wasm-edit", + "/@webassemblyjs/wasm-gen", + "/@webassemblyjs/wasm-parser" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.8.5.tgz", + "_shasum": "537a750eddf5c1e932f3744206551c91c1b93e61", + "_spec": "@webassemblyjs/helper-wasm-bytecode@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/ast", + "author": { + "name": "Sven Sauleau" + }, + "bugs": { + "url": "https://github.com/xtuc/webassemblyjs/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "WASM's Bytecode constants", + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "homepage": "https://github.com/xtuc/webassemblyjs#readme", + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/helper-wasm-bytecode", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/xtuc/webassemblyjs.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/helper-wasm-bytecode/webassemblyjs-helper-wasm-bytecode-1.7.10.tgz b/node_modules/@webassemblyjs/helper-wasm-bytecode/webassemblyjs-helper-wasm-bytecode-1.7.10.tgz new file mode 100644 index 0000000000000000000000000000000000000000..3456c42e4bb57ddfcee13e8d0c57175d1619c67e GIT binary patch literal 3848 zcmYL_cQhOB+lK{Fd+*h%Jz|FrBT7rDy{Q^CYEx|}Y8FL}R8gCnjTO7Zimi6VND+I~ zj8OVD;@3LwIq!3xb3ONc-Jf&+@!X6jC%Qf)d)A(Qa|(?6E|-+qUL`I~aIAz5t<5QX z_GQIgYrK}WUxxf@frysF0~qDw-V-PMqBq+Tm6p#QbXzCTf6ehWAOOl{p+prX3w5_T z7-8}DSa-R!S!!NXI-K-SKrYaV!~08T+-tpQX^|sl<#V3IwC&uyE1SmtMOzqP!7p`l zLK*K}*0f+kx>BCl2U8or?sBqnLh#V0Gd*r(zB!aletI7B@+!t!ZuUaDgRXfU6wnY& ze6#uHY;L@4WneYd?fW*6PGS)oZ8%v@INtUK1o6ho4*8)lUhG=Oef7ZMnoXKH8{GX{ zw&)cQG;xc8PN7-Bl`rhk?md%tO5{MaRnYFtcIT<`qFq%#A{=P#h0)293aPC1?r^#o zrL`=l{FoP|;Kx>_e6zRoX7f;q&@9;h$H(W^^E4WYRnc;mn@5#wvjv-r;ym9LDaXIl z0?Faf_DJxK^gP+4LI7xIq1Ee6R-etcI!+G78AHim<4{HaUAwp2%{oD;KczwOH}1Tk zKo|j%+m|+ov(jQ>G|gt*pn;Wz*xCh|xjpB}Y{mPP&Mug39*F?t!k+SuiFls);f1E} z;y3PG+DDV9(09-2`a_XZ=#>u4zQWL-D@Ho$EF0}F=3=GT6Ks?DPV%1RdBuVUj|^C1 zHVN=4gw~Pb*M)KM%aO|jo+Y==-LT5$vCUJDb@k6j4--IdM>Conr+*%sxAr|q%Gg(q zbON4mY>cQ|ka+m_KC$3#JY|7IyBjbC4B@7a?}o8aKj^LVU^=dea@kXur_p`tF#7`< z(0S4Yj=?1ez|Xq|BC_;)p&X69y1T4h<8x8NF;S={5Zds0qx)SX@Py9`x|_gb3GrP{ z&L`IP2Yetpw|tIxfYG^FbFeT(PtSHenmV!}PYr)>a_m9VKYdQRQ zvqS7yzk0#mEYg`d*U&VW*h4EelyeaASkjS|_uCVT;QmT_cl!2Y?tWx%0qQ#v;j0mD z_;omcFgxgGGkbit_Y74*c`el)z}zdd!V){rd$d_c1NL@o^X_8ZhZC(9i=LDA)?;iZ z`0k3x%XmOm;+RYISqgwl5A)mcVhHEq(+9s4{ZtM@rRh>*(S>ZgcLx&sAlrNfT%Sh!sA(R-qa#Jd zkepBSr1ED&Ra&`6pUsGEc4Nq2=OzhPj8&bdU~tFlPN7{@wt7|llYq~vBn^ejTfxL; zWag0*6|`mri8LYM#97adrKBcIimw<0RZ)bR$;00}gSg(_4>lj9#>fo*3no(DQSIQ? zGL|lz93tT0eWPdQmuw__U@}k&WtZc@Yjw7O)9hjnX zNS}#xiTfcpM;7iSQ+IKIm2czK=gk6-K`zD(0++pt}P)9~z{X z1HjT7se;gpbqQoT9{X*JNwhO6boNqC2T6xd-g0B2<+?^GP+O%%lr2nIBu=we!=(QXYu4w`}*rDGR37n#J~oP%hVqh%Ld) z4=tdmq-CwVvq}72?(~w=tme&u{rzR}XT^s(C|oeHaKr&;Dra^F0%YDM_1%a)?$GfY zawPkF)oIZdXb{D231l}@y1Tc#R(~@yTR~6n=nhZ%D;nq={ne17IOaM3*{9cTV;_Q5 zRVQ;r@q?2z1b?}sL)2AtxP!~#Tjtm}ZJ#BwXqP&(*x2ZGy*j*QpLj=i;m;>96z*Nq zpdUTUK^=RiL2ia$Oh1cfu;@nCw*aDEwnW94*M*RSqjQE2fcjG3s``DM3(ZLixtuMK z+Sj+^i5|yySdls3zIC!;>!-RLno>R|O(}QeeIGQf>`#FGqSs9O4WUye@)q0b(AbgCv?5zt?|If7l&3Pom;x>+oUl9G>A<(xCWTNU+QfRq7>NkWo z6m89|5%!9B;NY9c--xhM+CL!zoZN{!VW?bticm3@QR;Yui#8E@3rQ&8Sw zwX^d@7K=aKGJRTYFG6hEY~`e4QjEQ!)LAfFV5 zSL&Ns=arqn3}4-PN3Xz^-_g?jS{Zz_%OLMXDf%;*y={0qS2bdEyYa>Ggs#E(?_PCc zBr!mbs=g&kD2+~=dG^i=6_vPQ1f5k<(rxi^0!`t7Hupuep`+lv`W`jpc;9j)<3oj( zUPc7Vd244)TmO>fo(8i3PQsM#y|mWy--es~kD=OTtQP$rvnEIwIax2HQC&l#jI5Se zLxLPIk=jbcKsh~nx-9L-Kc;r5jpggITMue_Bf>y5VJLgAMCfvh{#buG!^@w1Ul=Dr zcaQYYIKb>aDv+>j>pS*b00kxR(Fp|XAjL_`gz{+ZORb^??-m_7zDrz ztxbWXI?Aea0v3U#{1lmFJFV71r23H!)pU9HFvMnDDk!r>ss>5=SHLm_$%txS>Y|As z`~#f*VG#lY@SZSYp+EoXBE2d@Y7wo7O5cAhccm_x<^T7HSo|L=uWQ8h7{O5Y_p4^^ z^E|EvA58Oavq;1OfI4lVf-?Db6pcbM`4EbhYqn<|-D=Y3g=G=Mk^~0aeCGz$DHW4`+X5KtQjE>4ROWY03vK{0+Z{aTz) z@k0o$T_A+Q{L8GkYk+`{$H66O5dvGB#yV<7uM*0NZ&9@Lp^cJBZRF5KOQbH|Z~f+y zRXxkN+8)!JKRM7HPwwz?6d>Q%jqpjOj^ee zvw@MT;aZ!RV`I#md#%6rWG@9`t>Z{h|NV6oXNuAn)^6L9P9vFz8c1-M>#sO0_?9 zmcsB7F0s}t2?Z^}Pij+An9NfBL*UIic2jOV8@;mKZOn8$aP!ltz}Am-c^&Ur6uINA z8SqJ$9;kF7EWbK`#y%(Jc8f^+J3E0zgc&m2Wy_Sf6pNIredxhb!~#|XsEyztvKY0$Mx0O(+|RmB8S_`_HV@mE0UP`e+vwHH2VM2UfvL@~$6_3T zrn)(Tv4hO8j}tv14&uCe>q`;T%B~A zSM`}Akr$VX(7H*Wz12(gm9GSB2+ZeO3F2p7s2wIL+_~NVrDej7Uka;H z0@;Lg=5;`Qv*k!q$Bp`Yyy{Jw>$<2?aMdAz~1 z^mKIfTW>1Oz4NU`DAA4OEH2&waJ^MLUOta6OSYw&I}coVI}Ma6O0K#Rj!L^P7L~Uz52`<1O>VzFzQ~L0#uHA{19Hy@ o{@fRV(D~S0>msa=BvaD&o@~ literal 0 HcmV?d00001 diff --git a/node_modules/@webassemblyjs/helper-wasm-section/LICENSE b/node_modules/@webassemblyjs/helper-wasm-section/LICENSE new file mode 100644 index 0000000..87e7e1f --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-section/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sven Sauleau + +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. diff --git a/node_modules/@webassemblyjs/helper-wasm-section/esm/create.js b/node_modules/@webassemblyjs/helper-wasm-section/esm/create.js new file mode 100644 index 0000000..3797978 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-section/esm/create.js @@ -0,0 +1,107 @@ +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +import { encodeNode } from "@webassemblyjs/wasm-gen"; +import { overrideBytesInBuffer } from "@webassemblyjs/helper-buffer"; +import constants from "@webassemblyjs/helper-wasm-bytecode"; +import * as t from "@webassemblyjs/ast"; + +function findLastSection(ast, forSection) { + var targetSectionId = constants.sections[forSection]; // $FlowIgnore: metadata can not be empty + + var moduleSections = ast.body[0].metadata.sections; + var lastSection; + var lastId = 0; + + for (var i = 0, len = moduleSections.length; i < len; i++) { + var section = moduleSections[i]; // Ignore custom section since they can actually occur everywhere + + if (section.section === "custom") { + continue; + } + + var sectionId = constants.sections[section.section]; + + if (targetSectionId > lastId && targetSectionId < sectionId) { + return lastSection; + } + + lastId = sectionId; + lastSection = section; + } + + return lastSection; +} + +export function createEmptySection(ast, uint8Buffer, section) { + // previous section after which we are going to insert our section + var lastSection = findLastSection(ast, section); + var start, end; + /** + * It's the first section + */ + + if (lastSection == null || lastSection.section === "custom") { + start = 8 + /* wasm header size */ + ; + end = start; + } else { + start = lastSection.startOffset + lastSection.size.value + 1; + end = start; + } // section id + + + start += 1; + var sizeStartLoc = { + line: -1, + column: start + }; + var sizeEndLoc = { + line: -1, + column: start + 1 + }; // 1 byte for the empty vector + + var size = t.withLoc(t.numberLiteralFromRaw(1), sizeEndLoc, sizeStartLoc); + var vectorOfSizeStartLoc = { + line: -1, + column: sizeEndLoc.column + }; + var vectorOfSizeEndLoc = { + line: -1, + column: sizeEndLoc.column + 1 + }; + var vectorOfSize = t.withLoc(t.numberLiteralFromRaw(0), vectorOfSizeEndLoc, vectorOfSizeStartLoc); + var sectionMetadata = t.sectionMetadata(section, start, size, vectorOfSize); + var sectionBytes = encodeNode(sectionMetadata); + uint8Buffer = overrideBytesInBuffer(uint8Buffer, start - 1, end, sectionBytes); // Add section into the AST for later lookups + + if (_typeof(ast.body[0].metadata) === "object") { + // $FlowIgnore: metadata can not be empty + ast.body[0].metadata.sections.push(sectionMetadata); + t.sortSectionMetadata(ast.body[0]); + } + /** + * Update AST + */ + // Once we hit our section every that is after needs to be shifted by the delta + + + var deltaBytes = +sectionBytes.length; + var encounteredSection = false; + t.traverse(ast, { + SectionMetadata: function SectionMetadata(path) { + if (path.node.section === section) { + encounteredSection = true; + return; + } + + if (encounteredSection === true) { + t.shiftSection(ast, path.node, deltaBytes); + } + } + }); + return { + uint8Buffer: uint8Buffer, + sectionMetadata: sectionMetadata + }; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-wasm-section/esm/index.js b/node_modules/@webassemblyjs/helper-wasm-section/esm/index.js new file mode 100644 index 0000000..91afb0a --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-section/esm/index.js @@ -0,0 +1,3 @@ +export { resizeSectionByteSize, resizeSectionVecSize } from "./resize"; +export { createEmptySection } from "./create"; +export { removeSections } from "./remove"; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-wasm-section/esm/remove.js b/node_modules/@webassemblyjs/helper-wasm-section/esm/remove.js new file mode 100644 index 0000000..3ed85a0 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-section/esm/remove.js @@ -0,0 +1,36 @@ +import { traverse, getSectionMetadatas, shiftSection } from "@webassemblyjs/ast"; +import { overrideBytesInBuffer } from "@webassemblyjs/helper-buffer"; +export function removeSections(ast, uint8Buffer, section) { + var sectionMetadatas = getSectionMetadatas(ast, section); + + if (sectionMetadatas.length === 0) { + throw new Error("Section metadata not found"); + } + + return sectionMetadatas.reverse().reduce(function (uint8Buffer, sectionMetadata) { + var startsIncludingId = sectionMetadata.startOffset - 1; + var ends = section === "start" ? sectionMetadata.size.loc.end.column + 1 : sectionMetadata.startOffset + sectionMetadata.size.value + 1; + var delta = -(ends - startsIncludingId); + /** + * update AST + */ + // Once we hit our section every that is after needs to be shifted by the delta + + var encounteredSection = false; + traverse(ast, { + SectionMetadata: function SectionMetadata(path) { + if (path.node.section === section) { + encounteredSection = true; + return path.remove(); + } + + if (encounteredSection === true) { + shiftSection(ast, path.node, delta); + } + } + }); // replacement is nothing + + var replacement = []; + return overrideBytesInBuffer(uint8Buffer, startsIncludingId, ends, replacement); + }, uint8Buffer); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-wasm-section/esm/resize.js b/node_modules/@webassemblyjs/helper-wasm-section/esm/resize.js new file mode 100644 index 0000000..9792078 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-section/esm/resize.js @@ -0,0 +1,78 @@ +import { encodeU32 } from "@webassemblyjs/wasm-gen"; +import { getSectionMetadata, traverse, shiftSection } from "@webassemblyjs/ast"; +import { overrideBytesInBuffer } from "@webassemblyjs/helper-buffer"; +export function resizeSectionByteSize(ast, uint8Buffer, section, deltaBytes) { + var sectionMetadata = getSectionMetadata(ast, section); + + if (typeof sectionMetadata === "undefined") { + throw new Error("Section metadata not found"); + } + + if (typeof sectionMetadata.size.loc === "undefined") { + throw new Error("SectionMetadata " + section + " has no loc"); + } // keep old node location to be overriden + + + var start = sectionMetadata.size.loc.start.column; + var end = sectionMetadata.size.loc.end.column; + var newSectionSize = sectionMetadata.size.value + deltaBytes; + var newBytes = encodeU32(newSectionSize); + /** + * update AST + */ + + sectionMetadata.size.value = newSectionSize; + var oldu32EncodedLen = end - start; + var newu32EncodedLen = newBytes.length; // the new u32 has a different encoded length + + if (newu32EncodedLen !== oldu32EncodedLen) { + var deltaInSizeEncoding = newu32EncodedLen - oldu32EncodedLen; + sectionMetadata.size.loc.end.column = start + newu32EncodedLen; + deltaBytes += deltaInSizeEncoding; // move the vec size pointer size the section size is now smaller + + sectionMetadata.vectorOfSize.loc.start.column += deltaInSizeEncoding; + sectionMetadata.vectorOfSize.loc.end.column += deltaInSizeEncoding; + } // Once we hit our section every that is after needs to be shifted by the delta + + + var encounteredSection = false; + traverse(ast, { + SectionMetadata: function SectionMetadata(path) { + if (path.node.section === section) { + encounteredSection = true; + return; + } + + if (encounteredSection === true) { + shiftSection(ast, path.node, deltaBytes); + } + } + }); + return overrideBytesInBuffer(uint8Buffer, start, end, newBytes); +} +export function resizeSectionVecSize(ast, uint8Buffer, section, deltaElements) { + var sectionMetadata = getSectionMetadata(ast, section); + + if (typeof sectionMetadata === "undefined") { + throw new Error("Section metadata not found"); + } + + if (typeof sectionMetadata.vectorOfSize.loc === "undefined") { + throw new Error("SectionMetadata " + section + " has no loc"); + } // Section has no vector + + + if (sectionMetadata.vectorOfSize.value === -1) { + return uint8Buffer; + } // keep old node location to be overriden + + + var start = sectionMetadata.vectorOfSize.loc.start.column; + var end = sectionMetadata.vectorOfSize.loc.end.column; + var newValue = sectionMetadata.vectorOfSize.value + deltaElements; + var newBytes = encodeU32(newValue); // Update AST + + sectionMetadata.vectorOfSize.value = newValue; + sectionMetadata.vectorOfSize.loc.end.column = start + newBytes.length; + return overrideBytesInBuffer(uint8Buffer, start, end, newBytes); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-wasm-section/lib/create.js b/node_modules/@webassemblyjs/helper-wasm-section/lib/create.js new file mode 100644 index 0000000..9506eac --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-section/lib/create.js @@ -0,0 +1,121 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createEmptySection = createEmptySection; + +var _wasmGen = require("@webassemblyjs/wasm-gen"); + +var _helperBuffer = require("@webassemblyjs/helper-buffer"); + +var _helperWasmBytecode = _interopRequireDefault(require("@webassemblyjs/helper-wasm-bytecode")); + +var t = _interopRequireWildcard(require("@webassemblyjs/ast")); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function findLastSection(ast, forSection) { + var targetSectionId = _helperWasmBytecode.default.sections[forSection]; // $FlowIgnore: metadata can not be empty + + var moduleSections = ast.body[0].metadata.sections; + var lastSection; + var lastId = 0; + + for (var i = 0, len = moduleSections.length; i < len; i++) { + var section = moduleSections[i]; // Ignore custom section since they can actually occur everywhere + + if (section.section === "custom") { + continue; + } + + var sectionId = _helperWasmBytecode.default.sections[section.section]; + + if (targetSectionId > lastId && targetSectionId < sectionId) { + return lastSection; + } + + lastId = sectionId; + lastSection = section; + } + + return lastSection; +} + +function createEmptySection(ast, uint8Buffer, section) { + // previous section after which we are going to insert our section + var lastSection = findLastSection(ast, section); + var start, end; + /** + * It's the first section + */ + + if (lastSection == null || lastSection.section === "custom") { + start = 8 + /* wasm header size */ + ; + end = start; + } else { + start = lastSection.startOffset + lastSection.size.value + 1; + end = start; + } // section id + + + start += 1; + var sizeStartLoc = { + line: -1, + column: start + }; + var sizeEndLoc = { + line: -1, + column: start + 1 + }; // 1 byte for the empty vector + + var size = t.withLoc(t.numberLiteralFromRaw(1), sizeEndLoc, sizeStartLoc); + var vectorOfSizeStartLoc = { + line: -1, + column: sizeEndLoc.column + }; + var vectorOfSizeEndLoc = { + line: -1, + column: sizeEndLoc.column + 1 + }; + var vectorOfSize = t.withLoc(t.numberLiteralFromRaw(0), vectorOfSizeEndLoc, vectorOfSizeStartLoc); + var sectionMetadata = t.sectionMetadata(section, start, size, vectorOfSize); + var sectionBytes = (0, _wasmGen.encodeNode)(sectionMetadata); + uint8Buffer = (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start - 1, end, sectionBytes); // Add section into the AST for later lookups + + if (_typeof(ast.body[0].metadata) === "object") { + // $FlowIgnore: metadata can not be empty + ast.body[0].metadata.sections.push(sectionMetadata); + t.sortSectionMetadata(ast.body[0]); + } + /** + * Update AST + */ + // Once we hit our section every that is after needs to be shifted by the delta + + + var deltaBytes = +sectionBytes.length; + var encounteredSection = false; + t.traverse(ast, { + SectionMetadata: function SectionMetadata(path) { + if (path.node.section === section) { + encounteredSection = true; + return; + } + + if (encounteredSection === true) { + t.shiftSection(ast, path.node, deltaBytes); + } + } + }); + return { + uint8Buffer: uint8Buffer, + sectionMetadata: sectionMetadata + }; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-wasm-section/lib/index.js b/node_modules/@webassemblyjs/helper-wasm-section/lib/index.js new file mode 100644 index 0000000..3c7963c --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-section/lib/index.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "resizeSectionByteSize", { + enumerable: true, + get: function get() { + return _resize.resizeSectionByteSize; + } +}); +Object.defineProperty(exports, "resizeSectionVecSize", { + enumerable: true, + get: function get() { + return _resize.resizeSectionVecSize; + } +}); +Object.defineProperty(exports, "createEmptySection", { + enumerable: true, + get: function get() { + return _create.createEmptySection; + } +}); +Object.defineProperty(exports, "removeSections", { + enumerable: true, + get: function get() { + return _remove.removeSections; + } +}); + +var _resize = require("./resize"); + +var _create = require("./create"); + +var _remove = require("./remove"); \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-wasm-section/lib/remove.js b/node_modules/@webassemblyjs/helper-wasm-section/lib/remove.js new file mode 100644 index 0000000..008f5d6 --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-section/lib/remove.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.removeSections = removeSections; + +var _ast = require("@webassemblyjs/ast"); + +var _helperBuffer = require("@webassemblyjs/helper-buffer"); + +function removeSections(ast, uint8Buffer, section) { + var sectionMetadatas = (0, _ast.getSectionMetadatas)(ast, section); + + if (sectionMetadatas.length === 0) { + throw new Error("Section metadata not found"); + } + + return sectionMetadatas.reverse().reduce(function (uint8Buffer, sectionMetadata) { + var startsIncludingId = sectionMetadata.startOffset - 1; + var ends = section === "start" ? sectionMetadata.size.loc.end.column + 1 : sectionMetadata.startOffset + sectionMetadata.size.value + 1; + var delta = -(ends - startsIncludingId); + /** + * update AST + */ + // Once we hit our section every that is after needs to be shifted by the delta + + var encounteredSection = false; + (0, _ast.traverse)(ast, { + SectionMetadata: function SectionMetadata(path) { + if (path.node.section === section) { + encounteredSection = true; + return path.remove(); + } + + if (encounteredSection === true) { + (0, _ast.shiftSection)(ast, path.node, delta); + } + } + }); // replacement is nothing + + var replacement = []; + return (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, startsIncludingId, ends, replacement); + }, uint8Buffer); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-wasm-section/lib/resize.js b/node_modules/@webassemblyjs/helper-wasm-section/lib/resize.js new file mode 100644 index 0000000..524cacb --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-section/lib/resize.js @@ -0,0 +1,90 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.resizeSectionByteSize = resizeSectionByteSize; +exports.resizeSectionVecSize = resizeSectionVecSize; + +var _wasmGen = require("@webassemblyjs/wasm-gen"); + +var _ast = require("@webassemblyjs/ast"); + +var _helperBuffer = require("@webassemblyjs/helper-buffer"); + +function resizeSectionByteSize(ast, uint8Buffer, section, deltaBytes) { + var sectionMetadata = (0, _ast.getSectionMetadata)(ast, section); + + if (typeof sectionMetadata === "undefined") { + throw new Error("Section metadata not found"); + } + + if (typeof sectionMetadata.size.loc === "undefined") { + throw new Error("SectionMetadata " + section + " has no loc"); + } // keep old node location to be overriden + + + var start = sectionMetadata.size.loc.start.column; + var end = sectionMetadata.size.loc.end.column; + var newSectionSize = sectionMetadata.size.value + deltaBytes; + var newBytes = (0, _wasmGen.encodeU32)(newSectionSize); + /** + * update AST + */ + + sectionMetadata.size.value = newSectionSize; + var oldu32EncodedLen = end - start; + var newu32EncodedLen = newBytes.length; // the new u32 has a different encoded length + + if (newu32EncodedLen !== oldu32EncodedLen) { + var deltaInSizeEncoding = newu32EncodedLen - oldu32EncodedLen; + sectionMetadata.size.loc.end.column = start + newu32EncodedLen; + deltaBytes += deltaInSizeEncoding; // move the vec size pointer size the section size is now smaller + + sectionMetadata.vectorOfSize.loc.start.column += deltaInSizeEncoding; + sectionMetadata.vectorOfSize.loc.end.column += deltaInSizeEncoding; + } // Once we hit our section every that is after needs to be shifted by the delta + + + var encounteredSection = false; + (0, _ast.traverse)(ast, { + SectionMetadata: function SectionMetadata(path) { + if (path.node.section === section) { + encounteredSection = true; + return; + } + + if (encounteredSection === true) { + (0, _ast.shiftSection)(ast, path.node, deltaBytes); + } + } + }); + return (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newBytes); +} + +function resizeSectionVecSize(ast, uint8Buffer, section, deltaElements) { + var sectionMetadata = (0, _ast.getSectionMetadata)(ast, section); + + if (typeof sectionMetadata === "undefined") { + throw new Error("Section metadata not found"); + } + + if (typeof sectionMetadata.vectorOfSize.loc === "undefined") { + throw new Error("SectionMetadata " + section + " has no loc"); + } // Section has no vector + + + if (sectionMetadata.vectorOfSize.value === -1) { + return uint8Buffer; + } // keep old node location to be overriden + + + var start = sectionMetadata.vectorOfSize.loc.start.column; + var end = sectionMetadata.vectorOfSize.loc.end.column; + var newValue = sectionMetadata.vectorOfSize.value + deltaElements; + var newBytes = (0, _wasmGen.encodeU32)(newValue); // Update AST + + sectionMetadata.vectorOfSize.value = newValue; + sectionMetadata.vectorOfSize.loc.end.column = start + newBytes.length; + return (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newBytes); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/helper-wasm-section/package.json b/node_modules/@webassemblyjs/helper-wasm-section/package.json new file mode 100644 index 0000000..acd3a6f --- /dev/null +++ b/node_modules/@webassemblyjs/helper-wasm-section/package.json @@ -0,0 +1,61 @@ +{ + "_from": "@webassemblyjs/helper-wasm-section@1.8.5", + "_id": "@webassemblyjs/helper-wasm-section@1.8.5", + "_inBundle": false, + "_integrity": "sha512-VV083zwR+VTrIWWtgIUpqfvVdK4ff38loRmrdDBgBT8ADXYsEZ5mPQ4Nde90N3UYatHdYoDIFb7oHzMncI02tA==", + "_location": "/@webassemblyjs/helper-wasm-section", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/helper-wasm-section@1.8.5", + "name": "@webassemblyjs/helper-wasm-section", + "escapedName": "@webassemblyjs%2fhelper-wasm-section", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/wasm-edit" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.8.5.tgz", + "_shasum": "74ca6a6bcbe19e50a3b6b462847e69503e6bfcbf", + "_spec": "@webassemblyjs/helper-wasm-section@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/wasm-edit", + "author": { + "name": "Sven Sauleau" + }, + "bugs": { + "url": "https://github.com/xtuc/webassemblyjs/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5" + }, + "deprecated": false, + "description": "", + "devDependencies": { + "@webassemblyjs/wasm-parser": "1.8.5" + }, + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "homepage": "https://github.com/xtuc/webassemblyjs#readme", + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/helper-wasm-section", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/xtuc/webassemblyjs.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/helper-wasm-section/webassemblyjs-helper-wasm-section-1.7.10.tgz b/node_modules/@webassemblyjs/helper-wasm-section/webassemblyjs-helper-wasm-section-1.7.10.tgz new file mode 100644 index 0000000000000000000000000000000000000000..71749e87cb3cddc4371d997addc1c1e6f2bf0367 GIT binary patch literal 3890 zcmV-256$o&iwFP!000001MM7ZR~t9BpXXQH`s~@YgYk=37MHdLOz>HQIkrhQC(X$j z&&YU^@r-vK5Vz&O@4b@d>9H||K$4D13nS@1bS2%Fq|Q|BlX}IfGx59f(Y37~9=X(N zwcXuq$g0Ou-`d%MAGUUOYxVl>ZVmh4A3Hnr`>`3xD!%Kf4zlu4JYp~q{{BYF9|}Oh zQm3r24~1WE*hqC=`zhTY^zYF{@2WL=>tLPmAy*6CaQJj zYK}4UWRs|zss{fujZxLGboLpSm~63i-{f?eJ599-L@qWGgIM7)*W+Eai4DIM+Kyv8 z`(W8X4dBk0W{eG{|5kv1{u9_|!-IMOA#XW0hs|u)@N8!uLpYyt+E<3hNn(}nm{c?I zyqUXStzyf>A5}DaTK(+#S~Ve@3c-a0X8y=D+{uw`jg6~_hN@}Ir9p@eS_Gi_-o$pO zWpK?b7^o--)fZ#Oj?8j7b7!4lAley20a=>CVnRvHmnuXQo07#oa!yD7c+8x2d-D}A zntM#Mb#^BZ?|sGM%Of1O&aRKw84AZSQyn+KWQYcZf67#yn#MajFST8*w!K$>xi@ZX ztBppjrjBac_1gBhzPF{bMq_vH-`fS{R(bBt_7xVX_p9B`QTu$*{vtG1>;Fcb)MZlt z*BZOET>n2sK@9_4p>P!C$ezs|<7(nTQ7b{CR(}a`^#nh;`1PwRzDP0ttSA@EnHnyc z129~eFo%uiaOJ3$$MiCc9mc>OgEmo}D^>>22GyDaDi!oIz#e&M9SrLVRM3#Nf<3(n zqH*o9ccVHCJL`aI!PX2F@qun@{*+msN;U?@hRIwgdJ~3fR6-O=oQTd;Q!y-{wx9`a zP@&tt2M(GH$Kdv?42GqdzD_&@&89ImBn1NJ0&x{Y>bp1s; zi-dYBcYf7*sY?_~I<)o(**02lq<>&|ie z7z(WceizE{rZYV4T@C?z^jqh{x6nI**7;lbPv`u&4DJ73^xK00^!iHY?4sLgV_oO` zsC#+bIe!I*2zTDYMcu)rjYx+*Ac7KAr#&EKXYKycDSoyNJKfIkZCN?#49^MYNv{tr zxM=lohEXYKQ01*u{kv|r-~3{G3!E|F4Nm&kpe z_=BU~#oK=8)#(sUd)?zURvxyIv({m^ElA;@j=HVRSs9L7XRTLl4%I^}eTBLS?%>U7 zo2rOj3xAG=o!&VO>Zb{Sgz&VU4R((j#>6%r>x^f(fPJ8ugt zBx*>^2zH_G%RxIt2*>SK7jX>;n1&d1uH+{58!v(VCl_3E7;0Jc!5^8%YWu&twY^~f z>$^LR-2OjB8T%GDgz$j^B70o4M;}Y@2N+{Cth@#W^XbSo;o#r^y=~c@hgpgCis3Ow z#TZL;ba`cgP)W>i0LzFu%tLDy;KRx$+~N-~(`ENTfL{xIW$=yN(0Q@YQu|uKu@8X!RYB6|Ha;82Tl6Yz^NHQp_z6Z zLuZE=eYqX$kjHJy5F~@U5DOnG+GTeoR5Hj5fnT8i1zt8J1)NPq31?-DL3|f02O?Qe z#6Qsmv>o|f;=$gv>VQYyV9>3j6%?u7 zpsF&M=pP@Xs8z7?%9}K?&rj3=|Jc|l$xxSICD{eQcZL|M7$s<^oKWmRZx>xJM&8t% zk6P6{A04nc*qY`$z;LC^Z^!{xI33!-60#D~qrD)o76N{NWbYZ4&zk)ER!OtDY=TnQ z-!~(|=?VTh5F>5RRNGGxorov7ol^4=au-fY2-*zm2cdA?2$I8PA;kvvnXmM484Eku zrqz^K$-ZHEFU1Zl2e<{tIAt@3T^qLVhO?!PQ6Zx5ZfFy@LDw4R^U5Y?9KCY`g94;z z`=N{%*B`07to;-a4%R2xFRW%37eV#K3lhW&=y?BfMHFB-lpzbrz>6x$f@Uc}?Eowv zJ^Vlaj5D!v<#5W#=1cxneF3CGFa%U}9Jp)z&WIE>iMc@zX-)`;&xlm-2~-KvRM#7i zUFN|?vITKhu2s`#*ic`B9p@xq-p~~qvLLc?AV9e65Yd2YyS9eVf)~@UP{C~0MRrTG zO@C_b3t&PVhi&8htOrSqa%keK4y0$fDxn$TdJC=@86zcz9r1bf^q8Q>awWcuTDl%BaZ3jMt-+8lEK?=*W7_s7f93`oKJZSmY+*_4ahs`+=9Gu4|!7Lw+ZYAO~kxrClhm?lv&8AJb9+Wg4k2H(=o3Nl&H z2Le7$1SgTCn6OqMhvk?QOA(dezqhZX0mRm#BWtG;W}S@Uv1C%@_oRcov=K zSa;DF@9wZE+QKkQi({sSLi4!=^qrUZ{ud&D>il10Yqznm|MzP7{f{RpVWKH;P0A1j z=YcJC%MiEh%hFFG9rQSIS;69k(tVgnsw;#Z}_X1sz#$PiyjxQ%3B)jD}VzK2CYNC`!1gVm=|9m??vHjoK zX>2dr|N2&L|DU3yj;AiS8uvM!S~RHTm?QE0K0`)Gv)pw^WGI%o5t&}Z5+_2Q5iVe$ zG#mN^Y;0IeFFeefSWZXSW|MNW_ahiGT8Ioj{#Ag9N}3!HrDT9K{U^p|V4FISb)YtR zbBY__U^=ZZl@=uWmoY2+4Vfj5(rTHWOaOw-DF7Ul9E?mTuk>4@X^+7t)4I4Xibvw(c=CudLoN@^F81Y9 zr-E+Kf+w3RMx}%39xS8<#B>gx<|*!Qa>;cpk%7k!bi8%2$lvAyl4e#8FKb4FGaa0! zG+KcpmYdx;$YO}gf;=NGkZY!ivz3``kSioUs3kgO{hbM)rL~N=a+jg#0M5}G+3e6Ldi?aiA{6U|V`F^f&5Obyxn(GP_`uvV@oujy4GZqSeQre+GJvvc zCF2*={Hmy|0IMZ}#=e8N5_)**dBf#*I<0m$!cOEffa)pG~Vk>ASdpB0FRw^2L%!IB? zu%(hDNKZqNT;}p3-em(iBr#ma@;xas^UGa5B9gElj*6%f1YK(5f4j^hjl=^9J-+tPV?{u0msJ`ZXg{A|%y?QBh3C<5w|tuJS?NTFOK$%;3HG zl4op>&X&ZxK39vu*MoSH3I41!?D}$w-@|>Ng!pyyB*usnk){>$i>G(PM+adaF`i@} z`O+YUhhG6m;o(mVN`L1!266rWO!xnHw)Ym#fA;eGe@{}r)cH^9UC#lex4GDs==H8R zy5XlG4?gaB+&2U~Jf%=8<1s-ge@zeo=dTG;uL;6+6GXM8zu&upPzLeHxAY7z3?7hU z`pzC5B<=rm-2dOL?Je5>y;?oD|4&iAoc+%T$GF+f4AU~fg6GC5s4$B9>sLpf*zNct z&k$BPBFp@c{6WHZ@E{@MXytONQOchuJ3@a@0*ZZ#Fad-K1hc9`_OJ4Glm%mv44`1%A;s9;{05R~P A_5c6? literal 0 HcmV?d00001 diff --git a/node_modules/@webassemblyjs/ieee754/LICENSE b/node_modules/@webassemblyjs/ieee754/LICENSE new file mode 100644 index 0000000..87e7e1f --- /dev/null +++ b/node_modules/@webassemblyjs/ieee754/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sven Sauleau + +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. diff --git a/node_modules/@webassemblyjs/ieee754/esm/index.js b/node_modules/@webassemblyjs/ieee754/esm/index.js new file mode 100644 index 0000000..88d9d4c --- /dev/null +++ b/node_modules/@webassemblyjs/ieee754/esm/index.js @@ -0,0 +1,33 @@ +import { write, read } from "@xtuc/ieee754"; +/** + * According to https://webassembly.github.io/spec/binary/values.html#binary-float + * n = 32/8 + */ + +export var NUMBER_OF_BYTE_F32 = 4; +/** + * According to https://webassembly.github.io/spec/binary/values.html#binary-float + * n = 64/8 + */ + +export var NUMBER_OF_BYTE_F64 = 8; +export var SINGLE_PRECISION_MANTISSA = 23; +export var DOUBLE_PRECISION_MANTISSA = 52; +export function encodeF32(v) { + var buffer = []; + write(buffer, v, 0, true, SINGLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F32); + return buffer; +} +export function encodeF64(v) { + var buffer = []; + write(buffer, v, 0, true, DOUBLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F64); + return buffer; +} +export function decodeF32(bytes) { + var buffer = Buffer.from(bytes); + return read(buffer, 0, true, SINGLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F32); +} +export function decodeF64(bytes) { + var buffer = Buffer.from(bytes); + return read(buffer, 0, true, DOUBLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F64); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ieee754/lib/index.js b/node_modules/@webassemblyjs/ieee754/lib/index.js new file mode 100644 index 0000000..27b9e22 --- /dev/null +++ b/node_modules/@webassemblyjs/ieee754/lib/index.js @@ -0,0 +1,52 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.encodeF32 = encodeF32; +exports.encodeF64 = encodeF64; +exports.decodeF32 = decodeF32; +exports.decodeF64 = decodeF64; +exports.DOUBLE_PRECISION_MANTISSA = exports.SINGLE_PRECISION_MANTISSA = exports.NUMBER_OF_BYTE_F64 = exports.NUMBER_OF_BYTE_F32 = void 0; + +var _ieee = require("@xtuc/ieee754"); + +/** + * According to https://webassembly.github.io/spec/binary/values.html#binary-float + * n = 32/8 + */ +var NUMBER_OF_BYTE_F32 = 4; +/** + * According to https://webassembly.github.io/spec/binary/values.html#binary-float + * n = 64/8 + */ + +exports.NUMBER_OF_BYTE_F32 = NUMBER_OF_BYTE_F32; +var NUMBER_OF_BYTE_F64 = 8; +exports.NUMBER_OF_BYTE_F64 = NUMBER_OF_BYTE_F64; +var SINGLE_PRECISION_MANTISSA = 23; +exports.SINGLE_PRECISION_MANTISSA = SINGLE_PRECISION_MANTISSA; +var DOUBLE_PRECISION_MANTISSA = 52; +exports.DOUBLE_PRECISION_MANTISSA = DOUBLE_PRECISION_MANTISSA; + +function encodeF32(v) { + var buffer = []; + (0, _ieee.write)(buffer, v, 0, true, SINGLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F32); + return buffer; +} + +function encodeF64(v) { + var buffer = []; + (0, _ieee.write)(buffer, v, 0, true, DOUBLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F64); + return buffer; +} + +function decodeF32(bytes) { + var buffer = Buffer.from(bytes); + return (0, _ieee.read)(buffer, 0, true, SINGLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F32); +} + +function decodeF64(bytes) { + var buffer = Buffer.from(bytes); + return (0, _ieee.read)(buffer, 0, true, DOUBLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F64); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/ieee754/package.json b/node_modules/@webassemblyjs/ieee754/package.json new file mode 100644 index 0000000..bc9253a --- /dev/null +++ b/node_modules/@webassemblyjs/ieee754/package.json @@ -0,0 +1,45 @@ +{ + "_from": "@webassemblyjs/ieee754@1.8.5", + "_id": "@webassemblyjs/ieee754@1.8.5", + "_inBundle": false, + "_integrity": "sha512-aaCvQYrvKbY/n6wKHb/ylAJr27GglahUO89CcGXMItrOBqRarUMxWLJgxm9PJNuKULwN5n1csT9bYoMeZOGF3g==", + "_location": "/@webassemblyjs/ieee754", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/ieee754@1.8.5", + "name": "@webassemblyjs/ieee754", + "escapedName": "@webassemblyjs%2fieee754", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/wasm-gen", + "/@webassemblyjs/wasm-parser" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.8.5.tgz", + "_shasum": "712329dbef240f36bf57bd2f7b8fb9bf4154421e", + "_spec": "@webassemblyjs/ieee754@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/wasm-gen", + "bundleDependencies": false, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + }, + "deprecated": false, + "description": "IEEE754 decoder and encoder", + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/ieee754", + "publishConfig": { + "access": "public" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/ieee754/src/index.js b/node_modules/@webassemblyjs/ieee754/src/index.js new file mode 100644 index 0000000..c8540a5 --- /dev/null +++ b/node_modules/@webassemblyjs/ieee754/src/index.js @@ -0,0 +1,47 @@ +// @flow + +import { write, read } from "@xtuc/ieee754"; + +/** + * According to https://webassembly.github.io/spec/binary/values.html#binary-float + * n = 32/8 + */ +export const NUMBER_OF_BYTE_F32 = 4; + +/** + * According to https://webassembly.github.io/spec/binary/values.html#binary-float + * n = 64/8 + */ +export const NUMBER_OF_BYTE_F64 = 8; + +export const SINGLE_PRECISION_MANTISSA = 23; + +export const DOUBLE_PRECISION_MANTISSA = 52; + +export function encodeF32(v: number): Array { + const buffer = []; + + write(buffer, v, 0, true, SINGLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F32); + + return buffer; +} + +export function encodeF64(v: number): Array { + const buffer = []; + + write(buffer, v, 0, true, DOUBLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F64); + + return buffer; +} + +export function decodeF32(bytes: Array): number { + const buffer = Buffer.from(bytes); + + return read(buffer, 0, true, SINGLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F32); +} + +export function decodeF64(bytes: Array): number { + const buffer = Buffer.from(bytes); + + return read(buffer, 0, true, DOUBLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F64); +} diff --git a/node_modules/@webassemblyjs/leb128/LICENSE.txt b/node_modules/@webassemblyjs/leb128/LICENSE.txt new file mode 100644 index 0000000..55e332a --- /dev/null +++ b/node_modules/@webassemblyjs/leb128/LICENSE.txt @@ -0,0 +1,194 @@ +Copyright 2012 The Obvious Corporation. +http://obvious.com/ + +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. + + +------------------------------------------------------------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/node_modules/@webassemblyjs/leb128/esm/bits.js b/node_modules/@webassemblyjs/leb128/esm/bits.js new file mode 100644 index 0000000..4c763cd --- /dev/null +++ b/node_modules/@webassemblyjs/leb128/esm/bits.js @@ -0,0 +1,145 @@ +// Copyright 2012 The Obvious Corporation. + +/* + * bits: Bitwise buffer utilities. The utilities here treat a buffer + * as a little-endian bigint, so the lowest-order bit is bit #0 of + * `buffer[0]`, and the highest-order bit is bit #7 of + * `buffer[buffer.length - 1]`. + */ + +/* + * Modules used + */ +"use strict"; +/* + * Exported bindings + */ + +/** + * Extracts the given number of bits from the buffer at the indicated + * index, returning a simple number as the result. If bits are requested + * that aren't covered by the buffer, the `defaultBit` is used as their + * value. + * + * The `bitLength` must be no more than 32. The `defaultBit` if not + * specified is taken to be `0`. + */ + +export function extract(buffer, bitIndex, bitLength, defaultBit) { + if (bitLength < 0 || bitLength > 32) { + throw new Error("Bad value for bitLength."); + } + + if (defaultBit === undefined) { + defaultBit = 0; + } else if (defaultBit !== 0 && defaultBit !== 1) { + throw new Error("Bad value for defaultBit."); + } + + var defaultByte = defaultBit * 0xff; + var result = 0; // All starts are inclusive. The {endByte, endBit} pair is exclusive, but + // if endBit !== 0, then endByte is inclusive. + + var lastBit = bitIndex + bitLength; + var startByte = Math.floor(bitIndex / 8); + var startBit = bitIndex % 8; + var endByte = Math.floor(lastBit / 8); + var endBit = lastBit % 8; + + if (endBit !== 0) { + // `(1 << endBit) - 1` is the mask of all bits up to but not including + // the endBit. + result = get(endByte) & (1 << endBit) - 1; + } + + while (endByte > startByte) { + endByte--; + result = result << 8 | get(endByte); + } + + result >>>= startBit; + return result; + + function get(index) { + var result = buffer[index]; + return result === undefined ? defaultByte : result; + } +} +/** + * Injects the given bits into the given buffer at the given index. Any + * bits in the value beyond the length to set are ignored. + */ + +export function inject(buffer, bitIndex, bitLength, value) { + if (bitLength < 0 || bitLength > 32) { + throw new Error("Bad value for bitLength."); + } + + var lastByte = Math.floor((bitIndex + bitLength - 1) / 8); + + if (bitIndex < 0 || lastByte >= buffer.length) { + throw new Error("Index out of range."); + } // Just keeping it simple, until / unless profiling shows that this + // is a problem. + + + var atByte = Math.floor(bitIndex / 8); + var atBit = bitIndex % 8; + + while (bitLength > 0) { + if (value & 1) { + buffer[atByte] |= 1 << atBit; + } else { + buffer[atByte] &= ~(1 << atBit); + } + + value >>= 1; + bitLength--; + atBit = (atBit + 1) % 8; + + if (atBit === 0) { + atByte++; + } + } +} +/** + * Gets the sign bit of the given buffer. + */ + +export function getSign(buffer) { + return buffer[buffer.length - 1] >>> 7; +} +/** + * Gets the zero-based bit number of the highest-order bit with the + * given value in the given buffer. + * + * If the buffer consists entirely of the other bit value, then this returns + * `-1`. + */ + +export function highOrder(bit, buffer) { + var length = buffer.length; + var fullyWrongByte = (bit ^ 1) * 0xff; // the other-bit extended to a full byte + + while (length > 0 && buffer[length - 1] === fullyWrongByte) { + length--; + } + + if (length === 0) { + // Degenerate case. The buffer consists entirely of ~bit. + return -1; + } + + var byteToCheck = buffer[length - 1]; + var result = length * 8 - 1; + + for (var i = 7; i > 0; i--) { + if ((byteToCheck >> i & 1) === bit) { + break; + } + + result--; + } + + return result; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/leb128/esm/bufs.js b/node_modules/@webassemblyjs/leb128/esm/bufs.js new file mode 100644 index 0000000..7e2a2bf --- /dev/null +++ b/node_modules/@webassemblyjs/leb128/esm/bufs.js @@ -0,0 +1,218 @@ +// Copyright 2012 The Obvious Corporation. + +/* + * bufs: Buffer utilities. + */ + +/* + * Module variables + */ + +/** Pool of buffers, where `bufPool[x].length === x`. */ +var bufPool = []; +/** Maximum length of kept temporary buffers. */ + +var TEMP_BUF_MAXIMUM_LENGTH = 20; +/** Minimum exactly-representable 64-bit int. */ + +var MIN_EXACT_INT64 = -0x8000000000000000; +/** Maximum exactly-representable 64-bit int. */ + +var MAX_EXACT_INT64 = 0x7ffffffffffffc00; +/** Maximum exactly-representable 64-bit uint. */ + +var MAX_EXACT_UINT64 = 0xfffffffffffff800; +/** + * The int value consisting just of a 1 in bit #32 (that is, one more + * than the maximum 32-bit unsigned value). + */ + +var BIT_32 = 0x100000000; +/** + * The int value consisting just of a 1 in bit #64 (that is, one more + * than the maximum 64-bit unsigned value). + */ + +var BIT_64 = 0x10000000000000000; +/* + * Helper functions + */ + +/** + * Masks off all but the lowest bit set of the given number. + */ + +function lowestBit(num) { + return num & -num; +} +/** + * Gets whether trying to add the second number to the first is lossy + * (inexact). The first number is meant to be an accumulated result. + */ + + +function isLossyToAdd(accum, num) { + if (num === 0) { + return false; + } + + var lowBit = lowestBit(num); + var added = accum + lowBit; + + if (added === accum) { + return true; + } + + if (added - lowBit !== accum) { + return true; + } + + return false; +} +/* + * Exported functions + */ + +/** + * Allocates a buffer of the given length, which is initialized + * with all zeroes. This returns a buffer from the pool if it is + * available, or a freshly-allocated buffer if not. + */ + + +export function alloc(length) { + var result = bufPool[length]; + + if (result) { + bufPool[length] = undefined; + } else { + result = new Buffer(length); + } + + result.fill(0); + return result; +} +/** + * Releases a buffer back to the pool. + */ + +export function free(buffer) { + var length = buffer.length; + + if (length < TEMP_BUF_MAXIMUM_LENGTH) { + bufPool[length] = buffer; + } +} +/** + * Resizes a buffer, returning a new buffer. Returns the argument if + * the length wouldn't actually change. This function is only safe to + * use if the given buffer was allocated within this module (since + * otherwise the buffer might possibly be shared externally). + */ + +export function resize(buffer, length) { + if (length === buffer.length) { + return buffer; + } + + var newBuf = alloc(length); + buffer.copy(newBuf); + free(buffer); + return newBuf; +} +/** + * Reads an arbitrary signed int from a buffer. + */ + +export function readInt(buffer) { + var length = buffer.length; + var positive = buffer[length - 1] < 0x80; + var result = positive ? 0 : -1; + var lossy = false; // Note: We can't use bit manipulation here, since that stops + // working if the result won't fit in a 32-bit int. + + if (length < 7) { + // Common case which can't possibly be lossy (because the result has + // no more than 48 bits, and loss only happens with 54 or more). + for (var i = length - 1; i >= 0; i--) { + result = result * 0x100 + buffer[i]; + } + } else { + for (var _i = length - 1; _i >= 0; _i--) { + var one = buffer[_i]; + result *= 0x100; + + if (isLossyToAdd(result, one)) { + lossy = true; + } + + result += one; + } + } + + return { + value: result, + lossy: lossy + }; +} +/** + * Reads an arbitrary unsigned int from a buffer. + */ + +export function readUInt(buffer) { + var length = buffer.length; + var result = 0; + var lossy = false; // Note: See above in re bit manipulation. + + if (length < 7) { + // Common case which can't possibly be lossy (see above). + for (var i = length - 1; i >= 0; i--) { + result = result * 0x100 + buffer[i]; + } + } else { + for (var _i2 = length - 1; _i2 >= 0; _i2--) { + var one = buffer[_i2]; + result *= 0x100; + + if (isLossyToAdd(result, one)) { + lossy = true; + } + + result += one; + } + } + + return { + value: result, + lossy: lossy + }; +} +/** + * Writes a little-endian 64-bit signed int into a buffer. + */ + +export function writeInt64(value, buffer) { + if (value < MIN_EXACT_INT64 || value > MAX_EXACT_INT64) { + throw new Error("Value out of range."); + } + + if (value < 0) { + value += BIT_64; + } + + writeUInt64(value, buffer); +} +/** + * Writes a little-endian 64-bit unsigned int into a buffer. + */ + +export function writeUInt64(value, buffer) { + if (value < 0 || value > MAX_EXACT_UINT64) { + throw new Error("Value out of range."); + } + + var lowWord = value % BIT_32; + var highWord = Math.floor(value / BIT_32); + buffer.writeUInt32LE(lowWord, 0); + buffer.writeUInt32LE(highWord, 4); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/leb128/esm/index.js b/node_modules/@webassemblyjs/leb128/esm/index.js new file mode 100644 index 0000000..7ee23fa --- /dev/null +++ b/node_modules/@webassemblyjs/leb128/esm/index.js @@ -0,0 +1,34 @@ +import leb from "./leb"; +/** + * According to https://webassembly.github.io/spec/core/binary/values.html#binary-int + * max = ceil(32/7) + */ + +export var MAX_NUMBER_OF_BYTE_U32 = 5; +/** + * According to https://webassembly.github.io/spec/core/binary/values.html#binary-int + * max = ceil(64/7) + */ + +export var MAX_NUMBER_OF_BYTE_U64 = 10; +export function decodeInt64(encodedBuffer, index) { + return leb.decodeInt64(encodedBuffer, index); +} +export function decodeUInt64(encodedBuffer, index) { + return leb.decodeUInt64(encodedBuffer, index); +} +export function decodeInt32(encodedBuffer, index) { + return leb.decodeInt32(encodedBuffer, index); +} +export function decodeUInt32(encodedBuffer, index) { + return leb.decodeUInt32(encodedBuffer, index); +} +export function encodeU32(v) { + return leb.encodeUInt32(v); +} +export function encodeI32(v) { + return leb.encodeInt32(v); +} +export function encodeI64(v) { + return leb.encodeInt64(v); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/leb128/esm/leb.js b/node_modules/@webassemblyjs/leb128/esm/leb.js new file mode 100644 index 0000000..1b6ee09 --- /dev/null +++ b/node_modules/@webassemblyjs/leb128/esm/leb.js @@ -0,0 +1,316 @@ +// Copyright 2012 The Obvious Corporation. + +/* + * leb: LEB128 utilities. + */ + +/* + * Modules used + */ +"use strict"; + +import Long from "@xtuc/long"; +import * as bits from "./bits"; +import * as bufs from "./bufs"; +/* + * Module variables + */ + +/** The minimum possible 32-bit signed int. */ + +var MIN_INT32 = -0x80000000; +/** The maximum possible 32-bit signed int. */ + +var MAX_INT32 = 0x7fffffff; +/** The maximum possible 32-bit unsigned int. */ + +var MAX_UINT32 = 0xffffffff; +/** The minimum possible 64-bit signed int. */ +// const MIN_INT64 = -0x8000000000000000; + +/** + * The maximum possible 64-bit signed int that is representable as a + * JavaScript number. + */ +// const MAX_INT64 = 0x7ffffffffffffc00; + +/** + * The maximum possible 64-bit unsigned int that is representable as a + * JavaScript number. + */ +// const MAX_UINT64 = 0xfffffffffffff800; + +/* + * Helper functions + */ + +/** + * Determines the number of bits required to encode the number + * represented in the given buffer as a signed value. The buffer is + * taken to represent a signed number in little-endian form. + * + * The number of bits to encode is the (zero-based) bit number of the + * highest-order non-sign-matching bit, plus two. For example: + * + * 11111011 01110101 + * high low + * + * The sign bit here is 1 (that is, it's a negative number). The highest + * bit number that doesn't match the sign is bit #10 (where the lowest-order + * bit is bit #0). So, we have to encode at least 12 bits total. + * + * As a special degenerate case, the numbers 0 and -1 each require just one bit. + */ + +function signedBitCount(buffer) { + return bits.highOrder(bits.getSign(buffer) ^ 1, buffer) + 2; +} +/** + * Determines the number of bits required to encode the number + * represented in the given buffer as an unsigned value. The buffer is + * taken to represent an unsigned number in little-endian form. + * + * The number of bits to encode is the (zero-based) bit number of the + * highest-order 1 bit, plus one. For example: + * + * 00011000 01010011 + * high low + * + * The highest-order 1 bit here is bit #12 (where the lowest-order bit + * is bit #0). So, we have to encode at least 13 bits total. + * + * As a special degenerate case, the number 0 requires 1 bit. + */ + + +function unsignedBitCount(buffer) { + var result = bits.highOrder(1, buffer) + 1; + return result ? result : 1; +} +/** + * Common encoder for both signed and unsigned ints. This takes a + * bigint-ish buffer, returning an LEB128-encoded buffer. + */ + + +function encodeBufferCommon(buffer, signed) { + var signBit; + var bitCount; + + if (signed) { + signBit = bits.getSign(buffer); + bitCount = signedBitCount(buffer); + } else { + signBit = 0; + bitCount = unsignedBitCount(buffer); + } + + var byteCount = Math.ceil(bitCount / 7); + var result = bufs.alloc(byteCount); + + for (var i = 0; i < byteCount; i++) { + var payload = bits.extract(buffer, i * 7, 7, signBit); + result[i] = payload | 0x80; + } // Mask off the top bit of the last byte, to indicate the end of the + // encoding. + + + result[byteCount - 1] &= 0x7f; + return result; +} +/** + * Gets the byte-length of the value encoded in the given buffer at + * the given index. + */ + + +function encodedLength(encodedBuffer, index) { + var result = 0; + + while (encodedBuffer[index + result] >= 0x80) { + result++; + } + + result++; // to account for the last byte + + if (index + result > encodedBuffer.length) {// FIXME(sven): seems to cause false positives + // throw new Error("integer representation too long"); + } + + return result; +} +/** + * Common decoder for both signed and unsigned ints. This takes an + * LEB128-encoded buffer, returning a bigint-ish buffer. + */ + + +function decodeBufferCommon(encodedBuffer, index, signed) { + index = index === undefined ? 0 : index; + var length = encodedLength(encodedBuffer, index); + var bitLength = length * 7; + var byteLength = Math.ceil(bitLength / 8); + var result = bufs.alloc(byteLength); + var outIndex = 0; + + while (length > 0) { + bits.inject(result, outIndex, 7, encodedBuffer[index]); + outIndex += 7; + index++; + length--; + } + + var signBit; + var signByte; + + if (signed) { + // Sign-extend the last byte. + var lastByte = result[byteLength - 1]; + var endBit = outIndex % 8; + + if (endBit !== 0) { + var shift = 32 - endBit; // 32 because JS bit ops work on 32-bit ints. + + lastByte = result[byteLength - 1] = lastByte << shift >> shift & 0xff; + } + + signBit = lastByte >> 7; + signByte = signBit * 0xff; + } else { + signBit = 0; + signByte = 0; + } // Slice off any superfluous bytes, that is, ones that add no meaningful + // bits (because the value would be the same if they were removed). + + + while (byteLength > 1 && result[byteLength - 1] === signByte && (!signed || result[byteLength - 2] >> 7 === signBit)) { + byteLength--; + } + + result = bufs.resize(result, byteLength); + return { + value: result, + nextIndex: index + }; +} +/* + * Exported bindings + */ + + +function encodeIntBuffer(buffer) { + return encodeBufferCommon(buffer, true); +} + +function decodeIntBuffer(encodedBuffer, index) { + return decodeBufferCommon(encodedBuffer, index, true); +} + +function encodeInt32(num) { + var buf = bufs.alloc(4); + buf.writeInt32LE(num, 0); + var result = encodeIntBuffer(buf); + bufs.free(buf); + return result; +} + +function decodeInt32(encodedBuffer, index) { + var result = decodeIntBuffer(encodedBuffer, index); + var parsed = bufs.readInt(result.value); + var value = parsed.value; + bufs.free(result.value); + + if (value < MIN_INT32 || value > MAX_INT32) { + throw new Error("integer too large"); + } + + return { + value: value, + nextIndex: result.nextIndex + }; +} + +function encodeInt64(num) { + var buf = bufs.alloc(8); + bufs.writeInt64(num, buf); + var result = encodeIntBuffer(buf); + bufs.free(buf); + return result; +} + +function decodeInt64(encodedBuffer, index) { + var result = decodeIntBuffer(encodedBuffer, index); + var value = Long.fromBytesLE(result.value, false); + bufs.free(result.value); + return { + value: value, + nextIndex: result.nextIndex, + lossy: false + }; +} + +function encodeUIntBuffer(buffer) { + return encodeBufferCommon(buffer, false); +} + +function decodeUIntBuffer(encodedBuffer, index) { + return decodeBufferCommon(encodedBuffer, index, false); +} + +function encodeUInt32(num) { + var buf = bufs.alloc(4); + buf.writeUInt32LE(num, 0); + var result = encodeUIntBuffer(buf); + bufs.free(buf); + return result; +} + +function decodeUInt32(encodedBuffer, index) { + var result = decodeUIntBuffer(encodedBuffer, index); + var parsed = bufs.readUInt(result.value); + var value = parsed.value; + bufs.free(result.value); + + if (value > MAX_UINT32) { + throw new Error("integer too large"); + } + + return { + value: value, + nextIndex: result.nextIndex + }; +} + +function encodeUInt64(num) { + var buf = bufs.alloc(8); + bufs.writeUInt64(num, buf); + var result = encodeUIntBuffer(buf); + bufs.free(buf); + return result; +} + +function decodeUInt64(encodedBuffer, index) { + var result = decodeUIntBuffer(encodedBuffer, index); + var value = Long.fromBytesLE(result.value, true); + bufs.free(result.value); + return { + value: value, + nextIndex: result.nextIndex, + lossy: false + }; +} + +export default { + decodeInt32: decodeInt32, + decodeInt64: decodeInt64, + decodeIntBuffer: decodeIntBuffer, + decodeUInt32: decodeUInt32, + decodeUInt64: decodeUInt64, + decodeUIntBuffer: decodeUIntBuffer, + encodeInt32: encodeInt32, + encodeInt64: encodeInt64, + encodeIntBuffer: encodeIntBuffer, + encodeUInt32: encodeUInt32, + encodeUInt64: encodeUInt64, + encodeUIntBuffer: encodeUIntBuffer +}; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/leb128/lib/bits.js b/node_modules/@webassemblyjs/leb128/lib/bits.js new file mode 100644 index 0000000..5acf246 --- /dev/null +++ b/node_modules/@webassemblyjs/leb128/lib/bits.js @@ -0,0 +1,156 @@ +// Copyright 2012 The Obvious Corporation. + +/* + * bits: Bitwise buffer utilities. The utilities here treat a buffer + * as a little-endian bigint, so the lowest-order bit is bit #0 of + * `buffer[0]`, and the highest-order bit is bit #7 of + * `buffer[buffer.length - 1]`. + */ + +/* + * Modules used + */ +"use strict"; +/* + * Exported bindings + */ + +/** + * Extracts the given number of bits from the buffer at the indicated + * index, returning a simple number as the result. If bits are requested + * that aren't covered by the buffer, the `defaultBit` is used as their + * value. + * + * The `bitLength` must be no more than 32. The `defaultBit` if not + * specified is taken to be `0`. + */ + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.extract = extract; +exports.inject = inject; +exports.getSign = getSign; +exports.highOrder = highOrder; + +function extract(buffer, bitIndex, bitLength, defaultBit) { + if (bitLength < 0 || bitLength > 32) { + throw new Error("Bad value for bitLength."); + } + + if (defaultBit === undefined) { + defaultBit = 0; + } else if (defaultBit !== 0 && defaultBit !== 1) { + throw new Error("Bad value for defaultBit."); + } + + var defaultByte = defaultBit * 0xff; + var result = 0; // All starts are inclusive. The {endByte, endBit} pair is exclusive, but + // if endBit !== 0, then endByte is inclusive. + + var lastBit = bitIndex + bitLength; + var startByte = Math.floor(bitIndex / 8); + var startBit = bitIndex % 8; + var endByte = Math.floor(lastBit / 8); + var endBit = lastBit % 8; + + if (endBit !== 0) { + // `(1 << endBit) - 1` is the mask of all bits up to but not including + // the endBit. + result = get(endByte) & (1 << endBit) - 1; + } + + while (endByte > startByte) { + endByte--; + result = result << 8 | get(endByte); + } + + result >>>= startBit; + return result; + + function get(index) { + var result = buffer[index]; + return result === undefined ? defaultByte : result; + } +} +/** + * Injects the given bits into the given buffer at the given index. Any + * bits in the value beyond the length to set are ignored. + */ + + +function inject(buffer, bitIndex, bitLength, value) { + if (bitLength < 0 || bitLength > 32) { + throw new Error("Bad value for bitLength."); + } + + var lastByte = Math.floor((bitIndex + bitLength - 1) / 8); + + if (bitIndex < 0 || lastByte >= buffer.length) { + throw new Error("Index out of range."); + } // Just keeping it simple, until / unless profiling shows that this + // is a problem. + + + var atByte = Math.floor(bitIndex / 8); + var atBit = bitIndex % 8; + + while (bitLength > 0) { + if (value & 1) { + buffer[atByte] |= 1 << atBit; + } else { + buffer[atByte] &= ~(1 << atBit); + } + + value >>= 1; + bitLength--; + atBit = (atBit + 1) % 8; + + if (atBit === 0) { + atByte++; + } + } +} +/** + * Gets the sign bit of the given buffer. + */ + + +function getSign(buffer) { + return buffer[buffer.length - 1] >>> 7; +} +/** + * Gets the zero-based bit number of the highest-order bit with the + * given value in the given buffer. + * + * If the buffer consists entirely of the other bit value, then this returns + * `-1`. + */ + + +function highOrder(bit, buffer) { + var length = buffer.length; + var fullyWrongByte = (bit ^ 1) * 0xff; // the other-bit extended to a full byte + + while (length > 0 && buffer[length - 1] === fullyWrongByte) { + length--; + } + + if (length === 0) { + // Degenerate case. The buffer consists entirely of ~bit. + return -1; + } + + var byteToCheck = buffer[length - 1]; + var result = length * 8 - 1; + + for (var i = 7; i > 0; i--) { + if ((byteToCheck >> i & 1) === bit) { + break; + } + + result--; + } + + return result; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/leb128/lib/bufs.js b/node_modules/@webassemblyjs/leb128/lib/bufs.js new file mode 100644 index 0000000..f9a176e --- /dev/null +++ b/node_modules/@webassemblyjs/leb128/lib/bufs.js @@ -0,0 +1,236 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.alloc = alloc; +exports.free = free; +exports.resize = resize; +exports.readInt = readInt; +exports.readUInt = readUInt; +exports.writeInt64 = writeInt64; +exports.writeUInt64 = writeUInt64; +// Copyright 2012 The Obvious Corporation. + +/* + * bufs: Buffer utilities. + */ + +/* + * Module variables + */ + +/** Pool of buffers, where `bufPool[x].length === x`. */ +var bufPool = []; +/** Maximum length of kept temporary buffers. */ + +var TEMP_BUF_MAXIMUM_LENGTH = 20; +/** Minimum exactly-representable 64-bit int. */ + +var MIN_EXACT_INT64 = -0x8000000000000000; +/** Maximum exactly-representable 64-bit int. */ + +var MAX_EXACT_INT64 = 0x7ffffffffffffc00; +/** Maximum exactly-representable 64-bit uint. */ + +var MAX_EXACT_UINT64 = 0xfffffffffffff800; +/** + * The int value consisting just of a 1 in bit #32 (that is, one more + * than the maximum 32-bit unsigned value). + */ + +var BIT_32 = 0x100000000; +/** + * The int value consisting just of a 1 in bit #64 (that is, one more + * than the maximum 64-bit unsigned value). + */ + +var BIT_64 = 0x10000000000000000; +/* + * Helper functions + */ + +/** + * Masks off all but the lowest bit set of the given number. + */ + +function lowestBit(num) { + return num & -num; +} +/** + * Gets whether trying to add the second number to the first is lossy + * (inexact). The first number is meant to be an accumulated result. + */ + + +function isLossyToAdd(accum, num) { + if (num === 0) { + return false; + } + + var lowBit = lowestBit(num); + var added = accum + lowBit; + + if (added === accum) { + return true; + } + + if (added - lowBit !== accum) { + return true; + } + + return false; +} +/* + * Exported functions + */ + +/** + * Allocates a buffer of the given length, which is initialized + * with all zeroes. This returns a buffer from the pool if it is + * available, or a freshly-allocated buffer if not. + */ + + +function alloc(length) { + var result = bufPool[length]; + + if (result) { + bufPool[length] = undefined; + } else { + result = new Buffer(length); + } + + result.fill(0); + return result; +} +/** + * Releases a buffer back to the pool. + */ + + +function free(buffer) { + var length = buffer.length; + + if (length < TEMP_BUF_MAXIMUM_LENGTH) { + bufPool[length] = buffer; + } +} +/** + * Resizes a buffer, returning a new buffer. Returns the argument if + * the length wouldn't actually change. This function is only safe to + * use if the given buffer was allocated within this module (since + * otherwise the buffer might possibly be shared externally). + */ + + +function resize(buffer, length) { + if (length === buffer.length) { + return buffer; + } + + var newBuf = alloc(length); + buffer.copy(newBuf); + free(buffer); + return newBuf; +} +/** + * Reads an arbitrary signed int from a buffer. + */ + + +function readInt(buffer) { + var length = buffer.length; + var positive = buffer[length - 1] < 0x80; + var result = positive ? 0 : -1; + var lossy = false; // Note: We can't use bit manipulation here, since that stops + // working if the result won't fit in a 32-bit int. + + if (length < 7) { + // Common case which can't possibly be lossy (because the result has + // no more than 48 bits, and loss only happens with 54 or more). + for (var i = length - 1; i >= 0; i--) { + result = result * 0x100 + buffer[i]; + } + } else { + for (var _i = length - 1; _i >= 0; _i--) { + var one = buffer[_i]; + result *= 0x100; + + if (isLossyToAdd(result, one)) { + lossy = true; + } + + result += one; + } + } + + return { + value: result, + lossy: lossy + }; +} +/** + * Reads an arbitrary unsigned int from a buffer. + */ + + +function readUInt(buffer) { + var length = buffer.length; + var result = 0; + var lossy = false; // Note: See above in re bit manipulation. + + if (length < 7) { + // Common case which can't possibly be lossy (see above). + for (var i = length - 1; i >= 0; i--) { + result = result * 0x100 + buffer[i]; + } + } else { + for (var _i2 = length - 1; _i2 >= 0; _i2--) { + var one = buffer[_i2]; + result *= 0x100; + + if (isLossyToAdd(result, one)) { + lossy = true; + } + + result += one; + } + } + + return { + value: result, + lossy: lossy + }; +} +/** + * Writes a little-endian 64-bit signed int into a buffer. + */ + + +function writeInt64(value, buffer) { + if (value < MIN_EXACT_INT64 || value > MAX_EXACT_INT64) { + throw new Error("Value out of range."); + } + + if (value < 0) { + value += BIT_64; + } + + writeUInt64(value, buffer); +} +/** + * Writes a little-endian 64-bit unsigned int into a buffer. + */ + + +function writeUInt64(value, buffer) { + if (value < 0 || value > MAX_EXACT_UINT64) { + throw new Error("Value out of range."); + } + + var lowWord = value % BIT_32; + var highWord = Math.floor(value / BIT_32); + buffer.writeUInt32LE(lowWord, 0); + buffer.writeUInt32LE(highWord, 4); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/leb128/lib/index.js b/node_modules/@webassemblyjs/leb128/lib/index.js new file mode 100644 index 0000000..6687537 --- /dev/null +++ b/node_modules/@webassemblyjs/leb128/lib/index.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.decodeInt64 = decodeInt64; +exports.decodeUInt64 = decodeUInt64; +exports.decodeInt32 = decodeInt32; +exports.decodeUInt32 = decodeUInt32; +exports.encodeU32 = encodeU32; +exports.encodeI32 = encodeI32; +exports.encodeI64 = encodeI64; +exports.MAX_NUMBER_OF_BYTE_U64 = exports.MAX_NUMBER_OF_BYTE_U32 = void 0; + +var _leb = _interopRequireDefault(require("./leb")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * According to https://webassembly.github.io/spec/core/binary/values.html#binary-int + * max = ceil(32/7) + */ +var MAX_NUMBER_OF_BYTE_U32 = 5; +/** + * According to https://webassembly.github.io/spec/core/binary/values.html#binary-int + * max = ceil(64/7) + */ + +exports.MAX_NUMBER_OF_BYTE_U32 = MAX_NUMBER_OF_BYTE_U32; +var MAX_NUMBER_OF_BYTE_U64 = 10; +exports.MAX_NUMBER_OF_BYTE_U64 = MAX_NUMBER_OF_BYTE_U64; + +function decodeInt64(encodedBuffer, index) { + return _leb.default.decodeInt64(encodedBuffer, index); +} + +function decodeUInt64(encodedBuffer, index) { + return _leb.default.decodeUInt64(encodedBuffer, index); +} + +function decodeInt32(encodedBuffer, index) { + return _leb.default.decodeInt32(encodedBuffer, index); +} + +function decodeUInt32(encodedBuffer, index) { + return _leb.default.decodeUInt32(encodedBuffer, index); +} + +function encodeU32(v) { + return _leb.default.encodeUInt32(v); +} + +function encodeI32(v) { + return _leb.default.encodeInt32(v); +} + +function encodeI64(v) { + return _leb.default.encodeInt64(v); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/leb128/lib/leb.js b/node_modules/@webassemblyjs/leb128/lib/leb.js new file mode 100644 index 0000000..3c1d4aa --- /dev/null +++ b/node_modules/@webassemblyjs/leb128/lib/leb.js @@ -0,0 +1,332 @@ +// Copyright 2012 The Obvious Corporation. + +/* + * leb: LEB128 utilities. + */ + +/* + * Modules used + */ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _long = _interopRequireDefault(require("@xtuc/long")); + +var bits = _interopRequireWildcard(require("./bits")); + +var bufs = _interopRequireWildcard(require("./bufs")); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* + * Module variables + */ + +/** The minimum possible 32-bit signed int. */ +var MIN_INT32 = -0x80000000; +/** The maximum possible 32-bit signed int. */ + +var MAX_INT32 = 0x7fffffff; +/** The maximum possible 32-bit unsigned int. */ + +var MAX_UINT32 = 0xffffffff; +/** The minimum possible 64-bit signed int. */ +// const MIN_INT64 = -0x8000000000000000; + +/** + * The maximum possible 64-bit signed int that is representable as a + * JavaScript number. + */ +// const MAX_INT64 = 0x7ffffffffffffc00; + +/** + * The maximum possible 64-bit unsigned int that is representable as a + * JavaScript number. + */ +// const MAX_UINT64 = 0xfffffffffffff800; + +/* + * Helper functions + */ + +/** + * Determines the number of bits required to encode the number + * represented in the given buffer as a signed value. The buffer is + * taken to represent a signed number in little-endian form. + * + * The number of bits to encode is the (zero-based) bit number of the + * highest-order non-sign-matching bit, plus two. For example: + * + * 11111011 01110101 + * high low + * + * The sign bit here is 1 (that is, it's a negative number). The highest + * bit number that doesn't match the sign is bit #10 (where the lowest-order + * bit is bit #0). So, we have to encode at least 12 bits total. + * + * As a special degenerate case, the numbers 0 and -1 each require just one bit. + */ + +function signedBitCount(buffer) { + return bits.highOrder(bits.getSign(buffer) ^ 1, buffer) + 2; +} +/** + * Determines the number of bits required to encode the number + * represented in the given buffer as an unsigned value. The buffer is + * taken to represent an unsigned number in little-endian form. + * + * The number of bits to encode is the (zero-based) bit number of the + * highest-order 1 bit, plus one. For example: + * + * 00011000 01010011 + * high low + * + * The highest-order 1 bit here is bit #12 (where the lowest-order bit + * is bit #0). So, we have to encode at least 13 bits total. + * + * As a special degenerate case, the number 0 requires 1 bit. + */ + + +function unsignedBitCount(buffer) { + var result = bits.highOrder(1, buffer) + 1; + return result ? result : 1; +} +/** + * Common encoder for both signed and unsigned ints. This takes a + * bigint-ish buffer, returning an LEB128-encoded buffer. + */ + + +function encodeBufferCommon(buffer, signed) { + var signBit; + var bitCount; + + if (signed) { + signBit = bits.getSign(buffer); + bitCount = signedBitCount(buffer); + } else { + signBit = 0; + bitCount = unsignedBitCount(buffer); + } + + var byteCount = Math.ceil(bitCount / 7); + var result = bufs.alloc(byteCount); + + for (var i = 0; i < byteCount; i++) { + var payload = bits.extract(buffer, i * 7, 7, signBit); + result[i] = payload | 0x80; + } // Mask off the top bit of the last byte, to indicate the end of the + // encoding. + + + result[byteCount - 1] &= 0x7f; + return result; +} +/** + * Gets the byte-length of the value encoded in the given buffer at + * the given index. + */ + + +function encodedLength(encodedBuffer, index) { + var result = 0; + + while (encodedBuffer[index + result] >= 0x80) { + result++; + } + + result++; // to account for the last byte + + if (index + result > encodedBuffer.length) {// FIXME(sven): seems to cause false positives + // throw new Error("integer representation too long"); + } + + return result; +} +/** + * Common decoder for both signed and unsigned ints. This takes an + * LEB128-encoded buffer, returning a bigint-ish buffer. + */ + + +function decodeBufferCommon(encodedBuffer, index, signed) { + index = index === undefined ? 0 : index; + var length = encodedLength(encodedBuffer, index); + var bitLength = length * 7; + var byteLength = Math.ceil(bitLength / 8); + var result = bufs.alloc(byteLength); + var outIndex = 0; + + while (length > 0) { + bits.inject(result, outIndex, 7, encodedBuffer[index]); + outIndex += 7; + index++; + length--; + } + + var signBit; + var signByte; + + if (signed) { + // Sign-extend the last byte. + var lastByte = result[byteLength - 1]; + var endBit = outIndex % 8; + + if (endBit !== 0) { + var shift = 32 - endBit; // 32 because JS bit ops work on 32-bit ints. + + lastByte = result[byteLength - 1] = lastByte << shift >> shift & 0xff; + } + + signBit = lastByte >> 7; + signByte = signBit * 0xff; + } else { + signBit = 0; + signByte = 0; + } // Slice off any superfluous bytes, that is, ones that add no meaningful + // bits (because the value would be the same if they were removed). + + + while (byteLength > 1 && result[byteLength - 1] === signByte && (!signed || result[byteLength - 2] >> 7 === signBit)) { + byteLength--; + } + + result = bufs.resize(result, byteLength); + return { + value: result, + nextIndex: index + }; +} +/* + * Exported bindings + */ + + +function encodeIntBuffer(buffer) { + return encodeBufferCommon(buffer, true); +} + +function decodeIntBuffer(encodedBuffer, index) { + return decodeBufferCommon(encodedBuffer, index, true); +} + +function encodeInt32(num) { + var buf = bufs.alloc(4); + buf.writeInt32LE(num, 0); + var result = encodeIntBuffer(buf); + bufs.free(buf); + return result; +} + +function decodeInt32(encodedBuffer, index) { + var result = decodeIntBuffer(encodedBuffer, index); + var parsed = bufs.readInt(result.value); + var value = parsed.value; + bufs.free(result.value); + + if (value < MIN_INT32 || value > MAX_INT32) { + throw new Error("integer too large"); + } + + return { + value: value, + nextIndex: result.nextIndex + }; +} + +function encodeInt64(num) { + var buf = bufs.alloc(8); + bufs.writeInt64(num, buf); + var result = encodeIntBuffer(buf); + bufs.free(buf); + return result; +} + +function decodeInt64(encodedBuffer, index) { + var result = decodeIntBuffer(encodedBuffer, index); + + var value = _long.default.fromBytesLE(result.value, false); + + bufs.free(result.value); + return { + value: value, + nextIndex: result.nextIndex, + lossy: false + }; +} + +function encodeUIntBuffer(buffer) { + return encodeBufferCommon(buffer, false); +} + +function decodeUIntBuffer(encodedBuffer, index) { + return decodeBufferCommon(encodedBuffer, index, false); +} + +function encodeUInt32(num) { + var buf = bufs.alloc(4); + buf.writeUInt32LE(num, 0); + var result = encodeUIntBuffer(buf); + bufs.free(buf); + return result; +} + +function decodeUInt32(encodedBuffer, index) { + var result = decodeUIntBuffer(encodedBuffer, index); + var parsed = bufs.readUInt(result.value); + var value = parsed.value; + bufs.free(result.value); + + if (value > MAX_UINT32) { + throw new Error("integer too large"); + } + + return { + value: value, + nextIndex: result.nextIndex + }; +} + +function encodeUInt64(num) { + var buf = bufs.alloc(8); + bufs.writeUInt64(num, buf); + var result = encodeUIntBuffer(buf); + bufs.free(buf); + return result; +} + +function decodeUInt64(encodedBuffer, index) { + var result = decodeUIntBuffer(encodedBuffer, index); + + var value = _long.default.fromBytesLE(result.value, true); + + bufs.free(result.value); + return { + value: value, + nextIndex: result.nextIndex, + lossy: false + }; +} + +var _default = { + decodeInt32: decodeInt32, + decodeInt64: decodeInt64, + decodeIntBuffer: decodeIntBuffer, + decodeUInt32: decodeUInt32, + decodeUInt64: decodeUInt64, + decodeUIntBuffer: decodeUIntBuffer, + encodeInt32: encodeInt32, + encodeInt64: encodeInt64, + encodeIntBuffer: encodeIntBuffer, + encodeUInt32: encodeUInt32, + encodeUInt64: encodeUInt64, + encodeUIntBuffer: encodeUIntBuffer +}; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/leb128/package.json b/node_modules/@webassemblyjs/leb128/package.json new file mode 100644 index 0000000..85d0c72 --- /dev/null +++ b/node_modules/@webassemblyjs/leb128/package.json @@ -0,0 +1,45 @@ +{ + "_from": "@webassemblyjs/leb128@1.8.5", + "_id": "@webassemblyjs/leb128@1.8.5", + "_inBundle": false, + "_integrity": "sha512-plYUuUwleLIziknvlP8VpTgO4kqNaH57Y3JnNa6DLpu/sGcP6hbVdfdX5aHAV716pQBKrfuU26BJK29qY37J7A==", + "_location": "/@webassemblyjs/leb128", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/leb128@1.8.5", + "name": "@webassemblyjs/leb128", + "escapedName": "@webassemblyjs%2fleb128", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/wasm-gen", + "/@webassemblyjs/wasm-parser" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.8.5.tgz", + "_shasum": "044edeb34ea679f3e04cd4fd9824d5e35767ae10", + "_spec": "@webassemblyjs/leb128@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/wasm-gen", + "bundleDependencies": false, + "dependencies": { + "@xtuc/long": "4.2.2" + }, + "deprecated": false, + "description": "LEB128 decoder and encoder", + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/leb128", + "publishConfig": { + "access": "public" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/utf8/LICENSE b/node_modules/@webassemblyjs/utf8/LICENSE new file mode 100644 index 0000000..87e7e1f --- /dev/null +++ b/node_modules/@webassemblyjs/utf8/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sven Sauleau + +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. diff --git a/node_modules/@webassemblyjs/utf8/esm/decoder.js b/node_modules/@webassemblyjs/utf8/esm/decoder.js new file mode 100644 index 0000000..12d88eb --- /dev/null +++ b/node_modules/@webassemblyjs/utf8/esm/decoder.js @@ -0,0 +1,95 @@ +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } + +function con(b) { + if ((b & 0xc0) === 0x80) { + return b & 0x3f; + } else { + throw new Error("invalid UTF-8 encoding"); + } +} + +function code(min, n) { + if (n < min || 0xd800 <= n && n < 0xe000 || n >= 0x10000) { + throw new Error("invalid UTF-8 encoding"); + } else { + return n; + } +} + +export function decode(bytes) { + return _decode(bytes).map(function (x) { + return String.fromCharCode(x); + }).join(""); +} + +function _decode(bytes) { + if (bytes.length === 0) { + return []; + } + /** + * 1 byte + */ + + + { + var _bytes = _toArray(bytes), + b1 = _bytes[0], + bs = _bytes.slice(1); + + if (b1 < 0x80) { + return [code(0x0, b1)].concat(_toConsumableArray(_decode(bs))); + } + + if (b1 < 0xc0) { + throw new Error("invalid UTF-8 encoding"); + } + } + /** + * 2 bytes + */ + + { + var _bytes2 = _toArray(bytes), + _b = _bytes2[0], + b2 = _bytes2[1], + _bs = _bytes2.slice(2); + + if (_b < 0xe0) { + return [code(0x80, ((_b & 0x1f) << 6) + con(b2))].concat(_toConsumableArray(_decode(_bs))); + } + } + /** + * 3 bytes + */ + + { + var _bytes3 = _toArray(bytes), + _b2 = _bytes3[0], + _b3 = _bytes3[1], + b3 = _bytes3[2], + _bs2 = _bytes3.slice(3); + + if (_b2 < 0xf0) { + return [code(0x800, ((_b2 & 0x0f) << 12) + (con(_b3) << 6) + con(b3))].concat(_toConsumableArray(_decode(_bs2))); + } + } + /** + * 4 bytes + */ + + { + var _bytes4 = _toArray(bytes), + _b4 = _bytes4[0], + _b5 = _bytes4[1], + _b6 = _bytes4[2], + b4 = _bytes4[3], + _bs3 = _bytes4.slice(4); + + if (_b4 < 0xf8) { + return [code(0x10000, (((_b4 & 0x07) << 18) + con(_b5) << 12) + (con(_b6) << 6) + con(b4))].concat(_toConsumableArray(_decode(_bs3))); + } + } + throw new Error("invalid UTF-8 encoding"); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/utf8/esm/encoder.js b/node_modules/@webassemblyjs/utf8/esm/encoder.js new file mode 100644 index 0000000..6d5e4de --- /dev/null +++ b/node_modules/@webassemblyjs/utf8/esm/encoder.js @@ -0,0 +1,46 @@ +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } + +function con(n) { + return 0x80 | n & 0x3f; +} + +export function encode(str) { + var arr = str.split("").map(function (x) { + return x.charCodeAt(0); + }); + return _encode(arr); +} + +function _encode(arr) { + if (arr.length === 0) { + return []; + } + + var _arr = _toArray(arr), + n = _arr[0], + ns = _arr.slice(1); + + if (n < 0) { + throw new Error("utf8"); + } + + if (n < 0x80) { + return [n].concat(_toConsumableArray(_encode(ns))); + } + + if (n < 0x800) { + return [0xc0 | n >>> 6, con(n)].concat(_toConsumableArray(_encode(ns))); + } + + if (n < 0x10000) { + return [0xe0 | n >>> 12, con(n >>> 6), con(n)].concat(_toConsumableArray(_encode(ns))); + } + + if (n < 0x110000) { + return [0xf0 | n >>> 18, con(n >>> 12), con(n >>> 6), con(n)].concat(_toConsumableArray(_encode(ns))); + } + + throw new Error("utf8"); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/utf8/esm/index.js b/node_modules/@webassemblyjs/utf8/esm/index.js new file mode 100644 index 0000000..2e31357 --- /dev/null +++ b/node_modules/@webassemblyjs/utf8/esm/index.js @@ -0,0 +1,2 @@ +export { decode } from "./decoder"; +export { encode } from "./encoder"; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/utf8/lib/decoder.js b/node_modules/@webassemblyjs/utf8/lib/decoder.js new file mode 100644 index 0000000..824c843 --- /dev/null +++ b/node_modules/@webassemblyjs/utf8/lib/decoder.js @@ -0,0 +1,102 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.decode = decode; + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } + +function con(b) { + if ((b & 0xc0) === 0x80) { + return b & 0x3f; + } else { + throw new Error("invalid UTF-8 encoding"); + } +} + +function code(min, n) { + if (n < min || 0xd800 <= n && n < 0xe000 || n >= 0x10000) { + throw new Error("invalid UTF-8 encoding"); + } else { + return n; + } +} + +function decode(bytes) { + return _decode(bytes).map(function (x) { + return String.fromCharCode(x); + }).join(""); +} + +function _decode(bytes) { + if (bytes.length === 0) { + return []; + } + /** + * 1 byte + */ + + + { + var _bytes = _toArray(bytes), + b1 = _bytes[0], + bs = _bytes.slice(1); + + if (b1 < 0x80) { + return [code(0x0, b1)].concat(_toConsumableArray(_decode(bs))); + } + + if (b1 < 0xc0) { + throw new Error("invalid UTF-8 encoding"); + } + } + /** + * 2 bytes + */ + + { + var _bytes2 = _toArray(bytes), + _b = _bytes2[0], + b2 = _bytes2[1], + _bs = _bytes2.slice(2); + + if (_b < 0xe0) { + return [code(0x80, ((_b & 0x1f) << 6) + con(b2))].concat(_toConsumableArray(_decode(_bs))); + } + } + /** + * 3 bytes + */ + + { + var _bytes3 = _toArray(bytes), + _b2 = _bytes3[0], + _b3 = _bytes3[1], + b3 = _bytes3[2], + _bs2 = _bytes3.slice(3); + + if (_b2 < 0xf0) { + return [code(0x800, ((_b2 & 0x0f) << 12) + (con(_b3) << 6) + con(b3))].concat(_toConsumableArray(_decode(_bs2))); + } + } + /** + * 4 bytes + */ + + { + var _bytes4 = _toArray(bytes), + _b4 = _bytes4[0], + _b5 = _bytes4[1], + _b6 = _bytes4[2], + b4 = _bytes4[3], + _bs3 = _bytes4.slice(4); + + if (_b4 < 0xf8) { + return [code(0x10000, (((_b4 & 0x07) << 18) + con(_b5) << 12) + (con(_b6) << 6) + con(b4))].concat(_toConsumableArray(_decode(_bs3))); + } + } + throw new Error("invalid UTF-8 encoding"); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/utf8/lib/encoder.js b/node_modules/@webassemblyjs/utf8/lib/encoder.js new file mode 100644 index 0000000..0606b56 --- /dev/null +++ b/node_modules/@webassemblyjs/utf8/lib/encoder.js @@ -0,0 +1,53 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.encode = encode; + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } + +function con(n) { + return 0x80 | n & 0x3f; +} + +function encode(str) { + var arr = str.split("").map(function (x) { + return x.charCodeAt(0); + }); + return _encode(arr); +} + +function _encode(arr) { + if (arr.length === 0) { + return []; + } + + var _arr = _toArray(arr), + n = _arr[0], + ns = _arr.slice(1); + + if (n < 0) { + throw new Error("utf8"); + } + + if (n < 0x80) { + return [n].concat(_toConsumableArray(_encode(ns))); + } + + if (n < 0x800) { + return [0xc0 | n >>> 6, con(n)].concat(_toConsumableArray(_encode(ns))); + } + + if (n < 0x10000) { + return [0xe0 | n >>> 12, con(n >>> 6), con(n)].concat(_toConsumableArray(_encode(ns))); + } + + if (n < 0x110000) { + return [0xf0 | n >>> 18, con(n >>> 12), con(n >>> 6), con(n)].concat(_toConsumableArray(_encode(ns))); + } + + throw new Error("utf8"); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/utf8/lib/index.js b/node_modules/@webassemblyjs/utf8/lib/index.js new file mode 100644 index 0000000..fef9470 --- /dev/null +++ b/node_modules/@webassemblyjs/utf8/lib/index.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "decode", { + enumerable: true, + get: function get() { + return _decoder.decode; + } +}); +Object.defineProperty(exports, "encode", { + enumerable: true, + get: function get() { + return _encoder.encode; + } +}); + +var _decoder = require("./decoder"); + +var _encoder = require("./encoder"); \ No newline at end of file diff --git a/node_modules/@webassemblyjs/utf8/package.json b/node_modules/@webassemblyjs/utf8/package.json new file mode 100644 index 0000000..15cea9d --- /dev/null +++ b/node_modules/@webassemblyjs/utf8/package.json @@ -0,0 +1,53 @@ +{ + "_from": "@webassemblyjs/utf8@1.8.5", + "_id": "@webassemblyjs/utf8@1.8.5", + "_inBundle": false, + "_integrity": "sha512-U7zgftmQriw37tfD934UNInokz6yTmn29inT2cAetAsaU9YeVCveWEwhKL1Mg4yS7q//NGdzy79nlXh3bT8Kjw==", + "_location": "/@webassemblyjs/utf8", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/utf8@1.8.5", + "name": "@webassemblyjs/utf8", + "escapedName": "@webassemblyjs%2futf8", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/wasm-gen", + "/@webassemblyjs/wasm-parser" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.8.5.tgz", + "_shasum": "a8bf3b5d8ffe986c7c1e373ccbdc2a0915f0cedc", + "_spec": "@webassemblyjs/utf8@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/wasm-gen", + "author": { + "name": "Sven Sauleau" + }, + "bugs": { + "url": "https://github.com/xtuc/webassemblyjs/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "UTF8 encoder/decoder for WASM", + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "homepage": "https://github.com/xtuc/webassemblyjs#readme", + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/utf8", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/xtuc/webassemblyjs.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/utf8/src/decoder.js b/node_modules/@webassemblyjs/utf8/src/decoder.js new file mode 100644 index 0000000..227ba3a --- /dev/null +++ b/node_modules/@webassemblyjs/utf8/src/decoder.js @@ -0,0 +1,86 @@ +function con(b) { + if ((b & 0xc0) === 0x80) { + return b & 0x3f; + } else { + throw new Error("invalid UTF-8 encoding"); + } +} + +function code(min, n) { + if (n < min || (0xd800 <= n && n < 0xe000) || n >= 0x10000) { + throw new Error("invalid UTF-8 encoding"); + } else { + return n; + } +} + +export function decode(bytes) { + return _decode(bytes) + .map(x => String.fromCharCode(x)) + .join(""); +} + +function _decode(bytes) { + if (bytes.length === 0) { + return []; + } + + /** + * 1 byte + */ + { + const [b1, ...bs] = bytes; + + if (b1 < 0x80) { + return [code(0x0, b1), ..._decode(bs)]; + } + + if (b1 < 0xc0) { + throw new Error("invalid UTF-8 encoding"); + } + } + + /** + * 2 bytes + */ + { + const [b1, b2, ...bs] = bytes; + + if (b1 < 0xe0) { + return [code(0x80, ((b1 & 0x1f) << 6) + con(b2)), ..._decode(bs)]; + } + } + + /** + * 3 bytes + */ + { + const [b1, b2, b3, ...bs] = bytes; + + if (b1 < 0xf0) { + return [ + code(0x800, ((b1 & 0x0f) << 12) + (con(b2) << 6) + con(b3)), + ..._decode(bs) + ]; + } + } + + /** + * 4 bytes + */ + { + const [b1, b2, b3, b4, ...bs] = bytes; + + if (b1 < 0xf8) { + return [ + code( + 0x10000, + ((((b1 & 0x07) << 18) + con(b2)) << 12) + (con(b3) << 6) + con(b4) + ), + ..._decode(bs) + ]; + } + } + + throw new Error("invalid UTF-8 encoding"); +} diff --git a/node_modules/@webassemblyjs/utf8/src/encoder.js b/node_modules/@webassemblyjs/utf8/src/encoder.js new file mode 100644 index 0000000..1c482f0 --- /dev/null +++ b/node_modules/@webassemblyjs/utf8/src/encoder.js @@ -0,0 +1,44 @@ +function con(n) { + return 0x80 | (n & 0x3f); +} + +export function encode(str) { + const arr = str.split("").map(x => x.charCodeAt(0)); + return _encode(arr); +} + +function _encode(arr) { + if (arr.length === 0) { + return []; + } + + const [n, ...ns] = arr; + + if (n < 0) { + throw new Error("utf8"); + } + + if (n < 0x80) { + return [n, ..._encode(ns)]; + } + + if (n < 0x800) { + return [0xc0 | (n >>> 6), con(n), ..._encode(ns)]; + } + + if (n < 0x10000) { + return [0xe0 | (n >>> 12), con(n >>> 6), con(n), ..._encode(ns)]; + } + + if (n < 0x110000) { + return [ + 0xf0 | (n >>> 18), + con(n >>> 12), + con(n >>> 6), + con(n), + ..._encode(ns) + ]; + } + + throw new Error("utf8"); +} diff --git a/node_modules/@webassemblyjs/utf8/src/index.js b/node_modules/@webassemblyjs/utf8/src/index.js new file mode 100644 index 0000000..82cf9a7 --- /dev/null +++ b/node_modules/@webassemblyjs/utf8/src/index.js @@ -0,0 +1,4 @@ +// @flow + +export { decode } from "./decoder"; +export { encode } from "./encoder"; diff --git a/node_modules/@webassemblyjs/utf8/test/index.js b/node_modules/@webassemblyjs/utf8/test/index.js new file mode 100644 index 0000000..dabdc6c --- /dev/null +++ b/node_modules/@webassemblyjs/utf8/test/index.js @@ -0,0 +1,13 @@ +const { assert } = require("chai"); + +const { decode, encode } = require("../lib"); + +describe("UTF8", () => { + it("should f-1(f(x)) = x", () => { + assert.equal(decode(encode("foo")), "foo"); + assert.equal(decode(encode("éé")), "éé"); + + // TODO(sven): utf8 encoder fails here + // assert.equal(decode(encode("🤣见見")), "🤣见見"); + }); +}); diff --git a/node_modules/@webassemblyjs/wasm-edit/LICENSE b/node_modules/@webassemblyjs/wasm-edit/LICENSE new file mode 100644 index 0000000..87e7e1f --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-edit/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sven Sauleau + +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. diff --git a/node_modules/@webassemblyjs/wasm-edit/README.md b/node_modules/@webassemblyjs/wasm-edit/README.md new file mode 100644 index 0000000..f03462f --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-edit/README.md @@ -0,0 +1,86 @@ +# @webassemblyjs/wasm-edit + +> Rewrite a WASM binary + +Replace in-place an AST node in the binary. + +## Installation + +```sh +yarn add @webassemblyjs/wasm-edit +``` + +## Usage + +Update: + +```js +import { edit } from "@webassemblyjs/wasm-edit"; + +const binary = [/*...*/]; + +const visitors = { + ModuleImport({ node }) { + node.module = "foo"; + node.name = "bar"; + } +}; + +const newBinary = edit(binary, visitors); +``` + +Replace: + +```js +import { edit } from "@webassemblyjs/wasm-edit"; + +const binary = [/*...*/]; + +const visitors = { + Instr(path) { + const newNode = t.callInstruction(t.indexLiteral(0)); + path.replaceWith(newNode); + } +}; + +const newBinary = edit(binary, visitors); +``` + +Remove: + +```js +import { edit } from "@webassemblyjs/wasm-edit"; + +const binary = [/*...*/]; + +const visitors = { + ModuleExport({ node }) { + path.remove() + } +}; + +const newBinary = edit(binary, visitors); +``` + +Insert: + +```js +import { add } from "@webassemblyjs/wasm-edit"; + +const binary = [/*...*/]; + +const newBinary = add(actualBinary, [ + t.moduleImport("env", "mem", t.memory(t.limit(1))) +]); +``` + +## Providing the AST + +Providing an AST allows you to handle the decoding yourself, here is the API: + +```js +addWithAST(Program, ArrayBuffer, Array): ArrayBuffer; +editWithAST(Program, ArrayBuffer, visitors): ArrayBuffer; +``` + +Note that the AST will be updated in-place. diff --git a/node_modules/@webassemblyjs/wasm-edit/esm/apply.js b/node_modules/@webassemblyjs/wasm-edit/esm/apply.js new file mode 100644 index 0000000..62b751a --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-edit/esm/apply.js @@ -0,0 +1,299 @@ +function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } + +import { encodeNode } from "@webassemblyjs/wasm-gen"; +import { encodeU32 } from "@webassemblyjs/wasm-gen/lib/encoder"; +import { isFunc, isGlobal, assertHasLoc, orderedInsertNode, getSectionMetadata, traverse, getEndOfSection } from "@webassemblyjs/ast"; +import { resizeSectionByteSize, resizeSectionVecSize, createEmptySection, removeSections } from "@webassemblyjs/helper-wasm-section"; +import { overrideBytesInBuffer } from "@webassemblyjs/helper-buffer"; +import { getSectionForNode } from "@webassemblyjs/helper-wasm-bytecode"; + +function shiftLocNodeByDelta(node, delta) { + assertHasLoc(node); // $FlowIgnore: assertHasLoc ensures that + + node.loc.start.column += delta; // $FlowIgnore: assertHasLoc ensures that + + node.loc.end.column += delta; +} + +function applyUpdate(ast, uint8Buffer, _ref) { + var _ref2 = _slicedToArray(_ref, 2), + oldNode = _ref2[0], + newNode = _ref2[1]; + + var deltaElements = 0; + assertHasLoc(oldNode); + var sectionName = getSectionForNode(newNode); + var replacementByteArray = encodeNode(newNode); + /** + * Replace new node as bytes + */ + + uint8Buffer = overrideBytesInBuffer(uint8Buffer, // $FlowIgnore: assertHasLoc ensures that + oldNode.loc.start.column, // $FlowIgnore: assertHasLoc ensures that + oldNode.loc.end.column, replacementByteArray); + /** + * Update function body size if needed + */ + + if (sectionName === "code") { + // Find the parent func + traverse(ast, { + Func: function Func(_ref3) { + var node = _ref3.node; + var funcHasThisIntr = node.body.find(function (n) { + return n === newNode; + }) !== undefined; // Update func's body size if needed + + if (funcHasThisIntr === true) { + // These are the old functions locations informations + assertHasLoc(node); + var oldNodeSize = encodeNode(oldNode).length; + var bodySizeDeltaBytes = replacementByteArray.length - oldNodeSize; + + if (bodySizeDeltaBytes !== 0) { + var newValue = node.metadata.bodySize + bodySizeDeltaBytes; + var newByteArray = encodeU32(newValue); // function body size byte + // FIXME(sven): only handles one byte u32 + + var start = node.loc.start.column; + var end = start + 1; + uint8Buffer = overrideBytesInBuffer(uint8Buffer, start, end, newByteArray); + } + } + } + }); + } + /** + * Update section size + */ + + + var deltaBytes = replacementByteArray.length - ( // $FlowIgnore: assertHasLoc ensures that + oldNode.loc.end.column - oldNode.loc.start.column); // Init location informations + + newNode.loc = { + start: { + line: -1, + column: -1 + }, + end: { + line: -1, + column: -1 + } + }; // Update new node end position + // $FlowIgnore: assertHasLoc ensures that + + newNode.loc.start.column = oldNode.loc.start.column; // $FlowIgnore: assertHasLoc ensures that + + newNode.loc.end.column = // $FlowIgnore: assertHasLoc ensures that + oldNode.loc.start.column + replacementByteArray.length; + return { + uint8Buffer: uint8Buffer, + deltaBytes: deltaBytes, + deltaElements: deltaElements + }; +} + +function applyDelete(ast, uint8Buffer, node) { + var deltaElements = -1; // since we removed an element + + assertHasLoc(node); + var sectionName = getSectionForNode(node); + + if (sectionName === "start") { + var sectionMetadata = getSectionMetadata(ast, "start"); + /** + * The start section only contains one element, + * we need to remove the whole section + */ + + uint8Buffer = removeSections(ast, uint8Buffer, "start"); + + var _deltaBytes = -(sectionMetadata.size.value + 1) + /* section id */ + ; + + return { + uint8Buffer: uint8Buffer, + deltaBytes: _deltaBytes, + deltaElements: deltaElements + }; + } // replacement is nothing + + + var replacement = []; + uint8Buffer = overrideBytesInBuffer(uint8Buffer, // $FlowIgnore: assertHasLoc ensures that + node.loc.start.column, // $FlowIgnore: assertHasLoc ensures that + node.loc.end.column, replacement); + /** + * Update section + */ + // $FlowIgnore: assertHasLoc ensures that + + var deltaBytes = -(node.loc.end.column - node.loc.start.column); + return { + uint8Buffer: uint8Buffer, + deltaBytes: deltaBytes, + deltaElements: deltaElements + }; +} + +function applyAdd(ast, uint8Buffer, node) { + var deltaElements = +1; // since we added an element + + var sectionName = getSectionForNode(node); + var sectionMetadata = getSectionMetadata(ast, sectionName); // Section doesn't exists, we create an empty one + + if (typeof sectionMetadata === "undefined") { + var res = createEmptySection(ast, uint8Buffer, sectionName); + uint8Buffer = res.uint8Buffer; + sectionMetadata = res.sectionMetadata; + } + /** + * check that the expressions were ended + */ + + + if (isFunc(node)) { + // $FlowIgnore + var body = node.body; + + if (body.length === 0 || body[body.length - 1].id !== "end") { + throw new Error("expressions must be ended"); + } + } + + if (isGlobal(node)) { + // $FlowIgnore + var body = node.init; + + if (body.length === 0 || body[body.length - 1].id !== "end") { + throw new Error("expressions must be ended"); + } + } + /** + * Add nodes + */ + + + var newByteArray = encodeNode(node); // The size of the section doesn't include the storage of the size itself + // we need to manually add it here + + var start = getEndOfSection(sectionMetadata); + var end = start; + /** + * Update section + */ + + var deltaBytes = newByteArray.length; + uint8Buffer = overrideBytesInBuffer(uint8Buffer, start, end, newByteArray); + node.loc = { + start: { + line: -1, + column: start + }, + end: { + line: -1, + column: start + deltaBytes + } + }; // for func add the additional metadata in the AST + + if (node.type === "Func") { + // the size is the first byte + // FIXME(sven): handle LEB128 correctly here + var bodySize = newByteArray[0]; + node.metadata = { + bodySize: bodySize + }; + } + + if (node.type !== "IndexInFuncSection") { + orderedInsertNode(ast.body[0], node); + } + + return { + uint8Buffer: uint8Buffer, + deltaBytes: deltaBytes, + deltaElements: deltaElements + }; +} + +export function applyOperations(ast, uint8Buffer, ops) { + ops.forEach(function (op) { + var state; + var sectionName; + + switch (op.kind) { + case "update": + state = applyUpdate(ast, uint8Buffer, [op.oldNode, op.node]); + sectionName = getSectionForNode(op.node); + break; + + case "delete": + state = applyDelete(ast, uint8Buffer, op.node); + sectionName = getSectionForNode(op.node); + break; + + case "add": + state = applyAdd(ast, uint8Buffer, op.node); + sectionName = getSectionForNode(op.node); + break; + + default: + throw new Error("Unknown operation"); + } + /** + * Resize section vec size. + * If the length of the LEB-encoded size changes, this can change + * the byte length of the section and the offset for nodes in the + * section. So we do this first before resizing section byte size + * or shifting following operations' nodes. + */ + + + if (state.deltaElements !== 0 && sectionName !== "start") { + var oldBufferLength = state.uint8Buffer.length; + state.uint8Buffer = resizeSectionVecSize(ast, state.uint8Buffer, sectionName, state.deltaElements); // Infer bytes added/removed by comparing buffer lengths + + state.deltaBytes += state.uint8Buffer.length - oldBufferLength; + } + /** + * Resize section byte size. + * If the length of the LEB-encoded size changes, this can change + * the offset for nodes in the section. So we do this before + * shifting following operations' nodes. + */ + + + if (state.deltaBytes !== 0 && sectionName !== "start") { + var _oldBufferLength = state.uint8Buffer.length; + state.uint8Buffer = resizeSectionByteSize(ast, state.uint8Buffer, sectionName, state.deltaBytes); // Infer bytes added/removed by comparing buffer lengths + + state.deltaBytes += state.uint8Buffer.length - _oldBufferLength; + } + /** + * Shift following operation's nodes + */ + + + if (state.deltaBytes !== 0) { + ops.forEach(function (op) { + // We don't need to handle add ops, they are positioning independent + switch (op.kind) { + case "update": + shiftLocNodeByDelta(op.oldNode, state.deltaBytes); + break; + + case "delete": + shiftLocNodeByDelta(op.node, state.deltaBytes); + break; + } + }); + } + + uint8Buffer = state.uint8Buffer; + }); + return uint8Buffer; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-edit/esm/index.js b/node_modules/@webassemblyjs/wasm-edit/esm/index.js new file mode 100644 index 0000000..6ed9d53 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-edit/esm/index.js @@ -0,0 +1,114 @@ +import { decode } from "@webassemblyjs/wasm-parser"; +import { traverse } from "@webassemblyjs/ast"; +import { cloneNode } from "@webassemblyjs/ast/lib/clone"; +import { shrinkPaddedLEB128 } from "@webassemblyjs/wasm-opt"; +import { getSectionForNode } from "@webassemblyjs/helper-wasm-bytecode"; +import constants from "@webassemblyjs/helper-wasm-bytecode"; +import { applyOperations } from "./apply"; + +function hashNode(node) { + return JSON.stringify(node); +} + +function preprocess(ab) { + var optBin = shrinkPaddedLEB128(new Uint8Array(ab)); + return optBin.buffer; +} + +function sortBySectionOrder(nodes) { + var originalOrder = new Map(); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _node = _step.value; + originalOrder.set(_node, originalOrder.size); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + nodes.sort(function (a, b) { + var sectionA = getSectionForNode(a); + var sectionB = getSectionForNode(b); + var aId = constants.sections[sectionA]; + var bId = constants.sections[sectionB]; + + if (typeof aId !== "number" || typeof bId !== "number") { + throw new Error("Section id not found"); + } + + if (aId === bId) { + // $FlowIgnore originalOrder is filled for all nodes + return originalOrder.get(a) - originalOrder.get(b); + } + + return aId - bId; + }); +} + +export function edit(ab, visitors) { + ab = preprocess(ab); + var ast = decode(ab); + return editWithAST(ast, ab, visitors); +} +export function editWithAST(ast, ab, visitors) { + var operations = []; + var uint8Buffer = new Uint8Array(ab); + var nodeBefore; + + function before(type, path) { + nodeBefore = cloneNode(path.node); + } + + function after(type, path) { + if (path.node._deleted === true) { + operations.push({ + kind: "delete", + node: path.node + }); // $FlowIgnore + } else if (hashNode(nodeBefore) !== hashNode(path.node)) { + operations.push({ + kind: "update", + oldNode: nodeBefore, + node: path.node + }); + } + } + + traverse(ast, visitors, before, after); + uint8Buffer = applyOperations(ast, uint8Buffer, operations); + return uint8Buffer.buffer; +} +export function add(ab, newNodes) { + ab = preprocess(ab); + var ast = decode(ab); + return addWithAST(ast, ab, newNodes); +} +export function addWithAST(ast, ab, newNodes) { + // Sort nodes by insertion order + sortBySectionOrder(newNodes); + var uint8Buffer = new Uint8Array(ab); // Map node into operations + + var operations = newNodes.map(function (n) { + return { + kind: "add", + node: n + }; + }); + uint8Buffer = applyOperations(ast, uint8Buffer, operations); + return uint8Buffer.buffer; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-edit/lib/apply.js b/node_modules/@webassemblyjs/wasm-edit/lib/apply.js new file mode 100644 index 0000000..a77b3b4 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-edit/lib/apply.js @@ -0,0 +1,311 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.applyOperations = applyOperations; + +var _wasmGen = require("@webassemblyjs/wasm-gen"); + +var _encoder = require("@webassemblyjs/wasm-gen/lib/encoder"); + +var _ast = require("@webassemblyjs/ast"); + +var _helperWasmSection = require("@webassemblyjs/helper-wasm-section"); + +var _helperBuffer = require("@webassemblyjs/helper-buffer"); + +var _helperWasmBytecode = require("@webassemblyjs/helper-wasm-bytecode"); + +function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } + +function shiftLocNodeByDelta(node, delta) { + (0, _ast.assertHasLoc)(node); // $FlowIgnore: assertHasLoc ensures that + + node.loc.start.column += delta; // $FlowIgnore: assertHasLoc ensures that + + node.loc.end.column += delta; +} + +function applyUpdate(ast, uint8Buffer, _ref) { + var _ref2 = _slicedToArray(_ref, 2), + oldNode = _ref2[0], + newNode = _ref2[1]; + + var deltaElements = 0; + (0, _ast.assertHasLoc)(oldNode); + var sectionName = (0, _helperWasmBytecode.getSectionForNode)(newNode); + var replacementByteArray = (0, _wasmGen.encodeNode)(newNode); + /** + * Replace new node as bytes + */ + + uint8Buffer = (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, // $FlowIgnore: assertHasLoc ensures that + oldNode.loc.start.column, // $FlowIgnore: assertHasLoc ensures that + oldNode.loc.end.column, replacementByteArray); + /** + * Update function body size if needed + */ + + if (sectionName === "code") { + // Find the parent func + (0, _ast.traverse)(ast, { + Func: function Func(_ref3) { + var node = _ref3.node; + var funcHasThisIntr = node.body.find(function (n) { + return n === newNode; + }) !== undefined; // Update func's body size if needed + + if (funcHasThisIntr === true) { + // These are the old functions locations informations + (0, _ast.assertHasLoc)(node); + var oldNodeSize = (0, _wasmGen.encodeNode)(oldNode).length; + var bodySizeDeltaBytes = replacementByteArray.length - oldNodeSize; + + if (bodySizeDeltaBytes !== 0) { + var newValue = node.metadata.bodySize + bodySizeDeltaBytes; + var newByteArray = (0, _encoder.encodeU32)(newValue); // function body size byte + // FIXME(sven): only handles one byte u32 + + var start = node.loc.start.column; + var end = start + 1; + uint8Buffer = (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newByteArray); + } + } + } + }); + } + /** + * Update section size + */ + + + var deltaBytes = replacementByteArray.length - ( // $FlowIgnore: assertHasLoc ensures that + oldNode.loc.end.column - oldNode.loc.start.column); // Init location informations + + newNode.loc = { + start: { + line: -1, + column: -1 + }, + end: { + line: -1, + column: -1 + } + }; // Update new node end position + // $FlowIgnore: assertHasLoc ensures that + + newNode.loc.start.column = oldNode.loc.start.column; // $FlowIgnore: assertHasLoc ensures that + + newNode.loc.end.column = // $FlowIgnore: assertHasLoc ensures that + oldNode.loc.start.column + replacementByteArray.length; + return { + uint8Buffer: uint8Buffer, + deltaBytes: deltaBytes, + deltaElements: deltaElements + }; +} + +function applyDelete(ast, uint8Buffer, node) { + var deltaElements = -1; // since we removed an element + + (0, _ast.assertHasLoc)(node); + var sectionName = (0, _helperWasmBytecode.getSectionForNode)(node); + + if (sectionName === "start") { + var sectionMetadata = (0, _ast.getSectionMetadata)(ast, "start"); + /** + * The start section only contains one element, + * we need to remove the whole section + */ + + uint8Buffer = (0, _helperWasmSection.removeSections)(ast, uint8Buffer, "start"); + + var _deltaBytes = -(sectionMetadata.size.value + 1) + /* section id */ + ; + + return { + uint8Buffer: uint8Buffer, + deltaBytes: _deltaBytes, + deltaElements: deltaElements + }; + } // replacement is nothing + + + var replacement = []; + uint8Buffer = (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, // $FlowIgnore: assertHasLoc ensures that + node.loc.start.column, // $FlowIgnore: assertHasLoc ensures that + node.loc.end.column, replacement); + /** + * Update section + */ + // $FlowIgnore: assertHasLoc ensures that + + var deltaBytes = -(node.loc.end.column - node.loc.start.column); + return { + uint8Buffer: uint8Buffer, + deltaBytes: deltaBytes, + deltaElements: deltaElements + }; +} + +function applyAdd(ast, uint8Buffer, node) { + var deltaElements = +1; // since we added an element + + var sectionName = (0, _helperWasmBytecode.getSectionForNode)(node); + var sectionMetadata = (0, _ast.getSectionMetadata)(ast, sectionName); // Section doesn't exists, we create an empty one + + if (typeof sectionMetadata === "undefined") { + var res = (0, _helperWasmSection.createEmptySection)(ast, uint8Buffer, sectionName); + uint8Buffer = res.uint8Buffer; + sectionMetadata = res.sectionMetadata; + } + /** + * check that the expressions were ended + */ + + + if ((0, _ast.isFunc)(node)) { + // $FlowIgnore + var body = node.body; + + if (body.length === 0 || body[body.length - 1].id !== "end") { + throw new Error("expressions must be ended"); + } + } + + if ((0, _ast.isGlobal)(node)) { + // $FlowIgnore + var body = node.init; + + if (body.length === 0 || body[body.length - 1].id !== "end") { + throw new Error("expressions must be ended"); + } + } + /** + * Add nodes + */ + + + var newByteArray = (0, _wasmGen.encodeNode)(node); // The size of the section doesn't include the storage of the size itself + // we need to manually add it here + + var start = (0, _ast.getEndOfSection)(sectionMetadata); + var end = start; + /** + * Update section + */ + + var deltaBytes = newByteArray.length; + uint8Buffer = (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newByteArray); + node.loc = { + start: { + line: -1, + column: start + }, + end: { + line: -1, + column: start + deltaBytes + } + }; // for func add the additional metadata in the AST + + if (node.type === "Func") { + // the size is the first byte + // FIXME(sven): handle LEB128 correctly here + var bodySize = newByteArray[0]; + node.metadata = { + bodySize: bodySize + }; + } + + if (node.type !== "IndexInFuncSection") { + (0, _ast.orderedInsertNode)(ast.body[0], node); + } + + return { + uint8Buffer: uint8Buffer, + deltaBytes: deltaBytes, + deltaElements: deltaElements + }; +} + +function applyOperations(ast, uint8Buffer, ops) { + ops.forEach(function (op) { + var state; + var sectionName; + + switch (op.kind) { + case "update": + state = applyUpdate(ast, uint8Buffer, [op.oldNode, op.node]); + sectionName = (0, _helperWasmBytecode.getSectionForNode)(op.node); + break; + + case "delete": + state = applyDelete(ast, uint8Buffer, op.node); + sectionName = (0, _helperWasmBytecode.getSectionForNode)(op.node); + break; + + case "add": + state = applyAdd(ast, uint8Buffer, op.node); + sectionName = (0, _helperWasmBytecode.getSectionForNode)(op.node); + break; + + default: + throw new Error("Unknown operation"); + } + /** + * Resize section vec size. + * If the length of the LEB-encoded size changes, this can change + * the byte length of the section and the offset for nodes in the + * section. So we do this first before resizing section byte size + * or shifting following operations' nodes. + */ + + + if (state.deltaElements !== 0 && sectionName !== "start") { + var oldBufferLength = state.uint8Buffer.length; + state.uint8Buffer = (0, _helperWasmSection.resizeSectionVecSize)(ast, state.uint8Buffer, sectionName, state.deltaElements); // Infer bytes added/removed by comparing buffer lengths + + state.deltaBytes += state.uint8Buffer.length - oldBufferLength; + } + /** + * Resize section byte size. + * If the length of the LEB-encoded size changes, this can change + * the offset for nodes in the section. So we do this before + * shifting following operations' nodes. + */ + + + if (state.deltaBytes !== 0 && sectionName !== "start") { + var _oldBufferLength = state.uint8Buffer.length; + state.uint8Buffer = (0, _helperWasmSection.resizeSectionByteSize)(ast, state.uint8Buffer, sectionName, state.deltaBytes); // Infer bytes added/removed by comparing buffer lengths + + state.deltaBytes += state.uint8Buffer.length - _oldBufferLength; + } + /** + * Shift following operation's nodes + */ + + + if (state.deltaBytes !== 0) { + ops.forEach(function (op) { + // We don't need to handle add ops, they are positioning independent + switch (op.kind) { + case "update": + shiftLocNodeByDelta(op.oldNode, state.deltaBytes); + break; + + case "delete": + shiftLocNodeByDelta(op.node, state.deltaBytes); + break; + } + }); + } + + uint8Buffer = state.uint8Buffer; + }); + return uint8Buffer; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-edit/lib/index.js b/node_modules/@webassemblyjs/wasm-edit/lib/index.js new file mode 100644 index 0000000..3f9b295 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-edit/lib/index.js @@ -0,0 +1,133 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.edit = edit; +exports.editWithAST = editWithAST; +exports.add = add; +exports.addWithAST = addWithAST; + +var _wasmParser = require("@webassemblyjs/wasm-parser"); + +var _ast = require("@webassemblyjs/ast"); + +var _clone = require("@webassemblyjs/ast/lib/clone"); + +var _wasmOpt = require("@webassemblyjs/wasm-opt"); + +var _helperWasmBytecode = _interopRequireWildcard(require("@webassemblyjs/helper-wasm-bytecode")); + +var _apply = require("./apply"); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + +function hashNode(node) { + return JSON.stringify(node); +} + +function preprocess(ab) { + var optBin = (0, _wasmOpt.shrinkPaddedLEB128)(new Uint8Array(ab)); + return optBin.buffer; +} + +function sortBySectionOrder(nodes) { + var originalOrder = new Map(); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _node = _step.value; + originalOrder.set(_node, originalOrder.size); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + nodes.sort(function (a, b) { + var sectionA = (0, _helperWasmBytecode.getSectionForNode)(a); + var sectionB = (0, _helperWasmBytecode.getSectionForNode)(b); + var aId = _helperWasmBytecode.default.sections[sectionA]; + var bId = _helperWasmBytecode.default.sections[sectionB]; + + if (typeof aId !== "number" || typeof bId !== "number") { + throw new Error("Section id not found"); + } + + if (aId === bId) { + // $FlowIgnore originalOrder is filled for all nodes + return originalOrder.get(a) - originalOrder.get(b); + } + + return aId - bId; + }); +} + +function edit(ab, visitors) { + ab = preprocess(ab); + var ast = (0, _wasmParser.decode)(ab); + return editWithAST(ast, ab, visitors); +} + +function editWithAST(ast, ab, visitors) { + var operations = []; + var uint8Buffer = new Uint8Array(ab); + var nodeBefore; + + function before(type, path) { + nodeBefore = (0, _clone.cloneNode)(path.node); + } + + function after(type, path) { + if (path.node._deleted === true) { + operations.push({ + kind: "delete", + node: path.node + }); // $FlowIgnore + } else if (hashNode(nodeBefore) !== hashNode(path.node)) { + operations.push({ + kind: "update", + oldNode: nodeBefore, + node: path.node + }); + } + } + + (0, _ast.traverse)(ast, visitors, before, after); + uint8Buffer = (0, _apply.applyOperations)(ast, uint8Buffer, operations); + return uint8Buffer.buffer; +} + +function add(ab, newNodes) { + ab = preprocess(ab); + var ast = (0, _wasmParser.decode)(ab); + return addWithAST(ast, ab, newNodes); +} + +function addWithAST(ast, ab, newNodes) { + // Sort nodes by insertion order + sortBySectionOrder(newNodes); + var uint8Buffer = new Uint8Array(ab); // Map node into operations + + var operations = newNodes.map(function (n) { + return { + kind: "add", + node: n + }; + }); + uint8Buffer = (0, _apply.applyOperations)(ast, uint8Buffer, operations); + return uint8Buffer.buffer; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-edit/package.json b/node_modules/@webassemblyjs/wasm-edit/package.json new file mode 100644 index 0000000..a192fb8 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-edit/package.json @@ -0,0 +1,65 @@ +{ + "_from": "@webassemblyjs/wasm-edit@1.8.5", + "_id": "@webassemblyjs/wasm-edit@1.8.5", + "_inBundle": false, + "_integrity": "sha512-A41EMy8MWw5yvqj7MQzkDjU29K7UJq1VrX2vWLzfpRHt3ISftOXqrtojn7nlPsZ9Ijhp5NwuODuycSvfAO/26Q==", + "_location": "/@webassemblyjs/wasm-edit", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/wasm-edit@1.8.5", + "name": "@webassemblyjs/wasm-edit", + "escapedName": "@webassemblyjs%2fwasm-edit", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/webpack" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.8.5.tgz", + "_shasum": "962da12aa5acc1c131c81c4232991c82ce56e01a", + "_spec": "@webassemblyjs/wasm-edit@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/webpack", + "author": { + "name": "Sven Sauleau" + }, + "bugs": { + "url": "https://github.com/xtuc/webassemblyjs/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/helper-wasm-section": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5", + "@webassemblyjs/wasm-opt": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5", + "@webassemblyjs/wast-printer": "1.8.5" + }, + "deprecated": false, + "description": "> Rewrite a WASM binary", + "devDependencies": { + "@webassemblyjs/helper-test-framework": "1.8.5" + }, + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "homepage": "https://github.com/xtuc/webassemblyjs#readme", + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/wasm-edit", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/xtuc/webassemblyjs.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/wasm-edit/webassemblyjs-wasm-edit-1.7.10.tgz b/node_modules/@webassemblyjs/wasm-edit/webassemblyjs-wasm-edit-1.7.10.tgz new file mode 100644 index 0000000000000000000000000000000000000000..399299fd24f2dc39ad013e97492f689a0a2150f4 GIT binary patch literal 5634 zcmV+d7X9fTiwFP!000001MNNiciT3S`!oLvRK2&ATA7xd#Oc}V?#i~(=+3tMB)i$Z zte;DXki~=|btDy6m-YXCGlLI;ACjfScG9cZzS<;!!C)|$FU-_aXZYT^;oDR3(|#9+ z!CxNuX*3$UyU$tKcX*n+&!4fsJbSU*Xf}6u8_*AadGP{&J~Sd_&n!-y2vGT4IASqO z|NMhIA1%fzfivNiJy!Y0Egv{>%qIhX{x06Wb>hhucfF)i$6g$`yV($* zT^7@4#5HC3I&#&Bo(Nu1x@np%Kx74+)PG>N*^U>|d33 z6ot_q3qpnsES~bAH}bgquL}F?Um5@1OIWi4Bku@W#HV5GC1Er-0M4g0_l;Z>e40f* zeiT1m?wM~x_qrcF&`#HPAQI|&NqC;j^XtFg;K|<6U8em6Z$4w)5r^wOlQ4Y zF8^@6$_B`lBTH_LA~;I7Vf4NXATZBs?zq@Adhz1N;qI{U{AKgUm!qBM&dyGw;S3tj zn~mqA=F4X;-`UxH`Jc}#)}8gJ=U>YG?UT+?`>fx7lsT5m|D7g^%dGrw?Cdr+^8YCw zkTvW?h#t#23a9hPyBQ~}I;^psM)OBz3M%%u7~cL7i#HUJKUvl}k0xG>ih+4C8}o<{ z=IkbN;8eMFHi|fB;fM{#PISZTED4zt%o&^)urpXVNI*|`!3}fR5aza^XEFvbaX3nD zorptcm%&jBhn@rQm>Ujf6CNZEiWfHWd>*rEGUgyq<%mj+CULprTVBAhO*OGw5bfbC zVG*3v$RiO|XI?P$XD;HPntgBL$r*4s5hS(%=q!d6Af9ywTFe{aPfp8{nxM{H4?z!R z34Dx6`XgoQxQ^{GVlnr93m||vVYJp1JL-d|Pm!RBBvFiCZpYyyyAm(9Mzbh@DLIXC zLm(N=_zpxbe!=de(D%bzT-q=UK#jwS;yuf{fF@@Ue&DngvEMfluI;ZC+oi=>y zoE@E99(T@uW`{8DtP4!t0oDef7hQ%EN>H74AAy~=dq=O~wRPAz>0JC;w_bHF&JgCS zZjZItd8>EPIl4S)_1O7k@4VY@!}P}h_N;UEst2>QPuph~Hp~j&So;@vVg1*wlM|fE zYFz^MJ;aY4bjXe#-zS}FS-<`ETRgVrP6YbHbr;VM{b=-M3=C>n zms1yPfIS-jF1EZ0su=c>VPAF!mIf%v#UAXw1&RvLka)2J_ICSw+qS>ozS2z}JaQLf zXhci@lswfA%~Sm-7I#;ZP5{2y!k2~al~EYN6uJQ&YWzHKBKmx1-RW5ZetW2JK-8)N zqq?5Hwl9`0sr-a1#(j#aQzsd#WoneqaPXLwvJW7g7!gKK;D>5+wpjBs> z%pCtvqVpE;P9zsgKCkfL16W{{37^0ZXoM9;bJ%6FimT09t!7;*^x<%xN8tyL%x66G zAOyf8(4VAOaL^2m**u(~WjY2U6Ale_cQLep9ia(ac7IeS2Lc@lf_C1~qyglSivU~| z;DdiL0ShOJocSTeG~~AFFrN6f@8YBQN0YKJ=UeoDq14RciK7 z7)8O4LEGu#5SW zQ$)U6=>$M}&t*=M@X0h05g1`3%s`$8VX#G04}7!_F-S1v6@m)OO%-{7k!G?qmMK3B z81LstT|V2nZ_qYgMu^^#2>`oB$!jM*35RtSM$pV%p_vhvI=kUXUqrM|dE$V`cR({n z4&H}|)^^}_N3zQzEHF%OOd9dn`(G}{9L^Kohu3=c^DlfTz7BzB6W#{O&Sew!MAJjQ z#*1bxi^>~V0E8&=T#g9Doj|C)dtk{+1OrM+pI2eDZ2L+t7WNH>kH_99fo(t_hx23Z zCr&k>J#g`NVSAbTMXkU{+uQ6vUV)X-xe3CE?`8S`hs3~zG3jv2k|w$z4s8_uV9|#D zY!a{^4#Xs%3XBJC0hDE)W>T-hi>U%P)Y;4nk{^``avkxJSRctqc-ukgmz4ncxz2WK z;zEP5(08R_P6OUHu2f5EvWu1`+Jpi&q1N^}22xSNHum#Gm0-zK#}Sfq&V*M}*zSyJ zkNu_Dj}stg5$-5a_4&?>*#7=|MEZNC+)5NKWNbSzLpF)2c^mOJNCp5)*|(Y@>*{-{ zsaar+PluB7M7@+K+4T$FV47hDp*v?N4^V^$oV(mjDS=WwvoE0DDs-TfhXP2y@+hFo z!CQ%7UII;RN_+`M{3w~`6*TXq^W!VA+_ReQA~rZkS?igNFZ-EhgaE|37<;fQ3GNh~ z5?qfB%FwOqDXM`9nkg+5&~hY`q_DyH`sN^GTEH3&s(lxi(oBy>niX(6(8h#;2f)1; zb5M8~ZASvau4=->4EEL$zj*=JH52h-j4zQhF7_B}8scOm;t%z{*DVYQV zm~2f0Azez=;5b-Fp><6VV+Laf4jx4L0kbdR7Gy*zvjve2F5k--IMkXl;hyok(WcCj zz3eM(OwpJEA;U|JDU!I_n93VGTTLQx?12};Zn-q2T?|)o(aS0~Ggmc-MCV0Hny9O_ zv;k0g7a5@HqgbUHEX0I7{wM(OQdbBkB?Cwl4#NPi*o7>Vi>s?Kx12O2dTW9Nr0H(Q zp|2&0?7D5`H4B8&LW-2*d7ZB=tCw^48jHy(v-O|DX}30zFT1wTrd8Q!~( z`?CCZooB#%S&*0z{)5b8oCyq924OPxf*UPu&1Q<5Jhtsxs>MDL!~(0e)L1q6gmz{v z!Bx;pTh%gmYO8#8wJ$4tS{P1WQ}X=7Ua$v5@ucLVSp7%Sj8;dkjKGy38qlS zNnA(NM9hJ3!?*(q5GBzti834&=SAVBZS#zPi)eR?VT=+2W^gQ(Ir^GgMn~J?ITqI(Ws~32<4G z>-6dh@lrg~S)tvXVqklLy%J7iu`2k*21aN*!?6*n2&WmF zErCO{pEu!9Y)R83zV+yOA)MOpy}(T!>Y)>J5R`NZD|_0!Le_Uz}5C&U96S+c^3_(iVz=;qE zn?q34;){YpNjMn&$ih*xIx;dCjz%$0NbZp?l)_Cxk=1GxU|4) zd*{4wu< zY8-5lc$rCr89VVfjX06sk<#_Q`rR`di_C%>Z!}ktKr=cyjrcSQu?D&74ANL6(B#m= zTcIK?@#2+TqS%(nWP_S1(8Wl5phUWvumejwRMEUHh5`tq*qAo*ZZQ9i8bz#vojTL1 z4pUvLq_i`<0rZc+TmdzQz-2m~>gRf{%1a}cOD7%X0jbtBPXHAerSFkKGcplXKAgA) zju)gPCVWa+iAyl8QZLF^l${D`i}$QEXKJbx3j`}}M3kb=P}Bw^x_T|NeXaqFO2Y%q zr90C1GLkBivm!k)Ba$HLghuL@5|+vA$b~DVq)9~|$z3{eGBvL9eX81Skr&`O446!; z%&o=*DKjoJOUeONK`P-rAZHs^rc-Bwk}JDbX)wX56#_$tr5y)GN2i0~S}kK#^g4d4 zrn*Y|4({oDc(tFJ)iPX<@X50YW|IMkarW(LzKxwf9sXx_sIiXp3K>l3@FwS2#{o)aZFxP5CT`%J2 ztf^j<>Z%`-_K-Yk;*&JfhQ1NU)R|calny|?Q)-+_h0?g$T?Upjg0ofv3fV)Cv#*6y zxu-azF1M~O$X+Yn)2tHyR*eh1Il}@d1lKVPJE*Hvl+QXeMyZcJ z0UGXt$rleGMDVH;hlohiV2(-XJQ8UVC^Mi-nI)4>y5jM|iNLr~g^)>T5Y;L>x@ro0 z0wz&OR%9-}K{6J`!*!ysU?{;PsW1MBoByR-sYFUptLwCG}s;=Enbj zil;J*F+l5$h^Xxs3d=Udew$*yr!MweuhgsBsMBe+%{0Q= zrs(T|ioO<*cX|024JyhbyAa)|ty&jG5Tzcl(`>ui167F`2uoA8G-s{0DI8m&a7?p| z@~Qh>UT|lr81oM z1eiCT?+%^Ft*(~>n64asITI^YgP6?{Trg=kc&GBx;8(QH;D?>EhLK?g4MsYdj3xq; zVN~UAUxP?%z|zdY_Z-vonK7AU&S?}TAx2p2u@iT11I4EFr)dye9mm#GIwSslT9~es zvk`aM0KTXJ>sbC#TR`UT_w`7pWP5s5I4h38Dl7UOjA_KE{D29f5Rf``HtAe?+@2J!8>jU#G!PV?O!rG0RJJd>9ztF4mgXHpQl!V$)5rsfy;VTWq>U zC~ZL%>KYJ=<*8)@rQlhiV0E3*n-bQQOISa4l+uf2?wR!s(* ztt(nHqYkSJP-K%A67ICwE&6$09`7@ + +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. diff --git a/node_modules/@webassemblyjs/wasm-gen/esm/encoder/index.js b/node_modules/@webassemblyjs/wasm-gen/esm/encoder/index.js new file mode 100644 index 0000000..ec31249 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-gen/esm/encoder/index.js @@ -0,0 +1,301 @@ +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +import * as leb from "@webassemblyjs/leb128"; +import * as ieee754 from "@webassemblyjs/ieee754"; +import * as utf8 from "@webassemblyjs/utf8"; +import constants from "@webassemblyjs/helper-wasm-bytecode"; +import { encodeNode } from "../index"; + +function assertNotIdentifierNode(n) { + if (n.type === "Identifier") { + throw new Error("Unsupported node Identifier"); + } +} + +export function encodeVersion(v) { + var bytes = constants.moduleVersion; + bytes[0] = v; + return bytes; +} +export function encodeHeader() { + return constants.magicModuleHeader; +} +export function encodeU32(v) { + var uint8view = new Uint8Array(leb.encodeU32(v)); + + var array = _toConsumableArray(uint8view); + + return array; +} +export function encodeI32(v) { + var uint8view = new Uint8Array(leb.encodeI32(v)); + + var array = _toConsumableArray(uint8view); + + return array; +} +export function encodeI64(v) { + var uint8view = new Uint8Array(leb.encodeI64(v)); + + var array = _toConsumableArray(uint8view); + + return array; +} +export function encodeVec(elements) { + var size = encodeU32(elements.length); + return _toConsumableArray(size).concat(_toConsumableArray(elements)); +} +export function encodeValtype(v) { + var byte = constants.valtypesByString[v]; + + if (typeof byte === "undefined") { + throw new Error("Unknown valtype: " + v); + } + + return parseInt(byte, 10); +} +export function encodeMutability(v) { + var byte = constants.globalTypesByString[v]; + + if (typeof byte === "undefined") { + throw new Error("Unknown mutability: " + v); + } + + return parseInt(byte, 10); +} +export function encodeUTF8Vec(str) { + return encodeVec(utf8.encode(str)); +} +export function encodeLimits(n) { + var out = []; + + if (typeof n.max === "number") { + out.push(0x01); + out.push.apply(out, _toConsumableArray(encodeU32(n.min))); // $FlowIgnore: ensured by the typeof + + out.push.apply(out, _toConsumableArray(encodeU32(n.max))); + } else { + out.push(0x00); + out.push.apply(out, _toConsumableArray(encodeU32(n.min))); + } + + return out; +} +export function encodeModuleImport(n) { + var out = []; + out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.module))); + out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.name))); + + switch (n.descr.type) { + case "GlobalType": + { + out.push(0x03); // $FlowIgnore: GlobalType ensure that these props exists + + out.push(encodeValtype(n.descr.valtype)); // $FlowIgnore: GlobalType ensure that these props exists + + out.push(encodeMutability(n.descr.mutability)); + break; + } + + case "Memory": + { + out.push(0x02); // $FlowIgnore + + out.push.apply(out, _toConsumableArray(encodeLimits(n.descr.limits))); + break; + } + + case "Table": + { + out.push(0x01); + out.push(0x70); // element type + // $FlowIgnore + + out.push.apply(out, _toConsumableArray(encodeLimits(n.descr.limits))); + break; + } + + case "FuncImportDescr": + { + out.push(0x00); // $FlowIgnore + + assertNotIdentifierNode(n.descr.id); // $FlowIgnore + + out.push.apply(out, _toConsumableArray(encodeU32(n.descr.id.value))); + break; + } + + default: + throw new Error("Unsupport operation: encode module import of type: " + n.descr.type); + } + + return out; +} +export function encodeSectionMetadata(n) { + var out = []; + var sectionId = constants.sections[n.section]; + + if (typeof sectionId === "undefined") { + throw new Error("Unknown section: " + n.section); + } + + if (n.section === "start") { + /** + * This is not implemented yet because it's a special case which + * doesn't have a vector in its section. + */ + throw new Error("Unsupported section encoding of type start"); + } + + out.push(sectionId); + out.push.apply(out, _toConsumableArray(encodeU32(n.size.value))); + out.push.apply(out, _toConsumableArray(encodeU32(n.vectorOfSize.value))); + return out; +} +export function encodeCallInstruction(n) { + var out = []; + assertNotIdentifierNode(n.index); + out.push(0x10); // $FlowIgnore + + out.push.apply(out, _toConsumableArray(encodeU32(n.index.value))); + return out; +} +export function encodeCallIndirectInstruction(n) { + var out = []; // $FlowIgnore + + assertNotIdentifierNode(n.index); + out.push(0x11); // $FlowIgnore + + out.push.apply(out, _toConsumableArray(encodeU32(n.index.value))); // add a reserved byte + + out.push(0x00); + return out; +} +export function encodeModuleExport(n) { + var out = []; + assertNotIdentifierNode(n.descr.id); + var exportTypeByteString = constants.exportTypesByName[n.descr.exportType]; + + if (typeof exportTypeByteString === "undefined") { + throw new Error("Unknown export of type: " + n.descr.exportType); + } + + var exportTypeByte = parseInt(exportTypeByteString, 10); + out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.name))); + out.push(exportTypeByte); // $FlowIgnore + + out.push.apply(out, _toConsumableArray(encodeU32(n.descr.id.value))); + return out; +} +export function encodeTypeInstruction(n) { + var out = [0x60]; + var params = n.functype.params.map(function (x) { + return x.valtype; + }).map(encodeValtype); + var results = n.functype.results.map(encodeValtype); + out.push.apply(out, _toConsumableArray(encodeVec(params))); + out.push.apply(out, _toConsumableArray(encodeVec(results))); + return out; +} +export function encodeInstr(n) { + var out = []; + var instructionName = n.id; + + if (typeof n.object === "string") { + instructionName = "".concat(n.object, ".").concat(String(n.id)); + } + + var byteString = constants.symbolsByName[instructionName]; + + if (typeof byteString === "undefined") { + throw new Error("encodeInstr: unknown instruction " + JSON.stringify(instructionName)); + } + + var byte = parseInt(byteString, 10); + out.push(byte); + + if (n.args) { + n.args.forEach(function (arg) { + var encoder = encodeU32; // find correct encoder + + if (n.object === "i32") { + encoder = encodeI32; + } + + if (n.object === "i64") { + encoder = encodeI64; + } + + if (n.object === "f32") { + encoder = ieee754.encodeF32; + } + + if (n.object === "f64") { + encoder = ieee754.encodeF64; + } + + if (arg.type === "NumberLiteral" || arg.type === "FloatLiteral" || arg.type === "LongNumberLiteral") { + // $FlowIgnore + out.push.apply(out, _toConsumableArray(encoder(arg.value))); + } else { + throw new Error("Unsupported instruction argument encoding " + JSON.stringify(arg.type)); + } + }); + } + + return out; +} + +function encodeExpr(instrs) { + var out = []; + instrs.forEach(function (instr) { + // $FlowIgnore + var n = encodeNode(instr); + out.push.apply(out, _toConsumableArray(n)); + }); + return out; +} + +export function encodeStringLiteral(n) { + return encodeUTF8Vec(n.value); +} +export function encodeGlobal(n) { + var out = []; + var _n$globalType = n.globalType, + valtype = _n$globalType.valtype, + mutability = _n$globalType.mutability; + out.push(encodeValtype(valtype)); + out.push(encodeMutability(mutability)); + out.push.apply(out, _toConsumableArray(encodeExpr(n.init))); + return out; +} +export function encodeFuncBody(n) { + var out = []; + out.push(-1); // temporary function body size + // FIXME(sven): get the func locals? + + var localBytes = encodeVec([]); + out.push.apply(out, _toConsumableArray(localBytes)); + var funcBodyBytes = encodeExpr(n.body); + out[0] = funcBodyBytes.length + localBytes.length; + out.push.apply(out, _toConsumableArray(funcBodyBytes)); + return out; +} +export function encodeIndexInFuncSection(n) { + assertNotIdentifierNode(n.index); // $FlowIgnore + + return encodeU32(n.index.value); +} +export function encodeElem(n) { + var out = []; + assertNotIdentifierNode(n.table); // $FlowIgnore + + out.push.apply(out, _toConsumableArray(encodeU32(n.table.value))); + out.push.apply(out, _toConsumableArray(encodeExpr(n.offset))); // $FlowIgnore + + var funcs = n.funcs.reduce(function (acc, x) { + return _toConsumableArray(acc).concat(_toConsumableArray(encodeU32(x.value))); + }, []); + out.push.apply(out, _toConsumableArray(encodeVec(funcs))); + return out; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-gen/esm/index.js b/node_modules/@webassemblyjs/wasm-gen/esm/index.js new file mode 100644 index 0000000..83bc19f --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-gen/esm/index.js @@ -0,0 +1,51 @@ +import * as encoder from "./encoder"; +export function encodeNode(n) { + switch (n.type) { + case "ModuleImport": + // $FlowIgnore: ModuleImport ensure that the node is well formated + return encoder.encodeModuleImport(n); + + case "SectionMetadata": + // $FlowIgnore: SectionMetadata ensure that the node is well formated + return encoder.encodeSectionMetadata(n); + + case "CallInstruction": + // $FlowIgnore: SectionMetadata ensure that the node is well formated + return encoder.encodeCallInstruction(n); + + case "CallIndirectInstruction": + // $FlowIgnore: SectionMetadata ensure that the node is well formated + return encoder.encodeCallIndirectInstruction(n); + + case "TypeInstruction": + return encoder.encodeTypeInstruction(n); + + case "Instr": + // $FlowIgnore + return encoder.encodeInstr(n); + + case "ModuleExport": + // $FlowIgnore: SectionMetadata ensure that the node is well formated + return encoder.encodeModuleExport(n); + + case "Global": + // $FlowIgnore + return encoder.encodeGlobal(n); + + case "Func": + return encoder.encodeFuncBody(n); + + case "IndexInFuncSection": + return encoder.encodeIndexInFuncSection(n); + + case "StringLiteral": + return encoder.encodeStringLiteral(n); + + case "Elem": + return encoder.encodeElem(n); + + default: + throw new Error("Unsupported encoding for node of type: " + JSON.stringify(n.type)); + } +} +export var encodeU32 = encoder.encodeU32; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-gen/lib/encoder/index.js b/node_modules/@webassemblyjs/wasm-gen/lib/encoder/index.js new file mode 100644 index 0000000..a77bff7 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-gen/lib/encoder/index.js @@ -0,0 +1,357 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.encodeVersion = encodeVersion; +exports.encodeHeader = encodeHeader; +exports.encodeU32 = encodeU32; +exports.encodeI32 = encodeI32; +exports.encodeI64 = encodeI64; +exports.encodeVec = encodeVec; +exports.encodeValtype = encodeValtype; +exports.encodeMutability = encodeMutability; +exports.encodeUTF8Vec = encodeUTF8Vec; +exports.encodeLimits = encodeLimits; +exports.encodeModuleImport = encodeModuleImport; +exports.encodeSectionMetadata = encodeSectionMetadata; +exports.encodeCallInstruction = encodeCallInstruction; +exports.encodeCallIndirectInstruction = encodeCallIndirectInstruction; +exports.encodeModuleExport = encodeModuleExport; +exports.encodeTypeInstruction = encodeTypeInstruction; +exports.encodeInstr = encodeInstr; +exports.encodeStringLiteral = encodeStringLiteral; +exports.encodeGlobal = encodeGlobal; +exports.encodeFuncBody = encodeFuncBody; +exports.encodeIndexInFuncSection = encodeIndexInFuncSection; +exports.encodeElem = encodeElem; + +var leb = _interopRequireWildcard(require("@webassemblyjs/leb128")); + +var ieee754 = _interopRequireWildcard(require("@webassemblyjs/ieee754")); + +var utf8 = _interopRequireWildcard(require("@webassemblyjs/utf8")); + +var _helperWasmBytecode = _interopRequireDefault(require("@webassemblyjs/helper-wasm-bytecode")); + +var _index = require("../index"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function assertNotIdentifierNode(n) { + if (n.type === "Identifier") { + throw new Error("Unsupported node Identifier"); + } +} + +function encodeVersion(v) { + var bytes = _helperWasmBytecode.default.moduleVersion; + bytes[0] = v; + return bytes; +} + +function encodeHeader() { + return _helperWasmBytecode.default.magicModuleHeader; +} + +function encodeU32(v) { + var uint8view = new Uint8Array(leb.encodeU32(v)); + + var array = _toConsumableArray(uint8view); + + return array; +} + +function encodeI32(v) { + var uint8view = new Uint8Array(leb.encodeI32(v)); + + var array = _toConsumableArray(uint8view); + + return array; +} + +function encodeI64(v) { + var uint8view = new Uint8Array(leb.encodeI64(v)); + + var array = _toConsumableArray(uint8view); + + return array; +} + +function encodeVec(elements) { + var size = encodeU32(elements.length); + return _toConsumableArray(size).concat(_toConsumableArray(elements)); +} + +function encodeValtype(v) { + var byte = _helperWasmBytecode.default.valtypesByString[v]; + + if (typeof byte === "undefined") { + throw new Error("Unknown valtype: " + v); + } + + return parseInt(byte, 10); +} + +function encodeMutability(v) { + var byte = _helperWasmBytecode.default.globalTypesByString[v]; + + if (typeof byte === "undefined") { + throw new Error("Unknown mutability: " + v); + } + + return parseInt(byte, 10); +} + +function encodeUTF8Vec(str) { + return encodeVec(utf8.encode(str)); +} + +function encodeLimits(n) { + var out = []; + + if (typeof n.max === "number") { + out.push(0x01); + out.push.apply(out, _toConsumableArray(encodeU32(n.min))); // $FlowIgnore: ensured by the typeof + + out.push.apply(out, _toConsumableArray(encodeU32(n.max))); + } else { + out.push(0x00); + out.push.apply(out, _toConsumableArray(encodeU32(n.min))); + } + + return out; +} + +function encodeModuleImport(n) { + var out = []; + out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.module))); + out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.name))); + + switch (n.descr.type) { + case "GlobalType": + { + out.push(0x03); // $FlowIgnore: GlobalType ensure that these props exists + + out.push(encodeValtype(n.descr.valtype)); // $FlowIgnore: GlobalType ensure that these props exists + + out.push(encodeMutability(n.descr.mutability)); + break; + } + + case "Memory": + { + out.push(0x02); // $FlowIgnore + + out.push.apply(out, _toConsumableArray(encodeLimits(n.descr.limits))); + break; + } + + case "Table": + { + out.push(0x01); + out.push(0x70); // element type + // $FlowIgnore + + out.push.apply(out, _toConsumableArray(encodeLimits(n.descr.limits))); + break; + } + + case "FuncImportDescr": + { + out.push(0x00); // $FlowIgnore + + assertNotIdentifierNode(n.descr.id); // $FlowIgnore + + out.push.apply(out, _toConsumableArray(encodeU32(n.descr.id.value))); + break; + } + + default: + throw new Error("Unsupport operation: encode module import of type: " + n.descr.type); + } + + return out; +} + +function encodeSectionMetadata(n) { + var out = []; + var sectionId = _helperWasmBytecode.default.sections[n.section]; + + if (typeof sectionId === "undefined") { + throw new Error("Unknown section: " + n.section); + } + + if (n.section === "start") { + /** + * This is not implemented yet because it's a special case which + * doesn't have a vector in its section. + */ + throw new Error("Unsupported section encoding of type start"); + } + + out.push(sectionId); + out.push.apply(out, _toConsumableArray(encodeU32(n.size.value))); + out.push.apply(out, _toConsumableArray(encodeU32(n.vectorOfSize.value))); + return out; +} + +function encodeCallInstruction(n) { + var out = []; + assertNotIdentifierNode(n.index); + out.push(0x10); // $FlowIgnore + + out.push.apply(out, _toConsumableArray(encodeU32(n.index.value))); + return out; +} + +function encodeCallIndirectInstruction(n) { + var out = []; // $FlowIgnore + + assertNotIdentifierNode(n.index); + out.push(0x11); // $FlowIgnore + + out.push.apply(out, _toConsumableArray(encodeU32(n.index.value))); // add a reserved byte + + out.push(0x00); + return out; +} + +function encodeModuleExport(n) { + var out = []; + assertNotIdentifierNode(n.descr.id); + var exportTypeByteString = _helperWasmBytecode.default.exportTypesByName[n.descr.exportType]; + + if (typeof exportTypeByteString === "undefined") { + throw new Error("Unknown export of type: " + n.descr.exportType); + } + + var exportTypeByte = parseInt(exportTypeByteString, 10); + out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.name))); + out.push(exportTypeByte); // $FlowIgnore + + out.push.apply(out, _toConsumableArray(encodeU32(n.descr.id.value))); + return out; +} + +function encodeTypeInstruction(n) { + var out = [0x60]; + var params = n.functype.params.map(function (x) { + return x.valtype; + }).map(encodeValtype); + var results = n.functype.results.map(encodeValtype); + out.push.apply(out, _toConsumableArray(encodeVec(params))); + out.push.apply(out, _toConsumableArray(encodeVec(results))); + return out; +} + +function encodeInstr(n) { + var out = []; + var instructionName = n.id; + + if (typeof n.object === "string") { + instructionName = "".concat(n.object, ".").concat(String(n.id)); + } + + var byteString = _helperWasmBytecode.default.symbolsByName[instructionName]; + + if (typeof byteString === "undefined") { + throw new Error("encodeInstr: unknown instruction " + JSON.stringify(instructionName)); + } + + var byte = parseInt(byteString, 10); + out.push(byte); + + if (n.args) { + n.args.forEach(function (arg) { + var encoder = encodeU32; // find correct encoder + + if (n.object === "i32") { + encoder = encodeI32; + } + + if (n.object === "i64") { + encoder = encodeI64; + } + + if (n.object === "f32") { + encoder = ieee754.encodeF32; + } + + if (n.object === "f64") { + encoder = ieee754.encodeF64; + } + + if (arg.type === "NumberLiteral" || arg.type === "FloatLiteral" || arg.type === "LongNumberLiteral") { + // $FlowIgnore + out.push.apply(out, _toConsumableArray(encoder(arg.value))); + } else { + throw new Error("Unsupported instruction argument encoding " + JSON.stringify(arg.type)); + } + }); + } + + return out; +} + +function encodeExpr(instrs) { + var out = []; + instrs.forEach(function (instr) { + // $FlowIgnore + var n = (0, _index.encodeNode)(instr); + out.push.apply(out, _toConsumableArray(n)); + }); + return out; +} + +function encodeStringLiteral(n) { + return encodeUTF8Vec(n.value); +} + +function encodeGlobal(n) { + var out = []; + var _n$globalType = n.globalType, + valtype = _n$globalType.valtype, + mutability = _n$globalType.mutability; + out.push(encodeValtype(valtype)); + out.push(encodeMutability(mutability)); + out.push.apply(out, _toConsumableArray(encodeExpr(n.init))); + return out; +} + +function encodeFuncBody(n) { + var out = []; + out.push(-1); // temporary function body size + // FIXME(sven): get the func locals? + + var localBytes = encodeVec([]); + out.push.apply(out, _toConsumableArray(localBytes)); + var funcBodyBytes = encodeExpr(n.body); + out[0] = funcBodyBytes.length + localBytes.length; + out.push.apply(out, _toConsumableArray(funcBodyBytes)); + return out; +} + +function encodeIndexInFuncSection(n) { + assertNotIdentifierNode(n.index); // $FlowIgnore + + return encodeU32(n.index.value); +} + +function encodeElem(n) { + var out = []; + assertNotIdentifierNode(n.table); // $FlowIgnore + + out.push.apply(out, _toConsumableArray(encodeU32(n.table.value))); + out.push.apply(out, _toConsumableArray(encodeExpr(n.offset))); // $FlowIgnore + + var funcs = n.funcs.reduce(function (acc, x) { + return _toConsumableArray(acc).concat(_toConsumableArray(encodeU32(x.value))); + }, []); + out.push.apply(out, _toConsumableArray(encodeVec(funcs))); + return out; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-gen/lib/index.js b/node_modules/@webassemblyjs/wasm-gen/lib/index.js new file mode 100644 index 0000000..f5095b1 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-gen/lib/index.js @@ -0,0 +1,64 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.encodeNode = encodeNode; +exports.encodeU32 = void 0; + +var encoder = _interopRequireWildcard(require("./encoder")); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + +function encodeNode(n) { + switch (n.type) { + case "ModuleImport": + // $FlowIgnore: ModuleImport ensure that the node is well formated + return encoder.encodeModuleImport(n); + + case "SectionMetadata": + // $FlowIgnore: SectionMetadata ensure that the node is well formated + return encoder.encodeSectionMetadata(n); + + case "CallInstruction": + // $FlowIgnore: SectionMetadata ensure that the node is well formated + return encoder.encodeCallInstruction(n); + + case "CallIndirectInstruction": + // $FlowIgnore: SectionMetadata ensure that the node is well formated + return encoder.encodeCallIndirectInstruction(n); + + case "TypeInstruction": + return encoder.encodeTypeInstruction(n); + + case "Instr": + // $FlowIgnore + return encoder.encodeInstr(n); + + case "ModuleExport": + // $FlowIgnore: SectionMetadata ensure that the node is well formated + return encoder.encodeModuleExport(n); + + case "Global": + // $FlowIgnore + return encoder.encodeGlobal(n); + + case "Func": + return encoder.encodeFuncBody(n); + + case "IndexInFuncSection": + return encoder.encodeIndexInFuncSection(n); + + case "StringLiteral": + return encoder.encodeStringLiteral(n); + + case "Elem": + return encoder.encodeElem(n); + + default: + throw new Error("Unsupported encoding for node of type: " + JSON.stringify(n.type)); + } +} + +var encodeU32 = encoder.encodeU32; +exports.encodeU32 = encodeU32; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-gen/package.json b/node_modules/@webassemblyjs/wasm-gen/package.json new file mode 100644 index 0000000..73e9c87 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-gen/package.json @@ -0,0 +1,61 @@ +{ + "_from": "@webassemblyjs/wasm-gen@1.8.5", + "_id": "@webassemblyjs/wasm-gen@1.8.5", + "_inBundle": false, + "_integrity": "sha512-BCZBT0LURC0CXDzj5FXSc2FPTsxwp3nWcqXQdOZE4U7h7i8FqtFK5Egia6f9raQLpEKT1VL7zr4r3+QX6zArWg==", + "_location": "/@webassemblyjs/wasm-gen", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/wasm-gen@1.8.5", + "name": "@webassemblyjs/wasm-gen", + "escapedName": "@webassemblyjs%2fwasm-gen", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/helper-wasm-section", + "/@webassemblyjs/wasm-edit", + "/@webassemblyjs/wasm-opt" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.8.5.tgz", + "_shasum": "54840766c2c1002eb64ed1abe720aded714f98bc", + "_spec": "@webassemblyjs/wasm-gen@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/wasm-edit", + "author": { + "name": "Sven Sauleau" + }, + "bugs": { + "url": "https://github.com/xtuc/webassemblyjs/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/ieee754": "1.8.5", + "@webassemblyjs/leb128": "1.8.5", + "@webassemblyjs/utf8": "1.8.5" + }, + "deprecated": false, + "description": "WebAssembly binary format printer", + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "homepage": "https://github.com/xtuc/webassemblyjs#readme", + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/wasm-gen", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/xtuc/webassemblyjs.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/wasm-gen/webassemblyjs-wasm-gen-1.7.10.tgz b/node_modules/@webassemblyjs/wasm-gen/webassemblyjs-wasm-gen-1.7.10.tgz new file mode 100644 index 0000000000000000000000000000000000000000..737bc8f23fb7a58018fcb90e11aa64f77d2c5885 GIT binary patch literal 4187 zcmV-h5Tx%PiwFP!000001MM7XbK*vJKl3YksZ;_Jf&pK%c4iZ7l4%1KQ% zQUjV1605^DJMn+t_qtnGOJL*ik;zI)%BcJGJNkH+`ejb_PjtdI=HhStqvzOvd*r9l zXzc84k-TIDKN*;6~ z+tA=M&*z}})FHo>JFe@vd&G7Kb`WpQbaQMnA zOoQq=^H2x@pvMDf;7=VFdj?m`CIbpHK?5N>05aR-%$;e&aPH>}Cdk%JmY5V}6{(n_ z#F}Mcrp%f%_XobG_x*y#>B zPeNn0{%p)+5&=49%Vie4qHM)NgEDkAcu2X8-n z;tf^cKTD-^=FUtHEdwzBpzDnq8M}-TXH4`dbtkMwe1}kbK|tAnpFy0F z4|c$`Cxj9mXqN!ep8^`s8T;4NWdLjt&=HPqQou(HM-OJq_9>bhGBz#dk%~WMpfKf# za+MP?7_~~KO|UQQBG;h0oxmq97zfwX5l4-fwr&Lm@(^}g=FF57a5$e3uLMW~4s^A7eN$Wt`$iru*1};A6+KoNE+KcWlE%iM+j1X$W0( zi&$^l@qtyr0xrNjURBxUO{ry(5t9=JbYXgFLL3*#!(p<0lUii%xSXCUW*z9CbjYB0 zJbd5ocZfD1=l$M0?Wl7^%IyKXmuuv`HazKF3<*H=+uh->q<2i(-CxPSweC@kbbdMS zcLoE}>zA~%^HZ$@ZCdy6^x{bCz9k1RuG@o6t-;m?q{ALTf)bV186dK=PXF)(UfT!S zsW$wzRyx*(UBr3Z>ytJ)Z}*4V;l*jYPtGs;=eSf9-2;Pln{AcY4%;#)A%U);>7x2vQ)_;b~httC6Gj zS^I5=kLm%IehI+@cjWy^2b+*y8~!~UYP~LsaoFn)`|w%=Df`1{=zDF@sgZVH8{mW- z_j_lx5>6+K=y4=4uGgaMF0ffF9w|mAvx-_PXX5e2cw7~aJ?|IU-=W-e{{CN zkp#cbjhybsqOsEcx4_nKtM-4hxw%`||L1tdfz1se`QSScsCdDQjx5%8UAm}H*R7Jz z#2k|fZ>XDI+<`q1*^$Z>b%{ydkOo*V*KNTsn_ZI#ux>GX;!msl0Q4h?8{qx>?-2aqtU%?2}ut&_0+q-i5Es@)$tMR>8~Ib!MCq1h_4g%o&;-@(SDq0ucwn{$-)a zehON~G5I6HASXQpW0ib(9>qk!V0XDi^zwmo!>(xXXCe+{7ybho1%`TE98Ul%MQevB zUBB!28U%wrhP*Bgs@PQ?6XF8ebqsCEn>TMrIfg1%WzgtPUFVuF9FL(Zkfh>(L^HgF?c;k#UI z-n?lU!RiXesD;N)Jqf9Ua3x^8gT(+s2YYgP^*a|GPc3$U z11-kj(GB42k4>8yt4{7G+qt%h#Jfkzg!+XM^?Be;D~+2*lZzI&)#-e0Eh_L@%iE^$_6GE(T?JOj#s>N3 z7(zd7VmmJE0Ej^Y7Zf=}<`|0!c1jPXLT``?&cC$G85tU1EQ7MTFmlEA{jP^GiRaW z!E()Ey{V6j4yfm@GxsnH?)hFRi!!aTLI$N4$=g+5PAs8ULVEE*ugX1y&&Xx;Q}}vY zN=(-ooACtx%BgB)xX-e5uSE^dx@4ATioELmI2|IgI~Z*yFeTb|8$tkSa`*v`;9gv? zV>pfC@EzgcJ49@(Sc|28tYphH9%~_mt_iW?E)Uq9;)1oJf#rwtE%%v;18zOfAnr*O zMT8njjQP}{K3%5!xHBX`H6vxQWvh2-hd(n$D=~0Qn=MC% zLdw@zLJ^k8W`P}JaX-Sm@#>YB>Q`ilNlEzEc6^*eaSp(uEtpS6Os4^CMAQGyBUF6# zqn6m5*HcrUhDZ#DdG>ccnbIo;fLA~n0$9_AkzUAcT>@|19TtV0^R>V%t6WtgrHBNL zwtqC24=^Wu!=g``+N=-2A;j*D2P&@n?6^Z}SsLsfH{h+ycHHuV%!Ahy>!1{x`AXpd z!im(?!=y4y7pCSe>2mm7SK8(iNsCCSVZhdQ!34Wk+~f08$Yba1{*G1WW|d=gADu0S z2_on)8~|G)KuD>h7ytr@F1SsXA(pr&qoDG!uBoe}{JDBLCJ-O#tT-S@6oTZjBtw!f z_ac*CREo}H?W$a>c%SWpjI2IBjhmfDWRhUI=nRuWcAX=F(RI-VA;!ECA+Owo%O{z* z3B6Lj990gT@?N7I2j>6`wn9TTE*ZAggyGT%mLH;zakOM+jalY1yvo#@@e<$};=-Fo zHW+op$3kg%agRplB#WY44pSlFz#1vn%Ta49yZ;lrgg^e6ZlE-|s{BZNW>VE9zPmFFfOL>u*cA0fKz86p9r93Ivmhc7>p2&-Lc~a)o^uc+z%H)qfNV*?1EA^Lm zpE~v=jUvgKqM9ERwYZ#NHCRbyVea%=lP3VM@#_?^3!8H$LLn0b`QO`Ru}Vo%Sl~an z;$(UGN=x+RoCn?!MFZIhL_~J90lC{DhOCu+vgI*X{j|nNM%}iNBjl2Zj8B_f|4>P% zvWu}r7wfoO(Tn`bDoy{v{wB`3ay=iv)*>}xi7lFj4ozqX7Ux|uka1Vq`ABEDqdZX- zCXwb*(>rTzf4-5>>oxr~>?Nir4jf}~S7xyCgY?UNhCw>Nxf)^`!Fc{Xp~Uy$vG&VZ zr-GNEs(WO@d~w?bfQjYk)bf4`Ee3x*kl(&yqksAPI>N_Ds*z(emO`a*%LzhmLjvN1 zS_)i#{(zGnV-7#c-k+-!%5}UK2w5~67e!_-!gaYbipueB(W3k!#5si=H zKbD)#kv%+^muu~e#~$-@vi_ySPKh0054>L^&{@*y(DfQoUF^Ku0J^^Nb66x=I{v<` zk@dEFd`vjQc_;m)FHQV~p5*E)_=5`#r>b>c#^kTLho7LGzss6 zmG_q@(c~SI_`_EAlUDNkT=aE7{hE{nQokpO8z`nnu9;=YdJ<+xL@68K)^k4z?kB%j zC|UER94T;L&QvyCpW;i&tv(-L*`#g`UzzOabMu#%o=x$oq@N=Ga&cyJRViG&Yl(!b z(1yvG6tZL*_4#H^N#3S75~0Ndbq81D$#oyor#l&etwyE> zYbiYFA+8=SeaQVaKMq0+9);U@fs!w5D)FoY;C3SXzKuQFI6nkVR}=!c@zu2b`{@7B z{$nBD%iRCnz-*aaW^x93a@IWfs(r%cem25CAzhoZrFgS zOr^@Go{Z2l-BA)H^{#@QC6g#>Q$`+<2#RGA?<$zMnGr#W*9_sL^AwRzG^ztsYZH!9 z+SOr-rw|QO+Vh8H47f5p)1NP;uxN^uqEQ{782M<7(w^BX*cI;HG~O<)h=}~TCO;01TS#%dAf>?F#E^rw4HgM{U?AWd2d>V zPF!msW&^2m+Z4RkA(SN ziZb`AeoTU!Ou!lqkM8MLlNa@u5Oqc$t8sk;ykWUI{He$4mi)xq_W&&PGYW zQ|k4u?a;E+bvXHmu7+cIO$p+`FVH|P*BBx1vSY&h1g<0bKOz8Te!2@HCW$jDr9!GW z0>A9=-K=#805S_BDD^{}G?!{|WGAu2v zQdzYx|5SA=sz@sx|OU9PgS>)*`7tkN>Q=0YO0Egm7-$h z>#kT)Ro(+@RaV*RqI#vMURiQMUEO_Od)-RDJpa!XEBP+fQ`f4jQb$Gg%2!goqHdj{ zZsl?7Rx$~gueoAnr2|sbuoN{cMGZ?)!}16du-zsxPDcqbKwM@8XLQFv4o9uG008gPF;f5l literal 0 HcmV?d00001 diff --git a/node_modules/@webassemblyjs/wasm-opt/LICENSE b/node_modules/@webassemblyjs/wasm-opt/LICENSE new file mode 100644 index 0000000..87e7e1f --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-opt/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sven Sauleau + +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. diff --git a/node_modules/@webassemblyjs/wasm-opt/esm/index.js b/node_modules/@webassemblyjs/wasm-opt/esm/index.js new file mode 100644 index 0000000..f9d9232 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-opt/esm/index.js @@ -0,0 +1,41 @@ +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +import { decode } from "@webassemblyjs/wasm-parser"; +import { shrinkPaddedLEB128 as makeShrinkPaddedLEB128 } from "./leb128.js"; + +var OptimizerError = +/*#__PURE__*/ +function (_Error) { + _inherits(OptimizerError, _Error); + + function OptimizerError(name, initalError) { + var _this; + + _classCallCheck(this, OptimizerError); + + _this = _possibleConstructorReturn(this, (OptimizerError.__proto__ || Object.getPrototypeOf(OptimizerError)).call(this, "Error while optimizing: " + name + ": " + initalError.message)); + _this.stack = initalError.stack; + return _this; + } + + return OptimizerError; +}(Error); + +var decoderOpts = { + ignoreCodeSection: true, + ignoreDataSection: true +}; +export function shrinkPaddedLEB128(uint8Buffer) { + try { + var ast = decode(uint8Buffer.buffer, decoderOpts); + return makeShrinkPaddedLEB128(ast, uint8Buffer); + } catch (e) { + throw new OptimizerError("shrinkPaddedLEB128", e); + } +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-opt/esm/leb128.js b/node_modules/@webassemblyjs/wasm-opt/esm/leb128.js new file mode 100644 index 0000000..3150c9e --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-opt/esm/leb128.js @@ -0,0 +1,47 @@ +import { traverse, shiftSection } from "@webassemblyjs/ast"; +import { encodeU32 } from "@webassemblyjs/wasm-gen/lib/encoder"; +import { overrideBytesInBuffer } from "@webassemblyjs/helper-buffer"; + +function shiftFollowingSections(ast, _ref, deltaInSizeEncoding) { + var section = _ref.section; + // Once we hit our section every that is after needs to be shifted by the delta + var encounteredSection = false; + traverse(ast, { + SectionMetadata: function SectionMetadata(path) { + if (path.node.section === section) { + encounteredSection = true; + return; + } + + if (encounteredSection === true) { + shiftSection(ast, path.node, deltaInSizeEncoding); + } + } + }); +} + +export function shrinkPaddedLEB128(ast, uint8Buffer) { + traverse(ast, { + SectionMetadata: function SectionMetadata(_ref2) { + var node = _ref2.node; + + /** + * Section size + */ + { + var newu32Encoded = encodeU32(node.size.value); + var newu32EncodedLen = newu32Encoded.length; + var start = node.size.loc.start.column; + var end = node.size.loc.end.column; + var oldu32EncodedLen = end - start; + + if (newu32EncodedLen !== oldu32EncodedLen) { + var deltaInSizeEncoding = oldu32EncodedLen - newu32EncodedLen; + uint8Buffer = overrideBytesInBuffer(uint8Buffer, start, end, newu32Encoded); + shiftFollowingSections(ast, node, -deltaInSizeEncoding); + } + } + } + }); + return uint8Buffer; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-opt/lib/index.js b/node_modules/@webassemblyjs/wasm-opt/lib/index.js new file mode 100644 index 0000000..4355961 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-opt/lib/index.js @@ -0,0 +1,50 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.shrinkPaddedLEB128 = shrinkPaddedLEB128; + +var _wasmParser = require("@webassemblyjs/wasm-parser"); + +var _leb = require("./leb128.js"); + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var OptimizerError = +/*#__PURE__*/ +function (_Error) { + _inherits(OptimizerError, _Error); + + function OptimizerError(name, initalError) { + var _this; + + _classCallCheck(this, OptimizerError); + + _this = _possibleConstructorReturn(this, (OptimizerError.__proto__ || Object.getPrototypeOf(OptimizerError)).call(this, "Error while optimizing: " + name + ": " + initalError.message)); + _this.stack = initalError.stack; + return _this; + } + + return OptimizerError; +}(Error); + +var decoderOpts = { + ignoreCodeSection: true, + ignoreDataSection: true +}; + +function shrinkPaddedLEB128(uint8Buffer) { + try { + var ast = (0, _wasmParser.decode)(uint8Buffer.buffer, decoderOpts); + return (0, _leb.shrinkPaddedLEB128)(ast, uint8Buffer); + } catch (e) { + throw new OptimizerError("shrinkPaddedLEB128", e); + } +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-opt/lib/leb128.js b/node_modules/@webassemblyjs/wasm-opt/lib/leb128.js new file mode 100644 index 0000000..e4a0e85 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-opt/lib/leb128.js @@ -0,0 +1,56 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.shrinkPaddedLEB128 = shrinkPaddedLEB128; + +var _ast = require("@webassemblyjs/ast"); + +var _encoder = require("@webassemblyjs/wasm-gen/lib/encoder"); + +var _helperBuffer = require("@webassemblyjs/helper-buffer"); + +function shiftFollowingSections(ast, _ref, deltaInSizeEncoding) { + var section = _ref.section; + // Once we hit our section every that is after needs to be shifted by the delta + var encounteredSection = false; + (0, _ast.traverse)(ast, { + SectionMetadata: function SectionMetadata(path) { + if (path.node.section === section) { + encounteredSection = true; + return; + } + + if (encounteredSection === true) { + (0, _ast.shiftSection)(ast, path.node, deltaInSizeEncoding); + } + } + }); +} + +function shrinkPaddedLEB128(ast, uint8Buffer) { + (0, _ast.traverse)(ast, { + SectionMetadata: function SectionMetadata(_ref2) { + var node = _ref2.node; + + /** + * Section size + */ + { + var newu32Encoded = (0, _encoder.encodeU32)(node.size.value); + var newu32EncodedLen = newu32Encoded.length; + var start = node.size.loc.start.column; + var end = node.size.loc.end.column; + var oldu32EncodedLen = end - start; + + if (newu32EncodedLen !== oldu32EncodedLen) { + var deltaInSizeEncoding = oldu32EncodedLen - newu32EncodedLen; + uint8Buffer = (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newu32Encoded); + shiftFollowingSections(ast, node, -deltaInSizeEncoding); + } + } + } + }); + return uint8Buffer; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-opt/package.json b/node_modules/@webassemblyjs/wasm-opt/package.json new file mode 100644 index 0000000..b9968b9 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-opt/package.json @@ -0,0 +1,58 @@ +{ + "_from": "@webassemblyjs/wasm-opt@1.8.5", + "_id": "@webassemblyjs/wasm-opt@1.8.5", + "_inBundle": false, + "_integrity": "sha512-HKo2mO/Uh9A6ojzu7cjslGaHaUU14LdLbGEKqTR7PBKwT6LdPtLLh9fPY33rmr5wcOMrsWDbbdCHq4hQUdd37Q==", + "_location": "/@webassemblyjs/wasm-opt", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/wasm-opt@1.8.5", + "name": "@webassemblyjs/wasm-opt", + "escapedName": "@webassemblyjs%2fwasm-opt", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/wasm-edit" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.8.5.tgz", + "_shasum": "b24d9f6ba50394af1349f510afa8ffcb8a63d264", + "_spec": "@webassemblyjs/wasm-opt@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/wasm-edit", + "author": { + "name": "Sven Sauleau" + }, + "bugs": { + "url": "https://github.com/xtuc/webassemblyjs/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5" + }, + "deprecated": false, + "description": "", + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "homepage": "https://github.com/xtuc/webassemblyjs#readme", + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/wasm-opt", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/xtuc/webassemblyjs.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/wasm-opt/webassemblyjs-wasm-opt-1.7.10.tgz b/node_modules/@webassemblyjs/wasm-opt/webassemblyjs-wasm-opt-1.7.10.tgz new file mode 100644 index 0000000000000000000000000000000000000000..379a7dd43a2e6334afa68faa4413d0742b6567b1 GIT binary patch literal 2701 zcmV;83Uc)yiwFP!000001MM1XbJ|F9KkHZYa#eefQ^dosoH=e6V>wnG1{dJXrE04v zA&o$ZkT_`+!tMIMU-yijfSpUl>syrRy*X#~mHgD+MS=g_6R$?2 zae8_T`{1~mtyT-ZJ32XSG@GZV4aCDQC&wrF`P72!TXDqA5JmY?I#LmNRejE~>B1X!$Z&@rp`FA6OWNvS0KZi9Fbu+T@B^R?h*r#U z9hcd^RN#jnfPHj1G%I-WUQi3!Du`Sjgqs4v%}Vf|yHY6x#i2)#1?Q{iyk5thMLg52 zU|IjjW2;`Wh(_l!2CI1HxzVB*_>Mczd6<^PB2q#kSor}n=8GVto$&|e!`MVin6cCy z5t$ze;ckpcYT6Y;1NoNA3P#zwBvYEGa3#Aq3+Am@_;MCI4huhtEv|jewr~0Y#FZIF zC8C+SXsl~y+O*}IoV>D5t;X?L^VONtIyPIaM#G#nj+>2Rr+Ic{vsUZ$?61caP~#YhEzi}2~ENIp@F{JWyuvT*4}lo`N{V8KE*+rT_Dea>tZoRBdH9IzH%&bfMCWkQMmpbOt6r*f|z`PWTL>~YcphsYy(D|z;aEb2XOJC&ti_iNQ8f~tV(*+gAgL-c?wd%fDS^}Tsnb6 zqOZuHJTXy3ko6*1mNjuB#fd{7Su%0P4$x$R<2zV8|EEYZlZAi9NndK6gzIRzWEEZL6sv z|7#t_!>h@g?nnn?47a1<&&H*G36<^`pDQZ7F(%i;y9pr1s5_Xvh2a%+2XEmY#^6!~ z{hzlZeLRNYNHK11`-YA%W6u$eKtd#B@N zLgvI1LqP=34RlF`Obw+QK@@tv8|xWCxYWCSq&23)q+*J!9kTT|zS8_(tj3?3$K(0` zxOvvx?f;smhy4E>%ZYuF2w_USQQ%aA*}EG23a*2RRX||8SshX-PH-(u4QGZn6x8G6&3GDI})CxC7+a!(9nRu1e8Zm5G zu>nqX6Sc|0jQl@yEJd&~#p;pD4L8Dihh?H zHB668rb=Ss`_}uAZwNmr`_|T`A4|jSy{R$b0{ghaf>e}ROAJQ9una{oR$6qJ>ZL*aO{P;+Jx39@>Mp7H zM15>#1vbg!gjhg7Hoa))hoVL3`tNT|8%x~2e$i~bqPJ&hzGvgzos_gz_t*>pG|Fl# z$_F!q;fiA)@oyH2%Z83pfAOd36w66{I(<>kU9UP72sJU@$^Ec=T!jP+i9;R*%Scrk z--|`m6nno{c zLQYQmu=l|x4+4pZt;{)8;4eU$;zvb36*ShC_$pyNQ$z7H=`{?X)_c^Uh$vtZDGS}g zLO?#00m~w`mHTRD9kQx)u@JGyMr3Vw?gt?n$!23FZYgRWka+w#WBt`6ARF-b1D4T}Np(yBa)9}X_r*skn(PSi}7#bx?cLcJQJW{}_*I`J- z_?p4Om!E9}h5loUs;# zR$Ih(c_UJM8Eq4^8^%o=^T>IgF}8N9E0ZtM7!9HtBZ%gs<+V&ttWcBhIV$WIi!xO^ zLy@T?eZE%;Z1$b*$n!-eMK6;YX7cU7rJPy%FP51Kvi>h}=T0t566lv0m|UclYee@+ z!Y9tt5}LGA!_;5ANHu?vQi2H8%b@k-TW%pik*(vSmaqZ3P$z%Us`4U{f+ouLTKnO1 zeMT2p0%;!e=X_B1wsWcp~L&)Qn9>Jr2^C|*=m_^tw{E<$RvIKqVcMK6wM zA^TVChOGKn$DTG|Q!HAGM~aFy#dF1K zLoFt0O-fe#yg{QNg6VlraZo#q8^6vf*8g8;{&&=*y{-EH==4zkKg;?bssCk^d8qKG zX=7IKC)2}E^$FX<#_YVD9%dc>Lqy6$#@Zit$|!;|ims*8u-YGU-k9lG96Z*(Z1VW| zBgdz*_E#A`3gMIYNy{dYwZka#Sw@k<`o-X-?Hx|m{z%iw!#b?PI;_L`z1DvK$*NB> H06YKyjB!A5 literal 0 HcmV?d00001 diff --git a/node_modules/@webassemblyjs/wasm-parser/LICENSE b/node_modules/@webassemblyjs/wasm-parser/LICENSE new file mode 100644 index 0000000..87e7e1f --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-parser/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sven Sauleau + +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. diff --git a/node_modules/@webassemblyjs/wasm-parser/README.md b/node_modules/@webassemblyjs/wasm-parser/README.md new file mode 100644 index 0000000..19058d7 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-parser/README.md @@ -0,0 +1,26 @@ +# @webassemblyjs/wasm-parser + +> WebAssembly binary format parser + +## Installation + +```sh +yarn add @webassemblyjs/wasm-parser +``` + +## Usage + +```js +import { decode } from "@webassemblyjs/wasm-parser"; + +const decoderOpts = {}; + +const ast = decode(binary, decoderOpts); +``` + +### Decoder options + +- `dump`: print dump information while decoding (default `false`) +- `ignoreCodeSection`: ignore the code section (default `false`) +- `ignoreDataSection`: ignore the data section (default `false`) + diff --git a/node_modules/@webassemblyjs/wasm-parser/esm/decoder.js b/node_modules/@webassemblyjs/wasm-parser/esm/decoder.js new file mode 100644 index 0000000..103dcc2 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-parser/esm/decoder.js @@ -0,0 +1,1760 @@ +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +import { CompileError } from "@webassemblyjs/helper-api-error"; +import * as ieee754 from "@webassemblyjs/ieee754"; +import * as utf8 from "@webassemblyjs/utf8"; +import * as t from "@webassemblyjs/ast"; +import { decodeInt32, decodeUInt32, MAX_NUMBER_OF_BYTE_U32, decodeInt64, decodeUInt64, MAX_NUMBER_OF_BYTE_U64 } from "@webassemblyjs/leb128"; +import constants from "@webassemblyjs/helper-wasm-bytecode"; + +function toHex(n) { + return "0x" + Number(n).toString(16); +} + +function byteArrayEq(l, r) { + if (l.length !== r.length) { + return false; + } + + for (var i = 0; i < l.length; i++) { + if (l[i] !== r[i]) { + return false; + } + } + + return true; +} + +export function decode(ab, opts) { + var buf = new Uint8Array(ab); + var getUniqueName = t.getUniqueNameGenerator(); + var offset = 0; + + function getPosition() { + return { + line: -1, + column: offset + }; + } + + function dump(b, msg) { + if (opts.dump === false) return; + var pad = "\t\t\t\t\t\t\t\t\t\t"; + var str = ""; + + if (b.length < 5) { + str = b.map(toHex).join(" "); + } else { + str = "..."; + } + + console.log(toHex(offset) + ":\t", str, pad, ";", msg); + } + + function dumpSep(msg) { + if (opts.dump === false) return; + console.log(";", msg); + } + /** + * TODO(sven): we can atually use a same structure + * we are adding incrementally new features + */ + + + var state = { + elementsInFuncSection: [], + elementsInExportSection: [], + elementsInCodeSection: [], + + /** + * Decode memory from: + * - Memory section + */ + memoriesInModule: [], + + /** + * Decoded types from: + * - Type section + */ + typesInModule: [], + + /** + * Decoded functions from: + * - Function section + * - Import section + */ + functionsInModule: [], + + /** + * Decoded tables from: + * - Table section + */ + tablesInModule: [], + + /** + * Decoded globals from: + * - Global section + */ + globalsInModule: [] + }; + + function isEOF() { + return offset >= buf.length; + } + + function eatBytes(n) { + offset = offset + n; + } + + function readBytesAtOffset(_offset, numberOfBytes) { + var arr = []; + + for (var i = 0; i < numberOfBytes; i++) { + arr.push(buf[_offset + i]); + } + + return arr; + } + + function readBytes(numberOfBytes) { + return readBytesAtOffset(offset, numberOfBytes); + } + + function readF64() { + var bytes = readBytes(ieee754.NUMBER_OF_BYTE_F64); + var value = ieee754.decodeF64(bytes); + + if (Math.sign(value) * value === Infinity) { + return { + value: Math.sign(value), + inf: true, + nextIndex: ieee754.NUMBER_OF_BYTE_F64 + }; + } + + if (isNaN(value)) { + var sign = bytes[bytes.length - 1] >> 7 ? -1 : 1; + var mantissa = 0; + + for (var i = 0; i < bytes.length - 2; ++i) { + mantissa += bytes[i] * Math.pow(256, i); + } + + mantissa += bytes[bytes.length - 2] % 16 * Math.pow(256, bytes.length - 2); + return { + value: sign * mantissa, + nan: true, + nextIndex: ieee754.NUMBER_OF_BYTE_F64 + }; + } + + return { + value: value, + nextIndex: ieee754.NUMBER_OF_BYTE_F64 + }; + } + + function readF32() { + var bytes = readBytes(ieee754.NUMBER_OF_BYTE_F32); + var value = ieee754.decodeF32(bytes); + + if (Math.sign(value) * value === Infinity) { + return { + value: Math.sign(value), + inf: true, + nextIndex: ieee754.NUMBER_OF_BYTE_F32 + }; + } + + if (isNaN(value)) { + var sign = bytes[bytes.length - 1] >> 7 ? -1 : 1; + var mantissa = 0; + + for (var i = 0; i < bytes.length - 2; ++i) { + mantissa += bytes[i] * Math.pow(256, i); + } + + mantissa += bytes[bytes.length - 2] % 128 * Math.pow(256, bytes.length - 2); + return { + value: sign * mantissa, + nan: true, + nextIndex: ieee754.NUMBER_OF_BYTE_F32 + }; + } + + return { + value: value, + nextIndex: ieee754.NUMBER_OF_BYTE_F32 + }; + } + + function readUTF8String() { + var lenu32 = readU32(); // Don't eat any bytes. Instead, peek ahead of the current offset using + // readBytesAtOffset below. This keeps readUTF8String neutral with respect + // to the current offset, just like the other readX functions. + + var strlen = lenu32.value; + dump([strlen], "string length"); + var bytes = readBytesAtOffset(offset + lenu32.nextIndex, strlen); + var value = utf8.decode(bytes); + return { + value: value, + nextIndex: strlen + lenu32.nextIndex + }; + } + /** + * Decode an unsigned 32bits integer + * + * The length will be handled by the leb librairy, we pass the max number of + * byte. + */ + + + function readU32() { + var bytes = readBytes(MAX_NUMBER_OF_BYTE_U32); + var buffer = Buffer.from(bytes); + return decodeUInt32(buffer); + } + + function readVaruint32() { + // where 32 bits = max 4 bytes + var bytes = readBytes(4); + var buffer = Buffer.from(bytes); + return decodeUInt32(buffer); + } + + function readVaruint7() { + // where 7 bits = max 1 bytes + var bytes = readBytes(1); + var buffer = Buffer.from(bytes); + return decodeUInt32(buffer); + } + /** + * Decode a signed 32bits interger + */ + + + function read32() { + var bytes = readBytes(MAX_NUMBER_OF_BYTE_U32); + var buffer = Buffer.from(bytes); + return decodeInt32(buffer); + } + /** + * Decode a signed 64bits integer + */ + + + function read64() { + var bytes = readBytes(MAX_NUMBER_OF_BYTE_U64); + var buffer = Buffer.from(bytes); + return decodeInt64(buffer); + } + + function readU64() { + var bytes = readBytes(MAX_NUMBER_OF_BYTE_U64); + var buffer = Buffer.from(bytes); + return decodeUInt64(buffer); + } + + function readByte() { + return readBytes(1)[0]; + } + + function parseModuleHeader() { + if (isEOF() === true || offset + 4 > buf.length) { + throw new Error("unexpected end"); + } + + var header = readBytes(4); + + if (byteArrayEq(constants.magicModuleHeader, header) === false) { + throw new CompileError("magic header not detected"); + } + + dump(header, "wasm magic header"); + eatBytes(4); + } + + function parseVersion() { + if (isEOF() === true || offset + 4 > buf.length) { + throw new Error("unexpected end"); + } + + var version = readBytes(4); + + if (byteArrayEq(constants.moduleVersion, version) === false) { + throw new CompileError("unknown binary version"); + } + + dump(version, "wasm version"); + eatBytes(4); + } + + function parseVec(cast) { + var u32 = readU32(); + var length = u32.value; + eatBytes(u32.nextIndex); + dump([length], "number"); + + if (length === 0) { + return []; + } + + var elements = []; + + for (var i = 0; i < length; i++) { + var byte = readByte(); + eatBytes(1); + var value = cast(byte); + dump([byte], value); + + if (typeof value === "undefined") { + throw new CompileError("Internal failure: parseVec could not cast the value"); + } + + elements.push(value); + } + + return elements; + } // Type section + // https://webassembly.github.io/spec/binary/modules.html#binary-typesec + + + function parseTypeSection(numberOfTypes) { + var typeInstructionNodes = []; + dump([numberOfTypes], "num types"); + + for (var i = 0; i < numberOfTypes; i++) { + var _startLoc = getPosition(); + + dumpSep("type " + i); + var type = readByte(); + eatBytes(1); + + if (type == constants.types.func) { + dump([type], "func"); + var paramValtypes = parseVec(function (b) { + return constants.valtypes[b]; + }); + var params = paramValtypes.map(function (v) { + return t.funcParam( + /*valtype*/ + v); + }); + var result = parseVec(function (b) { + return constants.valtypes[b]; + }); + typeInstructionNodes.push(function () { + var endLoc = getPosition(); + return t.withLoc(t.typeInstruction(undefined, t.signature(params, result)), endLoc, _startLoc); + }()); + state.typesInModule.push({ + params: params, + result: result + }); + } else { + throw new Error("Unsupported type: " + toHex(type)); + } + } + + return typeInstructionNodes; + } // Import section + // https://webassembly.github.io/spec/binary/modules.html#binary-importsec + + + function parseImportSection(numberOfImports) { + var imports = []; + + for (var i = 0; i < numberOfImports; i++) { + dumpSep("import header " + i); + + var _startLoc2 = getPosition(); + /** + * Module name + */ + + + var moduleName = readUTF8String(); + eatBytes(moduleName.nextIndex); + dump([], "module name (".concat(moduleName.value, ")")); + /** + * Name + */ + + var name = readUTF8String(); + eatBytes(name.nextIndex); + dump([], "name (".concat(name.value, ")")); + /** + * Import descr + */ + + var descrTypeByte = readByte(); + eatBytes(1); + var descrType = constants.importTypes[descrTypeByte]; + dump([descrTypeByte], "import kind"); + + if (typeof descrType === "undefined") { + throw new CompileError("Unknown import description type: " + toHex(descrTypeByte)); + } + + var importDescr = void 0; + + if (descrType === "func") { + var indexU32 = readU32(); + var typeindex = indexU32.value; + eatBytes(indexU32.nextIndex); + dump([typeindex], "type index"); + var signature = state.typesInModule[typeindex]; + + if (typeof signature === "undefined") { + throw new CompileError("function signature not found (".concat(typeindex, ")")); + } + + var id = getUniqueName("func"); + importDescr = t.funcImportDescr(id, t.signature(signature.params, signature.result)); + state.functionsInModule.push({ + id: t.identifier(name.value), + signature: signature, + isExternal: true + }); + } else if (descrType === "global") { + importDescr = parseGlobalType(); + var globalNode = t.global(importDescr, []); + state.globalsInModule.push(globalNode); + } else if (descrType === "table") { + importDescr = parseTableType(i); + } else if (descrType === "mem") { + var memoryNode = parseMemoryType(0); + state.memoriesInModule.push(memoryNode); + importDescr = memoryNode; + } else { + throw new CompileError("Unsupported import of type: " + descrType); + } + + imports.push(function () { + var endLoc = getPosition(); + return t.withLoc(t.moduleImport(moduleName.value, name.value, importDescr), endLoc, _startLoc2); + }()); + } + + return imports; + } // Function section + // https://webassembly.github.io/spec/binary/modules.html#function-section + + + function parseFuncSection(numberOfFunctions) { + dump([numberOfFunctions], "num funcs"); + + for (var i = 0; i < numberOfFunctions; i++) { + var indexU32 = readU32(); + var typeindex = indexU32.value; + eatBytes(indexU32.nextIndex); + dump([typeindex], "type index"); + var signature = state.typesInModule[typeindex]; + + if (typeof signature === "undefined") { + throw new CompileError("function signature not found (".concat(typeindex, ")")); + } // preserve anonymous, a name might be resolved later + + + var id = t.withRaw(t.identifier(getUniqueName("func")), ""); + state.functionsInModule.push({ + id: id, + signature: signature, + isExternal: false + }); + } + } // Export section + // https://webassembly.github.io/spec/binary/modules.html#export-section + + + function parseExportSection(numberOfExport) { + dump([numberOfExport], "num exports"); // Parse vector of exports + + for (var i = 0; i < numberOfExport; i++) { + var _startLoc3 = getPosition(); + /** + * Name + */ + + + var name = readUTF8String(); + eatBytes(name.nextIndex); + dump([], "export name (".concat(name.value, ")")); + /** + * exportdescr + */ + + var typeIndex = readByte(); + eatBytes(1); + dump([typeIndex], "export kind"); + var indexu32 = readU32(); + var index = indexu32.value; + eatBytes(indexu32.nextIndex); + dump([index], "export index"); + var id = void 0, + signature = void 0; + + if (constants.exportTypes[typeIndex] === "Func") { + var func = state.functionsInModule[index]; + + if (typeof func === "undefined") { + throw new CompileError("unknown function (".concat(index, ")")); + } + + id = t.numberLiteralFromRaw(index, String(index)); + signature = func.signature; + } else if (constants.exportTypes[typeIndex] === "Table") { + var table = state.tablesInModule[index]; + + if (typeof table === "undefined") { + throw new CompileError("unknown table ".concat(index)); + } + + id = t.numberLiteralFromRaw(index, String(index)); + signature = null; + } else if (constants.exportTypes[typeIndex] === "Mem") { + var memNode = state.memoriesInModule[index]; + + if (typeof memNode === "undefined") { + throw new CompileError("unknown memory ".concat(index)); + } + + id = t.numberLiteralFromRaw(index, String(index)); + signature = null; + } else if (constants.exportTypes[typeIndex] === "Global") { + var global = state.globalsInModule[index]; + + if (typeof global === "undefined") { + throw new CompileError("unknown global ".concat(index)); + } + + id = t.numberLiteralFromRaw(index, String(index)); + signature = null; + } else { + console.warn("Unsupported export type: " + toHex(typeIndex)); + return; + } + + var endLoc = getPosition(); + state.elementsInExportSection.push({ + name: name.value, + type: constants.exportTypes[typeIndex], + signature: signature, + id: id, + index: index, + endLoc: endLoc, + startLoc: _startLoc3 + }); + } + } // Code section + // https://webassembly.github.io/spec/binary/modules.html#code-section + + + function parseCodeSection(numberOfFuncs) { + dump([numberOfFuncs], "number functions"); // Parse vector of function + + for (var i = 0; i < numberOfFuncs; i++) { + var _startLoc4 = getPosition(); + + dumpSep("function body " + i); // the u32 size of the function code in bytes + // Ignore it for now + + var bodySizeU32 = readU32(); + eatBytes(bodySizeU32.nextIndex); + dump([bodySizeU32.value], "function body size"); + var code = []; + /** + * Parse locals + */ + + var funcLocalNumU32 = readU32(); + var funcLocalNum = funcLocalNumU32.value; + eatBytes(funcLocalNumU32.nextIndex); + dump([funcLocalNum], "num locals"); + var locals = []; + + for (var _i = 0; _i < funcLocalNum; _i++) { + var _startLoc5 = getPosition(); + + var localCountU32 = readU32(); + var localCount = localCountU32.value; + eatBytes(localCountU32.nextIndex); + dump([localCount], "num local"); + var valtypeByte = readByte(); + eatBytes(1); + var type = constants.valtypes[valtypeByte]; + var args = []; + + for (var _i2 = 0; _i2 < localCount; _i2++) { + args.push(t.valtypeLiteral(type)); + } + + var localNode = function () { + var endLoc = getPosition(); + return t.withLoc(t.instruction("local", args), endLoc, _startLoc5); + }(); + + locals.push(localNode); + dump([valtypeByte], type); + + if (typeof type === "undefined") { + throw new CompileError("Unexpected valtype: " + toHex(valtypeByte)); + } + } + + code.push.apply(code, locals); // Decode instructions until the end + + parseInstructionBlock(code); + var endLoc = getPosition(); + state.elementsInCodeSection.push({ + code: code, + locals: locals, + endLoc: endLoc, + startLoc: _startLoc4, + bodySize: bodySizeU32.value + }); + } + } + + function parseInstructionBlock(code) { + while (true) { + var _startLoc6 = getPosition(); + + var instructionAlreadyCreated = false; + var instructionByte = readByte(); + eatBytes(1); + + if (instructionByte === 0xfe) { + throw new CompileError("Atomic instructions are not implemented"); + } + + var instruction = constants.symbolsByByte[instructionByte]; + + if (typeof instruction === "undefined") { + throw new CompileError("Unexpected instruction: " + toHex(instructionByte)); + } + + if (typeof instruction.object === "string") { + dump([instructionByte], "".concat(instruction.object, ".").concat(instruction.name)); + } else { + dump([instructionByte], instruction.name); + } + /** + * End of the function + */ + + + if (instruction.name === "end") { + var node = function () { + var endLoc = getPosition(); + return t.withLoc(t.instruction(instruction.name), endLoc, _startLoc6); + }(); + + code.push(node); + break; + } + + var args = []; + + if (instruction.name === "loop") { + var _startLoc7 = getPosition(); + + var blocktypeByte = readByte(); + eatBytes(1); + var blocktype = constants.blockTypes[blocktypeByte]; + dump([blocktypeByte], "blocktype"); + + if (typeof blocktype === "undefined") { + throw new CompileError("Unexpected blocktype: " + toHex(blocktypeByte)); + } + + var instr = []; + parseInstructionBlock(instr); // preserve anonymous + + var label = t.withRaw(t.identifier(getUniqueName("loop")), ""); + + var loopNode = function () { + var endLoc = getPosition(); + return t.withLoc(t.loopInstruction(label, blocktype, instr), endLoc, _startLoc7); + }(); + + code.push(loopNode); + instructionAlreadyCreated = true; + } else if (instruction.name === "if") { + var _startLoc8 = getPosition(); + + var _blocktypeByte = readByte(); + + eatBytes(1); + var _blocktype = constants.blockTypes[_blocktypeByte]; + dump([_blocktypeByte], "blocktype"); + + if (typeof _blocktype === "undefined") { + throw new CompileError("Unexpected blocktype: " + toHex(_blocktypeByte)); + } + + var testIndex = t.withRaw(t.identifier(getUniqueName("if")), ""); + var ifBody = []; + parseInstructionBlock(ifBody); // Defaults to no alternate + + var elseIndex = 0; + + for (elseIndex = 0; elseIndex < ifBody.length; ++elseIndex) { + var _instr = ifBody[elseIndex]; + + if (_instr.type === "Instr" && _instr.id === "else") { + break; + } + } + + var consequentInstr = ifBody.slice(0, elseIndex); + var alternate = ifBody.slice(elseIndex + 1); // wast sugar + + var testInstrs = []; + + var ifNode = function () { + var endLoc = getPosition(); + return t.withLoc(t.ifInstruction(testIndex, testInstrs, _blocktype, consequentInstr, alternate), endLoc, _startLoc8); + }(); + + code.push(ifNode); + instructionAlreadyCreated = true; + } else if (instruction.name === "block") { + var _startLoc9 = getPosition(); + + var _blocktypeByte2 = readByte(); + + eatBytes(1); + var _blocktype2 = constants.blockTypes[_blocktypeByte2]; + dump([_blocktypeByte2], "blocktype"); + + if (typeof _blocktype2 === "undefined") { + throw new CompileError("Unexpected blocktype: " + toHex(_blocktypeByte2)); + } + + var _instr2 = []; + parseInstructionBlock(_instr2); // preserve anonymous + + var _label = t.withRaw(t.identifier(getUniqueName("block")), ""); + + var blockNode = function () { + var endLoc = getPosition(); + return t.withLoc(t.blockInstruction(_label, _instr2, _blocktype2), endLoc, _startLoc9); + }(); + + code.push(blockNode); + instructionAlreadyCreated = true; + } else if (instruction.name === "call") { + var indexu32 = readU32(); + var index = indexu32.value; + eatBytes(indexu32.nextIndex); + dump([index], "index"); + + var callNode = function () { + var endLoc = getPosition(); + return t.withLoc(t.callInstruction(t.indexLiteral(index)), endLoc, _startLoc6); + }(); + + code.push(callNode); + instructionAlreadyCreated = true; + } else if (instruction.name === "call_indirect") { + var _startLoc10 = getPosition(); + + var indexU32 = readU32(); + var typeindex = indexU32.value; + eatBytes(indexU32.nextIndex); + dump([typeindex], "type index"); + var signature = state.typesInModule[typeindex]; + + if (typeof signature === "undefined") { + throw new CompileError("call_indirect signature not found (".concat(typeindex, ")")); + } + + var _callNode = t.callIndirectInstruction(t.signature(signature.params, signature.result), []); + + var flagU32 = readU32(); + var flag = flagU32.value; // 0x00 - reserved byte + + eatBytes(flagU32.nextIndex); + + if (flag !== 0) { + throw new CompileError("zero flag expected"); + } + + code.push(function () { + var endLoc = getPosition(); + return t.withLoc(_callNode, endLoc, _startLoc10); + }()); + instructionAlreadyCreated = true; + } else if (instruction.name === "br_table") { + var indicesu32 = readU32(); + var indices = indicesu32.value; + eatBytes(indicesu32.nextIndex); + dump([indices], "num indices"); + + for (var i = 0; i <= indices; i++) { + var _indexu = readU32(); + + var _index = _indexu.value; + eatBytes(_indexu.nextIndex); + dump([_index], "index"); + args.push(t.numberLiteralFromRaw(_indexu.value.toString(), "u32")); + } + } else if (instructionByte >= 0x28 && instructionByte <= 0x40) { + /** + * Memory instructions + */ + if (instruction.name === "grow_memory" || instruction.name === "current_memory") { + var _indexU = readU32(); + + var _index2 = _indexU.value; + eatBytes(_indexU.nextIndex); + + if (_index2 !== 0) { + throw new Error("zero flag expected"); + } + + dump([_index2], "index"); + } else { + var aligun32 = readU32(); + var align = aligun32.value; + eatBytes(aligun32.nextIndex); + dump([align], "align"); + var offsetu32 = readU32(); + var _offset2 = offsetu32.value; + eatBytes(offsetu32.nextIndex); + dump([_offset2], "offset"); + } + } else if (instructionByte >= 0x41 && instructionByte <= 0x44) { + /** + * Numeric instructions + */ + if (instruction.object === "i32") { + var value32 = read32(); + var value = value32.value; + eatBytes(value32.nextIndex); + dump([value], "i32 value"); + args.push(t.numberLiteralFromRaw(value)); + } + + if (instruction.object === "u32") { + var valueu32 = readU32(); + var _value = valueu32.value; + eatBytes(valueu32.nextIndex); + dump([_value], "u32 value"); + args.push(t.numberLiteralFromRaw(_value)); + } + + if (instruction.object === "i64") { + var value64 = read64(); + var _value2 = value64.value; + eatBytes(value64.nextIndex); + dump([Number(_value2.toString())], "i64 value"); + var high = _value2.high, + low = _value2.low; + var _node = { + type: "LongNumberLiteral", + value: { + high: high, + low: low + } + }; + args.push(_node); + } + + if (instruction.object === "u64") { + var valueu64 = readU64(); + var _value3 = valueu64.value; + eatBytes(valueu64.nextIndex); + dump([Number(_value3.toString())], "u64 value"); + var _high = _value3.high, + _low = _value3.low; + var _node2 = { + type: "LongNumberLiteral", + value: { + high: _high, + low: _low + } + }; + args.push(_node2); + } + + if (instruction.object === "f32") { + var valuef32 = readF32(); + var _value4 = valuef32.value; + eatBytes(valuef32.nextIndex); + dump([_value4], "f32 value"); + args.push( // $FlowIgnore + t.floatLiteral(_value4, valuef32.nan, valuef32.inf, String(_value4))); + } + + if (instruction.object === "f64") { + var valuef64 = readF64(); + var _value5 = valuef64.value; + eatBytes(valuef64.nextIndex); + dump([_value5], "f64 value"); + args.push( // $FlowIgnore + t.floatLiteral(_value5, valuef64.nan, valuef64.inf, String(_value5))); + } + } else { + for (var _i3 = 0; _i3 < instruction.numberOfArgs; _i3++) { + var u32 = readU32(); + eatBytes(u32.nextIndex); + dump([u32.value], "argument " + _i3); + args.push(t.numberLiteralFromRaw(u32.value)); + } + } + + if (instructionAlreadyCreated === false) { + if (typeof instruction.object === "string") { + var _node3 = function () { + var endLoc = getPosition(); + return t.withLoc(t.objectInstruction(instruction.name, instruction.object, args), endLoc, _startLoc6); + }(); + + code.push(_node3); + } else { + var _node4 = function () { + var endLoc = getPosition(); + return t.withLoc(t.instruction(instruction.name, args), endLoc, _startLoc6); + }(); + + code.push(_node4); + } + } + } + } // https://webassembly.github.io/spec/core/binary/types.html#limits + + + function parseLimits() { + var limitType = readByte(); + eatBytes(1); + dump([limitType], "limit type"); + var min, max; + + if (limitType === 0x01 || limitType === 0x03 // shared limits + ) { + var u32min = readU32(); + min = parseInt(u32min.value); + eatBytes(u32min.nextIndex); + dump([min], "min"); + var u32max = readU32(); + max = parseInt(u32max.value); + eatBytes(u32max.nextIndex); + dump([max], "max"); + } + + if (limitType === 0x00) { + var _u32min = readU32(); + + min = parseInt(_u32min.value); + eatBytes(_u32min.nextIndex); + dump([min], "min"); + } + + return t.limit(min, max); + } // https://webassembly.github.io/spec/core/binary/types.html#binary-tabletype + + + function parseTableType(index) { + var name = t.withRaw(t.identifier(getUniqueName("table")), String(index)); + var elementTypeByte = readByte(); + eatBytes(1); + dump([elementTypeByte], "element type"); + var elementType = constants.tableTypes[elementTypeByte]; + + if (typeof elementType === "undefined") { + throw new CompileError("Unknown element type in table: " + toHex(elementType)); + } + + var limits = parseLimits(); + return t.table(elementType, limits, name); + } // https://webassembly.github.io/spec/binary/types.html#global-types + + + function parseGlobalType() { + var valtypeByte = readByte(); + eatBytes(1); + var type = constants.valtypes[valtypeByte]; + dump([valtypeByte], type); + + if (typeof type === "undefined") { + throw new CompileError("Unknown valtype: " + toHex(valtypeByte)); + } + + var globalTypeByte = readByte(); + eatBytes(1); + var globalType = constants.globalTypes[globalTypeByte]; + dump([globalTypeByte], "global type (".concat(globalType, ")")); + + if (typeof globalType === "undefined") { + throw new CompileError("Invalid mutability: " + toHex(globalTypeByte)); + } + + return t.globalType(type, globalType); + } // function parseNameModule() { + // const lenu32 = readVaruint32(); + // eatBytes(lenu32.nextIndex); + // console.log("len", lenu32); + // const strlen = lenu32.value; + // dump([strlen], "string length"); + // const bytes = readBytes(strlen); + // eatBytes(strlen); + // const value = utf8.decode(bytes); + // return [t.moduleNameMetadata(value)]; + // } + // this section contains an array of function names and indices + + + function parseNameSectionFunctions() { + var functionNames = []; + var numberOfFunctionsu32 = readU32(); + var numbeOfFunctions = numberOfFunctionsu32.value; + eatBytes(numberOfFunctionsu32.nextIndex); + + for (var i = 0; i < numbeOfFunctions; i++) { + var indexu32 = readU32(); + var index = indexu32.value; + eatBytes(indexu32.nextIndex); + var name = readUTF8String(); + eatBytes(name.nextIndex); + functionNames.push(t.functionNameMetadata(name.value, index)); + } + + return functionNames; + } + + function parseNameSectionLocals() { + var localNames = []; + var numbeOfFunctionsu32 = readU32(); + var numbeOfFunctions = numbeOfFunctionsu32.value; + eatBytes(numbeOfFunctionsu32.nextIndex); + + for (var i = 0; i < numbeOfFunctions; i++) { + var functionIndexu32 = readU32(); + var functionIndex = functionIndexu32.value; + eatBytes(functionIndexu32.nextIndex); + var numLocalsu32 = readU32(); + var numLocals = numLocalsu32.value; + eatBytes(numLocalsu32.nextIndex); + + for (var _i4 = 0; _i4 < numLocals; _i4++) { + var localIndexu32 = readU32(); + var localIndex = localIndexu32.value; + eatBytes(localIndexu32.nextIndex); + var name = readUTF8String(); + eatBytes(name.nextIndex); + localNames.push(t.localNameMetadata(name.value, localIndex, functionIndex)); + } + } + + return localNames; + } // this is a custom section used for name resolution + // https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#name-section + + + function parseNameSection(remainingBytes) { + var nameMetadata = []; + var initialOffset = offset; + + while (offset - initialOffset < remainingBytes) { + // name_type + var sectionTypeByte = readVaruint7(); + eatBytes(sectionTypeByte.nextIndex); // name_payload_len + + var subSectionSizeInBytesu32 = readVaruint32(); + eatBytes(subSectionSizeInBytesu32.nextIndex); + + switch (sectionTypeByte.value) { + // case 0: { + // TODO(sven): re-enable that + // Current status: it seems that when we decode the module's name + // no name_payload_len is used. + // + // See https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#name-section + // + // nameMetadata.push(...parseNameModule()); + // break; + // } + case 1: + { + nameMetadata.push.apply(nameMetadata, _toConsumableArray(parseNameSectionFunctions())); + break; + } + + case 2: + { + nameMetadata.push.apply(nameMetadata, _toConsumableArray(parseNameSectionLocals())); + break; + } + + default: + { + // skip unknown subsection + eatBytes(subSectionSizeInBytesu32.value); + } + } + } + + return nameMetadata; + } // this is a custom setion used for information about the producers + // https://github.com/WebAssembly/tool-conventions/blob/master/ProducersSection.md + + + function parseProducersSection() { + var metadata = t.producersSectionMetadata([]); // field_count + + var sectionTypeByte = readVaruint32(); + eatBytes(sectionTypeByte.nextIndex); + dump([sectionTypeByte.value], "num of producers"); + var fields = { + language: [], + "processed-by": [], + sdk: [] + }; // fields + + for (var fieldI = 0; fieldI < sectionTypeByte.value; fieldI++) { + // field_name + var fieldName = readUTF8String(); + eatBytes(fieldName.nextIndex); // field_value_count + + var valueCount = readVaruint32(); + eatBytes(valueCount.nextIndex); // field_values + + for (var producerI = 0; producerI < valueCount.value; producerI++) { + var producerName = readUTF8String(); + eatBytes(producerName.nextIndex); + var producerVersion = readUTF8String(); + eatBytes(producerVersion.nextIndex); + fields[fieldName.value].push(t.producerMetadataVersionedName(producerName.value, producerVersion.value)); + } + + metadata.producers.push(fields[fieldName.value]); + } + + return metadata; + } + + function parseGlobalSection(numberOfGlobals) { + var globals = []; + dump([numberOfGlobals], "num globals"); + + for (var i = 0; i < numberOfGlobals; i++) { + var _startLoc11 = getPosition(); + + var globalType = parseGlobalType(); + /** + * Global expressions + */ + + var init = []; + parseInstructionBlock(init); + + var node = function () { + var endLoc = getPosition(); + return t.withLoc(t.global(globalType, init), endLoc, _startLoc11); + }(); + + globals.push(node); + state.globalsInModule.push(node); + } + + return globals; + } + + function parseElemSection(numberOfElements) { + var elems = []; + dump([numberOfElements], "num elements"); + + for (var i = 0; i < numberOfElements; i++) { + var _startLoc12 = getPosition(); + + var tableindexu32 = readU32(); + var tableindex = tableindexu32.value; + eatBytes(tableindexu32.nextIndex); + dump([tableindex], "table index"); + /** + * Parse instructions + */ + + var instr = []; + parseInstructionBlock(instr); + /** + * Parse ( vector function index ) * + */ + + var indicesu32 = readU32(); + var indices = indicesu32.value; + eatBytes(indicesu32.nextIndex); + dump([indices], "num indices"); + var indexValues = []; + + for (var _i5 = 0; _i5 < indices; _i5++) { + var indexu32 = readU32(); + var index = indexu32.value; + eatBytes(indexu32.nextIndex); + dump([index], "index"); + indexValues.push(t.indexLiteral(index)); + } + + var elemNode = function () { + var endLoc = getPosition(); + return t.withLoc(t.elem(t.indexLiteral(tableindex), instr, indexValues), endLoc, _startLoc12); + }(); + + elems.push(elemNode); + } + + return elems; + } // https://webassembly.github.io/spec/core/binary/types.html#memory-types + + + function parseMemoryType(i) { + var limits = parseLimits(); + return t.memory(limits, t.indexLiteral(i)); + } // https://webassembly.github.io/spec/binary/modules.html#table-section + + + function parseTableSection(numberOfElements) { + var tables = []; + dump([numberOfElements], "num elements"); + + for (var i = 0; i < numberOfElements; i++) { + var tablesNode = parseTableType(i); + state.tablesInModule.push(tablesNode); + tables.push(tablesNode); + } + + return tables; + } // https://webassembly.github.io/spec/binary/modules.html#memory-section + + + function parseMemorySection(numberOfElements) { + var memories = []; + dump([numberOfElements], "num elements"); + + for (var i = 0; i < numberOfElements; i++) { + var memoryNode = parseMemoryType(i); + state.memoriesInModule.push(memoryNode); + memories.push(memoryNode); + } + + return memories; + } // https://webassembly.github.io/spec/binary/modules.html#binary-startsec + + + function parseStartSection() { + var startLoc = getPosition(); + var u32 = readU32(); + var startFuncIndex = u32.value; + eatBytes(u32.nextIndex); + dump([startFuncIndex], "index"); + return function () { + var endLoc = getPosition(); + return t.withLoc(t.start(t.indexLiteral(startFuncIndex)), endLoc, startLoc); + }(); + } // https://webassembly.github.io/spec/binary/modules.html#data-section + + + function parseDataSection(numberOfElements) { + var dataEntries = []; + dump([numberOfElements], "num elements"); + + for (var i = 0; i < numberOfElements; i++) { + var memoryIndexu32 = readU32(); + var memoryIndex = memoryIndexu32.value; + eatBytes(memoryIndexu32.nextIndex); + dump([memoryIndex], "memory index"); + var instrs = []; + parseInstructionBlock(instrs); + var hasExtraInstrs = instrs.filter(function (i) { + return i.id !== "end"; + }).length !== 1; + + if (hasExtraInstrs) { + throw new CompileError("data section offset must be a single instruction"); + } + + var bytes = parseVec(function (b) { + return b; + }); + dump([], "init"); + dataEntries.push(t.data(t.memIndexLiteral(memoryIndex), instrs[0], t.byteArray(bytes))); + } + + return dataEntries; + } // https://webassembly.github.io/spec/binary/modules.html#binary-section + + + function parseSection(sectionIndex) { + var sectionId = readByte(); + eatBytes(1); + + if (sectionId >= sectionIndex || sectionIndex === constants.sections.custom) { + sectionIndex = sectionId + 1; + } else { + if (sectionId !== constants.sections.custom) throw new CompileError("Unexpected section: " + toHex(sectionId)); + } + + var nextSectionIndex = sectionIndex; + var startOffset = offset; + var startLoc = getPosition(); + var u32 = readU32(); + var sectionSizeInBytes = u32.value; + eatBytes(u32.nextIndex); + + var sectionSizeInBytesNode = function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(sectionSizeInBytes), endLoc, startLoc); + }(); + + switch (sectionId) { + case constants.sections.type: + { + dumpSep("section Type"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc13 = getPosition(); + + var _u = readU32(); + + var numberOfTypes = _u.value; + eatBytes(_u.nextIndex); + + var _metadata = t.sectionMetadata("type", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfTypes), endLoc, _startLoc13); + }()); + + var _nodes = parseTypeSection(numberOfTypes); + + return { + nodes: _nodes, + metadata: _metadata, + nextSectionIndex: nextSectionIndex + }; + } + + case constants.sections.table: + { + dumpSep("section Table"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc14 = getPosition(); + + var _u2 = readU32(); + + var numberOfTable = _u2.value; + eatBytes(_u2.nextIndex); + dump([numberOfTable], "num tables"); + + var _metadata2 = t.sectionMetadata("table", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfTable), endLoc, _startLoc14); + }()); + + var _nodes2 = parseTableSection(numberOfTable); + + return { + nodes: _nodes2, + metadata: _metadata2, + nextSectionIndex: nextSectionIndex + }; + } + + case constants.sections.import: + { + dumpSep("section Import"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc15 = getPosition(); + + var numberOfImportsu32 = readU32(); + var numberOfImports = numberOfImportsu32.value; + eatBytes(numberOfImportsu32.nextIndex); + dump([numberOfImports], "number of imports"); + + var _metadata3 = t.sectionMetadata("import", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfImports), endLoc, _startLoc15); + }()); + + var _nodes3 = parseImportSection(numberOfImports); + + return { + nodes: _nodes3, + metadata: _metadata3, + nextSectionIndex: nextSectionIndex + }; + } + + case constants.sections.func: + { + dumpSep("section Function"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc16 = getPosition(); + + var numberOfFunctionsu32 = readU32(); + var numberOfFunctions = numberOfFunctionsu32.value; + eatBytes(numberOfFunctionsu32.nextIndex); + + var _metadata4 = t.sectionMetadata("func", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfFunctions), endLoc, _startLoc16); + }()); + + parseFuncSection(numberOfFunctions); + var _nodes4 = []; + return { + nodes: _nodes4, + metadata: _metadata4, + nextSectionIndex: nextSectionIndex + }; + } + + case constants.sections.export: + { + dumpSep("section Export"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc17 = getPosition(); + + var _u3 = readU32(); + + var numberOfExport = _u3.value; + eatBytes(_u3.nextIndex); + + var _metadata5 = t.sectionMetadata("export", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfExport), endLoc, _startLoc17); + }()); + + parseExportSection(numberOfExport); + var _nodes5 = []; + return { + nodes: _nodes5, + metadata: _metadata5, + nextSectionIndex: nextSectionIndex + }; + } + + case constants.sections.code: + { + dumpSep("section Code"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc18 = getPosition(); + + var _u4 = readU32(); + + var numberOfFuncs = _u4.value; + eatBytes(_u4.nextIndex); + + var _metadata6 = t.sectionMetadata("code", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfFuncs), endLoc, _startLoc18); + }()); + + if (opts.ignoreCodeSection === true) { + var remainingBytes = sectionSizeInBytes - _u4.nextIndex; + eatBytes(remainingBytes); // eat the entire section + } else { + parseCodeSection(numberOfFuncs); + } + + var _nodes6 = []; + return { + nodes: _nodes6, + metadata: _metadata6, + nextSectionIndex: nextSectionIndex + }; + } + + case constants.sections.start: + { + dumpSep("section Start"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _metadata7 = t.sectionMetadata("start", startOffset, sectionSizeInBytesNode); + + var _nodes7 = [parseStartSection()]; + return { + nodes: _nodes7, + metadata: _metadata7, + nextSectionIndex: nextSectionIndex + }; + } + + case constants.sections.element: + { + dumpSep("section Element"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc19 = getPosition(); + + var numberOfElementsu32 = readU32(); + var numberOfElements = numberOfElementsu32.value; + eatBytes(numberOfElementsu32.nextIndex); + + var _metadata8 = t.sectionMetadata("element", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfElements), endLoc, _startLoc19); + }()); + + var _nodes8 = parseElemSection(numberOfElements); + + return { + nodes: _nodes8, + metadata: _metadata8, + nextSectionIndex: nextSectionIndex + }; + } + + case constants.sections.global: + { + dumpSep("section Global"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc20 = getPosition(); + + var numberOfGlobalsu32 = readU32(); + var numberOfGlobals = numberOfGlobalsu32.value; + eatBytes(numberOfGlobalsu32.nextIndex); + + var _metadata9 = t.sectionMetadata("global", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfGlobals), endLoc, _startLoc20); + }()); + + var _nodes9 = parseGlobalSection(numberOfGlobals); + + return { + nodes: _nodes9, + metadata: _metadata9, + nextSectionIndex: nextSectionIndex + }; + } + + case constants.sections.memory: + { + dumpSep("section Memory"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc21 = getPosition(); + + var _numberOfElementsu = readU32(); + + var _numberOfElements = _numberOfElementsu.value; + eatBytes(_numberOfElementsu.nextIndex); + + var _metadata10 = t.sectionMetadata("memory", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(_numberOfElements), endLoc, _startLoc21); + }()); + + var _nodes10 = parseMemorySection(_numberOfElements); + + return { + nodes: _nodes10, + metadata: _metadata10, + nextSectionIndex: nextSectionIndex + }; + } + + case constants.sections.data: + { + dumpSep("section Data"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _metadata11 = t.sectionMetadata("data", startOffset, sectionSizeInBytesNode); + + var _startLoc22 = getPosition(); + + var _numberOfElementsu2 = readU32(); + + var _numberOfElements2 = _numberOfElementsu2.value; + eatBytes(_numberOfElementsu2.nextIndex); + + _metadata11.vectorOfSize = function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(_numberOfElements2), endLoc, _startLoc22); + }(); + + if (opts.ignoreDataSection === true) { + var _remainingBytes = sectionSizeInBytes - _numberOfElementsu2.nextIndex; + + eatBytes(_remainingBytes); // eat the entire section + + dumpSep("ignore data (" + sectionSizeInBytes + " bytes)"); + return { + nodes: [], + metadata: _metadata11, + nextSectionIndex: nextSectionIndex + }; + } else { + var _nodes11 = parseDataSection(_numberOfElements2); + + return { + nodes: _nodes11, + metadata: _metadata11, + nextSectionIndex: nextSectionIndex + }; + } + } + + case constants.sections.custom: + { + dumpSep("section Custom"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + var _metadata12 = [t.sectionMetadata("custom", startOffset, sectionSizeInBytesNode)]; + var sectionName = readUTF8String(); + eatBytes(sectionName.nextIndex); + dump([], "section name (".concat(sectionName.value, ")")); + + var _remainingBytes2 = sectionSizeInBytes - sectionName.nextIndex; + + if (sectionName.value === "name") { + var initialOffset = offset; + + try { + _metadata12.push.apply(_metadata12, _toConsumableArray(parseNameSection(_remainingBytes2))); + } catch (e) { + console.warn("Failed to decode custom \"name\" section @".concat(offset, "; ignoring (").concat(e.message, ").")); + eatBytes(offset - (initialOffset + _remainingBytes2)); + } + } else if (sectionName.value === "producers") { + var _initialOffset = offset; + + try { + _metadata12.push(parseProducersSection()); + } catch (e) { + console.warn("Failed to decode custom \"producers\" section @".concat(offset, "; ignoring (").concat(e.message, ").")); + eatBytes(offset - (_initialOffset + _remainingBytes2)); + } + } else { + // We don't parse the custom section + eatBytes(_remainingBytes2); + dumpSep("ignore custom " + JSON.stringify(sectionName.value) + " section (" + _remainingBytes2 + " bytes)"); + } + + return { + nodes: [], + metadata: _metadata12, + nextSectionIndex: nextSectionIndex + }; + } + } + + throw new CompileError("Unexpected section: " + toHex(sectionId)); + } + + parseModuleHeader(); + parseVersion(); + var moduleFields = []; + var sectionIndex = 0; + var moduleMetadata = { + sections: [], + functionNames: [], + localNames: [], + producers: [] + }; + /** + * All the generate declaration are going to be stored in our state + */ + + while (offset < buf.length) { + var _parseSection = parseSection(sectionIndex), + _nodes12 = _parseSection.nodes, + _metadata13 = _parseSection.metadata, + nextSectionIndex = _parseSection.nextSectionIndex; + + moduleFields.push.apply(moduleFields, _toConsumableArray(_nodes12)); + var metadataArray = Array.isArray(_metadata13) ? _metadata13 : [_metadata13]; + metadataArray.forEach(function (metadataItem) { + if (metadataItem.type === "FunctionNameMetadata") { + moduleMetadata.functionNames.push(metadataItem); + } else if (metadataItem.type === "LocalNameMetadata") { + moduleMetadata.localNames.push(metadataItem); + } else if (metadataItem.type === "ProducersSectionMetadata") { + moduleMetadata.producers.push(metadataItem); + } else { + moduleMetadata.sections.push(metadataItem); + } + }); // Ignore custom section + + if (nextSectionIndex) { + sectionIndex = nextSectionIndex; + } + } + /** + * Transform the state into AST nodes + */ + + + var funcIndex = 0; + state.functionsInModule.forEach(function (func) { + var params = func.signature.params; + var result = func.signature.result; + var body = []; // External functions doesn't provide any code, can skip it here + + if (func.isExternal === true) { + return; + } + + var decodedElementInCodeSection = state.elementsInCodeSection[funcIndex]; + + if (opts.ignoreCodeSection === false) { + if (typeof decodedElementInCodeSection === "undefined") { + throw new CompileError("func " + toHex(funcIndex) + " code not found"); + } + + body = decodedElementInCodeSection.code; + } + + funcIndex++; + var funcNode = t.func(func.id, t.signature(params, result), body); + + if (func.isExternal === true) { + funcNode.isExternal = func.isExternal; + } // Add function position in the binary if possible + + + if (opts.ignoreCodeSection === false) { + var _startLoc23 = decodedElementInCodeSection.startLoc, + endLoc = decodedElementInCodeSection.endLoc, + bodySize = decodedElementInCodeSection.bodySize; + funcNode = t.withLoc(funcNode, endLoc, _startLoc23); + funcNode.metadata = { + bodySize: bodySize + }; + } + + moduleFields.push(funcNode); + }); + state.elementsInExportSection.forEach(function (moduleExport) { + /** + * If the export has no id, we won't be able to call it from the outside + * so we can omit it + */ + if (moduleExport.id != null) { + moduleFields.push(t.withLoc(t.moduleExport(moduleExport.name, t.moduleExportDescr(moduleExport.type, moduleExport.id)), moduleExport.endLoc, moduleExport.startLoc)); + } + }); + dumpSep("end of program"); + var module = t.module(null, moduleFields, t.moduleMetadata(moduleMetadata.sections, moduleMetadata.functionNames, moduleMetadata.localNames, moduleMetadata.producers)); + return t.program([module]); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-parser/esm/index.js b/node_modules/@webassemblyjs/wasm-parser/esm/index.js new file mode 100644 index 0000000..a5844d6 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-parser/esm/index.js @@ -0,0 +1,247 @@ +import * as decoder from "./decoder"; +import * as t from "@webassemblyjs/ast"; +/** + * TODO(sven): I added initial props, but we should rather fix + * https://github.com/xtuc/webassemblyjs/issues/405 + */ + +var defaultDecoderOpts = { + dump: false, + ignoreCodeSection: false, + ignoreDataSection: false, + ignoreCustomNameSection: false +}; // traverses the AST, locating function name metadata, which is then +// used to update index-based identifiers with function names + +function restoreFunctionNames(ast) { + var functionNames = []; + t.traverse(ast, { + FunctionNameMetadata: function FunctionNameMetadata(_ref) { + var node = _ref.node; + functionNames.push({ + name: node.value, + index: node.index + }); + } + }); + + if (functionNames.length === 0) { + return; + } + + t.traverse(ast, { + Func: function (_Func) { + function Func(_x) { + return _Func.apply(this, arguments); + } + + Func.toString = function () { + return _Func.toString(); + }; + + return Func; + }(function (_ref2) { + var node = _ref2.node; + // $FlowIgnore + var nodeName = node.name; + var indexBasedFunctionName = nodeName.value; + var index = Number(indexBasedFunctionName.replace("func_", "")); + var functionName = functionNames.find(function (f) { + return f.index === index; + }); + + if (functionName) { + var oldValue = nodeName.value; + nodeName.value = functionName.name; + nodeName.numeric = oldValue; // $FlowIgnore + + delete nodeName.raw; + } + }), + // Also update the reference in the export + ModuleExport: function (_ModuleExport) { + function ModuleExport(_x2) { + return _ModuleExport.apply(this, arguments); + } + + ModuleExport.toString = function () { + return _ModuleExport.toString(); + }; + + return ModuleExport; + }(function (_ref3) { + var node = _ref3.node; + + if (node.descr.exportType === "Func") { + // $FlowIgnore + var nodeName = node.descr.id; + var index = nodeName.value; + var functionName = functionNames.find(function (f) { + return f.index === index; + }); + + if (functionName) { + node.descr.id = t.identifier(functionName.name); + } + } + }), + ModuleImport: function (_ModuleImport) { + function ModuleImport(_x3) { + return _ModuleImport.apply(this, arguments); + } + + ModuleImport.toString = function () { + return _ModuleImport.toString(); + }; + + return ModuleImport; + }(function (_ref4) { + var node = _ref4.node; + + if (node.descr.type === "FuncImportDescr") { + // $FlowIgnore + var indexBasedFunctionName = node.descr.id; + var index = Number(indexBasedFunctionName.replace("func_", "")); + var functionName = functionNames.find(function (f) { + return f.index === index; + }); + + if (functionName) { + // $FlowIgnore + node.descr.id = t.identifier(functionName.name); + } + } + }), + CallInstruction: function (_CallInstruction) { + function CallInstruction(_x4) { + return _CallInstruction.apply(this, arguments); + } + + CallInstruction.toString = function () { + return _CallInstruction.toString(); + }; + + return CallInstruction; + }(function (nodePath) { + var node = nodePath.node; + var index = node.index.value; + var functionName = functionNames.find(function (f) { + return f.index === index; + }); + + if (functionName) { + var oldValue = node.index; + node.index = t.identifier(functionName.name); + node.numeric = oldValue; // $FlowIgnore + + delete node.raw; + } + }) + }); +} + +function restoreLocalNames(ast) { + var localNames = []; + t.traverse(ast, { + LocalNameMetadata: function LocalNameMetadata(_ref5) { + var node = _ref5.node; + localNames.push({ + name: node.value, + localIndex: node.localIndex, + functionIndex: node.functionIndex + }); + } + }); + + if (localNames.length === 0) { + return; + } + + t.traverse(ast, { + Func: function (_Func2) { + function Func(_x5) { + return _Func2.apply(this, arguments); + } + + Func.toString = function () { + return _Func2.toString(); + }; + + return Func; + }(function (_ref6) { + var node = _ref6.node; + var signature = node.signature; + + if (signature.type !== "Signature") { + return; + } // $FlowIgnore + + + var nodeName = node.name; + var indexBasedFunctionName = nodeName.value; + var functionIndex = Number(indexBasedFunctionName.replace("func_", "")); + signature.params.forEach(function (param, paramIndex) { + var paramName = localNames.find(function (f) { + return f.localIndex === paramIndex && f.functionIndex === functionIndex; + }); + + if (paramName && paramName.name !== "") { + param.id = paramName.name; + } + }); + }) + }); +} + +function restoreModuleName(ast) { + t.traverse(ast, { + ModuleNameMetadata: function (_ModuleNameMetadata) { + function ModuleNameMetadata(_x6) { + return _ModuleNameMetadata.apply(this, arguments); + } + + ModuleNameMetadata.toString = function () { + return _ModuleNameMetadata.toString(); + }; + + return ModuleNameMetadata; + }(function (moduleNameMetadataPath) { + // update module + t.traverse(ast, { + Module: function (_Module) { + function Module(_x7) { + return _Module.apply(this, arguments); + } + + Module.toString = function () { + return _Module.toString(); + }; + + return Module; + }(function (_ref7) { + var node = _ref7.node; + var name = moduleNameMetadataPath.node.value; // compatiblity with wast-parser + + if (name === "") { + name = null; + } + + node.id = name; + }) + }); + }) + }); +} + +export function decode(buf, customOpts) { + var opts = Object.assign({}, defaultDecoderOpts, customOpts); + var ast = decoder.decode(buf, opts); + + if (opts.ignoreCustomNameSection === false) { + restoreFunctionNames(ast); + restoreLocalNames(ast); + restoreModuleName(ast); + } + + return ast; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-parser/esm/types/decoder.js b/node_modules/@webassemblyjs/wasm-parser/esm/types/decoder.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/@webassemblyjs/wasm-parser/lib/decoder.js b/node_modules/@webassemblyjs/wasm-parser/lib/decoder.js new file mode 100644 index 0000000..79e1ee2 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-parser/lib/decoder.js @@ -0,0 +1,1776 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.decode = decode; + +var _helperApiError = require("@webassemblyjs/helper-api-error"); + +var ieee754 = _interopRequireWildcard(require("@webassemblyjs/ieee754")); + +var utf8 = _interopRequireWildcard(require("@webassemblyjs/utf8")); + +var t = _interopRequireWildcard(require("@webassemblyjs/ast")); + +var _leb = require("@webassemblyjs/leb128"); + +var _helperWasmBytecode = _interopRequireDefault(require("@webassemblyjs/helper-wasm-bytecode")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function toHex(n) { + return "0x" + Number(n).toString(16); +} + +function byteArrayEq(l, r) { + if (l.length !== r.length) { + return false; + } + + for (var i = 0; i < l.length; i++) { + if (l[i] !== r[i]) { + return false; + } + } + + return true; +} + +function decode(ab, opts) { + var buf = new Uint8Array(ab); + var getUniqueName = t.getUniqueNameGenerator(); + var offset = 0; + + function getPosition() { + return { + line: -1, + column: offset + }; + } + + function dump(b, msg) { + if (opts.dump === false) return; + var pad = "\t\t\t\t\t\t\t\t\t\t"; + var str = ""; + + if (b.length < 5) { + str = b.map(toHex).join(" "); + } else { + str = "..."; + } + + console.log(toHex(offset) + ":\t", str, pad, ";", msg); + } + + function dumpSep(msg) { + if (opts.dump === false) return; + console.log(";", msg); + } + /** + * TODO(sven): we can atually use a same structure + * we are adding incrementally new features + */ + + + var state = { + elementsInFuncSection: [], + elementsInExportSection: [], + elementsInCodeSection: [], + + /** + * Decode memory from: + * - Memory section + */ + memoriesInModule: [], + + /** + * Decoded types from: + * - Type section + */ + typesInModule: [], + + /** + * Decoded functions from: + * - Function section + * - Import section + */ + functionsInModule: [], + + /** + * Decoded tables from: + * - Table section + */ + tablesInModule: [], + + /** + * Decoded globals from: + * - Global section + */ + globalsInModule: [] + }; + + function isEOF() { + return offset >= buf.length; + } + + function eatBytes(n) { + offset = offset + n; + } + + function readBytesAtOffset(_offset, numberOfBytes) { + var arr = []; + + for (var i = 0; i < numberOfBytes; i++) { + arr.push(buf[_offset + i]); + } + + return arr; + } + + function readBytes(numberOfBytes) { + return readBytesAtOffset(offset, numberOfBytes); + } + + function readF64() { + var bytes = readBytes(ieee754.NUMBER_OF_BYTE_F64); + var value = ieee754.decodeF64(bytes); + + if (Math.sign(value) * value === Infinity) { + return { + value: Math.sign(value), + inf: true, + nextIndex: ieee754.NUMBER_OF_BYTE_F64 + }; + } + + if (isNaN(value)) { + var sign = bytes[bytes.length - 1] >> 7 ? -1 : 1; + var mantissa = 0; + + for (var i = 0; i < bytes.length - 2; ++i) { + mantissa += bytes[i] * Math.pow(256, i); + } + + mantissa += bytes[bytes.length - 2] % 16 * Math.pow(256, bytes.length - 2); + return { + value: sign * mantissa, + nan: true, + nextIndex: ieee754.NUMBER_OF_BYTE_F64 + }; + } + + return { + value: value, + nextIndex: ieee754.NUMBER_OF_BYTE_F64 + }; + } + + function readF32() { + var bytes = readBytes(ieee754.NUMBER_OF_BYTE_F32); + var value = ieee754.decodeF32(bytes); + + if (Math.sign(value) * value === Infinity) { + return { + value: Math.sign(value), + inf: true, + nextIndex: ieee754.NUMBER_OF_BYTE_F32 + }; + } + + if (isNaN(value)) { + var sign = bytes[bytes.length - 1] >> 7 ? -1 : 1; + var mantissa = 0; + + for (var i = 0; i < bytes.length - 2; ++i) { + mantissa += bytes[i] * Math.pow(256, i); + } + + mantissa += bytes[bytes.length - 2] % 128 * Math.pow(256, bytes.length - 2); + return { + value: sign * mantissa, + nan: true, + nextIndex: ieee754.NUMBER_OF_BYTE_F32 + }; + } + + return { + value: value, + nextIndex: ieee754.NUMBER_OF_BYTE_F32 + }; + } + + function readUTF8String() { + var lenu32 = readU32(); // Don't eat any bytes. Instead, peek ahead of the current offset using + // readBytesAtOffset below. This keeps readUTF8String neutral with respect + // to the current offset, just like the other readX functions. + + var strlen = lenu32.value; + dump([strlen], "string length"); + var bytes = readBytesAtOffset(offset + lenu32.nextIndex, strlen); + var value = utf8.decode(bytes); + return { + value: value, + nextIndex: strlen + lenu32.nextIndex + }; + } + /** + * Decode an unsigned 32bits integer + * + * The length will be handled by the leb librairy, we pass the max number of + * byte. + */ + + + function readU32() { + var bytes = readBytes(_leb.MAX_NUMBER_OF_BYTE_U32); + var buffer = Buffer.from(bytes); + return (0, _leb.decodeUInt32)(buffer); + } + + function readVaruint32() { + // where 32 bits = max 4 bytes + var bytes = readBytes(4); + var buffer = Buffer.from(bytes); + return (0, _leb.decodeUInt32)(buffer); + } + + function readVaruint7() { + // where 7 bits = max 1 bytes + var bytes = readBytes(1); + var buffer = Buffer.from(bytes); + return (0, _leb.decodeUInt32)(buffer); + } + /** + * Decode a signed 32bits interger + */ + + + function read32() { + var bytes = readBytes(_leb.MAX_NUMBER_OF_BYTE_U32); + var buffer = Buffer.from(bytes); + return (0, _leb.decodeInt32)(buffer); + } + /** + * Decode a signed 64bits integer + */ + + + function read64() { + var bytes = readBytes(_leb.MAX_NUMBER_OF_BYTE_U64); + var buffer = Buffer.from(bytes); + return (0, _leb.decodeInt64)(buffer); + } + + function readU64() { + var bytes = readBytes(_leb.MAX_NUMBER_OF_BYTE_U64); + var buffer = Buffer.from(bytes); + return (0, _leb.decodeUInt64)(buffer); + } + + function readByte() { + return readBytes(1)[0]; + } + + function parseModuleHeader() { + if (isEOF() === true || offset + 4 > buf.length) { + throw new Error("unexpected end"); + } + + var header = readBytes(4); + + if (byteArrayEq(_helperWasmBytecode.default.magicModuleHeader, header) === false) { + throw new _helperApiError.CompileError("magic header not detected"); + } + + dump(header, "wasm magic header"); + eatBytes(4); + } + + function parseVersion() { + if (isEOF() === true || offset + 4 > buf.length) { + throw new Error("unexpected end"); + } + + var version = readBytes(4); + + if (byteArrayEq(_helperWasmBytecode.default.moduleVersion, version) === false) { + throw new _helperApiError.CompileError("unknown binary version"); + } + + dump(version, "wasm version"); + eatBytes(4); + } + + function parseVec(cast) { + var u32 = readU32(); + var length = u32.value; + eatBytes(u32.nextIndex); + dump([length], "number"); + + if (length === 0) { + return []; + } + + var elements = []; + + for (var i = 0; i < length; i++) { + var byte = readByte(); + eatBytes(1); + var value = cast(byte); + dump([byte], value); + + if (typeof value === "undefined") { + throw new _helperApiError.CompileError("Internal failure: parseVec could not cast the value"); + } + + elements.push(value); + } + + return elements; + } // Type section + // https://webassembly.github.io/spec/binary/modules.html#binary-typesec + + + function parseTypeSection(numberOfTypes) { + var typeInstructionNodes = []; + dump([numberOfTypes], "num types"); + + for (var i = 0; i < numberOfTypes; i++) { + var _startLoc = getPosition(); + + dumpSep("type " + i); + var type = readByte(); + eatBytes(1); + + if (type == _helperWasmBytecode.default.types.func) { + dump([type], "func"); + var paramValtypes = parseVec(function (b) { + return _helperWasmBytecode.default.valtypes[b]; + }); + var params = paramValtypes.map(function (v) { + return t.funcParam( + /*valtype*/ + v); + }); + var result = parseVec(function (b) { + return _helperWasmBytecode.default.valtypes[b]; + }); + typeInstructionNodes.push(function () { + var endLoc = getPosition(); + return t.withLoc(t.typeInstruction(undefined, t.signature(params, result)), endLoc, _startLoc); + }()); + state.typesInModule.push({ + params: params, + result: result + }); + } else { + throw new Error("Unsupported type: " + toHex(type)); + } + } + + return typeInstructionNodes; + } // Import section + // https://webassembly.github.io/spec/binary/modules.html#binary-importsec + + + function parseImportSection(numberOfImports) { + var imports = []; + + for (var i = 0; i < numberOfImports; i++) { + dumpSep("import header " + i); + + var _startLoc2 = getPosition(); + /** + * Module name + */ + + + var moduleName = readUTF8String(); + eatBytes(moduleName.nextIndex); + dump([], "module name (".concat(moduleName.value, ")")); + /** + * Name + */ + + var name = readUTF8String(); + eatBytes(name.nextIndex); + dump([], "name (".concat(name.value, ")")); + /** + * Import descr + */ + + var descrTypeByte = readByte(); + eatBytes(1); + var descrType = _helperWasmBytecode.default.importTypes[descrTypeByte]; + dump([descrTypeByte], "import kind"); + + if (typeof descrType === "undefined") { + throw new _helperApiError.CompileError("Unknown import description type: " + toHex(descrTypeByte)); + } + + var importDescr = void 0; + + if (descrType === "func") { + var indexU32 = readU32(); + var typeindex = indexU32.value; + eatBytes(indexU32.nextIndex); + dump([typeindex], "type index"); + var signature = state.typesInModule[typeindex]; + + if (typeof signature === "undefined") { + throw new _helperApiError.CompileError("function signature not found (".concat(typeindex, ")")); + } + + var id = getUniqueName("func"); + importDescr = t.funcImportDescr(id, t.signature(signature.params, signature.result)); + state.functionsInModule.push({ + id: t.identifier(name.value), + signature: signature, + isExternal: true + }); + } else if (descrType === "global") { + importDescr = parseGlobalType(); + var globalNode = t.global(importDescr, []); + state.globalsInModule.push(globalNode); + } else if (descrType === "table") { + importDescr = parseTableType(i); + } else if (descrType === "mem") { + var memoryNode = parseMemoryType(0); + state.memoriesInModule.push(memoryNode); + importDescr = memoryNode; + } else { + throw new _helperApiError.CompileError("Unsupported import of type: " + descrType); + } + + imports.push(function () { + var endLoc = getPosition(); + return t.withLoc(t.moduleImport(moduleName.value, name.value, importDescr), endLoc, _startLoc2); + }()); + } + + return imports; + } // Function section + // https://webassembly.github.io/spec/binary/modules.html#function-section + + + function parseFuncSection(numberOfFunctions) { + dump([numberOfFunctions], "num funcs"); + + for (var i = 0; i < numberOfFunctions; i++) { + var indexU32 = readU32(); + var typeindex = indexU32.value; + eatBytes(indexU32.nextIndex); + dump([typeindex], "type index"); + var signature = state.typesInModule[typeindex]; + + if (typeof signature === "undefined") { + throw new _helperApiError.CompileError("function signature not found (".concat(typeindex, ")")); + } // preserve anonymous, a name might be resolved later + + + var id = t.withRaw(t.identifier(getUniqueName("func")), ""); + state.functionsInModule.push({ + id: id, + signature: signature, + isExternal: false + }); + } + } // Export section + // https://webassembly.github.io/spec/binary/modules.html#export-section + + + function parseExportSection(numberOfExport) { + dump([numberOfExport], "num exports"); // Parse vector of exports + + for (var i = 0; i < numberOfExport; i++) { + var _startLoc3 = getPosition(); + /** + * Name + */ + + + var name = readUTF8String(); + eatBytes(name.nextIndex); + dump([], "export name (".concat(name.value, ")")); + /** + * exportdescr + */ + + var typeIndex = readByte(); + eatBytes(1); + dump([typeIndex], "export kind"); + var indexu32 = readU32(); + var index = indexu32.value; + eatBytes(indexu32.nextIndex); + dump([index], "export index"); + var id = void 0, + signature = void 0; + + if (_helperWasmBytecode.default.exportTypes[typeIndex] === "Func") { + var func = state.functionsInModule[index]; + + if (typeof func === "undefined") { + throw new _helperApiError.CompileError("unknown function (".concat(index, ")")); + } + + id = t.numberLiteralFromRaw(index, String(index)); + signature = func.signature; + } else if (_helperWasmBytecode.default.exportTypes[typeIndex] === "Table") { + var table = state.tablesInModule[index]; + + if (typeof table === "undefined") { + throw new _helperApiError.CompileError("unknown table ".concat(index)); + } + + id = t.numberLiteralFromRaw(index, String(index)); + signature = null; + } else if (_helperWasmBytecode.default.exportTypes[typeIndex] === "Mem") { + var memNode = state.memoriesInModule[index]; + + if (typeof memNode === "undefined") { + throw new _helperApiError.CompileError("unknown memory ".concat(index)); + } + + id = t.numberLiteralFromRaw(index, String(index)); + signature = null; + } else if (_helperWasmBytecode.default.exportTypes[typeIndex] === "Global") { + var global = state.globalsInModule[index]; + + if (typeof global === "undefined") { + throw new _helperApiError.CompileError("unknown global ".concat(index)); + } + + id = t.numberLiteralFromRaw(index, String(index)); + signature = null; + } else { + console.warn("Unsupported export type: " + toHex(typeIndex)); + return; + } + + var endLoc = getPosition(); + state.elementsInExportSection.push({ + name: name.value, + type: _helperWasmBytecode.default.exportTypes[typeIndex], + signature: signature, + id: id, + index: index, + endLoc: endLoc, + startLoc: _startLoc3 + }); + } + } // Code section + // https://webassembly.github.io/spec/binary/modules.html#code-section + + + function parseCodeSection(numberOfFuncs) { + dump([numberOfFuncs], "number functions"); // Parse vector of function + + for (var i = 0; i < numberOfFuncs; i++) { + var _startLoc4 = getPosition(); + + dumpSep("function body " + i); // the u32 size of the function code in bytes + // Ignore it for now + + var bodySizeU32 = readU32(); + eatBytes(bodySizeU32.nextIndex); + dump([bodySizeU32.value], "function body size"); + var code = []; + /** + * Parse locals + */ + + var funcLocalNumU32 = readU32(); + var funcLocalNum = funcLocalNumU32.value; + eatBytes(funcLocalNumU32.nextIndex); + dump([funcLocalNum], "num locals"); + var locals = []; + + for (var _i = 0; _i < funcLocalNum; _i++) { + var _startLoc5 = getPosition(); + + var localCountU32 = readU32(); + var localCount = localCountU32.value; + eatBytes(localCountU32.nextIndex); + dump([localCount], "num local"); + var valtypeByte = readByte(); + eatBytes(1); + var type = _helperWasmBytecode.default.valtypes[valtypeByte]; + var args = []; + + for (var _i2 = 0; _i2 < localCount; _i2++) { + args.push(t.valtypeLiteral(type)); + } + + var localNode = function () { + var endLoc = getPosition(); + return t.withLoc(t.instruction("local", args), endLoc, _startLoc5); + }(); + + locals.push(localNode); + dump([valtypeByte], type); + + if (typeof type === "undefined") { + throw new _helperApiError.CompileError("Unexpected valtype: " + toHex(valtypeByte)); + } + } + + code.push.apply(code, locals); // Decode instructions until the end + + parseInstructionBlock(code); + var endLoc = getPosition(); + state.elementsInCodeSection.push({ + code: code, + locals: locals, + endLoc: endLoc, + startLoc: _startLoc4, + bodySize: bodySizeU32.value + }); + } + } + + function parseInstructionBlock(code) { + while (true) { + var _startLoc6 = getPosition(); + + var instructionAlreadyCreated = false; + var instructionByte = readByte(); + eatBytes(1); + + if (instructionByte === 0xfe) { + throw new _helperApiError.CompileError("Atomic instructions are not implemented"); + } + + var instruction = _helperWasmBytecode.default.symbolsByByte[instructionByte]; + + if (typeof instruction === "undefined") { + throw new _helperApiError.CompileError("Unexpected instruction: " + toHex(instructionByte)); + } + + if (typeof instruction.object === "string") { + dump([instructionByte], "".concat(instruction.object, ".").concat(instruction.name)); + } else { + dump([instructionByte], instruction.name); + } + /** + * End of the function + */ + + + if (instruction.name === "end") { + var node = function () { + var endLoc = getPosition(); + return t.withLoc(t.instruction(instruction.name), endLoc, _startLoc6); + }(); + + code.push(node); + break; + } + + var args = []; + + if (instruction.name === "loop") { + var _startLoc7 = getPosition(); + + var blocktypeByte = readByte(); + eatBytes(1); + var blocktype = _helperWasmBytecode.default.blockTypes[blocktypeByte]; + dump([blocktypeByte], "blocktype"); + + if (typeof blocktype === "undefined") { + throw new _helperApiError.CompileError("Unexpected blocktype: " + toHex(blocktypeByte)); + } + + var instr = []; + parseInstructionBlock(instr); // preserve anonymous + + var label = t.withRaw(t.identifier(getUniqueName("loop")), ""); + + var loopNode = function () { + var endLoc = getPosition(); + return t.withLoc(t.loopInstruction(label, blocktype, instr), endLoc, _startLoc7); + }(); + + code.push(loopNode); + instructionAlreadyCreated = true; + } else if (instruction.name === "if") { + var _startLoc8 = getPosition(); + + var _blocktypeByte = readByte(); + + eatBytes(1); + var _blocktype = _helperWasmBytecode.default.blockTypes[_blocktypeByte]; + dump([_blocktypeByte], "blocktype"); + + if (typeof _blocktype === "undefined") { + throw new _helperApiError.CompileError("Unexpected blocktype: " + toHex(_blocktypeByte)); + } + + var testIndex = t.withRaw(t.identifier(getUniqueName("if")), ""); + var ifBody = []; + parseInstructionBlock(ifBody); // Defaults to no alternate + + var elseIndex = 0; + + for (elseIndex = 0; elseIndex < ifBody.length; ++elseIndex) { + var _instr = ifBody[elseIndex]; + + if (_instr.type === "Instr" && _instr.id === "else") { + break; + } + } + + var consequentInstr = ifBody.slice(0, elseIndex); + var alternate = ifBody.slice(elseIndex + 1); // wast sugar + + var testInstrs = []; + + var ifNode = function () { + var endLoc = getPosition(); + return t.withLoc(t.ifInstruction(testIndex, testInstrs, _blocktype, consequentInstr, alternate), endLoc, _startLoc8); + }(); + + code.push(ifNode); + instructionAlreadyCreated = true; + } else if (instruction.name === "block") { + var _startLoc9 = getPosition(); + + var _blocktypeByte2 = readByte(); + + eatBytes(1); + var _blocktype2 = _helperWasmBytecode.default.blockTypes[_blocktypeByte2]; + dump([_blocktypeByte2], "blocktype"); + + if (typeof _blocktype2 === "undefined") { + throw new _helperApiError.CompileError("Unexpected blocktype: " + toHex(_blocktypeByte2)); + } + + var _instr2 = []; + parseInstructionBlock(_instr2); // preserve anonymous + + var _label = t.withRaw(t.identifier(getUniqueName("block")), ""); + + var blockNode = function () { + var endLoc = getPosition(); + return t.withLoc(t.blockInstruction(_label, _instr2, _blocktype2), endLoc, _startLoc9); + }(); + + code.push(blockNode); + instructionAlreadyCreated = true; + } else if (instruction.name === "call") { + var indexu32 = readU32(); + var index = indexu32.value; + eatBytes(indexu32.nextIndex); + dump([index], "index"); + + var callNode = function () { + var endLoc = getPosition(); + return t.withLoc(t.callInstruction(t.indexLiteral(index)), endLoc, _startLoc6); + }(); + + code.push(callNode); + instructionAlreadyCreated = true; + } else if (instruction.name === "call_indirect") { + var _startLoc10 = getPosition(); + + var indexU32 = readU32(); + var typeindex = indexU32.value; + eatBytes(indexU32.nextIndex); + dump([typeindex], "type index"); + var signature = state.typesInModule[typeindex]; + + if (typeof signature === "undefined") { + throw new _helperApiError.CompileError("call_indirect signature not found (".concat(typeindex, ")")); + } + + var _callNode = t.callIndirectInstruction(t.signature(signature.params, signature.result), []); + + var flagU32 = readU32(); + var flag = flagU32.value; // 0x00 - reserved byte + + eatBytes(flagU32.nextIndex); + + if (flag !== 0) { + throw new _helperApiError.CompileError("zero flag expected"); + } + + code.push(function () { + var endLoc = getPosition(); + return t.withLoc(_callNode, endLoc, _startLoc10); + }()); + instructionAlreadyCreated = true; + } else if (instruction.name === "br_table") { + var indicesu32 = readU32(); + var indices = indicesu32.value; + eatBytes(indicesu32.nextIndex); + dump([indices], "num indices"); + + for (var i = 0; i <= indices; i++) { + var _indexu = readU32(); + + var _index = _indexu.value; + eatBytes(_indexu.nextIndex); + dump([_index], "index"); + args.push(t.numberLiteralFromRaw(_indexu.value.toString(), "u32")); + } + } else if (instructionByte >= 0x28 && instructionByte <= 0x40) { + /** + * Memory instructions + */ + if (instruction.name === "grow_memory" || instruction.name === "current_memory") { + var _indexU = readU32(); + + var _index2 = _indexU.value; + eatBytes(_indexU.nextIndex); + + if (_index2 !== 0) { + throw new Error("zero flag expected"); + } + + dump([_index2], "index"); + } else { + var aligun32 = readU32(); + var align = aligun32.value; + eatBytes(aligun32.nextIndex); + dump([align], "align"); + var offsetu32 = readU32(); + var _offset2 = offsetu32.value; + eatBytes(offsetu32.nextIndex); + dump([_offset2], "offset"); + } + } else if (instructionByte >= 0x41 && instructionByte <= 0x44) { + /** + * Numeric instructions + */ + if (instruction.object === "i32") { + var value32 = read32(); + var value = value32.value; + eatBytes(value32.nextIndex); + dump([value], "i32 value"); + args.push(t.numberLiteralFromRaw(value)); + } + + if (instruction.object === "u32") { + var valueu32 = readU32(); + var _value = valueu32.value; + eatBytes(valueu32.nextIndex); + dump([_value], "u32 value"); + args.push(t.numberLiteralFromRaw(_value)); + } + + if (instruction.object === "i64") { + var value64 = read64(); + var _value2 = value64.value; + eatBytes(value64.nextIndex); + dump([Number(_value2.toString())], "i64 value"); + var high = _value2.high, + low = _value2.low; + var _node = { + type: "LongNumberLiteral", + value: { + high: high, + low: low + } + }; + args.push(_node); + } + + if (instruction.object === "u64") { + var valueu64 = readU64(); + var _value3 = valueu64.value; + eatBytes(valueu64.nextIndex); + dump([Number(_value3.toString())], "u64 value"); + var _high = _value3.high, + _low = _value3.low; + var _node2 = { + type: "LongNumberLiteral", + value: { + high: _high, + low: _low + } + }; + args.push(_node2); + } + + if (instruction.object === "f32") { + var valuef32 = readF32(); + var _value4 = valuef32.value; + eatBytes(valuef32.nextIndex); + dump([_value4], "f32 value"); + args.push( // $FlowIgnore + t.floatLiteral(_value4, valuef32.nan, valuef32.inf, String(_value4))); + } + + if (instruction.object === "f64") { + var valuef64 = readF64(); + var _value5 = valuef64.value; + eatBytes(valuef64.nextIndex); + dump([_value5], "f64 value"); + args.push( // $FlowIgnore + t.floatLiteral(_value5, valuef64.nan, valuef64.inf, String(_value5))); + } + } else { + for (var _i3 = 0; _i3 < instruction.numberOfArgs; _i3++) { + var u32 = readU32(); + eatBytes(u32.nextIndex); + dump([u32.value], "argument " + _i3); + args.push(t.numberLiteralFromRaw(u32.value)); + } + } + + if (instructionAlreadyCreated === false) { + if (typeof instruction.object === "string") { + var _node3 = function () { + var endLoc = getPosition(); + return t.withLoc(t.objectInstruction(instruction.name, instruction.object, args), endLoc, _startLoc6); + }(); + + code.push(_node3); + } else { + var _node4 = function () { + var endLoc = getPosition(); + return t.withLoc(t.instruction(instruction.name, args), endLoc, _startLoc6); + }(); + + code.push(_node4); + } + } + } + } // https://webassembly.github.io/spec/core/binary/types.html#limits + + + function parseLimits() { + var limitType = readByte(); + eatBytes(1); + dump([limitType], "limit type"); + var min, max; + + if (limitType === 0x01 || limitType === 0x03 // shared limits + ) { + var u32min = readU32(); + min = parseInt(u32min.value); + eatBytes(u32min.nextIndex); + dump([min], "min"); + var u32max = readU32(); + max = parseInt(u32max.value); + eatBytes(u32max.nextIndex); + dump([max], "max"); + } + + if (limitType === 0x00) { + var _u32min = readU32(); + + min = parseInt(_u32min.value); + eatBytes(_u32min.nextIndex); + dump([min], "min"); + } + + return t.limit(min, max); + } // https://webassembly.github.io/spec/core/binary/types.html#binary-tabletype + + + function parseTableType(index) { + var name = t.withRaw(t.identifier(getUniqueName("table")), String(index)); + var elementTypeByte = readByte(); + eatBytes(1); + dump([elementTypeByte], "element type"); + var elementType = _helperWasmBytecode.default.tableTypes[elementTypeByte]; + + if (typeof elementType === "undefined") { + throw new _helperApiError.CompileError("Unknown element type in table: " + toHex(elementType)); + } + + var limits = parseLimits(); + return t.table(elementType, limits, name); + } // https://webassembly.github.io/spec/binary/types.html#global-types + + + function parseGlobalType() { + var valtypeByte = readByte(); + eatBytes(1); + var type = _helperWasmBytecode.default.valtypes[valtypeByte]; + dump([valtypeByte], type); + + if (typeof type === "undefined") { + throw new _helperApiError.CompileError("Unknown valtype: " + toHex(valtypeByte)); + } + + var globalTypeByte = readByte(); + eatBytes(1); + var globalType = _helperWasmBytecode.default.globalTypes[globalTypeByte]; + dump([globalTypeByte], "global type (".concat(globalType, ")")); + + if (typeof globalType === "undefined") { + throw new _helperApiError.CompileError("Invalid mutability: " + toHex(globalTypeByte)); + } + + return t.globalType(type, globalType); + } // function parseNameModule() { + // const lenu32 = readVaruint32(); + // eatBytes(lenu32.nextIndex); + // console.log("len", lenu32); + // const strlen = lenu32.value; + // dump([strlen], "string length"); + // const bytes = readBytes(strlen); + // eatBytes(strlen); + // const value = utf8.decode(bytes); + // return [t.moduleNameMetadata(value)]; + // } + // this section contains an array of function names and indices + + + function parseNameSectionFunctions() { + var functionNames = []; + var numberOfFunctionsu32 = readU32(); + var numbeOfFunctions = numberOfFunctionsu32.value; + eatBytes(numberOfFunctionsu32.nextIndex); + + for (var i = 0; i < numbeOfFunctions; i++) { + var indexu32 = readU32(); + var index = indexu32.value; + eatBytes(indexu32.nextIndex); + var name = readUTF8String(); + eatBytes(name.nextIndex); + functionNames.push(t.functionNameMetadata(name.value, index)); + } + + return functionNames; + } + + function parseNameSectionLocals() { + var localNames = []; + var numbeOfFunctionsu32 = readU32(); + var numbeOfFunctions = numbeOfFunctionsu32.value; + eatBytes(numbeOfFunctionsu32.nextIndex); + + for (var i = 0; i < numbeOfFunctions; i++) { + var functionIndexu32 = readU32(); + var functionIndex = functionIndexu32.value; + eatBytes(functionIndexu32.nextIndex); + var numLocalsu32 = readU32(); + var numLocals = numLocalsu32.value; + eatBytes(numLocalsu32.nextIndex); + + for (var _i4 = 0; _i4 < numLocals; _i4++) { + var localIndexu32 = readU32(); + var localIndex = localIndexu32.value; + eatBytes(localIndexu32.nextIndex); + var name = readUTF8String(); + eatBytes(name.nextIndex); + localNames.push(t.localNameMetadata(name.value, localIndex, functionIndex)); + } + } + + return localNames; + } // this is a custom section used for name resolution + // https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#name-section + + + function parseNameSection(remainingBytes) { + var nameMetadata = []; + var initialOffset = offset; + + while (offset - initialOffset < remainingBytes) { + // name_type + var sectionTypeByte = readVaruint7(); + eatBytes(sectionTypeByte.nextIndex); // name_payload_len + + var subSectionSizeInBytesu32 = readVaruint32(); + eatBytes(subSectionSizeInBytesu32.nextIndex); + + switch (sectionTypeByte.value) { + // case 0: { + // TODO(sven): re-enable that + // Current status: it seems that when we decode the module's name + // no name_payload_len is used. + // + // See https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#name-section + // + // nameMetadata.push(...parseNameModule()); + // break; + // } + case 1: + { + nameMetadata.push.apply(nameMetadata, _toConsumableArray(parseNameSectionFunctions())); + break; + } + + case 2: + { + nameMetadata.push.apply(nameMetadata, _toConsumableArray(parseNameSectionLocals())); + break; + } + + default: + { + // skip unknown subsection + eatBytes(subSectionSizeInBytesu32.value); + } + } + } + + return nameMetadata; + } // this is a custom setion used for information about the producers + // https://github.com/WebAssembly/tool-conventions/blob/master/ProducersSection.md + + + function parseProducersSection() { + var metadata = t.producersSectionMetadata([]); // field_count + + var sectionTypeByte = readVaruint32(); + eatBytes(sectionTypeByte.nextIndex); + dump([sectionTypeByte.value], "num of producers"); + var fields = { + language: [], + "processed-by": [], + sdk: [] + }; // fields + + for (var fieldI = 0; fieldI < sectionTypeByte.value; fieldI++) { + // field_name + var fieldName = readUTF8String(); + eatBytes(fieldName.nextIndex); // field_value_count + + var valueCount = readVaruint32(); + eatBytes(valueCount.nextIndex); // field_values + + for (var producerI = 0; producerI < valueCount.value; producerI++) { + var producerName = readUTF8String(); + eatBytes(producerName.nextIndex); + var producerVersion = readUTF8String(); + eatBytes(producerVersion.nextIndex); + fields[fieldName.value].push(t.producerMetadataVersionedName(producerName.value, producerVersion.value)); + } + + metadata.producers.push(fields[fieldName.value]); + } + + return metadata; + } + + function parseGlobalSection(numberOfGlobals) { + var globals = []; + dump([numberOfGlobals], "num globals"); + + for (var i = 0; i < numberOfGlobals; i++) { + var _startLoc11 = getPosition(); + + var globalType = parseGlobalType(); + /** + * Global expressions + */ + + var init = []; + parseInstructionBlock(init); + + var node = function () { + var endLoc = getPosition(); + return t.withLoc(t.global(globalType, init), endLoc, _startLoc11); + }(); + + globals.push(node); + state.globalsInModule.push(node); + } + + return globals; + } + + function parseElemSection(numberOfElements) { + var elems = []; + dump([numberOfElements], "num elements"); + + for (var i = 0; i < numberOfElements; i++) { + var _startLoc12 = getPosition(); + + var tableindexu32 = readU32(); + var tableindex = tableindexu32.value; + eatBytes(tableindexu32.nextIndex); + dump([tableindex], "table index"); + /** + * Parse instructions + */ + + var instr = []; + parseInstructionBlock(instr); + /** + * Parse ( vector function index ) * + */ + + var indicesu32 = readU32(); + var indices = indicesu32.value; + eatBytes(indicesu32.nextIndex); + dump([indices], "num indices"); + var indexValues = []; + + for (var _i5 = 0; _i5 < indices; _i5++) { + var indexu32 = readU32(); + var index = indexu32.value; + eatBytes(indexu32.nextIndex); + dump([index], "index"); + indexValues.push(t.indexLiteral(index)); + } + + var elemNode = function () { + var endLoc = getPosition(); + return t.withLoc(t.elem(t.indexLiteral(tableindex), instr, indexValues), endLoc, _startLoc12); + }(); + + elems.push(elemNode); + } + + return elems; + } // https://webassembly.github.io/spec/core/binary/types.html#memory-types + + + function parseMemoryType(i) { + var limits = parseLimits(); + return t.memory(limits, t.indexLiteral(i)); + } // https://webassembly.github.io/spec/binary/modules.html#table-section + + + function parseTableSection(numberOfElements) { + var tables = []; + dump([numberOfElements], "num elements"); + + for (var i = 0; i < numberOfElements; i++) { + var tablesNode = parseTableType(i); + state.tablesInModule.push(tablesNode); + tables.push(tablesNode); + } + + return tables; + } // https://webassembly.github.io/spec/binary/modules.html#memory-section + + + function parseMemorySection(numberOfElements) { + var memories = []; + dump([numberOfElements], "num elements"); + + for (var i = 0; i < numberOfElements; i++) { + var memoryNode = parseMemoryType(i); + state.memoriesInModule.push(memoryNode); + memories.push(memoryNode); + } + + return memories; + } // https://webassembly.github.io/spec/binary/modules.html#binary-startsec + + + function parseStartSection() { + var startLoc = getPosition(); + var u32 = readU32(); + var startFuncIndex = u32.value; + eatBytes(u32.nextIndex); + dump([startFuncIndex], "index"); + return function () { + var endLoc = getPosition(); + return t.withLoc(t.start(t.indexLiteral(startFuncIndex)), endLoc, startLoc); + }(); + } // https://webassembly.github.io/spec/binary/modules.html#data-section + + + function parseDataSection(numberOfElements) { + var dataEntries = []; + dump([numberOfElements], "num elements"); + + for (var i = 0; i < numberOfElements; i++) { + var memoryIndexu32 = readU32(); + var memoryIndex = memoryIndexu32.value; + eatBytes(memoryIndexu32.nextIndex); + dump([memoryIndex], "memory index"); + var instrs = []; + parseInstructionBlock(instrs); + var hasExtraInstrs = instrs.filter(function (i) { + return i.id !== "end"; + }).length !== 1; + + if (hasExtraInstrs) { + throw new _helperApiError.CompileError("data section offset must be a single instruction"); + } + + var bytes = parseVec(function (b) { + return b; + }); + dump([], "init"); + dataEntries.push(t.data(t.memIndexLiteral(memoryIndex), instrs[0], t.byteArray(bytes))); + } + + return dataEntries; + } // https://webassembly.github.io/spec/binary/modules.html#binary-section + + + function parseSection(sectionIndex) { + var sectionId = readByte(); + eatBytes(1); + + if (sectionId >= sectionIndex || sectionIndex === _helperWasmBytecode.default.sections.custom) { + sectionIndex = sectionId + 1; + } else { + if (sectionId !== _helperWasmBytecode.default.sections.custom) throw new _helperApiError.CompileError("Unexpected section: " + toHex(sectionId)); + } + + var nextSectionIndex = sectionIndex; + var startOffset = offset; + var startLoc = getPosition(); + var u32 = readU32(); + var sectionSizeInBytes = u32.value; + eatBytes(u32.nextIndex); + + var sectionSizeInBytesNode = function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(sectionSizeInBytes), endLoc, startLoc); + }(); + + switch (sectionId) { + case _helperWasmBytecode.default.sections.type: + { + dumpSep("section Type"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc13 = getPosition(); + + var _u = readU32(); + + var numberOfTypes = _u.value; + eatBytes(_u.nextIndex); + + var _metadata = t.sectionMetadata("type", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfTypes), endLoc, _startLoc13); + }()); + + var _nodes = parseTypeSection(numberOfTypes); + + return { + nodes: _nodes, + metadata: _metadata, + nextSectionIndex: nextSectionIndex + }; + } + + case _helperWasmBytecode.default.sections.table: + { + dumpSep("section Table"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc14 = getPosition(); + + var _u2 = readU32(); + + var numberOfTable = _u2.value; + eatBytes(_u2.nextIndex); + dump([numberOfTable], "num tables"); + + var _metadata2 = t.sectionMetadata("table", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfTable), endLoc, _startLoc14); + }()); + + var _nodes2 = parseTableSection(numberOfTable); + + return { + nodes: _nodes2, + metadata: _metadata2, + nextSectionIndex: nextSectionIndex + }; + } + + case _helperWasmBytecode.default.sections.import: + { + dumpSep("section Import"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc15 = getPosition(); + + var numberOfImportsu32 = readU32(); + var numberOfImports = numberOfImportsu32.value; + eatBytes(numberOfImportsu32.nextIndex); + dump([numberOfImports], "number of imports"); + + var _metadata3 = t.sectionMetadata("import", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfImports), endLoc, _startLoc15); + }()); + + var _nodes3 = parseImportSection(numberOfImports); + + return { + nodes: _nodes3, + metadata: _metadata3, + nextSectionIndex: nextSectionIndex + }; + } + + case _helperWasmBytecode.default.sections.func: + { + dumpSep("section Function"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc16 = getPosition(); + + var numberOfFunctionsu32 = readU32(); + var numberOfFunctions = numberOfFunctionsu32.value; + eatBytes(numberOfFunctionsu32.nextIndex); + + var _metadata4 = t.sectionMetadata("func", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfFunctions), endLoc, _startLoc16); + }()); + + parseFuncSection(numberOfFunctions); + var _nodes4 = []; + return { + nodes: _nodes4, + metadata: _metadata4, + nextSectionIndex: nextSectionIndex + }; + } + + case _helperWasmBytecode.default.sections.export: + { + dumpSep("section Export"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc17 = getPosition(); + + var _u3 = readU32(); + + var numberOfExport = _u3.value; + eatBytes(_u3.nextIndex); + + var _metadata5 = t.sectionMetadata("export", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfExport), endLoc, _startLoc17); + }()); + + parseExportSection(numberOfExport); + var _nodes5 = []; + return { + nodes: _nodes5, + metadata: _metadata5, + nextSectionIndex: nextSectionIndex + }; + } + + case _helperWasmBytecode.default.sections.code: + { + dumpSep("section Code"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc18 = getPosition(); + + var _u4 = readU32(); + + var numberOfFuncs = _u4.value; + eatBytes(_u4.nextIndex); + + var _metadata6 = t.sectionMetadata("code", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfFuncs), endLoc, _startLoc18); + }()); + + if (opts.ignoreCodeSection === true) { + var remainingBytes = sectionSizeInBytes - _u4.nextIndex; + eatBytes(remainingBytes); // eat the entire section + } else { + parseCodeSection(numberOfFuncs); + } + + var _nodes6 = []; + return { + nodes: _nodes6, + metadata: _metadata6, + nextSectionIndex: nextSectionIndex + }; + } + + case _helperWasmBytecode.default.sections.start: + { + dumpSep("section Start"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _metadata7 = t.sectionMetadata("start", startOffset, sectionSizeInBytesNode); + + var _nodes7 = [parseStartSection()]; + return { + nodes: _nodes7, + metadata: _metadata7, + nextSectionIndex: nextSectionIndex + }; + } + + case _helperWasmBytecode.default.sections.element: + { + dumpSep("section Element"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc19 = getPosition(); + + var numberOfElementsu32 = readU32(); + var numberOfElements = numberOfElementsu32.value; + eatBytes(numberOfElementsu32.nextIndex); + + var _metadata8 = t.sectionMetadata("element", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfElements), endLoc, _startLoc19); + }()); + + var _nodes8 = parseElemSection(numberOfElements); + + return { + nodes: _nodes8, + metadata: _metadata8, + nextSectionIndex: nextSectionIndex + }; + } + + case _helperWasmBytecode.default.sections.global: + { + dumpSep("section Global"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc20 = getPosition(); + + var numberOfGlobalsu32 = readU32(); + var numberOfGlobals = numberOfGlobalsu32.value; + eatBytes(numberOfGlobalsu32.nextIndex); + + var _metadata9 = t.sectionMetadata("global", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(numberOfGlobals), endLoc, _startLoc20); + }()); + + var _nodes9 = parseGlobalSection(numberOfGlobals); + + return { + nodes: _nodes9, + metadata: _metadata9, + nextSectionIndex: nextSectionIndex + }; + } + + case _helperWasmBytecode.default.sections.memory: + { + dumpSep("section Memory"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _startLoc21 = getPosition(); + + var _numberOfElementsu = readU32(); + + var _numberOfElements = _numberOfElementsu.value; + eatBytes(_numberOfElementsu.nextIndex); + + var _metadata10 = t.sectionMetadata("memory", startOffset, sectionSizeInBytesNode, function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(_numberOfElements), endLoc, _startLoc21); + }()); + + var _nodes10 = parseMemorySection(_numberOfElements); + + return { + nodes: _nodes10, + metadata: _metadata10, + nextSectionIndex: nextSectionIndex + }; + } + + case _helperWasmBytecode.default.sections.data: + { + dumpSep("section Data"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + + var _metadata11 = t.sectionMetadata("data", startOffset, sectionSizeInBytesNode); + + var _startLoc22 = getPosition(); + + var _numberOfElementsu2 = readU32(); + + var _numberOfElements2 = _numberOfElementsu2.value; + eatBytes(_numberOfElementsu2.nextIndex); + + _metadata11.vectorOfSize = function () { + var endLoc = getPosition(); + return t.withLoc(t.numberLiteralFromRaw(_numberOfElements2), endLoc, _startLoc22); + }(); + + if (opts.ignoreDataSection === true) { + var _remainingBytes = sectionSizeInBytes - _numberOfElementsu2.nextIndex; + + eatBytes(_remainingBytes); // eat the entire section + + dumpSep("ignore data (" + sectionSizeInBytes + " bytes)"); + return { + nodes: [], + metadata: _metadata11, + nextSectionIndex: nextSectionIndex + }; + } else { + var _nodes11 = parseDataSection(_numberOfElements2); + + return { + nodes: _nodes11, + metadata: _metadata11, + nextSectionIndex: nextSectionIndex + }; + } + } + + case _helperWasmBytecode.default.sections.custom: + { + dumpSep("section Custom"); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + var _metadata12 = [t.sectionMetadata("custom", startOffset, sectionSizeInBytesNode)]; + var sectionName = readUTF8String(); + eatBytes(sectionName.nextIndex); + dump([], "section name (".concat(sectionName.value, ")")); + + var _remainingBytes2 = sectionSizeInBytes - sectionName.nextIndex; + + if (sectionName.value === "name") { + var initialOffset = offset; + + try { + _metadata12.push.apply(_metadata12, _toConsumableArray(parseNameSection(_remainingBytes2))); + } catch (e) { + console.warn("Failed to decode custom \"name\" section @".concat(offset, "; ignoring (").concat(e.message, ").")); + eatBytes(offset - (initialOffset + _remainingBytes2)); + } + } else if (sectionName.value === "producers") { + var _initialOffset = offset; + + try { + _metadata12.push(parseProducersSection()); + } catch (e) { + console.warn("Failed to decode custom \"producers\" section @".concat(offset, "; ignoring (").concat(e.message, ").")); + eatBytes(offset - (_initialOffset + _remainingBytes2)); + } + } else { + // We don't parse the custom section + eatBytes(_remainingBytes2); + dumpSep("ignore custom " + JSON.stringify(sectionName.value) + " section (" + _remainingBytes2 + " bytes)"); + } + + return { + nodes: [], + metadata: _metadata12, + nextSectionIndex: nextSectionIndex + }; + } + } + + throw new _helperApiError.CompileError("Unexpected section: " + toHex(sectionId)); + } + + parseModuleHeader(); + parseVersion(); + var moduleFields = []; + var sectionIndex = 0; + var moduleMetadata = { + sections: [], + functionNames: [], + localNames: [], + producers: [] + }; + /** + * All the generate declaration are going to be stored in our state + */ + + while (offset < buf.length) { + var _parseSection = parseSection(sectionIndex), + _nodes12 = _parseSection.nodes, + _metadata13 = _parseSection.metadata, + nextSectionIndex = _parseSection.nextSectionIndex; + + moduleFields.push.apply(moduleFields, _toConsumableArray(_nodes12)); + var metadataArray = Array.isArray(_metadata13) ? _metadata13 : [_metadata13]; + metadataArray.forEach(function (metadataItem) { + if (metadataItem.type === "FunctionNameMetadata") { + moduleMetadata.functionNames.push(metadataItem); + } else if (metadataItem.type === "LocalNameMetadata") { + moduleMetadata.localNames.push(metadataItem); + } else if (metadataItem.type === "ProducersSectionMetadata") { + moduleMetadata.producers.push(metadataItem); + } else { + moduleMetadata.sections.push(metadataItem); + } + }); // Ignore custom section + + if (nextSectionIndex) { + sectionIndex = nextSectionIndex; + } + } + /** + * Transform the state into AST nodes + */ + + + var funcIndex = 0; + state.functionsInModule.forEach(function (func) { + var params = func.signature.params; + var result = func.signature.result; + var body = []; // External functions doesn't provide any code, can skip it here + + if (func.isExternal === true) { + return; + } + + var decodedElementInCodeSection = state.elementsInCodeSection[funcIndex]; + + if (opts.ignoreCodeSection === false) { + if (typeof decodedElementInCodeSection === "undefined") { + throw new _helperApiError.CompileError("func " + toHex(funcIndex) + " code not found"); + } + + body = decodedElementInCodeSection.code; + } + + funcIndex++; + var funcNode = t.func(func.id, t.signature(params, result), body); + + if (func.isExternal === true) { + funcNode.isExternal = func.isExternal; + } // Add function position in the binary if possible + + + if (opts.ignoreCodeSection === false) { + var _startLoc23 = decodedElementInCodeSection.startLoc, + endLoc = decodedElementInCodeSection.endLoc, + bodySize = decodedElementInCodeSection.bodySize; + funcNode = t.withLoc(funcNode, endLoc, _startLoc23); + funcNode.metadata = { + bodySize: bodySize + }; + } + + moduleFields.push(funcNode); + }); + state.elementsInExportSection.forEach(function (moduleExport) { + /** + * If the export has no id, we won't be able to call it from the outside + * so we can omit it + */ + if (moduleExport.id != null) { + moduleFields.push(t.withLoc(t.moduleExport(moduleExport.name, t.moduleExportDescr(moduleExport.type, moduleExport.id)), moduleExport.endLoc, moduleExport.startLoc)); + } + }); + dumpSep("end of program"); + var module = t.module(null, moduleFields, t.moduleMetadata(moduleMetadata.sections, moduleMetadata.functionNames, moduleMetadata.localNames, moduleMetadata.producers)); + return t.program([module]); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-parser/lib/index.js b/node_modules/@webassemblyjs/wasm-parser/lib/index.js new file mode 100644 index 0000000..abd442a --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-parser/lib/index.js @@ -0,0 +1,257 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.decode = decode; + +var decoder = _interopRequireWildcard(require("./decoder")); + +var t = _interopRequireWildcard(require("@webassemblyjs/ast")); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + +/** + * TODO(sven): I added initial props, but we should rather fix + * https://github.com/xtuc/webassemblyjs/issues/405 + */ +var defaultDecoderOpts = { + dump: false, + ignoreCodeSection: false, + ignoreDataSection: false, + ignoreCustomNameSection: false +}; // traverses the AST, locating function name metadata, which is then +// used to update index-based identifiers with function names + +function restoreFunctionNames(ast) { + var functionNames = []; + t.traverse(ast, { + FunctionNameMetadata: function FunctionNameMetadata(_ref) { + var node = _ref.node; + functionNames.push({ + name: node.value, + index: node.index + }); + } + }); + + if (functionNames.length === 0) { + return; + } + + t.traverse(ast, { + Func: function (_Func) { + function Func(_x) { + return _Func.apply(this, arguments); + } + + Func.toString = function () { + return _Func.toString(); + }; + + return Func; + }(function (_ref2) { + var node = _ref2.node; + // $FlowIgnore + var nodeName = node.name; + var indexBasedFunctionName = nodeName.value; + var index = Number(indexBasedFunctionName.replace("func_", "")); + var functionName = functionNames.find(function (f) { + return f.index === index; + }); + + if (functionName) { + var oldValue = nodeName.value; + nodeName.value = functionName.name; + nodeName.numeric = oldValue; // $FlowIgnore + + delete nodeName.raw; + } + }), + // Also update the reference in the export + ModuleExport: function (_ModuleExport) { + function ModuleExport(_x2) { + return _ModuleExport.apply(this, arguments); + } + + ModuleExport.toString = function () { + return _ModuleExport.toString(); + }; + + return ModuleExport; + }(function (_ref3) { + var node = _ref3.node; + + if (node.descr.exportType === "Func") { + // $FlowIgnore + var nodeName = node.descr.id; + var index = nodeName.value; + var functionName = functionNames.find(function (f) { + return f.index === index; + }); + + if (functionName) { + node.descr.id = t.identifier(functionName.name); + } + } + }), + ModuleImport: function (_ModuleImport) { + function ModuleImport(_x3) { + return _ModuleImport.apply(this, arguments); + } + + ModuleImport.toString = function () { + return _ModuleImport.toString(); + }; + + return ModuleImport; + }(function (_ref4) { + var node = _ref4.node; + + if (node.descr.type === "FuncImportDescr") { + // $FlowIgnore + var indexBasedFunctionName = node.descr.id; + var index = Number(indexBasedFunctionName.replace("func_", "")); + var functionName = functionNames.find(function (f) { + return f.index === index; + }); + + if (functionName) { + // $FlowIgnore + node.descr.id = t.identifier(functionName.name); + } + } + }), + CallInstruction: function (_CallInstruction) { + function CallInstruction(_x4) { + return _CallInstruction.apply(this, arguments); + } + + CallInstruction.toString = function () { + return _CallInstruction.toString(); + }; + + return CallInstruction; + }(function (nodePath) { + var node = nodePath.node; + var index = node.index.value; + var functionName = functionNames.find(function (f) { + return f.index === index; + }); + + if (functionName) { + var oldValue = node.index; + node.index = t.identifier(functionName.name); + node.numeric = oldValue; // $FlowIgnore + + delete node.raw; + } + }) + }); +} + +function restoreLocalNames(ast) { + var localNames = []; + t.traverse(ast, { + LocalNameMetadata: function LocalNameMetadata(_ref5) { + var node = _ref5.node; + localNames.push({ + name: node.value, + localIndex: node.localIndex, + functionIndex: node.functionIndex + }); + } + }); + + if (localNames.length === 0) { + return; + } + + t.traverse(ast, { + Func: function (_Func2) { + function Func(_x5) { + return _Func2.apply(this, arguments); + } + + Func.toString = function () { + return _Func2.toString(); + }; + + return Func; + }(function (_ref6) { + var node = _ref6.node; + var signature = node.signature; + + if (signature.type !== "Signature") { + return; + } // $FlowIgnore + + + var nodeName = node.name; + var indexBasedFunctionName = nodeName.value; + var functionIndex = Number(indexBasedFunctionName.replace("func_", "")); + signature.params.forEach(function (param, paramIndex) { + var paramName = localNames.find(function (f) { + return f.localIndex === paramIndex && f.functionIndex === functionIndex; + }); + + if (paramName && paramName.name !== "") { + param.id = paramName.name; + } + }); + }) + }); +} + +function restoreModuleName(ast) { + t.traverse(ast, { + ModuleNameMetadata: function (_ModuleNameMetadata) { + function ModuleNameMetadata(_x6) { + return _ModuleNameMetadata.apply(this, arguments); + } + + ModuleNameMetadata.toString = function () { + return _ModuleNameMetadata.toString(); + }; + + return ModuleNameMetadata; + }(function (moduleNameMetadataPath) { + // update module + t.traverse(ast, { + Module: function (_Module) { + function Module(_x7) { + return _Module.apply(this, arguments); + } + + Module.toString = function () { + return _Module.toString(); + }; + + return Module; + }(function (_ref7) { + var node = _ref7.node; + var name = moduleNameMetadataPath.node.value; // compatiblity with wast-parser + + if (name === "") { + name = null; + } + + node.id = name; + }) + }); + }) + }); +} + +function decode(buf, customOpts) { + var opts = Object.assign({}, defaultDecoderOpts, customOpts); + var ast = decoder.decode(buf, opts); + + if (opts.ignoreCustomNameSection === false) { + restoreFunctionNames(ast); + restoreLocalNames(ast); + restoreModuleName(ast); + } + + return ast; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-parser/lib/types/decoder.js b/node_modules/@webassemblyjs/wasm-parser/lib/types/decoder.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/@webassemblyjs/wasm-parser/package.json b/node_modules/@webassemblyjs/wasm-parser/package.json new file mode 100644 index 0000000..e9f7f39 --- /dev/null +++ b/node_modules/@webassemblyjs/wasm-parser/package.json @@ -0,0 +1,77 @@ +{ + "_from": "@webassemblyjs/wasm-parser@1.8.5", + "_id": "@webassemblyjs/wasm-parser@1.8.5", + "_inBundle": false, + "_integrity": "sha512-pi0SYE9T6tfcMkthwcgCpL0cM9nRYr6/6fjgDtL6q/ZqKHdMWvxitRi5JcZ7RI4SNJJYnYNaWy5UUrHQy998lw==", + "_location": "/@webassemblyjs/wasm-parser", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/wasm-parser@1.8.5", + "name": "@webassemblyjs/wasm-parser", + "escapedName": "@webassemblyjs%2fwasm-parser", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/wasm-edit", + "/@webassemblyjs/wasm-opt", + "/webpack" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.8.5.tgz", + "_shasum": "21576f0ec88b91427357b8536383668ef7c66b8d", + "_spec": "@webassemblyjs/wasm-parser@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/webpack", + "author": { + "name": "Sven Sauleau" + }, + "bugs": { + "url": "https://github.com/xtuc/webassemblyjs/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-api-error": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/ieee754": "1.8.5", + "@webassemblyjs/leb128": "1.8.5", + "@webassemblyjs/utf8": "1.8.5" + }, + "deprecated": false, + "description": "WebAssembly binary format parser", + "devDependencies": { + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/helper-test-framework": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5", + "@webassemblyjs/wast-parser": "1.8.5", + "mamacro": "^0.0.3", + "wabt": "1.0.0-nightly.20180421" + }, + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "homepage": "https://github.com/xtuc/webassemblyjs#readme", + "keywords": [ + "webassembly", + "javascript", + "ast", + "parser", + "wasm" + ], + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/wasm-parser", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/xtuc/webassemblyjs.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/wasm-parser/webassemblyjs-wasm-parser-1.7.10.tgz b/node_modules/@webassemblyjs/wasm-parser/webassemblyjs-wasm-parser-1.7.10.tgz new file mode 100644 index 0000000000000000000000000000000000000000..0149f2323a6c71d3f565ab1f101c58cb6fa650ac GIT binary patch literal 21780 zcmcH9W3Mn;5GCki+qP}nwr$%!@3C#$wr$(CZO`rQnGC@@I4}KH`!2f)} zH$C3Y*qpZ%o&HzK4lQrlDM+HJrW>>CNgJ+6=A&n1Zd4KGZc|x{t;MN35yh)+ZHMpd zV|zbH`_Lv$_>a_0u0@cd(l zY8#^2{ZViFgP`8{4$%Wr`{|-b4hcq}_OW~{rs%1Jbry`VLV?=_ZUmJ?!81cT!A+*= zJdmjiNeq%A$d@Sn2{^i@2OPP}nG*xjH5rOgmfa`}TBdMYkNe_C7OeN3d13bjeGoH0ni~$$H)4=u79@ z%ZSlqhEPWY0HdY-B;SvXvkH=xv1&_}8s0Gf(sE^x>8x}#`1Y)h-JmB4?mf?;%F!8= z6LW%kV8jxUy?1t#L|yz6W@iWtK(aZPquwvQ_nc|cf zpf!>kqZlB?)vtLV(KIMfB%X>ytPe96uX!%P{W(bS`@+3d_4J(3?hxwNvI{>6Ci zz`|wdI#G39zIy%(KP~81G2@K8BS_#h>nvRX%=pbN|6~d zSc^b|-7QnQO_arYq%;IuACh1J$HGOS9c@?v*(%hTFYqL?3OJHTZ0<{_Q{DkKHx0F; zBFY}vhwmgZ%ZAAk3Gix}ej7$MK`XQZ|Ez~2r-n9Z1{v=sK@at2t`fqq_(ForkVGhX zIC&z@-QL#Ifj*RM=H;SULuML#MB;zTs?DZn!5Ts ziSOa}d^u zZ~S{Ze>V-o{XM$r8hX3inCKc^$ZD&LgZpSIIzq3L*T=*Co6dc58Y9oHh~uz!F2|AK{kIh~@b>XX$mef367?%~M6TAdZO8Kai0;oPu^AAoXkM2L_Akw0ms_$|mytwL;KmfL+fH zj(EB)?4AkmGd=zL^ZUk#7bs{tC#E0kd!YZ)IZR^E4*1-!+czKgOc$OkE2PawsV4+* z*kQ0b66Mi%a^wN|(@1z6|5$ic{SentWw-!%N>kls?1JFv_`W~?Z46-MC-DGy)BSO8 z9&i1WQqP&xw}<;>=NO@B|8M;9f7MZyMMA9c$VUC&snU5n=KmU5XZZ5 zJ-&D3(V9vBN+PvjEUdW0&d1p5F?M>vNlNtG6qR(!EGJ2#rL9I04j!WmhP=CY+SmB) zFAF@Pz6P)|3_ zFul%`J!TNZ19 z1ouHbLhJ_mJ(Dos+Z)N+n%NU*$-77Eae0S6xHja=7bTwUsC&$RWK8d-8CYnaFIIqr zToOiJrvpmrx+y;=pifnkgUmMDKKGHFP>C6asY}tvV;1GpKmtRiaZA80Sih?9&wU-p zydsIRS4~0?s~vK%A=ftat<4kyoshSmh8Fj1|oJ0@B5 z$@j^9Chl)#Heb{m7MY2rL1t%>=8}sIjDDT%@=N-^{kc@=H(~-gCf4jwi?$EEF3fra zm4k+E;gp_O)RD)dEnOg*taV~;{G0%}$8%nAVFA$Zzd2yB#iJdp+d#aAxNA7Pl{mMy z_Q@Yn^uocJvXU86Fn;_rWDDfWJ?OKV^%`X3Z_M*E>bkb~X*Kn>an4K53SwrJ1?CMw zcT5jT!k&r47q=CHjk##B0&BCzgS@0Uno{%kE*mOrt^C$fO{G6mdrA1AZ|z7LItjE~ z76lGr@hYY!2|}W|wad=lG~Ia@FQ|*#HU=!Hwt2Cqpw|Ae(mWXd(>5`!`qNc=Y+UsJ z3`0&04Cur*Oc;j_K6xIhDsx&9Hw|4fYFSAWa)ttGnPX#HpYnKEgE4d87DX`;zB7hc zePe>*Z`u#^SMQQLQcZL?Qj-0wN?s$bPLKHx9v3^H>Ah}*uLpePgh{Jd658ETO?5~D zbAvKOcbt&L4w1X<*kE;AFH?o$j?4>5qC5Q~34g&K{ddK7{uug}?XLaY7uAer9B5s| z40xYV$D*`AGQc8R$nJDGnsMLZO4x8Ua5Wyuy9wTnu6x410yfy$P56~km(d8OIV&NZ zS7)RKz3*ygV)r7hnCc{(9CBtDXy9})bU`J0#)PDuj6Pt*bYv=~F7cwtaVX3n6$sJY z>$B1Xvxu@c9aOjYeE>{0FG${HGGgp(U1Ig-ZFYWdFpoh0gwqGXpBmP0k2}SzTi8B3 zga$u@dgW?l9-o9Gk52{b(+B*(<_pl&7p*Uc-zi(hiUo?=6{R$pVcrw>5!fzIy4s1r zgic0#39JOITfb^>Yxei{muY(W??)uHb5w4EF7X{{hvodjj#XW!Vla4EoJU6{^Ys(a z!ZCpL>{ypQh)c7juZsF~}S?qpv1y=|lYa!SFrVmDywbLjpiEFrk%8&THWFHtV9AiXt*-7zMjRid2n z&2ON2Y8+hT5EWqe9?pGwmDdP}8AJ7A;!&`-IfL*eyNZkRh3)(IgoPsu!B*PzTI%M2CGx3KP zgcfn6;!{w?XB3Su+oy$t{?}y!YC4qT)#&o`h_-U*ju-Ta*740Kv1Y?F`&8%Vi0ytA zXLwqBpWI_dVK8)hns~^zsji0oGG0jr`Dia*tY+Mupq*g?R}T5OVWE< zB|iQ|Gu5PR!L}A=1g&Eq7g9?Hlq64!N}`C8`;~x^!*kRsu2Y)crn)DoQc3W0DO@!^ z2si@=N-4e_3j~`WN(bx>m!s3=guvOUM@g^%;EZfd^~$x=1r|6aEsYO!^@d&R&kY}) z&3&PnGP-Jvi&k6t3f)A2N9@cVpARVV_!BEEjBdQ5FMT^8c`-Bei+Gp#EB7wwgjgQ2 z;o9j9qSD?c+eAgP9I+6*V=X=TliJj#=g_dky!5~0o8dvI+CipC z;O5v3LvSTJwWueCWGD$j?@gi#F7Mq*MX^n^^cKbnD;Dgbuqv$BMR4^iim=H~4!OwM zh(JVLO@V3&@t5q@7^2d`iGt{J6@+ghno}xn0&5k9T`7_ksoMrk|q__sv zZN*EXyi=Wx5kQ zw@Kk`AExeiurYrNZ6bE)(Q1Vxmm5D~_&Ah41=tieu46+VKTRgQOLEjsHYd*VRcj)$ zQ$1XerON8(d(e{i{Mezf0yJqXWX?h=y-t{~0?u0SrXyZ7GY)7XcZbbRp~yRkGU?-+ z4Ki($UxSL8l+7<`8gom`kOQB%4xvcXd!!CI%Q++Do!EaHW%Pvf%V*bT@v5ruTKJEz zxsQ!uh*zFsQMt6FY&7qGD{>YD*1XAHj99aF();bdS8G{Ze@<;EBU}%@$RD?%27ZZ^ zKhC}%C#y4Aa&k@-C^J+SzRDguP}P3!RoHly#F6QOObqEgj#c)ZPw+Zc7KY%gX#WZBaj-p)VAG+Nfjsd_7HpE=2lNP>>yk4FuIakrGK=sI;ougvBBsT(o%EJgRBYN(-tqN~`hWYqI_T6X~ zgx)PEFfAdnMHmN(CnZ7FplgGgl+x+}gCu0NO6M7Egi*c2V6#`u*SKliaiH6vyQ9FZ z`8S%pCF2u)Wd!vvEDLX`R!p?2he*QL)~nXpDV|C$;;}Wcb5tdOuO}3KNBR#Gpc;2c zWiZK|ScEOltTeolhuLxiyk{ZrJ6KEggx(i)X&0j`GF^jCoZLe0xOb7j9F;=q}BJAADq|fK@ezzPs4CQ}&CQQtBDO*~{ zoS%R;O$b*F?+^`Ndpr6}Hv7=Np)+rFF?OP;1=&tDkmFL&D>6m_7w`{(4gLEZvGh+*MR5am2 zF0$XPXSTwkBCK=gFSh11bq^qcsSKKlELXytF3suvK_)twi_na7Mjn{j;;{lGc3naj zLuhx0%Lb|1>iu2Lh`(s@nSb&%85k3w>^ZqDWs*Z`z*24!=!P+$nHNd>YK0{XyH9^k z*%mb!pv+r*kBk^>_u3mh4@-9Cg7I0PAgM3Xcco{^C>$n-ImHMIz3oV`)Q=V8pP8n7 z`02%#aLD1NG#WC|!&0U>XwF6tKCd~t&HZpzO(n)PsIjdEy9@qjW zkMxM55Xl5}hNHIx>vIxA+?WF>RhYeli`${<^^w-`O^aMk1Q2nH` z53;};)lZHIa~e&WDT3L4bE+71$B&*&GxpSX+j!N_f$jIw{?{QZV9$WfqJWI-r$JQ^ zWxD*xb{5MfqGE9y73#x6t~luV?VWBQTVkMiQ)>hohUbRJx^B~?Mv@=x-b9r-8~C&+ z2nwL_0?omhogd+)@6G!fEa}T4cvmm}Ru$-yUZdC#^=p%-PgV5x7c5DmRg&zuBri_P zGW3<4smL@f{w*1B@G7EJ;twDO5gkm2j0vh#83G{DA$KA#-QnGe;qo(k8+a;S@OK^S zVaO2<;`SxzRY>5oGtcbPz-QXdrJmrw`@>rWOIC#^XHPGflAw9c6pT(GWbHyAJj^g_ExN6}v>$Wy}@?#mll zmQv(#iEi72AmD=c@rn~biEb<1ZcBIJy+Lvoq?GFK(yN6cSrP!)mmf%55C}$TY&HxY zGfY3D<9i5US5O&mOq>rOHk8IP-JcwpAp#YHte?dmA2VRqU;`s%a^%4Zk31HkEzMDG z%?uPU3(JfohP*5;@5-Volp3!jn2e}&C-ZpPUM6{p6Av+zr9`-iiK1v|P7ndmf%46APEB+TQ)$spI4MD(+#%I$a%xFzf8Xjc z9#{cc=*)p%3pFT@MFEkAsh$QF_~+zE6FhQWuGt{vi%UNnM>&zj=9STV>Ru*iF@{HN z0c#Vis})x_QD^-(PH!VzO_zoqcP9mZZ}|XWZ^>4Nceui3+}oau2jmMGa^`;`i5jV*6f5xGyY$1zmi~y)anZy!$F&xUXhxvK7!O#bD=@YxC9lE zfRPaE_t4IW+s0j*5*+)jo*TP$gEX|K5IH>ita>kl-+i)to64vO-o5j_+h#+R;V+Hs zudrBSv5Z`Xr1u*vC$4wll~g5mQX(|KSJuTfTV~X8@%vx0GDk}9WZyQG8w=_V>S_Hv zYWs{D6!Ph8srxBA6wy@Kq_FvS_M9G)#X(#Tb_Y=IUuQka6x-oZ{!c7{9%u;j;jwlZ zdHfwqe_aynU;*6UFDCm>Z`8bks6YNah_bG0kSneoXEvygMKPuV!kEV^t3GjtcPFs6 z3|$aNJX?exAm~c_Aba}iek#?2(Dy=9`k$NSDVqB4zHftgNZ-iN$HL$XkI=%twIKC< z$V%kCwI}uaSE3roIrM?Q6CkbLW8w+_=!p7xskSZq&UKP zDo&l!@jrYxysyOLbl^4@?(IoZc)YG|=gz=V>vU zg#phM#R))>y_w(0fF*1ix)uxJ)sl^cz$CKF`j1Fw6PBn(YALp^gx{ef%nL{9>z6F> z&^TK-kP+h7MiOu*2**c~rX-L*tH%6WY6fJ#o8lZ+g4Gu+oa&7P3)}c=4p#cXFBkZqxGCf!L)54@p<$%k+;MEUJd z(o3gdUdCXeK}Aqw4Tnb^SXycoLo-sH&j|HKnIW#%_B8W;=9P0xlorlE zeuE>`%n|3B4Ry-@nwY6uL%IK=G)h4;&e(%bkPcucBP3y?k@4`^O^j!}nPKAtPR!&` zNc(pqciuNBLK+Sw$>E;VU`IP3&c!*M3`zu!D8QPg$iVe*@1l5P7S9*q(7 ztcE*<6NEH{P;e7=oTNMToCzLs7&*X6)XrE_2iB;diTJr|mTNxU7!uumfoa5B;?fYb zSY2yD#XOEup9=O~gN{_FqJOvQb^?*>@h`8}Vb6^XBtA%V_YS^ph$bkPA>ELGgNbSv zc-bj3Lk_t_1joMm0#tsU6Vzl!;@l^76)BzwmS|_=VA-(I+oTT7<6jKj-fFMvqL``> zo^4w*8?_?j_e^r}bRnYJ#8a3!0=mV785F!HtkKjn0oIj(5Y85lV3~~fu%Y0^^wC`TfEk^xmuZux@~I7 z{TgVBiV8^GYNOPe&tPNK&R5%mAg-$!WS-(W@2E!J%2cAzlmxX}?zRgx#* zL=&xyuAWmio-Tqh;XQtK0g^}?O%vLQnsNOb+e8J>7$**Bv(Av&#|3heKEh&xd1@=4;{XHq^GKj(<*>@>GP1&kCbV+8a?i<_Wp8;bF>q}G_*niWOSCqGs2H8G+sEQ*!%AC>g> zX~*`udcaZQpmn%$^u4_|7!qJqcpw8pu400wvtIX(6tWsua3VJ@El~9U{dh2-K3fOz zUoqwC-;(!xL)5G|$=@fff`;?qbWqf2C+C`fbePzpa((I-7Bw!>W@6E`R;^VJyFCtD zg#T1UB6zxw>#ih#^Eq`)_7n&zbqYWtd7URwFc{zz4&-_Ohj6`J zkkyCPV?Ks+eAm-AbHAi`&zV;HqGoxVC4jz3{I;d4NL&~Vpt5c!d);}eNB z-*8ccG4J^N_^_Z8AjbnwY`_t$2D9v1`gBg&^BfR-qF`HKJ>=`qlfy#^OvYPSqGHCa z1d|qvy1gHmhQHH9cOSU_v^eA~diGlUqR^-4+|-sp`FTZ4$n&sutx#|u^UG+4TXjtO zrPmB+Yd%J3wzaev(oI)$*vndFaC>O=PEg1jF(2EkzP!#H+yJP<+nDAp)GsO1n~MO= ziD%qu)z}^G|MkkVS2ytdd9WpL8SM1z>>SJ3=iv*ISFhwzs9xLAjh{tGM_-40S*Iv!pn@e9G!q)N#=Yif-O z4uNZdd0@>8{o7GP&9w%!=5N#9_I6uf+?^`K=PV!?XRM<%`ABY;9m!cV zO}Ed+fc+9ue4!GMAk}(%8UC7Dgb{kD8tH1Si&#~pt?m+0PLdzlzjIg$2)=!I4KptP> zpUA$c?1y4nxUctvrlsqe10?s35bM(ASzNfm9^0oA_-#o4-XJJAg18ClbKaZ-_ltNiOQkYJH zx3b~&yIw>fjCyh^-fUn`7yC4`?o9mdjM~_zRgkBgayg_xE#okZwP!OuG62o*EMsU$;alzr?}A zWv?)&fbxvbG0P|1X#?%lFQ)CbowTgdX(6hDWubGgf!nUXeq_gl@lr_PsdbfGQC0rg zj##mtZNrF2TgtyBovaJAK$F|=CH7>{!rT2rf4$U~#YO#gm;KgglyJ@~XbtLSrgfIZ z#UYni+Q%6y-g3!OtG4~JBd>f$Sexl{RK=$M&4eTkw%VNKQ;?qPV(r@0DFku-_213I zaTjgOvG7Vc3um)(7iGx?bmGw{{;RvfO1u@>SB`c^%NEvhBVXtY|F4L_p#Fhg!!#sv z34y_pUz7-GF;d_g?1>!Q7#<#3y0^eQ+iHT2H-QU`l=8#|(wZ=yHcr|B%4H=HJYJX( zzcwJVbL53b-zJ)5DC?)$-!m9LP?~9=vV}{@M}QJZ zUldQ}YoW0`Pn+TmDMNU)DXr`*4g4g8M5DxC_i8{v_o41JvkV524-J;!vrFP?>j_wWp>`<%>y4o zF&`xPMUvg0ZKQV0V`>9MBLWvqZurj{!45RcQmm{$UePhaQhr{pLKqto!TMa8nU~Uq zKJI?`luF7to1|Vpb6vzqIt?tcRr|9tutZO5b>aFFP?s-{D1UZVAnqD<%&u2v(omcxC&7Z1a;M9Te~_a3!CFdm zxI{F`DKPsdiRlEf+cEXdR?ILtozj1po${D!3cl?+ICFc53WB!YA{t z)kX+m8`n~)cbhTF+sUo4LNiy{KBpy!P!Eo?ZxJeCI+AP^D~s_Mi663AAaah-1)?aC z0-EcEUL)N&a4>{VWEgb^!>i1)M1%mvs%uWNCJCjED!?Qw!&uf3XG}}(3I{#mSi^H%T=6xJG5X+oldwjNhQT9OQHp^Ua{QWh z_09b4x(fT`q1J=hPue~hn0v|m{m_4ehx^g}>UcuvWAVdT8^}c7)=a()F!`sB*6=ASE@r?5CcuC9xOaAo&SyTu4Tyy zJz7wI5GLEL-yypobMtBAw=W$GsXOjj&V3{HIqf47BvuzQwPDHf z#b;K`;JUFxrJQxsQzEsVH~2MTP^AFVT8t47D9)Gn?}TE`!>9gRV0Ex*zmzoZ7$SPX zWG_%@a34KQ+sTWyPJ3H#_HOzXY_st=H4f(unf<*bt!<<}!q^qh43!=#L$&*Kx>I#p z2*`}rEX8!yM6FDPvO8%V$BSppzx7uB1cM3R-AkAnD^i%0v{%{Ew}Hn>+&DnutX zrt2y^*;S8^{Nlbf0X1%Ka8qsyJ(on+t=q@~y`GZ|dJW9yTif~hp501=GRHJGr{K!2 zJ!$o40I9GUGH4m6gy4!#T`ud>4?~x3?e_NF;iysR)=bpxZ{k=>6g`)b{^W)(F}GUd zLa?XxY}vC?wE3I_tAqMS^VRc9hVzuf#Itqg2;v34gg;}m+&OGuxaC^t>vW@(lQhd7 zwr@tlf{&jeYdjuq8I9^^=e%Bv>%m%%k#?d`t$CLg=~}Zvk16$yh89&F^kbUX1~R9| z*zlm5z~tC(0mIHSOu!5s+y!Tc`%XG#*AuEqtAy>QqO6g;tmoq9@k~N`eS48vjvQyD z+nQ1fmcTjC-?+<6cjW6RM=pI34c36D?VzCN1o$zeSQv>NK~DcQqFyOg2yL8DB9t)% z$#%k(TZF-sEVV3}Yt)9-W&$AOJ||nLEY0^gxyO?&yM*9Kt6$%($My^wP)p2^cU>ED z5?u|gUZpbd?QZ#%(d=D38khUqh4q+D(=I2JtTsVn!g~|;?e+54{13j&LQVItdpo>J z=O1yK^z~0(&CI~++fQEDd-+42XpuLD=L047-;7{iAGgC;-`QN(X}CoG%!mSND7piwN5OSFgg7o zrnqN)G{Ypg@bX_%B$AyN_f`bZy<~lKZZJS3c*1-={E&k?wvrc2kto_DSuZk$UzAyr zW4w%(D21scVp{BmQPaf|_I`j7n4}vpOuc#~B8>S#c`(BFjoDwtZEx|uy&zZEy{V*0 z86f>gvW7+<30)h+sk|6cltp}QEHuMtk-X2PauV_%XcfS3nKeex4{Y9@BZDh8GGF_y z`PvAoMdk#S1J!FmTh-ngV*=CGJ?WXjy4`6DB?_6$2nqEcj-DY*eT9tEFH=Ml2HD`P zXnd{?T{4Udp%2)+YrahvEj374VS|)SLqO{k`kA4aLxDNF)*vpue^nrZDv+pYUA`Ix zpk(obH`bui_+E4>0Tj^%fk&2tY&Xx*9p9th@FO)q_}}nXEsi8$W1W4=U>bysI2%4Y z4oO5|6D}SMeRaS9&7;9Mxi1V&j|rASh*1>I(`mpYU0ld4(K-0vXrI7PGUkYWg5Fda z(>O=O**ZcSG0~&Kr-NyN*&Q_qsnlM7p)DF{7WZtV>KXh0q5Xn-DKZiH9EGM=knpBu zY+*keujjIV*^@c>fr$vLen(<(S;JL>YcFst9J}Bb<>15?WmZo)+OkjHvz-L}sK70Y zXKb%dJ)RS^QHQDC+~I8S+G-mjoiP3o>Pqz_^rz|A>iq1pzrO zXM;?kJ8E}+P{gCuk}Bra$e*>1Zr!?MS(9NGoSk!84Df`F%zhl7oCuhetS)0x<>8>;d5;`s%?X37g`gxA=O>E8?Ym9`(j(w@G0JlY*Dm>wuEFY|hI~C=&5BWR6f) zd06iS4}iWS(wEu8^CyUlXbruj$>(~=>QYUUcaGj3Q*-l#PIa~WuK+`LclB_e4efMX z7;7yFnJ(5|yi9FNXte0H|E>La=-b59c!R5mQjpnkqMhgcf51{tL8nGZQE*BFMogf` zglZk?QTF{n;k0BPxA*W2D2f(C< zfhxCXg@rkPwCkUJQ~F+DH=+cXwOeCe^Aj#p*o z5OkW5Kg-l>^U~(dMKjs8_;j*e$=CQd!shPOuEP-1X^|f<7UvRTq7XQ;6O*LeRlT*z zQ}e&Toj_(Z_Qa%GpOzZO;~$#l#-)E+N_X{h-tR$hi9!CYmT*k!i>oe%e&hdb!V%n+s~yn7_mPf6JiE6eKt(-=?atS zZ-z`So8#ZyQb@Op2X^r7FoqHwLg=D+|5JA4?It#8zGw%PjDO^U)qf0NI&0Zn$6#DK zBfm1QdAH?N*lz#;$l~E-kfjCewa_LPl#rYYC{{&G7A~&%3c~2&*Ts8+AT2 z$*ki}Vp^X*s7+b`b(kaq`gLF6BfW{AW zjw~lWuAjD99$IBFhoeJ*Em-E~O}k@0g7R*NhssLO=B@--*_&E#@ayuqG&s-8?L2h7 zOq}vU&IH*w34Q&U&QQYaL0;CpSu~TtyE))z3+Zm9#ENacXJxY7IW={)zMHrWm286@ zuafD8_Sw1n-Cl%Owu4}BMWU$9uM{vmM;7L;p6?0oM3uck1^tTgycZPRZCGI|hfhSk zI^{=CNG0|Nz2#OT6dducU7GCcD!h!GoT8xQkME8)v4Aghq*Ai z7KxdupYc4{$YNy;-zOEbFBM>Vm~H};$Iw4&&v1ATy%8lDsIF8^O7YzWsvqQ&oJSS~ zN>aO;>`J8BvO*b|ooY0721hQMmykvZyye`1CK}pxwpZ7n05^u&2!( zeeYg^12r;f-e1C5!6%F*b@lCgAWo}I+?Wv_K4p(cPVU*bo$-2A6iq&2h)tE}ydKG% zaBsJ3Rdk&ermAF`^c>(W|4W%Cu(fXQl44IkNR!MSzozp)%}1KbavC-4&PD_YROicD zMn$8}3fPt}v!mbb8YMzuU!W7!z2iYbo$BYTsovEN%e6H-HhxC!JRiX7+__& zqm+p{>W33H#xIY7Uj|sEQ{08B=R&m zaL2Y_aj0L}>{Gl1MbpOVVvR~x$M{Uu@aPQ?K@|0T6Vt*bN&+TModFV3n6wx>Rh3J% zQqopskV8CVNl>cBznyPRAVb1H{okLbWCpwzf3Q&Uot3I39wec(BKvr4`s%Fji_VnN zRbpK<+bLG*CIUa;V%ng81(byP2uJF5DLV#JWo{t)59}EPHZ? zHSfQ+&Q>%B5(_n0P#PKG)EKlh=dgQ3M;po@m(8VdWFnNcMVb@E;;#dCs&NOtPbNM5s?9-c!JTsUA> zjpdRH56q7dR4v*$#JY(zGX?=`<*E#D!kcwAq8T(ac^mhI3vW)lO2dXJV$!A}36Zf7 zu+rdH-JHh|RU#e?jZq8kT=Tn8w{wvCDx%QNlu3!t^SekE_tG;m+-%LPR?jleEzixu zwvbZGJ5Mg;1da*T_oT~7DKeoaez9&z28n)2P3$Z;=hS3tSk6+rl%ZlROU9O?xRN7> zXUQNir|l4fPol5qN29MjeSn(1m{`_c_y9enI3{?whEA))yt6aHeNKVI7GT)Vg_iE~ zE-PWf8&Q=l=k)Af9x$gY@|7xs;1UckHg4?GS~l4`;q7uKR6aBijSxxMRl7o^c#xA! z;^|mG@m{lM4CrbP0a?!R(WbRxN}Kz%%L>yI9tRF**OCfvB&CLIKtYo#TBRC14J=)Xcb`job}cnNd}85_K^qs2E`}ru=~zlPjGy(Khjy-Z|^J7e7q;j_ac-%7_L~ z5qD-D_ln+eTY7kpZ^BG?W0X;!(^a#uyKoo}gy+Y@gr(^{8^|ZGxHEv*eYdr-H28`+ zUlg1V!S};BRa5x(U*q`B)_=`d$;N{;&rst+s5~Ev8|pxX`nx|e@Uqa46-GC5l6vH< zh}*u*Zf1HxH$S=P{JDsU{xPVwwK@LGR^7sJjaJWyWo>*SkEp$6WZ&s*oO*q3BeF(| z?cR={h4!UyFo~i!r`JI*H4EAbrb0_^y!7ocJ*sgdn9&qyj}^EDH~2mg4e$DKkWPpC zTkgl$MWL1W#vpEU6@Yrf2o#~CB(BWUjApst#cUPAqHW48Fm6X8?J zyOBCTGYXJ|RPtG2$_VV2KyLh>UW-v?u-yDlucg-hFTIv3`oHTnbCLg-UQ20GI%@?q zp1WoWp|iuTT%WVuujcFWv+L;6YG*yvUDe>eZF#kmWHmuoSJ3gAD6f)r4Me+QfIMVn zqJEWFeSp3cAlKy1iI51ohE(|-0eDb|?A&FR#l#P_Afs>3wvZ2BUuJQb;}qm;8(jvD zJl6Ric&+lWH1f-g=d6L0^QPw)lQd}ef;`5W71Y>e|4?XypY!2qaFo(lmabphKe2?} zheMg>*<60R@W^2__uD(^Vzzrq|E1t$ik;l6HRpfAHGA|Xdfy7>oN(5jQ6C22gD$Uu zKhRxoF?pA>e^)mqi7lSBG{d33Iic*1_;~*duHj1H8~qQs2JgG}#?e!*fOoOtgEF^x zrhb1qeG#xGZFSHa1*=>GMU;uLS`J*Mn46>If7Qu&>Vgo1QbtjYMkOD!W9krqHMJ`` zy5}|nn()kfN=+M!PFYD4Hs~Vv-C`3kG&0QUSuVMMHc~sG7^+xOtV%q)o!5hdLUJ}s zqZ{ptHa4~WXbU3bv!p4HUc0XsjNIC%x+m@)+qCznxD1~OnuKdPh&$(j#cb+S6=3Q; z37yclAMLVG$B(F#KKRudqLV z*j<9Kz&nXVOP6Rb;e{C%oTpu68LJ*EG|Hx24;14DKhQ@fbif$udTCgKyfbC>l=oeOn{6!k@qsS&j zp6vOp(Kk(Ai9_{(8Zyg5;c6l&&L5cg{JK6uW+IkY*B=!ul|wv1n%B(Ig^?V104T0F zE(xzbyfEszq{#wzP#kp;&x?~8Z-*(IJ7%LC4Ol#Ha&gHc;WIsOC7WZ2dQ{UQ$x_lO z(xehbaE^d@-oA60zUsvqTYky+4BJ{Ebnw2}^0Mx&AuC_+_?+-Fbqgjda zsx+@wtUUCMQnkn=J#H`=XoNPgS&APp8i4{*mrMz&SVbBz-U(_dFZJ=wCina^#}|1f zPl$gL_hGQ!9BTar{30Uo-c?u|WaKloAWlG3-|LO3hAkfF9tXEff9Y=fC5DA=$`8n1 z>yJ{S|F#PMV5R@i^pJf3nb0UG`*Ugh3Rarqo5pRH)R^LRBg>(?O`s>LnEcOUVKzS;iW^uGL}KNjOi&-u&|E- z+cT(bL>NuR6){J+7C;rjZ*gDdeY(Aq1>rj_N_bc7@ISZ~`G0|HdKdpET-*Qu53VJb zN)@5*nPj+@HF1nDKk5_Rq^r>df_|XVmU2PK54PIpBbJRIF|Qy!RcaWuvf@^enrRU- zA`vex(BrX}9=VM*C(bAQO)fch=^DLbOC^-&_d-Em2KD7^?l5g$|7*kE`%0B1eX_Si z!jS4jjX6_NH!V<3RPWq9u2l4_P^jO!tc`uL^s?)OmP1g&NUA5H@4bqYubbI2mcs9$f30|6&p0B~?7*9(!1As& z59MRnLiDb+3-#Muj0*TE^q!})ACuN?(h}oyQ=~EUzx8n!UQIZP7r^P7z{n{f-4eH|=e&2cTo!>dXbN`Ba&*xm# z>bx{7yD@X6YId*tr;3denA8O-f<`V>*@4nrbOfrEKzRiSo?+#R9$EiYqGWD9#loXG z>tf@ zd13M$KDs)01nok>s|Ph%lHM)!Z7ew=ydyXVgfg zRL3EnV{dwnb4-OCvuG*N;r~+(ea|2X=wv$a#Enfp zLumPi^x(q8)mgX+%YV2UL?D3F8ugdnfOCtnABgxN^=-&0)4 z3|_#w?zs@N`jOYiCNz43vd2wQalYz-Ylz0pEW8u}ALjl!Cwk&!w)c~3R1rR6Nj_nV zPo5%8GU$yZeJcnRf)>*E2$xU7myP*j@frmhag|@mVWto)!ve=iJIcuR6yiyR1nm;g zo(zyA-ncN(0|O@i;vW<0(fb)ss376R`2vjAq4+}VQ;i-wdVy&&6cLu#L=aE!&l2@w zuqJUkOpnf5Dn)f1ujG!CJt~!!n^iVC})P6m}DO z?T-dnu;wQE8?23b3(R+nMq*9{{dKKQ=-6X*8SE|J|HOhds33@W_YYV@DfF&@A?5wj zuYJO>U~Sgt4_JelCg~>rH&}x=EF~IZ!P<*IV6AxbKVYrx+5dtyaZNePm%>=E7Msd5 z6)H^Kg9U3$#%p}Fzrk8dWCI25zrotia?qfWa3+F3b>ttgmi67@4_NC=3CsBhtik_+ zHIhq)HOv12Yv*tO4_IqrW#2)3Q&-oiQ*01y=O=E$f;A1uAFx(!GHLr4thN0HYl5AB z!J0y)@UKeYrp*5btO*DH25b78SgCZ8L!<$$KEs>b1__ODPF9T!zp`3?eEuXKAuP<>y7Mb&6Cw@ctT1W zxRSyrV!@Q#;fI4C<%zov?&M5^fkWu)JF7?1Xp%#@g4zU`Bqo}bRe%R!eAn3rF6jAy zu|#B}ho=leZ8V&d*J%pA9?sOe#u3+;p>%PqdZnVwj|(Fw^vaCGVt#LZoE+szL<`eJhI4$cscEd4 zo4!Q~*^uJ!RA1j{uu2RL+nLLqZaBa(5PJB9dUp-fr}@KpY?YJ5vx@KWr3%%0i0Cb9 z5PFoB-E#)b@;IiBzp$r)x_TkB0AHOwN9~lFZ69YmrNIkg0m$yu@Z$S&H@2Y>RG@WM zcQMSPGTU$hH(_$c-E5*p>hp$~JWy;oNbM1WdX(vq)VF2;JE-ABB&EzNkHUczP5?{) zP$SZpao^;2jYM%0eO`+=eli#uxVO_!JL~B)PHihRTVw0g4}*ts=!#YDc|DaS=?|Se zEng>@$kk~l`k~e?k9VEP&Rt1$!a*|OOK##>mRiB<-iT-ISvLA?x>P`5tfLAQG$kxx zrL|>hyaY3@E4g8+J$dw6WsTV^Sb4HFtiZ)krSC{0nRZ~_OjF}|is)5@a<2wC->uOk z>SirGXu&2ExVeIlQ;gsl`DwhlQi9v@-8^J+Z=C>}RD5Kprs#9Km%X9IpOkO=`ILY6 zA5ka%HK(;`Um(-QGmyX53Y8z3Arh>Me)4?v|(U9wTXM{%EDSaW&&%XQ9I(Zu+2fV5Kv~k=wGxcCeJQ(k2^5 zEc&-u8^M}2j}q76%nfp^S!2YSwJ{=S<$a0K^g7xyX+e?PrJm^q!b0)7U$?AK*=)Xm zv>nYc>Q->I7n<&3L?toc3@xt`nTAQ>h1{B{2bC0mB2 zc(o_2G*hgxUkgwtgdv~4P!E0#U0p$r*5leK3Gp2XiAxv4>)DC+`kMrk7G`0BKQhpt zk6YMH8qGGsD*0-c$zEyI324Y=sfAfV@}KWrdKGLF8=i>=7JkL2)-YO^zKJ=wokE3n zA}%~&xFP^V(1V6RH{M$dzG~V7Z{2l{Vf|bu$U%4}@0@~o>*lNYUVPFg3^UB5A@j7V zEV2ZxUMTJ;QXVbF6rOghJ0E;9JKLuk6BYouEFig%JsZ7sUtOv>uXEL$HmJK zE~|OBG>uLbMrOE=DK^_rcK} znC$LeOOaOA=m(?cAMS9j;#>IUy7$BdRFP=%(bw7m-bq!+Yo7rb;JUrs4aIr6E8}hk zSv5{G1rKZ?^z1_`+N5N8T9F@vY}O3>F;T${)4G1QIR@=YOP%>kSduIf_t>&OAoDjp zA1`_N?_5QEt5Bh3X+*v2f@=6n?oPMI z9WcXWd%jfp{hCvAu1*=DNRNz~duE^Fe&-OfOP4eSs`Bwd6IuFUofP$#WfD%-*`U?L=C5R;t z8I`@U?Jd-&j=E6Dp*A=9wnl-7<2lq3J^&Q0YrroP1Dyv5hP;A8O~erpZnAdQ$nlV~ ztA<1STd|M!yAHbVFu2YsuWuC}RBrq{43Lt-UkRMuaCJLAGuhNMnUZQjqqDPbM=zQa zHA!7;n@MyY8-C(w9BTft)oa7F}>ke zl7SYEK+01uWCCZU4(SlGTVE%Yz`TQ#To){HlCQZGg>IL!E}X|a52Zlbbb}IZC4-E> zlGJL4edx3?FLumZQ=UijOynBOK`{Bg_5lyCK$_dD2KP_GO59mpJ+&QFGXzzZ(5@7d z#GzYCa;R0S2~pVj^9X>C)4Q>Ijx5cxRlrY*%+Zl|74xhEpXohVIDDtnc*_&_F;nb# zeAkFbKb7tqwXNOQSuUs49EW-OdQW=XuqMLrYn#>e-H*?cOOXcRpf|sgB)e7XzRR3xAbG}!mTbg7<*!vzOz?&R zq3Y6Sz9bN7?)g;vrh~Cg-gD#b*fK*x^Cj}cN8yBdT6#6Q%qAW7PnF6}AGD=^n+p1> z(&2sl=7;asUm$AkuPt(8b!H{s>nf;xBtRSGECUtHdk-7BOZQs>2Yyc027n$Wp0ll>{?muh`+<$ zotsTR8}MoJADY=ebg7zq6F(u~>)YHbRO14+oXyYIHHDi{LK>D4!-8}e3s&-ufx-kIiiHF71@)x_0u!?~WTvl;4-gp}r%nSPuJLgu z=KG1kY>zX)eLwjm_ejgX{t)wYxbRb#Dr6HyuI3Tcf4UR-q-skh=+}fJM(Sy@@rSbaB_`?#{dZ}q*p_yygRN>LpHpVXG{QPSBc<^t6g0CJ?OO3;Erg3rp E1^Fv_D*ylh literal 0 HcmV?d00001 diff --git a/node_modules/@webassemblyjs/wast-parser/LICENSE b/node_modules/@webassemblyjs/wast-parser/LICENSE new file mode 100644 index 0000000..87e7e1f --- /dev/null +++ b/node_modules/@webassemblyjs/wast-parser/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sven Sauleau + +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. diff --git a/node_modules/@webassemblyjs/wast-parser/README.md b/node_modules/@webassemblyjs/wast-parser/README.md new file mode 100644 index 0000000..345f0d7 --- /dev/null +++ b/node_modules/@webassemblyjs/wast-parser/README.md @@ -0,0 +1,17 @@ +# @webassemblyjs/wast-parser + +> WebAssembly text format parser + +## Installation + +```sh +yarn add @webassemblyjs/wast-parser +``` + +## Usage + +```js +import { parse } from "@webassemblyjs/wast-parser"; + +const ast = parse(source); +``` diff --git a/node_modules/@webassemblyjs/wast-parser/esm/grammar.js b/node_modules/@webassemblyjs/wast-parser/esm/grammar.js new file mode 100644 index 0000000..aa92e55 --- /dev/null +++ b/node_modules/@webassemblyjs/wast-parser/esm/grammar.js @@ -0,0 +1,1756 @@ +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +import { codeFrameFromSource } from "@webassemblyjs/helper-code-frame"; +import * as t from "@webassemblyjs/ast"; +import { parse32I } from "./number-literals"; +import { parseString } from "./string-literals"; +import { tokens, keywords } from "./tokenizer"; + +function hasPlugin(name) { + if (name !== "wast") throw new Error("unknow plugin"); + return true; +} + +function isKeyword(token, id) { + return token.type === tokens.keyword && token.value === id; +} + +function tokenToString(token) { + if (token.type === "keyword") { + return "keyword (".concat(token.value, ")"); + } + + return token.type; +} + +function identifierFromToken(token) { + var _token$loc = token.loc, + end = _token$loc.end, + start = _token$loc.start; + return t.withLoc(t.identifier(token.value), end, start); +} + +export function parse(tokensList, source) { + var current = 0; + var getUniqueName = t.getUniqueNameGenerator(); + var state = { + registredExportedElements: [] + }; // But this time we're going to use recursion instead of a `while` loop. So we + // define a `walk` function. + + function walk() { + var token = tokensList[current]; + + function eatToken() { + token = tokensList[++current]; + } + + function getEndLoc() { + var currentToken = token; + + if (typeof currentToken === "undefined") { + var lastToken = tokensList[tokensList.length - 1]; + currentToken = lastToken; + } + + return currentToken.loc.end; + } + + function getStartLoc() { + return token.loc.start; + } + + function eatTokenOfType(type) { + if (token.type !== type) { + throw new Error("\n" + codeFrameFromSource(source, token.loc) + "Assertion error: expected token of type " + type + ", given " + tokenToString(token)); + } + + eatToken(); + } + + function parseExportIndex(token) { + if (token.type === tokens.identifier) { + var index = identifierFromToken(token); + eatToken(); + return index; + } else if (token.type === tokens.number) { + var _index = t.numberLiteralFromRaw(token.value); + + eatToken(); + return _index; + } else { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "unknown export index" + ", given " + tokenToString(token)); + }(); + } + } + + function lookaheadAndCheck() { + var len = arguments.length; + + for (var i = 0; i < len; i++) { + var tokenAhead = tokensList[current + i]; + var expectedToken = i < 0 || arguments.length <= i ? undefined : arguments[i]; + + if (tokenAhead.type === "keyword") { + if (isKeyword(tokenAhead, expectedToken) === false) { + return false; + } + } else if (expectedToken !== tokenAhead.type) { + return false; + } + } + + return true; + } // TODO(sven): there is probably a better way to do this + // can refactor it if it get out of hands + + + function maybeIgnoreComment() { + if (typeof token === "undefined") { + // Ignore + return; + } + + while (token.type === tokens.comment) { + eatToken(); + + if (typeof token === "undefined") { + // Hit the end + break; + } + } + } + /** + * Parses a memory instruction + * + * WAST: + * + * memory: ( memory ? ) + * ( memory ? ( export ) <...> ) + * ( memory ? ( import ) ) + * ( memory ? ( export )* ( data * ) + * memory_sig: ? + * + */ + + + function parseMemory() { + var id = t.identifier(getUniqueName("memory")); + var limits = t.limit(0); + + if (token.type === tokens.string || token.type === tokens.identifier) { + id = t.identifier(token.value); + eatToken(); + } else { + id = t.withRaw(id, ""); // preserve anonymous + } + /** + * Maybe data + */ + + + if (lookaheadAndCheck(tokens.openParen, keywords.data)) { + eatToken(); // ( + + eatToken(); // data + // TODO(sven): do something with the data collected here + + var stringInitializer = token.value; + eatTokenOfType(tokens.string); // Update limits accordingly + + limits = t.limit(stringInitializer.length); + eatTokenOfType(tokens.closeParen); + } + /** + * Maybe export + */ + + + if (lookaheadAndCheck(tokens.openParen, keywords.export)) { + eatToken(); // ( + + eatToken(); // export + + if (token.type !== tokens.string) { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Expected string in export" + ", given " + tokenToString(token)); + }(); + } + + var _name = token.value; + eatToken(); + state.registredExportedElements.push({ + exportType: "Memory", + name: _name, + id: id + }); + eatTokenOfType(tokens.closeParen); + } + /** + * Memory signature + */ + + + if (token.type === tokens.number) { + limits = t.limit(parse32I(token.value)); + eatToken(); + + if (token.type === tokens.number) { + limits.max = parse32I(token.value); + eatToken(); + } + } + + return t.memory(limits, id); + } + /** + * Parses a data section + * https://webassembly.github.io/spec/core/text/modules.html#data-segments + * + * WAST: + * + * data: ( data ? ) + */ + + + function parseData() { + // optional memory index + var memidx = 0; + + if (token.type === tokens.number) { + memidx = token.value; + eatTokenOfType(tokens.number); // . + } + + eatTokenOfType(tokens.openParen); + var offset; + + if (token.type === tokens.valtype) { + eatTokenOfType(tokens.valtype); // i32 + + eatTokenOfType(tokens.dot); // . + + if (token.value !== "const") { + throw new Error("constant expression required"); + } + + eatTokenOfType(tokens.name); // const + + var numberLiteral = t.numberLiteralFromRaw(token.value, "i32"); + offset = t.objectInstruction("const", "i32", [numberLiteral]); + eatToken(); + eatTokenOfType(tokens.closeParen); + } else { + eatTokenOfType(tokens.name); // get_global + + var _numberLiteral = t.numberLiteralFromRaw(token.value, "i32"); + + offset = t.instruction("get_global", [_numberLiteral]); + eatToken(); + eatTokenOfType(tokens.closeParen); + } + + var byteArray = parseString(token.value); + eatToken(); // "string" + + return t.data(t.memIndexLiteral(memidx), offset, t.byteArray(byteArray)); + } + /** + * Parses a table instruction + * + * WAST: + * + * table: ( table ? ) + * ( table ? ( export ) <...> ) + * ( table ? ( import ) ) + * ( table ? ( export )* ( elem * ) ) + * + * table_type: ? + * elem_type: anyfunc + * + * elem: ( elem ? (offset * ) * ) + * ( elem ? * ) + */ + + + function parseTable() { + var name = t.identifier(getUniqueName("table")); + var limit = t.limit(0); + var elemIndices = []; + var elemType = "anyfunc"; + + if (token.type === tokens.string || token.type === tokens.identifier) { + name = identifierFromToken(token); + eatToken(); + } else { + name = t.withRaw(name, ""); // preserve anonymous + } + + while (token.type !== tokens.closeParen) { + /** + * Maybe export + */ + if (lookaheadAndCheck(tokens.openParen, keywords.elem)) { + eatToken(); // ( + + eatToken(); // elem + + while (token.type === tokens.identifier) { + elemIndices.push(t.identifier(token.value)); + eatToken(); + } + + eatTokenOfType(tokens.closeParen); + } else if (lookaheadAndCheck(tokens.openParen, keywords.export)) { + eatToken(); // ( + + eatToken(); // export + + if (token.type !== tokens.string) { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Expected string in export" + ", given " + tokenToString(token)); + }(); + } + + var exportName = token.value; + eatToken(); + state.registredExportedElements.push({ + exportType: "Table", + name: exportName, + id: name + }); + eatTokenOfType(tokens.closeParen); + } else if (isKeyword(token, keywords.anyfunc)) { + // It's the default value, we can ignore it + eatToken(); // anyfunc + } else if (token.type === tokens.number) { + /** + * Table type + */ + var min = parseInt(token.value); + eatToken(); + + if (token.type === tokens.number) { + var max = parseInt(token.value); + eatToken(); + limit = t.limit(min, max); + } else { + limit = t.limit(min); + } + + eatToken(); + } else { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unexpected token" + ", given " + tokenToString(token)); + }(); + } + } + + if (elemIndices.length > 0) { + return t.table(elemType, limit, name, elemIndices); + } else { + return t.table(elemType, limit, name); + } + } + /** + * Parses an import statement + * + * WAST: + * + * import: ( import ) + * imkind: ( func ? ) + * ( global ? ) + * ( table ? ) + * ( memory ? ) + * + * global_sig: | ( mut ) + */ + + + function parseImport() { + if (token.type !== tokens.string) { + throw new Error("Expected a string, " + token.type + " given."); + } + + var moduleName = token.value; + eatToken(); + + if (token.type !== tokens.string) { + throw new Error("Expected a string, " + token.type + " given."); + } + + var name = token.value; + eatToken(); + eatTokenOfType(tokens.openParen); + var descr; + + if (isKeyword(token, keywords.func)) { + eatToken(); // keyword + + var fnParams = []; + var fnResult = []; + var typeRef; + var fnName = t.identifier(getUniqueName("func")); + + if (token.type === tokens.identifier) { + fnName = identifierFromToken(token); + eatToken(); + } + + while (token.type === tokens.openParen) { + eatToken(); + + if (lookaheadAndCheck(keywords.type) === true) { + eatToken(); + typeRef = parseTypeReference(); + } else if (lookaheadAndCheck(keywords.param) === true) { + eatToken(); + fnParams.push.apply(fnParams, _toConsumableArray(parseFuncParam())); + } else if (lookaheadAndCheck(keywords.result) === true) { + eatToken(); + fnResult.push.apply(fnResult, _toConsumableArray(parseFuncResult())); + } else { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unexpected token in import of type" + ", given " + tokenToString(token)); + }(); + } + + eatTokenOfType(tokens.closeParen); + } + + if (typeof fnName === "undefined") { + throw new Error("Imported function must have a name"); + } + + descr = t.funcImportDescr(fnName, typeRef !== undefined ? typeRef : t.signature(fnParams, fnResult)); + } else if (isKeyword(token, keywords.global)) { + eatToken(); // keyword + + if (token.type === tokens.openParen) { + eatToken(); // ( + + eatTokenOfType(tokens.keyword); // mut keyword + + var valtype = token.value; + eatToken(); + descr = t.globalType(valtype, "var"); + eatTokenOfType(tokens.closeParen); + } else { + var _valtype = token.value; + eatTokenOfType(tokens.valtype); + descr = t.globalType(_valtype, "const"); + } + } else if (isKeyword(token, keywords.memory) === true) { + eatToken(); // Keyword + + descr = parseMemory(); + } else if (isKeyword(token, keywords.table) === true) { + eatToken(); // Keyword + + descr = parseTable(); + } else { + throw new Error("Unsupported import type: " + tokenToString(token)); + } + + eatTokenOfType(tokens.closeParen); + return t.moduleImport(moduleName, name, descr); + } + /** + * Parses a block instruction + * + * WAST: + * + * expr: ( block ? * ) + * instr: block ? * end ? + * block_sig : ( result * )* + * + */ + + + function parseBlock() { + var label = t.identifier(getUniqueName("block")); + var blockResult = null; + var instr = []; + + if (token.type === tokens.identifier) { + label = identifierFromToken(token); + eatToken(); + } else { + label = t.withRaw(label, ""); // preserve anonymous + } + + while (token.type === tokens.openParen) { + eatToken(); + + if (lookaheadAndCheck(keywords.result) === true) { + eatToken(); + blockResult = token.value; + eatToken(); + } else if (lookaheadAndCheck(tokens.name) === true || lookaheadAndCheck(tokens.valtype) === true || token.type === "keyword" // is any keyword + ) { + // Instruction + instr.push(parseFuncInstr()); + } else { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unexpected token in block body of type" + ", given " + tokenToString(token)); + }(); + } + + maybeIgnoreComment(); + eatTokenOfType(tokens.closeParen); + } + + return t.blockInstruction(label, instr, blockResult); + } + /** + * Parses a if instruction + * + * WAST: + * + * expr: + * ( if ? ( then * ) ( else * )? ) + * ( if ? + ( then * ) ( else * )? ) + * + * instr: + * if ? * end ? + * if ? * else ? * end ? + * + * block_sig : ( result * )* + * + */ + + + function parseIf() { + var blockResult = null; + var label = t.identifier(getUniqueName("if")); + var testInstrs = []; + var consequent = []; + var alternate = []; + + if (token.type === tokens.identifier) { + label = identifierFromToken(token); + eatToken(); + } else { + label = t.withRaw(label, ""); // preserve anonymous + } + + while (token.type === tokens.openParen) { + eatToken(); // ( + + /** + * Block signature + */ + + if (isKeyword(token, keywords.result) === true) { + eatToken(); + blockResult = token.value; + eatTokenOfType(tokens.valtype); + eatTokenOfType(tokens.closeParen); + continue; + } + /** + * Then + */ + + + if (isKeyword(token, keywords.then) === true) { + eatToken(); // then + + while (token.type === tokens.openParen) { + eatToken(); // Instruction + + if (lookaheadAndCheck(tokens.name) === true || lookaheadAndCheck(tokens.valtype) === true || token.type === "keyword" // is any keyword + ) { + consequent.push(parseFuncInstr()); + } else { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unexpected token in consequent body of type" + ", given " + tokenToString(token)); + }(); + } + + eatTokenOfType(tokens.closeParen); + } + + eatTokenOfType(tokens.closeParen); + continue; + } + /** + * Alternate + */ + + + if (isKeyword(token, keywords.else)) { + eatToken(); // else + + while (token.type === tokens.openParen) { + eatToken(); // Instruction + + if (lookaheadAndCheck(tokens.name) === true || lookaheadAndCheck(tokens.valtype) === true || token.type === "keyword" // is any keyword + ) { + alternate.push(parseFuncInstr()); + } else { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unexpected token in alternate body of type" + ", given " + tokenToString(token)); + }(); + } + + eatTokenOfType(tokens.closeParen); + } + + eatTokenOfType(tokens.closeParen); + continue; + } + /** + * Test instruction + */ + + + if (lookaheadAndCheck(tokens.name) === true || lookaheadAndCheck(tokens.valtype) === true || token.type === "keyword" // is any keyword + ) { + testInstrs.push(parseFuncInstr()); + eatTokenOfType(tokens.closeParen); + continue; + } + + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unexpected token in if body" + ", given " + tokenToString(token)); + }(); + } + + return t.ifInstruction(label, testInstrs, blockResult, consequent, alternate); + } + /** + * Parses a loop instruction + * + * WAT: + * + * blockinstr :: 'loop' I:label rt:resulttype (in:instr*) 'end' id? + * + * WAST: + * + * instr :: loop ? * end ? + * expr :: ( loop ? * ) + * block_sig :: ( result * )* + * + */ + + + function parseLoop() { + var label = t.identifier(getUniqueName("loop")); + var blockResult; + var instr = []; + + if (token.type === tokens.identifier) { + label = identifierFromToken(token); + eatToken(); + } else { + label = t.withRaw(label, ""); // preserve anonymous + } + + while (token.type === tokens.openParen) { + eatToken(); + + if (lookaheadAndCheck(keywords.result) === true) { + eatToken(); + blockResult = token.value; + eatToken(); + } else if (lookaheadAndCheck(tokens.name) === true || lookaheadAndCheck(tokens.valtype) === true || token.type === "keyword" // is any keyword + ) { + // Instruction + instr.push(parseFuncInstr()); + } else { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unexpected token in loop body" + ", given " + tokenToString(token)); + }(); + } + + eatTokenOfType(tokens.closeParen); + } + + return t.loopInstruction(label, blockResult, instr); + } + + function parseCallIndirect() { + var typeRef; + var params = []; + var results = []; + var instrs = []; + + while (token.type !== tokens.closeParen) { + if (lookaheadAndCheck(tokens.openParen, keywords.type)) { + eatToken(); // ( + + eatToken(); // type + + typeRef = parseTypeReference(); + } else if (lookaheadAndCheck(tokens.openParen, keywords.param)) { + eatToken(); // ( + + eatToken(); // param + + /** + * Params can be empty: + * (params)` + */ + + if (token.type !== tokens.closeParen) { + params.push.apply(params, _toConsumableArray(parseFuncParam())); + } + } else if (lookaheadAndCheck(tokens.openParen, keywords.result)) { + eatToken(); // ( + + eatToken(); // result + + /** + * Results can be empty: + * (result)` + */ + + if (token.type !== tokens.closeParen) { + results.push.apply(results, _toConsumableArray(parseFuncResult())); + } + } else { + eatTokenOfType(tokens.openParen); + instrs.push(parseFuncInstr()); + } + + eatTokenOfType(tokens.closeParen); + } + + return t.callIndirectInstruction(typeRef !== undefined ? typeRef : t.signature(params, results), instrs); + } + /** + * Parses an export instruction + * + * WAT: + * + * export: ( export ) + * exkind: ( func ) + * ( global ) + * ( table ) + * ( memory ) + * var: | + * + */ + + + function parseExport() { + if (token.type !== tokens.string) { + throw new Error("Expected string after export, got: " + token.type); + } + + var name = token.value; + eatToken(); + var moduleExportDescr = parseModuleExportDescr(); + return t.moduleExport(name, moduleExportDescr); + } + + function parseModuleExportDescr() { + var startLoc = getStartLoc(); + var type = ""; + var index; + eatTokenOfType(tokens.openParen); + + while (token.type !== tokens.closeParen) { + if (isKeyword(token, keywords.func)) { + type = "Func"; + eatToken(); + index = parseExportIndex(token); + } else if (isKeyword(token, keywords.table)) { + type = "Table"; + eatToken(); + index = parseExportIndex(token); + } else if (isKeyword(token, keywords.global)) { + type = "Global"; + eatToken(); + index = parseExportIndex(token); + } else if (isKeyword(token, keywords.memory)) { + type = "Memory"; + eatToken(); + index = parseExportIndex(token); + } + + eatToken(); + } + + if (type === "") { + throw new Error("Unknown export type"); + } + + if (index === undefined) { + throw new Error("Exported function must have a name"); + } + + var node = t.moduleExportDescr(type, index); + var endLoc = getEndLoc(); + eatTokenOfType(tokens.closeParen); + return t.withLoc(node, endLoc, startLoc); + } + + function parseModule() { + var name = null; + var isBinary = false; + var isQuote = false; + var moduleFields = []; + + if (token.type === tokens.identifier) { + name = token.value; + eatToken(); + } + + if (hasPlugin("wast") && token.type === tokens.name && token.value === "binary") { + eatToken(); + isBinary = true; + } + + if (hasPlugin("wast") && token.type === tokens.name && token.value === "quote") { + eatToken(); + isQuote = true; + } + + if (isBinary === true) { + var blob = []; + + while (token.type === tokens.string) { + blob.push(token.value); + eatToken(); + maybeIgnoreComment(); + } + + eatTokenOfType(tokens.closeParen); + return t.binaryModule(name, blob); + } + + if (isQuote === true) { + var string = []; + + while (token.type === tokens.string) { + string.push(token.value); + eatToken(); + } + + eatTokenOfType(tokens.closeParen); + return t.quoteModule(name, string); + } + + while (token.type !== tokens.closeParen) { + moduleFields.push(walk()); + + if (state.registredExportedElements.length > 0) { + state.registredExportedElements.forEach(function (decl) { + moduleFields.push(t.moduleExport(decl.name, t.moduleExportDescr(decl.exportType, decl.id))); + }); + state.registredExportedElements = []; + } + + token = tokensList[current]; + } + + eatTokenOfType(tokens.closeParen); + return t.module(name, moduleFields); + } + /** + * Parses the arguments of an instruction + */ + + + function parseFuncInstrArguments(signature) { + var args = []; + var namedArgs = {}; + var signaturePtr = 0; + + while (token.type === tokens.name || isKeyword(token, keywords.offset)) { + var key = token.value; + eatToken(); + eatTokenOfType(tokens.equal); + var value = void 0; + + if (token.type === tokens.number) { + value = t.numberLiteralFromRaw(token.value); + } else { + throw new Error("Unexpected type for argument: " + token.type); + } + + namedArgs[key] = value; + eatToken(); + } // $FlowIgnore + + + var signatureLength = signature.vector ? Infinity : signature.length; + + while (token.type !== tokens.closeParen && ( // $FlowIgnore + token.type === tokens.openParen || signaturePtr < signatureLength)) { + if (token.type === tokens.identifier) { + args.push(t.identifier(token.value)); + eatToken(); + } else if (token.type === tokens.valtype) { + // Handle locals + args.push(t.valtypeLiteral(token.value)); + eatToken(); + } else if (token.type === tokens.string) { + args.push(t.stringLiteral(token.value)); + eatToken(); + } else if (token.type === tokens.number) { + args.push( // TODO(sven): refactor the type signature handling + // https://github.com/xtuc/webassemblyjs/pull/129 is a good start + t.numberLiteralFromRaw(token.value, // $FlowIgnore + signature[signaturePtr] || "f64")); // $FlowIgnore + + if (!signature.vector) { + ++signaturePtr; + } + + eatToken(); + } else if (token.type === tokens.openParen) { + /** + * Maybe some nested instructions + */ + eatToken(); // Instruction + + if (lookaheadAndCheck(tokens.name) === true || lookaheadAndCheck(tokens.valtype) === true || token.type === "keyword" // is any keyword + ) { + // $FlowIgnore + args.push(parseFuncInstr()); + } else { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unexpected token in nested instruction" + ", given " + tokenToString(token)); + }(); + } + + if (token.type === tokens.closeParen) { + eatToken(); + } + } else { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unexpected token in instruction argument" + ", given " + tokenToString(token)); + }(); + } + } + + return { + args: args, + namedArgs: namedArgs + }; + } + /** + * Parses an instruction + * + * WAT: + * + * instr :: plaininst + * blockinstr + * + * blockinstr :: 'block' I:label rt:resulttype (in:instr*) 'end' id? + * 'loop' I:label rt:resulttype (in:instr*) 'end' id? + * 'if' I:label rt:resulttype (in:instr*) 'else' id? (in2:intr*) 'end' id? + * + * plaininst :: 'unreachable' + * 'nop' + * 'br' l:labelidx + * 'br_if' l:labelidx + * 'br_table' l*:vec(labelidx) ln:labelidx + * 'return' + * 'call' x:funcidx + * 'call_indirect' x, I:typeuse + * + * WAST: + * + * instr: + * + * + * block ? * end ? + * loop ? * end ? + * if ? * end ? + * if ? * else ? * end ? + * + * expr: + * ( ) + * ( + ) + * ( block ? * ) + * ( loop ? * ) + * ( if ? ( then * ) ( else * )? ) + * ( if ? + ( then * ) ( else * )? ) + * + * op: + * unreachable + * nop + * br + * br_if + * br_table + + * return + * call + * call_indirect + * drop + * select + * get_local + * set_local + * tee_local + * get_global + * set_global + * .load((8|16|32)_)? ? ? + * .store(8|16|32)? ? ? + * current_memory + * grow_memory + * .const + * . + * . + * . + * . + * ./ + * + * func_type: ( type )? * * + */ + + + function parseFuncInstr() { + var startLoc = getStartLoc(); + maybeIgnoreComment(); + /** + * A simple instruction + */ + + if (token.type === tokens.name || token.type === tokens.valtype) { + var _name2 = token.value; + var object; + eatToken(); + + if (token.type === tokens.dot) { + object = _name2; + eatToken(); + + if (token.type !== tokens.name) { + throw new TypeError("Unknown token: " + token.type + ", name expected"); + } + + _name2 = token.value; + eatToken(); + } + + if (token.type === tokens.closeParen) { + var _endLoc = token.loc.end; + + if (typeof object === "undefined") { + return t.withLoc(t.instruction(_name2), _endLoc, startLoc); + } else { + return t.withLoc(t.objectInstruction(_name2, object, []), _endLoc, startLoc); + } + } + + var signature = t.signatureForOpcode(object || "", _name2); + + var _parseFuncInstrArgume = parseFuncInstrArguments(signature), + _args = _parseFuncInstrArgume.args, + _namedArgs = _parseFuncInstrArgume.namedArgs; + + var endLoc = token.loc.end; + + if (typeof object === "undefined") { + return t.withLoc(t.instruction(_name2, _args, _namedArgs), endLoc, startLoc); + } else { + return t.withLoc(t.objectInstruction(_name2, object, _args, _namedArgs), endLoc, startLoc); + } + } else if (isKeyword(token, keywords.loop)) { + /** + * Else a instruction with a keyword (loop or block) + */ + eatToken(); // keyword + + return parseLoop(); + } else if (isKeyword(token, keywords.block)) { + eatToken(); // keyword + + return parseBlock(); + } else if (isKeyword(token, keywords.call_indirect)) { + eatToken(); // keyword + + return parseCallIndirect(); + } else if (isKeyword(token, keywords.call)) { + eatToken(); // keyword + + var index; + + if (token.type === tokens.identifier) { + index = identifierFromToken(token); + eatToken(); + } else if (token.type === tokens.number) { + index = t.indexLiteral(token.value); + eatToken(); + } + + var instrArgs = []; // Nested instruction + + while (token.type === tokens.openParen) { + eatToken(); + instrArgs.push(parseFuncInstr()); + eatTokenOfType(tokens.closeParen); + } + + if (typeof index === "undefined") { + throw new Error("Missing argument in call instruciton"); + } + + if (instrArgs.length > 0) { + return t.callInstruction(index, instrArgs); + } else { + return t.callInstruction(index); + } + } else if (isKeyword(token, keywords.if)) { + eatToken(); // Keyword + + return parseIf(); + } else if (isKeyword(token, keywords.module) && hasPlugin("wast")) { + eatToken(); // In WAST you can have a module as an instruction's argument + // we will cast it into a instruction to not break the flow + // $FlowIgnore + + var module = parseModule(); + return module; + } else { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unexpected instruction in function body" + ", given " + tokenToString(token)); + }(); + } + } + /* + * Parses a function + * + * WAT: + * + * functype :: ( 'func' t1:vec(param) t2:vec(result) ) + * param :: ( 'param' id? t:valtype ) + * result :: ( 'result' t:valtype ) + * + * WAST: + * + * func :: ( func ? * * ) + * ( func ? ( export ) <...> ) + * ( func ? ( import ) ) + * func_sig :: ( type )? * * + * param :: ( param * ) | ( param ) + * result :: ( result * ) + * local :: ( local * ) | ( local ) + * + */ + + + function parseFunc() { + var fnName = t.identifier(getUniqueName("func")); + var typeRef; + var fnBody = []; + var fnParams = []; + var fnResult = []; // name + + if (token.type === tokens.identifier) { + fnName = identifierFromToken(token); + eatToken(); + } else { + fnName = t.withRaw(fnName, ""); // preserve anonymous + } + + maybeIgnoreComment(); + + while (token.type === tokens.openParen || token.type === tokens.name || token.type === tokens.valtype) { + // Instructions without parens + if (token.type === tokens.name || token.type === tokens.valtype) { + fnBody.push(parseFuncInstr()); + continue; + } + + eatToken(); + + if (lookaheadAndCheck(keywords.param) === true) { + eatToken(); + fnParams.push.apply(fnParams, _toConsumableArray(parseFuncParam())); + } else if (lookaheadAndCheck(keywords.result) === true) { + eatToken(); + fnResult.push.apply(fnResult, _toConsumableArray(parseFuncResult())); + } else if (lookaheadAndCheck(keywords.export) === true) { + eatToken(); + parseFuncExport(fnName); + } else if (lookaheadAndCheck(keywords.type) === true) { + eatToken(); + typeRef = parseTypeReference(); + } else if (lookaheadAndCheck(tokens.name) === true || lookaheadAndCheck(tokens.valtype) === true || token.type === "keyword" // is any keyword + ) { + // Instruction + fnBody.push(parseFuncInstr()); + } else { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unexpected token in func body" + ", given " + tokenToString(token)); + }(); + } + + eatTokenOfType(tokens.closeParen); + } + + return t.func(fnName, typeRef !== undefined ? typeRef : t.signature(fnParams, fnResult), fnBody); + } + /** + * Parses shorthand export in func + * + * export :: ( export ) + */ + + + function parseFuncExport(funcId) { + if (token.type !== tokens.string) { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Function export expected a string" + ", given " + tokenToString(token)); + }(); + } + + var name = token.value; + eatToken(); + /** + * Func export shorthand, we trait it as a syntaxic sugar. + * A export ModuleField will be added later. + * + * We give the anonymous function a generated name and export it. + */ + + var id = t.identifier(funcId.value); + state.registredExportedElements.push({ + exportType: "Func", + name: name, + id: id + }); + } + /** + * Parses a type instruction + * + * WAST: + * + * typedef: ( type ? ( func * * ) ) + */ + + + function parseType() { + var id; + var params = []; + var result = []; + + if (token.type === tokens.identifier) { + id = identifierFromToken(token); + eatToken(); + } + + if (lookaheadAndCheck(tokens.openParen, keywords.func)) { + eatToken(); // ( + + eatToken(); // func + + if (token.type === tokens.closeParen) { + eatToken(); // function with an empty signature, we can abort here + + return t.typeInstruction(id, t.signature([], [])); + } + + if (lookaheadAndCheck(tokens.openParen, keywords.param)) { + eatToken(); // ( + + eatToken(); // param + + params = parseFuncParam(); + eatTokenOfType(tokens.closeParen); + } + + if (lookaheadAndCheck(tokens.openParen, keywords.result)) { + eatToken(); // ( + + eatToken(); // result + + result = parseFuncResult(); + eatTokenOfType(tokens.closeParen); + } + + eatTokenOfType(tokens.closeParen); + } + + return t.typeInstruction(id, t.signature(params, result)); + } + /** + * Parses a function result + * + * WAST: + * + * result :: ( result * ) + */ + + + function parseFuncResult() { + var results = []; + + while (token.type !== tokens.closeParen) { + if (token.type !== tokens.valtype) { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unexpected token in func result" + ", given " + tokenToString(token)); + }(); + } + + var valtype = token.value; + eatToken(); + results.push(valtype); + } + + return results; + } + /** + * Parses a type reference + * + */ + + + function parseTypeReference() { + var ref; + + if (token.type === tokens.identifier) { + ref = identifierFromToken(token); + eatToken(); + } else if (token.type === tokens.number) { + ref = t.numberLiteralFromRaw(token.value); + eatToken(); + } + + return ref; + } + /** + * Parses a global instruction + * + * WAST: + * + * global: ( global ? * ) + * ( global ? ( export ) <...> ) + * ( global ? ( import ) ) + * + * global_sig: | ( mut ) + * + */ + + + function parseGlobal() { + var name = t.identifier(getUniqueName("global")); + var type; // Keep informations in case of a shorthand import + + var importing = null; + maybeIgnoreComment(); + + if (token.type === tokens.identifier) { + name = identifierFromToken(token); + eatToken(); + } else { + name = t.withRaw(name, ""); // preserve anonymous + } + /** + * maybe export + */ + + + if (lookaheadAndCheck(tokens.openParen, keywords.export)) { + eatToken(); // ( + + eatToken(); // export + + var exportName = token.value; + eatTokenOfType(tokens.string); + state.registredExportedElements.push({ + exportType: "Global", + name: exportName, + id: name + }); + eatTokenOfType(tokens.closeParen); + } + /** + * maybe import + */ + + + if (lookaheadAndCheck(tokens.openParen, keywords.import)) { + eatToken(); // ( + + eatToken(); // import + + var moduleName = token.value; + eatTokenOfType(tokens.string); + var _name3 = token.value; + eatTokenOfType(tokens.string); + importing = { + module: moduleName, + name: _name3, + descr: undefined + }; + eatTokenOfType(tokens.closeParen); + } + /** + * global_sig + */ + + + if (token.type === tokens.valtype) { + type = t.globalType(token.value, "const"); + eatToken(); + } else if (token.type === tokens.openParen) { + eatToken(); // ( + + if (isKeyword(token, keywords.mut) === false) { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unsupported global type, expected mut" + ", given " + tokenToString(token)); + }(); + } + + eatToken(); // mut + + type = t.globalType(token.value, "var"); + eatToken(); + eatTokenOfType(tokens.closeParen); + } + + if (type === undefined) { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Could not determine global type" + ", given " + tokenToString(token)); + }(); + } + + maybeIgnoreComment(); + var init = []; + + if (importing != null) { + importing.descr = type; + init.push(t.moduleImport(importing.module, importing.name, importing.descr)); + } + /** + * instr* + */ + + + while (token.type === tokens.openParen) { + eatToken(); + init.push(parseFuncInstr()); + eatTokenOfType(tokens.closeParen); + } + + return t.global(type, init, name); + } + /** + * Parses a function param + * + * WAST: + * + * param :: ( param * ) | ( param ) + */ + + + function parseFuncParam() { + var params = []; + var id; + var valtype; + + if (token.type === tokens.identifier) { + id = token.value; + eatToken(); + } + + if (token.type === tokens.valtype) { + valtype = token.value; + eatToken(); + params.push({ + id: id, + valtype: valtype + }); + /** + * Shorthand notation for multiple anonymous parameters + * @see https://webassembly.github.io/spec/core/text/types.html#function-types + * @see https://github.com/xtuc/webassemblyjs/issues/6 + */ + + if (id === undefined) { + while (token.type === tokens.valtype) { + valtype = token.value; + eatToken(); + params.push({ + id: undefined, + valtype: valtype + }); + } + } + } else {// ignore + } + + return params; + } + /** + * Parses an element segments instruction + * + * WAST: + * + * elem: ( elem ? (offset * ) * ) + * ( elem ? * ) + * + * var: | + */ + + + function parseElem() { + var tableIndex = t.indexLiteral(0); + var offset = []; + var funcs = []; + + if (token.type === tokens.identifier) { + tableIndex = identifierFromToken(token); + eatToken(); + } + + if (token.type === tokens.number) { + tableIndex = t.indexLiteral(token.value); + eatToken(); + } + + while (token.type !== tokens.closeParen) { + if (lookaheadAndCheck(tokens.openParen, keywords.offset)) { + eatToken(); // ( + + eatToken(); // offset + + while (token.type !== tokens.closeParen) { + eatTokenOfType(tokens.openParen); + offset.push(parseFuncInstr()); + eatTokenOfType(tokens.closeParen); + } + + eatTokenOfType(tokens.closeParen); + } else if (token.type === tokens.identifier) { + funcs.push(t.identifier(token.value)); + eatToken(); + } else if (token.type === tokens.number) { + funcs.push(t.indexLiteral(token.value)); + eatToken(); + } else if (token.type === tokens.openParen) { + eatToken(); // ( + + offset.push(parseFuncInstr()); + eatTokenOfType(tokens.closeParen); + } else { + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unsupported token in elem" + ", given " + tokenToString(token)); + }(); + } + } + + return t.elem(tableIndex, offset, funcs); + } + /** + * Parses the start instruction in a module + * + * WAST: + * + * start: ( start ) + * var: | + * + * WAT: + * start ::= ‘(’ ‘start’ x:funcidx ‘)’ + */ + + + function parseStart() { + if (token.type === tokens.identifier) { + var index = identifierFromToken(token); + eatToken(); + return t.start(index); + } + + if (token.type === tokens.number) { + var _index2 = t.indexLiteral(token.value); + + eatToken(); + return t.start(_index2); + } + + throw new Error("Unknown start, token: " + tokenToString(token)); + } + + if (token.type === tokens.openParen) { + eatToken(); + var startLoc = getStartLoc(); + + if (isKeyword(token, keywords.export)) { + eatToken(); + var node = parseExport(); + + var _endLoc2 = getEndLoc(); + + return t.withLoc(node, _endLoc2, startLoc); + } + + if (isKeyword(token, keywords.loop)) { + eatToken(); + + var _node = parseLoop(); + + var _endLoc3 = getEndLoc(); + + return t.withLoc(_node, _endLoc3, startLoc); + } + + if (isKeyword(token, keywords.func)) { + eatToken(); + + var _node2 = parseFunc(); + + var _endLoc4 = getEndLoc(); + + maybeIgnoreComment(); + eatTokenOfType(tokens.closeParen); + return t.withLoc(_node2, _endLoc4, startLoc); + } + + if (isKeyword(token, keywords.module)) { + eatToken(); + + var _node3 = parseModule(); + + var _endLoc5 = getEndLoc(); + + return t.withLoc(_node3, _endLoc5, startLoc); + } + + if (isKeyword(token, keywords.import)) { + eatToken(); + + var _node4 = parseImport(); + + var _endLoc6 = getEndLoc(); + + eatTokenOfType(tokens.closeParen); + return t.withLoc(_node4, _endLoc6, startLoc); + } + + if (isKeyword(token, keywords.block)) { + eatToken(); + + var _node5 = parseBlock(); + + var _endLoc7 = getEndLoc(); + + eatTokenOfType(tokens.closeParen); + return t.withLoc(_node5, _endLoc7, startLoc); + } + + if (isKeyword(token, keywords.memory)) { + eatToken(); + + var _node6 = parseMemory(); + + var _endLoc8 = getEndLoc(); + + eatTokenOfType(tokens.closeParen); + return t.withLoc(_node6, _endLoc8, startLoc); + } + + if (isKeyword(token, keywords.data)) { + eatToken(); + + var _node7 = parseData(); + + var _endLoc9 = getEndLoc(); + + eatTokenOfType(tokens.closeParen); + return t.withLoc(_node7, _endLoc9, startLoc); + } + + if (isKeyword(token, keywords.table)) { + eatToken(); + + var _node8 = parseTable(); + + var _endLoc10 = getEndLoc(); + + eatTokenOfType(tokens.closeParen); + return t.withLoc(_node8, _endLoc10, startLoc); + } + + if (isKeyword(token, keywords.global)) { + eatToken(); + + var _node9 = parseGlobal(); + + var _endLoc11 = getEndLoc(); + + eatTokenOfType(tokens.closeParen); + return t.withLoc(_node9, _endLoc11, startLoc); + } + + if (isKeyword(token, keywords.type)) { + eatToken(); + + var _node10 = parseType(); + + var _endLoc12 = getEndLoc(); + + eatTokenOfType(tokens.closeParen); + return t.withLoc(_node10, _endLoc12, startLoc); + } + + if (isKeyword(token, keywords.start)) { + eatToken(); + + var _node11 = parseStart(); + + var _endLoc13 = getEndLoc(); + + eatTokenOfType(tokens.closeParen); + return t.withLoc(_node11, _endLoc13, startLoc); + } + + if (isKeyword(token, keywords.elem)) { + eatToken(); + + var _node12 = parseElem(); + + var _endLoc14 = getEndLoc(); + + eatTokenOfType(tokens.closeParen); + return t.withLoc(_node12, _endLoc14, startLoc); + } + + var instruction = parseFuncInstr(); + var endLoc = getEndLoc(); + maybeIgnoreComment(); + + if (_typeof(instruction) === "object") { + if (typeof token !== "undefined") { + eatTokenOfType(tokens.closeParen); + } + + return t.withLoc(instruction, endLoc, startLoc); + } + } + + if (token.type === tokens.comment) { + var _startLoc = getStartLoc(); + + var builder = token.opts.type === "leading" ? t.leadingComment : t.blockComment; + + var _node13 = builder(token.value); + + eatToken(); // comment + + var _endLoc15 = getEndLoc(); + + return t.withLoc(_node13, _endLoc15, _startLoc); + } + + throw function () { + return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unknown token" + ", given " + tokenToString(token)); + }(); + } + + var body = []; + + while (current < tokensList.length) { + body.push(walk()); + } + + return t.program(body); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wast-parser/esm/index.js b/node_modules/@webassemblyjs/wast-parser/esm/index.js new file mode 100644 index 0000000..70cda38 --- /dev/null +++ b/node_modules/@webassemblyjs/wast-parser/esm/index.js @@ -0,0 +1,9 @@ +import * as parser from "./grammar"; +import { tokenize } from "./tokenizer"; +export function parse(source) { + var tokens = tokenize(source); // We pass the source here to show code frames + + var ast = parser.parse(tokens, source); + return ast; +} +export * from "./number-literals"; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wast-parser/esm/number-literals.js b/node_modules/@webassemblyjs/wast-parser/esm/number-literals.js new file mode 100644 index 0000000..98b8996 --- /dev/null +++ b/node_modules/@webassemblyjs/wast-parser/esm/number-literals.js @@ -0,0 +1,91 @@ +import Long from "@xtuc/long"; +import parseHexFloat from "@webassemblyjs/floating-point-hex-parser"; +import { CompileError } from "@webassemblyjs/helper-api-error"; +export function parse32F(sourceString) { + if (isHexLiteral(sourceString)) { + return parseHexFloat(sourceString); + } + + if (isInfLiteral(sourceString)) { + return sourceString[0] === "-" ? -1 : 1; + } + + if (isNanLiteral(sourceString)) { + return (sourceString[0] === "-" ? -1 : 1) * (sourceString.includes(":") ? parseInt(sourceString.substring(sourceString.indexOf(":") + 1), 16) : 0x400000); + } + + return parseFloat(sourceString); +} +export function parse64F(sourceString) { + if (isHexLiteral(sourceString)) { + return parseHexFloat(sourceString); + } + + if (isInfLiteral(sourceString)) { + return sourceString[0] === "-" ? -1 : 1; + } + + if (isNanLiteral(sourceString)) { + return (sourceString[0] === "-" ? -1 : 1) * (sourceString.includes(":") ? parseInt(sourceString.substring(sourceString.indexOf(":") + 1), 16) : 0x8000000000000); + } + + if (isHexLiteral(sourceString)) { + return parseHexFloat(sourceString); + } + + return parseFloat(sourceString); +} +export function parse32I(sourceString) { + var value = 0; + + if (isHexLiteral(sourceString)) { + value = ~~parseInt(sourceString, 16); + } else if (isDecimalExponentLiteral(sourceString)) { + throw new Error("This number literal format is yet to be implemented."); + } else { + value = parseInt(sourceString, 10); + } + + return value; +} +export function parseU32(sourceString) { + var value = parse32I(sourceString); + + if (value < 0) { + throw new CompileError("Illegal value for u32: " + sourceString); + } + + return value; +} +export function parse64I(sourceString) { + var long; + + if (isHexLiteral(sourceString)) { + long = Long.fromString(sourceString, false, 16); + } else if (isDecimalExponentLiteral(sourceString)) { + throw new Error("This number literal format is yet to be implemented."); + } else { + long = Long.fromString(sourceString); + } + + return { + high: long.high, + low: long.low + }; +} +var NAN_WORD = /^\+?-?nan/; +var INF_WORD = /^\+?-?inf/; +export function isInfLiteral(sourceString) { + return INF_WORD.test(sourceString.toLowerCase()); +} +export function isNanLiteral(sourceString) { + return NAN_WORD.test(sourceString.toLowerCase()); +} + +function isDecimalExponentLiteral(sourceString) { + return !isHexLiteral(sourceString) && sourceString.toUpperCase().includes("E"); +} + +function isHexLiteral(sourceString) { + return sourceString.substring(0, 2).toUpperCase() === "0X" || sourceString.substring(0, 3).toUpperCase() === "-0X"; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wast-parser/esm/string-literals.js b/node_modules/@webassemblyjs/wast-parser/esm/string-literals.js new file mode 100644 index 0000000..3f55e82 --- /dev/null +++ b/node_modules/@webassemblyjs/wast-parser/esm/string-literals.js @@ -0,0 +1,88 @@ +// string literal characters cannot contain control codes +var CONTROL_CODES = [0, // null +7, // bell +8, // backspace +9, // horizontal +10, // line feed +11, // vertical tab +12, // form feed +13, // carriage return +26, // Control-Z +27, // escape +127 // delete +]; // escaped sequences can either be a two character hex value, or one of the +// following single character codes + +function decodeControlCharacter(char) { + switch (char) { + case "t": + return 0x09; + + case "n": + return 0x0a; + + case "r": + return 0x0d; + + case '"': + return 0x22; + + case "′": + return 0x27; + + case "\\": + return 0x5c; + } + + return -1; +} + +var ESCAPE_CHAR = 92; // backslash + +var QUOTE_CHAR = 34; // backslash +// parse string as per the spec: +// https://webassembly.github.io/spec/core/multipage/text/values.html#text-string + +export function parseString(value) { + var byteArray = []; + var index = 0; + + while (index < value.length) { + var charCode = value.charCodeAt(index); + + if (CONTROL_CODES.indexOf(charCode) !== -1) { + throw new Error("ASCII control characters are not permitted within string literals"); + } + + if (charCode === QUOTE_CHAR) { + throw new Error("quotes are not permitted within string literals"); + } + + if (charCode === ESCAPE_CHAR) { + var firstChar = value.substr(index + 1, 1); + var decodedControlChar = decodeControlCharacter(firstChar); + + if (decodedControlChar !== -1) { + // single character escaped values, e.g. \r + byteArray.push(decodedControlChar); + index += 2; + } else { + // hex escaped values, e.g. \2a + var hexValue = value.substr(index + 1, 2); + + if (!/^[0-9A-F]{2}$/i.test(hexValue)) { + throw new Error("invalid character encoding"); + } + + byteArray.push(parseInt(hexValue, 16)); + index += 3; + } + } else { + // ASCII encoded values + byteArray.push(charCode); + index++; + } + } + + return byteArray; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wast-parser/esm/tokenizer.js b/node_modules/@webassemblyjs/wast-parser/esm/tokenizer.js new file mode 100644 index 0000000..30f9098 --- /dev/null +++ b/node_modules/@webassemblyjs/wast-parser/esm/tokenizer.js @@ -0,0 +1,434 @@ +import { FSM, makeTransition } from "@webassemblyjs/helper-fsm"; +import { codeFrameFromSource } from "@webassemblyjs/helper-code-frame"; + +// eslint-disable-next-line +function getCodeFrame(source, line, column) { + var loc = { + start: { + line: line, + column: column + } + }; + return "\n" + codeFrameFromSource(source, loc) + "\n"; +} + +var WHITESPACE = /\s/; +var PARENS = /\(|\)/; +var LETTERS = /[a-z0-9_/]/i; +var idchar = /[a-z0-9!#$%&*+./:<=>?@\\[\]^_`|~-]/i; +var valtypes = ["i32", "i64", "f32", "f64"]; +var NUMBERS = /[0-9|.|_]/; +var NUMBER_KEYWORDS = /nan|inf/; + +function isNewLine(char) { + return char.charCodeAt(0) === 10 || char.charCodeAt(0) === 13; +} + +function Token(type, value, start, end) { + var opts = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; + var token = { + type: type, + value: value, + loc: { + start: start, + end: end + } + }; + + if (Object.keys(opts).length > 0) { + // $FlowIgnore + token["opts"] = opts; + } + + return token; +} + +var tokenTypes = { + openParen: "openParen", + closeParen: "closeParen", + number: "number", + string: "string", + name: "name", + identifier: "identifier", + valtype: "valtype", + dot: "dot", + comment: "comment", + equal: "equal", + keyword: "keyword" +}; +export var keywords = { + module: "module", + func: "func", + param: "param", + result: "result", + export: "export", + loop: "loop", + block: "block", + if: "if", + then: "then", + else: "else", + call: "call", + call_indirect: "call_indirect", + import: "import", + memory: "memory", + table: "table", + global: "global", + anyfunc: "anyfunc", + mut: "mut", + data: "data", + type: "type", + elem: "elem", + start: "start", + offset: "offset" +}; +var NUMERIC_SEPARATOR = "_"; +/** + * Build the FSM for number literals + */ + +var numberLiteralFSM = new FSM({ + START: [makeTransition(/-|\+/, "AFTER_SIGN"), makeTransition(/nan:0x/, "NAN_HEX", { + n: 6 + }), makeTransition(/nan|inf/, "STOP", { + n: 3 + }), makeTransition(/0x/, "HEX", { + n: 2 + }), makeTransition(/[0-9]/, "DEC"), makeTransition(/\./, "DEC_FRAC")], + AFTER_SIGN: [makeTransition(/nan:0x/, "NAN_HEX", { + n: 6 + }), makeTransition(/nan|inf/, "STOP", { + n: 3 + }), makeTransition(/0x/, "HEX", { + n: 2 + }), makeTransition(/[0-9]/, "DEC"), makeTransition(/\./, "DEC_FRAC")], + DEC_FRAC: [makeTransition(/[0-9]/, "DEC_FRAC", { + allowedSeparator: NUMERIC_SEPARATOR + }), makeTransition(/e|E/, "DEC_SIGNED_EXP")], + DEC: [makeTransition(/[0-9]/, "DEC", { + allowedSeparator: NUMERIC_SEPARATOR + }), makeTransition(/\./, "DEC_FRAC"), makeTransition(/e|E/, "DEC_SIGNED_EXP")], + DEC_SIGNED_EXP: [makeTransition(/\+|-/, "DEC_EXP"), makeTransition(/[0-9]/, "DEC_EXP")], + DEC_EXP: [makeTransition(/[0-9]/, "DEC_EXP", { + allowedSeparator: NUMERIC_SEPARATOR + })], + HEX: [makeTransition(/[0-9|A-F|a-f]/, "HEX", { + allowedSeparator: NUMERIC_SEPARATOR + }), makeTransition(/\./, "HEX_FRAC"), makeTransition(/p|P/, "HEX_SIGNED_EXP")], + HEX_FRAC: [makeTransition(/[0-9|A-F|a-f]/, "HEX_FRAC", { + allowedSeparator: NUMERIC_SEPARATOR + }), makeTransition(/p|P|/, "HEX_SIGNED_EXP")], + HEX_SIGNED_EXP: [makeTransition(/[0-9|+|-]/, "HEX_EXP")], + HEX_EXP: [makeTransition(/[0-9]/, "HEX_EXP", { + allowedSeparator: NUMERIC_SEPARATOR + })], + NAN_HEX: [makeTransition(/[0-9|A-F|a-f]/, "NAN_HEX", { + allowedSeparator: NUMERIC_SEPARATOR + })], + STOP: [] +}, "START", "STOP"); +export function tokenize(input) { + var current = 0; + var char = input[current]; // Used by SourceLocation + + var column = 1; + var line = 1; + var tokens = []; + /** + * Creates a pushToken function for a given type + */ + + function pushToken(type) { + return function (v) { + var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var startColumn = opts.startColumn || column - String(v).length; + delete opts.startColumn; + var endColumn = opts.endColumn || startColumn + String(v).length - 1; + delete opts.endColumn; + var start = { + line: line, + column: startColumn + }; + var end = { + line: line, + column: endColumn + }; + tokens.push(Token(type, v, start, end, opts)); + }; + } + /** + * Functions to save newly encountered tokens + */ + + + var pushCloseParenToken = pushToken(tokenTypes.closeParen); + var pushOpenParenToken = pushToken(tokenTypes.openParen); + var pushNumberToken = pushToken(tokenTypes.number); + var pushValtypeToken = pushToken(tokenTypes.valtype); + var pushNameToken = pushToken(tokenTypes.name); + var pushIdentifierToken = pushToken(tokenTypes.identifier); + var pushKeywordToken = pushToken(tokenTypes.keyword); + var pushDotToken = pushToken(tokenTypes.dot); + var pushStringToken = pushToken(tokenTypes.string); + var pushCommentToken = pushToken(tokenTypes.comment); + var pushEqualToken = pushToken(tokenTypes.equal); + /** + * Can be used to look at the next character(s). + * + * The default behavior `lookahead()` simply returns the next character without consuming it. + * Letters are always returned in lowercase. + * + * @param {number} length How many characters to query. Default = 1 + * @param {number} offset How many characters to skip forward from current one. Default = 1 + * + */ + + function lookahead() { + var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; + return input.substring(current + offset, current + offset + length).toLowerCase(); + } + /** + * Advances the cursor in the input by a certain amount + * + * @param {number} amount How many characters to consume. Default = 1 + */ + + + function eatCharacter() { + var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + column += amount; + current += amount; + char = input[current]; + } + + while (current < input.length) { + // ;; + if (char === ";" && lookahead() === ";") { + var startColumn = column; + eatCharacter(2); + var text = ""; + + while (!isNewLine(char)) { + text += char; + eatCharacter(); + + if (char === undefined) { + break; + } + } + + var endColumn = column; + pushCommentToken(text, { + type: "leading", + startColumn: startColumn, + endColumn: endColumn + }); + continue; + } // (; + + + if (char === "(" && lookahead() === ";") { + var _startColumn = column; + eatCharacter(2); + var _text = ""; // ;) + + while (true) { + char = input[current]; + + if (char === ";" && lookahead() === ")") { + eatCharacter(2); + break; + } + + _text += char; + eatCharacter(); + + if (isNewLine(char)) { + line++; + column = 0; + } + } + + var _endColumn = column; + pushCommentToken(_text, { + type: "block", + startColumn: _startColumn, + endColumn: _endColumn + }); + continue; + } + + if (char === "(") { + pushOpenParenToken(char); + eatCharacter(); + continue; + } + + if (char === "=") { + pushEqualToken(char); + eatCharacter(); + continue; + } + + if (char === ")") { + pushCloseParenToken(char); + eatCharacter(); + continue; + } + + if (isNewLine(char)) { + line++; + eatCharacter(); + column = 0; + continue; + } + + if (WHITESPACE.test(char)) { + eatCharacter(); + continue; + } + + if (char === "$") { + var _startColumn2 = column; + eatCharacter(); + var value = ""; + + while (idchar.test(char)) { + value += char; + eatCharacter(); + } + + var _endColumn2 = column; + pushIdentifierToken(value, { + startColumn: _startColumn2, + endColumn: _endColumn2 + }); + continue; + } + + if (NUMBERS.test(char) || NUMBER_KEYWORDS.test(lookahead(3, 0)) || char === "-" || char === "+") { + var _startColumn3 = column; + + var _value = numberLiteralFSM.run(input.slice(current)); + + if (_value === "") { + throw new Error(getCodeFrame(input, line, column) + "Unexpected character " + JSON.stringify(char)); + } + + pushNumberToken(_value, { + startColumn: _startColumn3 + }); + eatCharacter(_value.length); + + if (char && !PARENS.test(char) && !WHITESPACE.test(char)) { + throw new Error(getCodeFrame(input, line, column) + "Unexpected character " + JSON.stringify(char)); + } + + continue; + } + + if (char === '"') { + var _startColumn4 = column; + var _value2 = ""; + eatCharacter(); // " + + while (char !== '"') { + if (isNewLine(char)) { + throw new Error(getCodeFrame(input, line, column) + "Unexpected character " + JSON.stringify(char)); + } + + _value2 += char; + eatCharacter(); // char + } + + eatCharacter(); // " + + var _endColumn3 = column; + pushStringToken(_value2, { + startColumn: _startColumn4, + endColumn: _endColumn3 + }); + continue; + } + + if (LETTERS.test(char)) { + var _value3 = ""; + var _startColumn5 = column; + + while (char && LETTERS.test(char)) { + _value3 += char; + eatCharacter(); + } + /* + * Handle MemberAccess + */ + + + if (char === ".") { + var dotStartColumn = column; + + if (valtypes.indexOf(_value3) !== -1) { + pushValtypeToken(_value3, { + startColumn: _startColumn5 + }); + } else { + pushNameToken(_value3); + } + + eatCharacter(); + _value3 = ""; + var nameStartColumn = column; + + while (LETTERS.test(char)) { + _value3 += char; + eatCharacter(); + } + + pushDotToken(".", { + startColumn: dotStartColumn + }); + pushNameToken(_value3, { + startColumn: nameStartColumn + }); + continue; + } + /* + * Handle keywords + */ + // $FlowIgnore + + + if (typeof keywords[_value3] === "string") { + pushKeywordToken(_value3, { + startColumn: _startColumn5 + }); + continue; + } + /* + * Handle types + */ + + + if (valtypes.indexOf(_value3) !== -1) { + pushValtypeToken(_value3, { + startColumn: _startColumn5 + }); + continue; + } + /* + * Handle literals + */ + + + pushNameToken(_value3, { + startColumn: _startColumn5 + }); + continue; + } + + throw new Error(getCodeFrame(input, line, column) + "Unexpected character " + JSON.stringify(char)); + } + + return tokens; +} +export var tokens = tokenTypes; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wast-parser/lib/grammar.js b/node_modules/@webassemblyjs/wast-parser/lib/grammar.js new file mode 100644 index 0000000..ddde33a --- /dev/null +++ b/node_modules/@webassemblyjs/wast-parser/lib/grammar.js @@ -0,0 +1,1769 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parse = parse; + +var _helperCodeFrame = require("@webassemblyjs/helper-code-frame"); + +var t = _interopRequireWildcard(require("@webassemblyjs/ast")); + +var _numberLiterals = require("./number-literals"); + +var _stringLiterals = require("./string-literals"); + +var _tokenizer = require("./tokenizer"); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function hasPlugin(name) { + if (name !== "wast") throw new Error("unknow plugin"); + return true; +} + +function isKeyword(token, id) { + return token.type === _tokenizer.tokens.keyword && token.value === id; +} + +function tokenToString(token) { + if (token.type === "keyword") { + return "keyword (".concat(token.value, ")"); + } + + return token.type; +} + +function identifierFromToken(token) { + var _token$loc = token.loc, + end = _token$loc.end, + start = _token$loc.start; + return t.withLoc(t.identifier(token.value), end, start); +} + +function parse(tokensList, source) { + var current = 0; + var getUniqueName = t.getUniqueNameGenerator(); + var state = { + registredExportedElements: [] + }; // But this time we're going to use recursion instead of a `while` loop. So we + // define a `walk` function. + + function walk() { + var token = tokensList[current]; + + function eatToken() { + token = tokensList[++current]; + } + + function getEndLoc() { + var currentToken = token; + + if (typeof currentToken === "undefined") { + var lastToken = tokensList[tokensList.length - 1]; + currentToken = lastToken; + } + + return currentToken.loc.end; + } + + function getStartLoc() { + return token.loc.start; + } + + function eatTokenOfType(type) { + if (token.type !== type) { + throw new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "Assertion error: expected token of type " + type + ", given " + tokenToString(token)); + } + + eatToken(); + } + + function parseExportIndex(token) { + if (token.type === _tokenizer.tokens.identifier) { + var index = identifierFromToken(token); + eatToken(); + return index; + } else if (token.type === _tokenizer.tokens.number) { + var _index = t.numberLiteralFromRaw(token.value); + + eatToken(); + return _index; + } else { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "unknown export index" + ", given " + tokenToString(token)); + }(); + } + } + + function lookaheadAndCheck() { + var len = arguments.length; + + for (var i = 0; i < len; i++) { + var tokenAhead = tokensList[current + i]; + var expectedToken = i < 0 || arguments.length <= i ? undefined : arguments[i]; + + if (tokenAhead.type === "keyword") { + if (isKeyword(tokenAhead, expectedToken) === false) { + return false; + } + } else if (expectedToken !== tokenAhead.type) { + return false; + } + } + + return true; + } // TODO(sven): there is probably a better way to do this + // can refactor it if it get out of hands + + + function maybeIgnoreComment() { + if (typeof token === "undefined") { + // Ignore + return; + } + + while (token.type === _tokenizer.tokens.comment) { + eatToken(); + + if (typeof token === "undefined") { + // Hit the end + break; + } + } + } + /** + * Parses a memory instruction + * + * WAST: + * + * memory: ( memory ? ) + * ( memory ? ( export ) <...> ) + * ( memory ? ( import ) ) + * ( memory ? ( export )* ( data * ) + * memory_sig: ? + * + */ + + + function parseMemory() { + var id = t.identifier(getUniqueName("memory")); + var limits = t.limit(0); + + if (token.type === _tokenizer.tokens.string || token.type === _tokenizer.tokens.identifier) { + id = t.identifier(token.value); + eatToken(); + } else { + id = t.withRaw(id, ""); // preserve anonymous + } + /** + * Maybe data + */ + + + if (lookaheadAndCheck(_tokenizer.tokens.openParen, _tokenizer.keywords.data)) { + eatToken(); // ( + + eatToken(); // data + // TODO(sven): do something with the data collected here + + var stringInitializer = token.value; + eatTokenOfType(_tokenizer.tokens.string); // Update limits accordingly + + limits = t.limit(stringInitializer.length); + eatTokenOfType(_tokenizer.tokens.closeParen); + } + /** + * Maybe export + */ + + + if (lookaheadAndCheck(_tokenizer.tokens.openParen, _tokenizer.keywords.export)) { + eatToken(); // ( + + eatToken(); // export + + if (token.type !== _tokenizer.tokens.string) { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Expected string in export" + ", given " + tokenToString(token)); + }(); + } + + var _name = token.value; + eatToken(); + state.registredExportedElements.push({ + exportType: "Memory", + name: _name, + id: id + }); + eatTokenOfType(_tokenizer.tokens.closeParen); + } + /** + * Memory signature + */ + + + if (token.type === _tokenizer.tokens.number) { + limits = t.limit((0, _numberLiterals.parse32I)(token.value)); + eatToken(); + + if (token.type === _tokenizer.tokens.number) { + limits.max = (0, _numberLiterals.parse32I)(token.value); + eatToken(); + } + } + + return t.memory(limits, id); + } + /** + * Parses a data section + * https://webassembly.github.io/spec/core/text/modules.html#data-segments + * + * WAST: + * + * data: ( data ? ) + */ + + + function parseData() { + // optional memory index + var memidx = 0; + + if (token.type === _tokenizer.tokens.number) { + memidx = token.value; + eatTokenOfType(_tokenizer.tokens.number); // . + } + + eatTokenOfType(_tokenizer.tokens.openParen); + var offset; + + if (token.type === _tokenizer.tokens.valtype) { + eatTokenOfType(_tokenizer.tokens.valtype); // i32 + + eatTokenOfType(_tokenizer.tokens.dot); // . + + if (token.value !== "const") { + throw new Error("constant expression required"); + } + + eatTokenOfType(_tokenizer.tokens.name); // const + + var numberLiteral = t.numberLiteralFromRaw(token.value, "i32"); + offset = t.objectInstruction("const", "i32", [numberLiteral]); + eatToken(); + eatTokenOfType(_tokenizer.tokens.closeParen); + } else { + eatTokenOfType(_tokenizer.tokens.name); // get_global + + var _numberLiteral = t.numberLiteralFromRaw(token.value, "i32"); + + offset = t.instruction("get_global", [_numberLiteral]); + eatToken(); + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + var byteArray = (0, _stringLiterals.parseString)(token.value); + eatToken(); // "string" + + return t.data(t.memIndexLiteral(memidx), offset, t.byteArray(byteArray)); + } + /** + * Parses a table instruction + * + * WAST: + * + * table: ( table ? ) + * ( table ? ( export ) <...> ) + * ( table ? ( import ) ) + * ( table ? ( export )* ( elem * ) ) + * + * table_type: ? + * elem_type: anyfunc + * + * elem: ( elem ? (offset * ) * ) + * ( elem ? * ) + */ + + + function parseTable() { + var name = t.identifier(getUniqueName("table")); + var limit = t.limit(0); + var elemIndices = []; + var elemType = "anyfunc"; + + if (token.type === _tokenizer.tokens.string || token.type === _tokenizer.tokens.identifier) { + name = identifierFromToken(token); + eatToken(); + } else { + name = t.withRaw(name, ""); // preserve anonymous + } + + while (token.type !== _tokenizer.tokens.closeParen) { + /** + * Maybe export + */ + if (lookaheadAndCheck(_tokenizer.tokens.openParen, _tokenizer.keywords.elem)) { + eatToken(); // ( + + eatToken(); // elem + + while (token.type === _tokenizer.tokens.identifier) { + elemIndices.push(t.identifier(token.value)); + eatToken(); + } + + eatTokenOfType(_tokenizer.tokens.closeParen); + } else if (lookaheadAndCheck(_tokenizer.tokens.openParen, _tokenizer.keywords.export)) { + eatToken(); // ( + + eatToken(); // export + + if (token.type !== _tokenizer.tokens.string) { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Expected string in export" + ", given " + tokenToString(token)); + }(); + } + + var exportName = token.value; + eatToken(); + state.registredExportedElements.push({ + exportType: "Table", + name: exportName, + id: name + }); + eatTokenOfType(_tokenizer.tokens.closeParen); + } else if (isKeyword(token, _tokenizer.keywords.anyfunc)) { + // It's the default value, we can ignore it + eatToken(); // anyfunc + } else if (token.type === _tokenizer.tokens.number) { + /** + * Table type + */ + var min = parseInt(token.value); + eatToken(); + + if (token.type === _tokenizer.tokens.number) { + var max = parseInt(token.value); + eatToken(); + limit = t.limit(min, max); + } else { + limit = t.limit(min); + } + + eatToken(); + } else { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Unexpected token" + ", given " + tokenToString(token)); + }(); + } + } + + if (elemIndices.length > 0) { + return t.table(elemType, limit, name, elemIndices); + } else { + return t.table(elemType, limit, name); + } + } + /** + * Parses an import statement + * + * WAST: + * + * import: ( import ) + * imkind: ( func ? ) + * ( global ? ) + * ( table ? ) + * ( memory ? ) + * + * global_sig: | ( mut ) + */ + + + function parseImport() { + if (token.type !== _tokenizer.tokens.string) { + throw new Error("Expected a string, " + token.type + " given."); + } + + var moduleName = token.value; + eatToken(); + + if (token.type !== _tokenizer.tokens.string) { + throw new Error("Expected a string, " + token.type + " given."); + } + + var name = token.value; + eatToken(); + eatTokenOfType(_tokenizer.tokens.openParen); + var descr; + + if (isKeyword(token, _tokenizer.keywords.func)) { + eatToken(); // keyword + + var fnParams = []; + var fnResult = []; + var typeRef; + var fnName = t.identifier(getUniqueName("func")); + + if (token.type === _tokenizer.tokens.identifier) { + fnName = identifierFromToken(token); + eatToken(); + } + + while (token.type === _tokenizer.tokens.openParen) { + eatToken(); + + if (lookaheadAndCheck(_tokenizer.keywords.type) === true) { + eatToken(); + typeRef = parseTypeReference(); + } else if (lookaheadAndCheck(_tokenizer.keywords.param) === true) { + eatToken(); + fnParams.push.apply(fnParams, _toConsumableArray(parseFuncParam())); + } else if (lookaheadAndCheck(_tokenizer.keywords.result) === true) { + eatToken(); + fnResult.push.apply(fnResult, _toConsumableArray(parseFuncResult())); + } else { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Unexpected token in import of type" + ", given " + tokenToString(token)); + }(); + } + + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + if (typeof fnName === "undefined") { + throw new Error("Imported function must have a name"); + } + + descr = t.funcImportDescr(fnName, typeRef !== undefined ? typeRef : t.signature(fnParams, fnResult)); + } else if (isKeyword(token, _tokenizer.keywords.global)) { + eatToken(); // keyword + + if (token.type === _tokenizer.tokens.openParen) { + eatToken(); // ( + + eatTokenOfType(_tokenizer.tokens.keyword); // mut keyword + + var valtype = token.value; + eatToken(); + descr = t.globalType(valtype, "var"); + eatTokenOfType(_tokenizer.tokens.closeParen); + } else { + var _valtype = token.value; + eatTokenOfType(_tokenizer.tokens.valtype); + descr = t.globalType(_valtype, "const"); + } + } else if (isKeyword(token, _tokenizer.keywords.memory) === true) { + eatToken(); // Keyword + + descr = parseMemory(); + } else if (isKeyword(token, _tokenizer.keywords.table) === true) { + eatToken(); // Keyword + + descr = parseTable(); + } else { + throw new Error("Unsupported import type: " + tokenToString(token)); + } + + eatTokenOfType(_tokenizer.tokens.closeParen); + return t.moduleImport(moduleName, name, descr); + } + /** + * Parses a block instruction + * + * WAST: + * + * expr: ( block ? * ) + * instr: block ? * end ? + * block_sig : ( result * )* + * + */ + + + function parseBlock() { + var label = t.identifier(getUniqueName("block")); + var blockResult = null; + var instr = []; + + if (token.type === _tokenizer.tokens.identifier) { + label = identifierFromToken(token); + eatToken(); + } else { + label = t.withRaw(label, ""); // preserve anonymous + } + + while (token.type === _tokenizer.tokens.openParen) { + eatToken(); + + if (lookaheadAndCheck(_tokenizer.keywords.result) === true) { + eatToken(); + blockResult = token.value; + eatToken(); + } else if (lookaheadAndCheck(_tokenizer.tokens.name) === true || lookaheadAndCheck(_tokenizer.tokens.valtype) === true || token.type === "keyword" // is any keyword + ) { + // Instruction + instr.push(parseFuncInstr()); + } else { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Unexpected token in block body of type" + ", given " + tokenToString(token)); + }(); + } + + maybeIgnoreComment(); + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + return t.blockInstruction(label, instr, blockResult); + } + /** + * Parses a if instruction + * + * WAST: + * + * expr: + * ( if ? ( then * ) ( else * )? ) + * ( if ? + ( then * ) ( else * )? ) + * + * instr: + * if ? * end ? + * if ? * else ? * end ? + * + * block_sig : ( result * )* + * + */ + + + function parseIf() { + var blockResult = null; + var label = t.identifier(getUniqueName("if")); + var testInstrs = []; + var consequent = []; + var alternate = []; + + if (token.type === _tokenizer.tokens.identifier) { + label = identifierFromToken(token); + eatToken(); + } else { + label = t.withRaw(label, ""); // preserve anonymous + } + + while (token.type === _tokenizer.tokens.openParen) { + eatToken(); // ( + + /** + * Block signature + */ + + if (isKeyword(token, _tokenizer.keywords.result) === true) { + eatToken(); + blockResult = token.value; + eatTokenOfType(_tokenizer.tokens.valtype); + eatTokenOfType(_tokenizer.tokens.closeParen); + continue; + } + /** + * Then + */ + + + if (isKeyword(token, _tokenizer.keywords.then) === true) { + eatToken(); // then + + while (token.type === _tokenizer.tokens.openParen) { + eatToken(); // Instruction + + if (lookaheadAndCheck(_tokenizer.tokens.name) === true || lookaheadAndCheck(_tokenizer.tokens.valtype) === true || token.type === "keyword" // is any keyword + ) { + consequent.push(parseFuncInstr()); + } else { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Unexpected token in consequent body of type" + ", given " + tokenToString(token)); + }(); + } + + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + eatTokenOfType(_tokenizer.tokens.closeParen); + continue; + } + /** + * Alternate + */ + + + if (isKeyword(token, _tokenizer.keywords.else)) { + eatToken(); // else + + while (token.type === _tokenizer.tokens.openParen) { + eatToken(); // Instruction + + if (lookaheadAndCheck(_tokenizer.tokens.name) === true || lookaheadAndCheck(_tokenizer.tokens.valtype) === true || token.type === "keyword" // is any keyword + ) { + alternate.push(parseFuncInstr()); + } else { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Unexpected token in alternate body of type" + ", given " + tokenToString(token)); + }(); + } + + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + eatTokenOfType(_tokenizer.tokens.closeParen); + continue; + } + /** + * Test instruction + */ + + + if (lookaheadAndCheck(_tokenizer.tokens.name) === true || lookaheadAndCheck(_tokenizer.tokens.valtype) === true || token.type === "keyword" // is any keyword + ) { + testInstrs.push(parseFuncInstr()); + eatTokenOfType(_tokenizer.tokens.closeParen); + continue; + } + + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Unexpected token in if body" + ", given " + tokenToString(token)); + }(); + } + + return t.ifInstruction(label, testInstrs, blockResult, consequent, alternate); + } + /** + * Parses a loop instruction + * + * WAT: + * + * blockinstr :: 'loop' I:label rt:resulttype (in:instr*) 'end' id? + * + * WAST: + * + * instr :: loop ? * end ? + * expr :: ( loop ? * ) + * block_sig :: ( result * )* + * + */ + + + function parseLoop() { + var label = t.identifier(getUniqueName("loop")); + var blockResult; + var instr = []; + + if (token.type === _tokenizer.tokens.identifier) { + label = identifierFromToken(token); + eatToken(); + } else { + label = t.withRaw(label, ""); // preserve anonymous + } + + while (token.type === _tokenizer.tokens.openParen) { + eatToken(); + + if (lookaheadAndCheck(_tokenizer.keywords.result) === true) { + eatToken(); + blockResult = token.value; + eatToken(); + } else if (lookaheadAndCheck(_tokenizer.tokens.name) === true || lookaheadAndCheck(_tokenizer.tokens.valtype) === true || token.type === "keyword" // is any keyword + ) { + // Instruction + instr.push(parseFuncInstr()); + } else { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Unexpected token in loop body" + ", given " + tokenToString(token)); + }(); + } + + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + return t.loopInstruction(label, blockResult, instr); + } + + function parseCallIndirect() { + var typeRef; + var params = []; + var results = []; + var instrs = []; + + while (token.type !== _tokenizer.tokens.closeParen) { + if (lookaheadAndCheck(_tokenizer.tokens.openParen, _tokenizer.keywords.type)) { + eatToken(); // ( + + eatToken(); // type + + typeRef = parseTypeReference(); + } else if (lookaheadAndCheck(_tokenizer.tokens.openParen, _tokenizer.keywords.param)) { + eatToken(); // ( + + eatToken(); // param + + /** + * Params can be empty: + * (params)` + */ + + if (token.type !== _tokenizer.tokens.closeParen) { + params.push.apply(params, _toConsumableArray(parseFuncParam())); + } + } else if (lookaheadAndCheck(_tokenizer.tokens.openParen, _tokenizer.keywords.result)) { + eatToken(); // ( + + eatToken(); // result + + /** + * Results can be empty: + * (result)` + */ + + if (token.type !== _tokenizer.tokens.closeParen) { + results.push.apply(results, _toConsumableArray(parseFuncResult())); + } + } else { + eatTokenOfType(_tokenizer.tokens.openParen); + instrs.push(parseFuncInstr()); + } + + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + return t.callIndirectInstruction(typeRef !== undefined ? typeRef : t.signature(params, results), instrs); + } + /** + * Parses an export instruction + * + * WAT: + * + * export: ( export ) + * exkind: ( func ) + * ( global ) + * ( table ) + * ( memory ) + * var: | + * + */ + + + function parseExport() { + if (token.type !== _tokenizer.tokens.string) { + throw new Error("Expected string after export, got: " + token.type); + } + + var name = token.value; + eatToken(); + var moduleExportDescr = parseModuleExportDescr(); + return t.moduleExport(name, moduleExportDescr); + } + + function parseModuleExportDescr() { + var startLoc = getStartLoc(); + var type = ""; + var index; + eatTokenOfType(_tokenizer.tokens.openParen); + + while (token.type !== _tokenizer.tokens.closeParen) { + if (isKeyword(token, _tokenizer.keywords.func)) { + type = "Func"; + eatToken(); + index = parseExportIndex(token); + } else if (isKeyword(token, _tokenizer.keywords.table)) { + type = "Table"; + eatToken(); + index = parseExportIndex(token); + } else if (isKeyword(token, _tokenizer.keywords.global)) { + type = "Global"; + eatToken(); + index = parseExportIndex(token); + } else if (isKeyword(token, _tokenizer.keywords.memory)) { + type = "Memory"; + eatToken(); + index = parseExportIndex(token); + } + + eatToken(); + } + + if (type === "") { + throw new Error("Unknown export type"); + } + + if (index === undefined) { + throw new Error("Exported function must have a name"); + } + + var node = t.moduleExportDescr(type, index); + var endLoc = getEndLoc(); + eatTokenOfType(_tokenizer.tokens.closeParen); + return t.withLoc(node, endLoc, startLoc); + } + + function parseModule() { + var name = null; + var isBinary = false; + var isQuote = false; + var moduleFields = []; + + if (token.type === _tokenizer.tokens.identifier) { + name = token.value; + eatToken(); + } + + if (hasPlugin("wast") && token.type === _tokenizer.tokens.name && token.value === "binary") { + eatToken(); + isBinary = true; + } + + if (hasPlugin("wast") && token.type === _tokenizer.tokens.name && token.value === "quote") { + eatToken(); + isQuote = true; + } + + if (isBinary === true) { + var blob = []; + + while (token.type === _tokenizer.tokens.string) { + blob.push(token.value); + eatToken(); + maybeIgnoreComment(); + } + + eatTokenOfType(_tokenizer.tokens.closeParen); + return t.binaryModule(name, blob); + } + + if (isQuote === true) { + var string = []; + + while (token.type === _tokenizer.tokens.string) { + string.push(token.value); + eatToken(); + } + + eatTokenOfType(_tokenizer.tokens.closeParen); + return t.quoteModule(name, string); + } + + while (token.type !== _tokenizer.tokens.closeParen) { + moduleFields.push(walk()); + + if (state.registredExportedElements.length > 0) { + state.registredExportedElements.forEach(function (decl) { + moduleFields.push(t.moduleExport(decl.name, t.moduleExportDescr(decl.exportType, decl.id))); + }); + state.registredExportedElements = []; + } + + token = tokensList[current]; + } + + eatTokenOfType(_tokenizer.tokens.closeParen); + return t.module(name, moduleFields); + } + /** + * Parses the arguments of an instruction + */ + + + function parseFuncInstrArguments(signature) { + var args = []; + var namedArgs = {}; + var signaturePtr = 0; + + while (token.type === _tokenizer.tokens.name || isKeyword(token, _tokenizer.keywords.offset)) { + var key = token.value; + eatToken(); + eatTokenOfType(_tokenizer.tokens.equal); + var value = void 0; + + if (token.type === _tokenizer.tokens.number) { + value = t.numberLiteralFromRaw(token.value); + } else { + throw new Error("Unexpected type for argument: " + token.type); + } + + namedArgs[key] = value; + eatToken(); + } // $FlowIgnore + + + var signatureLength = signature.vector ? Infinity : signature.length; + + while (token.type !== _tokenizer.tokens.closeParen && ( // $FlowIgnore + token.type === _tokenizer.tokens.openParen || signaturePtr < signatureLength)) { + if (token.type === _tokenizer.tokens.identifier) { + args.push(t.identifier(token.value)); + eatToken(); + } else if (token.type === _tokenizer.tokens.valtype) { + // Handle locals + args.push(t.valtypeLiteral(token.value)); + eatToken(); + } else if (token.type === _tokenizer.tokens.string) { + args.push(t.stringLiteral(token.value)); + eatToken(); + } else if (token.type === _tokenizer.tokens.number) { + args.push( // TODO(sven): refactor the type signature handling + // https://github.com/xtuc/webassemblyjs/pull/129 is a good start + t.numberLiteralFromRaw(token.value, // $FlowIgnore + signature[signaturePtr] || "f64")); // $FlowIgnore + + if (!signature.vector) { + ++signaturePtr; + } + + eatToken(); + } else if (token.type === _tokenizer.tokens.openParen) { + /** + * Maybe some nested instructions + */ + eatToken(); // Instruction + + if (lookaheadAndCheck(_tokenizer.tokens.name) === true || lookaheadAndCheck(_tokenizer.tokens.valtype) === true || token.type === "keyword" // is any keyword + ) { + // $FlowIgnore + args.push(parseFuncInstr()); + } else { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Unexpected token in nested instruction" + ", given " + tokenToString(token)); + }(); + } + + if (token.type === _tokenizer.tokens.closeParen) { + eatToken(); + } + } else { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Unexpected token in instruction argument" + ", given " + tokenToString(token)); + }(); + } + } + + return { + args: args, + namedArgs: namedArgs + }; + } + /** + * Parses an instruction + * + * WAT: + * + * instr :: plaininst + * blockinstr + * + * blockinstr :: 'block' I:label rt:resulttype (in:instr*) 'end' id? + * 'loop' I:label rt:resulttype (in:instr*) 'end' id? + * 'if' I:label rt:resulttype (in:instr*) 'else' id? (in2:intr*) 'end' id? + * + * plaininst :: 'unreachable' + * 'nop' + * 'br' l:labelidx + * 'br_if' l:labelidx + * 'br_table' l*:vec(labelidx) ln:labelidx + * 'return' + * 'call' x:funcidx + * 'call_indirect' x, I:typeuse + * + * WAST: + * + * instr: + * + * + * block ? * end ? + * loop ? * end ? + * if ? * end ? + * if ? * else ? * end ? + * + * expr: + * ( ) + * ( + ) + * ( block ? * ) + * ( loop ? * ) + * ( if ? ( then * ) ( else * )? ) + * ( if ? + ( then * ) ( else * )? ) + * + * op: + * unreachable + * nop + * br + * br_if + * br_table + + * return + * call + * call_indirect + * drop + * select + * get_local + * set_local + * tee_local + * get_global + * set_global + * .load((8|16|32)_)? ? ? + * .store(8|16|32)? ? ? + * current_memory + * grow_memory + * .const + * . + * . + * . + * . + * ./ + * + * func_type: ( type )? * * + */ + + + function parseFuncInstr() { + var startLoc = getStartLoc(); + maybeIgnoreComment(); + /** + * A simple instruction + */ + + if (token.type === _tokenizer.tokens.name || token.type === _tokenizer.tokens.valtype) { + var _name2 = token.value; + var object; + eatToken(); + + if (token.type === _tokenizer.tokens.dot) { + object = _name2; + eatToken(); + + if (token.type !== _tokenizer.tokens.name) { + throw new TypeError("Unknown token: " + token.type + ", name expected"); + } + + _name2 = token.value; + eatToken(); + } + + if (token.type === _tokenizer.tokens.closeParen) { + var _endLoc = token.loc.end; + + if (typeof object === "undefined") { + return t.withLoc(t.instruction(_name2), _endLoc, startLoc); + } else { + return t.withLoc(t.objectInstruction(_name2, object, []), _endLoc, startLoc); + } + } + + var signature = t.signatureForOpcode(object || "", _name2); + + var _parseFuncInstrArgume = parseFuncInstrArguments(signature), + _args = _parseFuncInstrArgume.args, + _namedArgs = _parseFuncInstrArgume.namedArgs; + + var endLoc = token.loc.end; + + if (typeof object === "undefined") { + return t.withLoc(t.instruction(_name2, _args, _namedArgs), endLoc, startLoc); + } else { + return t.withLoc(t.objectInstruction(_name2, object, _args, _namedArgs), endLoc, startLoc); + } + } else if (isKeyword(token, _tokenizer.keywords.loop)) { + /** + * Else a instruction with a keyword (loop or block) + */ + eatToken(); // keyword + + return parseLoop(); + } else if (isKeyword(token, _tokenizer.keywords.block)) { + eatToken(); // keyword + + return parseBlock(); + } else if (isKeyword(token, _tokenizer.keywords.call_indirect)) { + eatToken(); // keyword + + return parseCallIndirect(); + } else if (isKeyword(token, _tokenizer.keywords.call)) { + eatToken(); // keyword + + var index; + + if (token.type === _tokenizer.tokens.identifier) { + index = identifierFromToken(token); + eatToken(); + } else if (token.type === _tokenizer.tokens.number) { + index = t.indexLiteral(token.value); + eatToken(); + } + + var instrArgs = []; // Nested instruction + + while (token.type === _tokenizer.tokens.openParen) { + eatToken(); + instrArgs.push(parseFuncInstr()); + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + if (typeof index === "undefined") { + throw new Error("Missing argument in call instruciton"); + } + + if (instrArgs.length > 0) { + return t.callInstruction(index, instrArgs); + } else { + return t.callInstruction(index); + } + } else if (isKeyword(token, _tokenizer.keywords.if)) { + eatToken(); // Keyword + + return parseIf(); + } else if (isKeyword(token, _tokenizer.keywords.module) && hasPlugin("wast")) { + eatToken(); // In WAST you can have a module as an instruction's argument + // we will cast it into a instruction to not break the flow + // $FlowIgnore + + var module = parseModule(); + return module; + } else { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Unexpected instruction in function body" + ", given " + tokenToString(token)); + }(); + } + } + /* + * Parses a function + * + * WAT: + * + * functype :: ( 'func' t1:vec(param) t2:vec(result) ) + * param :: ( 'param' id? t:valtype ) + * result :: ( 'result' t:valtype ) + * + * WAST: + * + * func :: ( func ? * * ) + * ( func ? ( export ) <...> ) + * ( func ? ( import ) ) + * func_sig :: ( type )? * * + * param :: ( param * ) | ( param ) + * result :: ( result * ) + * local :: ( local * ) | ( local ) + * + */ + + + function parseFunc() { + var fnName = t.identifier(getUniqueName("func")); + var typeRef; + var fnBody = []; + var fnParams = []; + var fnResult = []; // name + + if (token.type === _tokenizer.tokens.identifier) { + fnName = identifierFromToken(token); + eatToken(); + } else { + fnName = t.withRaw(fnName, ""); // preserve anonymous + } + + maybeIgnoreComment(); + + while (token.type === _tokenizer.tokens.openParen || token.type === _tokenizer.tokens.name || token.type === _tokenizer.tokens.valtype) { + // Instructions without parens + if (token.type === _tokenizer.tokens.name || token.type === _tokenizer.tokens.valtype) { + fnBody.push(parseFuncInstr()); + continue; + } + + eatToken(); + + if (lookaheadAndCheck(_tokenizer.keywords.param) === true) { + eatToken(); + fnParams.push.apply(fnParams, _toConsumableArray(parseFuncParam())); + } else if (lookaheadAndCheck(_tokenizer.keywords.result) === true) { + eatToken(); + fnResult.push.apply(fnResult, _toConsumableArray(parseFuncResult())); + } else if (lookaheadAndCheck(_tokenizer.keywords.export) === true) { + eatToken(); + parseFuncExport(fnName); + } else if (lookaheadAndCheck(_tokenizer.keywords.type) === true) { + eatToken(); + typeRef = parseTypeReference(); + } else if (lookaheadAndCheck(_tokenizer.tokens.name) === true || lookaheadAndCheck(_tokenizer.tokens.valtype) === true || token.type === "keyword" // is any keyword + ) { + // Instruction + fnBody.push(parseFuncInstr()); + } else { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Unexpected token in func body" + ", given " + tokenToString(token)); + }(); + } + + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + return t.func(fnName, typeRef !== undefined ? typeRef : t.signature(fnParams, fnResult), fnBody); + } + /** + * Parses shorthand export in func + * + * export :: ( export ) + */ + + + function parseFuncExport(funcId) { + if (token.type !== _tokenizer.tokens.string) { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Function export expected a string" + ", given " + tokenToString(token)); + }(); + } + + var name = token.value; + eatToken(); + /** + * Func export shorthand, we trait it as a syntaxic sugar. + * A export ModuleField will be added later. + * + * We give the anonymous function a generated name and export it. + */ + + var id = t.identifier(funcId.value); + state.registredExportedElements.push({ + exportType: "Func", + name: name, + id: id + }); + } + /** + * Parses a type instruction + * + * WAST: + * + * typedef: ( type ? ( func * * ) ) + */ + + + function parseType() { + var id; + var params = []; + var result = []; + + if (token.type === _tokenizer.tokens.identifier) { + id = identifierFromToken(token); + eatToken(); + } + + if (lookaheadAndCheck(_tokenizer.tokens.openParen, _tokenizer.keywords.func)) { + eatToken(); // ( + + eatToken(); // func + + if (token.type === _tokenizer.tokens.closeParen) { + eatToken(); // function with an empty signature, we can abort here + + return t.typeInstruction(id, t.signature([], [])); + } + + if (lookaheadAndCheck(_tokenizer.tokens.openParen, _tokenizer.keywords.param)) { + eatToken(); // ( + + eatToken(); // param + + params = parseFuncParam(); + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + if (lookaheadAndCheck(_tokenizer.tokens.openParen, _tokenizer.keywords.result)) { + eatToken(); // ( + + eatToken(); // result + + result = parseFuncResult(); + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + return t.typeInstruction(id, t.signature(params, result)); + } + /** + * Parses a function result + * + * WAST: + * + * result :: ( result * ) + */ + + + function parseFuncResult() { + var results = []; + + while (token.type !== _tokenizer.tokens.closeParen) { + if (token.type !== _tokenizer.tokens.valtype) { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Unexpected token in func result" + ", given " + tokenToString(token)); + }(); + } + + var valtype = token.value; + eatToken(); + results.push(valtype); + } + + return results; + } + /** + * Parses a type reference + * + */ + + + function parseTypeReference() { + var ref; + + if (token.type === _tokenizer.tokens.identifier) { + ref = identifierFromToken(token); + eatToken(); + } else if (token.type === _tokenizer.tokens.number) { + ref = t.numberLiteralFromRaw(token.value); + eatToken(); + } + + return ref; + } + /** + * Parses a global instruction + * + * WAST: + * + * global: ( global ? * ) + * ( global ? ( export ) <...> ) + * ( global ? ( import ) ) + * + * global_sig: | ( mut ) + * + */ + + + function parseGlobal() { + var name = t.identifier(getUniqueName("global")); + var type; // Keep informations in case of a shorthand import + + var importing = null; + maybeIgnoreComment(); + + if (token.type === _tokenizer.tokens.identifier) { + name = identifierFromToken(token); + eatToken(); + } else { + name = t.withRaw(name, ""); // preserve anonymous + } + /** + * maybe export + */ + + + if (lookaheadAndCheck(_tokenizer.tokens.openParen, _tokenizer.keywords.export)) { + eatToken(); // ( + + eatToken(); // export + + var exportName = token.value; + eatTokenOfType(_tokenizer.tokens.string); + state.registredExportedElements.push({ + exportType: "Global", + name: exportName, + id: name + }); + eatTokenOfType(_tokenizer.tokens.closeParen); + } + /** + * maybe import + */ + + + if (lookaheadAndCheck(_tokenizer.tokens.openParen, _tokenizer.keywords.import)) { + eatToken(); // ( + + eatToken(); // import + + var moduleName = token.value; + eatTokenOfType(_tokenizer.tokens.string); + var _name3 = token.value; + eatTokenOfType(_tokenizer.tokens.string); + importing = { + module: moduleName, + name: _name3, + descr: undefined + }; + eatTokenOfType(_tokenizer.tokens.closeParen); + } + /** + * global_sig + */ + + + if (token.type === _tokenizer.tokens.valtype) { + type = t.globalType(token.value, "const"); + eatToken(); + } else if (token.type === _tokenizer.tokens.openParen) { + eatToken(); // ( + + if (isKeyword(token, _tokenizer.keywords.mut) === false) { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Unsupported global type, expected mut" + ", given " + tokenToString(token)); + }(); + } + + eatToken(); // mut + + type = t.globalType(token.value, "var"); + eatToken(); + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + if (type === undefined) { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Could not determine global type" + ", given " + tokenToString(token)); + }(); + } + + maybeIgnoreComment(); + var init = []; + + if (importing != null) { + importing.descr = type; + init.push(t.moduleImport(importing.module, importing.name, importing.descr)); + } + /** + * instr* + */ + + + while (token.type === _tokenizer.tokens.openParen) { + eatToken(); + init.push(parseFuncInstr()); + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + return t.global(type, init, name); + } + /** + * Parses a function param + * + * WAST: + * + * param :: ( param * ) | ( param ) + */ + + + function parseFuncParam() { + var params = []; + var id; + var valtype; + + if (token.type === _tokenizer.tokens.identifier) { + id = token.value; + eatToken(); + } + + if (token.type === _tokenizer.tokens.valtype) { + valtype = token.value; + eatToken(); + params.push({ + id: id, + valtype: valtype + }); + /** + * Shorthand notation for multiple anonymous parameters + * @see https://webassembly.github.io/spec/core/text/types.html#function-types + * @see https://github.com/xtuc/webassemblyjs/issues/6 + */ + + if (id === undefined) { + while (token.type === _tokenizer.tokens.valtype) { + valtype = token.value; + eatToken(); + params.push({ + id: undefined, + valtype: valtype + }); + } + } + } else {// ignore + } + + return params; + } + /** + * Parses an element segments instruction + * + * WAST: + * + * elem: ( elem ? (offset * ) * ) + * ( elem ? * ) + * + * var: | + */ + + + function parseElem() { + var tableIndex = t.indexLiteral(0); + var offset = []; + var funcs = []; + + if (token.type === _tokenizer.tokens.identifier) { + tableIndex = identifierFromToken(token); + eatToken(); + } + + if (token.type === _tokenizer.tokens.number) { + tableIndex = t.indexLiteral(token.value); + eatToken(); + } + + while (token.type !== _tokenizer.tokens.closeParen) { + if (lookaheadAndCheck(_tokenizer.tokens.openParen, _tokenizer.keywords.offset)) { + eatToken(); // ( + + eatToken(); // offset + + while (token.type !== _tokenizer.tokens.closeParen) { + eatTokenOfType(_tokenizer.tokens.openParen); + offset.push(parseFuncInstr()); + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + eatTokenOfType(_tokenizer.tokens.closeParen); + } else if (token.type === _tokenizer.tokens.identifier) { + funcs.push(t.identifier(token.value)); + eatToken(); + } else if (token.type === _tokenizer.tokens.number) { + funcs.push(t.indexLiteral(token.value)); + eatToken(); + } else if (token.type === _tokenizer.tokens.openParen) { + eatToken(); // ( + + offset.push(parseFuncInstr()); + eatTokenOfType(_tokenizer.tokens.closeParen); + } else { + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Unsupported token in elem" + ", given " + tokenToString(token)); + }(); + } + } + + return t.elem(tableIndex, offset, funcs); + } + /** + * Parses the start instruction in a module + * + * WAST: + * + * start: ( start ) + * var: | + * + * WAT: + * start ::= ‘(’ ‘start’ x:funcidx ‘)’ + */ + + + function parseStart() { + if (token.type === _tokenizer.tokens.identifier) { + var index = identifierFromToken(token); + eatToken(); + return t.start(index); + } + + if (token.type === _tokenizer.tokens.number) { + var _index2 = t.indexLiteral(token.value); + + eatToken(); + return t.start(_index2); + } + + throw new Error("Unknown start, token: " + tokenToString(token)); + } + + if (token.type === _tokenizer.tokens.openParen) { + eatToken(); + var startLoc = getStartLoc(); + + if (isKeyword(token, _tokenizer.keywords.export)) { + eatToken(); + var node = parseExport(); + + var _endLoc2 = getEndLoc(); + + return t.withLoc(node, _endLoc2, startLoc); + } + + if (isKeyword(token, _tokenizer.keywords.loop)) { + eatToken(); + + var _node = parseLoop(); + + var _endLoc3 = getEndLoc(); + + return t.withLoc(_node, _endLoc3, startLoc); + } + + if (isKeyword(token, _tokenizer.keywords.func)) { + eatToken(); + + var _node2 = parseFunc(); + + var _endLoc4 = getEndLoc(); + + maybeIgnoreComment(); + eatTokenOfType(_tokenizer.tokens.closeParen); + return t.withLoc(_node2, _endLoc4, startLoc); + } + + if (isKeyword(token, _tokenizer.keywords.module)) { + eatToken(); + + var _node3 = parseModule(); + + var _endLoc5 = getEndLoc(); + + return t.withLoc(_node3, _endLoc5, startLoc); + } + + if (isKeyword(token, _tokenizer.keywords.import)) { + eatToken(); + + var _node4 = parseImport(); + + var _endLoc6 = getEndLoc(); + + eatTokenOfType(_tokenizer.tokens.closeParen); + return t.withLoc(_node4, _endLoc6, startLoc); + } + + if (isKeyword(token, _tokenizer.keywords.block)) { + eatToken(); + + var _node5 = parseBlock(); + + var _endLoc7 = getEndLoc(); + + eatTokenOfType(_tokenizer.tokens.closeParen); + return t.withLoc(_node5, _endLoc7, startLoc); + } + + if (isKeyword(token, _tokenizer.keywords.memory)) { + eatToken(); + + var _node6 = parseMemory(); + + var _endLoc8 = getEndLoc(); + + eatTokenOfType(_tokenizer.tokens.closeParen); + return t.withLoc(_node6, _endLoc8, startLoc); + } + + if (isKeyword(token, _tokenizer.keywords.data)) { + eatToken(); + + var _node7 = parseData(); + + var _endLoc9 = getEndLoc(); + + eatTokenOfType(_tokenizer.tokens.closeParen); + return t.withLoc(_node7, _endLoc9, startLoc); + } + + if (isKeyword(token, _tokenizer.keywords.table)) { + eatToken(); + + var _node8 = parseTable(); + + var _endLoc10 = getEndLoc(); + + eatTokenOfType(_tokenizer.tokens.closeParen); + return t.withLoc(_node8, _endLoc10, startLoc); + } + + if (isKeyword(token, _tokenizer.keywords.global)) { + eatToken(); + + var _node9 = parseGlobal(); + + var _endLoc11 = getEndLoc(); + + eatTokenOfType(_tokenizer.tokens.closeParen); + return t.withLoc(_node9, _endLoc11, startLoc); + } + + if (isKeyword(token, _tokenizer.keywords.type)) { + eatToken(); + + var _node10 = parseType(); + + var _endLoc12 = getEndLoc(); + + eatTokenOfType(_tokenizer.tokens.closeParen); + return t.withLoc(_node10, _endLoc12, startLoc); + } + + if (isKeyword(token, _tokenizer.keywords.start)) { + eatToken(); + + var _node11 = parseStart(); + + var _endLoc13 = getEndLoc(); + + eatTokenOfType(_tokenizer.tokens.closeParen); + return t.withLoc(_node11, _endLoc13, startLoc); + } + + if (isKeyword(token, _tokenizer.keywords.elem)) { + eatToken(); + + var _node12 = parseElem(); + + var _endLoc14 = getEndLoc(); + + eatTokenOfType(_tokenizer.tokens.closeParen); + return t.withLoc(_node12, _endLoc14, startLoc); + } + + var instruction = parseFuncInstr(); + var endLoc = getEndLoc(); + maybeIgnoreComment(); + + if (_typeof(instruction) === "object") { + if (typeof token !== "undefined") { + eatTokenOfType(_tokenizer.tokens.closeParen); + } + + return t.withLoc(instruction, endLoc, startLoc); + } + } + + if (token.type === _tokenizer.tokens.comment) { + var _startLoc = getStartLoc(); + + var builder = token.opts.type === "leading" ? t.leadingComment : t.blockComment; + + var _node13 = builder(token.value); + + eatToken(); // comment + + var _endLoc15 = getEndLoc(); + + return t.withLoc(_node13, _endLoc15, _startLoc); + } + + throw function () { + return new Error("\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, token.loc) + "\n" + "Unknown token" + ", given " + tokenToString(token)); + }(); + } + + var body = []; + + while (current < tokensList.length) { + body.push(walk()); + } + + return t.program(body); +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wast-parser/lib/index.js b/node_modules/@webassemblyjs/wast-parser/lib/index.js new file mode 100644 index 0000000..1567e05 --- /dev/null +++ b/node_modules/@webassemblyjs/wast-parser/lib/index.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _exportNames = { + parse: true +}; +exports.parse = parse; + +var parser = _interopRequireWildcard(require("./grammar")); + +var _tokenizer = require("./tokenizer"); + +var _numberLiterals = require("./number-literals"); + +Object.keys(_numberLiterals).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _numberLiterals[key]; + } + }); +}); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + +function parse(source) { + var tokens = (0, _tokenizer.tokenize)(source); // We pass the source here to show code frames + + var ast = parser.parse(tokens, source); + return ast; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wast-parser/lib/number-literals.js b/node_modules/@webassemblyjs/wast-parser/lib/number-literals.js new file mode 100644 index 0000000..fea08f9 --- /dev/null +++ b/node_modules/@webassemblyjs/wast-parser/lib/number-literals.js @@ -0,0 +1,116 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parse32F = parse32F; +exports.parse64F = parse64F; +exports.parse32I = parse32I; +exports.parseU32 = parseU32; +exports.parse64I = parse64I; +exports.isInfLiteral = isInfLiteral; +exports.isNanLiteral = isNanLiteral; + +var _long = _interopRequireDefault(require("@xtuc/long")); + +var _floatingPointHexParser = _interopRequireDefault(require("@webassemblyjs/floating-point-hex-parser")); + +var _helperApiError = require("@webassemblyjs/helper-api-error"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function parse32F(sourceString) { + if (isHexLiteral(sourceString)) { + return (0, _floatingPointHexParser.default)(sourceString); + } + + if (isInfLiteral(sourceString)) { + return sourceString[0] === "-" ? -1 : 1; + } + + if (isNanLiteral(sourceString)) { + return (sourceString[0] === "-" ? -1 : 1) * (sourceString.includes(":") ? parseInt(sourceString.substring(sourceString.indexOf(":") + 1), 16) : 0x400000); + } + + return parseFloat(sourceString); +} + +function parse64F(sourceString) { + if (isHexLiteral(sourceString)) { + return (0, _floatingPointHexParser.default)(sourceString); + } + + if (isInfLiteral(sourceString)) { + return sourceString[0] === "-" ? -1 : 1; + } + + if (isNanLiteral(sourceString)) { + return (sourceString[0] === "-" ? -1 : 1) * (sourceString.includes(":") ? parseInt(sourceString.substring(sourceString.indexOf(":") + 1), 16) : 0x8000000000000); + } + + if (isHexLiteral(sourceString)) { + return (0, _floatingPointHexParser.default)(sourceString); + } + + return parseFloat(sourceString); +} + +function parse32I(sourceString) { + var value = 0; + + if (isHexLiteral(sourceString)) { + value = ~~parseInt(sourceString, 16); + } else if (isDecimalExponentLiteral(sourceString)) { + throw new Error("This number literal format is yet to be implemented."); + } else { + value = parseInt(sourceString, 10); + } + + return value; +} + +function parseU32(sourceString) { + var value = parse32I(sourceString); + + if (value < 0) { + throw new _helperApiError.CompileError("Illegal value for u32: " + sourceString); + } + + return value; +} + +function parse64I(sourceString) { + var long; + + if (isHexLiteral(sourceString)) { + long = _long.default.fromString(sourceString, false, 16); + } else if (isDecimalExponentLiteral(sourceString)) { + throw new Error("This number literal format is yet to be implemented."); + } else { + long = _long.default.fromString(sourceString); + } + + return { + high: long.high, + low: long.low + }; +} + +var NAN_WORD = /^\+?-?nan/; +var INF_WORD = /^\+?-?inf/; + +function isInfLiteral(sourceString) { + return INF_WORD.test(sourceString.toLowerCase()); +} + +function isNanLiteral(sourceString) { + return NAN_WORD.test(sourceString.toLowerCase()); +} + +function isDecimalExponentLiteral(sourceString) { + return !isHexLiteral(sourceString) && sourceString.toUpperCase().includes("E"); +} + +function isHexLiteral(sourceString) { + return sourceString.substring(0, 2).toUpperCase() === "0X" || sourceString.substring(0, 3).toUpperCase() === "-0X"; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wast-parser/lib/string-literals.js b/node_modules/@webassemblyjs/wast-parser/lib/string-literals.js new file mode 100644 index 0000000..db1ff75 --- /dev/null +++ b/node_modules/@webassemblyjs/wast-parser/lib/string-literals.js @@ -0,0 +1,94 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parseString = parseString; +// string literal characters cannot contain control codes +var CONTROL_CODES = [0, // null +7, // bell +8, // backspace +9, // horizontal +10, // line feed +11, // vertical tab +12, // form feed +13, // carriage return +26, // Control-Z +27, // escape +127 // delete +]; // escaped sequences can either be a two character hex value, or one of the +// following single character codes + +function decodeControlCharacter(char) { + switch (char) { + case "t": + return 0x09; + + case "n": + return 0x0a; + + case "r": + return 0x0d; + + case '"': + return 0x22; + + case "′": + return 0x27; + + case "\\": + return 0x5c; + } + + return -1; +} + +var ESCAPE_CHAR = 92; // backslash + +var QUOTE_CHAR = 34; // backslash +// parse string as per the spec: +// https://webassembly.github.io/spec/core/multipage/text/values.html#text-string + +function parseString(value) { + var byteArray = []; + var index = 0; + + while (index < value.length) { + var charCode = value.charCodeAt(index); + + if (CONTROL_CODES.indexOf(charCode) !== -1) { + throw new Error("ASCII control characters are not permitted within string literals"); + } + + if (charCode === QUOTE_CHAR) { + throw new Error("quotes are not permitted within string literals"); + } + + if (charCode === ESCAPE_CHAR) { + var firstChar = value.substr(index + 1, 1); + var decodedControlChar = decodeControlCharacter(firstChar); + + if (decodedControlChar !== -1) { + // single character escaped values, e.g. \r + byteArray.push(decodedControlChar); + index += 2; + } else { + // hex escaped values, e.g. \2a + var hexValue = value.substr(index + 1, 2); + + if (!/^[0-9A-F]{2}$/i.test(hexValue)) { + throw new Error("invalid character encoding"); + } + + byteArray.push(parseInt(hexValue, 16)); + index += 3; + } + } else { + // ASCII encoded values + byteArray.push(charCode); + index++; + } + } + + return byteArray; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wast-parser/lib/tokenizer.js b/node_modules/@webassemblyjs/wast-parser/lib/tokenizer.js new file mode 100644 index 0000000..bb6f78f --- /dev/null +++ b/node_modules/@webassemblyjs/wast-parser/lib/tokenizer.js @@ -0,0 +1,447 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.tokenize = tokenize; +exports.tokens = exports.keywords = void 0; + +var _helperFsm = require("@webassemblyjs/helper-fsm"); + +var _helperCodeFrame = require("@webassemblyjs/helper-code-frame"); + +// eslint-disable-next-line +function getCodeFrame(source, line, column) { + var loc = { + start: { + line: line, + column: column + } + }; + return "\n" + (0, _helperCodeFrame.codeFrameFromSource)(source, loc) + "\n"; +} + +var WHITESPACE = /\s/; +var PARENS = /\(|\)/; +var LETTERS = /[a-z0-9_/]/i; +var idchar = /[a-z0-9!#$%&*+./:<=>?@\\[\]^_`|~-]/i; +var valtypes = ["i32", "i64", "f32", "f64"]; +var NUMBERS = /[0-9|.|_]/; +var NUMBER_KEYWORDS = /nan|inf/; + +function isNewLine(char) { + return char.charCodeAt(0) === 10 || char.charCodeAt(0) === 13; +} + +function Token(type, value, start, end) { + var opts = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; + var token = { + type: type, + value: value, + loc: { + start: start, + end: end + } + }; + + if (Object.keys(opts).length > 0) { + // $FlowIgnore + token["opts"] = opts; + } + + return token; +} + +var tokenTypes = { + openParen: "openParen", + closeParen: "closeParen", + number: "number", + string: "string", + name: "name", + identifier: "identifier", + valtype: "valtype", + dot: "dot", + comment: "comment", + equal: "equal", + keyword: "keyword" +}; +var keywords = { + module: "module", + func: "func", + param: "param", + result: "result", + export: "export", + loop: "loop", + block: "block", + if: "if", + then: "then", + else: "else", + call: "call", + call_indirect: "call_indirect", + import: "import", + memory: "memory", + table: "table", + global: "global", + anyfunc: "anyfunc", + mut: "mut", + data: "data", + type: "type", + elem: "elem", + start: "start", + offset: "offset" +}; +exports.keywords = keywords; +var NUMERIC_SEPARATOR = "_"; +/** + * Build the FSM for number literals + */ + +var numberLiteralFSM = new _helperFsm.FSM({ + START: [(0, _helperFsm.makeTransition)(/-|\+/, "AFTER_SIGN"), (0, _helperFsm.makeTransition)(/nan:0x/, "NAN_HEX", { + n: 6 + }), (0, _helperFsm.makeTransition)(/nan|inf/, "STOP", { + n: 3 + }), (0, _helperFsm.makeTransition)(/0x/, "HEX", { + n: 2 + }), (0, _helperFsm.makeTransition)(/[0-9]/, "DEC"), (0, _helperFsm.makeTransition)(/\./, "DEC_FRAC")], + AFTER_SIGN: [(0, _helperFsm.makeTransition)(/nan:0x/, "NAN_HEX", { + n: 6 + }), (0, _helperFsm.makeTransition)(/nan|inf/, "STOP", { + n: 3 + }), (0, _helperFsm.makeTransition)(/0x/, "HEX", { + n: 2 + }), (0, _helperFsm.makeTransition)(/[0-9]/, "DEC"), (0, _helperFsm.makeTransition)(/\./, "DEC_FRAC")], + DEC_FRAC: [(0, _helperFsm.makeTransition)(/[0-9]/, "DEC_FRAC", { + allowedSeparator: NUMERIC_SEPARATOR + }), (0, _helperFsm.makeTransition)(/e|E/, "DEC_SIGNED_EXP")], + DEC: [(0, _helperFsm.makeTransition)(/[0-9]/, "DEC", { + allowedSeparator: NUMERIC_SEPARATOR + }), (0, _helperFsm.makeTransition)(/\./, "DEC_FRAC"), (0, _helperFsm.makeTransition)(/e|E/, "DEC_SIGNED_EXP")], + DEC_SIGNED_EXP: [(0, _helperFsm.makeTransition)(/\+|-/, "DEC_EXP"), (0, _helperFsm.makeTransition)(/[0-9]/, "DEC_EXP")], + DEC_EXP: [(0, _helperFsm.makeTransition)(/[0-9]/, "DEC_EXP", { + allowedSeparator: NUMERIC_SEPARATOR + })], + HEX: [(0, _helperFsm.makeTransition)(/[0-9|A-F|a-f]/, "HEX", { + allowedSeparator: NUMERIC_SEPARATOR + }), (0, _helperFsm.makeTransition)(/\./, "HEX_FRAC"), (0, _helperFsm.makeTransition)(/p|P/, "HEX_SIGNED_EXP")], + HEX_FRAC: [(0, _helperFsm.makeTransition)(/[0-9|A-F|a-f]/, "HEX_FRAC", { + allowedSeparator: NUMERIC_SEPARATOR + }), (0, _helperFsm.makeTransition)(/p|P|/, "HEX_SIGNED_EXP")], + HEX_SIGNED_EXP: [(0, _helperFsm.makeTransition)(/[0-9|+|-]/, "HEX_EXP")], + HEX_EXP: [(0, _helperFsm.makeTransition)(/[0-9]/, "HEX_EXP", { + allowedSeparator: NUMERIC_SEPARATOR + })], + NAN_HEX: [(0, _helperFsm.makeTransition)(/[0-9|A-F|a-f]/, "NAN_HEX", { + allowedSeparator: NUMERIC_SEPARATOR + })], + STOP: [] +}, "START", "STOP"); + +function tokenize(input) { + var current = 0; + var char = input[current]; // Used by SourceLocation + + var column = 1; + var line = 1; + var tokens = []; + /** + * Creates a pushToken function for a given type + */ + + function pushToken(type) { + return function (v) { + var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var startColumn = opts.startColumn || column - String(v).length; + delete opts.startColumn; + var endColumn = opts.endColumn || startColumn + String(v).length - 1; + delete opts.endColumn; + var start = { + line: line, + column: startColumn + }; + var end = { + line: line, + column: endColumn + }; + tokens.push(Token(type, v, start, end, opts)); + }; + } + /** + * Functions to save newly encountered tokens + */ + + + var pushCloseParenToken = pushToken(tokenTypes.closeParen); + var pushOpenParenToken = pushToken(tokenTypes.openParen); + var pushNumberToken = pushToken(tokenTypes.number); + var pushValtypeToken = pushToken(tokenTypes.valtype); + var pushNameToken = pushToken(tokenTypes.name); + var pushIdentifierToken = pushToken(tokenTypes.identifier); + var pushKeywordToken = pushToken(tokenTypes.keyword); + var pushDotToken = pushToken(tokenTypes.dot); + var pushStringToken = pushToken(tokenTypes.string); + var pushCommentToken = pushToken(tokenTypes.comment); + var pushEqualToken = pushToken(tokenTypes.equal); + /** + * Can be used to look at the next character(s). + * + * The default behavior `lookahead()` simply returns the next character without consuming it. + * Letters are always returned in lowercase. + * + * @param {number} length How many characters to query. Default = 1 + * @param {number} offset How many characters to skip forward from current one. Default = 1 + * + */ + + function lookahead() { + var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; + return input.substring(current + offset, current + offset + length).toLowerCase(); + } + /** + * Advances the cursor in the input by a certain amount + * + * @param {number} amount How many characters to consume. Default = 1 + */ + + + function eatCharacter() { + var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + column += amount; + current += amount; + char = input[current]; + } + + while (current < input.length) { + // ;; + if (char === ";" && lookahead() === ";") { + var startColumn = column; + eatCharacter(2); + var text = ""; + + while (!isNewLine(char)) { + text += char; + eatCharacter(); + + if (char === undefined) { + break; + } + } + + var endColumn = column; + pushCommentToken(text, { + type: "leading", + startColumn: startColumn, + endColumn: endColumn + }); + continue; + } // (; + + + if (char === "(" && lookahead() === ";") { + var _startColumn = column; + eatCharacter(2); + var _text = ""; // ;) + + while (true) { + char = input[current]; + + if (char === ";" && lookahead() === ")") { + eatCharacter(2); + break; + } + + _text += char; + eatCharacter(); + + if (isNewLine(char)) { + line++; + column = 0; + } + } + + var _endColumn = column; + pushCommentToken(_text, { + type: "block", + startColumn: _startColumn, + endColumn: _endColumn + }); + continue; + } + + if (char === "(") { + pushOpenParenToken(char); + eatCharacter(); + continue; + } + + if (char === "=") { + pushEqualToken(char); + eatCharacter(); + continue; + } + + if (char === ")") { + pushCloseParenToken(char); + eatCharacter(); + continue; + } + + if (isNewLine(char)) { + line++; + eatCharacter(); + column = 0; + continue; + } + + if (WHITESPACE.test(char)) { + eatCharacter(); + continue; + } + + if (char === "$") { + var _startColumn2 = column; + eatCharacter(); + var value = ""; + + while (idchar.test(char)) { + value += char; + eatCharacter(); + } + + var _endColumn2 = column; + pushIdentifierToken(value, { + startColumn: _startColumn2, + endColumn: _endColumn2 + }); + continue; + } + + if (NUMBERS.test(char) || NUMBER_KEYWORDS.test(lookahead(3, 0)) || char === "-" || char === "+") { + var _startColumn3 = column; + + var _value = numberLiteralFSM.run(input.slice(current)); + + if (_value === "") { + throw new Error(getCodeFrame(input, line, column) + "Unexpected character " + JSON.stringify(char)); + } + + pushNumberToken(_value, { + startColumn: _startColumn3 + }); + eatCharacter(_value.length); + + if (char && !PARENS.test(char) && !WHITESPACE.test(char)) { + throw new Error(getCodeFrame(input, line, column) + "Unexpected character " + JSON.stringify(char)); + } + + continue; + } + + if (char === '"') { + var _startColumn4 = column; + var _value2 = ""; + eatCharacter(); // " + + while (char !== '"') { + if (isNewLine(char)) { + throw new Error(getCodeFrame(input, line, column) + "Unexpected character " + JSON.stringify(char)); + } + + _value2 += char; + eatCharacter(); // char + } + + eatCharacter(); // " + + var _endColumn3 = column; + pushStringToken(_value2, { + startColumn: _startColumn4, + endColumn: _endColumn3 + }); + continue; + } + + if (LETTERS.test(char)) { + var _value3 = ""; + var _startColumn5 = column; + + while (char && LETTERS.test(char)) { + _value3 += char; + eatCharacter(); + } + /* + * Handle MemberAccess + */ + + + if (char === ".") { + var dotStartColumn = column; + + if (valtypes.indexOf(_value3) !== -1) { + pushValtypeToken(_value3, { + startColumn: _startColumn5 + }); + } else { + pushNameToken(_value3); + } + + eatCharacter(); + _value3 = ""; + var nameStartColumn = column; + + while (LETTERS.test(char)) { + _value3 += char; + eatCharacter(); + } + + pushDotToken(".", { + startColumn: dotStartColumn + }); + pushNameToken(_value3, { + startColumn: nameStartColumn + }); + continue; + } + /* + * Handle keywords + */ + // $FlowIgnore + + + if (typeof keywords[_value3] === "string") { + pushKeywordToken(_value3, { + startColumn: _startColumn5 + }); + continue; + } + /* + * Handle types + */ + + + if (valtypes.indexOf(_value3) !== -1) { + pushValtypeToken(_value3, { + startColumn: _startColumn5 + }); + continue; + } + /* + * Handle literals + */ + + + pushNameToken(_value3, { + startColumn: _startColumn5 + }); + continue; + } + + throw new Error(getCodeFrame(input, line, column) + "Unexpected character " + JSON.stringify(char)); + } + + return tokens; +} + +var tokens = tokenTypes; +exports.tokens = tokens; \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wast-parser/package.json b/node_modules/@webassemblyjs/wast-parser/package.json new file mode 100644 index 0000000..ad28f95 --- /dev/null +++ b/node_modules/@webassemblyjs/wast-parser/package.json @@ -0,0 +1,73 @@ +{ + "_from": "@webassemblyjs/wast-parser@1.8.5", + "_id": "@webassemblyjs/wast-parser@1.8.5", + "_inBundle": false, + "_integrity": "sha512-daXC1FyKWHF1i11obK086QRlsMsY4+tIOKgBqI1lxAnkp9xe9YMcgOxm9kLe+ttjs5aWV2KKE1TWJCN57/Btsg==", + "_location": "/@webassemblyjs/wast-parser", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/wast-parser@1.8.5", + "name": "@webassemblyjs/wast-parser", + "escapedName": "@webassemblyjs%2fwast-parser", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/ast", + "/@webassemblyjs/wast-printer" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.8.5.tgz", + "_shasum": "e10eecd542d0e7bd394f6827c49f3df6d4eefb8c", + "_spec": "@webassemblyjs/wast-parser@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/ast", + "author": { + "name": "Sven Sauleau" + }, + "bugs": { + "url": "https://github.com/xtuc/webassemblyjs/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/floating-point-hex-parser": "1.8.5", + "@webassemblyjs/helper-api-error": "1.8.5", + "@webassemblyjs/helper-code-frame": "1.8.5", + "@webassemblyjs/helper-fsm": "1.8.5", + "@xtuc/long": "4.2.2" + }, + "deprecated": false, + "description": "WebAssembly text format parser", + "devDependencies": { + "@webassemblyjs/helper-test-framework": "1.8.5", + "mamacro": "^0.0.3" + }, + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "homepage": "https://github.com/xtuc/webassemblyjs#readme", + "keywords": [ + "webassembly", + "javascript", + "ast", + "parser", + "wat", + "wast" + ], + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/wast-parser", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/xtuc/webassemblyjs.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/wast-parser/webassemblyjs-wast-parser-1.7.10.tgz b/node_modules/@webassemblyjs/wast-parser/webassemblyjs-wast-parser-1.7.10.tgz new file mode 100644 index 0000000000000000000000000000000000000000..bac0568f7e412ea82fa4680f0f003b1642a2121f GIT binary patch literal 25182 zcmV)KK)SyliwFP!000001MPkNe%r>eX#eI@AZ*VuX;T#SVL73lIEpOSy0s-ANp9L} zy9z{t5*mtR2++0~yT3lhy{~Z}sZVm}W52Ng0g|$vbIdjtu-K2;+1c5d+1c4i*!wxW zh}I|kxBd5IJo?>=f1OTeXJhuV{C=$kL46cnMfGk_|Nd=s9wte2bw0fQd$RsEOwzSUI8CByy@mPS zMAIZ5k1*>-`(Asa!^!<9=}qHFDn9)fo$rcDf;4)U27~eRDog{jrk|thx8rF)f&4Gw z9a4;@DGMb1J$w^#%`yc5l8;7hSUODgBV>Zd*VNEe7!y##_nJA28OeF2E%cf#-oe1$v7URYnRbGIZ*RTUPi-7G+hfP@me&U zj!PHljr-BsU@9o3Oo>5q<;nUko%Pm-#9u%K#VIn}^qc0P=g%f0bv5MSsv!d@>*uw$H|rwc&oCsEkPPlLO6zwYhyI@|X) zzP>lu+zvN4JDu>nv%S&T9&Fs(>PMTKJNLfXuGc=)mYx5C@2@{S*xNrm* z|K>)P|93WbI$!wz$M^wj3Z62js@3+!lj~`GahV27okQEyTs{U{vP;!%L#Xw-8t)L%c)#tMm5)+!?h}jnQV|_dgl4v-rK@Gs%0_v-V zj`ASr6GUh#P?TWG+spBl-IF+}4QA63G#OEu{uoe3E&e^~rI>=*2jk&z{1&^`8;|-i z_9*GrYNzliJRiS_s4qO;qj3tLG6*;T6FsWpQ*s#&hrxLy5C-i6dPAc-Q*0h4(X5 zVK#;?`0>d;CSiNK@c+HjgQG+2#@^B4=`p;vpqIy|s_2ggC;P2n_xRuh5%T!>=vk|V z=!6nSR0)(j+~-;l)qyo4kOkjgob0O#gGc+jPob_8ER0>0ncGXRKVN>I_9xf>V8eZEt7R|GV3pU)KMR@%w#{uk_Vw-v!0WT&?!|-v5yk+3>zzx~j#4@I{o&;EA z=C8q5Dy2P{j?*#L7(7(H3c6WX1qdc!kX)-7AdmN;(b-jaK8$v!)9|_xPNx#rl+cb7 z{QYB^Dr0*XjV{tlXe|yN1UdoU@7%#ku+Yo+HI#!V zcrc*FPX?kzD#L<|mjJ;G&=JL%(Gv6+tuBut#|bgoJU*SZ9o?7p+y;Ifr2b-P0lV)k z1zVd3s+IQoXm)iD6%UE%hDj#(320%U_viu%C3p*@Pl2NS=`6Zm zGwCHx{=@(^2nx_t``nZ)fvIhxOeA3LMO$=&rU7Mm6AovbBktP`(D&0Zqlz2ReQ|1+ z2HSd5Sh55VGCgS2aZ2^Vv|%*c3hGVnCA8}S-05&1H2ZiEM^hxMQ_N*Th11}S-v2Nh z_X5%5HaxSjE(jvfUcWW+v>`!$LoT1%Un$8Pf;L(Jo{oEsw5?$=`_pV;8!fJ^Nzg~{ zh>BDvSp49@cp4`uWM)xB^`SSLPN8y~(Dy~sMU=i6#lOs=L!=<+S=&naV>Dvc+GxrW z06~g5{)fBlhnH>+8V}vy_$lG=^5*Mz^L>a52Vd!nO^l z24G`L4lu_k?4$A?20y*MjEB)r!EijDv_X-FqEIJP*pCMBD54zU@aLZt652S}3M2Tf zA;|_|C*;WSBP6{PIC*`)M!8hkC`_3SWck2X`pz9)9KkNP;Ux*B67PR$wx z1cA8#+WBxc%tqXIJs)J9LzwxeSrGN3;LgEXupz+3p96}jMdtV*!4kA;=5Gs9&+YsP zlB?Z)YbsikAzOnSgrmVJ;DeB&D{^=Raz8smkmZ7}U>UySTSkP~-qLV2A!8jCkST+L z6?6lbbWtxQ(--0kO-$H0)=CdhrWIVoXu6~{52I^lFso_Jj|Q6AJi!idv&iI49!wZK zSu+!tT4>iP__l!cX%cbaGlr3>Q61vdJRclhJ6%xDBrK`O@RXNI1n4+?Yq3E!NeZDl z^MU1(g+gz`1W47f1l4eUvE+^d!KewQdL;@0*c%49_-F%I zA9qIz%{9k0mx^OU0%@xeYoir}g4T6R&{{V&j?;ZvZ`28%2 zFTM+!GQav|@;4*{dcc|p6bc@++wGEtg|eawo3$(t$!$pNhiRyiZtIG4?Om)Q{f_^A zXk%*KrBPZfpHW$d7skZ6ObOc(b{lnWv91{~aZucpOQNK{qgFY%SwE0?=hR%;dP= zh5t0ztD{9;3xJyg6QAjY-=W8{ibG~HNmHH0F>_dE9uXF{DBEmbh418UkK3L({Jv4l zmF(KQ^fb5$vbafI(88o4RuFefB2%CUq`R15)NBjav3R_m0BNrSV~W;sKW&}e5R>+0 zdNuq#*0z>J7eq}ZbbB04LHbKqC zatz6F{~g<~7N8qdyaJyWwGbO?yCdi?qPV9eN-%Otzztxz%7VWgnUP?Nw>Gov*UsM` zr?MZONx&9cvLn+jMcv1Q4IWFGLQwsH*?>$z2E1wX%PgLvQ0--YIT%K3Ho-+z+Pu;- z3Y0PvfT#nwFd<;fQ{gdrDjjHPT=b(ZO0|NQR{gK%SVGFPMOQ?dhYOHS&n||b&kfzh zV+oA-P!gNS(5)gW&Ta@7HDg+wU#Gk+CE2REraGL}kt*uUX6hM!ifpMtY?VxA0{#Y1 z|7J_{9)y6lYQ3SJnsb?Nid$(FRXQpIJQJ8E7grh`z0&@jUyri0S5xTRvPJsb(s0}k z9z-CKh$;`{Wx(IacaX1U4~OP3s4F=e?Wsp za7chWJv2)`K(6+ko7=yRonluUbyJFX1qvr&z^89I>ZbmR00KqFy$FS$m#^J#r?ip; zb%CS$jj5`lcZ=DNGptbIO6sd5mzL33#Y5IkWM~uy12Sz;T0G5DmT0`?V|8^2#-nL3 zq50}kR$+qD=I267n176@R!uOhB;=YGEa}zH->s#*0=u_tq|2(D)v)NOomCaj`KssV zseC%>r!#QEI1e=+7U-dQG*DR=b+l1pmX)TOzJTiwSzd#r$}q{vf(MOidwu2xfkJ-_8_hFb!X78 z;*k`x4n}Dy-8Fye%z;s~sI}#y7V~H=$gGFZg%;LoQ@6XIw`5YotxkD^LsUdvKuSjjTl)> zx7>w#NictpRm@WPS}fWg5U$*PzLE=Q#$=$DxKJ!|EltdA=|aI&-md%AMYdbzFI*nx z^{GM5xAtb)P8EX^oqx7^nZKlE)-z{a5*ck%!vGr%uWVgIemag4TmgNb4(IDWq@Fa( zS!46WTh&k*H6+g@s~!s_Y&`&ZqNux4X60Np7867&`yAk=enw``SqkN7kc8C^CzIiI zL#DNSZoV{u9|NK(PovrNEt+#+ozf^T0xZ*q4J@Y>1Iu}Gp#5aRxw{~vbS~Br;Rd#9 zDZPqN>veXJ)1%1SA;a#N-$O68*T*bLgUb-rZ{lP*rd?u2H0iM(TI*V*)E8$ zTviFd^vd$DHuNeH9uvA{il86A$RG==YymdQi=hylp^4izczy}`2du*N%M8z>;T#Ex zns%(il%@o)(QG(0zfwPhK;{>H=L%I4uoW40bw8zLmr|B9?apJ|xqJN!i#dL7Y!5~S zMqb7m$|rmzIB1^F&8oJG&D;*Ylz%Mk6eko6L#|B{ELVC$dzU*qB{nggEqzLEqr8o| zQrjmpp`gUZOyGRnzg}Ew%X94UdB-lZH>$WT0d4MBi#bGt&@#zzF3&|j-|7rkzBI7B zkApVQCOR@V*&00XI_05e$hp<pfvgK0kG^~^7Bg>r znVK)fSI{W}q@Xk&%{-?YGT1qVDQ}~sBu$&(kFMmVI! z8||3m%j^l9pIQljHSv&M8PiS<#rjxl`zKBFc=niW25ZQDY@+`tWIu&PO^} z>$SuWh-#NQU+bz}@xY^VX#`t}SIby?T6!wY)yFWjL7_&LQOKxKHuQA6!7Z%dR&dZ| z$#1<-FYtZh@Y13&dB3Jyx0) z)|#F|a|_tp5XyXW+ZQ|A7dzV*J6l&G$C)4;ua^ z8OM&v!fqW)qgn9ih4IYg3lV)R=0Opr1sE&Fw3vY=szuU5UMViJeJGpf%0*o%C$z7I zANCAZX7WWje-V*77Ry65ue+8Dhon$}zNX-z$vmOg2#Hfc?&UJ%i0Pg?dJw&Hyf!(( z@Y=*fJcW*$xfz6KX6|?Ci)m+oH#&^O$C};?;kS(N%I@?l_qP;B3c>-#gkc22syt4+ zjx*!(4vgAIle_ZB@~v<`=yHy8fxrVh6lCfvTBtp3SgUm+qLKkjR*W)hQ$(Djs@sdS z5msvcQXOcB`@rFW@H@n*C>EA7m;~Pstyd}5?Lj-z2eSj(3Ts^vM^%R2=^vCDbizt09DSHctrb!fVb0KQiVs^uS?=$9GDj`yvK1@{l$ zjN`u1i>gOrWi_QD-73n992nPC5<{+rXA!j;!VT0Wzj*{)Pq;nnk7$ zT;Q9oYF0&b3TVny3B539Bg5agCt?&wG7U$4z~6A(1L-gaC{b3%$XP95zJ=CooWI{p z+rBBN+jfIUs&Kf-NvSGD2NVr=2yoiSEp)VLpNJ zC3M0O7AOicR z9cP?c9FH1$UBsovX>VcI9Jii$P_7oBMydvrHzB>y??)kvP8)VM5XSv?xtY$eCuQ=HMH#Z*?!tQ1kolXza5S$l6KEcsxbJlTt&J6b>=%VWwyT;&P;l78em#qBGtKG9U-3A(JTT z=Nm>JkP?su{K0Hwu@jkm9{bbLd)5148V$Yay*HSDonIYtq`~I1=Co0cE0Wj-hu)KS z0MPLRUa!6@-t{&F)=GP|MMi2X{`fBFNmmnJ&{or_q(GMxHmTC;w+i#VnP-xskkAy3 z*l%W0iTO}rJZDSB9o-X4#qM-$Xt8UiI~a)7}WeYZ-bLpZYRg|KM7Wc4a0N%{qTh5`8g(#$Ivo)*vV($kO z!z??hbNpr>s|YO}mhN#0Wff$fnFM3ulixH7ulu;CHvo`8i*ZQcew9ve%T*!{nGK3C zAeCCQ#H)o{wmp|C15i0?obZz>!IkrD=2fmIT%mDT-$WRjQR5ff3|4;KyK2)6QFfTI zc9q<-E)jyx?22f(gjI0qKx5kBr+l2TXK|8{N1|Z(bbc2#41t(99glJ%jj@lB>|fs2 zwBzln`5r;r(ikeqO1;%A$`9i~(X7gZh%#q0#)POehj|m3JY6#GF9kpxjL5zbT#sku zrY+pDxHh~)+qTx-O4LwlCcln>k>AEJs=W};SK=tAV~5d0!f2fG^?J1VG8m5Enss=$ zF0_Y}?OW=(50tYxIMe<9_{SE_-UHdIrk6g#sQ+Eho;8%sIBJ~7u1YzP`_LJ@Tljh_ zNH@qDCt_EooAf4+b1B;gea1&FO0R5{OuI6aoXRXt_sPusddrhj!#3l0e{QEDXs^p1gC0N_!jc~sob=^&tInDRi2Lg zyiYBco?f5Z9y%@GpUtslghmHXu5>of6JEI`hGmW)X>tjZ0{xxzDZRjV-4=f&X&@sb z&0X&0)I+i`&W2P!>UQH&`(xRF=w#&H2C#~dBUO*sSvwmDp@dEi9^FWjPQ#d#E>zZn zN&8W~Gzr^Dec>zmJ+& zS_$DYZ{NsMonf^e@ric5aiVUB3eS=D?Yqd$%WCeC0RFSg40DmuHWCAfo_Je#;K;qEiT6UO} zT+Ou9L27?~uUh!&Wl!$-YA>6gbAy9VSuulT$onO7Nl;`iwL(s%!ef(A{&Hq$NDhSz z7GA2Rq=YSHk*Tt;#LZPY^HZ=!Dx?qQAzZjTRTE0MPUaB!JG8U*NwLEdVcfsLczPAG*^9QnfU@x9o}q+s?=A6|Qux5D zc~ZR4s<+^Y?@xZcFaNdloh#2py+(}ARa`M!T8eb9mo0a(s(-O}PW>)$&#I;3h%gtX zFHF%TtC=fSKX`_?gmjWSV1kfWFkoEMVgqJRr*anxmL4$W^0&2QMdlPY2bdx48W3lP zmjN)-={BCOHX7+6UeyR|R+}@vrA_lvP%&?aGBD}8Bx->*x?&jrIoskNLFDlEb@A0ucO#w&Cy)tE0!EAO-X)it6SPoR?**~N;@=zxcy5PJ++h>bxyZq{rj+1la$24;aOI8of)`5wfIxnO+TlFNc1O z(sHXUKHMHB$t+6NcZ}lhT{iuEjyz{ldu=pxhcRy`i-uDUse-cQe9RqPcZ6*(dhu82 zLnwcmhqqns!O+d&6eGHB9UUf<=z@d2RJ_p(ic@UL20gNe5h&VxaLGK9Mqm6YzFCsb zw7I!up~6U*IUz8iayP;7G7P9 zv7$~mM-&!Xe8{Fn^=!^teX2kvs?5Tc8+Mk;wK8W+{d6s=tHeP3k*xC%AREXmxKyps zxNKor1hch*fV)R1`8eLD8@@J+WjipfEay4L_n}-rGUxZazOQTmHToeB+4*|0RlXNz zRyVd5??#coh^HHy=4O9hKeluGv7!rs^ANJBFtWWkM#SNu@;KSb9=Gvf9-5yRFWo`g(ou=6Zcs_4?it zq??VXUfk^+MY>cnuiszaT)%fzzrS9*-~BKREA;xF?DZokm)GZSZm!SwRG+_DywBM? z28uiVweqsZf_c5(=-gblzi#PP7Vo#`CWGRRe$GV~G*Jo>Uod z8cM?nHmBS9qSMmd#$i^?EZ%P_SEb_{vg1Ml$?18%xV3!GH+0XJ5YAA)tkQ8Mow2wXu+>0JGLs(5vw9WT6v;$4pC}JdIQBQ|79fkW~vn$ zsEnvkRg6-?97T}QK@da*op7Xh= z55N2J`&hq8*!wxWh}NUzYMqQh?Y}3hZllxb?Cfj@zI6O;Z*2y@+q%2c+1S|G=|Dbs zxC_h5?>egn#P^%w%mh%Dt%v&(sK39FpK$BFjfc}{HJkgY zd6LKfh=LC)mrTNZ!ok=!$O`tv?0_~AiBm|14@G4T;=n&fP%IIaYD%YLIvAcLxddj3 z3=kRz4wy*JgfUITT0U)ao7_e#kTq*=1DS!tNKkL9ez47TZOAs&q<;TXkIcvUne*R4 z!OA#6@%+Er*}3P=|E;^58(-%C$M}h<{d7FK5L4lM@-G=ef}Z&_sh&jd9uLQ1D)ZSc zC>3KMYa1Z0ZaB3bhNCjI zHs)2^#Cv+pOzn8o8_xPs(x`VqeRwFWt0TLU?PPY&PS0*(kOPheT=ouB-wHN%n$S?^ z-8NBoMucNM%7?`d{=wVX{xWzUeek~S7(W+DE5!PuM6tDb;2{e0;wQfIsT{zv%s>C> z#UG)CKsJN7J&JnqRXD_rzY*v)g$-o(NKY^0B;Z9f5Q}KQM~g6+$90sV5W{CM*mo@I zx9cVhHsE<+XQ!WVy~{!Ci>=K$X!T=X;hM8O(2@Og&rOEjs2>c6(FJsx3!o3>Y-^Ku zi3=&E82+8@JhH$=sscq|cIYjxb!}XFPO{Ud#m5IeU*agyhYWhTU`1vKE`i-UEbR(7p2~1I1PJv#sMRx-~lR(z8B)bX!tuF56J|R&`Pj(ba;Av z^z>}+=+XWO8izY{Lmr-Ls@z+~>gUt2x=_Rbz7=9^8-;OnA0?=*)af}Xx99SFh zyf|d85qv{fOA(_OSa}#3#Tap#v-cxR5rFQ=Yz-{Hyghjvr@hO-ND26OdOfXo?VW_cxoOq$?|=QjY%QDjtURw?WwYGvxl+p71}%F? zR{JM=yU+K}_MYq>15tgmd0&ywFib8v&wsr*I#pS=ww){-7AJ`$aieuJ;yWerC{DL# z+#5OX#15YWLMBOPcWB(j;T=p^<0fi;;Z?|Iyz8U{*YoR?qc5rh5~kZ}$J}Az#0N}n z&ejSRLekh{Uq8+w6Lz)ZsoK4>=BrW_Wr-$jJg#l%U8sx{yL+;CaG)81W)xA8Pdab7CqvV+QF--Dx-*wcjL0{7(2(J zgWm?~?wX8~JNh#2D!hb1ZpwdZD`&-ffQ9nk=Jvgf9asL_-2Ni}eVm^%%|AYQ)(Wn| zpQF=hI7(t#!HO;PgXGGz?Rz{E=2UZy?!HpIPyew?7Y;MxdRSCk30#B>p* zd$Jwn_kdYi(Ef0CH8PDuJr%b@99fZb5({*>m`LHmUGZ1XHe=(kgad}*dZA>QADs0-P=cV$*V-zP@eA|?;oB}Qse!rrbvCde|oxqOvx|9wSNHnJ6nIf9`nbz-{bW} ze*5b8fB298ynUy=-hJ@xcMrdR_3GuT*MB?v>HR;~R2gwjmX2K3KEd-IFAyI`g-Kig$N*&_h1-zlWe0EMy0>pew~Tq zYkdTY`5=We_RNw5#ix)75^b~X3ZR5#t)~f2&>sUU(g5Tx{$moGFl8Q*k68QX=sIa& zXPTbdRXq1l6NoSCSfc(KK*fiQvkm4^#L4bIfOJ_cU?SDYJUu9ti!(y6MJhRK>S3hpu=J4 zv^xEz6ye+0)d99^AC$Qg@gSWa1r}t0pE^HK9Y}6ADm&|ga70DO=nq6ZQz z)CK}W50r+7cpwG;&^x)XK?40{ybKT@1A4{_O5qLvaE%~bV14k1aS#r%v-n57tGlYi z2ldXiUkRA_fzsHCAA3v>+%hs@Y#RSkii}DpqpD$AIJy?75l>v-3>&~;H#BNt8sf0Q zAFi1PR*fp3g|E}GNv0i|E_M1#DSXBeiIN^@`~+XxKR(zyJJ|<@x_f$r%3%ErxGx=j zydC_2zJH|l!TLr!61E8*8}l&_vnn)PuJ2}FpN zpQwKlAyY`lz|}JJnFC|=eqYvzsNH{bw*Qys8k9LutN;KP36()K5Y}4XxloWzglat4i%4*Mde~*FF#ngLR@Vd08{NE2_L65 zqX-mmJJ_2>A(_?!v`3JdGOO(APu!r)|S=qK0&6eb5g`^Lnq)4tI^<{Of%5( zhOa4AMW#DeFv_eZt94nUVQHXppe|jNg2t^#oc|!>m8G4Tnpumwq|OzvN@5V5yxb!p zCttkZ5CpH`HCfDNBap{rY>h-xoS z35|s!?ZsuXxDCp(L~1KI(*prATXR+DtJV;U?fLAv&Zho`NtXtpZI{ z+Qi%dO`VExxl_mhj4H%P{O8eS_$CGh`jd*`)M)+`BBA@;F0JAEFk_`M6|D*T9TjR2`(OQ!)c!lf^w}JkD_eto@K?rnX&aHVD~N@9ed&E z6fGQ`*V4VyiCwme1xeH^mOxs{4L=)+h&w8ZkDCGyV$;v|RmyPD-Ts@9wyu$gpq6Be zJBsv1t)jRP2EAxXd->rNvep8^;0$>~%GBr?JZ8>n;6R$t8(!wviRxE6c495R^R1{| zq)LQ3$zIv2Cah(d<83@}_Vz2tVfVQ*xuwWHQupiF0h4A$vMu%4!b#6s?Jc}*T3d{` z=Zsd4x_cwXSB~}73SNhW00a0zZ(-S^F;hoizD3M>4WI=rZvJLfA4P zW*d<_|EXmX18tU!qjRWMJ%WourG2I32MSbnzgF`MXQSM3o-H_@XL>-1qMB}uK<8e= z9K!XFT^=nqvxka(@Oj5sJ)SKhXQ`FSq5Gs~sT!T_Nk)~&C2o7@~#Or0}DKMkVhvw&OmTluuKotayjls3h5_fA<98tM)w z=t-|JtH}~8@JB?PElP-f&f`zy?+foP@{4d{^RO*14>PO~f-W~pk@)r;4wjt)xnv@I zKfDyJNny((1(%5KW*L%65ioa(S_xDerI!i*yM9|{yd69VM}27US%fTOw+9NT3Tp4% zMx%LbyKb*kQ{3l2@ru(HDNFAb<;g1G&pNWoaW<`QGIz_$RWR6hjcjJHc~AUd%VMX% z@{+zEwSjlM^|fbnup>sjc(e<~J0C0qa?{+`fI+koX`#^`PhFW&u@_|pRXSMk)@e_+ zLV}epAO^9Dytbo_Nx>p$lPvmD04>h=3da`{B?L(nhVt&Uj31l$c)ogVw``>hEXBo^#UPsRvrPU$p3d^duMwi z6aQngv-KtZ$4B|qXX21dFGYP)cpkFB@A-5*iKgjwgQ+fQ1@*JDD0wEF;>6B1IXm`nc{5Bt4v z+Hd657UETPvVt>9D@#luvQdCkA)ccCLe9BKT}V09+xd0Kq^9XSo7b!H`QL%}5|4&Q z6yo4dTaN^O6pR8s+*jfV%L>t37*pKn{cvAZp)VezJ^hAofyC_sqcK4Xlj%4eBd2d) zhRM;}k)(c(27UQ!2jd#?Y`RhAf)SfeMdY7rr)xR z25BHyhz=*$SLfp)%L_6)S!}KEZK5p14ht5Ph=PTz8KB5(OfDguj|s%+ZRrXG>CJ;1 zNt5n|#MqJoV3C=>k~AT@rAP}#UG^&IW?>Z|n1J1P5Io+a9Vv8Gr6Vzoa5|N^<^wiy zqCZ%aAEQ~Y6+rr?@cC33m2mkB(3{ci zFxIAua989;W?hLL(4C-W${(WgZ$mxwqC(imEK z8{L{l!NnLI7Sb{LPCzxdE6w-KBxw}(`I7CQNLT%d+~V88$ry^(0zRRQOq+6q!=Har z461GIFmq5*V`o_&)X+$Bcgf7%X%YNYpEb>vzH`Ui9#(pQc_v8)g|!SeqSUEb<9(0% zXy?lh{Yx$nF#AulAZCKEqFdQ(L$$I&QMF`@nDVfWk-sfyJh$^Yu&)BvnuFFX$kyP- zGq$c8beIHPH|E||>~carr-dO*T!FLgIlR@(37@+Q;^UM7#A>_x3STA>Jn)YoQ50Q# zsB+ztX}46dwSCAjuA!mZo=jHd!H=I?-}psGRE_Fe?yX^2$cipHB1UEJpa5)mZM`>; zb0L6dJ_ubBs(K~yvJ@r)G|xnUW}(^>q)XjS?4zUX#ep`j8WLY{eQ^|WZCQz>A;==d zAZzppxLs_^%Y>mbvB8 zRIp_OmwUsw_Ho8{l}Gr3hAht)?>!72@cUU3Uwr4iM%KySki6&tTQS^5~?KQW?Wr+SKK~G|30)a<-a#jUPffGMZOH%l+!KAxgn2BYF^BTEv{lZ z&;ZgHKGM~=RTgX!zXUkof@^ygZhOu2(Y_!}cWo3^q0)kDZwxH4UgsUw$ut5P>5Xwg zcE)mVnC_n;Q=p;C*?`EdQQ7Vq_uLvEOWn!jTt(`9G2wE#Ch){$d=+76nG5pArkPGe z*c%UrEEOVW)wQz{g`;>diqkk83M-&74B1f-5^x?pFrY6cebmhajfK4)bQ~kWT3NaVUBLMJF>!i7M>9iM9;P+swPTIbV3G4v~bZeHEheRURJ4Z6HGs`F9!f z^4Z{a$qXsgU~41{(TKQi5}86#=|FB2zKugVi1=+-+gcJ`5Mh>(u{e-{l0ZmTLjjAA zYM7!vuB#I^_$G|wD(c>trNyFK$$|&g@N;d z3`I6ku|L?)iB2|uVCeWC-(dx{+dSNw#-$7^7$<0J(*#DHib~sjhuMKvPehmMqEst* zY1RLFju~kocI^tP6)*%s{27NZahJL!@Z>{OY@$fFiU>Npc?_8jkY>b5;_UW@cH0P6 z>1Xba5GB2vGAtcAV}m&Rfq6$cvz?~Ctv+olkQ(Z#IhX%aFq(>*u?S>?e4C3a#h6}c zThXtM+S#k=#ctUmwRmYbZU+xAdXA`~K@oL=2Qcuc9;+%Xgq-oI7fVq#Ymu2%N>|4E zacbk}Jp`w27N8XK-~kO5!65CP?+m@za)Fu;3pD#YDyppAJNo^piYBLjtl(>y?60WjV-B-F zUY&DcTF&^x_^4Gd_GZTPe~{kdL-*1pObCW=BicTRX#*pO(|kg<)>Rv{h4grfe^Mk0 zk{@Ku9+kfCP{mcOE=9)3$7OW<{K;1yT+ujL9p*NkN0&in{f6FPFspa=Ovs+q@Rpp< zIU8A8`izW&hQm31U)m<nbC#MoTEsKkYO{6MEM8t)z9&$ZwT?6K&6ltwCaIx`TJn3C+gh%o}b^V z*Oc95^X|&YV!Gun)Jy8cd#qxX%GY86{eW=g?*CR_qccVnwO)o|#cXN1ZcC3GCir&U zuN1Q_Fn<;FFuKnO`h2^5mPIXSnM2>`snz#VOJ!!Abk;kO(Kfyeu>J7L)~@8IV+yJ3 z{d72A+aran*{o_J&y&nmn`N}EJd?P3EUPEz5z3R7-Nm?2L|21Faevsc#SJx*2R$Q! zhl>Qhb~u>~uNyM0<#Wj9>mXqyC{Lr=^sUR~!R8>#i@?paWW&vA#c*?;9Kb&_Wx`$l zQJWB}mT+8LwN|m95bkxkkrS-Q=O)8Zd7*(0Yd54>k_ML;PcS5AnPXZfCPy3uOL8@I z+@!&9psiAE02(wdsix@)Ev5M+udS6hWhurrpH<|l*15x{V*O!JT>UeksqiEWSv9p% z4+0~Fpb&MnFb4dzzB--nR|n>^(m>DOTbkFWGu3r4EmqkQIkMg zPEd;yG|8PSfJ0bybCrS28ZJ?>V3-UOZRT4eDvOurx?@A}Zgl?H4c-BQ^kcCyY0Gs7iSZD&!#BCcqze?}} zR^d7zhv(67ju^-Bxoo37r77tUPc@ofsUJdW^b7D+BtHq`ij3^K%hJkDDa)DJD=Y}P zz9Xv;!2Dd^9<2%sL`B0hAD)wt;kHVdQp%^mEa>1?`Hzzi0ooF-)k-LVb)`MD5xSFF zq8rnV3&&8-q`Zx}Qs!r7U_uF#Im-FCf4#Vrndge;^C@4^{? zxx5@5<*PGt`O?7hKF-{r`(VsH)do|BPI;&qeQq_p!+NJ$b@uY1-f~(fSVHC&AqZrS z{EAk%BpnQ#^{9AVDYII|181qiAUs4|*$rfr1nKJ8H1i2~QZya$am+8vSn)FEXf@6@ zGKn2oS56shTI02psC(nfUnNyzF?A>#bH_ZdPSOwQvzi;j+k|k?erYo zH&eg4BHK&yZ$ievU)HJ=7@VYpR6*nIvtO05V0{t^!(f!li5b*&*EaZ}=B1dblWGNa zu}U*@S1u9DPEVwSVs{M8@nu$4o|S45|8F@dwTSX%PVx^{OAz+58UTHBr{?ER))`+Z zCCQee=S9)&L%21PpY+_mcZ+2}Q(&p%`>s+Njof2*B@B};;J9Pk>^SL;osO~NWXJ5V zW81cE+g5jM?%1~3aWZ+{cV^DaI_JY#RX?G=RIRIS6h8biVsHSX6&`{SU}~&wg>F!n zc214;gpPgmpvjuEH3(}B9=W{|QD&AYVo20D%5|?@mDgVR&5BV<_Yz5ZPPr#rC&KE5x={v?U0eef(e zFdt8bO*M_GU4X`iZ$fr$o&RLd#Gw}XMAboic7#YW3#=pUC;BW?>6Y%6>A&qwU6Lpu z=45>Pp@k7upGw z+9!Aq@2tsjb=zu20#MNhe=T00>1<@Ey)Ze{5NinVU3}4*v{OT)F~CWZ@e=FxFF^wQ zloXYe^c{gm{bdyr2ASZbrSNU%4w(K%pFoFwYm2PnLwtKI|JGB(FpL|*jYj;tR~VXv zLD16k@dN|n@Y;25`V&15`3PSHQe=_vp{1E5Z5iW`#!yM}3?{dtBHm%sr&2B(ys^WR z-d;T1)wRuBG;tV0?nj(~;UQC8z*9?}H7sDtrKE)*R%xZvVzwQROpn1T1K4Jj*31Ql zZb{gtT(hYDWuEh}D`TVnZJx)cJb%9a+dQWMOEj;(MhH7H*yA~B2fZ-yY=t1X@AxlH z!BOAy5k#f);k)s~?oSB+MTnM!>)spQ?=3QTP>%{EyIdn)xlv`>tTV2ZCq!DzO80m) z%4VI9x34=^5IaJ32-!!3;trvZf;uFXA6BCmB`E<)Y@MKr7MgAkwVrL5n{)RJ?lG?E zMQ2>#OB`lh{3W@~^r7?omVFWOdn}ma=)PcMdY+*{fhV61+dQT}E%MA=IOqPC!(B&k zVC!XhCJ?!i*K~4xotg#l04m+ZzNWivEq)eH!hubgFQK}ZLb>)WPJ;8U0w8U;k%YyT z7;Mh$KP|kl6;k`xs$?u=M!yunb`EgdiHq{ncIx#oSSb3bMU8 z5_65KSM2UAd6?k3AXwMl$?UAGQ&D#mt95I30+`P&SVO_}c>#Jy=5?#uatF0GGFbKI zhC9@!$m2`KZT`&Do^vY3T*C3-`pw~&ED9|?ojB$DAnU6gl29HB=%6$K5$HkYL?#1(#I)t-Zhp{5m*I(^9yNq|M+zMGlFF=xV zCb6a`UUoOTZg_<^yo(NkN1)P3dEauV_3J}-q3NF7>YawS*=lt;#^@OA-%LA&`;9HN4Jlgkd^BnZ(=@<hB;6)Y+MYoEQVhv^tsa2QsLN8 z)d9?`{4i0e` z?BT0K^TH3OD=9o%L&9jjb8?D>^Ld$imD&69mL81bR-W(~2#Eo*Xb9yI8}V3Gse1|8 z%`8S&dre01dXuEsIMObUQ20{rcqb8BYT4By&2)Gqe9U_jMO{%sy@&Lt3gO%Sn?2hV z{EI!8(EVTRIscPA``-UId;aPAFZOIw!@42BO8P~E{F6PGY~jFi(BNovlZ=aF^Tv%F z)(H~5<^3ip22E#dcmzBxKFyO!;9DY-2xY^!lEVo?9r3rBf)NRB-Jf*)Y=IP+tZEd| zHOgzTE?t6tJ2l^l2(xN`OH@`1GPXj)@NK6xVx6iLk9()J?c8K2L1Es$%ZsId3tsR;GII@?Mu-5NrL$b>oI5BM@KcA-PU7y^&4F%3L z52RQI%Ugzak3mpQ*}*^HG=H2he$W1Tjh5`??0n3wVCLP@x0?+I+1c`^xvGceB)-|r zhb*ZN+>J>`r7&EH4YWhtjM$yg=JCMIR*xE_V%2QIuD5as1INDfxM@KGs~>*jS+x8a;pDJ^)Ua*PA);CWdPIi~_eBy_w|o2uJ4!dHfkLE0 zOs|NHDD`R{4H5IiriN=P3J(gD0~PdAOk+kWB27uInP41~!bHxoGamZ$Zr}KqlMQ_5H_wU;8iDkmO zV{acOQ&-u{ZcIfmMz3tOkB)49SNaS)Hia0eRD1G|e8{qvt9#X0>sT_yz$;nKV_9My z6%&Hz$QbQJ-R0bLXX8CUk_MquQrgpfGIdEXy9Iq=A9(pdXZIn>@S0zF>D zh}$A-p*LC%L%A>grk^4g%BXW}5J!9L{OYIwoU3Lg6q{HQbG6xa6-#5QD`P-g& z+u0Z8&8ZPe@}ukkVH9f+>sz_X(TCw7wxvgJ?eS@pH?2U#13D{ixz~ zuNDmih7LW0^pk-OO+hoROaFm(L-^Y8!k3*twD~wNP#Vj>IPklnjhz~vutYslU4|6< z=oNQxeumHQ?R2j5$WIKy^n^l+9-Y%UQ5(2M-|n&0>)736S%8HZ`=745zL-9# z_Dy{&4mH+jpIJ(}i4>gLe@d80!;lWox-+U*k>-MD>p-OJW@M}DC zq2##c*$i@2V#S17lS->xq7V1V{;mq+hC#AF0|O)%$6D`pq6 zCv8wKH+NSza6kDgbv`I{Qd#UF(bSsuV=K?k{HNl@7W{KpUC;hA4uQ6Zb#jNPOI!~S zxkRg?Vs?-GtIoGqodOb#a((r2$M(Cb3M=b$7Hi*cY=%>05n|0Mg=GxEvC05?xUy42s>F4e0E&;MM((9$3Vd^#s$s>}wOZczPU73^*ed0c z(m+l`V(h-Q^i363FQQ4<4flff>K;9IWYV$|p!|>|S!W*m8!Rp;gwZcf_URy>neKA* zOAXhNt7{I;0E{}qF9A%yeRB>OL%!vL7C~5KBmOXr_ZP}=6$V&}zam=wL7_vZaFtZ2 z{Q7jKzwVfHB!=Vv6?pKQGL&6V@gur)G0o{(`N2ujMar!JdLmmh9`w%j^^ zc)9D`V0sI~=Ria5d8frDmFnqRX@(XyUF3EKMkfxPOTbKl!-(JJ?@mL;w0r`*5*9N9 zCp&CLTh&^TCSR#4Sc)V@^BgfpZ~41w=~dEyK(uzt_*c4MN))JXobCoQ@Jwyx`BnQw zym@K&-$j(3`eqE`G5aFlnT}dU<@b~Jf)R)B!XLYwmPpVh^90~C2_LZSi)tt zqzWGlA0K%Mo4&2xg5S`HhwUeg-YVKxoBO5yJqQC+1hl+ZU41gNoWZV-d!K7&s+|U8 zNdFO8Njh!K<0Ch3^;bGpy(~Q~S2(udsOMe6cMazt$_z4K8@EkZB}8E<3xbKYt2N!? zXeQQ!a!0APBKBUF0IA@+uiuV+N-*{XlzJ;pUU$_C?wT^lv)6eR={;-UH_@0@@-5-S zn?f5PjiOCA$F}(gflmCPi5Jld-DVzZg@hLUv0_|He2GLxae<_6O0z?U3Zbt1NbCr9 zItNyEvzkA(on{SRadZ9Qre|xrmfd5EO4mhoq22&5Pqw$!m^Yl3zFe2H{Y%rR;)d$d zk_H?Hd`ziFteqOUNS55g_RfYx&wx%)ghxf*<5?2U!0?hHraaYc?e)Dx&tP=#;39pG zxS&iQd}}MU-8Jm!zQImLjDMI1JjP}v6vncJQMlrD6VJRq^sQ|j=!s_dvAu{u8;*nT zVF9yXmmm!Jm@Xk8CMw21#)eIRLsf)mF@dgMsLz@!{*aVH??j7=C6-bpg1!d^s0d9& zfKDX*GTI~YXS!9%)6&edQhY@;sRN!Tv310GgV1tsEQ5X^7@L+8-dGwdQWO_@ZCJMX z574m)q)pw#8vOzKmTu@0%rit+-qEav#vF*mpocYpps}*c8z2Tb?C&bY!X)fA-#k=W z=K?-?a8l=ZKFL7*x1el=1YdrppKFgRvR5Fh#XU6T_$C4umWN1UCttGm#Mr+_gHH2` z0F4kb_b3z?N7~BAP8Oollw9lgGw*}A!ZTnqD&sja)D<}H(OWBVHG6fe56*7fi}Rg2 z;LG3}J-K+)*>)R`WjRv^S`(e8T=6c#+PlEvZ4`<3gWx$QoQGft4(R!tfF3og>dWOw z`Rb7)4=?YkA2X46hSmdz|EAUY`mv?u*_k6L3E$ee~qSS{7#z5UO|)t%}-8mp)s5s2gJD6ei;_UR6PmHv+xcvD@gq>FY(|@yydT{)Ia$ zr!sMU*i~U+k)lb59tKu3twwd`bmtYnRH$0cKmi*BYIK2~$u-+E8kZ$ARFC24Wt6)I z(cuNwb0NE!!EehS(Bk4r+G^ZY317mpvbw5}1|;Yx6(EJ>W^Ca(`5&}|1P(-6TR~nT zt#e>MMR>Mv-o0|skv`897VXUN;o^R>MTXk7D=7x{cg~a&!T!eVGM+89E5#ZUnPfp{ zj6KX0M_6}h??Cnx)m8};;|0m$u;l9v^v8e2Z>K&g#ke>O-b<)Ljf5tE*r zW^oj6OxfO$7jut@s4ME3N`Pf0W-?iqC=+KWlg)G{P8V#) zBN#60Nq)rW4&0_b8+C{^dOzwiy(Jca6dJ^O5eq5$ZeUUvsyKKi3u*DHxUs~B9h2(! zF|@hrZ^Aw1C1TFC^Zijjl0jCN44Vx)AT=BdpN@2-H|}gp3Lc$-%jc zJZ>}|fNHFO4hKUMPN^i^eP!YwA(K{CD++$cXt7WsVDz5TI`iUl@O)|eJ4p&+;Phis z{4l%Y-NtIOybCpW#mJ1-}BGI#?4FKmeDd(S_ z$EVue(`Q4a$Gngys4*$-vo$iAsZp}TjXrh_Z3yK5NnB=}a5(}%XC>$z(dR-2X+1yT zN(+W<@K2#R)i*6)B-dv*!KpSnR48Xl$1G?@y zZ>fr)$hrDcuMcIe_2!-sA+??nmHxr9Jj+c5xwXh5G8E7^*dbh>{`}6G{w=F3^1zfO zUC$*lC!#QeB=V#m@@zwd?;xn$GsV1(c$nqmwFDA z>gZ)L^~l{7I2GWnknynbWDg6uk&X=5{?_h$;Q(FgGttbkyj~WodE*Xo>Lw>|n^pA# z%N}W{E8c$&fgQ@;mZd~1&FT2HIk>1By zy}{NBu-9um-n^Ka`*5oiY<}-r@3Dz~_i@?1ze?V3cFL1Q3p-$PNhTYPu1N)QT**X0V!{k+L7!~`qi&vW^6`<#4% zqglY+3Tr18wR4Bt0Sg{NoM|zPN&`!L{Xy9GMF>8b1Th>k%>rr@b-}EkM)w}PyoG5n zbT&dluon~jD0_UN8=}*b(q^~O1rL`Nd}ynzf2KGonzl+cYWG$#ZFAcrpp;#5zO=9O!-`$^dYY%4Hg54fYE+e#+GP*Nu|Cmb09+3JRnFEhoyo}DD%kLLBI zmr9EzQKj!C*Ei=q#IxL7UyN+@_#J?yO9ak_`hS!81|~6Dhe8U6Np#iroFCu2DyK*i z3J3!4g8_4uk5AL(nvD35=Ev&T30j5db&d>^I-8Ev_{Ma+1JS2 zz9Z#5mvsB-f<(_{(q9<@m{#2H${hJ%vV6Zv-GWNfTNK$bjFaYuvv>ywt9s~w+swW1 zJ{38%AE!~v^Uq*dqaPW(1O#bsT@&Y%DQ{gdHyyN3dNc8NZGjSp6wi>uP{-Vnd>)9A zjfR&$`Q@q)Z1j=hE7}`giaK!)Q^dX7#O0t>;NXr#*0fKD;N1HwqZBTLt@2EsdrPqs z=_yTq`OUFp>O{#v8p{tPVjTKW%??87Fnv{OwN-naKU=yoP+wA>y#lG!U&hEI%RR_v zUtXLS%wGV>W!$D*VjfWBY09qOfy#vf>w^62g2j6&+be?l^L+nh+YP_}f7o_3!60F~ zx!o#R(n|NvhA1DHR}SBn#muLxfd&$zQ-!yezb_4orw1hsg6AJtvL1=Xn9&=i6EPv6 z)e>JTkv=rZ0Vw6d^V%qjf`H(<&KRv`JGo59VlxF{9gGmK0!6)9NOw}mz?(^dUFQKS zHpKF~l+_wm92a$xk?+Hf4T?sCpkJ`)zYC_Ze!wBv$S36GO2eoYf)DGw4pH``@284y z*e<0NA9_n3-u!@o7xL5?LU*#~Nw?iI8l%U#rP(nOG!Pvc3&b9yY) zJ0e(JCd(qBi4t>>#CWh$5P&~W|Ced66Zyxq(?KcxPt(rpLGh1i?~eGEZJYJ36u#xF z`#&Pm;zex8b zOvU>99A#;5lKH)}2*ZSig7XJhN0bf$UA z+-m$+sd83NI_`VAaioC^g2W;O`%c(th5;llFfN#0Mud?0v5);Ww0wJSOVSBmu}4(o zwouN8HfUFhlzm2I-O-jEMqYr`vtu%Pcx$}kr_nMwt{YOf>BLg&f&$K?tC{UPz zz?_?#-`!fZ4pE`A|Q78V2r?(_!2Yu_v1!8Kof100Bl-pXGVtw z9dLIspY>o-&rx2CpT;GdV!^5`1guo@__0T|>fY7y_tC4B!}WYJ3K&B^r{j)EeVH>x zo~D?1&#=^$kq!X6c@a*fS0olfo-4_1J}sA&uJ;d;l)5?-n?A39kv=C+2@%)(B=2J( zPQRJly7s$hlP<;i(#Msme1~@(8XFC( zE6Nn?MHWOe%m+JW9^5{J0+-u~&SVQ>BTvCKDW#ldsAUxn;0FAJ@bnW3!cTNiKFzy0 zG?sawK=|!obK~KuE!yB~&#g*`zbY_Fv0hxNQQEu+lEnn2Qi22W11u;`G}$|-#3=qPC%RnD^{U@K(< zK1??KLz=fHC@1j(C5<{QTYv^J_WM1)<^E(RC4E(p<|` zQd}O6-c8n)FjIbQAZLr0t#~1Y*z}!>szBKeQaIv77PmfG_ulb`P<|xQ-ina6PA6Qi zZoyxob8tB2Rea{t9y{^67EWeZJzAiFdpVd(c}G*Xx^^O!yn(%u&TDcKi!HD4kA?fO z8s2JkU+8f0{OtwNYI5<^6dAT*WV>P^#Fwfu_%$XH=z5}~xu_t@a6%LJH+P-GrETYT zym6AbRgt0zF^=GR!5>9wirJANx`PteTzlz_s-OdV@NR+=%RsEI%7TJ}?W8wo@8LC)WqI?!!@ z&7ieu2$Pd1ww4!3{xZ`CM>7%NIW;}RAWpL6oBAS^{{m7M0+%Fj?M=P zD;m&BykmLnR!WCCV!uppCC@9_s-D7R3dreGS?W9cRf^(lvcwzN8uMY&Q*rk?Kc-Z=q~RM|FSYzd(HFJv&3dajL;iq6<&t+eQ^J+Ft!VDpspa*`IsB^ zKL)Yl|4aaKX7R>w9Lf|<+^|YniV$Q;tgkNn9n_@bSvUF1HPAl9&!_!3eUs~{wZeP+ z)-X(F|KPVWyIe{p+HJ5FQRoSB^p6O;S?U}p(c$DATlYJ0`b~6J;nk$-R}KGhx_6{- zq!Eqe#-z1NqCCoS!xenl+zp_(EZ=ahyLu)TIG&q!2chSF8%EJZfeP>O-fCk@a)> z0}BM$9vOs_>sBFyRCEmX*L=$U6TUkxbNw5>OHl2PF>Ot?*N^>g_bQ7^uj`e%AO8A%I z;Z%77aQo?QRs@v4LPz9g*B=4E8$+2$JyT^OJA&uY*Y7a4{IeRZ6CH{TlSWjm>DILc z8^>ge=^aMQm{c5G?Ij4&V5rP1$9}pJowzi^5oAaU-uvWv(#=LKEN4H!{fk2 HA;A6vcGp}6 literal 0 HcmV?d00001 diff --git a/node_modules/@webassemblyjs/wast-printer/LICENSE b/node_modules/@webassemblyjs/wast-printer/LICENSE new file mode 100644 index 0000000..87e7e1f --- /dev/null +++ b/node_modules/@webassemblyjs/wast-printer/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sven Sauleau + +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. diff --git a/node_modules/@webassemblyjs/wast-printer/README.md b/node_modules/@webassemblyjs/wast-printer/README.md new file mode 100644 index 0000000..ed4cd4e --- /dev/null +++ b/node_modules/@webassemblyjs/wast-printer/README.md @@ -0,0 +1,17 @@ +# @webassemblyjs/wast-parser + +> WebAssembly text format printer + +## Installation + +```sh +yarn add @webassemblyjs/wast-printer +``` + +## Usage + +```js +import { print } from "@webassemblyjs/wast-printer" + +console.log(print(ast)); +``` diff --git a/node_modules/@webassemblyjs/wast-printer/esm/index.js b/node_modules/@webassemblyjs/wast-printer/esm/index.js new file mode 100644 index 0000000..398e86f --- /dev/null +++ b/node_modules/@webassemblyjs/wast-printer/esm/index.js @@ -0,0 +1,900 @@ +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } + +import { isAnonymous, isInstruction } from "@webassemblyjs/ast"; +import Long from "@xtuc/long"; +var compact = false; +var space = " "; + +var quote = function quote(str) { + return "\"".concat(str, "\""); +}; + +function indent(nb) { + return Array(nb).fill(space + space).join(""); +} // TODO(sven): allow arbitrary ast nodes + + +export function print(n) { + if (n.type === "Program") { + return printProgram(n, 0); + } else { + throw new Error("Unsupported node in print of type: " + String(n.type)); + } +} + +function printProgram(n, depth) { + return n.body.reduce(function (acc, child) { + if (child.type === "Module") { + acc += printModule(child, depth + 1); + } + + if (child.type === "Func") { + acc += printFunc(child, depth + 1); + } + + if (child.type === "BlockComment") { + acc += printBlockComment(child); + } + + if (child.type === "LeadingComment") { + acc += printLeadingComment(child); + } + + if (compact === false) { + acc += "\n"; + } + + return acc; + }, ""); +} + +function printTypeInstruction(n) { + var out = ""; + out += "("; + out += "type"; + out += space; + + if (n.id != null) { + out += printIndex(n.id); + out += space; + } + + out += "("; + out += "func"; + n.functype.params.forEach(function (param) { + out += space; + out += "("; + out += "param"; + out += space; + out += printFuncParam(param); + out += ")"; + }); + n.functype.results.forEach(function (result) { + out += space; + out += "("; + out += "result"; + out += space; + out += result; + out += ")"; + }); + out += ")"; // func + + out += ")"; + return out; +} + +function printModule(n, depth) { + var out = "("; + out += "module"; + + if (typeof n.id === "string") { + out += space; + out += n.id; + } + + if (compact === false) { + out += "\n"; + } else { + out += space; + } + + n.fields.forEach(function (field) { + if (compact === false) { + out += indent(depth); + } + + switch (field.type) { + case "Func": + { + out += printFunc(field, depth + 1); + break; + } + + case "TypeInstruction": + { + out += printTypeInstruction(field); + break; + } + + case "Table": + { + out += printTable(field); + break; + } + + case "Global": + { + out += printGlobal(field, depth + 1); + break; + } + + case "ModuleExport": + { + out += printModuleExport(field); + break; + } + + case "ModuleImport": + { + out += printModuleImport(field); + break; + } + + case "Memory": + { + out += printMemory(field); + break; + } + + case "BlockComment": + { + out += printBlockComment(field); + break; + } + + case "LeadingComment": + { + out += printLeadingComment(field); + break; + } + + case "Start": + { + out += printStart(field); + break; + } + + case "Elem": + { + out += printElem(field, depth); + break; + } + + case "Data": + { + out += printData(field, depth); + break; + } + + default: + throw new Error("Unsupported node in printModule: " + String(field.type)); + } + + if (compact === false) { + out += "\n"; + } + }); + out += ")"; + return out; +} + +function printData(n, depth) { + var out = ""; + out += "("; + out += "data"; + out += space; + out += printIndex(n.memoryIndex); + out += space; + out += printInstruction(n.offset, depth); + out += space; + out += '"'; + n.init.values.forEach(function (byte) { + // Avoid non-displayable characters + if (byte <= 31 || byte == 34 || byte == 92 || byte >= 127) { + out += "\\"; + out += ("00" + byte.toString(16)).substr(-2); + } else if (byte > 255) { + throw new Error("Unsupported byte in data segment: " + byte); + } else { + out += String.fromCharCode(byte); + } + }); + out += '"'; + out += ")"; + return out; +} + +function printElem(n, depth) { + var out = ""; + out += "("; + out += "elem"; + out += space; + out += printIndex(n.table); + + var _n$offset = _slicedToArray(n.offset, 1), + firstOffset = _n$offset[0]; + + out += space; + out += "("; + out += "offset"; + out += space; + out += printInstruction(firstOffset, depth); + out += ")"; + n.funcs.forEach(function (func) { + out += space; + out += printIndex(func); + }); + out += ")"; + return out; +} + +function printStart(n) { + var out = ""; + out += "("; + out += "start"; + out += space; + out += printIndex(n.index); + out += ")"; + return out; +} + +function printLeadingComment(n) { + // Don't print leading comments in compact mode + if (compact === true) { + return ""; + } + + var out = ""; + out += ";;"; + out += n.value; + out += "\n"; + return out; +} + +function printBlockComment(n) { + // Don't print block comments in compact mode + if (compact === true) { + return ""; + } + + var out = ""; + out += "(;"; + out += n.value; + out += ";)"; + out += "\n"; + return out; +} + +function printSignature(n) { + var out = ""; + n.params.forEach(function (param) { + out += space; + out += "("; + out += "param"; + out += space; + out += printFuncParam(param); + out += ")"; + }); + n.results.forEach(function (result) { + out += space; + out += "("; + out += "result"; + out += space; + out += result; + out += ")"; + }); + return out; +} + +function printModuleImportDescr(n) { + var out = ""; + + if (n.type === "FuncImportDescr") { + out += "("; + out += "func"; + + if (isAnonymous(n.id) === false) { + out += space; + out += printIdentifier(n.id); + } + + out += printSignature(n.signature); + out += ")"; + } + + if (n.type === "GlobalType") { + out += "("; + out += "global"; + out += space; + out += printGlobalType(n); + out += ")"; + } + + if (n.type === "Table") { + out += printTable(n); + } + + return out; +} + +function printModuleImport(n) { + var out = ""; + out += "("; + out += "import"; + out += space; + out += quote(n.module); + out += space; + out += quote(n.name); + out += space; + out += printModuleImportDescr(n.descr); + out += ")"; + return out; +} + +function printGlobalType(n) { + var out = ""; + + if (n.mutability === "var") { + out += "("; + out += "mut"; + out += space; + out += n.valtype; + out += ")"; + } else { + out += n.valtype; + } + + return out; +} + +function printGlobal(n, depth) { + var out = ""; + out += "("; + out += "global"; + out += space; + + if (n.name != null && isAnonymous(n.name) === false) { + out += printIdentifier(n.name); + out += space; + } + + out += printGlobalType(n.globalType); + out += space; + n.init.forEach(function (i) { + out += printInstruction(i, depth + 1); + }); + out += ")"; + return out; +} + +function printTable(n) { + var out = ""; + out += "("; + out += "table"; + out += space; + + if (n.name != null && isAnonymous(n.name) === false) { + out += printIdentifier(n.name); + out += space; + } + + out += printLimit(n.limits); + out += space; + out += n.elementType; + out += ")"; + return out; +} + +function printFuncParam(n) { + var out = ""; + + if (typeof n.id === "string") { + out += "$" + n.id; + out += space; + } + + out += n.valtype; + return out; +} + +function printFunc(n, depth) { + var out = ""; + out += "("; + out += "func"; + + if (n.name != null) { + if (n.name.type === "Identifier" && isAnonymous(n.name) === false) { + out += space; + out += printIdentifier(n.name); + } + } + + if (n.signature.type === "Signature") { + out += printSignature(n.signature); + } else { + var index = n.signature; + out += space; + out += "("; + out += "type"; + out += space; + out += printIndex(index); + out += ")"; + } + + if (n.body.length > 0) { + // func is empty since we ignore the default end instruction + if (n.body.length === 1 && n.body[0].id === "end") { + out += ")"; + return out; + } + + if (compact === false) { + out += "\n"; + } + + n.body.forEach(function (i) { + if (i.id !== "end") { + out += indent(depth); + out += printInstruction(i, depth); + + if (compact === false) { + out += "\n"; + } + } + }); + out += indent(depth - 1) + ")"; + } else { + out += ")"; + } + + return out; +} + +function printInstruction(n, depth) { + switch (n.type) { + case "Instr": + // $FlowIgnore + return printGenericInstruction(n, depth + 1); + + case "BlockInstruction": + // $FlowIgnore + return printBlockInstruction(n, depth + 1); + + case "IfInstruction": + // $FlowIgnore + return printIfInstruction(n, depth + 1); + + case "CallInstruction": + // $FlowIgnore + return printCallInstruction(n, depth + 1); + + case "CallIndirectInstruction": + // $FlowIgnore + return printCallIndirectIntruction(n, depth + 1); + + case "LoopInstruction": + // $FlowIgnore + return printLoopInstruction(n, depth + 1); + + default: + throw new Error("Unsupported instruction: " + JSON.stringify(n.type)); + } +} + +function printCallIndirectIntruction(n, depth) { + var out = ""; + out += "("; + out += "call_indirect"; + + if (n.signature.type === "Signature") { + out += printSignature(n.signature); + } else if (n.signature.type === "Identifier") { + out += space; + out += "("; + out += "type"; + out += space; + out += printIdentifier(n.signature); + out += ")"; + } else { + throw new Error("CallIndirectInstruction: unsupported signature " + JSON.stringify(n.signature.type)); + } + + out += space; + + if (n.intrs != null) { + // $FlowIgnore + n.intrs.forEach(function (i, index) { + // $FlowIgnore + out += printInstruction(i, depth + 1); // $FlowIgnore + + if (index !== n.intrs.length - 1) { + out += space; + } + }); + } + + out += ")"; + return out; +} + +function printLoopInstruction(n, depth) { + var out = ""; + out += "("; + out += "loop"; + + if (n.label != null && isAnonymous(n.label) === false) { + out += space; + out += printIdentifier(n.label); + } + + if (typeof n.resulttype === "string") { + out += space; + out += "("; + out += "result"; + out += space; + out += n.resulttype; + out += ")"; + } + + if (n.instr.length > 0) { + n.instr.forEach(function (e) { + if (compact === false) { + out += "\n"; + } + + out += indent(depth); + out += printInstruction(e, depth + 1); + }); + + if (compact === false) { + out += "\n"; + out += indent(depth - 1); + } + } + + out += ")"; + return out; +} + +function printCallInstruction(n, depth) { + var out = ""; + out += "("; + out += "call"; + out += space; + out += printIndex(n.index); + + if (_typeof(n.instrArgs) === "object") { + // $FlowIgnore + n.instrArgs.forEach(function (arg) { + out += space; + out += printFuncInstructionArg(arg, depth + 1); + }); + } + + out += ")"; + return out; +} + +function printIfInstruction(n, depth) { + var out = ""; + out += "("; + out += "if"; + + if (n.testLabel != null && isAnonymous(n.testLabel) === false) { + out += space; + out += printIdentifier(n.testLabel); + } + + if (typeof n.result === "string") { + out += space; + out += "("; + out += "result"; + out += space; + out += n.result; + out += ")"; + } + + if (n.test.length > 0) { + out += space; + n.test.forEach(function (i) { + out += printInstruction(i, depth + 1); + }); + } + + if (n.consequent.length > 0) { + if (compact === false) { + out += "\n"; + } + + out += indent(depth); + out += "("; + out += "then"; + depth++; + n.consequent.forEach(function (i) { + if (compact === false) { + out += "\n"; + } + + out += indent(depth); + out += printInstruction(i, depth + 1); + }); + depth--; + + if (compact === false) { + out += "\n"; + out += indent(depth); + } + + out += ")"; + } else { + if (compact === false) { + out += "\n"; + out += indent(depth); + } + + out += "("; + out += "then"; + out += ")"; + } + + if (n.alternate.length > 0) { + if (compact === false) { + out += "\n"; + } + + out += indent(depth); + out += "("; + out += "else"; + depth++; + n.alternate.forEach(function (i) { + if (compact === false) { + out += "\n"; + } + + out += indent(depth); + out += printInstruction(i, depth + 1); + }); + depth--; + + if (compact === false) { + out += "\n"; + out += indent(depth); + } + + out += ")"; + } else { + if (compact === false) { + out += "\n"; + out += indent(depth); + } + + out += "("; + out += "else"; + out += ")"; + } + + if (compact === false) { + out += "\n"; + out += indent(depth - 1); + } + + out += ")"; + return out; +} + +function printBlockInstruction(n, depth) { + var out = ""; + out += "("; + out += "block"; + + if (n.label != null && isAnonymous(n.label) === false) { + out += space; + out += printIdentifier(n.label); + } + + if (typeof n.result === "string") { + out += space; + out += "("; + out += "result"; + out += space; + out += n.result; + out += ")"; + } + + if (n.instr.length > 0) { + n.instr.forEach(function (i) { + if (compact === false) { + out += "\n"; + } + + out += indent(depth); + out += printInstruction(i, depth + 1); + }); + + if (compact === false) { + out += "\n"; + } + + out += indent(depth - 1); + out += ")"; + } else { + out += ")"; + } + + return out; +} + +function printGenericInstruction(n, depth) { + var out = ""; + out += "("; + + if (typeof n.object === "string") { + out += n.object; + out += "."; + } + + out += n.id; + n.args.forEach(function (arg) { + out += space; + out += printFuncInstructionArg(arg, depth + 1); + }); + out += ")"; + return out; +} + +function printLongNumberLiteral(n) { + if (typeof n.raw === "string") { + return n.raw; + } + + var _n$value = n.value, + low = _n$value.low, + high = _n$value.high; + var v = new Long(low, high); + return v.toString(); +} + +function printFloatLiteral(n) { + if (typeof n.raw === "string") { + return n.raw; + } + + return String(n.value); +} + +function printFuncInstructionArg(n, depth) { + var out = ""; + + if (n.type === "NumberLiteral") { + out += printNumberLiteral(n); + } + + if (n.type === "LongNumberLiteral") { + out += printLongNumberLiteral(n); + } + + if (n.type === "Identifier" && isAnonymous(n) === false) { + out += printIdentifier(n); + } + + if (n.type === "ValtypeLiteral") { + out += n.name; + } + + if (n.type === "FloatLiteral") { + out += printFloatLiteral(n); + } + + if (isInstruction(n)) { + out += printInstruction(n, depth + 1); + } + + return out; +} + +function printNumberLiteral(n) { + if (typeof n.raw === "string") { + return n.raw; + } + + return String(n.value); +} + +function printModuleExport(n) { + var out = ""; + out += "("; + out += "export"; + out += space; + out += quote(n.name); + + if (n.descr.exportType === "Func") { + out += space; + out += "("; + out += "func"; + out += space; + out += printIndex(n.descr.id); + out += ")"; + } else if (n.descr.exportType === "Global") { + out += space; + out += "("; + out += "global"; + out += space; + out += printIndex(n.descr.id); + out += ")"; + } else if (n.descr.exportType === "Memory" || n.descr.exportType === "Mem") { + out += space; + out += "("; + out += "memory"; + out += space; + out += printIndex(n.descr.id); + out += ")"; + } else if (n.descr.exportType === "Table") { + out += space; + out += "("; + out += "table"; + out += space; + out += printIndex(n.descr.id); + out += ")"; + } else { + throw new Error("printModuleExport: unknown type: " + n.descr.exportType); + } + + out += ")"; + return out; +} + +function printIdentifier(n) { + return "$" + n.value; +} + +function printIndex(n) { + if (n.type === "Identifier") { + return printIdentifier(n); + } else if (n.type === "NumberLiteral") { + return printNumberLiteral(n); + } else { + throw new Error("Unsupported index: " + n.type); + } +} + +function printMemory(n) { + var out = ""; + out += "("; + out += "memory"; + + if (n.id != null) { + out += space; + out += printIndex(n.id); + out += space; + } + + out += printLimit(n.limits); + out += ")"; + return out; +} + +function printLimit(n) { + var out = ""; + out += n.min + ""; + + if (n.max != null) { + out += space; + out += String(n.max); + } + + return out; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wast-printer/lib/index.js b/node_modules/@webassemblyjs/wast-printer/lib/index.js new file mode 100644 index 0000000..03be8ca --- /dev/null +++ b/node_modules/@webassemblyjs/wast-printer/lib/index.js @@ -0,0 +1,911 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.print = print; + +var _ast = require("@webassemblyjs/ast"); + +var _long = _interopRequireDefault(require("@xtuc/long")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } + +var compact = false; +var space = " "; + +var quote = function quote(str) { + return "\"".concat(str, "\""); +}; + +function indent(nb) { + return Array(nb).fill(space + space).join(""); +} // TODO(sven): allow arbitrary ast nodes + + +function print(n) { + if (n.type === "Program") { + return printProgram(n, 0); + } else { + throw new Error("Unsupported node in print of type: " + String(n.type)); + } +} + +function printProgram(n, depth) { + return n.body.reduce(function (acc, child) { + if (child.type === "Module") { + acc += printModule(child, depth + 1); + } + + if (child.type === "Func") { + acc += printFunc(child, depth + 1); + } + + if (child.type === "BlockComment") { + acc += printBlockComment(child); + } + + if (child.type === "LeadingComment") { + acc += printLeadingComment(child); + } + + if (compact === false) { + acc += "\n"; + } + + return acc; + }, ""); +} + +function printTypeInstruction(n) { + var out = ""; + out += "("; + out += "type"; + out += space; + + if (n.id != null) { + out += printIndex(n.id); + out += space; + } + + out += "("; + out += "func"; + n.functype.params.forEach(function (param) { + out += space; + out += "("; + out += "param"; + out += space; + out += printFuncParam(param); + out += ")"; + }); + n.functype.results.forEach(function (result) { + out += space; + out += "("; + out += "result"; + out += space; + out += result; + out += ")"; + }); + out += ")"; // func + + out += ")"; + return out; +} + +function printModule(n, depth) { + var out = "("; + out += "module"; + + if (typeof n.id === "string") { + out += space; + out += n.id; + } + + if (compact === false) { + out += "\n"; + } else { + out += space; + } + + n.fields.forEach(function (field) { + if (compact === false) { + out += indent(depth); + } + + switch (field.type) { + case "Func": + { + out += printFunc(field, depth + 1); + break; + } + + case "TypeInstruction": + { + out += printTypeInstruction(field); + break; + } + + case "Table": + { + out += printTable(field); + break; + } + + case "Global": + { + out += printGlobal(field, depth + 1); + break; + } + + case "ModuleExport": + { + out += printModuleExport(field); + break; + } + + case "ModuleImport": + { + out += printModuleImport(field); + break; + } + + case "Memory": + { + out += printMemory(field); + break; + } + + case "BlockComment": + { + out += printBlockComment(field); + break; + } + + case "LeadingComment": + { + out += printLeadingComment(field); + break; + } + + case "Start": + { + out += printStart(field); + break; + } + + case "Elem": + { + out += printElem(field, depth); + break; + } + + case "Data": + { + out += printData(field, depth); + break; + } + + default: + throw new Error("Unsupported node in printModule: " + String(field.type)); + } + + if (compact === false) { + out += "\n"; + } + }); + out += ")"; + return out; +} + +function printData(n, depth) { + var out = ""; + out += "("; + out += "data"; + out += space; + out += printIndex(n.memoryIndex); + out += space; + out += printInstruction(n.offset, depth); + out += space; + out += '"'; + n.init.values.forEach(function (byte) { + // Avoid non-displayable characters + if (byte <= 31 || byte == 34 || byte == 92 || byte >= 127) { + out += "\\"; + out += ("00" + byte.toString(16)).substr(-2); + } else if (byte > 255) { + throw new Error("Unsupported byte in data segment: " + byte); + } else { + out += String.fromCharCode(byte); + } + }); + out += '"'; + out += ")"; + return out; +} + +function printElem(n, depth) { + var out = ""; + out += "("; + out += "elem"; + out += space; + out += printIndex(n.table); + + var _n$offset = _slicedToArray(n.offset, 1), + firstOffset = _n$offset[0]; + + out += space; + out += "("; + out += "offset"; + out += space; + out += printInstruction(firstOffset, depth); + out += ")"; + n.funcs.forEach(function (func) { + out += space; + out += printIndex(func); + }); + out += ")"; + return out; +} + +function printStart(n) { + var out = ""; + out += "("; + out += "start"; + out += space; + out += printIndex(n.index); + out += ")"; + return out; +} + +function printLeadingComment(n) { + // Don't print leading comments in compact mode + if (compact === true) { + return ""; + } + + var out = ""; + out += ";;"; + out += n.value; + out += "\n"; + return out; +} + +function printBlockComment(n) { + // Don't print block comments in compact mode + if (compact === true) { + return ""; + } + + var out = ""; + out += "(;"; + out += n.value; + out += ";)"; + out += "\n"; + return out; +} + +function printSignature(n) { + var out = ""; + n.params.forEach(function (param) { + out += space; + out += "("; + out += "param"; + out += space; + out += printFuncParam(param); + out += ")"; + }); + n.results.forEach(function (result) { + out += space; + out += "("; + out += "result"; + out += space; + out += result; + out += ")"; + }); + return out; +} + +function printModuleImportDescr(n) { + var out = ""; + + if (n.type === "FuncImportDescr") { + out += "("; + out += "func"; + + if ((0, _ast.isAnonymous)(n.id) === false) { + out += space; + out += printIdentifier(n.id); + } + + out += printSignature(n.signature); + out += ")"; + } + + if (n.type === "GlobalType") { + out += "("; + out += "global"; + out += space; + out += printGlobalType(n); + out += ")"; + } + + if (n.type === "Table") { + out += printTable(n); + } + + return out; +} + +function printModuleImport(n) { + var out = ""; + out += "("; + out += "import"; + out += space; + out += quote(n.module); + out += space; + out += quote(n.name); + out += space; + out += printModuleImportDescr(n.descr); + out += ")"; + return out; +} + +function printGlobalType(n) { + var out = ""; + + if (n.mutability === "var") { + out += "("; + out += "mut"; + out += space; + out += n.valtype; + out += ")"; + } else { + out += n.valtype; + } + + return out; +} + +function printGlobal(n, depth) { + var out = ""; + out += "("; + out += "global"; + out += space; + + if (n.name != null && (0, _ast.isAnonymous)(n.name) === false) { + out += printIdentifier(n.name); + out += space; + } + + out += printGlobalType(n.globalType); + out += space; + n.init.forEach(function (i) { + out += printInstruction(i, depth + 1); + }); + out += ")"; + return out; +} + +function printTable(n) { + var out = ""; + out += "("; + out += "table"; + out += space; + + if (n.name != null && (0, _ast.isAnonymous)(n.name) === false) { + out += printIdentifier(n.name); + out += space; + } + + out += printLimit(n.limits); + out += space; + out += n.elementType; + out += ")"; + return out; +} + +function printFuncParam(n) { + var out = ""; + + if (typeof n.id === "string") { + out += "$" + n.id; + out += space; + } + + out += n.valtype; + return out; +} + +function printFunc(n, depth) { + var out = ""; + out += "("; + out += "func"; + + if (n.name != null) { + if (n.name.type === "Identifier" && (0, _ast.isAnonymous)(n.name) === false) { + out += space; + out += printIdentifier(n.name); + } + } + + if (n.signature.type === "Signature") { + out += printSignature(n.signature); + } else { + var index = n.signature; + out += space; + out += "("; + out += "type"; + out += space; + out += printIndex(index); + out += ")"; + } + + if (n.body.length > 0) { + // func is empty since we ignore the default end instruction + if (n.body.length === 1 && n.body[0].id === "end") { + out += ")"; + return out; + } + + if (compact === false) { + out += "\n"; + } + + n.body.forEach(function (i) { + if (i.id !== "end") { + out += indent(depth); + out += printInstruction(i, depth); + + if (compact === false) { + out += "\n"; + } + } + }); + out += indent(depth - 1) + ")"; + } else { + out += ")"; + } + + return out; +} + +function printInstruction(n, depth) { + switch (n.type) { + case "Instr": + // $FlowIgnore + return printGenericInstruction(n, depth + 1); + + case "BlockInstruction": + // $FlowIgnore + return printBlockInstruction(n, depth + 1); + + case "IfInstruction": + // $FlowIgnore + return printIfInstruction(n, depth + 1); + + case "CallInstruction": + // $FlowIgnore + return printCallInstruction(n, depth + 1); + + case "CallIndirectInstruction": + // $FlowIgnore + return printCallIndirectIntruction(n, depth + 1); + + case "LoopInstruction": + // $FlowIgnore + return printLoopInstruction(n, depth + 1); + + default: + throw new Error("Unsupported instruction: " + JSON.stringify(n.type)); + } +} + +function printCallIndirectIntruction(n, depth) { + var out = ""; + out += "("; + out += "call_indirect"; + + if (n.signature.type === "Signature") { + out += printSignature(n.signature); + } else if (n.signature.type === "Identifier") { + out += space; + out += "("; + out += "type"; + out += space; + out += printIdentifier(n.signature); + out += ")"; + } else { + throw new Error("CallIndirectInstruction: unsupported signature " + JSON.stringify(n.signature.type)); + } + + out += space; + + if (n.intrs != null) { + // $FlowIgnore + n.intrs.forEach(function (i, index) { + // $FlowIgnore + out += printInstruction(i, depth + 1); // $FlowIgnore + + if (index !== n.intrs.length - 1) { + out += space; + } + }); + } + + out += ")"; + return out; +} + +function printLoopInstruction(n, depth) { + var out = ""; + out += "("; + out += "loop"; + + if (n.label != null && (0, _ast.isAnonymous)(n.label) === false) { + out += space; + out += printIdentifier(n.label); + } + + if (typeof n.resulttype === "string") { + out += space; + out += "("; + out += "result"; + out += space; + out += n.resulttype; + out += ")"; + } + + if (n.instr.length > 0) { + n.instr.forEach(function (e) { + if (compact === false) { + out += "\n"; + } + + out += indent(depth); + out += printInstruction(e, depth + 1); + }); + + if (compact === false) { + out += "\n"; + out += indent(depth - 1); + } + } + + out += ")"; + return out; +} + +function printCallInstruction(n, depth) { + var out = ""; + out += "("; + out += "call"; + out += space; + out += printIndex(n.index); + + if (_typeof(n.instrArgs) === "object") { + // $FlowIgnore + n.instrArgs.forEach(function (arg) { + out += space; + out += printFuncInstructionArg(arg, depth + 1); + }); + } + + out += ")"; + return out; +} + +function printIfInstruction(n, depth) { + var out = ""; + out += "("; + out += "if"; + + if (n.testLabel != null && (0, _ast.isAnonymous)(n.testLabel) === false) { + out += space; + out += printIdentifier(n.testLabel); + } + + if (typeof n.result === "string") { + out += space; + out += "("; + out += "result"; + out += space; + out += n.result; + out += ")"; + } + + if (n.test.length > 0) { + out += space; + n.test.forEach(function (i) { + out += printInstruction(i, depth + 1); + }); + } + + if (n.consequent.length > 0) { + if (compact === false) { + out += "\n"; + } + + out += indent(depth); + out += "("; + out += "then"; + depth++; + n.consequent.forEach(function (i) { + if (compact === false) { + out += "\n"; + } + + out += indent(depth); + out += printInstruction(i, depth + 1); + }); + depth--; + + if (compact === false) { + out += "\n"; + out += indent(depth); + } + + out += ")"; + } else { + if (compact === false) { + out += "\n"; + out += indent(depth); + } + + out += "("; + out += "then"; + out += ")"; + } + + if (n.alternate.length > 0) { + if (compact === false) { + out += "\n"; + } + + out += indent(depth); + out += "("; + out += "else"; + depth++; + n.alternate.forEach(function (i) { + if (compact === false) { + out += "\n"; + } + + out += indent(depth); + out += printInstruction(i, depth + 1); + }); + depth--; + + if (compact === false) { + out += "\n"; + out += indent(depth); + } + + out += ")"; + } else { + if (compact === false) { + out += "\n"; + out += indent(depth); + } + + out += "("; + out += "else"; + out += ")"; + } + + if (compact === false) { + out += "\n"; + out += indent(depth - 1); + } + + out += ")"; + return out; +} + +function printBlockInstruction(n, depth) { + var out = ""; + out += "("; + out += "block"; + + if (n.label != null && (0, _ast.isAnonymous)(n.label) === false) { + out += space; + out += printIdentifier(n.label); + } + + if (typeof n.result === "string") { + out += space; + out += "("; + out += "result"; + out += space; + out += n.result; + out += ")"; + } + + if (n.instr.length > 0) { + n.instr.forEach(function (i) { + if (compact === false) { + out += "\n"; + } + + out += indent(depth); + out += printInstruction(i, depth + 1); + }); + + if (compact === false) { + out += "\n"; + } + + out += indent(depth - 1); + out += ")"; + } else { + out += ")"; + } + + return out; +} + +function printGenericInstruction(n, depth) { + var out = ""; + out += "("; + + if (typeof n.object === "string") { + out += n.object; + out += "."; + } + + out += n.id; + n.args.forEach(function (arg) { + out += space; + out += printFuncInstructionArg(arg, depth + 1); + }); + out += ")"; + return out; +} + +function printLongNumberLiteral(n) { + if (typeof n.raw === "string") { + return n.raw; + } + + var _n$value = n.value, + low = _n$value.low, + high = _n$value.high; + var v = new _long.default(low, high); + return v.toString(); +} + +function printFloatLiteral(n) { + if (typeof n.raw === "string") { + return n.raw; + } + + return String(n.value); +} + +function printFuncInstructionArg(n, depth) { + var out = ""; + + if (n.type === "NumberLiteral") { + out += printNumberLiteral(n); + } + + if (n.type === "LongNumberLiteral") { + out += printLongNumberLiteral(n); + } + + if (n.type === "Identifier" && (0, _ast.isAnonymous)(n) === false) { + out += printIdentifier(n); + } + + if (n.type === "ValtypeLiteral") { + out += n.name; + } + + if (n.type === "FloatLiteral") { + out += printFloatLiteral(n); + } + + if ((0, _ast.isInstruction)(n)) { + out += printInstruction(n, depth + 1); + } + + return out; +} + +function printNumberLiteral(n) { + if (typeof n.raw === "string") { + return n.raw; + } + + return String(n.value); +} + +function printModuleExport(n) { + var out = ""; + out += "("; + out += "export"; + out += space; + out += quote(n.name); + + if (n.descr.exportType === "Func") { + out += space; + out += "("; + out += "func"; + out += space; + out += printIndex(n.descr.id); + out += ")"; + } else if (n.descr.exportType === "Global") { + out += space; + out += "("; + out += "global"; + out += space; + out += printIndex(n.descr.id); + out += ")"; + } else if (n.descr.exportType === "Memory" || n.descr.exportType === "Mem") { + out += space; + out += "("; + out += "memory"; + out += space; + out += printIndex(n.descr.id); + out += ")"; + } else if (n.descr.exportType === "Table") { + out += space; + out += "("; + out += "table"; + out += space; + out += printIndex(n.descr.id); + out += ")"; + } else { + throw new Error("printModuleExport: unknown type: " + n.descr.exportType); + } + + out += ")"; + return out; +} + +function printIdentifier(n) { + return "$" + n.value; +} + +function printIndex(n) { + if (n.type === "Identifier") { + return printIdentifier(n); + } else if (n.type === "NumberLiteral") { + return printNumberLiteral(n); + } else { + throw new Error("Unsupported index: " + n.type); + } +} + +function printMemory(n) { + var out = ""; + out += "("; + out += "memory"; + + if (n.id != null) { + out += space; + out += printIndex(n.id); + out += space; + } + + out += printLimit(n.limits); + out += ")"; + return out; +} + +function printLimit(n) { + var out = ""; + out += n.min + ""; + + if (n.max != null) { + out += space; + out += String(n.max); + } + + return out; +} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wast-printer/package.json b/node_modules/@webassemblyjs/wast-printer/package.json new file mode 100644 index 0000000..1a198e0 --- /dev/null +++ b/node_modules/@webassemblyjs/wast-printer/package.json @@ -0,0 +1,69 @@ +{ + "_from": "@webassemblyjs/wast-printer@1.8.5", + "_id": "@webassemblyjs/wast-printer@1.8.5", + "_inBundle": false, + "_integrity": "sha512-w0U0pD4EhlnvRyeJzBqaVSJAo9w/ce7/WPogeXLzGkO6hzhr4GnQIZ4W4uUt5b9ooAaXPtnXlj0gzsXEOUNYMg==", + "_location": "/@webassemblyjs/wast-printer", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@webassemblyjs/wast-printer@1.8.5", + "name": "@webassemblyjs/wast-printer", + "escapedName": "@webassemblyjs%2fwast-printer", + "scope": "@webassemblyjs", + "rawSpec": "1.8.5", + "saveSpec": null, + "fetchSpec": "1.8.5" + }, + "_requiredBy": [ + "/@webassemblyjs/helper-code-frame", + "/@webassemblyjs/wasm-edit" + ], + "_resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.8.5.tgz", + "_shasum": "114bbc481fd10ca0e23b3560fa812748b0bae5bc", + "_spec": "@webassemblyjs/wast-printer@1.8.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/helper-code-frame", + "author": { + "name": "Sven Sauleau" + }, + "bugs": { + "url": "https://github.com/xtuc/webassemblyjs/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/wast-parser": "1.8.5", + "@xtuc/long": "4.2.2" + }, + "deprecated": false, + "description": "WebAssembly text format printer", + "devDependencies": { + "@webassemblyjs/helper-test-framework": "1.8.5" + }, + "gitHead": "77bc195e9bb463b4fa4cbdb6291eed446d454d49", + "homepage": "https://github.com/xtuc/webassemblyjs#readme", + "keywords": [ + "webassembly", + "javascript", + "ast", + "compiler", + "printer", + "wast" + ], + "license": "MIT", + "main": "lib/index.js", + "module": "esm/index.js", + "name": "@webassemblyjs/wast-printer", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/xtuc/webassemblyjs.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.8.5" +} diff --git a/node_modules/@webassemblyjs/wast-printer/webassemblyjs-wast-printer-1.7.10.tgz b/node_modules/@webassemblyjs/wast-printer/webassemblyjs-wast-printer-1.7.10.tgz new file mode 100644 index 0000000000000000000000000000000000000000..4c946cd5e52c4fb7628ff66740bd6d5309122a79 GIT binary patch literal 4655 zcmV+~6431*iwFP!000001MM7ZbK5rZKJ!?u~gWk9B3@sAN3uljm$O4JK?&K`vW2sf0W+{Te4F zP4q4dUn0%*sG9=&(ckEMmSZol??ByGyAjIOMxnAJ1J-6qx@H60H!S zOV^HP`i{Gmrfa)qf-lT){x`0LElb~Ddq;bF(6ijkR9KZg#%+waisM28>&?tEz2%8x z&&@?dL(_HYA^#jej|RZ#S5z~wYyRZP5Bj0rIe6Or;pu$;K-=H%bhKILpxZf^cb|T5 z(Ea_xr++_aC^yQN-jetF6Lx=ZI5_E_Px_yQM!x;u@1nVk+yBn~VQv5K@5L{0&xa$W47n5H%{Ohi4~_|WJvbA&V7 zMmhEzmw42&6uvtZ`<*KRn7t~z&cu0(d8{Q%OW!>CJgAp z^lFkgE|Q1MWc#LOk+tJ8dPy-=p#Q2*CZiYAH@$J63?}4aJo;&H+CL?Y-UOZ-ZSrO? zeKmSLB>*w*olk!zqZg!i{xkW{;QX{r`v1Kc_a_rF8Y_ddi{YRTZG-cZ;p@}E`AhN~ z#+{EqsRy9ifOI+{NKl{}^e2eytUo?^1&_VwgW+KMb6a^an4Tlf7o#!hk&E7VIyiYf z?2XCA>+!{C(g*UVfcAWF{$dPN`e*&~sR~q~jr4zl2Qqop8xE0_(t8cukC8ueGP?MA zJb3wPN?whIr+sLA-UrTl&xd_Z3WPct_6BEda@srVz3j75Bfv6N5R7w2-n{B#6VmI! ze<#zy=p4m38J$nZ@Yn_^$J21=o57^tCcW`sf)ny$JUVMDIGr$J#E`(a^FGIdQ%zzk z0wDPOdeRROlGA=~2)HIV7)1<#)jyZB`~&_1|3B{cPS5)4%J>X4^8J73`-6iW|NrD* zzxMz4@%xr!pC}aNM^bQ>QND>#b5ws2wr=j zf^6h_Pcc{MJIL>x1i6720^DEj*;D~1WP6T9Rm)j4S!)yeTdiY8;!Dr*L;eN(Up{Kz zHI3Z;f6(pXUQgzKx=-r;e;>d3#%6&qxx}-&GjBSx_bu3b<{ScR)A zz5z@{gW^Iq~z*rKjo$9E7T`DZ8b+xUuCWwc%siqh9 zwIo&JsJMnAaB>sC;b_DTW66Q(Y9MJlXWgdPWD2U(cU^#L3~ZQs6VAfEPgiT7A91+? zZ{R#=JN9EndS>AP4NqY@9EF+mO5{;N7J%HYoQ(%Wy@A*QI1?Fe7ITot0fM0eM@az| zr52AB)HzJ6YH;)n^prJv(1a`9AOOW$e%m-cl{YeLXaXNCmd_KD)cB>*z%2?2gnez+ z0N(uOSXw-ESK#RFS!^g@EofBdre!rb3y(M}E%m))+D(p%?Crs^>2%b@q(QWXTy_Q-ExlOw*S5D=BWXBpBQK~{JS@UvHBdZ)xqU((yoE7GfGBC>^e0(w5A=NO0l#e(Ll!-dnN6*Ag+CkR% z#csrg1r|xy*}}tSVfvk1ezYdijt{gKcO_=M05L<0eT zne!_E8R-EAmJCV=9LFLgNvDiLum)RY@&F?$98a{Br-H-lYx+{sR@RZ=AS9Bc5IwVD zjda%HlAzvQAhaMA$J1gsZdwU;UFvNtKaF4BQ=MTxu83m}mCd5mhQ<)tQj{cU5L#{g z6rB=VJ8n@VjfyX&c(E6%jfkO`_VA#Q*|A39eBg*sZE|-_Kw9jXn6*t+LRdDFT1MJp zv5uG(%-*X4w{TH>a$=j-yEa*D#E^2k9S+tt;E`LuBhf^{&NPkWSavNT|M7q@O{6rdcJ>bHGoTIGD$(NL z)oIZcdy894g#lK^AM?V+RAL^vDy@WTE~b`n(^ctBe67?1F}TXu`xaf5K#pKB#jZf& zRP(hGBoM4R2{^H8;F2Qr!+GQ*0Uuut6%U3d zOU*rjRpWpn(!kiFcjcG{JEj_@x3;t`JE`JZVOS&TdQ#l+@5$&~<&l6n-!?_cq1xK8 z4RD*ap}4`yu8ogEv{*R9lQ!S+Ime_*Jh2e1Mz_@#S~xdd&mV;Yg28V)?~avh1`_=8 zF(o*b-E~MeMLERm^5``+3WC2112k!x7<_8XS+t1UL{>Vcc+C2iT|YCqtIBYd@DGAL zQ1Mg8{+oC&LM#r1SrLTt(24~H38G+{61Iwb8=J)-3(^R~(k$_hkL5?3?_3!`*tlGg zVh%Q4pc#UEesP*b;vBacRi&Gl3tPi1S(YlH!X05mq96-M}lF$iLf#)|90u5JAUx+Xx7SBamrh38O>C2fWEI*9k z$*NG!1wY`F(XI$9%z9~F`1vd?kHb%7b}JlOdg-f~ah`9^v*SE%4B-)@krx>Ska)+r zFoH_aR+U|DuIeRXGoPpLs|`dEre*qDKKTGvr~xphX!)7x#3fB#^^`0~Y(Vkaio^45 zLM%yt6eG{UB$3h!-wl47+&gf198|?Qi(GBqjx3pzY#<) zFJo+L6|#7%Jr()B-L;f6mb^!@_0gI&O0RiEuPJH5P2A;#eo|s6^rNW`DBH`%Y#L4) z3+@Tdeh64#Gk5H4_|l`?Nhdl^R{soa@2D zc3dhN<=3|_sZCu|PopJ_xrCb?tI|^Ig=CT=bBGM)x1tammV^F8v#eVYNDM3_VVEw} z{ZAkjASgj`=s4?JQA!L}M6WP%0J3^QOU;Y`r8t9??;aJ!J=6QUZL za#yG&WsIr>VA=6ZBGj#*xmiB5sv)nO02k{S++7u`*K-#hSL%ktt}-?X?2Q1?B-cPO%QV zXa#7Qb4+nIC8imi5xnh9f7`%h-rdS%z|zz1f%_k5qM% znF)w0ev-X2erQqjLvoMRqvr>>TkqJ&Ng;I37Ok2b%*opoYjjePcrcu&NC8Y-4z-co zioyE>Fwuo^bN((U7c*CW&xBw6oNrb$>JHiGMV9={OSH4J>(to@KP>@(P;_xqD!6wh z?sx>3qVN-(XJNkzk3rAUTrA}-d_ETVt`HHuW*;auaSVf&FDG27z9Vi8rhOX$hZ)Vk zGZ95&_*G7Dg)Q}cPh!>b)G{<2Q7Ry|IH~Elh$Q>o0Wg77ZHU2@8~*m+B^v#0R=zz5s8wxusPcO|@Ca!axzxJ!Nu6HYUT2CoD{csg_r+$XCgjQXNa_4`f+3Gnh_4n!;TJ$3I)CWZFXQ zj-vOhPaX?Ysnkc11@~e~#cq6bu8_96GHrYTFAKKPK9-g&^d>MU!>xVk3K#V+?-$g6 zk;|~&HI0J$FNfX3-TE(`y8g?({2CiDuDl!~+5ld&Lgkf3E?j3#U4Pr;Udd~d#^ojT z#K-<^VOYSS9I@;E3LY;7sLDSZ5Qaj>p04%u6!5VH7r9`WK$QisSDZEg>33VHYG^Zg>0VHg>33V zHtbgyvZ)K%)P-#7LN;|Fn?~v#txqjv)9kd_s}ohaKh>&B+SDa&>XJ6Ow}T&YNt>)a zT^F~xpW-%OV*cwgHxH%EO~uu(=u_*0H+8|A3_j|DH+8|Ay5LP+@TM+!Qy0AXx(eQ8 zg-mtno4WK(UHYajeN$*C>LNIG5gZn^)J1TLNIwrwGm$jjSJ%qpZu} z> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); +} + +function write(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = e << mLen | m; + eLen += mLen; + + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128; +} diff --git a/node_modules/@xtuc/ieee754/index.js b/node_modules/@xtuc/ieee754/index.js new file mode 100644 index 0000000..f294ac0 --- /dev/null +++ b/node_modules/@xtuc/ieee754/index.js @@ -0,0 +1,84 @@ +export function read(buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +export function write(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = ((value * c) - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} diff --git a/node_modules/@xtuc/ieee754/package.json b/node_modules/@xtuc/ieee754/package.json new file mode 100644 index 0000000..89d6e3e --- /dev/null +++ b/node_modules/@xtuc/ieee754/package.json @@ -0,0 +1,75 @@ +{ + "_from": "@xtuc/ieee754@^1.2.0", + "_id": "@xtuc/ieee754@1.2.0", + "_inBundle": false, + "_integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "_location": "/@xtuc/ieee754", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@xtuc/ieee754@^1.2.0", + "name": "@xtuc/ieee754", + "escapedName": "@xtuc%2fieee754", + "scope": "@xtuc", + "rawSpec": "^1.2.0", + "saveSpec": null, + "fetchSpec": "^1.2.0" + }, + "_requiredBy": [ + "/@webassemblyjs/ieee754" + ], + "_resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "_shasum": "eef014a3145ae477a1cbc00cd1e552336dceb790", + "_spec": "@xtuc/ieee754@^1.2.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/ieee754", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/ieee754/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Romain Beauxis", + "email": "toots@rastageeks.org" + } + ], + "deprecated": false, + "description": "Read/write IEEE754 floating point numbers from/to a Buffer or array-like object", + "devDependencies": { + "@babel/cli": "^7.0.0-beta.54", + "@babel/core": "^7.0.0-beta.54", + "@babel/plugin-transform-modules-commonjs": "^7.0.0-beta.54", + "airtap": "0.0.7", + "standard": "*", + "tape": "^4.0.0" + }, + "homepage": "https://github.com/feross/ieee754#readme", + "keywords": [ + "IEEE 754", + "buffer", + "convert", + "floating point", + "ieee754" + ], + "license": "BSD-3-Clause", + "main": "dist/index.cjs.js", + "module": "index.js", + "name": "@xtuc/ieee754", + "prepublish": "babel --plugins @babel/plugin-transform-modules-commonjs index.js -o dist/index.cjs.js", + "repository": { + "type": "git", + "url": "git://github.com/feross/ieee754.git" + }, + "scripts": { + "test": "standard && npm run test-node && npm run test-browser", + "test-browser": "airtap -- test/*.js", + "test-browser-local": "airtap --local -- test/*.js", + "test-node": "tape test/*.js" + }, + "version": "1.2.0" +} diff --git a/node_modules/@xtuc/long/LICENSE b/node_modules/@xtuc/long/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/node_modules/@xtuc/long/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/node_modules/@xtuc/long/README.md b/node_modules/@xtuc/long/README.md new file mode 100644 index 0000000..dd96ae6 --- /dev/null +++ b/node_modules/@xtuc/long/README.md @@ -0,0 +1,257 @@ +long.js +======= + +A Long class for representing a 64 bit two's-complement integer value derived from the [Closure Library](https://github.com/google/closure-library) +for stand-alone use and extended with unsigned support. + +[![npm](https://img.shields.io/npm/v/long.svg)](https://www.npmjs.com/package/long) [![Build Status](https://travis-ci.org/dcodeIO/long.js.svg)](https://travis-ci.org/dcodeIO/long.js) + +Background +---------- + +As of [ECMA-262 5th Edition](http://ecma262-5.com/ELS5_HTML.htm#Section_8.5), "all the positive and negative integers +whose magnitude is no greater than 253 are representable in the Number type", which is "representing the +doubleprecision 64-bit format IEEE 754 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic". +The [maximum safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) +in JavaScript is 253-1. + +Example: 264-1 is 1844674407370955**1615** but in JavaScript it evaluates to 1844674407370955**2000**. + +Furthermore, bitwise operators in JavaScript "deal only with integers in the range −231 through +231−1, inclusive, or in the range 0 through 232−1, inclusive. These operators accept any value of +the Number type but first convert each such value to one of 232 integer values." + +In some use cases, however, it is required to be able to reliably work with and perform bitwise operations on the full +64 bits. This is where long.js comes into play. + +Usage +----- + +The class is compatible with CommonJS and AMD loaders and is exposed globally as `Long` if neither is available. + +```javascript +var Long = require("long"); + +var longVal = new Long(0xFFFFFFFF, 0x7FFFFFFF); + +console.log(longVal.toString()); +... +``` + +API +--- + +### Constructor + +* new **Long**(low: `number`, high: `number`, unsigned?: `boolean`)
+ Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. See the from* functions below for more convenient ways of constructing Longs. + +### Fields + +* Long#**low**: `number`
+ The low 32 bits as a signed value. + +* Long#**high**: `number`
+ The high 32 bits as a signed value. + +* Long#**unsigned**: `boolean`
+ Whether unsigned or not. + +### Constants + +* Long.**ZERO**: `Long`
+ Signed zero. + +* Long.**ONE**: `Long`
+ Signed one. + +* Long.**NEG_ONE**: `Long`
+ Signed negative one. + +* Long.**UZERO**: `Long`
+ Unsigned zero. + +* Long.**UONE**: `Long`
+ Unsigned one. + +* Long.**MAX_VALUE**: `Long`
+ Maximum signed value. + +* Long.**MIN_VALUE**: `Long`
+ Minimum signed value. + +* Long.**MAX_UNSIGNED_VALUE**: `Long`
+ Maximum unsigned value. + +### Utility + +* Long.**isLong**(obj: `*`): `boolean`
+ Tests if the specified object is a Long. + +* Long.**fromBits**(lowBits: `number`, highBits: `number`, unsigned?: `boolean`): `Long`
+ Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. + +* Long.**fromBytes**(bytes: `number[]`, unsigned?: `boolean`, le?: `boolean`): `Long`
+ Creates a Long from its byte representation. + +* Long.**fromBytesLE**(bytes: `number[]`, unsigned?: `boolean`): `Long`
+ Creates a Long from its little endian byte representation. + +* Long.**fromBytesBE**(bytes: `number[]`, unsigned?: `boolean`): `Long`
+ Creates a Long from its big endian byte representation. + +* Long.**fromInt**(value: `number`, unsigned?: `boolean`): `Long`
+ Returns a Long representing the given 32 bit integer value. + +* Long.**fromNumber**(value: `number`, unsigned?: `boolean`): `Long`
+ Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + +* Long.**fromString**(str: `string`, unsigned?: `boolean`, radix?: `number`)
+ Long.**fromString**(str: `string`, radix: `number`)
+ Returns a Long representation of the given string, written using the specified radix. + +* Long.**fromValue**(val: `*`, unsigned?: `boolean`): `Long`
+ Converts the specified value to a Long using the appropriate from* function for its type. + +### Methods + +* Long#**add**(addend: `Long | number | string`): `Long`
+ Returns the sum of this and the specified Long. + +* Long#**and**(other: `Long | number | string`): `Long`
+ Returns the bitwise AND of this Long and the specified. + +* Long#**compare**/**comp**(other: `Long | number | string`): `number`
+ Compares this Long's value with the specified's. Returns `0` if they are the same, `1` if the this is greater and `-1` if the given one is greater. + +* Long#**divide**/**div**(divisor: `Long | number | string`): `Long`
+ Returns this Long divided by the specified. + +* Long#**equals**/**eq**(other: `Long | number | string`): `boolean`
+ Tests if this Long's value equals the specified's. + +* Long#**getHighBits**(): `number`
+ Gets the high 32 bits as a signed integer. + +* Long#**getHighBitsUnsigned**(): `number`
+ Gets the high 32 bits as an unsigned integer. + +* Long#**getLowBits**(): `number`
+ Gets the low 32 bits as a signed integer. + +* Long#**getLowBitsUnsigned**(): `number`
+ Gets the low 32 bits as an unsigned integer. + +* Long#**getNumBitsAbs**(): `number`
+ Gets the number of bits needed to represent the absolute value of this Long. + +* Long#**greaterThan**/**gt**(other: `Long | number | string`): `boolean`
+ Tests if this Long's value is greater than the specified's. + +* Long#**greaterThanOrEqual**/**gte**/**ge**(other: `Long | number | string`): `boolean`
+ Tests if this Long's value is greater than or equal the specified's. + +* Long#**isEven**(): `boolean`
+ Tests if this Long's value is even. + +* Long#**isNegative**(): `boolean`
+ Tests if this Long's value is negative. + +* Long#**isOdd**(): `boolean`
+ Tests if this Long's value is odd. + +* Long#**isPositive**(): `boolean`
+ Tests if this Long's value is positive. + +* Long#**isZero**/**eqz**(): `boolean`
+ Tests if this Long's value equals zero. + +* Long#**lessThan**/**lt**(other: `Long | number | string`): `boolean`
+ Tests if this Long's value is less than the specified's. + +* Long#**lessThanOrEqual**/**lte**/**le**(other: `Long | number | string`): `boolean`
+ Tests if this Long's value is less than or equal the specified's. + +* Long#**modulo**/**mod**/**rem**(divisor: `Long | number | string`): `Long`
+ Returns this Long modulo the specified. + +* Long#**multiply**/**mul**(multiplier: `Long | number | string`): `Long`
+ Returns the product of this and the specified Long. + +* Long#**negate**/**neg**(): `Long`
+ Negates this Long's value. + +* Long#**not**(): `Long`
+ Returns the bitwise NOT of this Long. + +* Long#**notEquals**/**neq**/**ne**(other: `Long | number | string`): `boolean`
+ Tests if this Long's value differs from the specified's. + +* Long#**or**(other: `Long | number | string`): `Long`
+ Returns the bitwise OR of this Long and the specified. + +* Long#**shiftLeft**/**shl**(numBits: `Long | number | string`): `Long`
+ Returns this Long with bits shifted to the left by the given amount. + +* Long#**shiftRight**/**shr**(numBits: `Long | number | string`): `Long`
+ Returns this Long with bits arithmetically shifted to the right by the given amount. + +* Long#**shiftRightUnsigned**/**shru**/**shr_u**(numBits: `Long | number | string`): `Long`
+ Returns this Long with bits logically shifted to the right by the given amount. + +* Long#**rotateLeft**/**rotl**(numBits: `Long | number | string`): `Long`
+ Returns this Long with bits rotated to the left by the given amount. + +* Long#**rotateRight**/**rotr**(numBits: `Long | number | string`): `Long`
+ Returns this Long with bits rotated to the right by the given amount. + +* Long#**subtract**/**sub**(subtrahend: `Long | number | string`): `Long`
+ Returns the difference of this and the specified Long. + +* Long#**toBytes**(le?: `boolean`): `number[]`
+ Converts this Long to its byte representation. + +* Long#**toBytesLE**(): `number[]`
+ Converts this Long to its little endian byte representation. + +* Long#**toBytesBE**(): `number[]`
+ Converts this Long to its big endian byte representation. + +* Long#**toInt**(): `number`
+ Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + +* Long#**toNumber**(): `number`
+ Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + +* Long#**toSigned**(): `Long`
+ Converts this Long to signed. + +* Long#**toString**(radix?: `number`): `string`
+ Converts the Long to a string written in the specified radix. + +* Long#**toUnsigned**(): `Long`
+ Converts this Long to unsigned. + +* Long#**xor**(other: `Long | number | string`): `Long`
+ Returns the bitwise XOR of this Long and the given one. + +WebAssembly support +------------------- + +[WebAssembly](http://webassembly.org) supports 64-bit integer arithmetic out of the box, hence a [tiny WebAssembly module](./src/wasm.wat) is used to compute operations like multiplication, division and remainder more efficiently (slow operations like division are around twice as fast), falling back to floating point based computations in JavaScript where WebAssembly is not yet supported, e.g., in older versions of node. + +Building +-------- + +To build an UMD bundle to `dist/long.js`, run: + +``` +$> npm install +$> npm run build +``` + +Running the [tests](./tests): + +``` +$> npm test +``` diff --git a/node_modules/@xtuc/long/dist/long.js b/node_modules/@xtuc/long/dist/long.js new file mode 100644 index 0000000..71370a7 --- /dev/null +++ b/node_modules/@xtuc/long/dist/long.js @@ -0,0 +1,2 @@ +!function(t,i){"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof exports?exports.Long=i():t.Long=i()}("undefined"!=typeof self?self:this,function(){return function(t){function i(h){if(n[h])return n[h].exports;var e=n[h]={i:h,l:!1,exports:{}};return t[h].call(e.exports,e,e.exports,i),e.l=!0,e.exports}var n={};return i.m=t,i.c=n,i.d=function(t,n,h){i.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:h})},i.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(n,"a",n),n},i.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},i.p="",i(i.s=0)}([function(t,i){function n(t,i,n){this.low=0|t,this.high=0|i,this.unsigned=!!n}function h(t){return!0===(t&&t.__isLong__)}function e(t,i){var n,h,e;return i?(t>>>=0,(e=0<=t&&t<256)&&(h=l[t])?h:(n=r(t,(0|t)<0?-1:0,!0),e&&(l[t]=n),n)):(t|=0,(e=-128<=t&&t<128)&&(h=f[t])?h:(n=r(t,t<0?-1:0,!1),e&&(f[t]=n),n))}function s(t,i){if(isNaN(t))return i?p:m;if(i){if(t<0)return p;if(t>=c)return q}else{if(t<=-w)return _;if(t+1>=w)return E}return t<0?s(-t,i).neg():r(t%d|0,t/d|0,i)}function r(t,i,h){return new n(t,i,h)}function o(t,i,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return m;if("number"==typeof i?(n=i,i=!1):i=!!i,(n=n||10)<2||360)throw Error("interior hyphen");if(0===h)return o(t.substring(1),i,n).neg();for(var e=s(a(n,8)),r=m,u=0;u>>0:this.low},B.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},B.toString=function(t){if((t=t||10)<2||36>>0,f=g.toString(t);if(r=u,r.isZero())return f+o;for(;f.length<6;)f="0"+f;o=""+f+o}},B.getHighBits=function(){return this.high},B.getHighBitsUnsigned=function(){return this.high>>>0},B.getLowBits=function(){return this.low},B.getLowBitsUnsigned=function(){return this.low>>>0},B.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,i=31;i>0&&0==(t&1<=0},B.isOdd=function(){return 1==(1&this.low)},B.isEven=function(){return 0==(1&this.low)},B.equals=function(t){return h(t)||(t=u(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},B.eq=B.equals,B.notEquals=function(t){return!this.eq(t)},B.neq=B.notEquals,B.ne=B.notEquals,B.lessThan=function(t){return this.comp(t)<0},B.lt=B.lessThan,B.lessThanOrEqual=function(t){return this.comp(t)<=0},B.lte=B.lessThanOrEqual,B.le=B.lessThanOrEqual,B.greaterThan=function(t){return this.comp(t)>0},B.gt=B.greaterThan,B.greaterThanOrEqual=function(t){return this.comp(t)>=0},B.gte=B.greaterThanOrEqual,B.ge=B.greaterThanOrEqual,B.compare=function(t){if(h(t)||(t=u(t)),this.eq(t))return 0;var i=this.isNegative(),n=t.isNegative();return i&&!n?-1:!i&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},B.comp=B.compare,B.negate=function(){return!this.unsigned&&this.eq(_)?_:this.not().add(y)},B.neg=B.negate,B.add=function(t){h(t)||(t=u(t));var i=this.high>>>16,n=65535&this.high,e=this.low>>>16,s=65535&this.low,o=t.high>>>16,g=65535&t.high,f=t.low>>>16,l=65535&t.low,a=0,d=0,c=0,w=0;return w+=s+l,c+=w>>>16,w&=65535,c+=e+f,d+=c>>>16,c&=65535,d+=n+g,a+=d>>>16,d&=65535,a+=i+o,a&=65535,r(c<<16|w,a<<16|d,this.unsigned)},B.subtract=function(t){return h(t)||(t=u(t)),this.add(t.neg())},B.sub=B.subtract,B.multiply=function(t){if(this.isZero())return m;if(h(t)||(t=u(t)),g){return r(g.mul(this.low,this.high,t.low,t.high),g.get_high(),this.unsigned)}if(t.isZero())return m;if(this.eq(_))return t.isOdd()?_:m;if(t.eq(_))return this.isOdd()?_:m;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(v)&&t.lt(v))return s(this.toNumber()*t.toNumber(),this.unsigned);var i=this.high>>>16,n=65535&this.high,e=this.low>>>16,o=65535&this.low,f=t.high>>>16,l=65535&t.high,a=t.low>>>16,d=65535&t.low,c=0,w=0,p=0,y=0;return y+=o*d,p+=y>>>16,y&=65535,p+=e*d,w+=p>>>16,p&=65535,p+=o*a,w+=p>>>16,p&=65535,w+=n*d,c+=w>>>16,w&=65535,w+=e*a,c+=w>>>16,w&=65535,w+=o*l,c+=w>>>16,w&=65535,c+=i*d+n*a+e*l+o*f,c&=65535,r(p<<16|y,c<<16|w,this.unsigned)},B.mul=B.multiply,B.divide=function(t){if(h(t)||(t=u(t)),t.isZero())throw Error("division by zero");if(g){if(!this.unsigned&&-2147483648===this.high&&-1===t.low&&-1===t.high)return this;return r((this.unsigned?g.div_u:g.div_s)(this.low,this.high,t.low,t.high),g.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?p:m;var i,n,e;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return p;if(t.gt(this.shru(1)))return b;e=p}else{if(this.eq(_)){if(t.eq(y)||t.eq(N))return _;if(t.eq(_))return y;return i=this.shr(1).div(t).shl(1),i.eq(m)?t.isNegative()?y:N:(n=this.sub(t.mul(i)),e=i.add(n.div(t)))}if(t.eq(_))return this.unsigned?p:m;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();e=m}for(n=this;n.gte(t);){i=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var o=Math.ceil(Math.log(i)/Math.LN2),f=o<=48?1:a(2,o-48),l=s(i),d=l.mul(t);d.isNegative()||d.gt(n);)i-=f,l=s(i,this.unsigned),d=l.mul(t);l.isZero()&&(l=y),e=e.add(l),n=n.sub(d)}return e},B.div=B.divide,B.modulo=function(t){if(h(t)||(t=u(t)),g){return r((this.unsigned?g.rem_u:g.rem_s)(this.low,this.high,t.low,t.high),g.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},B.mod=B.modulo,B.rem=B.modulo,B.not=function(){return r(~this.low,~this.high,this.unsigned)},B.and=function(t){return h(t)||(t=u(t)),r(this.low&t.low,this.high&t.high,this.unsigned)},B.or=function(t){return h(t)||(t=u(t)),r(this.low|t.low,this.high|t.high,this.unsigned)},B.xor=function(t){return h(t)||(t=u(t)),r(this.low^t.low,this.high^t.high,this.unsigned)},B.shiftLeft=function(t){return h(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?r(this.low<>>32-t,this.unsigned):r(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):r(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},B.shr=B.shiftRight,B.shiftRightUnsigned=function(t){return h(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?r(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):32===t?r(this.high,0,this.unsigned):r(this.high>>>t-32,0,this.unsigned)},B.shru=B.shiftRightUnsigned,B.shr_u=B.shiftRightUnsigned,B.rotateLeft=function(t){var i;return h(t)&&(t=t.toInt()),0==(t&=63)?this:32===t?r(this.high,this.low,this.unsigned):t<32?(i=32-t,r(this.low<>>i,this.high<>>i,this.unsigned)):(t-=32,i=32-t,r(this.high<>>i,this.low<>>i,this.unsigned))},B.rotl=B.rotateLeft,B.rotateRight=function(t){var i;return h(t)&&(t=t.toInt()),0==(t&=63)?this:32===t?r(this.high,this.low,this.unsigned):t<32?(i=32-t,r(this.high<>>t,this.low<>>t,this.unsigned)):(t-=32,i=32-t,r(this.low<>>t,this.high<>>t,this.unsigned))},B.rotr=B.rotateRight,B.toSigned=function(){return this.unsigned?r(this.low,this.high,!1):this},B.toUnsigned=function(){return this.unsigned?this:r(this.low,this.high,!0)},B.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},B.toBytesLE=function(){var t=this.high,i=this.low;return[255&i,i>>>8&255,i>>>16&255,i>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},B.toBytesBE=function(){var t=this.high,i=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,i>>>24,i>>>16&255,i>>>8&255,255&i]},n.fromBytes=function(t,i,h){return h?n.fromBytesLE(t,i):n.fromBytesBE(t,i)},n.fromBytesLE=function(t,i){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,i)},n.fromBytesBE=function(t,i){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],i)}}])}); +//# sourceMappingURL=long.js.map \ No newline at end of file diff --git a/node_modules/@xtuc/long/dist/long.js.map b/node_modules/@xtuc/long/dist/long.js.map new file mode 100644 index 0000000..6a3d702 --- /dev/null +++ b/node_modules/@xtuc/long/dist/long.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///long.js","webpack:///webpack/bootstrap f96e8d1360c0487f2545","webpack:///./src/long.js"],"names":["root","factory","exports","module","define","amd","self","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","Long","low","high","unsigned","isLong","obj","fromInt","value","cachedObj","cache","UINT_CACHE","fromBits","INT_CACHE","fromNumber","isNaN","UZERO","ZERO","TWO_PWR_64_DBL","MAX_UNSIGNED_VALUE","TWO_PWR_63_DBL","MIN_VALUE","MAX_VALUE","neg","TWO_PWR_32_DBL","lowBits","highBits","fromString","str","radix","length","Error","RangeError","indexOf","substring","radixToPower","pow_dbl","result","size","Math","min","parseInt","power","mul","add","fromValue","val","wasm","WebAssembly","Instance","Module","Uint8Array","e","__isLong__","pow","TWO_PWR_16_DBL","TWO_PWR_24","ONE","UONE","NEG_ONE","LongPrototype","toInt","toNumber","toString","isZero","isNegative","eq","radixLong","div","rem1","sub","rem","remDiv","intval","digits","getHighBits","getHighBitsUnsigned","getLowBits","getLowBitsUnsigned","getNumBitsAbs","bit","eqz","isPositive","isOdd","isEven","equals","other","notEquals","neq","ne","lessThan","comp","lt","lessThanOrEqual","lte","le","greaterThan","gt","greaterThanOrEqual","gte","ge","compare","thisNeg","otherNeg","negate","not","addend","a48","a32","a16","a00","b48","b32","b16","b00","c48","c32","c16","c00","subtract","subtrahend","multiply","multiplier","divide","divisor","approx","res","toUnsigned","shru","shr","shl","max","floor","log2","ceil","log","LN2","delta","approxRes","approxRem","modulo","mod","and","or","xor","shiftLeft","numBits","shiftRight","shiftRightUnsigned","shr_u","rotateLeft","b","rotl","rotateRight","rotr","toSigned","toBytes","toBytesLE","toBytesBE","hi","lo","fromBytes","bytes","fromBytesLE","fromBytesBE"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,KAAAD,IAEAD,EAAA,KAAAC,KACC,mBAAAK,WAAAC,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAR,OAGA,IAAAC,GAAAQ,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAX,WAUA,OANAM,GAAAE,GAAAI,KAAAX,EAAAD,QAAAC,IAAAD,QAAAO,GAGAN,EAAAU,GAAA,EAGAV,EAAAD,QAvBA,GAAAS,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAf,EAAAgB,EAAAC,GACAV,EAAAW,EAAAlB,EAAAgB,IACAG,OAAAC,eAAApB,EAAAgB,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAvB,GACA,GAAAgB,GAAAhB,KAAAwB,WACA,WAA2B,MAAAxB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAM,GAAAQ,EAAAE,EAAA,IAAAA,GACAA,GAIAV,EAAAW,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDpB,EAAAuB,EAAA,GAGAvB,IAAAwB,EAAA,KDgBM,SAAU9B,EAAQD,GEpDxB,QAAAgC,GAAAC,EAAAC,EAAAC,GAMA9B,KAAA4B,IAAA,EAAAA,EAMA5B,KAAA6B,KAAA,EAAAA,EAMA7B,KAAA8B,aAoCA,QAAAC,GAAAC,GACA,YAAAA,KAAA,YA+BA,QAAAC,GAAAC,EAAAJ,GACA,GAAAE,GAAAG,EAAAC,CACA,OAAAN,IACAI,KAAA,GACAE,EAAA,GAAAF,KAAA,OACAC,EAAAE,EAAAH,IAEAC,GAEAH,EAAAM,EAAAJ,GAAA,EAAAA,GAAA,WACAE,IACAC,EAAAH,GAAAF,GACAA,KAEAE,GAAA,GACAE,GAAA,KAAAF,KAAA,OACAC,EAAAI,EAAAL,IAEAC,GAEAH,EAAAM,EAAAJ,IAAA,WACAE,IACAG,EAAAL,GAAAF,GACAA,IAmBA,QAAAQ,GAAAN,EAAAJ,GACA,GAAAW,MAAAP,GACA,MAAAJ,GAAAY,EAAAC,CACA,IAAAb,EAAA,CACA,GAAAI,EAAA,EACA,MAAAQ,EACA,IAAAR,GAAAU,EACA,MAAAC,OACK,CACL,GAAAX,IAAAY,EACA,MAAAC,EACA,IAAAb,EAAA,GAAAY,EACA,MAAAE,GAEA,MAAAd,GAAA,EACAM,GAAAN,EAAAJ,GAAAmB,MACAX,EAAAJ,EAAAgB,EAAA,EAAAhB,EAAAgB,EAAA,EAAApB,GAmBA,QAAAQ,GAAAa,EAAAC,EAAAtB,GACA,UAAAH,GAAAwB,EAAAC,EAAAtB,GA8BA,QAAAuB,GAAAC,EAAAxB,EAAAyB,GACA,OAAAD,EAAAE,OACA,KAAAC,OAAA,eACA,YAAAH,GAAA,aAAAA,GAAA,cAAAA,GAAA,cAAAA,EACA,MAAAX,EASA,IARA,gBAAAb,IAEAyB,EAAAzB,EACAA,GAAA,GAEAA,OAEAyB,KAAA,IACA,MAAAA,EACA,KAAAG,YAAA,QAEA,IAAAjC,EACA,KAAAA,EAAA6B,EAAAK,QAAA,QACA,KAAAF,OAAA,kBACA,QAAAhC,EACA,MAAA4B,GAAAC,EAAAM,UAAA,GAAA9B,EAAAyB,GAAAN,KAQA,QAHAY,GAAArB,EAAAsB,EAAAP,EAAA,IAEAQ,EAAApB,EACAtC,EAAA,EAAmBA,EAAAiD,EAAAE,OAAgBnD,GAAA,GACnC,GAAA2D,GAAAC,KAAAC,IAAA,EAAAZ,EAAAE,OAAAnD,GACA6B,EAAAiC,SAAAb,EAAAM,UAAAvD,IAAA2D,GAAAT,EACA,IAAAS,EAAA,GACA,GAAAI,GAAA5B,EAAAsB,EAAAP,EAAAS,GACAD,KAAAM,IAAAD,GAAAE,IAAA9B,EAAAN,QAEA6B,KAAAM,IAAAR,GACAE,IAAAO,IAAA9B,EAAAN,IAIA,MADA6B,GAAAjC,WACAiC,EAoBA,QAAAQ,GAAAC,EAAA1C,GACA,sBAAA0C,GACAhC,EAAAgC,EAAA1C,GACA,gBAAA0C,GACAnB,EAAAmB,EAAA1C,GAEAQ,EAAAkC,EAAA5C,IAAA4C,EAAA3C,KAAA,iBAAAC,KAAA0C,EAAA1C,UA7RAlC,EAAAD,QAAAgC,CAKA,IAAA8C,GAAA,IAEA,KACAA,EAAA,GAAAC,aAAAC,SAAA,GAAAD,aAAAE,OAAA,GAAAC,aACA,u2BACSlF,QACR,MAAAmF,IA0DDnD,EAAAJ,UAAAwD,WAEAjE,OAAAC,eAAAY,EAAAJ,UAAA,cAAqDW,OAAA,IAkBrDP,EAAAI,QAOA,IAAAQ,MAOAF,IA0CAV,GAAAM,UAkCAN,EAAAa,aAsBAb,EAAAW,UASA,IAAAwB,GAAAG,KAAAe,GA4DArD,GAAA0B,aAyBA1B,EAAA4C,WAUA,IAcArB,GAAA+B,WAOArC,EAAAM,IAOAJ,EAAAF,EAAA,EAOAsC,EAAAjD,EA5BA,OAkCAU,EAAAV,EAAA,EAMAN,GAAAgB,MAMA,IAAAD,GAAAT,EAAA,KAMAN,GAAAe,OAMA,IAAAyC,GAAAlD,EAAA,EAMAN,GAAAwD,KAMA,IAAAC,GAAAnD,EAAA,KAMAN,GAAAyD,MAMA,IAAAC,GAAApD,GAAA,EAMAN,GAAA0D,SAMA,IAAArC,GAAAV,GAAA,gBAMAX,GAAAqB,WAMA,IAAAH,GAAAP,GAAA,QAMAX,GAAAkB,oBAMA,IAAAE,GAAAT,EAAA,iBAMAX,GAAAoB,WAMA,IAAAuC,GAAA3D,EAAAJ,SAOA+D,GAAAC,MAAA,WACA,MAAAvF,MAAA8B,SAAA9B,KAAA4B,MAAA,EAAA5B,KAAA4B,KAQA0D,EAAAE,SAAA,WACA,MAAAxF,MAAA8B,UACA9B,KAAA6B,OAAA,GAAAqB,GAAAlD,KAAA4B,MAAA,GACA5B,KAAA6B,KAAAqB,GAAAlD,KAAA4B,MAAA,IAWA0D,EAAAG,SAAA,SAAAlC,GAEA,IADAA,KAAA,IACA,MAAAA,EACA,KAAAG,YAAA,QACA,IAAA1D,KAAA0F,SACA,SACA,IAAA1F,KAAA2F,aAAA,CACA,GAAA3F,KAAA4F,GAAA7C,GAAA,CAGA,GAAA8C,GAAArD,EAAAe,GACAuC,EAAA9F,KAAA8F,IAAAD,GACAE,EAAAD,EAAAzB,IAAAwB,GAAAG,IAAAhG,KACA,OAAA8F,GAAAL,SAAAlC,GAAAwC,EAAAR,QAAAE,SAAAlC,GAEA,UAAAvD,KAAAiD,MAAAwC,SAAAlC,GAQA,IAHA,GAAAM,GAAArB,EAAAsB,EAAAP,EAAA,GAAAvD,KAAA8B,UACAmE,EAAAjG,KACA+D,EAAA,KACA,CACA,GAAAmC,GAAAD,EAAAH,IAAAjC,GACAsC,EAAAF,EAAAD,IAAAE,EAAA7B,IAAAR,IAAA0B,UAAA,EACAa,EAAAD,EAAAV,SAAAlC,EAEA,IADA0C,EAAAC,EACAD,EAAAP,SACA,MAAAU,GAAArC,CAEA,MAAAqC,EAAA5C,OAAA,GACA4C,EAAA,IAAAA,CACArC,GAAA,GAAAqC,EAAArC,IAUAuB,EAAAe,YAAA,WACA,MAAArG,MAAA6B,MAQAyD,EAAAgB,oBAAA,WACA,MAAAtG,MAAA6B,OAAA,GAQAyD,EAAAiB,WAAA,WACA,MAAAvG,MAAA4B,KAQA0D,EAAAkB,mBAAA,WACA,MAAAxG,MAAA4B,MAAA,GAQA0D,EAAAmB,cAAA,WACA,GAAAzG,KAAA2F,aACA,MAAA3F,MAAA4F,GAAA7C,GAAA,GAAA/C,KAAAiD,MAAAwD,eAEA,QADAjC,GAAA,GAAAxE,KAAA6B,KAAA7B,KAAA6B,KAAA7B,KAAA4B,IACA8E,EAAA,GAAsBA,EAAA,GACtB,IAAAlC,EAAA,GAAAkC,GAD+BA,KAG/B,UAAA1G,KAAA6B,KAAA6E,EAAA,GAAAA,EAAA,GAQApB,EAAAI,OAAA,WACA,WAAA1F,KAAA6B,MAAA,IAAA7B,KAAA4B,KAOA0D,EAAAqB,IAAArB,EAAAI,OAOAJ,EAAAK,WAAA,WACA,OAAA3F,KAAA8B,UAAA9B,KAAA6B,KAAA,GAQAyD,EAAAsB,WAAA,WACA,MAAA5G,MAAA8B,UAAA9B,KAAA6B,MAAA,GAQAyD,EAAAuB,MAAA,WACA,aAAA7G,KAAA4B,MAQA0D,EAAAwB,OAAA,WACA,aAAA9G,KAAA4B,MASA0D,EAAAyB,OAAA,SAAAC,GAGA,MAFAjF,GAAAiF,KACAA,EAAAzC,EAAAyC,KACAhH,KAAA8B,WAAAkF,EAAAlF,UAAA9B,KAAA6B,OAAA,OAAAmF,EAAAnF,OAAA,SAEA7B,KAAA6B,OAAAmF,EAAAnF,MAAA7B,KAAA4B,MAAAoF,EAAApF,MASA0D,EAAAM,GAAAN,EAAAyB,OAQAzB,EAAA2B,UAAA,SAAAD,GACA,OAAAhH,KAAA4F,GAAAoB,IASA1B,EAAA4B,IAAA5B,EAAA2B,UAQA3B,EAAA6B,GAAA7B,EAAA2B,UAQA3B,EAAA8B,SAAA,SAAAJ,GACA,MAAAhH,MAAAqH,KAAAL,GAAA,GASA1B,EAAAgC,GAAAhC,EAAA8B,SAQA9B,EAAAiC,gBAAA,SAAAP,GACA,MAAAhH,MAAAqH,KAAAL,IAAA,GASA1B,EAAAkC,IAAAlC,EAAAiC,gBAQAjC,EAAAmC,GAAAnC,EAAAiC,gBAQAjC,EAAAoC,YAAA,SAAAV,GACA,MAAAhH,MAAAqH,KAAAL,GAAA,GASA1B,EAAAqC,GAAArC,EAAAoC,YAQApC,EAAAsC,mBAAA,SAAAZ,GACA,MAAAhH,MAAAqH,KAAAL,IAAA,GASA1B,EAAAuC,IAAAvC,EAAAsC,mBAQAtC,EAAAwC,GAAAxC,EAAAsC,mBASAtC,EAAAyC,QAAA,SAAAf,GAGA,GAFAjF,EAAAiF,KACAA,EAAAzC,EAAAyC,IACAhH,KAAA4F,GAAAoB,GACA,QACA,IAAAgB,GAAAhI,KAAA2F,aACAsC,EAAAjB,EAAArB,YACA,OAAAqC,KAAAC,GACA,GACAD,GAAAC,EACA,EAEAjI,KAAA8B,SAGAkF,EAAAnF,OAAA,EAAA7B,KAAA6B,OAAA,GAAAmF,EAAAnF,OAAA7B,KAAA6B,MAAAmF,EAAApF,MAAA,EAAA5B,KAAA4B,MAAA,OAFA5B,KAAAgG,IAAAgB,GAAArB,cAAA,KAYAL,EAAA+B,KAAA/B,EAAAyC,QAOAzC,EAAA4C,OAAA,WACA,OAAAlI,KAAA8B,UAAA9B,KAAA4F,GAAA7C,GACAA,EACA/C,KAAAmI,MAAA7D,IAAAa,IAQAG,EAAArC,IAAAqC,EAAA4C,OAQA5C,EAAAhB,IAAA,SAAA8D,GACArG,EAAAqG,KACAA,EAAA7D,EAAA6D,GAIA,IAAAC,GAAArI,KAAA6B,OAAA,GACAyG,EAAA,MAAAtI,KAAA6B,KACA0G,EAAAvI,KAAA4B,MAAA,GACA4G,EAAA,MAAAxI,KAAA4B,IAEA6G,EAAAL,EAAAvG,OAAA,GACA6G,EAAA,MAAAN,EAAAvG,KACA8G,EAAAP,EAAAxG,MAAA,GACAgH,EAAA,MAAAR,EAAAxG,IAEAiH,EAAA,EAAAC,EAAA,EAAAC,EAAA,EAAAC,EAAA,CAYA,OAXAA,IAAAR,EAAAI,EACAG,GAAAC,IAAA,GACAA,GAAA,MACAD,GAAAR,EAAAI,EACAG,GAAAC,IAAA,GACAA,GAAA,MACAD,GAAAR,EAAAI,EACAG,GAAAC,IAAA,GACAA,GAAA,MACAD,GAAAR,EAAAI,EACAI,GAAA,MACAvG,EAAAyG,GAAA,GAAAC,EAAAH,GAAA,GAAAC,EAAA9I,KAAA8B,WASAwD,EAAA2D,SAAA,SAAAC,GAGA,MAFAnH,GAAAmH,KACAA,EAAA3E,EAAA2E,IACAlJ,KAAAsE,IAAA4E,EAAAjG,QASAqC,EAAAU,IAAAV,EAAA2D,SAQA3D,EAAA6D,SAAA,SAAAC,GACA,GAAApJ,KAAA0F,SACA,MAAA/C,EAKA,IAJAZ,EAAAqH,KACAA,EAAA7E,EAAA6E,IAGA3E,EAAA,CAKA,MAAAnC,GAJAmC,EAAA,IAAAzE,KAAA4B,IACA5B,KAAA6B,KACAuH,EAAAxH,IACAwH,EAAAvH,MACA4C,EAAA,WAAAzE,KAAA8B,UAGA,GAAAsH,EAAA1D,SACA,MAAA/C,EACA,IAAA3C,KAAA4F,GAAA7C,GACA,MAAAqG,GAAAvC,QAAA9D,EAAAJ,CACA,IAAAyG,EAAAxD,GAAA7C,GACA,MAAA/C,MAAA6G,QAAA9D,EAAAJ,CAEA,IAAA3C,KAAA2F,aACA,MAAAyD,GAAAzD,aACA3F,KAAAiD,MAAAoB,IAAA+E,EAAAnG,OAEAjD,KAAAiD,MAAAoB,IAAA+E,GAAAnG,KACK,IAAAmG,EAAAzD,aACL,MAAA3F,MAAAqE,IAAA+E,EAAAnG,YAGA,IAAAjD,KAAAsH,GAAApC,IAAAkE,EAAA9B,GAAApC,GACA,MAAA1C,GAAAxC,KAAAwF,WAAA4D,EAAA5D,WAAAxF,KAAA8B,SAKA,IAAAuG,GAAArI,KAAA6B,OAAA,GACAyG,EAAA,MAAAtI,KAAA6B,KACA0G,EAAAvI,KAAA4B,MAAA,GACA4G,EAAA,MAAAxI,KAAA4B,IAEA6G,EAAAW,EAAAvH,OAAA,GACA6G,EAAA,MAAAU,EAAAvH,KACA8G,EAAAS,EAAAxH,MAAA,GACAgH,EAAA,MAAAQ,EAAAxH,IAEAiH,EAAA,EAAAC,EAAA,EAAAC,EAAA,EAAAC,EAAA,CAqBA,OApBAA,IAAAR,EAAAI,EACAG,GAAAC,IAAA,GACAA,GAAA,MACAD,GAAAR,EAAAK,EACAE,GAAAC,IAAA,GACAA,GAAA,MACAA,GAAAP,EAAAG,EACAG,GAAAC,IAAA,GACAA,GAAA,MACAD,GAAAR,EAAAM,EACAC,GAAAC,IAAA,GACAA,GAAA,MACAA,GAAAP,EAAAI,EACAE,GAAAC,IAAA,GACAA,GAAA,MACAA,GAAAN,EAAAE,EACAG,GAAAC,IAAA,GACAA,GAAA,MACAD,GAAAR,EAAAO,EAAAN,EAAAK,EAAAJ,EAAAG,EAAAF,EAAAC,EACAI,GAAA,MACAvG,EAAAyG,GAAA,GAAAC,EAAAH,GAAA,GAAAC,EAAA9I,KAAA8B,WASAwD,EAAAjB,IAAAiB,EAAA6D,SASA7D,EAAA+D,OAAA,SAAAC,GAGA,GAFAvH,EAAAuH,KACAA,EAAA/E,EAAA+E,IACAA,EAAA5D,SACA,KAAAjC,OAAA,mBAGA,IAAAgB,EAAA,CAIA,IAAAzE,KAAA8B,WACA,aAAA9B,KAAA6B,OACA,IAAAyH,EAAA1H,MAAA,IAAA0H,EAAAzH,KAEA,MAAA7B,KAQA,OAAAsC,IANAtC,KAAA8B,SAAA2C,EAAA,MAAAA,EAAA,OACAzE,KAAA4B,IACA5B,KAAA6B,KACAyH,EAAA1H,IACA0H,EAAAzH,MAEA4C,EAAA,WAAAzE,KAAA8B,UAGA,GAAA9B,KAAA0F,SACA,MAAA1F,MAAA8B,SAAAY,EAAAC,CACA,IAAA4G,GAAAtD,EAAAuD,CACA,IAAAxJ,KAAA8B,SA6BK,CAKL,GAFAwH,EAAAxH,WACAwH,IAAAG,cACAH,EAAA3B,GAAA3H,MACA,MAAA0C,EACA,IAAA4G,EAAA3B,GAAA3H,KAAA0J,KAAA,IACA,MAAAtE,EACAoE,GAAA9G,MAtCA,CAGA,GAAA1C,KAAA4F,GAAA7C,GAAA,CACA,GAAAuG,EAAA1D,GAAAT,IAAAmE,EAAA1D,GAAAP,GACA,MAAAtC,EACA,IAAAuG,EAAA1D,GAAA7C,GACA,MAAAoC,EAKA,OADAoE,GADAvJ,KAAA2J,IAAA,GACA7D,IAAAwD,GAAAM,IAAA,GACAL,EAAA3D,GAAAjD,GACA2G,EAAA3D,aAAAR,EAAAE,GAEAY,EAAAjG,KAAAgG,IAAAsD,EAAAjF,IAAAkF,IACAC,EAAAD,EAAAjF,IAAA2B,EAAAH,IAAAwD,KAIS,GAAAA,EAAA1D,GAAA7C,GACT,MAAA/C,MAAA8B,SAAAY,EAAAC,CACA,IAAA3C,KAAA2F,aACA,MAAA2D,GAAA3D,aACA3F,KAAAiD,MAAA6C,IAAAwD,EAAArG,OACAjD,KAAAiD,MAAA6C,IAAAwD,GAAArG,KACS,IAAAqG,EAAA3D,aACT,MAAA3F,MAAA8F,IAAAwD,EAAArG,YACAuG,GAAA7G,EAmBA,IADAsD,EAAAjG,KACAiG,EAAA4B,IAAAyB,IAAA,CAGAC,EAAAtF,KAAA4F,IAAA,EAAA5F,KAAA6F,MAAA7D,EAAAT,WAAA8D,EAAA9D,YAWA,KAPA,GAAAuE,GAAA9F,KAAA+F,KAAA/F,KAAAgG,IAAAV,GAAAtF,KAAAiG,KACAC,EAAAJ,GAAA,KAAAjG,EAAA,EAAAiG,EAAA,IAIAK,EAAA5H,EAAA+G,GACAc,EAAAD,EAAA/F,IAAAiF,GACAe,EAAA1E,cAAA0E,EAAA1C,GAAA1B,IACAsD,GAAAY,EACAC,EAAA5H,EAAA+G,EAAAvJ,KAAA8B,UACAuI,EAAAD,EAAA/F,IAAAiF,EAKAc,GAAA1E,WACA0E,EAAAjF,GAEAqE,IAAAlF,IAAA8F,GACAnE,IAAAD,IAAAqE,GAEA,MAAAb,IASAlE,EAAAQ,IAAAR,EAAA+D,OAQA/D,EAAAgF,OAAA,SAAAhB,GAKA,GAJAvH,EAAAuH,KACAA,EAAA/E,EAAA+E,IAGA7E,EAAA,CAOA,MAAAnC,IANAtC,KAAA8B,SAAA2C,EAAA,MAAAA,EAAA,OACAzE,KAAA4B,IACA5B,KAAA6B,KACAyH,EAAA1H,IACA0H,EAAAzH,MAEA4C,EAAA,WAAAzE,KAAA8B,UAGA,MAAA9B,MAAAgG,IAAAhG,KAAA8F,IAAAwD,GAAAjF,IAAAiF,KASAhE,EAAAiF,IAAAjF,EAAAgF,OAQAhF,EAAAW,IAAAX,EAAAgF,OAOAhF,EAAA6C,IAAA,WACA,MAAA7F,IAAAtC,KAAA4B,KAAA5B,KAAA6B,KAAA7B,KAAA8B,WASAwD,EAAAkF,IAAA,SAAAxD,GAGA,MAFAjF,GAAAiF,KACAA,EAAAzC,EAAAyC,IACA1E,EAAAtC,KAAA4B,IAAAoF,EAAApF,IAAA5B,KAAA6B,KAAAmF,EAAAnF,KAAA7B,KAAA8B,WASAwD,EAAAmF,GAAA,SAAAzD,GAGA,MAFAjF,GAAAiF,KACAA,EAAAzC,EAAAyC,IACA1E,EAAAtC,KAAA4B,IAAAoF,EAAApF,IAAA5B,KAAA6B,KAAAmF,EAAAnF,KAAA7B,KAAA8B,WASAwD,EAAAoF,IAAA,SAAA1D,GAGA,MAFAjF,GAAAiF,KACAA,EAAAzC,EAAAyC,IACA1E,EAAAtC,KAAA4B,IAAAoF,EAAApF,IAAA5B,KAAA6B,KAAAmF,EAAAnF,KAAA7B,KAAA8B,WASAwD,EAAAqF,UAAA,SAAAC,GAGA,MAFA7I,GAAA6I,KACAA,IAAArF,SACA,IAAAqF,GAAA,IACA5K,KACA4K,EAAA,GACAtI,EAAAtC,KAAA4B,KAAAgJ,EAAA5K,KAAA6B,MAAA+I,EAAA5K,KAAA4B,MAAA,GAAAgJ,EAAA5K,KAAA8B,UAEAQ,EAAA,EAAAtC,KAAA4B,KAAAgJ,EAAA,GAAA5K,KAAA8B,WASAwD,EAAAsE,IAAAtE,EAAAqF,UAQArF,EAAAuF,WAAA,SAAAD,GAGA,MAFA7I,GAAA6I,KACAA,IAAArF,SACA,IAAAqF,GAAA,IACA5K,KACA4K,EAAA,GACAtI,EAAAtC,KAAA4B,MAAAgJ,EAAA5K,KAAA6B,MAAA,GAAA+I,EAAA5K,KAAA6B,MAAA+I,EAAA5K,KAAA8B,UAEAQ,EAAAtC,KAAA6B,MAAA+I,EAAA,GAAA5K,KAAA6B,MAAA,OAAA7B,KAAA8B,WASAwD,EAAAqE,IAAArE,EAAAuF,WAQAvF,EAAAwF,mBAAA,SAAAF,GAEA,MADA7I,GAAA6I,SAAArF,SACA,IAAAqF,GAAA,IAAA5K,KACA4K,EAAA,GAAAtI,EAAAtC,KAAA4B,MAAAgJ,EAAA5K,KAAA6B,MAAA,GAAA+I,EAAA5K,KAAA6B,OAAA+I,EAAA5K,KAAA8B,UACA,KAAA8I,EAAAtI,EAAAtC,KAAA6B,KAAA,EAAA7B,KAAA8B,UACAQ,EAAAtC,KAAA6B,OAAA+I,EAAA,KAAA5K,KAAA8B,WASAwD,EAAAoE,KAAApE,EAAAwF,mBAQAxF,EAAAyF,MAAAzF,EAAAwF,mBAQAxF,EAAA0F,WAAA,SAAAJ,GACA,GAAAK,EAEA,OADAlJ,GAAA6I,SAAArF,SACA,IAAAqF,GAAA,IAAA5K,KACA,KAAA4K,EAAAtI,EAAAtC,KAAA6B,KAAA7B,KAAA4B,IAAA5B,KAAA8B,UACA8I,EAAA,IACAK,EAAA,GAAAL,EACAtI,EAAAtC,KAAA4B,KAAAgJ,EAAA5K,KAAA6B,OAAAoJ,EAAAjL,KAAA6B,MAAA+I,EAAA5K,KAAA4B,MAAAqJ,EAAAjL,KAAA8B,YAEA8I,GAAA,GACAK,EAAA,GAAAL,EACAtI,EAAAtC,KAAA6B,MAAA+I,EAAA5K,KAAA4B,MAAAqJ,EAAAjL,KAAA4B,KAAAgJ,EAAA5K,KAAA6B,OAAAoJ,EAAAjL,KAAA8B,YAQAwD,EAAA4F,KAAA5F,EAAA0F,WAQA1F,EAAA6F,YAAA,SAAAP,GACA,GAAAK,EAEA,OADAlJ,GAAA6I,SAAArF,SACA,IAAAqF,GAAA,IAAA5K,KACA,KAAA4K,EAAAtI,EAAAtC,KAAA6B,KAAA7B,KAAA4B,IAAA5B,KAAA8B,UACA8I,EAAA,IACAK,EAAA,GAAAL,EACAtI,EAAAtC,KAAA6B,MAAAoJ,EAAAjL,KAAA4B,MAAAgJ,EAAA5K,KAAA4B,KAAAqJ,EAAAjL,KAAA6B,OAAA+I,EAAA5K,KAAA8B,YAEA8I,GAAA,GACAK,EAAA,GAAAL,EACAtI,EAAAtC,KAAA4B,KAAAqJ,EAAAjL,KAAA6B,OAAA+I,EAAA5K,KAAA6B,MAAAoJ,EAAAjL,KAAA4B,MAAAgJ,EAAA5K,KAAA8B,YAQAwD,EAAA8F,KAAA9F,EAAA6F,YAOA7F,EAAA+F,SAAA,WACA,MAAArL,MAAA8B,SAEAQ,EAAAtC,KAAA4B,IAAA5B,KAAA6B,MAAA,GADA7B,MASAsF,EAAAmE,WAAA,WACA,MAAAzJ,MAAA8B,SACA9B,KACAsC,EAAAtC,KAAA4B,IAAA5B,KAAA6B,MAAA,IASAyD,EAAAgG,QAAA,SAAA7D,GACA,MAAAA,GAAAzH,KAAAuL,YAAAvL,KAAAwL,aAQAlG,EAAAiG,UAAA,WACA,GAAAE,GAAAzL,KAAA6B,KACA6J,EAAA1L,KAAA4B,GACA,QACA,IAAA8J,EACAA,IAAA,MACAA,IAAA,OACAA,IAAA,GACA,IAAAD,EACAA,IAAA,MACAA,IAAA,OACAA,IAAA,KASAnG,EAAAkG,UAAA,WACA,GAAAC,GAAAzL,KAAA6B,KACA6J,EAAA1L,KAAA4B,GACA,QACA6J,IAAA,GACAA,IAAA,OACAA,IAAA,MACA,IAAAA,EACAC,IAAA,GACAA,IAAA,OACAA,IAAA,MACA,IAAAA,IAWA/J,EAAAgK,UAAA,SAAAC,EAAA9J,EAAA2F,GACA,MAAAA,GAAA9F,EAAAkK,YAAAD,EAAA9J,GAAAH,EAAAmK,YAAAF,EAAA9J,IASAH,EAAAkK,YAAA,SAAAD,EAAA9J,GACA,UAAAH,GACAiK,EAAA,GACAA,EAAA,MACAA,EAAA,OACAA,EAAA,OACAA,EAAA,GACAA,EAAA,MACAA,EAAA,OACAA,EAAA,OACA9J,IAUAH,EAAAmK,YAAA,SAAAF,EAAA9J,GACA,UAAAH,GACAiK,EAAA,OACAA,EAAA,OACAA,EAAA,MACAA,EAAA,GACAA,EAAA,OACAA,EAAA,OACAA,EAAA,MACAA,EAAA,GACA9J","file":"long.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Long\"] = factory();\n\telse\n\t\troot[\"Long\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Long\"] = factory();\n\telse\n\t\troot[\"Long\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = Long;\n\n/**\n * wasm optimizations, to do native i64 multiplication and divide\n */\nvar wasm = null;\n\ntry {\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\n ])), {}).exports;\n} catch (e) {\n // no wasm support :(\n}\n\n/**\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\n * See the from* functions below for more convenient ways of constructing Longs.\n * @exports Long\n * @class A Long class for representing a 64 bit two's-complement integer value.\n * @param {number} low The low (signed) 32 bits of the long\n * @param {number} high The high (signed) 32 bits of the long\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @constructor\n */\nfunction Long(low, high, unsigned) {\n\n /**\n * The low 32 bits as a signed value.\n * @type {number}\n */\n this.low = low | 0;\n\n /**\n * The high 32 bits as a signed value.\n * @type {number}\n */\n this.high = high | 0;\n\n /**\n * Whether unsigned or not.\n * @type {boolean}\n */\n this.unsigned = !!unsigned;\n}\n\n// The internal representation of a long is the two given signed, 32-bit values.\n// We use 32-bit pieces because these are the size of integers on which\n// Javascript performs bit-operations. For operations like addition and\n// multiplication, we split each number into 16 bit pieces, which can easily be\n// multiplied within Javascript's floating-point representation without overflow\n// or change in sign.\n//\n// In the algorithms below, we frequently reduce the negative case to the\n// positive case by negating the input(s) and then post-processing the result.\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n// a positive number, it overflows back into a negative). Not handling this\n// case would often result in infinite recursion.\n//\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\n// methods on which they depend.\n\n/**\n * An indicator used to reliably determine if an object is a Long or not.\n * @type {boolean}\n * @const\n * @private\n */\nLong.prototype.__isLong__;\n\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\n\n/**\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n * @inner\n */\nfunction isLong(obj) {\n return (obj && obj[\"__isLong__\"]) === true;\n}\n\n/**\n * Tests if the specified object is a Long.\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n */\nLong.isLong = isLong;\n\n/**\n * A cache of the Long representations of small integer values.\n * @type {!Object}\n * @inner\n */\nvar INT_CACHE = {};\n\n/**\n * A cache of the Long representations of small unsigned integer values.\n * @type {!Object}\n * @inner\n */\nvar UINT_CACHE = {};\n\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromInt(value, unsigned) {\n var obj, cachedObj, cache;\n if (unsigned) {\n value >>>= 0;\n if (cache = (0 <= value && value < 256)) {\n cachedObj = UINT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\n if (cache)\n UINT_CACHE[value] = obj;\n return obj;\n } else {\n value |= 0;\n if (cache = (-128 <= value && value < 128)) {\n cachedObj = INT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, value < 0 ? -1 : 0, false);\n if (cache)\n INT_CACHE[value] = obj;\n return obj;\n }\n}\n\n/**\n * Returns a Long representing the given 32 bit integer value.\n * @function\n * @param {number} value The 32 bit integer in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromInt = fromInt;\n\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromNumber(value, unsigned) {\n if (isNaN(value))\n return unsigned ? UZERO : ZERO;\n if (unsigned) {\n if (value < 0)\n return UZERO;\n if (value >= TWO_PWR_64_DBL)\n return MAX_UNSIGNED_VALUE;\n } else {\n if (value <= -TWO_PWR_63_DBL)\n return MIN_VALUE;\n if (value + 1 >= TWO_PWR_63_DBL)\n return MAX_VALUE;\n }\n if (value < 0)\n return fromNumber(-value, unsigned).neg();\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\n}\n\n/**\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\n * @function\n * @param {number} value The number in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromNumber = fromNumber;\n\n/**\n * @param {number} lowBits\n * @param {number} highBits\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromBits(lowBits, highBits, unsigned) {\n return new Long(lowBits, highBits, unsigned);\n}\n\n/**\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\n * assumed to use 32 bits.\n * @function\n * @param {number} lowBits The low 32 bits\n * @param {number} highBits The high 32 bits\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromBits = fromBits;\n\n/**\n * @function\n * @param {number} base\n * @param {number} exponent\n * @returns {number}\n * @inner\n */\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\n\n/**\n * @param {string} str\n * @param {(boolean|number)=} unsigned\n * @param {number=} radix\n * @returns {!Long}\n * @inner\n */\nfunction fromString(str, unsigned, radix) {\n if (str.length === 0)\n throw Error('empty string');\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\n return ZERO;\n if (typeof unsigned === 'number') {\n // For goog.math.long compatibility\n radix = unsigned,\n unsigned = false;\n } else {\n unsigned = !! unsigned;\n }\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n\n var p;\n if ((p = str.indexOf('-')) > 0)\n throw Error('interior hyphen');\n else if (p === 0) {\n return fromString(str.substring(1), unsigned, radix).neg();\n }\n\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 8));\n\n var result = ZERO;\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i),\n value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = fromNumber(pow_dbl(radix, size));\n result = result.mul(power).add(fromNumber(value));\n } else {\n result = result.mul(radixToPower);\n result = result.add(fromNumber(value));\n }\n }\n result.unsigned = unsigned;\n return result;\n}\n\n/**\n * Returns a Long representation of the given string, written using the specified radix.\n * @function\n * @param {string} str The textual representation of the Long\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\n * @returns {!Long} The corresponding Long value\n */\nLong.fromString = fromString;\n\n/**\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromValue(val, unsigned) {\n if (typeof val === 'number')\n return fromNumber(val, unsigned);\n if (typeof val === 'string')\n return fromString(val, unsigned);\n // Throws for non-objects, converts non-instanceof Long:\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\n}\n\n/**\n * Converts the specified value to a Long using the appropriate from* function for its type.\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long}\n */\nLong.fromValue = fromValue;\n\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\n// no runtime penalty for these.\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_16_DBL = 1 << 16;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_24_DBL = 1 << 24;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\n\n/**\n * @type {!Long}\n * @const\n * @inner\n */\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\n\n/**\n * @type {!Long}\n * @inner\n */\nvar ZERO = fromInt(0);\n\n/**\n * Signed zero.\n * @type {!Long}\n */\nLong.ZERO = ZERO;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar UZERO = fromInt(0, true);\n\n/**\n * Unsigned zero.\n * @type {!Long}\n */\nLong.UZERO = UZERO;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar ONE = fromInt(1);\n\n/**\n * Signed one.\n * @type {!Long}\n */\nLong.ONE = ONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar UONE = fromInt(1, true);\n\n/**\n * Unsigned one.\n * @type {!Long}\n */\nLong.UONE = UONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar NEG_ONE = fromInt(-1);\n\n/**\n * Signed negative one.\n * @type {!Long}\n */\nLong.NEG_ONE = NEG_ONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);\n\n/**\n * Maximum signed value.\n * @type {!Long}\n */\nLong.MAX_VALUE = MAX_VALUE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);\n\n/**\n * Maximum unsigned value.\n * @type {!Long}\n */\nLong.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MIN_VALUE = fromBits(0, 0x80000000|0, false);\n\n/**\n * Minimum signed value.\n * @type {!Long}\n */\nLong.MIN_VALUE = MIN_VALUE;\n\n/**\n * @alias Long.prototype\n * @inner\n */\nvar LongPrototype = Long.prototype;\n\n/**\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.toInt = function toInt() {\n return this.unsigned ? this.low >>> 0 : this.low;\n};\n\n/**\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.toNumber = function toNumber() {\n if (this.unsigned)\n return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\n};\n\n/**\n * Converts the Long to a string written in the specified radix.\n * @this {!Long}\n * @param {number=} radix Radix (2-36), defaults to 10\n * @returns {string}\n * @override\n * @throws {RangeError} If `radix` is out of range\n */\nLongPrototype.toString = function toString(radix) {\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n if (this.isZero())\n return '0';\n if (this.isNegative()) { // Unsigned Longs are never negative\n if (this.eq(MIN_VALUE)) {\n // We need to change the Long value before it can be negated, so we remove\n // the bottom-most digit in this base and then recurse to do the rest.\n var radixLong = fromNumber(radix),\n div = this.div(radixLong),\n rem1 = div.mul(radixLong).sub(this);\n return div.toString(radix) + rem1.toInt().toString(radix);\n } else\n return '-' + this.neg().toString(radix);\n }\n\n // Do several (6) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\n rem = this;\n var result = '';\n while (true) {\n var remDiv = rem.div(radixToPower),\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\n digits = intval.toString(radix);\n rem = remDiv;\n if (rem.isZero())\n return digits + result;\n else {\n while (digits.length < 6)\n digits = '0' + digits;\n result = '' + digits + result;\n }\n }\n};\n\n/**\n * Gets the high 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed high bits\n */\nLongPrototype.getHighBits = function getHighBits() {\n return this.high;\n};\n\n/**\n * Gets the high 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned high bits\n */\nLongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\n return this.high >>> 0;\n};\n\n/**\n * Gets the low 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed low bits\n */\nLongPrototype.getLowBits = function getLowBits() {\n return this.low;\n};\n\n/**\n * Gets the low 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned low bits\n */\nLongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\n return this.low >>> 0;\n};\n\n/**\n * Gets the number of bits needed to represent the absolute value of this Long.\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.getNumBitsAbs = function getNumBitsAbs() {\n if (this.isNegative()) // Unsigned Longs are never negative\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\n var val = this.high != 0 ? this.high : this.low;\n for (var bit = 31; bit > 0; bit--)\n if ((val & (1 << bit)) != 0)\n break;\n return this.high != 0 ? bit + 33 : bit + 1;\n};\n\n/**\n * Tests if this Long's value equals zero.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isZero = function isZero() {\n return this.high === 0 && this.low === 0;\n};\n\n/**\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\n * @returns {boolean}\n */\nLongPrototype.eqz = LongPrototype.isZero;\n\n/**\n * Tests if this Long's value is negative.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isNegative = function isNegative() {\n return !this.unsigned && this.high < 0;\n};\n\n/**\n * Tests if this Long's value is positive.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isPositive = function isPositive() {\n return this.unsigned || this.high >= 0;\n};\n\n/**\n * Tests if this Long's value is odd.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isOdd = function isOdd() {\n return (this.low & 1) === 1;\n};\n\n/**\n * Tests if this Long's value is even.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isEven = function isEven() {\n return (this.low & 1) === 0;\n};\n\n/**\n * Tests if this Long's value equals the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.equals = function equals(other) {\n if (!isLong(other))\n other = fromValue(other);\n if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\n return false;\n return this.high === other.high && this.low === other.low;\n};\n\n/**\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.eq = LongPrototype.equals;\n\n/**\n * Tests if this Long's value differs from the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.notEquals = function notEquals(other) {\n return !this.eq(/* validates */ other);\n};\n\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.neq = LongPrototype.notEquals;\n\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.ne = LongPrototype.notEquals;\n\n/**\n * Tests if this Long's value is less than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lessThan = function lessThan(other) {\n return this.comp(/* validates */ other) < 0;\n};\n\n/**\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lt = LongPrototype.lessThan;\n\n/**\n * Tests if this Long's value is less than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\n return this.comp(/* validates */ other) <= 0;\n};\n\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lte = LongPrototype.lessThanOrEqual;\n\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.le = LongPrototype.lessThanOrEqual;\n\n/**\n * Tests if this Long's value is greater than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.greaterThan = function greaterThan(other) {\n return this.comp(/* validates */ other) > 0;\n};\n\n/**\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.gt = LongPrototype.greaterThan;\n\n/**\n * Tests if this Long's value is greater than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\n return this.comp(/* validates */ other) >= 0;\n};\n\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.gte = LongPrototype.greaterThanOrEqual;\n\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.ge = LongPrototype.greaterThanOrEqual;\n\n/**\n * Compares this Long's value with the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\nLongPrototype.compare = function compare(other) {\n if (!isLong(other))\n other = fromValue(other);\n if (this.eq(other))\n return 0;\n var thisNeg = this.isNegative(),\n otherNeg = other.isNegative();\n if (thisNeg && !otherNeg)\n return -1;\n if (!thisNeg && otherNeg)\n return 1;\n // At this point the sign bits are the same\n if (!this.unsigned)\n return this.sub(other).isNegative() ? -1 : 1;\n // Both are positive if at least one is unsigned\n return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\n};\n\n/**\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\nLongPrototype.comp = LongPrototype.compare;\n\n/**\n * Negates this Long's value.\n * @this {!Long}\n * @returns {!Long} Negated Long\n */\nLongPrototype.negate = function negate() {\n if (!this.unsigned && this.eq(MIN_VALUE))\n return MIN_VALUE;\n return this.not().add(ONE);\n};\n\n/**\n * Negates this Long's value. This is an alias of {@link Long#negate}.\n * @function\n * @returns {!Long} Negated Long\n */\nLongPrototype.neg = LongPrototype.negate;\n\n/**\n * Returns the sum of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} addend Addend\n * @returns {!Long} Sum\n */\nLongPrototype.add = function add(addend) {\n if (!isLong(addend))\n addend = fromValue(addend);\n\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n\n var a48 = this.high >>> 16;\n var a32 = this.high & 0xFFFF;\n var a16 = this.low >>> 16;\n var a00 = this.low & 0xFFFF;\n\n var b48 = addend.high >>> 16;\n var b32 = addend.high & 0xFFFF;\n var b16 = addend.low >>> 16;\n var b00 = addend.low & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 + b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\n};\n\n/**\n * Returns the difference of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\nLongPrototype.subtract = function subtract(subtrahend) {\n if (!isLong(subtrahend))\n subtrahend = fromValue(subtrahend);\n return this.add(subtrahend.neg());\n};\n\n/**\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\n * @function\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\nLongPrototype.sub = LongPrototype.subtract;\n\n/**\n * Returns the product of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\nLongPrototype.multiply = function multiply(multiplier) {\n if (this.isZero())\n return ZERO;\n if (!isLong(multiplier))\n multiplier = fromValue(multiplier);\n\n // use wasm support if present\n if (wasm) {\n var low = wasm[\"mul\"](this.low,\n this.high,\n multiplier.low,\n multiplier.high);\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n\n if (multiplier.isZero())\n return ZERO;\n if (this.eq(MIN_VALUE))\n return multiplier.isOdd() ? MIN_VALUE : ZERO;\n if (multiplier.eq(MIN_VALUE))\n return this.isOdd() ? MIN_VALUE : ZERO;\n\n if (this.isNegative()) {\n if (multiplier.isNegative())\n return this.neg().mul(multiplier.neg());\n else\n return this.neg().mul(multiplier).neg();\n } else if (multiplier.isNegative())\n return this.mul(multiplier.neg()).neg();\n\n // If both longs are small, use float multiplication\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\n return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\n\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n // We can skip products that would overflow.\n\n var a48 = this.high >>> 16;\n var a32 = this.high & 0xFFFF;\n var a16 = this.low >>> 16;\n var a00 = this.low & 0xFFFF;\n\n var b48 = multiplier.high >>> 16;\n var b32 = multiplier.high & 0xFFFF;\n var b16 = multiplier.low >>> 16;\n var b00 = multiplier.low & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\n};\n\n/**\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\n * @function\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\nLongPrototype.mul = LongPrototype.multiply;\n\n/**\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\n * unsigned if this Long is unsigned.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\nLongPrototype.divide = function divide(divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n if (divisor.isZero())\n throw Error('division by zero');\n\n // use wasm support if present\n if (wasm) {\n // guard against signed division overflow: the largest\n // negative number / -1 would be 1 larger than the largest\n // positive number, due to two's complement.\n if (!this.unsigned &&\n this.high === -0x80000000 &&\n divisor.low === -1 && divisor.high === -1) {\n // be consistent with non-wasm code path\n return this;\n }\n var low = (this.unsigned ? wasm[\"div_u\"] : wasm[\"div_s\"])(\n this.low,\n this.high,\n divisor.low,\n divisor.high\n );\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n\n if (this.isZero())\n return this.unsigned ? UZERO : ZERO;\n var approx, rem, res;\n if (!this.unsigned) {\n // This section is only relevant for signed longs and is derived from the\n // closure library as a whole.\n if (this.eq(MIN_VALUE)) {\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\n else if (divisor.eq(MIN_VALUE))\n return ONE;\n else {\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n var halfThis = this.shr(1);\n approx = halfThis.div(divisor).shl(1);\n if (approx.eq(ZERO)) {\n return divisor.isNegative() ? ONE : NEG_ONE;\n } else {\n rem = this.sub(divisor.mul(approx));\n res = approx.add(rem.div(divisor));\n return res;\n }\n }\n } else if (divisor.eq(MIN_VALUE))\n return this.unsigned ? UZERO : ZERO;\n if (this.isNegative()) {\n if (divisor.isNegative())\n return this.neg().div(divisor.neg());\n return this.neg().div(divisor).neg();\n } else if (divisor.isNegative())\n return this.div(divisor.neg()).neg();\n res = ZERO;\n } else {\n // The algorithm below has not been made for unsigned longs. It's therefore\n // required to take special care of the MSB prior to running it.\n if (!divisor.unsigned)\n divisor = divisor.toUnsigned();\n if (divisor.gt(this))\n return UZERO;\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\n return UONE;\n res = UZERO;\n }\n\n // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n rem = this;\n while (rem.gte(divisor)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\n\n // We will tweak the approximate result by changing it in the 48-th digit or\n // the smallest non-fractional digit, whichever is larger.\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\n delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\n\n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n approxRes = fromNumber(approx),\n approxRem = approxRes.mul(divisor);\n while (approxRem.isNegative() || approxRem.gt(rem)) {\n approx -= delta;\n approxRes = fromNumber(approx, this.unsigned);\n approxRem = approxRes.mul(divisor);\n }\n\n // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n if (approxRes.isZero())\n approxRes = ONE;\n\n res = res.add(approxRes);\n rem = rem.sub(approxRem);\n }\n return res;\n};\n\n/**\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\nLongPrototype.div = LongPrototype.divide;\n\n/**\n * Returns this Long modulo the specified.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.modulo = function modulo(divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n\n // use wasm support if present\n if (wasm) {\n var low = (this.unsigned ? wasm[\"rem_u\"] : wasm[\"rem_s\"])(\n this.low,\n this.high,\n divisor.low,\n divisor.high\n );\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n\n return this.sub(this.div(divisor).mul(divisor));\n};\n\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.mod = LongPrototype.modulo;\n\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.rem = LongPrototype.modulo;\n\n/**\n * Returns the bitwise NOT of this Long.\n * @this {!Long}\n * @returns {!Long}\n */\nLongPrototype.not = function not() {\n return fromBits(~this.low, ~this.high, this.unsigned);\n};\n\n/**\n * Returns the bitwise AND of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.and = function and(other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\n};\n\n/**\n * Returns the bitwise OR of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.or = function or(other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\n};\n\n/**\n * Returns the bitwise XOR of this Long and the given one.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.xor = function xor(other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\n};\n\n/**\n * Returns this Long with bits shifted to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftLeft = function shiftLeft(numBits) {\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n else if (numBits < 32)\n return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\n else\n return fromBits(0, this.low << (numBits - 32), this.unsigned);\n};\n\n/**\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shl = LongPrototype.shiftLeft;\n\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftRight = function shiftRight(numBits) {\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n else if (numBits < 32)\n return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\n else\n return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\n};\n\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shr = LongPrototype.shiftRight;\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits < 32) return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >>> numBits, this.unsigned);\n if (numBits === 32) return fromBits(this.high, 0, this.unsigned);\n return fromBits(this.high >>> (numBits - 32), 0, this.unsigned);\n};\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shru = LongPrototype.shiftRightUnsigned;\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\n\n/**\n * Returns this Long with bits rotated to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotateLeft = function rotateLeft(numBits) {\n var b;\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.low << numBits) | (this.high >>> b)), ((this.high << numBits) | (this.low >>> b)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.high << numBits) | (this.low >>> b)), ((this.low << numBits) | (this.high >>> b)), this.unsigned);\n}\n/**\n * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotl = LongPrototype.rotateLeft;\n\n/**\n * Returns this Long with bits rotated to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotateRight = function rotateRight(numBits) {\n var b;\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.high << b) | (this.low >>> numBits)), ((this.low << b) | (this.high >>> numBits)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.low << b) | (this.high >>> numBits)), ((this.high << b) | (this.low >>> numBits)), this.unsigned);\n}\n/**\n * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotr = LongPrototype.rotateRight;\n\n/**\n * Converts this Long to signed.\n * @this {!Long}\n * @returns {!Long} Signed long\n */\nLongPrototype.toSigned = function toSigned() {\n if (!this.unsigned)\n return this;\n return fromBits(this.low, this.high, false);\n};\n\n/**\n * Converts this Long to unsigned.\n * @this {!Long}\n * @returns {!Long} Unsigned long\n */\nLongPrototype.toUnsigned = function toUnsigned() {\n if (this.unsigned)\n return this;\n return fromBits(this.low, this.high, true);\n};\n\n/**\n * Converts this Long to its byte representation.\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @this {!Long}\n * @returns {!Array.} Byte representation\n */\nLongPrototype.toBytes = function toBytes(le) {\n return le ? this.toBytesLE() : this.toBytesBE();\n};\n\n/**\n * Converts this Long to its little endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Little endian byte representation\n */\nLongPrototype.toBytesLE = function toBytesLE() {\n var hi = this.high,\n lo = this.low;\n return [\n lo & 0xff,\n lo >>> 8 & 0xff,\n lo >>> 16 & 0xff,\n lo >>> 24 ,\n hi & 0xff,\n hi >>> 8 & 0xff,\n hi >>> 16 & 0xff,\n hi >>> 24\n ];\n};\n\n/**\n * Converts this Long to its big endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Big endian byte representation\n */\nLongPrototype.toBytesBE = function toBytesBE() {\n var hi = this.high,\n lo = this.low;\n return [\n hi >>> 24 ,\n hi >>> 16 & 0xff,\n hi >>> 8 & 0xff,\n hi & 0xff,\n lo >>> 24 ,\n lo >>> 16 & 0xff,\n lo >>> 8 & 0xff,\n lo & 0xff\n ];\n};\n\n/**\n * Creates a Long from its byte representation.\n * @param {!Array.} bytes Byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytes = function fromBytes(bytes, unsigned, le) {\n return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);\n};\n\n/**\n * Creates a Long from its little endian byte representation.\n * @param {!Array.} bytes Little endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytesLE = function fromBytesLE(bytes, unsigned) {\n return new Long(\n bytes[0] |\n bytes[1] << 8 |\n bytes[2] << 16 |\n bytes[3] << 24,\n bytes[4] |\n bytes[5] << 8 |\n bytes[6] << 16 |\n bytes[7] << 24,\n unsigned\n );\n};\n\n/**\n * Creates a Long from its big endian byte representation.\n * @param {!Array.} bytes Big endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytesBE = function fromBytesBE(bytes, unsigned) {\n return new Long(\n bytes[4] << 24 |\n bytes[5] << 16 |\n bytes[6] << 8 |\n bytes[7],\n bytes[0] << 24 |\n bytes[1] << 16 |\n bytes[2] << 8 |\n bytes[3],\n unsigned\n );\n};\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// long.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f96e8d1360c0487f2545","module.exports = Long;\n\n/**\n * wasm optimizations, to do native i64 multiplication and divide\n */\nvar wasm = null;\n\ntry {\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\n ])), {}).exports;\n} catch (e) {\n // no wasm support :(\n}\n\n/**\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\n * See the from* functions below for more convenient ways of constructing Longs.\n * @exports Long\n * @class A Long class for representing a 64 bit two's-complement integer value.\n * @param {number} low The low (signed) 32 bits of the long\n * @param {number} high The high (signed) 32 bits of the long\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @constructor\n */\nfunction Long(low, high, unsigned) {\n\n /**\n * The low 32 bits as a signed value.\n * @type {number}\n */\n this.low = low | 0;\n\n /**\n * The high 32 bits as a signed value.\n * @type {number}\n */\n this.high = high | 0;\n\n /**\n * Whether unsigned or not.\n * @type {boolean}\n */\n this.unsigned = !!unsigned;\n}\n\n// The internal representation of a long is the two given signed, 32-bit values.\n// We use 32-bit pieces because these are the size of integers on which\n// Javascript performs bit-operations. For operations like addition and\n// multiplication, we split each number into 16 bit pieces, which can easily be\n// multiplied within Javascript's floating-point representation without overflow\n// or change in sign.\n//\n// In the algorithms below, we frequently reduce the negative case to the\n// positive case by negating the input(s) and then post-processing the result.\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n// a positive number, it overflows back into a negative). Not handling this\n// case would often result in infinite recursion.\n//\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\n// methods on which they depend.\n\n/**\n * An indicator used to reliably determine if an object is a Long or not.\n * @type {boolean}\n * @const\n * @private\n */\nLong.prototype.__isLong__;\n\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\n\n/**\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n * @inner\n */\nfunction isLong(obj) {\n return (obj && obj[\"__isLong__\"]) === true;\n}\n\n/**\n * Tests if the specified object is a Long.\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n */\nLong.isLong = isLong;\n\n/**\n * A cache of the Long representations of small integer values.\n * @type {!Object}\n * @inner\n */\nvar INT_CACHE = {};\n\n/**\n * A cache of the Long representations of small unsigned integer values.\n * @type {!Object}\n * @inner\n */\nvar UINT_CACHE = {};\n\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromInt(value, unsigned) {\n var obj, cachedObj, cache;\n if (unsigned) {\n value >>>= 0;\n if (cache = (0 <= value && value < 256)) {\n cachedObj = UINT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\n if (cache)\n UINT_CACHE[value] = obj;\n return obj;\n } else {\n value |= 0;\n if (cache = (-128 <= value && value < 128)) {\n cachedObj = INT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, value < 0 ? -1 : 0, false);\n if (cache)\n INT_CACHE[value] = obj;\n return obj;\n }\n}\n\n/**\n * Returns a Long representing the given 32 bit integer value.\n * @function\n * @param {number} value The 32 bit integer in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromInt = fromInt;\n\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromNumber(value, unsigned) {\n if (isNaN(value))\n return unsigned ? UZERO : ZERO;\n if (unsigned) {\n if (value < 0)\n return UZERO;\n if (value >= TWO_PWR_64_DBL)\n return MAX_UNSIGNED_VALUE;\n } else {\n if (value <= -TWO_PWR_63_DBL)\n return MIN_VALUE;\n if (value + 1 >= TWO_PWR_63_DBL)\n return MAX_VALUE;\n }\n if (value < 0)\n return fromNumber(-value, unsigned).neg();\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\n}\n\n/**\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\n * @function\n * @param {number} value The number in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromNumber = fromNumber;\n\n/**\n * @param {number} lowBits\n * @param {number} highBits\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromBits(lowBits, highBits, unsigned) {\n return new Long(lowBits, highBits, unsigned);\n}\n\n/**\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\n * assumed to use 32 bits.\n * @function\n * @param {number} lowBits The low 32 bits\n * @param {number} highBits The high 32 bits\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromBits = fromBits;\n\n/**\n * @function\n * @param {number} base\n * @param {number} exponent\n * @returns {number}\n * @inner\n */\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\n\n/**\n * @param {string} str\n * @param {(boolean|number)=} unsigned\n * @param {number=} radix\n * @returns {!Long}\n * @inner\n */\nfunction fromString(str, unsigned, radix) {\n if (str.length === 0)\n throw Error('empty string');\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\n return ZERO;\n if (typeof unsigned === 'number') {\n // For goog.math.long compatibility\n radix = unsigned,\n unsigned = false;\n } else {\n unsigned = !! unsigned;\n }\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n\n var p;\n if ((p = str.indexOf('-')) > 0)\n throw Error('interior hyphen');\n else if (p === 0) {\n return fromString(str.substring(1), unsigned, radix).neg();\n }\n\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 8));\n\n var result = ZERO;\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i),\n value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = fromNumber(pow_dbl(radix, size));\n result = result.mul(power).add(fromNumber(value));\n } else {\n result = result.mul(radixToPower);\n result = result.add(fromNumber(value));\n }\n }\n result.unsigned = unsigned;\n return result;\n}\n\n/**\n * Returns a Long representation of the given string, written using the specified radix.\n * @function\n * @param {string} str The textual representation of the Long\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\n * @returns {!Long} The corresponding Long value\n */\nLong.fromString = fromString;\n\n/**\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromValue(val, unsigned) {\n if (typeof val === 'number')\n return fromNumber(val, unsigned);\n if (typeof val === 'string')\n return fromString(val, unsigned);\n // Throws for non-objects, converts non-instanceof Long:\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\n}\n\n/**\n * Converts the specified value to a Long using the appropriate from* function for its type.\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long}\n */\nLong.fromValue = fromValue;\n\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\n// no runtime penalty for these.\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_16_DBL = 1 << 16;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_24_DBL = 1 << 24;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\n\n/**\n * @type {!Long}\n * @const\n * @inner\n */\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\n\n/**\n * @type {!Long}\n * @inner\n */\nvar ZERO = fromInt(0);\n\n/**\n * Signed zero.\n * @type {!Long}\n */\nLong.ZERO = ZERO;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar UZERO = fromInt(0, true);\n\n/**\n * Unsigned zero.\n * @type {!Long}\n */\nLong.UZERO = UZERO;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar ONE = fromInt(1);\n\n/**\n * Signed one.\n * @type {!Long}\n */\nLong.ONE = ONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar UONE = fromInt(1, true);\n\n/**\n * Unsigned one.\n * @type {!Long}\n */\nLong.UONE = UONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar NEG_ONE = fromInt(-1);\n\n/**\n * Signed negative one.\n * @type {!Long}\n */\nLong.NEG_ONE = NEG_ONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);\n\n/**\n * Maximum signed value.\n * @type {!Long}\n */\nLong.MAX_VALUE = MAX_VALUE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);\n\n/**\n * Maximum unsigned value.\n * @type {!Long}\n */\nLong.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MIN_VALUE = fromBits(0, 0x80000000|0, false);\n\n/**\n * Minimum signed value.\n * @type {!Long}\n */\nLong.MIN_VALUE = MIN_VALUE;\n\n/**\n * @alias Long.prototype\n * @inner\n */\nvar LongPrototype = Long.prototype;\n\n/**\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.toInt = function toInt() {\n return this.unsigned ? this.low >>> 0 : this.low;\n};\n\n/**\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.toNumber = function toNumber() {\n if (this.unsigned)\n return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\n};\n\n/**\n * Converts the Long to a string written in the specified radix.\n * @this {!Long}\n * @param {number=} radix Radix (2-36), defaults to 10\n * @returns {string}\n * @override\n * @throws {RangeError} If `radix` is out of range\n */\nLongPrototype.toString = function toString(radix) {\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n if (this.isZero())\n return '0';\n if (this.isNegative()) { // Unsigned Longs are never negative\n if (this.eq(MIN_VALUE)) {\n // We need to change the Long value before it can be negated, so we remove\n // the bottom-most digit in this base and then recurse to do the rest.\n var radixLong = fromNumber(radix),\n div = this.div(radixLong),\n rem1 = div.mul(radixLong).sub(this);\n return div.toString(radix) + rem1.toInt().toString(radix);\n } else\n return '-' + this.neg().toString(radix);\n }\n\n // Do several (6) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\n rem = this;\n var result = '';\n while (true) {\n var remDiv = rem.div(radixToPower),\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\n digits = intval.toString(radix);\n rem = remDiv;\n if (rem.isZero())\n return digits + result;\n else {\n while (digits.length < 6)\n digits = '0' + digits;\n result = '' + digits + result;\n }\n }\n};\n\n/**\n * Gets the high 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed high bits\n */\nLongPrototype.getHighBits = function getHighBits() {\n return this.high;\n};\n\n/**\n * Gets the high 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned high bits\n */\nLongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\n return this.high >>> 0;\n};\n\n/**\n * Gets the low 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed low bits\n */\nLongPrototype.getLowBits = function getLowBits() {\n return this.low;\n};\n\n/**\n * Gets the low 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned low bits\n */\nLongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\n return this.low >>> 0;\n};\n\n/**\n * Gets the number of bits needed to represent the absolute value of this Long.\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.getNumBitsAbs = function getNumBitsAbs() {\n if (this.isNegative()) // Unsigned Longs are never negative\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\n var val = this.high != 0 ? this.high : this.low;\n for (var bit = 31; bit > 0; bit--)\n if ((val & (1 << bit)) != 0)\n break;\n return this.high != 0 ? bit + 33 : bit + 1;\n};\n\n/**\n * Tests if this Long's value equals zero.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isZero = function isZero() {\n return this.high === 0 && this.low === 0;\n};\n\n/**\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\n * @returns {boolean}\n */\nLongPrototype.eqz = LongPrototype.isZero;\n\n/**\n * Tests if this Long's value is negative.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isNegative = function isNegative() {\n return !this.unsigned && this.high < 0;\n};\n\n/**\n * Tests if this Long's value is positive.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isPositive = function isPositive() {\n return this.unsigned || this.high >= 0;\n};\n\n/**\n * Tests if this Long's value is odd.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isOdd = function isOdd() {\n return (this.low & 1) === 1;\n};\n\n/**\n * Tests if this Long's value is even.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isEven = function isEven() {\n return (this.low & 1) === 0;\n};\n\n/**\n * Tests if this Long's value equals the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.equals = function equals(other) {\n if (!isLong(other))\n other = fromValue(other);\n if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\n return false;\n return this.high === other.high && this.low === other.low;\n};\n\n/**\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.eq = LongPrototype.equals;\n\n/**\n * Tests if this Long's value differs from the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.notEquals = function notEquals(other) {\n return !this.eq(/* validates */ other);\n};\n\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.neq = LongPrototype.notEquals;\n\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.ne = LongPrototype.notEquals;\n\n/**\n * Tests if this Long's value is less than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lessThan = function lessThan(other) {\n return this.comp(/* validates */ other) < 0;\n};\n\n/**\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lt = LongPrototype.lessThan;\n\n/**\n * Tests if this Long's value is less than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\n return this.comp(/* validates */ other) <= 0;\n};\n\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lte = LongPrototype.lessThanOrEqual;\n\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.le = LongPrototype.lessThanOrEqual;\n\n/**\n * Tests if this Long's value is greater than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.greaterThan = function greaterThan(other) {\n return this.comp(/* validates */ other) > 0;\n};\n\n/**\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.gt = LongPrototype.greaterThan;\n\n/**\n * Tests if this Long's value is greater than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\n return this.comp(/* validates */ other) >= 0;\n};\n\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.gte = LongPrototype.greaterThanOrEqual;\n\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.ge = LongPrototype.greaterThanOrEqual;\n\n/**\n * Compares this Long's value with the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\nLongPrototype.compare = function compare(other) {\n if (!isLong(other))\n other = fromValue(other);\n if (this.eq(other))\n return 0;\n var thisNeg = this.isNegative(),\n otherNeg = other.isNegative();\n if (thisNeg && !otherNeg)\n return -1;\n if (!thisNeg && otherNeg)\n return 1;\n // At this point the sign bits are the same\n if (!this.unsigned)\n return this.sub(other).isNegative() ? -1 : 1;\n // Both are positive if at least one is unsigned\n return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\n};\n\n/**\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\nLongPrototype.comp = LongPrototype.compare;\n\n/**\n * Negates this Long's value.\n * @this {!Long}\n * @returns {!Long} Negated Long\n */\nLongPrototype.negate = function negate() {\n if (!this.unsigned && this.eq(MIN_VALUE))\n return MIN_VALUE;\n return this.not().add(ONE);\n};\n\n/**\n * Negates this Long's value. This is an alias of {@link Long#negate}.\n * @function\n * @returns {!Long} Negated Long\n */\nLongPrototype.neg = LongPrototype.negate;\n\n/**\n * Returns the sum of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} addend Addend\n * @returns {!Long} Sum\n */\nLongPrototype.add = function add(addend) {\n if (!isLong(addend))\n addend = fromValue(addend);\n\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n\n var a48 = this.high >>> 16;\n var a32 = this.high & 0xFFFF;\n var a16 = this.low >>> 16;\n var a00 = this.low & 0xFFFF;\n\n var b48 = addend.high >>> 16;\n var b32 = addend.high & 0xFFFF;\n var b16 = addend.low >>> 16;\n var b00 = addend.low & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 + b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\n};\n\n/**\n * Returns the difference of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\nLongPrototype.subtract = function subtract(subtrahend) {\n if (!isLong(subtrahend))\n subtrahend = fromValue(subtrahend);\n return this.add(subtrahend.neg());\n};\n\n/**\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\n * @function\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\nLongPrototype.sub = LongPrototype.subtract;\n\n/**\n * Returns the product of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\nLongPrototype.multiply = function multiply(multiplier) {\n if (this.isZero())\n return ZERO;\n if (!isLong(multiplier))\n multiplier = fromValue(multiplier);\n\n // use wasm support if present\n if (wasm) {\n var low = wasm[\"mul\"](this.low,\n this.high,\n multiplier.low,\n multiplier.high);\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n\n if (multiplier.isZero())\n return ZERO;\n if (this.eq(MIN_VALUE))\n return multiplier.isOdd() ? MIN_VALUE : ZERO;\n if (multiplier.eq(MIN_VALUE))\n return this.isOdd() ? MIN_VALUE : ZERO;\n\n if (this.isNegative()) {\n if (multiplier.isNegative())\n return this.neg().mul(multiplier.neg());\n else\n return this.neg().mul(multiplier).neg();\n } else if (multiplier.isNegative())\n return this.mul(multiplier.neg()).neg();\n\n // If both longs are small, use float multiplication\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\n return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\n\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n // We can skip products that would overflow.\n\n var a48 = this.high >>> 16;\n var a32 = this.high & 0xFFFF;\n var a16 = this.low >>> 16;\n var a00 = this.low & 0xFFFF;\n\n var b48 = multiplier.high >>> 16;\n var b32 = multiplier.high & 0xFFFF;\n var b16 = multiplier.low >>> 16;\n var b00 = multiplier.low & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\n};\n\n/**\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\n * @function\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\nLongPrototype.mul = LongPrototype.multiply;\n\n/**\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\n * unsigned if this Long is unsigned.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\nLongPrototype.divide = function divide(divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n if (divisor.isZero())\n throw Error('division by zero');\n\n // use wasm support if present\n if (wasm) {\n // guard against signed division overflow: the largest\n // negative number / -1 would be 1 larger than the largest\n // positive number, due to two's complement.\n if (!this.unsigned &&\n this.high === -0x80000000 &&\n divisor.low === -1 && divisor.high === -1) {\n // be consistent with non-wasm code path\n return this;\n }\n var low = (this.unsigned ? wasm[\"div_u\"] : wasm[\"div_s\"])(\n this.low,\n this.high,\n divisor.low,\n divisor.high\n );\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n\n if (this.isZero())\n return this.unsigned ? UZERO : ZERO;\n var approx, rem, res;\n if (!this.unsigned) {\n // This section is only relevant for signed longs and is derived from the\n // closure library as a whole.\n if (this.eq(MIN_VALUE)) {\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\n else if (divisor.eq(MIN_VALUE))\n return ONE;\n else {\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n var halfThis = this.shr(1);\n approx = halfThis.div(divisor).shl(1);\n if (approx.eq(ZERO)) {\n return divisor.isNegative() ? ONE : NEG_ONE;\n } else {\n rem = this.sub(divisor.mul(approx));\n res = approx.add(rem.div(divisor));\n return res;\n }\n }\n } else if (divisor.eq(MIN_VALUE))\n return this.unsigned ? UZERO : ZERO;\n if (this.isNegative()) {\n if (divisor.isNegative())\n return this.neg().div(divisor.neg());\n return this.neg().div(divisor).neg();\n } else if (divisor.isNegative())\n return this.div(divisor.neg()).neg();\n res = ZERO;\n } else {\n // The algorithm below has not been made for unsigned longs. It's therefore\n // required to take special care of the MSB prior to running it.\n if (!divisor.unsigned)\n divisor = divisor.toUnsigned();\n if (divisor.gt(this))\n return UZERO;\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\n return UONE;\n res = UZERO;\n }\n\n // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n rem = this;\n while (rem.gte(divisor)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\n\n // We will tweak the approximate result by changing it in the 48-th digit or\n // the smallest non-fractional digit, whichever is larger.\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\n delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\n\n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n approxRes = fromNumber(approx),\n approxRem = approxRes.mul(divisor);\n while (approxRem.isNegative() || approxRem.gt(rem)) {\n approx -= delta;\n approxRes = fromNumber(approx, this.unsigned);\n approxRem = approxRes.mul(divisor);\n }\n\n // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n if (approxRes.isZero())\n approxRes = ONE;\n\n res = res.add(approxRes);\n rem = rem.sub(approxRem);\n }\n return res;\n};\n\n/**\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\nLongPrototype.div = LongPrototype.divide;\n\n/**\n * Returns this Long modulo the specified.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.modulo = function modulo(divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n\n // use wasm support if present\n if (wasm) {\n var low = (this.unsigned ? wasm[\"rem_u\"] : wasm[\"rem_s\"])(\n this.low,\n this.high,\n divisor.low,\n divisor.high\n );\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n\n return this.sub(this.div(divisor).mul(divisor));\n};\n\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.mod = LongPrototype.modulo;\n\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.rem = LongPrototype.modulo;\n\n/**\n * Returns the bitwise NOT of this Long.\n * @this {!Long}\n * @returns {!Long}\n */\nLongPrototype.not = function not() {\n return fromBits(~this.low, ~this.high, this.unsigned);\n};\n\n/**\n * Returns the bitwise AND of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.and = function and(other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\n};\n\n/**\n * Returns the bitwise OR of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.or = function or(other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\n};\n\n/**\n * Returns the bitwise XOR of this Long and the given one.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.xor = function xor(other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\n};\n\n/**\n * Returns this Long with bits shifted to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftLeft = function shiftLeft(numBits) {\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n else if (numBits < 32)\n return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\n else\n return fromBits(0, this.low << (numBits - 32), this.unsigned);\n};\n\n/**\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shl = LongPrototype.shiftLeft;\n\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftRight = function shiftRight(numBits) {\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n else if (numBits < 32)\n return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\n else\n return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\n};\n\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shr = LongPrototype.shiftRight;\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits < 32) return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >>> numBits, this.unsigned);\n if (numBits === 32) return fromBits(this.high, 0, this.unsigned);\n return fromBits(this.high >>> (numBits - 32), 0, this.unsigned);\n};\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shru = LongPrototype.shiftRightUnsigned;\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\n\n/**\n * Returns this Long with bits rotated to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotateLeft = function rotateLeft(numBits) {\n var b;\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.low << numBits) | (this.high >>> b)), ((this.high << numBits) | (this.low >>> b)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.high << numBits) | (this.low >>> b)), ((this.low << numBits) | (this.high >>> b)), this.unsigned);\n}\n/**\n * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotl = LongPrototype.rotateLeft;\n\n/**\n * Returns this Long with bits rotated to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotateRight = function rotateRight(numBits) {\n var b;\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.high << b) | (this.low >>> numBits)), ((this.low << b) | (this.high >>> numBits)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.low << b) | (this.high >>> numBits)), ((this.high << b) | (this.low >>> numBits)), this.unsigned);\n}\n/**\n * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotr = LongPrototype.rotateRight;\n\n/**\n * Converts this Long to signed.\n * @this {!Long}\n * @returns {!Long} Signed long\n */\nLongPrototype.toSigned = function toSigned() {\n if (!this.unsigned)\n return this;\n return fromBits(this.low, this.high, false);\n};\n\n/**\n * Converts this Long to unsigned.\n * @this {!Long}\n * @returns {!Long} Unsigned long\n */\nLongPrototype.toUnsigned = function toUnsigned() {\n if (this.unsigned)\n return this;\n return fromBits(this.low, this.high, true);\n};\n\n/**\n * Converts this Long to its byte representation.\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @this {!Long}\n * @returns {!Array.} Byte representation\n */\nLongPrototype.toBytes = function toBytes(le) {\n return le ? this.toBytesLE() : this.toBytesBE();\n};\n\n/**\n * Converts this Long to its little endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Little endian byte representation\n */\nLongPrototype.toBytesLE = function toBytesLE() {\n var hi = this.high,\n lo = this.low;\n return [\n lo & 0xff,\n lo >>> 8 & 0xff,\n lo >>> 16 & 0xff,\n lo >>> 24 ,\n hi & 0xff,\n hi >>> 8 & 0xff,\n hi >>> 16 & 0xff,\n hi >>> 24\n ];\n};\n\n/**\n * Converts this Long to its big endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Big endian byte representation\n */\nLongPrototype.toBytesBE = function toBytesBE() {\n var hi = this.high,\n lo = this.low;\n return [\n hi >>> 24 ,\n hi >>> 16 & 0xff,\n hi >>> 8 & 0xff,\n hi & 0xff,\n lo >>> 24 ,\n lo >>> 16 & 0xff,\n lo >>> 8 & 0xff,\n lo & 0xff\n ];\n};\n\n/**\n * Creates a Long from its byte representation.\n * @param {!Array.} bytes Byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytes = function fromBytes(bytes, unsigned, le) {\n return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);\n};\n\n/**\n * Creates a Long from its little endian byte representation.\n * @param {!Array.} bytes Little endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytesLE = function fromBytesLE(bytes, unsigned) {\n return new Long(\n bytes[0] |\n bytes[1] << 8 |\n bytes[2] << 16 |\n bytes[3] << 24,\n bytes[4] |\n bytes[5] << 8 |\n bytes[6] << 16 |\n bytes[7] << 24,\n unsigned\n );\n};\n\n/**\n * Creates a Long from its big endian byte representation.\n * @param {!Array.} bytes Big endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytesBE = function fromBytesBE(bytes, unsigned) {\n return new Long(\n bytes[4] << 24 |\n bytes[5] << 16 |\n bytes[6] << 8 |\n bytes[7],\n bytes[0] << 24 |\n bytes[1] << 16 |\n bytes[2] << 8 |\n bytes[3],\n unsigned\n );\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/long.js\n// module id = 0\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/@xtuc/long/index.d.ts b/node_modules/@xtuc/long/index.d.ts new file mode 100644 index 0000000..04dfea6 --- /dev/null +++ b/node_modules/@xtuc/long/index.d.ts @@ -0,0 +1,429 @@ +export = Long; +export as namespace Long; + +declare namespace Long { } + +declare class Long { + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. See the from* functions below for more convenient ways of constructing Longs. + */ + constructor(low: number, high?: number, unsigned?: boolean); + + /** + * Maximum unsigned value. + */ + static MAX_UNSIGNED_VALUE: Long; + + /** + * Maximum signed value. + */ + static MAX_VALUE: Long; + + /** + * Minimum signed value. + */ + static MIN_VALUE: Long; + + /** + * Signed negative one. + */ + static NEG_ONE: Long; + + /** + * Signed one. + */ + static ONE: Long; + + /** + * Unsigned one. + */ + static UONE: Long; + + /** + * Unsigned zero. + */ + static UZERO: Long; + + /** + * Signed zero + */ + static ZERO: Long; + + /** + * The high 32 bits as a signed value. + */ + high: number; + + /** + * The low 32 bits as a signed value. + */ + low: number; + + /** + * Whether unsigned or not. + */ + unsigned: boolean; + + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. + */ + static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long; + + /** + * Returns a Long representing the given 32 bit integer value. + */ + static fromInt(value: number, unsigned?: boolean): Long; + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + */ + static fromNumber(value: number, unsigned?: boolean): Long; + + /** + * Returns a Long representation of the given string, written using the specified radix. + */ + static fromString(str: string, unsigned?: boolean | number, radix?: number): Long; + + /** + * Creates a Long from its byte representation. + */ + static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long; + + /** + * Creates a Long from its little endian byte representation. + */ + static fromBytesLE(bytes: number[], unsigned?: boolean): Long; + + /** + * Creates a Long from its big endian byte representation. + */ + static fromBytesBE(bytes: number[], unsigned?: boolean): Long; + + /** + * Tests if the specified object is a Long. + */ + static isLong(obj: any): obj is Long; + + /** + * Converts the specified value to a Long. + */ + static fromValue(val: Long | number | string | {low: number, high: number, unsigned: boolean}, unsigned?: boolean): Long; + + /** + * Returns the sum of this and the specified Long. + */ + add(addend: number | Long | string): Long; + + /** + * Returns the bitwise AND of this Long and the specified. + */ + and(other: Long | number | string): Long; + + /** + * Compares this Long's value with the specified's. + */ + compare(other: Long | number | string): number; + + /** + * Compares this Long's value with the specified's. + */ + comp(other: Long | number | string): number; + + /** + * Returns this Long divided by the specified. + */ + divide(divisor: Long | number | string): Long; + + /** + * Returns this Long divided by the specified. + */ + div(divisor: Long | number | string): Long; + + /** + * Tests if this Long's value equals the specified's. + */ + equals(other: Long | number | string): boolean; + + /** + * Tests if this Long's value equals the specified's. + */ + eq(other: Long | number | string): boolean; + + /** + * Gets the high 32 bits as a signed integer. + */ + getHighBits(): number; + + /** + * Gets the high 32 bits as an unsigned integer. + */ + getHighBitsUnsigned(): number; + + /** + * Gets the low 32 bits as a signed integer. + */ + getLowBits(): number; + + /** + * Gets the low 32 bits as an unsigned integer. + */ + getLowBitsUnsigned(): number; + + /** + * Gets the number of bits needed to represent the absolute value of this Long. + */ + getNumBitsAbs(): number; + + /** + * Tests if this Long's value is greater than the specified's. + */ + greaterThan(other: Long | number | string): boolean; + + /** + * Tests if this Long's value is greater than the specified's. + */ + gt(other: Long | number | string): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + greaterThanOrEqual(other: Long | number | string): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + gte(other: Long | number | string): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + ge(other: Long | number | string): boolean; + + /** + * Tests if this Long's value is even. + */ + isEven(): boolean; + + /** + * Tests if this Long's value is negative. + */ + isNegative(): boolean; + + /** + * Tests if this Long's value is odd. + */ + isOdd(): boolean; + + /** + * Tests if this Long's value is positive. + */ + isPositive(): boolean; + + /** + * Tests if this Long's value equals zero. + */ + isZero(): boolean; + + /** + * Tests if this Long's value equals zero. + */ + eqz(): boolean; + + /** + * Tests if this Long's value is less than the specified's. + */ + lessThan(other: Long | number | string): boolean; + + /** + * Tests if this Long's value is less than the specified's. + */ + lt(other: Long | number | string): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + lessThanOrEqual(other: Long | number | string): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + lte(other: Long | number | string): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + le(other: Long | number | string): boolean; + + /** + * Returns this Long modulo the specified. + */ + modulo(other: Long | number | string): Long; + + /** + * Returns this Long modulo the specified. + */ + mod(other: Long | number | string): Long; + + /** + * Returns this Long modulo the specified. + */ + rem(other: Long | number | string): Long; + + /** + * Returns the product of this and the specified Long. + */ + multiply(multiplier: Long | number | string): Long; + + /** + * Returns the product of this and the specified Long. + */ + mul(multiplier: Long | number | string): Long; + + /** + * Negates this Long's value. + */ + negate(): Long; + + /** + * Negates this Long's value. + */ + neg(): Long; + + /** + * Returns the bitwise NOT of this Long. + */ + not(): Long; + + /** + * Tests if this Long's value differs from the specified's. + */ + notEquals(other: Long | number | string): boolean; + + /** + * Tests if this Long's value differs from the specified's. + */ + neq(other: Long | number | string): boolean; + + /** + * Tests if this Long's value differs from the specified's. + */ + ne(other: Long | number | string): boolean; + + /** + * Returns the bitwise OR of this Long and the specified. + */ + or(other: Long | number | string): Long; + + /** + * Returns this Long with bits shifted to the left by the given amount. + */ + shiftLeft(numBits: number | Long): Long; + + /** + * Returns this Long with bits shifted to the left by the given amount. + */ + shl(numBits: number | Long): Long; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + */ + shiftRight(numBits: number | Long): Long; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + */ + shr(numBits: number | Long): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shiftRightUnsigned(numBits: number | Long): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shru(numBits: number | Long): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shr_u(numBits: number | Long): Long; + + /** + * Returns this Long with bits rotated to the left by the given amount. + */ + rotateLeft(numBits: number | Long): Long; + + /** + * Returns this Long with bits rotated to the left by the given amount. + */ + rotl(numBits: number | Long): Long; + + /** + * Returns this Long with bits rotated to the right by the given amount. + */ + rotateRight(numBits: number | Long): Long; + + /** + * Returns this Long with bits rotated to the right by the given amount. + */ + rotr(numBits: number | Long): Long; + + /** + * Returns the difference of this and the specified Long. + */ + subtract(subtrahend: number | Long | string): Long; + + /** + * Returns the difference of this and the specified Long. + */ + sub(subtrahend: number | Long |string): Long; + + /** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + */ + toInt(): number; + + /** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + */ + toNumber(): number; + + /** + * Converts this Long to its byte representation. + */ + + toBytes(le?: boolean): number[]; + + /** + * Converts this Long to its little endian byte representation. + */ + + toBytesLE(): number[]; + + /** + * Converts this Long to its big endian byte representation. + */ + + toBytesBE(): number[]; + + /** + * Converts this Long to signed. + */ + toSigned(): Long; + + /** + * Converts the Long to a string written in the specified radix. + */ + toString(radix?: number): string; + + /** + * Converts this Long to unsigned. + */ + toUnsigned(): Long; + + /** + * Returns the bitwise XOR of this Long and the given one. + */ + xor(other: Long | number | string): Long; +} diff --git a/node_modules/@xtuc/long/index.js b/node_modules/@xtuc/long/index.js new file mode 100644 index 0000000..e16857a --- /dev/null +++ b/node_modules/@xtuc/long/index.js @@ -0,0 +1 @@ +module.exports = require("./src/long"); diff --git a/node_modules/@xtuc/long/package.json b/node_modules/@xtuc/long/package.json new file mode 100644 index 0000000..2ec2b8d --- /dev/null +++ b/node_modules/@xtuc/long/package.json @@ -0,0 +1,68 @@ +{ + "_from": "@xtuc/long@4.2.2", + "_id": "@xtuc/long@4.2.2", + "_inBundle": false, + "_integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "_location": "/@xtuc/long", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@xtuc/long@4.2.2", + "name": "@xtuc/long", + "escapedName": "@xtuc%2flong", + "scope": "@xtuc", + "rawSpec": "4.2.2", + "saveSpec": null, + "fetchSpec": "4.2.2" + }, + "_requiredBy": [ + "/@webassemblyjs/leb128", + "/@webassemblyjs/wast-parser", + "/@webassemblyjs/wast-printer" + ], + "_resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "_shasum": "d291c6a4e97989b5c61d9acf396ae4fe133a718d", + "_spec": "@xtuc/long@4.2.2", + "_where": "/usr/share/r3-server/beta/r3/node_modules/@webassemblyjs/wast-parser", + "author": { + "name": "Daniel Wirtz", + "email": "dcode@dcode.io" + }, + "bugs": { + "url": "https://github.com/dcodeIO/long.js/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "A Long class for representing a 64-bit two's-complement integer value.", + "devDependencies": { + "webpack": "^3.10.0" + }, + "files": [ + "index.js", + "LICENSE", + "README.md", + "src/long.js", + "dist/long.js", + "dist/long.js.map", + "index.d.ts" + ], + "homepage": "https://github.com/dcodeIO/long.js#readme", + "keywords": [ + "math" + ], + "license": "Apache-2.0", + "main": "src/long.js", + "name": "@xtuc/long", + "repository": { + "type": "git", + "url": "git+https://github.com/dcodeIO/long.js.git" + }, + "scripts": { + "build": "webpack", + "test": "node tests" + }, + "types": "index.d.ts", + "version": "4.2.2" +} diff --git a/node_modules/@xtuc/long/src/long.js b/node_modules/@xtuc/long/src/long.js new file mode 100644 index 0000000..e1dfd57 --- /dev/null +++ b/node_modules/@xtuc/long/src/long.js @@ -0,0 +1,1405 @@ +module.exports = Long; + +/** + * wasm optimizations, to do native i64 multiplication and divide + */ +var wasm = null; + +try { + wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([ + 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11 + ])), {}).exports; +} catch (e) { + // no wasm support :( +} + +/** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * @exports Long + * @class A Long class for representing a 64 bit two's-complement integer value. + * @param {number} low The low (signed) 32 bits of the long + * @param {number} high The high (signed) 32 bits of the long + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @constructor + */ +function Long(low, high, unsigned) { + + /** + * The low 32 bits as a signed value. + * @type {number} + */ + this.low = low | 0; + + /** + * The high 32 bits as a signed value. + * @type {number} + */ + this.high = high | 0; + + /** + * Whether unsigned or not. + * @type {boolean} + */ + this.unsigned = !!unsigned; +} + +// The internal representation of a long is the two given signed, 32-bit values. +// We use 32-bit pieces because these are the size of integers on which +// Javascript performs bit-operations. For operations like addition and +// multiplication, we split each number into 16 bit pieces, which can easily be +// multiplied within Javascript's floating-point representation without overflow +// or change in sign. +// +// In the algorithms below, we frequently reduce the negative case to the +// positive case by negating the input(s) and then post-processing the result. +// Note that we must ALWAYS check specially whether those values are MIN_VALUE +// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as +// a positive number, it overflows back into a negative). Not handling this +// case would often result in infinite recursion. +// +// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from* +// methods on which they depend. + +/** + * An indicator used to reliably determine if an object is a Long or not. + * @type {boolean} + * @const + * @private + */ +Long.prototype.__isLong__; + +Object.defineProperty(Long.prototype, "__isLong__", { value: true }); + +/** + * @function + * @param {*} obj Object + * @returns {boolean} + * @inner + */ +function isLong(obj) { + return (obj && obj["__isLong__"]) === true; +} + +/** + * Tests if the specified object is a Long. + * @function + * @param {*} obj Object + * @returns {boolean} + */ +Long.isLong = isLong; + +/** + * A cache of the Long representations of small integer values. + * @type {!Object} + * @inner + */ +var INT_CACHE = {}; + +/** + * A cache of the Long representations of small unsigned integer values. + * @type {!Object} + * @inner + */ +var UINT_CACHE = {}; + +/** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ +function fromInt(value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if (cache = (0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } else { + value |= 0; + if (cache = (-128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } +} + +/** + * Returns a Long representing the given 32 bit integer value. + * @function + * @param {number} value The 32 bit integer in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ +Long.fromInt = fromInt; + +/** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ +function fromNumber(value, unsigned) { + if (isNaN(value)) + return unsigned ? UZERO : ZERO; + if (unsigned) { + if (value < 0) + return UZERO; + if (value >= TWO_PWR_64_DBL) + return MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) + return MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return MAX_VALUE; + } + if (value < 0) + return fromNumber(-value, unsigned).neg(); + return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); +} + +/** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @function + * @param {number} value The number in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ +Long.fromNumber = fromNumber; + +/** + * @param {number} lowBits + * @param {number} highBits + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ +function fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); +} + +/** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is + * assumed to use 32 bits. + * @function + * @param {number} lowBits The low 32 bits + * @param {number} highBits The high 32 bits + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ +Long.fromBits = fromBits; + +/** + * @function + * @param {number} base + * @param {number} exponent + * @returns {number} + * @inner + */ +var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4) + +/** + * @param {string} str + * @param {(boolean|number)=} unsigned + * @param {number=} radix + * @returns {!Long} + * @inner + */ +function fromString(str, unsigned, radix) { + if (str.length === 0) + throw Error('empty string'); + if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") + return ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + radix = unsigned, + unsigned = false; + } else { + unsigned = !! unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + + var p; + if ((p = str.indexOf('-')) > 0) + throw Error('interior hyphen'); + else if (p === 0) { + return fromString(str.substring(1), unsigned, radix).neg(); + } + + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = fromNumber(pow_dbl(radix, 8)); + + var result = ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), + value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = fromNumber(pow_dbl(radix, size)); + result = result.mul(power).add(fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; +} + +/** + * Returns a Long representation of the given string, written using the specified radix. + * @function + * @param {string} str The textual representation of the Long + * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed + * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 + * @returns {!Long} The corresponding Long value + */ +Long.fromString = fromString; + +/** + * @function + * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ +function fromValue(val, unsigned) { + if (typeof val === 'number') + return fromNumber(val, unsigned); + if (typeof val === 'string') + return fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); +} + +/** + * Converts the specified value to a Long using the appropriate from* function for its type. + * @function + * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} + */ +Long.fromValue = fromValue; + +// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be +// no runtime penalty for these. + +/** + * @type {number} + * @const + * @inner + */ +var TWO_PWR_16_DBL = 1 << 16; + +/** + * @type {number} + * @const + * @inner + */ +var TWO_PWR_24_DBL = 1 << 24; + +/** + * @type {number} + * @const + * @inner + */ +var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + +/** + * @type {number} + * @const + * @inner + */ +var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + +/** + * @type {number} + * @const + * @inner + */ +var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + +/** + * @type {!Long} + * @const + * @inner + */ +var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); + +/** + * @type {!Long} + * @inner + */ +var ZERO = fromInt(0); + +/** + * Signed zero. + * @type {!Long} + */ +Long.ZERO = ZERO; + +/** + * @type {!Long} + * @inner + */ +var UZERO = fromInt(0, true); + +/** + * Unsigned zero. + * @type {!Long} + */ +Long.UZERO = UZERO; + +/** + * @type {!Long} + * @inner + */ +var ONE = fromInt(1); + +/** + * Signed one. + * @type {!Long} + */ +Long.ONE = ONE; + +/** + * @type {!Long} + * @inner + */ +var UONE = fromInt(1, true); + +/** + * Unsigned one. + * @type {!Long} + */ +Long.UONE = UONE; + +/** + * @type {!Long} + * @inner + */ +var NEG_ONE = fromInt(-1); + +/** + * Signed negative one. + * @type {!Long} + */ +Long.NEG_ONE = NEG_ONE; + +/** + * @type {!Long} + * @inner + */ +var MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false); + +/** + * Maximum signed value. + * @type {!Long} + */ +Long.MAX_VALUE = MAX_VALUE; + +/** + * @type {!Long} + * @inner + */ +var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true); + +/** + * Maximum unsigned value. + * @type {!Long} + */ +Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; + +/** + * @type {!Long} + * @inner + */ +var MIN_VALUE = fromBits(0, 0x80000000|0, false); + +/** + * Minimum signed value. + * @type {!Long} + */ +Long.MIN_VALUE = MIN_VALUE; + +/** + * @alias Long.prototype + * @inner + */ +var LongPrototype = Long.prototype; + +/** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + * @this {!Long} + * @returns {number} + */ +LongPrototype.toInt = function toInt() { + return this.unsigned ? this.low >>> 0 : this.low; +}; + +/** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + * @this {!Long} + * @returns {number} + */ +LongPrototype.toNumber = function toNumber() { + if (this.unsigned) + return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); +}; + +/** + * Converts the Long to a string written in the specified radix. + * @this {!Long} + * @param {number=} radix Radix (2-36), defaults to 10 + * @returns {string} + * @override + * @throws {RangeError} If `radix` is out of range + */ +LongPrototype.toString = function toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { // Unsigned Longs are never negative + if (this.eq(MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = fromNumber(radix), + div = this.div(radixLong), + rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } else + return '-' + this.neg().toString(radix); + } + + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), + rem = this; + var result = ''; + while (true) { + var remDiv = rem.div(radixToPower), + intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, + digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) + return digits + result; + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } +}; + +/** + * Gets the high 32 bits as a signed integer. + * @this {!Long} + * @returns {number} Signed high bits + */ +LongPrototype.getHighBits = function getHighBits() { + return this.high; +}; + +/** + * Gets the high 32 bits as an unsigned integer. + * @this {!Long} + * @returns {number} Unsigned high bits + */ +LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { + return this.high >>> 0; +}; + +/** + * Gets the low 32 bits as a signed integer. + * @this {!Long} + * @returns {number} Signed low bits + */ +LongPrototype.getLowBits = function getLowBits() { + return this.low; +}; + +/** + * Gets the low 32 bits as an unsigned integer. + * @this {!Long} + * @returns {number} Unsigned low bits + */ +LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { + return this.low >>> 0; +}; + +/** + * Gets the number of bits needed to represent the absolute value of this Long. + * @this {!Long} + * @returns {number} + */ +LongPrototype.getNumBitsAbs = function getNumBitsAbs() { + if (this.isNegative()) // Unsigned Longs are never negative + return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + var val = this.high != 0 ? this.high : this.low; + for (var bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) != 0) + break; + return this.high != 0 ? bit + 33 : bit + 1; +}; + +/** + * Tests if this Long's value equals zero. + * @this {!Long} + * @returns {boolean} + */ +LongPrototype.isZero = function isZero() { + return this.high === 0 && this.low === 0; +}; + +/** + * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}. + * @returns {boolean} + */ +LongPrototype.eqz = LongPrototype.isZero; + +/** + * Tests if this Long's value is negative. + * @this {!Long} + * @returns {boolean} + */ +LongPrototype.isNegative = function isNegative() { + return !this.unsigned && this.high < 0; +}; + +/** + * Tests if this Long's value is positive. + * @this {!Long} + * @returns {boolean} + */ +LongPrototype.isPositive = function isPositive() { + return this.unsigned || this.high >= 0; +}; + +/** + * Tests if this Long's value is odd. + * @this {!Long} + * @returns {boolean} + */ +LongPrototype.isOdd = function isOdd() { + return (this.low & 1) === 1; +}; + +/** + * Tests if this Long's value is even. + * @this {!Long} + * @returns {boolean} + */ +LongPrototype.isEven = function isEven() { + return (this.low & 1) === 0; +}; + +/** + * Tests if this Long's value equals the specified's. + * @this {!Long} + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.equals = function equals(other) { + if (!isLong(other)) + other = fromValue(other); + if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1) + return false; + return this.high === other.high && this.low === other.low; +}; + +/** + * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.eq = LongPrototype.equals; + +/** + * Tests if this Long's value differs from the specified's. + * @this {!Long} + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.notEquals = function notEquals(other) { + return !this.eq(/* validates */ other); +}; + +/** + * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.neq = LongPrototype.notEquals; + +/** + * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.ne = LongPrototype.notEquals; + +/** + * Tests if this Long's value is less than the specified's. + * @this {!Long} + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.lessThan = function lessThan(other) { + return this.comp(/* validates */ other) < 0; +}; + +/** + * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.lt = LongPrototype.lessThan; + +/** + * Tests if this Long's value is less than or equal the specified's. + * @this {!Long} + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { + return this.comp(/* validates */ other) <= 0; +}; + +/** + * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.lte = LongPrototype.lessThanOrEqual; + +/** + * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.le = LongPrototype.lessThanOrEqual; + +/** + * Tests if this Long's value is greater than the specified's. + * @this {!Long} + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.greaterThan = function greaterThan(other) { + return this.comp(/* validates */ other) > 0; +}; + +/** + * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.gt = LongPrototype.greaterThan; + +/** + * Tests if this Long's value is greater than or equal the specified's. + * @this {!Long} + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { + return this.comp(/* validates */ other) >= 0; +}; + +/** + * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.gte = LongPrototype.greaterThanOrEqual; + +/** + * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.ge = LongPrototype.greaterThanOrEqual; + +/** + * Compares this Long's value with the specified's. + * @this {!Long} + * @param {!Long|number|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ +LongPrototype.compare = function compare(other) { + if (!isLong(other)) + other = fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), + otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + // At this point the sign bits are the same + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1; +}; + +/** + * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. + * @function + * @param {!Long|number|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ +LongPrototype.comp = LongPrototype.compare; + +/** + * Negates this Long's value. + * @this {!Long} + * @returns {!Long} Negated Long + */ +LongPrototype.negate = function negate() { + if (!this.unsigned && this.eq(MIN_VALUE)) + return MIN_VALUE; + return this.not().add(ONE); +}; + +/** + * Negates this Long's value. This is an alias of {@link Long#negate}. + * @function + * @returns {!Long} Negated Long + */ +LongPrototype.neg = LongPrototype.negate; + +/** + * Returns the sum of this and the specified Long. + * @this {!Long} + * @param {!Long|number|string} addend Addend + * @returns {!Long} Sum + */ +LongPrototype.add = function add(addend) { + if (!isLong(addend)) + addend = fromValue(addend); + + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + + var a48 = this.high >>> 16; + var a32 = this.high & 0xFFFF; + var a16 = this.low >>> 16; + var a00 = this.low & 0xFFFF; + + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xFFFF; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xFFFF; + + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xFFFF; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xFFFF; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c48 += a48 + b48; + c48 &= 0xFFFF; + return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); +}; + +/** + * Returns the difference of this and the specified Long. + * @this {!Long} + * @param {!Long|number|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ +LongPrototype.subtract = function subtract(subtrahend) { + if (!isLong(subtrahend)) + subtrahend = fromValue(subtrahend); + return this.add(subtrahend.neg()); +}; + +/** + * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. + * @function + * @param {!Long|number|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ +LongPrototype.sub = LongPrototype.subtract; + +/** + * Returns the product of this and the specified Long. + * @this {!Long} + * @param {!Long|number|string} multiplier Multiplier + * @returns {!Long} Product + */ +LongPrototype.multiply = function multiply(multiplier) { + if (this.isZero()) + return ZERO; + if (!isLong(multiplier)) + multiplier = fromValue(multiplier); + + // use wasm support if present + if (wasm) { + var low = wasm["mul"](this.low, + this.high, + multiplier.low, + multiplier.high); + return fromBits(low, wasm["get_high"](), this.unsigned); + } + + if (multiplier.isZero()) + return ZERO; + if (this.eq(MIN_VALUE)) + return multiplier.isOdd() ? MIN_VALUE : ZERO; + if (multiplier.eq(MIN_VALUE)) + return this.isOdd() ? MIN_VALUE : ZERO; + + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + + // If both longs are small, use float multiplication + if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) + return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + + var a48 = this.high >>> 16; + var a32 = this.high & 0xFFFF; + var a16 = this.low >>> 16; + var a00 = this.low & 0xFFFF; + + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xFFFF; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xFFFF; + + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xFFFF; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xFFFF; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xFFFF; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xFFFF; + return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); +}; + +/** + * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. + * @function + * @param {!Long|number|string} multiplier Multiplier + * @returns {!Long} Product + */ +LongPrototype.mul = LongPrototype.multiply; + +/** + * Returns this Long divided by the specified. The result is signed if this Long is signed or + * unsigned if this Long is unsigned. + * @this {!Long} + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Quotient + */ +LongPrototype.divide = function divide(divisor) { + if (!isLong(divisor)) + divisor = fromValue(divisor); + if (divisor.isZero()) + throw Error('division by zero'); + + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if (!this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && divisor.high === -1) { + // be consistent with non-wasm code path + return this; + } + var low = (this.unsigned ? wasm["div_u"] : wasm["div_s"])( + this.low, + this.high, + divisor.low, + divisor.high + ); + return fromBits(low, wasm["get_high"](), this.unsigned); + } + + if (this.isZero()) + return this.unsigned ? UZERO : ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(MIN_VALUE)) { + if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) + return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(MIN_VALUE)) + return ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(ZERO)) { + return divisor.isNegative() ? ONE : NEG_ONE; + } else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } else if (divisor.eq(MIN_VALUE)) + return this.unsigned ? UZERO : ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = ZERO; + } else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return UZERO; + if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true + return UONE; + res = UZERO; + } + + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2), + delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48), + + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + approxRes = fromNumber(approx), + approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) + approxRes = ONE; + + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; +}; + +/** + * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. + * @function + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Quotient + */ +LongPrototype.div = LongPrototype.divide; + +/** + * Returns this Long modulo the specified. + * @this {!Long} + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Remainder + */ +LongPrototype.modulo = function modulo(divisor) { + if (!isLong(divisor)) + divisor = fromValue(divisor); + + // use wasm support if present + if (wasm) { + var low = (this.unsigned ? wasm["rem_u"] : wasm["rem_s"])( + this.low, + this.high, + divisor.low, + divisor.high + ); + return fromBits(low, wasm["get_high"](), this.unsigned); + } + + return this.sub(this.div(divisor).mul(divisor)); +}; + +/** + * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. + * @function + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Remainder + */ +LongPrototype.mod = LongPrototype.modulo; + +/** + * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. + * @function + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Remainder + */ +LongPrototype.rem = LongPrototype.modulo; + +/** + * Returns the bitwise NOT of this Long. + * @this {!Long} + * @returns {!Long} + */ +LongPrototype.not = function not() { + return fromBits(~this.low, ~this.high, this.unsigned); +}; + +/** + * Returns the bitwise AND of this Long and the specified. + * @this {!Long} + * @param {!Long|number|string} other Other Long + * @returns {!Long} + */ +LongPrototype.and = function and(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low & other.low, this.high & other.high, this.unsigned); +}; + +/** + * Returns the bitwise OR of this Long and the specified. + * @this {!Long} + * @param {!Long|number|string} other Other Long + * @returns {!Long} + */ +LongPrototype.or = function or(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low | other.low, this.high | other.high, this.unsigned); +}; + +/** + * Returns the bitwise XOR of this Long and the given one. + * @this {!Long} + * @param {!Long|number|string} other Other Long + * @returns {!Long} + */ +LongPrototype.xor = function xor(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); +}; + +/** + * Returns this Long with bits shifted to the left by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shiftLeft = function shiftLeft(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return fromBits(0, this.low << (numBits - 32), this.unsigned); +}; + +/** + * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shl = LongPrototype.shiftLeft; + +/** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shiftRight = function shiftRight(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); +}; + +/** + * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shr = LongPrototype.shiftRight; + +/** + * Returns this Long with bits logically shifted to the right by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits < 32) return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >>> numBits, this.unsigned); + if (numBits === 32) return fromBits(this.high, 0, this.unsigned); + return fromBits(this.high >>> (numBits - 32), 0, this.unsigned); +}; + +/** + * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shru = LongPrototype.shiftRightUnsigned; + +/** + * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; + +/** + * Returns this Long with bits rotated to the left by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ +LongPrototype.rotateLeft = function rotateLeft(numBits) { + var b; + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); + if (numBits < 32) { + b = (32 - numBits); + return fromBits(((this.low << numBits) | (this.high >>> b)), ((this.high << numBits) | (this.low >>> b)), this.unsigned); + } + numBits -= 32; + b = (32 - numBits); + return fromBits(((this.high << numBits) | (this.low >>> b)), ((this.low << numBits) | (this.high >>> b)), this.unsigned); +} +/** + * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ +LongPrototype.rotl = LongPrototype.rotateLeft; + +/** + * Returns this Long with bits rotated to the right by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ +LongPrototype.rotateRight = function rotateRight(numBits) { + var b; + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); + if (numBits < 32) { + b = (32 - numBits); + return fromBits(((this.high << b) | (this.low >>> numBits)), ((this.low << b) | (this.high >>> numBits)), this.unsigned); + } + numBits -= 32; + b = (32 - numBits); + return fromBits(((this.low << b) | (this.high >>> numBits)), ((this.high << b) | (this.low >>> numBits)), this.unsigned); +} +/** + * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ +LongPrototype.rotr = LongPrototype.rotateRight; + +/** + * Converts this Long to signed. + * @this {!Long} + * @returns {!Long} Signed long + */ +LongPrototype.toSigned = function toSigned() { + if (!this.unsigned) + return this; + return fromBits(this.low, this.high, false); +}; + +/** + * Converts this Long to unsigned. + * @this {!Long} + * @returns {!Long} Unsigned long + */ +LongPrototype.toUnsigned = function toUnsigned() { + if (this.unsigned) + return this; + return fromBits(this.low, this.high, true); +}; + +/** + * Converts this Long to its byte representation. + * @param {boolean=} le Whether little or big endian, defaults to big endian + * @this {!Long} + * @returns {!Array.} Byte representation + */ +LongPrototype.toBytes = function toBytes(le) { + return le ? this.toBytesLE() : this.toBytesBE(); +}; + +/** + * Converts this Long to its little endian byte representation. + * @this {!Long} + * @returns {!Array.} Little endian byte representation + */ +LongPrototype.toBytesLE = function toBytesLE() { + var hi = this.high, + lo = this.low; + return [ + lo & 0xff, + lo >>> 8 & 0xff, + lo >>> 16 & 0xff, + lo >>> 24 , + hi & 0xff, + hi >>> 8 & 0xff, + hi >>> 16 & 0xff, + hi >>> 24 + ]; +}; + +/** + * Converts this Long to its big endian byte representation. + * @this {!Long} + * @returns {!Array.} Big endian byte representation + */ +LongPrototype.toBytesBE = function toBytesBE() { + var hi = this.high, + lo = this.low; + return [ + hi >>> 24 , + hi >>> 16 & 0xff, + hi >>> 8 & 0xff, + hi & 0xff, + lo >>> 24 , + lo >>> 16 & 0xff, + lo >>> 8 & 0xff, + lo & 0xff + ]; +}; + +/** + * Creates a Long from its byte representation. + * @param {!Array.} bytes Byte representation + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @param {boolean=} le Whether little or big endian, defaults to big endian + * @returns {Long} The corresponding Long value + */ +Long.fromBytes = function fromBytes(bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); +}; + +/** + * Creates a Long from its little endian byte representation. + * @param {!Array.} bytes Little endian byte representation + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {Long} The corresponding Long value + */ +Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { + return new Long( + bytes[0] | + bytes[1] << 8 | + bytes[2] << 16 | + bytes[3] << 24, + bytes[4] | + bytes[5] << 8 | + bytes[6] << 16 | + bytes[7] << 24, + unsigned + ); +}; + +/** + * Creates a Long from its big endian byte representation. + * @param {!Array.} bytes Big endian byte representation + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {Long} The corresponding Long value + */ +Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { + return new Long( + bytes[4] << 24 | + bytes[5] << 16 | + bytes[6] << 8 | + bytes[7], + bytes[0] << 24 | + bytes[1] << 16 | + bytes[2] << 8 | + bytes[3], + unsigned + ); +}; diff --git a/node_modules/acorn/CHANGELOG.md b/node_modules/acorn/CHANGELOG.md new file mode 100644 index 0000000..1438da6 --- /dev/null +++ b/node_modules/acorn/CHANGELOG.md @@ -0,0 +1,550 @@ +## 6.4.0 (2019-11-26) + +### New features + +Add a static `acorn` property to the `Parser` class that contains the entire module interface, to allow plugins to access the instance of the library that they are acting on. + +## 6.3.0 (2019-08-12) + +### New features + +`sourceType: "module"` can now be used even when `ecmaVersion` is less than 6, to parse module-style code that otherwise conforms to an older standard. + +## 6.2.1 (2019-07-21) + +### Bug fixes + +Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such. + +Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances. + +## 6.2.0 (2019-07-04) + +### Bug fixes + +Improve valid assignment checking in `for`/`in` and `for`/`of` loops. + +Disallow binding `let` in patterns. + +### New features + +Support bigint syntax with `ecmaVersion` >= 10. + +Support dynamic `import` syntax with `ecmaVersion` >= 10. + +Upgrade to Unicode version 12. + +## 6.1.1 (2019-02-27) + +### Bug fixes + +Fix bug that caused parsing default exports of with names to fail. + +## 6.1.0 (2019-02-08) + +### Bug fixes + +Fix scope checking when redefining a `var` as a lexical binding. + +### New features + +Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins. + +## 6.0.7 (2019-02-04) + +### Bug fixes + +Check that exported bindings are defined. + +Don't treat `\u180e` as a whitespace character. + +Check for duplicate parameter names in methods. + +Don't allow shorthand properties when they are generators or async methods. + +Forbid binding `await` in async arrow function's parameter list. + +## 6.0.6 (2019-01-30) + +### Bug fixes + +The content of class declarations and expressions is now always parsed in strict mode. + +Don't allow `let` or `const` to bind the variable name `let`. + +Treat class declarations as lexical. + +Don't allow a generator function declaration as the sole body of an `if` or `else`. + +Ignore `"use strict"` when after an empty statement. + +Allow string line continuations with special line terminator characters. + +Treat `for` bodies as part of the `for` scope when checking for conflicting bindings. + +Fix bug with parsing `yield` in a `for` loop initializer. + +Implement special cases around scope checking for functions. + +## 6.0.5 (2019-01-02) + +### Bug fixes + +Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type. + +Don't treat `let` as a keyword when the next token is `{` on the next line. + +Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on. + +## 6.0.4 (2018-11-05) + +### Bug fixes + +Further improvements to tokenizing regular expressions in corner cases. + +## 6.0.3 (2018-11-04) + +### Bug fixes + +Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression. + +Remove stray symlink in the package tarball. + +## 6.0.2 (2018-09-26) + +### Bug fixes + +Fix bug where default expressions could fail to parse inside an object destructuring assignment expression. + +## 6.0.1 (2018-09-14) + +### Bug fixes + +Fix wrong value in `version` export. + +## 6.0.0 (2018-09-14) + +### Bug fixes + +Better handle variable-redefinition checks for catch bindings and functions directly under if statements. + +Forbid `new.target` in top-level arrow functions. + +Fix issue with parsing a regexp after `yield` in some contexts. + +### New features + +The package now comes with TypeScript definitions. + +### Breaking changes + +The default value of the `ecmaVersion` option is now 9 (2018). + +Plugins work differently, and will have to be rewritten to work with this version. + +The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`). + +## 5.7.3 (2018-09-10) + +### Bug fixes + +Fix failure to tokenize regexps after expressions like `x.of`. + +Better error message for unterminated template literals. + +## 5.7.2 (2018-08-24) + +### Bug fixes + +Properly handle `allowAwaitOutsideFunction` in for statements. + +Treat function declarations at the top level of modules like let bindings. + +Don't allow async function declarations as the only statement under a label. + +## 5.7.0 (2018-06-15) + +### New features + +Upgraded to Unicode 11. + +## 5.6.0 (2018-05-31) + +### New features + +Allow U+2028 and U+2029 in string when ECMAVersion >= 10. + +Allow binding-less catch statements when ECMAVersion >= 10. + +Add `allowAwaitOutsideFunction` option for parsing top-level `await`. + +## 5.5.3 (2018-03-08) + +### Bug fixes + +A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps. + +## 5.5.2 (2018-03-08) + +### Bug fixes + +A republish of the code in 5.5.1 in an attempt to solve an issue with the file timestamps in the npm package being 0. + +## 5.5.1 (2018-03-06) + +### Bug fixes + +Fix misleading error message for octal escapes in template strings. + +## 5.5.0 (2018-02-27) + +### New features + +The identifier character categorization is now based on Unicode version 10. + +Acorn will now validate the content of regular expressions, including new ES9 features. + +## 5.4.0 (2018-02-01) + +### Bug fixes + +Disallow duplicate or escaped flags on regular expressions. + +Disallow octal escapes in strings in strict mode. + +### New features + +Add support for async iteration. + +Add support for object spread and rest. + +## 5.3.0 (2017-12-28) + +### Bug fixes + +Fix parsing of floating point literals with leading zeroes in loose mode. + +Allow duplicate property names in object patterns. + +Don't allow static class methods named `prototype`. + +Disallow async functions directly under `if` or `else`. + +Parse right-hand-side of `for`/`of` as an assignment expression. + +Stricter parsing of `for`/`in`. + +Don't allow unicode escapes in contextual keywords. + +### New features + +Parsing class members was factored into smaller methods to allow plugins to hook into it. + +## 5.2.1 (2017-10-30) + +### Bug fixes + +Fix a token context corruption bug. + +## 5.2.0 (2017-10-30) + +### Bug fixes + +Fix token context tracking for `class` and `function` in property-name position. + +Make sure `%*` isn't parsed as a valid operator. + +Allow shorthand properties `get` and `set` to be followed by default values. + +Disallow `super` when not in callee or object position. + +### New features + +Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements. + +## 5.1.2 (2017-09-04) + +### Bug fixes + +Disable parsing of legacy HTML-style comments in modules. + +Fix parsing of async methods whose names are keywords. + +## 5.1.1 (2017-07-06) + +### Bug fixes + +Fix problem with disambiguating regexp and division after a class. + +## 5.1.0 (2017-07-05) + +### Bug fixes + +Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`. + +Parse zero-prefixed numbers with non-octal digits as decimal. + +Allow object/array patterns in rest parameters. + +Don't error when `yield` is used as a property name. + +Allow `async` as a shorthand object property. + +### New features + +Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9. + +## 5.0.3 (2017-04-01) + +### Bug fixes + +Fix spurious duplicate variable definition errors for named functions. + +## 5.0.2 (2017-03-30) + +### Bug fixes + +A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error. + +## 5.0.0 (2017-03-28) + +### Bug fixes + +Raise an error for duplicated lexical bindings. + +Fix spurious error when an assignement expression occurred after a spread expression. + +Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions. + +Allow labels in front or `var` declarations, even in strict mode. + +### Breaking changes + +Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`. + +## 4.0.11 (2017-02-07) + +### Bug fixes + +Allow all forms of member expressions to be parenthesized as lvalue. + +## 4.0.10 (2017-02-07) + +### Bug fixes + +Don't expect semicolons after default-exported functions or classes, even when they are expressions. + +Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode. + +## 4.0.9 (2017-02-06) + +### Bug fixes + +Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again. + +## 4.0.8 (2017-02-03) + +### Bug fixes + +Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet. + +## 4.0.7 (2017-02-02) + +### Bug fixes + +Accept invalidly rejected code like `(x).y = 2` again. + +Don't raise an error when a function _inside_ strict code has a non-simple parameter list. + +## 4.0.6 (2017-02-02) + +### Bug fixes + +Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check. + +## 4.0.5 (2017-02-02) + +### Bug fixes + +Disallow parenthesized pattern expressions. + +Allow keywords as export names. + +Don't allow the `async` keyword to be parenthesized. + +Properly raise an error when a keyword contains a character escape. + +Allow `"use strict"` to appear after other string literal expressions. + +Disallow labeled declarations. + +## 4.0.4 (2016-12-19) + +### Bug fixes + +Fix crash when `export` was followed by a keyword that can't be +exported. + +## 4.0.3 (2016-08-16) + +### Bug fixes + +Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode. + +Properly parse properties named `async` in ES2017 mode. + +Fix bug where reserved words were broken in ES2017 mode. + +## 4.0.2 (2016-08-11) + +### Bug fixes + +Don't ignore period or 'e' characters after octal numbers. + +Fix broken parsing for call expressions in default parameter values of arrow functions. + +## 4.0.1 (2016-08-08) + +### Bug fixes + +Fix false positives in duplicated export name errors. + +## 4.0.0 (2016-08-07) + +### Breaking changes + +The default `ecmaVersion` option value is now 7. + +A number of internal method signatures changed, so plugins might need to be updated. + +### Bug fixes + +The parser now raises errors on duplicated export names. + +`arguments` and `eval` can now be used in shorthand properties. + +Duplicate parameter names in non-simple argument lists now always produce an error. + +### New features + +The `ecmaVersion` option now also accepts year-style version numbers +(2015, etc). + +Support for `async`/`await` syntax when `ecmaVersion` is >= 8. + +Support for trailing commas in call expressions when `ecmaVersion` is >= 8. + +## 3.3.0 (2016-07-25) + +### Bug fixes + +Fix bug in tokenizing of regexp operator after a function declaration. + +Fix parser crash when parsing an array pattern with a hole. + +### New features + +Implement check against complex argument lists in functions that enable strict mode in ES7. + +## 3.2.0 (2016-06-07) + +### Bug fixes + +Improve handling of lack of unicode regexp support in host +environment. + +Properly reject shorthand properties whose name is a keyword. + +### New features + +Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object. + +## 3.1.0 (2016-04-18) + +### Bug fixes + +Properly tokenize the division operator directly after a function expression. + +Allow trailing comma in destructuring arrays. + +## 3.0.4 (2016-02-25) + +### Fixes + +Allow update expressions as left-hand-side of the ES7 exponential operator. + +## 3.0.2 (2016-02-10) + +### Fixes + +Fix bug that accidentally made `undefined` a reserved word when parsing ES7. + +## 3.0.0 (2016-02-10) + +### Breaking changes + +The default value of the `ecmaVersion` option is now 6 (used to be 5). + +Support for comprehension syntax (which was dropped from the draft spec) has been removed. + +### Fixes + +`let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code. + +A parenthesized class or function expression after `export default` is now parsed correctly. + +### New features + +When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`). + +The identifier character ranges are now based on Unicode 8.0.0. + +Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled. + +## 2.7.0 (2016-01-04) + +### Fixes + +Stop allowing rest parameters in setters. + +Disallow `y` rexexp flag in ES5. + +Disallow `\00` and `\000` escapes in strict mode. + +Raise an error when an import name is a reserved word. + +## 2.6.2 (2015-11-10) + +### Fixes + +Don't crash when no options object is passed. + +## 2.6.0 (2015-11-09) + +### Fixes + +Add `await` as a reserved word in module sources. + +Disallow `yield` in a parameter default value for a generator. + +Forbid using a comma after a rest pattern in an array destructuring. + +### New features + +Support parsing stdin in command-line tool. + +## 2.5.0 (2015-10-27) + +### Fixes + +Fix tokenizer support in the command-line tool. + +Stop allowing `new.target` outside of functions. + +Remove legacy `guard` and `guardedHandler` properties from try nodes. + +Stop allowing multiple `__proto__` properties on an object literal in strict mode. + +Don't allow rest parameters to be non-identifier patterns. + +Check for duplicate paramter names in arrow functions. diff --git a/node_modules/acorn/LICENSE b/node_modules/acorn/LICENSE new file mode 100644 index 0000000..2c0632b --- /dev/null +++ b/node_modules/acorn/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2018 by various contributors (see AUTHORS) + +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. diff --git a/node_modules/acorn/README.md b/node_modules/acorn/README.md new file mode 100644 index 0000000..bcf85cc --- /dev/null +++ b/node_modules/acorn/README.md @@ -0,0 +1,269 @@ +# Acorn + +A tiny, fast JavaScript parser written in JavaScript. + +## Community + +Acorn is open source software released under an +[MIT license](https://github.com/acornjs/acorn/blob/master/acorn/LICENSE). + +You are welcome to +[report bugs](https://github.com/acornjs/acorn/issues) or create pull +requests on [github](https://github.com/acornjs/acorn). For questions +and discussion, please use the +[Tern discussion forum](https://discuss.ternjs.net). + +## Installation + +The easiest way to install acorn is from [`npm`](https://www.npmjs.com/): + +```sh +npm install acorn +``` + +Alternately, you can download the source and build acorn yourself: + +```sh +git clone https://github.com/acornjs/acorn.git +cd acorn +npm install +``` + +## Interface + +**parse**`(input, options)` is the main interface to the library. The +`input` parameter is a string, `options` can be undefined or an object +setting some of the options listed below. The return value will be an +abstract syntax tree object as specified by the [ESTree +spec](https://github.com/estree/estree). + +```javascript +let acorn = require("acorn"); +console.log(acorn.parse("1 + 1")); +``` + +When encountering a syntax error, the parser will raise a +`SyntaxError` object with a meaningful message. The error object will +have a `pos` property that indicates the string offset at which the +error occurred, and a `loc` object that contains a `{line, column}` +object referring to that same position. + +Options can be provided by passing a second argument, which should be +an object containing any of these fields: + +- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be + either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018) or 10 (2019, partial + support). This influences support for strict mode, the set of + reserved words, and support for new syntax features. Default is 9. + + **NOTE**: Only 'stage 4' (finalized) ECMAScript features are being + implemented by Acorn. Other proposed new features can be implemented + through plugins. + +- **sourceType**: Indicate the mode the code should be parsed in. Can be + either `"script"` or `"module"`. This influences global strict mode + and parsing of `import` and `export` declarations. + + **NOTE**: If set to `"module"`, then static `import` / `export` syntax + will be valid, even if `ecmaVersion` is less than 6. + +- **onInsertedSemicolon**: If given a callback, that callback will be + called whenever a missing semicolon is inserted by the parser. The + callback will be given the character offset of the point where the + semicolon is inserted as argument, and if `locations` is on, also a + `{line, column}` object representing this position. + +- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing + commas. + +- **allowReserved**: If `false`, using a reserved word will generate + an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher + versions. When given the value `"never"`, reserved words and + keywords can also not be used as property names (as in Internet + Explorer's old parser). + +- **allowReturnOutsideFunction**: By default, a return statement at + the top level raises an error. Set this to `true` to accept such + code. + +- **allowImportExportEverywhere**: By default, `import` and `export` + declarations can only appear at a program's top level. Setting this + option to `true` allows them anywhere where a statement is allowed. + +- **allowAwaitOutsideFunction**: By default, `await` expressions can + only appear inside `async` functions. Setting this option to + `true` allows to have top-level `await` expressions. They are + still not allowed in non-`async` functions, though. + +- **allowHashBang**: When this is enabled (off by default), if the + code starts with the characters `#!` (as in a shellscript), the + first line will be treated as a comment. + +- **locations**: When `true`, each node has a `loc` object attached + with `start` and `end` subobjects, each of which contains the + one-based line and zero-based column numbers in `{line, column}` + form. Default is `false`. + +- **onToken**: If a function is passed for this option, each found + token will be passed in same format as tokens returned from + `tokenizer().getToken()`. + + If array is passed, each found token is pushed to it. + + Note that you are not allowed to call the parser from the + callback—that will corrupt its internal state. + +- **onComment**: If a function is passed for this option, whenever a + comment is encountered the function will be called with the + following parameters: + + - `block`: `true` if the comment is a block comment, false if it + is a line comment. + - `text`: The content of the comment. + - `start`: Character offset of the start of the comment. + - `end`: Character offset of the end of the comment. + + When the `locations` options is on, the `{line, column}` locations + of the comment’s start and end are passed as two additional + parameters. + + If array is passed for this option, each found comment is pushed + to it as object in Esprima format: + + ```javascript + { + "type": "Line" | "Block", + "value": "comment text", + "start": Number, + "end": Number, + // If `locations` option is on: + "loc": { + "start": {line: Number, column: Number} + "end": {line: Number, column: Number} + }, + // If `ranges` option is on: + "range": [Number, Number] + } + ``` + + Note that you are not allowed to call the parser from the + callback—that will corrupt its internal state. + +- **ranges**: Nodes have their start and end characters offsets + recorded in `start` and `end` properties (directly on the node, + rather than the `loc` object, which holds line/column data. To also + add a + [semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678) + `range` property holding a `[start, end]` array with the same + numbers, set the `ranges` option to `true`. + +- **program**: It is possible to parse multiple files into a single + AST by passing the tree produced by parsing the first file as the + `program` option in subsequent parses. This will add the toplevel + forms of the parsed file to the "Program" (top) node of an existing + parse tree. + +- **sourceFile**: When the `locations` option is `true`, you can pass + this option to add a `source` attribute in every node’s `loc` + object. Note that the contents of this option are not examined or + processed in any way; you are free to use whatever format you + choose. + +- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property + will be added (regardless of the `location` option) directly to the + nodes, rather than the `loc` object. + +- **preserveParens**: If this option is `true`, parenthesized expressions + are represented by (non-standard) `ParenthesizedExpression` nodes + that have a single `expression` property containing the expression + inside parentheses. + +**parseExpressionAt**`(input, offset, options)` will parse a single +expression in a string, and return its AST. It will not complain if +there is more of the string left after the expression. + +**tokenizer**`(input, options)` returns an object with a `getToken` +method that can be called repeatedly to get the next token, a `{start, +end, type, value}` object (with added `loc` property when the +`locations` option is enabled and `range` property when the `ranges` +option is enabled). When the token's type is `tokTypes.eof`, you +should stop calling the method, since it will keep returning that same +token forever. + +In ES6 environment, returned result can be used as any other +protocol-compliant iterable: + +```javascript +for (let token of acorn.tokenizer(str)) { + // iterate over the tokens +} + +// transform code to array of tokens: +var tokens = [...acorn.tokenizer(str)]; +``` + +**tokTypes** holds an object mapping names to the token type objects +that end up in the `type` properties of tokens. + +**getLineInfo**`(input, offset)` can be used to get a `{line, +column}` object for a given program string and offset. + +### The `Parser` class + +Instances of the **`Parser`** class contain all the state and logic +that drives a parse. It has static methods `parse`, +`parseExpressionAt`, and `tokenizer` that match the top-level +functions by the same name. + +When extending the parser with plugins, you need to call these methods +on the extended version of the class. To extend a parser with plugins, +you can use its static `extend` method. + +```javascript +var acorn = require("acorn"); +var jsx = require("acorn-jsx"); +var JSXParser = acorn.Parser.extend(jsx()); +JSXParser.parse("foo()"); +``` + +The `extend` method takes any number of plugin values, and returns a +new `Parser` class that includes the extra parser logic provided by +the plugins. + +## Command line interface + +The `bin/acorn` utility can be used to parse a file from the command +line. It accepts as arguments its input file and the following +options: + +- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version + to parse. Default is version 9. + +- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise. + +- `--locations`: Attaches a "loc" object to each node with "start" and + "end" subobjects, each of which contains the one-based line and + zero-based column numbers in `{line, column}` form. + +- `--allow-hash-bang`: If the code starts with the characters #! (as + in a shellscript), the first line will be treated as a comment. + +- `--compact`: No whitespace is used in the AST output. + +- `--silent`: Do not output the AST, just return the exit status. + +- `--help`: Print the usage information and quit. + +The utility spits out the syntax tree as JSON data. + +## Existing plugins + + - [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx) + +Plugins for ECMAScript proposals: + + - [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling: + - [`acorn-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields) + - [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta) + - [`acorn-numeric-separator`](https://github.com/acornjs/acorn-numeric-separator): Parse [numeric separator proposal](https://github.com/tc39/proposal-numeric-separator) + - [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods)n diff --git a/node_modules/acorn/bin/acorn b/node_modules/acorn/bin/acorn new file mode 100755 index 0000000..cf7df46 --- /dev/null +++ b/node_modules/acorn/bin/acorn @@ -0,0 +1,4 @@ +#!/usr/bin/env node +'use strict'; + +require('../dist/bin.js'); diff --git a/node_modules/acorn/dist/acorn.d.ts b/node_modules/acorn/dist/acorn.d.ts new file mode 100644 index 0000000..c68e239 --- /dev/null +++ b/node_modules/acorn/dist/acorn.d.ts @@ -0,0 +1,209 @@ +export as namespace acorn +export = acorn + +declare namespace acorn { + function parse(input: string, options?: Options): Node + + function parseExpressionAt(input: string, pos?: number, options?: Options): Node + + function tokenizer(input: string, options?: Options): { + getToken(): Token + [Symbol.iterator](): Iterator + } + + interface Options { + ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 2015 | 2016 | 2017 | 2018 | 2019 + sourceType?: 'script' | 'module' + onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void + onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void + allowReserved?: boolean | 'never' + allowReturnOutsideFunction?: boolean + allowImportExportEverywhere?: boolean + allowAwaitOutsideFunction?: boolean + allowHashBang?: boolean + locations?: boolean + onToken?: ((token: Token) => any) | Token[] + onComment?: (( + isBlock: boolean, text: string, start: number, end: number, startLoc?: Position, + endLoc?: Position + ) => void) | Comment[] + ranges?: boolean + program?: Node + sourceFile?: string + directSourceFile?: string + preserveParens?: boolean + } + + class Parser { + constructor(options: Options, input: string, startPos?: number) + parse(this: Parser): Node + static parse(this: typeof Parser, input: string, options?: Options): Node + static parseExpressionAt(this: typeof Parser, input: string, pos: number, options?: Options): Node + static tokenizer(this: typeof Parser, input: string, options?: Options): { + getToken(): Token + [Symbol.iterator](): Iterator + } + static extend(this: typeof Parser, ...plugins: ((BaseParser: typeof Parser) => typeof Parser)[]): typeof Parser + } + + interface Position { line: number; column: number; offset: number } + + const defaultOptions: Options + + function getLineInfo(input: string, offset: number): Position + + class SourceLocation { + start: Position + end: Position + source?: string | null + constructor(p: Parser, start: Position, end: Position) + } + + class Node { + type: string + start: number + end: number + loc?: SourceLocation + sourceFile?: string + range?: [number, number] + constructor(parser: Parser, pos: number, loc?: SourceLocation) + } + + class TokenType { + label: string + keyword: string + beforeExpr: boolean + startsExpr: boolean + isLoop: boolean + isAssign: boolean + prefix: boolean + postfix: boolean + binop: number + updateContext?: (prevType: TokenType) => void + constructor(label: string, conf?: any) + } + + const tokTypes: { + num: TokenType + regexp: TokenType + string: TokenType + name: TokenType + eof: TokenType + bracketL: TokenType + bracketR: TokenType + braceL: TokenType + braceR: TokenType + parenL: TokenType + parenR: TokenType + comma: TokenType + semi: TokenType + colon: TokenType + dot: TokenType + question: TokenType + arrow: TokenType + template: TokenType + ellipsis: TokenType + backQuote: TokenType + dollarBraceL: TokenType + eq: TokenType + assign: TokenType + incDec: TokenType + prefix: TokenType + logicalOR: TokenType + logicalAND: TokenType + bitwiseOR: TokenType + bitwiseXOR: TokenType + bitwiseAND: TokenType + equality: TokenType + relational: TokenType + bitShift: TokenType + plusMin: TokenType + modulo: TokenType + star: TokenType + slash: TokenType + starstar: TokenType + _break: TokenType + _case: TokenType + _catch: TokenType + _continue: TokenType + _debugger: TokenType + _default: TokenType + _do: TokenType + _else: TokenType + _finally: TokenType + _for: TokenType + _function: TokenType + _if: TokenType + _return: TokenType + _switch: TokenType + _throw: TokenType + _try: TokenType + _var: TokenType + _const: TokenType + _while: TokenType + _with: TokenType + _new: TokenType + _this: TokenType + _super: TokenType + _class: TokenType + _extends: TokenType + _export: TokenType + _import: TokenType + _null: TokenType + _true: TokenType + _false: TokenType + _in: TokenType + _instanceof: TokenType + _typeof: TokenType + _void: TokenType + _delete: TokenType + } + + class TokContext { + constructor(token: string, isExpr: boolean, preserveSpace: boolean, override?: (p: Parser) => void) + } + + const tokContexts: { + b_stat: TokContext + b_expr: TokContext + b_tmpl: TokContext + p_stat: TokContext + p_expr: TokContext + q_tmpl: TokContext + f_expr: TokContext + } + + function isIdentifierStart(code: number, astral?: boolean): boolean + + function isIdentifierChar(code: number, astral?: boolean): boolean + + interface AbstractToken { + } + + interface Comment extends AbstractToken { + type: string + value: string + start: number + end: number + loc?: SourceLocation + range?: [number, number] + } + + class Token { + type: TokenType + value: any + start: number + end: number + loc?: SourceLocation + range?: [number, number] + constructor(p: Parser) + } + + function isNewLine(code: number): boolean + + const lineBreak: RegExp + + const lineBreakG: RegExp + + const version: string +} diff --git a/node_modules/acorn/dist/acorn.js b/node_modules/acorn/dist/acorn.js new file mode 100644 index 0000000..5bad54b --- /dev/null +++ b/node_modules/acorn/dist/acorn.js @@ -0,0 +1,4990 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = global || self, factory(global.acorn = {})); +}(this, function (exports) { 'use strict'; + + // Reserved word lists for various dialects of the language + + var reservedWords = { + 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", + 5: "class enum extends super const export import", + 6: "enum", + strict: "implements interface let package private protected public static yield", + strictBind: "eval arguments" + }; + + // And the keywords + + var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; + + var keywords = { + 5: ecma5AndLessKeywords, + "5module": ecma5AndLessKeywords + " export import", + 6: ecma5AndLessKeywords + " const class extends export import super" + }; + + var keywordRelationalOperator = /^in(stanceof)?$/; + + // ## Character categories + + // Big ugly regular expressions that match characters in the + // whitespace, identifier, and identifier-start categories. These + // are only applied when a character is found to actually have a + // code point above 128. + // Generated by `bin/generate-identifier-regex.js`. + var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab67\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; + var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; + + var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); + var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + + nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; + + // These are a run-length and offset encoded representation of the + // >0xffff code points that are a valid part of identifiers. The + // offset starts at 0x10000, and each pair of numbers represents an + // offset to the next range, and then a size of the range. They were + // generated by bin/generate-identifier-regex.js + + // eslint-disable-next-line comma-spacing + var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,155,22,13,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,0,33,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,0,161,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,754,9486,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541]; + + // eslint-disable-next-line comma-spacing + var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,232,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,792487,239]; + + // This has a complexity linear to the value of the code. The + // assumption is that looking up astral identifier characters is + // rare. + function isInAstralSet(code, set) { + var pos = 0x10000; + for (var i = 0; i < set.length; i += 2) { + pos += set[i]; + if (pos > code) { return false } + pos += set[i + 1]; + if (pos >= code) { return true } + } + } + + // Test whether a given character code starts an identifier. + + function isIdentifierStart(code, astral) { + if (code < 65) { return code === 36 } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) + } + + // Test whether a given character is part of an identifier. + + function isIdentifierChar(code, astral) { + if (code < 48) { return code === 36 } + if (code < 58) { return true } + if (code < 65) { return false } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) + } + + // ## Token types + + // The assignment of fine-grained, information-carrying type objects + // allows the tokenizer to store the information it has about a + // token in a way that is very cheap for the parser to look up. + + // All token type variables start with an underscore, to make them + // easy to recognize. + + // The `beforeExpr` property is used to disambiguate between regular + // expressions and divisions. It is set on all token types that can + // be followed by an expression (thus, a slash after them would be a + // regular expression). + // + // The `startsExpr` property is used to check if the token ends a + // `yield` expression. It is set on all token types that either can + // directly start an expression (like a quotation mark) or can + // continue an expression (like the body of a string). + // + // `isLoop` marks a keyword as starting a loop, which is important + // to know when parsing a label, in order to allow or disallow + // continue jumps to that label. + + var TokenType = function TokenType(label, conf) { + if ( conf === void 0 ) conf = {}; + + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; + }; + + function binop(name, prec) { + return new TokenType(name, {beforeExpr: true, binop: prec}) + } + var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true}; + + // Map keyword names to token types. + + var keywords$1 = {}; + + // Succinct definitions of keyword token types + function kw(name, options) { + if ( options === void 0 ) options = {}; + + options.keyword = name; + return keywords$1[name] = new TokenType(name, options) + } + + var types = { + num: new TokenType("num", startsExpr), + regexp: new TokenType("regexp", startsExpr), + string: new TokenType("string", startsExpr), + name: new TokenType("name", startsExpr), + eof: new TokenType("eof"), + + // Punctuation token types. + bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}), + bracketR: new TokenType("]"), + braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}), + braceR: new TokenType("}"), + parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}), + parenR: new TokenType(")"), + comma: new TokenType(",", beforeExpr), + semi: new TokenType(";", beforeExpr), + colon: new TokenType(":", beforeExpr), + dot: new TokenType("."), + question: new TokenType("?", beforeExpr), + arrow: new TokenType("=>", beforeExpr), + template: new TokenType("template"), + invalidTemplate: new TokenType("invalidTemplate"), + ellipsis: new TokenType("...", beforeExpr), + backQuote: new TokenType("`", startsExpr), + dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}), + + // Operators. These carry several kinds of properties to help the + // parser use them properly (the presence of these properties is + // what categorizes them as operators). + // + // `binop`, when present, specifies that this operator is a binary + // operator, and will refer to its precedence. + // + // `prefix` and `postfix` mark the operator as a prefix or postfix + // unary operator. + // + // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as + // binary operators with a very low precedence, that should result + // in AssignmentExpression nodes. + + eq: new TokenType("=", {beforeExpr: true, isAssign: true}), + assign: new TokenType("_=", {beforeExpr: true, isAssign: true}), + incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}), + prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}), + logicalOR: binop("||", 1), + logicalAND: binop("&&", 2), + bitwiseOR: binop("|", 3), + bitwiseXOR: binop("^", 4), + bitwiseAND: binop("&", 5), + equality: binop("==/!=/===/!==", 6), + relational: binop("/<=/>=", 7), + bitShift: binop("<>/>>>", 8), + plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), + modulo: binop("%", 10), + star: binop("*", 10), + slash: binop("/", 10), + starstar: new TokenType("**", {beforeExpr: true}), + + // Keyword token types. + _break: kw("break"), + _case: kw("case", beforeExpr), + _catch: kw("catch"), + _continue: kw("continue"), + _debugger: kw("debugger"), + _default: kw("default", beforeExpr), + _do: kw("do", {isLoop: true, beforeExpr: true}), + _else: kw("else", beforeExpr), + _finally: kw("finally"), + _for: kw("for", {isLoop: true}), + _function: kw("function", startsExpr), + _if: kw("if"), + _return: kw("return", beforeExpr), + _switch: kw("switch"), + _throw: kw("throw", beforeExpr), + _try: kw("try"), + _var: kw("var"), + _const: kw("const"), + _while: kw("while", {isLoop: true}), + _with: kw("with"), + _new: kw("new", {beforeExpr: true, startsExpr: true}), + _this: kw("this", startsExpr), + _super: kw("super", startsExpr), + _class: kw("class", startsExpr), + _extends: kw("extends", beforeExpr), + _export: kw("export"), + _import: kw("import", startsExpr), + _null: kw("null", startsExpr), + _true: kw("true", startsExpr), + _false: kw("false", startsExpr), + _in: kw("in", {beforeExpr: true, binop: 7}), + _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}), + _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}), + _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}), + _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true}) + }; + + // Matches a whole line break (where CRLF is considered a single + // line break). Used to count lines. + + var lineBreak = /\r\n?|\n|\u2028|\u2029/; + var lineBreakG = new RegExp(lineBreak.source, "g"); + + function isNewLine(code, ecma2019String) { + return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029)) + } + + var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; + + var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; + + var ref = Object.prototype; + var hasOwnProperty = ref.hasOwnProperty; + var toString = ref.toString; + + // Checks if an object has a property. + + function has(obj, propName) { + return hasOwnProperty.call(obj, propName) + } + + var isArray = Array.isArray || (function (obj) { return ( + toString.call(obj) === "[object Array]" + ); }); + + function wordsRegexp(words) { + return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") + } + + // These are used when `options.locations` is on, for the + // `startLoc` and `endLoc` properties. + + var Position = function Position(line, col) { + this.line = line; + this.column = col; + }; + + Position.prototype.offset = function offset (n) { + return new Position(this.line, this.column + n) + }; + + var SourceLocation = function SourceLocation(p, start, end) { + this.start = start; + this.end = end; + if (p.sourceFile !== null) { this.source = p.sourceFile; } + }; + + // The `getLineInfo` function is mostly useful when the + // `locations` option is off (for performance reasons) and you + // want to find the line/column position for a given character + // offset. `input` should be the code string that the offset refers + // into. + + function getLineInfo(input, offset) { + for (var line = 1, cur = 0;;) { + lineBreakG.lastIndex = cur; + var match = lineBreakG.exec(input); + if (match && match.index < offset) { + ++line; + cur = match.index + match[0].length; + } else { + return new Position(line, offset - cur) + } + } + } + + // A second optional argument can be given to further configure + // the parser process. These options are recognized: + + var defaultOptions = { + // `ecmaVersion` indicates the ECMAScript version to parse. Must be + // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10 + // (2019). This influences support for strict mode, the set of + // reserved words, and support for new syntax features. The default + // is 9. + ecmaVersion: 9, + // `sourceType` indicates the mode the code should be parsed in. + // Can be either `"script"` or `"module"`. This influences global + // strict mode and parsing of `import` and `export` declarations. + sourceType: "script", + // `onInsertedSemicolon` can be a callback that will be called + // when a semicolon is automatically inserted. It will be passed + // the position of the comma as an offset, and if `locations` is + // enabled, it is given the location as a `{line, column}` object + // as second argument. + onInsertedSemicolon: null, + // `onTrailingComma` is similar to `onInsertedSemicolon`, but for + // trailing commas. + onTrailingComma: null, + // By default, reserved words are only enforced if ecmaVersion >= 5. + // Set `allowReserved` to a boolean value to explicitly turn this on + // an off. When this option has the value "never", reserved words + // and keywords can also not be used as property names. + allowReserved: null, + // When enabled, a return at the top level is not considered an + // error. + allowReturnOutsideFunction: false, + // When enabled, import/export statements are not constrained to + // appearing at the top of the program. + allowImportExportEverywhere: false, + // When enabled, await identifiers are allowed to appear at the top-level scope, + // but they are still not allowed in non-async functions. + allowAwaitOutsideFunction: false, + // When enabled, hashbang directive in the beginning of file + // is allowed and treated as a line comment. + allowHashBang: false, + // When `locations` is on, `loc` properties holding objects with + // `start` and `end` properties in `{line, column}` form (with + // line being 1-based and column 0-based) will be attached to the + // nodes. + locations: false, + // A function can be passed as `onToken` option, which will + // cause Acorn to call that function with object in the same + // format as tokens returned from `tokenizer().getToken()`. Note + // that you are not allowed to call the parser from the + // callback—that will corrupt its internal state. + onToken: null, + // A function can be passed as `onComment` option, which will + // cause Acorn to call that function with `(block, text, start, + // end)` parameters whenever a comment is skipped. `block` is a + // boolean indicating whether this is a block (`/* */`) comment, + // `text` is the content of the comment, and `start` and `end` are + // character offsets that denote the start and end of the comment. + // When the `locations` option is on, two more parameters are + // passed, the full `{line, column}` locations of the start and + // end of the comments. Note that you are not allowed to call the + // parser from the callback—that will corrupt its internal state. + onComment: null, + // Nodes have their start and end characters offsets recorded in + // `start` and `end` properties (directly on the node, rather than + // the `loc` object, which holds line/column data. To also add a + // [semi-standardized][range] `range` property holding a `[start, + // end]` array with the same numbers, set the `ranges` option to + // `true`. + // + // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + ranges: false, + // It is possible to parse multiple files into a single AST by + // passing the tree produced by parsing the first file as + // `program` option in subsequent parses. This will add the + // toplevel forms of the parsed file to the `Program` (top) node + // of an existing parse tree. + program: null, + // When `locations` is on, you can pass this to record the source + // file in every node's `loc` object. + sourceFile: null, + // This value, if given, is stored in every node, whether + // `locations` is on or off. + directSourceFile: null, + // When enabled, parenthesized expressions are represented by + // (non-standard) ParenthesizedExpression nodes + preserveParens: false + }; + + // Interpret and default an options object + + function getOptions(opts) { + var options = {}; + + for (var opt in defaultOptions) + { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } + + if (options.ecmaVersion >= 2015) + { options.ecmaVersion -= 2009; } + + if (options.allowReserved == null) + { options.allowReserved = options.ecmaVersion < 5; } + + if (isArray(options.onToken)) { + var tokens = options.onToken; + options.onToken = function (token) { return tokens.push(token); }; + } + if (isArray(options.onComment)) + { options.onComment = pushComment(options, options.onComment); } + + return options + } + + function pushComment(options, array) { + return function(block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? "Block" : "Line", + value: text, + start: start, + end: end + }; + if (options.locations) + { comment.loc = new SourceLocation(this, startLoc, endLoc); } + if (options.ranges) + { comment.range = [start, end]; } + array.push(comment); + } + } + + // Each scope gets a bitset that may contain these flags + var + SCOPE_TOP = 1, + SCOPE_FUNCTION = 2, + SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION, + SCOPE_ASYNC = 4, + SCOPE_GENERATOR = 8, + SCOPE_ARROW = 16, + SCOPE_SIMPLE_CATCH = 32, + SCOPE_SUPER = 64, + SCOPE_DIRECT_SUPER = 128; + + function functionFlags(async, generator) { + return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0) + } + + // Used in checkLVal and declareName to determine the type of a binding + var + BIND_NONE = 0, // Not a binding + BIND_VAR = 1, // Var-style binding + BIND_LEXICAL = 2, // Let- or const-style binding + BIND_FUNCTION = 3, // Function declaration + BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding + BIND_OUTSIDE = 5; // Special case for function names as bound inside the function + + var Parser = function Parser(options, input, startPos) { + this.options = options = getOptions(options); + this.sourceFile = options.sourceFile; + this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); + var reserved = ""; + if (options.allowReserved !== true) { + for (var v = options.ecmaVersion;; v--) + { if (reserved = reservedWords[v]) { break } } + if (options.sourceType === "module") { reserved += " await"; } + } + this.reservedWords = wordsRegexp(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; + this.reservedWordsStrict = wordsRegexp(reservedStrict); + this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); + this.input = String(input); + + // Used to signal to callers of `readWord1` whether the word + // contained any escape sequences. This is needed because words with + // escape sequences must not be interpreted as keywords. + this.containsEsc = false; + + // Set up token state + + // The current position of the tokenizer in the input. + if (startPos) { + this.pos = startPos; + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; + } else { + this.pos = this.lineStart = 0; + this.curLine = 1; + } + + // Properties of the current token: + // Its type + this.type = types.eof; + // For tokens that include more information than their type, the value + this.value = null; + // Its start and end offset + this.start = this.end = this.pos; + // And, if locations are used, the {line, column} object + // corresponding to those offsets + this.startLoc = this.endLoc = this.curPosition(); + + // Position information for the previous token + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + + // The context stack is used to superficially track syntactic + // context to predict whether a regular expression is allowed in a + // given position. + this.context = this.initialContext(); + this.exprAllowed = true; + + // Figure out if it's a module code. + this.inModule = options.sourceType === "module"; + this.strict = this.inModule || this.strictDirective(this.pos); + + // Used to signify the start of a potential arrow function + this.potentialArrowAt = -1; + + // Positions to delayed-check that yield/await does not exist in default parameters. + this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; + // Labels in scope. + this.labels = []; + // Thus-far undefined exports. + this.undefinedExports = {}; + + // If enabled, skip leading hashbang line. + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") + { this.skipLineComment(2); } + + // Scope tracking for duplicate variable names (see scope.js) + this.scopeStack = []; + this.enterScope(SCOPE_TOP); + + // For RegExp validation + this.regexpState = null; + }; + + var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true } }; + + Parser.prototype.parse = function parse () { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node) + }; + + prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; + prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }; + prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }; + prototypeAccessors.allowSuper.get = function () { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 }; + prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; + prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; + + // Switch to a getter for 7.0.0. + Parser.prototype.inNonArrowFunction = function inNonArrowFunction () { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 }; + + Parser.extend = function extend () { + var plugins = [], len = arguments.length; + while ( len-- ) plugins[ len ] = arguments[ len ]; + + var cls = this; + for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); } + return cls + }; + + Parser.parse = function parse (input, options) { + return new this(options, input).parse() + }; + + Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) { + var parser = new this(options, input, pos); + parser.nextToken(); + return parser.parseExpression() + }; + + Parser.tokenizer = function tokenizer (input, options) { + return new this(options, input) + }; + + Object.defineProperties( Parser.prototype, prototypeAccessors ); + + var pp = Parser.prototype; + + // ## Parser utilities + + var literal = /^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)")/; + pp.strictDirective = function(start) { + for (;;) { + // Try to find string literal. + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this.input)[0].length; + var match = literal.exec(this.input.slice(start)); + if (!match) { return false } + if ((match[1] || match[2]) === "use strict") { return true } + start += match[0].length; + + // Skip semicolon, if any. + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this.input)[0].length; + if (this.input[start] === ";") + { start++; } + } + }; + + // Predicate that tests whether the next token is of the given + // type, and if yes, consumes it as a side effect. + + pp.eat = function(type) { + if (this.type === type) { + this.next(); + return true + } else { + return false + } + }; + + // Tests whether parsed token is a contextual keyword. + + pp.isContextual = function(name) { + return this.type === types.name && this.value === name && !this.containsEsc + }; + + // Consumes contextual keyword if possible. + + pp.eatContextual = function(name) { + if (!this.isContextual(name)) { return false } + this.next(); + return true + }; + + // Asserts that following token is given contextual keyword. + + pp.expectContextual = function(name) { + if (!this.eatContextual(name)) { this.unexpected(); } + }; + + // Test whether a semicolon can be inserted at the current position. + + pp.canInsertSemicolon = function() { + return this.type === types.eof || + this.type === types.braceR || + lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) + }; + + pp.insertSemicolon = function() { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) + { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } + return true + } + }; + + // Consume a semicolon, or, failing that, see if we are allowed to + // pretend that there is a semicolon at this position. + + pp.semicolon = function() { + if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); } + }; + + pp.afterTrailingComma = function(tokType, notNext) { + if (this.type === tokType) { + if (this.options.onTrailingComma) + { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } + if (!notNext) + { this.next(); } + return true + } + }; + + // Expect a token of a given type. If found, consume it, otherwise, + // raise an unexpected token error. + + pp.expect = function(type) { + this.eat(type) || this.unexpected(); + }; + + // Raise an unexpected token error. + + pp.unexpected = function(pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token"); + }; + + function DestructuringErrors() { + this.shorthandAssign = + this.trailingComma = + this.parenthesizedAssign = + this.parenthesizedBind = + this.doubleProto = + -1; + } + + pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { + if (!refDestructuringErrors) { return } + if (refDestructuringErrors.trailingComma > -1) + { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } + var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; + if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } + }; + + pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + if (!refDestructuringErrors) { return false } + var shorthandAssign = refDestructuringErrors.shorthandAssign; + var doubleProto = refDestructuringErrors.doubleProto; + if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 } + if (shorthandAssign >= 0) + { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); } + if (doubleProto >= 0) + { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } + }; + + pp.checkYieldAwaitInDefaultParams = function() { + if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) + { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } + if (this.awaitPos) + { this.raise(this.awaitPos, "Await expression cannot be a default value"); } + }; + + pp.isSimpleAssignTarget = function(expr) { + if (expr.type === "ParenthesizedExpression") + { return this.isSimpleAssignTarget(expr.expression) } + return expr.type === "Identifier" || expr.type === "MemberExpression" + }; + + var pp$1 = Parser.prototype; + + // ### Statement parsing + + // Parse a program. Initializes the parser, reads any number of + // statements, and wraps them in a Program node. Optionally takes a + // `program` argument. If present, the statements will be appended + // to its body instead of creating a new node. + + pp$1.parseTopLevel = function(node) { + var exports = {}; + if (!node.body) { node.body = []; } + while (this.type !== types.eof) { + var stmt = this.parseStatement(null, true, exports); + node.body.push(stmt); + } + if (this.inModule) + { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) + { + var name = list[i]; + + this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined")); + } } + this.adaptDirectivePrologue(node.body); + this.next(); + node.sourceType = this.options.sourceType; + return this.finishNode(node, "Program") + }; + + var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; + + pp$1.isLet = function(context) { + if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + // For ambiguous cases, determine if a LexicalDeclaration (or only a + // Statement) is allowed here. If context is not empty then only a Statement + // is allowed. However, `let [` is an explicit negative lookahead for + // ExpressionStatement, so special-case it first. + if (nextCh === 91) { return true } // '[' + if (context) { return false } + + if (nextCh === 123) { return true } // '{' + if (isIdentifierStart(nextCh, true)) { + var pos = next + 1; + while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; } + var ident = this.input.slice(next, pos); + if (!keywordRelationalOperator.test(ident)) { return true } + } + return false + }; + + // check 'async [no LineTerminator here] function' + // - 'async /*foo*/ function' is OK. + // - 'async /*\n*/ function' is invalid. + pp$1.isAsyncFunction = function() { + if (this.options.ecmaVersion < 8 || !this.isContextual("async")) + { return false } + + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length; + return !lineBreak.test(this.input.slice(this.pos, next)) && + this.input.slice(next, next + 8) === "function" && + (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8))) + }; + + // Parse a single statement. + // + // If expecting a statement and finding a slash operator, parse a + // regular expression literal. This is to handle cases like + // `if (foo) /blah/.exec(foo)`, where looking at the previous token + // does not help. + + pp$1.parseStatement = function(context, topLevel, exports) { + var starttype = this.type, node = this.startNode(), kind; + + if (this.isLet(context)) { + starttype = types._var; + kind = "let"; + } + + // Most types of statements are recognized by the keyword they + // start with. Many are trivial to parse, some require a bit of + // complexity. + + switch (starttype) { + case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword) + case types._debugger: return this.parseDebuggerStatement(node) + case types._do: return this.parseDoStatement(node) + case types._for: return this.parseForStatement(node) + case types._function: + // Function as sole body of either an if statement or a labeled statement + // works, but not when it is part of a labeled statement that is the sole + // body of an if statement. + if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } + return this.parseFunctionStatement(node, false, !context) + case types._class: + if (context) { this.unexpected(); } + return this.parseClass(node, true) + case types._if: return this.parseIfStatement(node) + case types._return: return this.parseReturnStatement(node) + case types._switch: return this.parseSwitchStatement(node) + case types._throw: return this.parseThrowStatement(node) + case types._try: return this.parseTryStatement(node) + case types._const: case types._var: + kind = kind || this.value; + if (context && kind !== "var") { this.unexpected(); } + return this.parseVarStatement(node, kind) + case types._while: return this.parseWhileStatement(node) + case types._with: return this.parseWithStatement(node) + case types.braceL: return this.parseBlock(true, node) + case types.semi: return this.parseEmptyStatement(node) + case types._export: + case types._import: + if (this.options.ecmaVersion > 10 && starttype === types._import) { + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 40) // '(' + { return this.parseExpressionStatement(node, this.parseExpression()) } + } + + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) + { this.raise(this.start, "'import' and 'export' may only appear at the top level"); } + if (!this.inModule) + { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } + } + return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports) + + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + default: + if (this.isAsyncFunction()) { + if (context) { this.unexpected(); } + this.next(); + return this.parseFunctionStatement(node, true, !context) + } + + var maybeName = this.value, expr = this.parseExpression(); + if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) + { return this.parseLabeledStatement(node, maybeName, expr, context) } + else { return this.parseExpressionStatement(node, expr) } + } + }; + + pp$1.parseBreakContinueStatement = function(node, keyword) { + var isBreak = keyword === "break"; + this.next(); + if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; } + else if (this.type !== types.name) { this.unexpected(); } + else { + node.label = this.parseIdent(); + this.semicolon(); + } + + // Verify that there is an actual destination to break or + // continue to. + var i = 0; + for (; i < this.labels.length; ++i) { + var lab = this.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) { break } + if (node.label && isBreak) { break } + } + } + if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); } + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") + }; + + pp$1.parseDebuggerStatement = function(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement") + }; + + pp$1.parseDoStatement = function(node) { + this.next(); + this.labels.push(loopLabel); + node.body = this.parseStatement("do"); + this.labels.pop(); + this.expect(types._while); + node.test = this.parseParenExpression(); + if (this.options.ecmaVersion >= 6) + { this.eat(types.semi); } + else + { this.semicolon(); } + return this.finishNode(node, "DoWhileStatement") + }; + + // Disambiguating between a `for` and a `for`/`in` or `for`/`of` + // loop is non-trivial. Basically, we have to parse the init `var` + // statement or expression, disallowing the `in` operator (see + // the second parameter to `parseExpression`), and then check + // whether the next token is `in` or `of`. When there is no init + // part (semicolon immediately after the opening parenthesis), it + // is a regular `for` loop. + + pp$1.parseForStatement = function(node) { + this.next(); + var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1; + this.labels.push(loopLabel); + this.enterScope(0); + this.expect(types.parenL); + if (this.type === types.semi) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, null) + } + var isLet = this.isLet(); + if (this.type === types._var || this.type === types._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value; + this.next(); + this.parseVar(init$1, true, kind); + this.finishNode(init$1, "VariableDeclaration"); + if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } + return this.parseForIn(node, init$1) + } + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init$1) + } + var refDestructuringErrors = new DestructuringErrors; + var init = this.parseExpression(true, refDestructuringErrors); + if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } + this.toAssignable(init, false, refDestructuringErrors); + this.checkLVal(init); + return this.parseForIn(node, init) + } else { + this.checkExpressionErrors(refDestructuringErrors, true); + } + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init) + }; + + pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) { + this.next(); + return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) + }; + + pp$1.parseIfStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + // allow function declarations in branches, but only in non-strict mode + node.consequent = this.parseStatement("if"); + node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; + return this.finishNode(node, "IfStatement") + }; + + pp$1.parseReturnStatement = function(node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) + { this.raise(this.start, "'return' outside of function"); } + this.next(); + + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. + + if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; } + else { node.argument = this.parseExpression(); this.semicolon(); } + return this.finishNode(node, "ReturnStatement") + }; + + pp$1.parseSwitchStatement = function(node) { + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(types.braceL); + this.labels.push(switchLabel); + this.enterScope(0); + + // Statements under must be grouped (by label) in SwitchCase + // nodes. `cur` is used to keep the node that we are currently + // adding statements to. + + var cur; + for (var sawDefault = false; this.type !== types.braceR;) { + if (this.type === types._case || this.type === types._default) { + var isCase = this.type === types._case; + if (cur) { this.finishNode(cur, "SwitchCase"); } + node.cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); } + sawDefault = true; + cur.test = null; + } + this.expect(types.colon); + } else { + if (!cur) { this.unexpected(); } + cur.consequent.push(this.parseStatement(null)); + } + } + this.exitScope(); + if (cur) { this.finishNode(cur, "SwitchCase"); } + this.next(); // Closing brace + this.labels.pop(); + return this.finishNode(node, "SwitchStatement") + }; + + pp$1.parseThrowStatement = function(node) { + this.next(); + if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) + { this.raise(this.lastTokEnd, "Illegal newline after throw"); } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement") + }; + + // Reused empty array added for node fields that are always empty. + + var empty = []; + + pp$1.parseTryStatement = function(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === types._catch) { + var clause = this.startNode(); + this.next(); + if (this.eat(types.parenL)) { + clause.param = this.parseBindingAtom(); + var simple = clause.param.type === "Identifier"; + this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); + this.checkLVal(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); + this.expect(types.parenR); + } else { + if (this.options.ecmaVersion < 10) { this.unexpected(); } + clause.param = null; + this.enterScope(0); + } + clause.body = this.parseBlock(false); + this.exitScope(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) + { this.raise(node.start, "Missing catch or finally clause"); } + return this.finishNode(node, "TryStatement") + }; + + pp$1.parseVarStatement = function(node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration") + }; + + pp$1.parseWhileStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel); + node.body = this.parseStatement("while"); + this.labels.pop(); + return this.finishNode(node, "WhileStatement") + }; + + pp$1.parseWithStatement = function(node) { + if (this.strict) { this.raise(this.start, "'with' in strict mode"); } + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement("with"); + return this.finishNode(node, "WithStatement") + }; + + pp$1.parseEmptyStatement = function(node) { + this.next(); + return this.finishNode(node, "EmptyStatement") + }; + + pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { + for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) + { + var label = list[i$1]; + + if (label.name === maybeName) + { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } } + var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null; + for (var i = this.labels.length - 1; i >= 0; i--) { + var label$1 = this.labels[i]; + if (label$1.statementStart === node.start) { + // Update information about previous labels on this node + label$1.statementStart = this.start; + label$1.kind = kind; + } else { break } + } + this.labels.push({name: maybeName, kind: kind, statementStart: this.start}); + node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); + this.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement") + }; + + pp$1.parseExpressionStatement = function(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement") + }; + + // Parse a semicolon-enclosed block of statements, handling `"use + // strict"` declarations when `allowStrict` is true (used for + // function bodies). + + pp$1.parseBlock = function(createNewLexicalScope, node) { + if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; + if ( node === void 0 ) node = this.startNode(); + + node.body = []; + this.expect(types.braceL); + if (createNewLexicalScope) { this.enterScope(0); } + while (!this.eat(types.braceR)) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + if (createNewLexicalScope) { this.exitScope(); } + return this.finishNode(node, "BlockStatement") + }; + + // Parse a regular `for` loop. The disambiguation code in + // `parseStatement` will already have parsed the init statement or + // expression. + + pp$1.parseFor = function(node, init) { + node.init = init; + this.expect(types.semi); + node.test = this.type === types.semi ? null : this.parseExpression(); + this.expect(types.semi); + node.update = this.type === types.parenR ? null : this.parseExpression(); + this.expect(types.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, "ForStatement") + }; + + // Parse a `for`/`in` and `for`/`of` loop, which are almost + // same from parser's perspective. + + pp$1.parseForIn = function(node, init) { + var isForIn = this.type === types._in; + this.next(); + + if ( + init.type === "VariableDeclaration" && + init.declarations[0].init != null && + ( + !isForIn || + this.options.ecmaVersion < 8 || + this.strict || + init.kind !== "var" || + init.declarations[0].id.type !== "Identifier" + ) + ) { + this.raise( + init.start, + ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer") + ); + } else if (init.type === "AssignmentPattern") { + this.raise(init.start, "Invalid left-hand side in for-loop"); + } + node.left = init; + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); + this.expect(types.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement") + }; + + // Parse a list of variable declarations. + + pp$1.parseVar = function(node, isFor, kind) { + node.declarations = []; + node.kind = kind; + for (;;) { + var decl = this.startNode(); + this.parseVarId(decl, kind); + if (this.eat(types.eq)) { + decl.init = this.parseMaybeAssign(isFor); + } else if (kind === "const" && !(this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { + this.unexpected(); + } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types._in || this.isContextual("of")))) { + this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(types.comma)) { break } + } + return node + }; + + pp$1.parseVarId = function(decl, kind) { + decl.id = this.parseBindingAtom(); + this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); + }; + + var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4; + + // Parse a function declaration or literal (depending on the + // `statement & FUNC_STATEMENT`). + + // Remove `allowExpressionBody` for 7.0.0, as it is only called with false + pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) { + this.initFunction(node); + if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { + if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT)) + { this.unexpected(); } + node.generator = this.eat(types.star); + } + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } + + if (statement & FUNC_STATEMENT) { + node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent(); + if (node.id && !(statement & FUNC_HANGING_STATEMENT)) + // If it is a regular function declaration in sloppy mode, then it is + // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding + // mode depends on properties of the current scope (see + // treatFunctionsAsVar). + { this.checkLVal(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); } + } + + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(node.async, node.generator)); + + if (!(statement & FUNC_STATEMENT)) + { node.id = this.type === types.name ? this.parseIdent() : null; } + + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody, false); + + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") + }; + + pp$1.parseFunctionParams = function(node) { + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + }; + + // Parse a class declaration or literal (depending on the + // `isStatement` parameter). + + pp$1.parseClass = function(node, isStatement) { + this.next(); + + // ecma-262 14.6 Class Definitions + // A class definition is always strict mode code. + var oldStrict = this.strict; + this.strict = true; + + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + var element = this.parseClassElement(node.superClass !== null); + if (element) { + classBody.body.push(element); + if (element.type === "MethodDefinition" && element.kind === "constructor") { + if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); } + hadConstructor = true; + } + } + } + node.body = this.finishNode(classBody, "ClassBody"); + this.strict = oldStrict; + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") + }; + + pp$1.parseClassElement = function(constructorAllowsSuper) { + var this$1 = this; + + if (this.eat(types.semi)) { return null } + + var method = this.startNode(); + var tryContextual = function (k, noLineBreak) { + if ( noLineBreak === void 0 ) noLineBreak = false; + + var start = this$1.start, startLoc = this$1.startLoc; + if (!this$1.eatContextual(k)) { return false } + if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true } + if (method.key) { this$1.unexpected(); } + method.computed = false; + method.key = this$1.startNodeAt(start, startLoc); + method.key.name = k; + this$1.finishNode(method.key, "Identifier"); + return false + }; + + method.kind = "method"; + method.static = tryContextual("static"); + var isGenerator = this.eat(types.star); + var isAsync = false; + if (!isGenerator) { + if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + } else if (tryContextual("get")) { + method.kind = "get"; + } else if (tryContextual("set")) { + method.kind = "set"; + } + } + if (!method.key) { this.parsePropertyName(method); } + var key = method.key; + var allowsDirectSuper = false; + if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" || + key.type === "Literal" && key.value === "constructor")) { + if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); } + if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } + if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } + method.kind = "constructor"; + allowsDirectSuper = constructorAllowsSuper; + } else if (method.static && key.type === "Identifier" && key.name === "prototype") { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper); + if (method.kind === "get" && method.value.params.length !== 0) + { this.raiseRecoverable(method.value.start, "getter should have no params"); } + if (method.kind === "set" && method.value.params.length !== 1) + { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); } + if (method.kind === "set" && method.value.params[0].type === "RestElement") + { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); } + return method + }; + + pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + return this.finishNode(method, "MethodDefinition") + }; + + pp$1.parseClassId = function(node, isStatement) { + if (this.type === types.name) { + node.id = this.parseIdent(); + if (isStatement) + { this.checkLVal(node.id, BIND_LEXICAL, false); } + } else { + if (isStatement === true) + { this.unexpected(); } + node.id = null; + } + }; + + pp$1.parseClassSuper = function(node) { + node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null; + }; + + // Parses module export declaration. + + pp$1.parseExport = function(node, exports) { + this.next(); + // export * from '...' + if (this.eat(types.star)) { + this.expectContextual("from"); + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration") + } + if (this.eat(types._default)) { // export default ... + this.checkExport(exports, "default", this.lastTokStart); + var isAsync; + if (this.type === types._function || (isAsync = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync) { this.next(); } + node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); + } else if (this.type === types._class) { + var cNode = this.startNode(); + node.declaration = this.parseClass(cNode, "nullableID"); + } else { + node.declaration = this.parseMaybeAssign(); + this.semicolon(); + } + return this.finishNode(node, "ExportDefaultDeclaration") + } + // export var|const|let|function|class ... + if (this.shouldParseExportStatement()) { + node.declaration = this.parseStatement(null); + if (node.declaration.type === "VariableDeclaration") + { this.checkVariableExport(exports, node.declaration.declarations); } + else + { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); } + node.specifiers = []; + node.source = null; + } else { // export { x, y as z } [from '...'] + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports); + if (this.eatContextual("from")) { + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + } else { + for (var i = 0, list = node.specifiers; i < list.length; i += 1) { + // check for keywords used as local names + var spec = list[i]; + + this.checkUnreserved(spec.local); + // check if export is defined + this.checkLocalExport(spec.local); + } + + node.source = null; + } + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration") + }; + + pp$1.checkExport = function(exports, name, pos) { + if (!exports) { return } + if (has(exports, name)) + { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } + exports[name] = true; + }; + + pp$1.checkPatternExport = function(exports, pat) { + var type = pat.type; + if (type === "Identifier") + { this.checkExport(exports, pat.name, pat.start); } + else if (type === "ObjectPattern") + { for (var i = 0, list = pat.properties; i < list.length; i += 1) + { + var prop = list[i]; + + this.checkPatternExport(exports, prop); + } } + else if (type === "ArrayPattern") + { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { + var elt = list$1[i$1]; + + if (elt) { this.checkPatternExport(exports, elt); } + } } + else if (type === "Property") + { this.checkPatternExport(exports, pat.value); } + else if (type === "AssignmentPattern") + { this.checkPatternExport(exports, pat.left); } + else if (type === "RestElement") + { this.checkPatternExport(exports, pat.argument); } + else if (type === "ParenthesizedExpression") + { this.checkPatternExport(exports, pat.expression); } + }; + + pp$1.checkVariableExport = function(exports, decls) { + if (!exports) { return } + for (var i = 0, list = decls; i < list.length; i += 1) + { + var decl = list[i]; + + this.checkPatternExport(exports, decl.id); + } + }; + + pp$1.shouldParseExportStatement = function() { + return this.type.keyword === "var" || + this.type.keyword === "const" || + this.type.keyword === "class" || + this.type.keyword === "function" || + this.isLet() || + this.isAsyncFunction() + }; + + // Parses a comma-separated list of module exports. + + pp$1.parseExportSpecifiers = function(exports) { + var nodes = [], first = true; + // export { x, y as z } [from '...'] + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + if (!first) { + this.expect(types.comma); + if (this.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var node = this.startNode(); + node.local = this.parseIdent(true); + node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local; + this.checkExport(exports, node.exported.name, node.exported.start); + nodes.push(this.finishNode(node, "ExportSpecifier")); + } + return nodes + }; + + // Parses import declaration. + + pp$1.parseImport = function(node) { + this.next(); + // import '...' + if (this.type === types.string) { + node.specifiers = empty; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration") + }; + + // Parses a comma-separated list of module imports. + + pp$1.parseImportSpecifiers = function() { + var nodes = [], first = true; + if (this.type === types.name) { + // import defaultObj, { x, y as z } from '...' + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLVal(node.local, BIND_LEXICAL); + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); + if (!this.eat(types.comma)) { return nodes } + } + if (this.type === types.star) { + var node$1 = this.startNode(); + this.next(); + this.expectContextual("as"); + node$1.local = this.parseIdent(); + this.checkLVal(node$1.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); + return nodes + } + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + if (!first) { + this.expect(types.comma); + if (this.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var node$2 = this.startNode(); + node$2.imported = this.parseIdent(true); + if (this.eatContextual("as")) { + node$2.local = this.parseIdent(); + } else { + this.checkUnreserved(node$2.imported); + node$2.local = node$2.imported; + } + this.checkLVal(node$2.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$2, "ImportSpecifier")); + } + return nodes + }; + + // Set `ExpressionStatement#directive` property for directive prologues. + pp$1.adaptDirectivePrologue = function(statements) { + for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { + statements[i].directive = statements[i].expression.raw.slice(1, -1); + } + }; + pp$1.isDirectiveCandidate = function(statement) { + return ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" && + typeof statement.expression.value === "string" && + // Reject parenthesized strings. + (this.input[statement.start] === "\"" || this.input[statement.start] === "'") + ) + }; + + var pp$2 = Parser.prototype; + + // Convert existing expression atom to assignable pattern + // if possible. + + pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + if (this.inAsync && node.name === "await") + { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); } + break + + case "ObjectPattern": + case "ArrayPattern": + case "RestElement": + break + + case "ObjectExpression": + node.type = "ObjectPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + for (var i = 0, list = node.properties; i < list.length; i += 1) { + var prop = list[i]; + + this.toAssignable(prop, isBinding); + // Early error: + // AssignmentRestProperty[Yield, Await] : + // `...` DestructuringAssignmentTarget[Yield, Await] + // + // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|. + if ( + prop.type === "RestElement" && + (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern") + ) { + this.raise(prop.argument.start, "Unexpected token"); + } + } + break + + case "Property": + // AssignmentProperty has type === "Property" + if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); } + this.toAssignable(node.value, isBinding); + break + + case "ArrayExpression": + node.type = "ArrayPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + this.toAssignableList(node.elements, isBinding); + break + + case "SpreadElement": + node.type = "RestElement"; + this.toAssignable(node.argument, isBinding); + if (node.argument.type === "AssignmentPattern") + { this.raise(node.argument.start, "Rest elements cannot have a default value"); } + break + + case "AssignmentExpression": + if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding); + // falls through to AssignmentPattern + + case "AssignmentPattern": + break + + case "ParenthesizedExpression": + this.toAssignable(node.expression, isBinding, refDestructuringErrors); + break + + case "MemberExpression": + if (!isBinding) { break } + + default: + this.raise(node.start, "Assigning to rvalue"); + } + } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + return node + }; + + // Convert list of expression atoms to binding list. + + pp$2.toAssignableList = function(exprList, isBinding) { + var end = exprList.length; + for (var i = 0; i < end; i++) { + var elt = exprList[i]; + if (elt) { this.toAssignable(elt, isBinding); } + } + if (end) { + var last = exprList[end - 1]; + if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") + { this.unexpected(last.argument.start); } + } + return exprList + }; + + // Parses spread element. + + pp$2.parseSpread = function(refDestructuringErrors) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refDestructuringErrors); + return this.finishNode(node, "SpreadElement") + }; + + pp$2.parseRestBinding = function() { + var node = this.startNode(); + this.next(); + + // RestElement inside of a function parameter must be an identifier + if (this.options.ecmaVersion === 6 && this.type !== types.name) + { this.unexpected(); } + + node.argument = this.parseBindingAtom(); + + return this.finishNode(node, "RestElement") + }; + + // Parses lvalue (assignable) atom. + + pp$2.parseBindingAtom = function() { + if (this.options.ecmaVersion >= 6) { + switch (this.type) { + case types.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(types.bracketR, true, true); + return this.finishNode(node, "ArrayPattern") + + case types.braceL: + return this.parseObj(true) + } + } + return this.parseIdent() + }; + + pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { + var elts = [], first = true; + while (!this.eat(close)) { + if (first) { first = false; } + else { this.expect(types.comma); } + if (allowEmpty && this.type === types.comma) { + elts.push(null); + } else if (allowTrailingComma && this.afterTrailingComma(close)) { + break + } else if (this.type === types.ellipsis) { + var rest = this.parseRestBinding(); + this.parseBindingListItem(rest); + elts.push(rest); + if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + this.expect(close); + break + } else { + var elem = this.parseMaybeDefault(this.start, this.startLoc); + this.parseBindingListItem(elem); + elts.push(elem); + } + } + return elts + }; + + pp$2.parseBindingListItem = function(param) { + return param + }; + + // Parses assignment pattern around given atom if possible. + + pp$2.parseMaybeDefault = function(startPos, startLoc, left) { + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern") + }; + + // Verify that a node is an lval — something that can be assigned + // to. + // bindingType can be either: + // 'var' indicating that the lval creates a 'var' binding + // 'let' indicating that the lval creates a lexical ('let' or 'const') binding + // 'none' indicating that the binding should be checked for illegal identifiers, but not for duplicate references + + pp$2.checkLVal = function(expr, bindingType, checkClashes) { + if ( bindingType === void 0 ) bindingType = BIND_NONE; + + switch (expr.type) { + case "Identifier": + if (bindingType === BIND_LEXICAL && expr.name === "let") + { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) + { this.raiseRecoverable(expr.start, (bindingType ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } + if (checkClashes) { + if (has(checkClashes, expr.name)) + { this.raiseRecoverable(expr.start, "Argument name clash"); } + checkClashes[expr.name] = true; + } + if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } + break + + case "MemberExpression": + if (bindingType) { this.raiseRecoverable(expr.start, "Binding member expression"); } + break + + case "ObjectPattern": + for (var i = 0, list = expr.properties; i < list.length; i += 1) + { + var prop = list[i]; + + this.checkLVal(prop, bindingType, checkClashes); + } + break + + case "Property": + // AssignmentProperty has type === "Property" + this.checkLVal(expr.value, bindingType, checkClashes); + break + + case "ArrayPattern": + for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { + var elem = list$1[i$1]; + + if (elem) { this.checkLVal(elem, bindingType, checkClashes); } + } + break + + case "AssignmentPattern": + this.checkLVal(expr.left, bindingType, checkClashes); + break + + case "RestElement": + this.checkLVal(expr.argument, bindingType, checkClashes); + break + + case "ParenthesizedExpression": + this.checkLVal(expr.expression, bindingType, checkClashes); + break + + default: + this.raise(expr.start, (bindingType ? "Binding" : "Assigning to") + " rvalue"); + } + }; + + // A recursive descent parser operates by defining functions for all + + var pp$3 = Parser.prototype; + + // Check if property name clashes with already added. + // Object/class getters and setters are not allowed to clash — + // either with each other or with an init property — and in + // strict mode, init properties are also not allowed to be repeated. + + pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) { + if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") + { return } + if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) + { return } + var key = prop.key; + var name; + switch (key.type) { + case "Identifier": name = key.name; break + case "Literal": name = String(key.value); break + default: return + } + var kind = prop.kind; + if (this.options.ecmaVersion >= 6) { + if (name === "__proto__" && kind === "init") { + if (propHash.proto) { + if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) { refDestructuringErrors.doubleProto = key.start; } + // Backwards-compat kludge. Can be removed in version 6.0 + else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } + } + propHash.proto = true; + } + return + } + name = "$" + name; + var other = propHash[name]; + if (other) { + var redefinition; + if (kind === "init") { + redefinition = this.strict && other.init || other.get || other.set; + } else { + redefinition = other.init || other[kind]; + } + if (redefinition) + { this.raiseRecoverable(key.start, "Redefinition of property"); } + } else { + other = propHash[name] = { + init: false, + get: false, + set: false + }; + } + other[kind] = true; + }; + + // ### Expression parsing + + // These nest, from the most general expression type at the top to + // 'atomic', nondivisible expression types at the bottom. Most of + // the functions will simply let the function(s) below them parse, + // and, *if* the syntactic construct they handle is present, wrap + // the AST node that the inner parser gave them in another node. + + // Parse a full expression. The optional arguments are used to + // forbid the `in` operator (in for loops initalization expressions) + // and provide reference for storing '=' operator inside shorthand + // property assignment in contexts where both object expression + // and object pattern might appear (so it's possible to raise + // delayed syntax error at correct position). + + pp$3.parseExpression = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeAssign(noIn, refDestructuringErrors); + if (this.type === types.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors)); } + return this.finishNode(node, "SequenceExpression") + } + return expr + }; + + // Parse an assignment expression. This includes applications of + // operators like `+=`. + + pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { + if (this.isContextual("yield")) { + if (this.inGenerator) { return this.parseYield(noIn) } + // The tokenizer will assume an expression is allowed after + // `yield`, but this isn't that kind of yield + else { this.exprAllowed = false; } + } + + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldShorthandAssign = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + oldShorthandAssign = refDestructuringErrors.shorthandAssign; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.shorthandAssign = -1; + } else { + refDestructuringErrors = new DestructuringErrors; + ownDestructuringErrors = true; + } + + var startPos = this.start, startLoc = this.startLoc; + if (this.type === types.parenL || this.type === types.name) + { this.potentialArrowAt = this.start; } + var left = this.parseMaybeConditional(noIn, refDestructuringErrors); + if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } + if (this.type.isAssign) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left; + if (!ownDestructuringErrors) { DestructuringErrors.call(refDestructuringErrors); } + refDestructuringErrors.shorthandAssign = -1; // reset because shorthand default was used correctly + this.checkLVal(left); + this.next(); + node.right = this.parseMaybeAssign(noIn); + return this.finishNode(node, "AssignmentExpression") + } else { + if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } + } + if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } + if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } + if (oldShorthandAssign > -1) { refDestructuringErrors.shorthandAssign = oldShorthandAssign; } + return left + }; + + // Parse a ternary conditional (`?:`) operator. + + pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprOps(noIn, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + if (this.eat(types.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(types.colon); + node.alternate = this.parseMaybeAssign(noIn); + return this.finishNode(node, "ConditionalExpression") + } + return expr + }; + + // Start the precedence parser. + + pp$3.parseExprOps = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors, false); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn) + }; + + // Parse binary operators with the operator precedence parsing + // algorithm. `left` is the left-hand side of the operator. + // `minPrec` provides context that allows the function to stop and + // defer further parser to one of its callers when it encounters an + // operator that has a lower precedence than the set it is parsing. + + pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { + var prec = this.type.binop; + if (prec != null && (!noIn || this.type !== types._in)) { + if (prec > minPrec) { + var logical = this.type === types.logicalOR || this.type === types.logicalAND; + var op = this.value; + this.next(); + var startPos = this.start, startLoc = this.startLoc; + var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical); + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn) + } + } + return left + }; + + pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) { + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") + }; + + // Parse unary operators, both prefix and postfix. + + pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) { + var startPos = this.start, startLoc = this.startLoc, expr; + if (this.isContextual("await") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) { + expr = this.parseAwait(); + sawUnary = true; + } else if (this.type.prefix) { + var node = this.startNode(), update = this.type === types.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(null, true); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update) { this.checkLVal(node.argument); } + else if (this.strict && node.operator === "delete" && + node.argument.type === "Identifier") + { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } + else { sawUnary = true; } + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else { + expr = this.parseExprSubscripts(refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + while (this.type.postfix && !this.canInsertSemicolon()) { + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.operator = this.value; + node$1.prefix = false; + node$1.argument = expr; + this.checkLVal(expr); + this.next(); + expr = this.finishNode(node$1, "UpdateExpression"); + } + } + + if (!sawUnary && this.eat(types.starstar)) + { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) } + else + { return expr } + }; + + // Parse call, dot, and `[]`-subscript expressions. + + pp$3.parseExprSubscripts = function(refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors); + var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")"; + if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) { return expr } + var result = this.parseSubscripts(expr, startPos, startLoc); + if (refDestructuringErrors && result.type === "MemberExpression") { + if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } + if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } + } + return result + }; + + pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { + var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && + this.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async"; + while (true) { + var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow); + if (element === base || element.type === "ArrowFunctionExpression") { return element } + base = element; + } + }; + + pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow) { + var computed = this.eat(types.bracketL); + if (computed || this.eat(types.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never"); + node.computed = !!computed; + if (computed) { this.expect(types.bracketR); } + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(types.parenL)) { + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8 && base.type !== "Import", false, refDestructuringErrors); + if (maybeAsyncArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + if (this.awaitIdentPos > 0) + { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); } + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true) + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.callee = base; + node$1.arguments = exprList; + if (node$1.callee.type === "Import") { + if (node$1.arguments.length !== 1) { + this.raise(node$1.start, "import() requires exactly one argument"); + } + + var importArg = node$1.arguments[0]; + if (importArg && importArg.type === "SpreadElement") { + this.raise(importArg.start, "... is not allowed in import()"); + } + } + base = this.finishNode(node$1, "CallExpression"); + } else if (this.type === types.backQuote) { + var node$2 = this.startNodeAt(startPos, startLoc); + node$2.tag = base; + node$2.quasi = this.parseTemplate({isTagged: true}); + base = this.finishNode(node$2, "TaggedTemplateExpression"); + } + return base + }; + + // Parse an atomic expression — either a single token that is an + // expression, an expression started by a keyword like `function` or + // `new`, or an expression wrapped in punctuation like `()`, `[]`, + // or `{}`. + + pp$3.parseExprAtom = function(refDestructuringErrors) { + // If a division operator appears in an expression position, the + // tokenizer got confused, and we force it to read a regexp instead. + if (this.type === types.slash) { this.readRegexp(); } + + var node, canBeArrow = this.potentialArrowAt === this.start; + switch (this.type) { + case types._super: + if (!this.allowSuper) + { this.raise(this.start, "'super' keyword outside a method"); } + node = this.startNode(); + this.next(); + if (this.type === types.parenL && !this.allowDirectSuper) + { this.raise(node.start, "super() call outside constructor of a subclass"); } + // The `super` keyword can appear at below: + // SuperProperty: + // super [ Expression ] + // super . IdentifierName + // SuperCall: + // super Arguments + if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL) + { this.unexpected(); } + return this.finishNode(node, "Super") + + case types._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression") + + case types.name: + var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + var id = this.parseIdent(false); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) + { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) } + if (canBeArrow && !this.canInsertSemicolon()) { + if (this.eat(types.arrow)) + { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) { + id = this.parseIdent(false); + if (this.canInsertSemicolon() || !this.eat(types.arrow)) + { this.unexpected(); } + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true) + } + } + return id + + case types.regexp: + var value = this.value; + node = this.parseLiteral(value.value); + node.regex = {pattern: value.pattern, flags: value.flags}; + return node + + case types.num: case types.string: + return this.parseLiteral(this.value) + + case types._null: case types._true: case types._false: + node = this.startNode(); + node.value = this.type === types._null ? null : this.type === types._true; + node.raw = this.type.keyword; + this.next(); + return this.finishNode(node, "Literal") + + case types.parenL: + var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow); + if (refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) + { refDestructuringErrors.parenthesizedAssign = start; } + if (refDestructuringErrors.parenthesizedBind < 0) + { refDestructuringErrors.parenthesizedBind = start; } + } + return expr + + case types.bracketL: + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors); + return this.finishNode(node, "ArrayExpression") + + case types.braceL: + return this.parseObj(false, refDestructuringErrors) + + case types._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, 0) + + case types._class: + return this.parseClass(this.startNode(), false) + + case types._new: + return this.parseNew() + + case types.backQuote: + return this.parseTemplate() + + case types._import: + if (this.options.ecmaVersion > 10) { + return this.parseDynamicImport() + } else { + return this.unexpected() + } + + default: + this.unexpected(); + } + }; + + pp$3.parseDynamicImport = function() { + var node = this.startNode(); + this.next(); + if (this.type !== types.parenL) { + this.unexpected(); + } + return this.finishNode(node, "Import") + }; + + pp$3.parseLiteral = function(value) { + var node = this.startNode(); + node.value = value; + node.raw = this.input.slice(this.start, this.end); + if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1); } + this.next(); + return this.finishNode(node, "Literal") + }; + + pp$3.parseParenExpression = function() { + this.expect(types.parenL); + var val = this.parseExpression(); + this.expect(types.parenR); + return val + }; + + pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { + var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; + if (this.options.ecmaVersion >= 6) { + this.next(); + + var innerStartPos = this.start, innerStartLoc = this.startLoc; + var exprList = [], first = true, lastIsComma = false; + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + // Do not save awaitIdentPos to allow checking awaits nested in parameters + while (this.type !== types.parenR) { + first ? first = false : this.expect(types.comma); + if (allowTrailingComma && this.afterTrailingComma(types.parenR, true)) { + lastIsComma = true; + break + } else if (this.type === types.ellipsis) { + spreadStart = this.start; + exprList.push(this.parseParenItem(this.parseRestBinding())); + if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + break + } else { + exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); + } + } + var innerEndPos = this.start, innerEndLoc = this.startLoc; + this.expect(types.parenR); + + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.parseParenArrowList(startPos, startLoc, exprList) + } + + if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } + if (spreadStart) { this.unexpected(spreadStart); } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + } else { + val = this.parseParenExpression(); + } + + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression") + } else { + return val + } + }; + + pp$3.parseParenItem = function(item) { + return item + }; + + pp$3.parseParenArrowList = function(startPos, startLoc, exprList) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList) + }; + + // New's precedence is slightly tricky. It must allow its argument to + // be a `[]` or dot subscript expression, but not a call — at least, + // not without wrapping it in parentheses. Thus, it uses the noCalls + // argument to parseSubscripts to prevent it from consuming the + // argument list. + + var empty$1 = []; + + pp$3.parseNew = function() { + var node = this.startNode(); + var meta = this.parseIdent(true); + if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) { + node.meta = meta; + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target" || containsEsc) + { this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target"); } + if (!this.inNonArrowFunction()) + { this.raiseRecoverable(node.start, "new.target can only be used in functions"); } + return this.finishNode(node, "MetaProperty") + } + var startPos = this.start, startLoc = this.startLoc; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); + if (this.options.ecmaVersion > 10 && node.callee.type === "Import") { + this.raise(node.callee.start, "Cannot use new with import(...)"); + } + if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8 && node.callee.type !== "Import", false); } + else { node.arguments = empty$1; } + return this.finishNode(node, "NewExpression") + }; + + // Parse template expression. + + pp$3.parseTemplateElement = function(ref) { + var isTagged = ref.isTagged; + + var elem = this.startNode(); + if (this.type === types.invalidTemplate) { + if (!isTagged) { + this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + } + elem.value = { + raw: this.value, + cooked: null + }; + } else { + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), + cooked: this.value + }; + } + this.next(); + elem.tail = this.type === types.backQuote; + return this.finishNode(elem, "TemplateElement") + }; + + pp$3.parseTemplate = function(ref) { + if ( ref === void 0 ) ref = {}; + var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; + + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement({isTagged: isTagged}); + node.quasis = [curElt]; + while (!curElt.tail) { + if (this.type === types.eof) { this.raise(this.pos, "Unterminated template literal"); } + this.expect(types.dollarBraceL); + node.expressions.push(this.parseExpression()); + this.expect(types.braceR); + node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged})); + } + this.next(); + return this.finishNode(node, "TemplateLiteral") + }; + + pp$3.isAsyncProp = function(prop) { + return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && + (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) && + !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) + }; + + // Parse an object literal or binding pattern. + + pp$3.parseObj = function(isPattern, refDestructuringErrors) { + var node = this.startNode(), first = true, propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(types.braceR)) { + if (!first) { + this.expect(types.comma); + if (this.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var prop = this.parseProperty(isPattern, refDestructuringErrors); + if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); } + node.properties.push(prop); + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") + }; + + pp$3.parseProperty = function(isPattern, refDestructuringErrors) { + var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; + if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) { + if (isPattern) { + prop.argument = this.parseIdent(false); + if (this.type === types.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + return this.finishNode(prop, "RestElement") + } + // To disallow parenthesized identifier via `this.toAssignable()`. + if (this.type === types.parenL && refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0) { + refDestructuringErrors.parenthesizedAssign = this.start; + } + if (refDestructuringErrors.parenthesizedBind < 0) { + refDestructuringErrors.parenthesizedBind = this.start; + } + } + // Parse argument. + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + // To disallow trailing comma via `this.toAssignable()`. + if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + // Finish + return this.finishNode(prop, "SpreadElement") + } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) + { isGenerator = this.eat(types.star); } + } + var containsEsc = this.containsEsc; + this.parsePropertyName(prop); + if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + this.parsePropertyName(prop, refDestructuringErrors); + } else { + isAsync = false; + } + this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); + return this.finishNode(prop, "Property") + }; + + pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types.colon) + { this.unexpected(); } + + if (this.eat(types.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) { + if (isPattern) { this.unexpected(); } + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync); + } else if (!isPattern && !containsEsc && + this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && + (prop.key.name === "get" || prop.key.name === "set") && + (this.type !== types.comma && this.type !== types.braceR)) { + if (isGenerator || isAsync) { this.unexpected(); } + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start = prop.value.start; + if (prop.kind === "get") + { this.raiseRecoverable(start, "getter should have no params"); } + else + { this.raiseRecoverable(start, "setter should have exactly one param"); } + } else { + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") + { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); } + } + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + if (isGenerator || isAsync) { this.unexpected(); } + this.checkUnreserved(prop.key); + if (prop.key.name === "await" && !this.awaitIdentPos) + { this.awaitIdentPos = startPos; } + prop.kind = "init"; + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else if (this.type === types.eq && refDestructuringErrors) { + if (refDestructuringErrors.shorthandAssign < 0) + { refDestructuringErrors.shorthandAssign = this.start; } + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else { + prop.value = prop.key; + } + prop.shorthand = true; + } else { this.unexpected(); } + }; + + pp$3.parsePropertyName = function(prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(types.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(types.bracketR); + return prop.key + } else { + prop.computed = false; + } + } + return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") + }; + + // Initialize empty function node. + + pp$3.initFunction = function(node) { + node.id = null; + if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } + if (this.options.ecmaVersion >= 8) { node.async = false; } + }; + + // Parse object or class method. + + pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { + var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + + this.initFunction(node); + if (this.options.ecmaVersion >= 6) + { node.generator = isGenerator; } + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } + + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); + + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false, true); + + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "FunctionExpression") + }; + + // Parse arrow function expression with given parameters. + + pp$3.parseArrowExpression = function(node, params, isAsync) { + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + + this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); + this.initFunction(node); + if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } + + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true, false); + + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "ArrowFunctionExpression") + }; + + // Parse function body and check parameters. + + pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) { + var isExpression = isArrowFunction && this.type !== types.braceL; + var oldStrict = this.strict, useStrict = false; + + if (isExpression) { + node.body = this.parseMaybeAssign(); + node.expression = true; + this.checkParams(node, false); + } else { + var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); + if (!oldStrict || nonSimple) { + useStrict = this.strictDirective(this.end); + // If this is a strict mode function, verify that argument names + // are not repeated, and it does not try to bind the words `eval` + // or `arguments`. + if (useStrict && nonSimple) + { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } + } + // Start a new scope with regard to labels and the `inFunction` + // flag (restore them to their old value afterwards). + var oldLabels = this.labels; + this.labels = []; + if (useStrict) { this.strict = true; } + + // Add the params to varDeclaredNames to ensure that an error is thrown + // if a let/const declaration in the function clashes with one of the params. + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); + node.body = this.parseBlock(false); + node.expression = false; + this.adaptDirectivePrologue(node.body.body); + this.labels = oldLabels; + } + this.exitScope(); + + // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' + if (this.strict && node.id) { this.checkLVal(node.id, BIND_OUTSIDE); } + this.strict = oldStrict; + }; + + pp$3.isSimpleParamList = function(params) { + for (var i = 0, list = params; i < list.length; i += 1) + { + var param = list[i]; + + if (param.type !== "Identifier") { return false + } } + return true + }; + + // Checks function params for various disallowed patterns such as using "eval" + // or "arguments" and duplicate parameters. + + pp$3.checkParams = function(node, allowDuplicates) { + var nameHash = {}; + for (var i = 0, list = node.params; i < list.length; i += 1) + { + var param = list[i]; + + this.checkLVal(param, BIND_VAR, allowDuplicates ? null : nameHash); + } + }; + + // Parses a comma-separated list of expressions, and returns them as + // an array. `close` is the token type that ends the list, and + // `allowEmpty` can be turned on to allow subsequent commas with + // nothing in between them to be parsed as `null` (which is needed + // for array literals). + + pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var elts = [], first = true; + while (!this.eat(close)) { + if (!first) { + this.expect(types.comma); + if (allowTrailingComma && this.afterTrailingComma(close)) { break } + } else { first = false; } + + var elt = (void 0); + if (allowEmpty && this.type === types.comma) + { elt = null; } + else if (this.type === types.ellipsis) { + elt = this.parseSpread(refDestructuringErrors); + if (refDestructuringErrors && this.type === types.comma && refDestructuringErrors.trailingComma < 0) + { refDestructuringErrors.trailingComma = this.start; } + } else { + elt = this.parseMaybeAssign(false, refDestructuringErrors); + } + elts.push(elt); + } + return elts + }; + + pp$3.checkUnreserved = function(ref) { + var start = ref.start; + var end = ref.end; + var name = ref.name; + + if (this.inGenerator && name === "yield") + { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); } + if (this.inAsync && name === "await") + { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); } + if (this.keywords.test(name)) + { this.raise(start, ("Unexpected keyword '" + name + "'")); } + if (this.options.ecmaVersion < 6 && + this.input.slice(start, end).indexOf("\\") !== -1) { return } + var re = this.strict ? this.reservedWordsStrict : this.reservedWords; + if (re.test(name)) { + if (!this.inAsync && name === "await") + { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); } + this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved")); + } + }; + + // Parse the next token as an identifier. If `liberal` is true (used + // when parsing properties), it will also convert keywords into + // identifiers. + + pp$3.parseIdent = function(liberal, isBinding) { + var node = this.startNode(); + if (this.type === types.name) { + node.name = this.value; + } else if (this.type.keyword) { + node.name = this.type.keyword; + + // To fix https://github.com/acornjs/acorn/issues/575 + // `class` and `function` keywords push new context into this.context. + // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name. + // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword + if ((node.name === "class" || node.name === "function") && + (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { + this.context.pop(); + } + } else { + this.unexpected(); + } + this.next(); + this.finishNode(node, "Identifier"); + if (!liberal) { + this.checkUnreserved(node); + if (node.name === "await" && !this.awaitIdentPos) + { this.awaitIdentPos = node.start; } + } + return node + }; + + // Parses yield expression inside generator. + + pp$3.parseYield = function(noIn) { + if (!this.yieldPos) { this.yieldPos = this.start; } + + var node = this.startNode(); + this.next(); + if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(types.star); + node.argument = this.parseMaybeAssign(noIn); + } + return this.finishNode(node, "YieldExpression") + }; + + pp$3.parseAwait = function() { + if (!this.awaitPos) { this.awaitPos = this.start; } + + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeUnary(null, true); + return this.finishNode(node, "AwaitExpression") + }; + + var pp$4 = Parser.prototype; + + // This function is used to raise exceptions on parse errors. It + // takes an offset integer (into the current `input`) to indicate + // the location of the error, attaches the position to the end + // of the error message, and then raises a `SyntaxError` with that + // message. + + pp$4.raise = function(pos, message) { + var loc = getLineInfo(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; err.loc = loc; err.raisedAt = this.pos; + throw err + }; + + pp$4.raiseRecoverable = pp$4.raise; + + pp$4.curPosition = function() { + if (this.options.locations) { + return new Position(this.curLine, this.pos - this.lineStart) + } + }; + + var pp$5 = Parser.prototype; + + var Scope = function Scope(flags) { + this.flags = flags; + // A list of var-declared names in the current lexical scope + this.var = []; + // A list of lexically-declared names in the current lexical scope + this.lexical = []; + // A list of lexically-declared FunctionDeclaration names in the current lexical scope + this.functions = []; + }; + + // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. + + pp$5.enterScope = function(flags) { + this.scopeStack.push(new Scope(flags)); + }; + + pp$5.exitScope = function() { + this.scopeStack.pop(); + }; + + // The spec says: + // > At the top level of a function, or script, function declarations are + // > treated like var declarations rather than like lexical declarations. + pp$5.treatFunctionsAsVarInScope = function(scope) { + return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) + }; + + pp$5.declareName = function(name, bindingType, pos) { + var redeclared = false; + if (bindingType === BIND_LEXICAL) { + var scope = this.currentScope(); + redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; + scope.lexical.push(name); + if (this.inModule && (scope.flags & SCOPE_TOP)) + { delete this.undefinedExports[name]; } + } else if (bindingType === BIND_SIMPLE_CATCH) { + var scope$1 = this.currentScope(); + scope$1.lexical.push(name); + } else if (bindingType === BIND_FUNCTION) { + var scope$2 = this.currentScope(); + if (this.treatFunctionsAsVar) + { redeclared = scope$2.lexical.indexOf(name) > -1; } + else + { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; } + scope$2.functions.push(name); + } else { + for (var i = this.scopeStack.length - 1; i >= 0; --i) { + var scope$3 = this.scopeStack[i]; + if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) || + !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { + redeclared = true; + break + } + scope$3.var.push(name); + if (this.inModule && (scope$3.flags & SCOPE_TOP)) + { delete this.undefinedExports[name]; } + if (scope$3.flags & SCOPE_VAR) { break } + } + } + if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } + }; + + pp$5.checkLocalExport = function(id) { + // scope.functions must be empty as Module code is always strict. + if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && + this.scopeStack[0].var.indexOf(id.name) === -1) { + this.undefinedExports[id.name] = id; + } + }; + + pp$5.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1] + }; + + pp$5.currentVarScope = function() { + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR) { return scope } + } + }; + + // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. + pp$5.currentThisScope = function() { + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } + } + }; + + var Node = function Node(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) + { this.loc = new SourceLocation(parser, loc); } + if (parser.options.directSourceFile) + { this.sourceFile = parser.options.directSourceFile; } + if (parser.options.ranges) + { this.range = [pos, 0]; } + }; + + // Start an AST node, attaching a start offset. + + var pp$6 = Parser.prototype; + + pp$6.startNode = function() { + return new Node(this, this.start, this.startLoc) + }; + + pp$6.startNodeAt = function(pos, loc) { + return new Node(this, pos, loc) + }; + + // Finish an AST node, adding `type` and `end` properties. + + function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) + { node.loc.end = loc; } + if (this.options.ranges) + { node.range[1] = pos; } + return node + } + + pp$6.finishNode = function(node, type) { + return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) + }; + + // Finish node at given position + + pp$6.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc) + }; + + // The algorithm used to determine whether a regexp can appear at a + + var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; + }; + + var types$1 = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", false), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), + f_stat: new TokContext("function", false), + f_expr: new TokContext("function", true), + f_expr_gen: new TokContext("function", true, false, null, true), + f_gen: new TokContext("function", false, false, null, true) + }; + + var pp$7 = Parser.prototype; + + pp$7.initialContext = function() { + return [types$1.b_stat] + }; + + pp$7.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types$1.f_expr || parent === types$1.f_stat) + { return true } + if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr)) + { return !parent.isExpr } + + // The check for `tt.name && exprAllowed` detects whether we are + // after a `yield` or `of` construct. See the `updateContext` for + // `tt.name`. + if (prevType === types._return || prevType === types.name && this.exprAllowed) + { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } + if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) + { return true } + if (prevType === types.braceL) + { return parent === types$1.b_stat } + if (prevType === types._var || prevType === types._const || prevType === types.name) + { return false } + return !this.exprAllowed + }; + + pp$7.inGeneratorContext = function() { + for (var i = this.context.length - 1; i >= 1; i--) { + var context = this.context[i]; + if (context.token === "function") + { return context.generator } + } + return false + }; + + pp$7.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType === types.dot) + { this.exprAllowed = false; } + else if (update = type.updateContext) + { update.call(this, prevType); } + else + { this.exprAllowed = type.beforeExpr; } + }; + + // Token-specific context update code + + types.parenR.updateContext = types.braceR.updateContext = function() { + if (this.context.length === 1) { + this.exprAllowed = true; + return + } + var out = this.context.pop(); + if (out === types$1.b_stat && this.curContext().token === "function") { + out = this.context.pop(); + } + this.exprAllowed = !out.isExpr; + }; + + types.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr); + this.exprAllowed = true; + }; + + types.dollarBraceL.updateContext = function() { + this.context.push(types$1.b_tmpl); + this.exprAllowed = true; + }; + + types.parenL.updateContext = function(prevType) { + var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; + this.context.push(statementParens ? types$1.p_stat : types$1.p_expr); + this.exprAllowed = true; + }; + + types.incDec.updateContext = function() { + // tokExprAllowed stays unchanged + }; + + types._function.updateContext = types._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && + !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && + !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) + { this.context.push(types$1.f_expr); } + else + { this.context.push(types$1.f_stat); } + this.exprAllowed = false; + }; + + types.backQuote.updateContext = function() { + if (this.curContext() === types$1.q_tmpl) + { this.context.pop(); } + else + { this.context.push(types$1.q_tmpl); } + this.exprAllowed = false; + }; + + types.star.updateContext = function(prevType) { + if (prevType === types._function) { + var index = this.context.length - 1; + if (this.context[index] === types$1.f_expr) + { this.context[index] = types$1.f_expr_gen; } + else + { this.context[index] = types$1.f_gen; } + } + this.exprAllowed = true; + }; + + types.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6 && prevType !== types.dot) { + if (this.value === "of" && !this.exprAllowed || + this.value === "yield" && this.inGeneratorContext()) + { allowed = true; } + } + this.exprAllowed = allowed; + }; + + // This file contains Unicode properties extracted from the ECMAScript + // specification. The lists are extracted like so: + // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) + + // #table-binary-unicode-properties + var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; + var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; + var ecma11BinaryProperties = ecma10BinaryProperties; + var unicodeBinaryProperties = { + 9: ecma9BinaryProperties, + 10: ecma10BinaryProperties, + 11: ecma11BinaryProperties + }; + + // #table-unicode-general-category-values + var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; + + // #table-unicode-script-values + var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; + var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; + var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; + var unicodeScriptValues = { + 9: ecma9ScriptValues, + 10: ecma10ScriptValues, + 11: ecma11ScriptValues + }; + + var data = {}; + function buildUnicodeData(ecmaVersion) { + var d = data[ecmaVersion] = { + binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), + nonBinary: { + General_Category: wordsRegexp(unicodeGeneralCategoryValues), + Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) + } + }; + d.nonBinary.Script_Extensions = d.nonBinary.Script; + + d.nonBinary.gc = d.nonBinary.General_Category; + d.nonBinary.sc = d.nonBinary.Script; + d.nonBinary.scx = d.nonBinary.Script_Extensions; + } + buildUnicodeData(9); + buildUnicodeData(10); + buildUnicodeData(11); + + var pp$8 = Parser.prototype; + + var RegExpValidationState = function RegExpValidationState(parser) { + this.parser = parser; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : ""); + this.unicodeProperties = data[parser.options.ecmaVersion >= 11 ? 11 : parser.options.ecmaVersion]; + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; + }; + + RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { + var unicode = flags.indexOf("u") !== -1; + this.start = start | 0; + this.source = pattern + ""; + this.flags = flags; + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; + }; + + RegExpValidationState.prototype.raise = function raise (message) { + this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message)); + }; + + // If u flag is given, this returns the code point at the index (it combines a surrogate pair). + // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). + RegExpValidationState.prototype.at = function at (i) { + var s = this.source; + var l = s.length; + if (i >= l) { + return -1 + } + var c = s.charCodeAt(i); + if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { + return c + } + return (c << 10) + s.charCodeAt(i + 1) - 0x35FDC00 + }; + + RegExpValidationState.prototype.nextIndex = function nextIndex (i) { + var s = this.source; + var l = s.length; + if (i >= l) { + return l + } + var c = s.charCodeAt(i); + if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { + return i + 1 + } + return i + 2 + }; + + RegExpValidationState.prototype.current = function current () { + return this.at(this.pos) + }; + + RegExpValidationState.prototype.lookahead = function lookahead () { + return this.at(this.nextIndex(this.pos)) + }; + + RegExpValidationState.prototype.advance = function advance () { + this.pos = this.nextIndex(this.pos); + }; + + RegExpValidationState.prototype.eat = function eat (ch) { + if (this.current() === ch) { + this.advance(); + return true + } + return false + }; + + function codePointToString(ch) { + if (ch <= 0xFFFF) { return String.fromCharCode(ch) } + ch -= 0x10000; + return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) + } + + /** + * Validate the flags part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ + pp$8.validateRegExpFlags = function(state) { + var validFlags = state.validFlags; + var flags = state.flags; + + for (var i = 0; i < flags.length; i++) { + var flag = flags.charAt(i); + if (validFlags.indexOf(flag) === -1) { + this.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i + 1) > -1) { + this.raise(state.start, "Duplicate regular expression flag"); + } + } + }; + + /** + * Validate the pattern part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ + pp$8.validateRegExpPattern = function(state) { + this.regexp_pattern(state); + + // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of + // parsing contains a |GroupName|, reparse with the goal symbol + // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* + // exception if _P_ did not conform to the grammar, if any elements of _P_ + // were not matched by the parse, or if any Early Error conditions exist. + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern + pp$8.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; + + this.regexp_disjunction(state); + + if (state.pos !== state.source.length) { + // Make the same messages as V8. + if (state.eat(0x29 /* ) */)) { + state.raise("Unmatched ')'"); + } + if (state.eat(0x5D /* [ */) || state.eat(0x7D /* } */)) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); + } + for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { + var name = list[i]; + + if (state.groupNames.indexOf(name) === -1) { + state.raise("Invalid named capture referenced"); + } + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction + pp$8.regexp_disjunction = function(state) { + this.regexp_alternative(state); + while (state.eat(0x7C /* | */)) { + this.regexp_alternative(state); + } + + // Make the same message as V8. + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + if (state.eat(0x7B /* { */)) { + state.raise("Lone quantifier brackets"); + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative + pp$8.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) + { } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term + pp$8.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + // Handle `QuantifiableAssertion Quantifier` alternative. + // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion + // is a QuantifiableAssertion. + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + // Make the same message as V8. + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true + } + + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true + } + + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion + pp$8.regexp_eatAssertion = function(state) { + var start = state.pos; + state.lastAssertionIsQuantifiable = false; + + // ^, $ + if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { + return true + } + + // \b \B + if (state.eat(0x5C /* \ */)) { + if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { + return true + } + state.pos = start; + } + + // Lookahead / Lookbehind + if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat(0x3C /* < */); + } + if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { + this.regexp_disjunction(state); + if (!state.eat(0x29 /* ) */)) { + state.raise("Unterminated group"); + } + state.lastAssertionIsQuantifiable = !lookbehind; + return true + } + } + + state.pos = start; + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier + pp$8.regexp_eatQuantifier = function(state, noError) { + if ( noError === void 0 ) noError = false; + + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(0x3F /* ? */); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix + pp$8.regexp_eatQuantifierPrefix = function(state, noError) { + return ( + state.eat(0x2A /* * */) || + state.eat(0x2B /* + */) || + state.eat(0x3F /* ? */) || + this.regexp_eatBracedQuantifier(state, noError) + ) + }; + pp$8.regexp_eatBracedQuantifier = function(state, noError) { + var start = state.pos; + if (state.eat(0x7B /* { */)) { + var min = 0, max = -1; + if (this.regexp_eatDecimalDigits(state)) { + min = state.lastIntValue; + if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { + max = state.lastIntValue; + } + if (state.eat(0x7D /* } */)) { + // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term + if (max !== -1 && max < min && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true + } + } + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); + } + state.pos = start; + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom + pp$8.regexp_eatAtom = function(state) { + return ( + this.regexp_eatPatternCharacters(state) || + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) + ) + }; + pp$8.regexp_eatReverseSolidusAtomEscape = function(state) { + var start = state.pos; + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatAtomEscape(state)) { + return true + } + state.pos = start; + } + return false + }; + pp$8.regexp_eatUncapturingGroup = function(state) { + var start = state.pos; + if (state.eat(0x28 /* ( */)) { + if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + return true + } + state.raise("Unterminated group"); + } + state.pos = start; + } + return false + }; + pp$8.regexp_eatCapturingGroup = function(state) { + if (state.eat(0x28 /* ( */)) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 0x3F /* ? */) { + state.raise("Invalid group"); + } + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + state.numCapturingParens += 1; + return true + } + state.raise("Unterminated group"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom + pp$8.regexp_eatExtendedAtom = function(state) { + return ( + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) || + this.regexp_eatInvalidBracedQuantifier(state) || + this.regexp_eatExtendedPatternCharacter(state) + ) + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier + pp$8.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter + pp$8.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter(ch)) { + state.lastIntValue = ch; + state.advance(); + return true + } + return false + }; + function isSyntaxCharacter(ch) { + return ( + ch === 0x24 /* $ */ || + ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || + ch === 0x2E /* . */ || + ch === 0x3F /* ? */ || + ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || + ch >= 0x7B /* { */ && ch <= 0x7D /* } */ + ) + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter + // But eat eager. + pp$8.regexp_eatPatternCharacters = function(state) { + var start = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { + state.advance(); + } + return state.pos !== start + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter + pp$8.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if ( + ch !== -1 && + ch !== 0x24 /* $ */ && + !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && + ch !== 0x2E /* . */ && + ch !== 0x3F /* ? */ && + ch !== 0x5B /* [ */ && + ch !== 0x5E /* ^ */ && + ch !== 0x7C /* | */ + ) { + state.advance(); + return true + } + return false + }; + + // GroupSpecifier[U] :: + // [empty] + // `?` GroupName[?U] + pp$8.regexp_groupSpecifier = function(state) { + if (state.eat(0x3F /* ? */)) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return + } + state.raise("Invalid group"); + } + }; + + // GroupName[U] :: + // `<` RegExpIdentifierName[?U] `>` + // Note: this updates `state.lastStringValue` property with the eaten name. + pp$8.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat(0x3C /* < */)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { + return true + } + state.raise("Invalid capture group name"); + } + return false + }; + + // RegExpIdentifierName[U] :: + // RegExpIdentifierStart[?U] + // RegExpIdentifierName[?U] RegExpIdentifierPart[?U] + // Note: this updates `state.lastStringValue` property with the eaten name. + pp$8.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + } + return true + } + return false + }; + + // RegExpIdentifierStart[U] :: + // UnicodeIDStart + // `$` + // `_` + // `\` RegExpUnicodeEscapeSequence[?U] + pp$8.regexp_eatRegExpIdentifierStart = function(state) { + var start = state.pos; + var ch = state.current(); + state.advance(); + + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart(ch)) { + state.lastIntValue = ch; + return true + } + + state.pos = start; + return false + }; + function isRegExpIdentifierStart(ch) { + return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ + } + + // RegExpIdentifierPart[U] :: + // UnicodeIDContinue + // `$` + // `_` + // `\` RegExpUnicodeEscapeSequence[?U] + // + // + pp$8.regexp_eatRegExpIdentifierPart = function(state) { + var start = state.pos; + var ch = state.current(); + state.advance(); + + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart(ch)) { + state.lastIntValue = ch; + return true + } + + state.pos = start; + return false + }; + function isRegExpIdentifierPart(ch) { + return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape + pp$8.regexp_eatAtomEscape = function(state) { + if ( + this.regexp_eatBackReference(state) || + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) || + (state.switchN && this.regexp_eatKGroupName(state)) + ) { + return true + } + if (state.switchU) { + // Make the same message as V8. + if (state.current() === 0x63 /* c */) { + state.raise("Invalid unicode escape"); + } + state.raise("Invalid escape"); + } + return false + }; + pp$8.regexp_eatBackReference = function(state) { + var start = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n = state.lastIntValue; + if (state.switchU) { + // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape + if (n > state.maxBackReference) { + state.maxBackReference = n; + } + return true + } + if (n <= state.numCapturingParens) { + return true + } + state.pos = start; + } + return false + }; + pp$8.regexp_eatKGroupName = function(state) { + if (state.eat(0x6B /* k */)) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true + } + state.raise("Invalid named reference"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape + pp$8.regexp_eatCharacterEscape = function(state) { + return ( + this.regexp_eatControlEscape(state) || + this.regexp_eatCControlLetter(state) || + this.regexp_eatZero(state) || + this.regexp_eatHexEscapeSequence(state) || + this.regexp_eatRegExpUnicodeEscapeSequence(state) || + (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || + this.regexp_eatIdentityEscape(state) + ) + }; + pp$8.regexp_eatCControlLetter = function(state) { + var start = state.pos; + if (state.eat(0x63 /* c */)) { + if (this.regexp_eatControlLetter(state)) { + return true + } + state.pos = start; + } + return false + }; + pp$8.regexp_eatZero = function(state) { + if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape + pp$8.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 0x74 /* t */) { + state.lastIntValue = 0x09; /* \t */ + state.advance(); + return true + } + if (ch === 0x6E /* n */) { + state.lastIntValue = 0x0A; /* \n */ + state.advance(); + return true + } + if (ch === 0x76 /* v */) { + state.lastIntValue = 0x0B; /* \v */ + state.advance(); + return true + } + if (ch === 0x66 /* f */) { + state.lastIntValue = 0x0C; /* \f */ + state.advance(); + return true + } + if (ch === 0x72 /* r */) { + state.lastIntValue = 0x0D; /* \r */ + state.advance(); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter + pp$8.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter(ch)) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false + }; + function isControlLetter(ch) { + return ( + (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) || + (ch >= 0x61 /* a */ && ch <= 0x7A /* z */) + ) + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence + pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state) { + var start = state.pos; + + if (state.eat(0x75 /* u */)) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (state.switchU && lead >= 0xD800 && lead <= 0xDBFF) { + var leadSurrogateEnd = state.pos; + if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 0xDC00 && trail <= 0xDFFF) { + state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; + return true + } + } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; + } + return true + } + if ( + state.switchU && + state.eat(0x7B /* { */) && + this.regexp_eatHexDigits(state) && + state.eat(0x7D /* } */) && + isValidUnicode(state.lastIntValue) + ) { + return true + } + if (state.switchU) { + state.raise("Invalid unicode escape"); + } + state.pos = start; + } + + return false + }; + function isValidUnicode(ch) { + return ch >= 0 && ch <= 0x10FFFF + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape + pp$8.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true + } + if (state.eat(0x2F /* / */)) { + state.lastIntValue = 0x2F; /* / */ + return true + } + return false + } + + var ch = state.current(); + if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { + state.lastIntValue = ch; + state.advance(); + return true + } + + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape + pp$8.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape + pp$8.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); + + if (isCharacterClassEscape(ch)) { + state.lastIntValue = -1; + state.advance(); + return true + } + + if ( + state.switchU && + this.options.ecmaVersion >= 9 && + (ch === 0x50 /* P */ || ch === 0x70 /* p */) + ) { + state.lastIntValue = -1; + state.advance(); + if ( + state.eat(0x7B /* { */) && + this.regexp_eatUnicodePropertyValueExpression(state) && + state.eat(0x7D /* } */) + ) { + return true + } + state.raise("Invalid property name"); + } + + return false + }; + function isCharacterClassEscape(ch) { + return ( + ch === 0x64 /* d */ || + ch === 0x44 /* D */ || + ch === 0x73 /* s */ || + ch === 0x53 /* S */ || + ch === 0x77 /* w */ || + ch === 0x57 /* W */ + ) + } + + // UnicodePropertyValueExpression :: + // UnicodePropertyName `=` UnicodePropertyValue + // LoneUnicodePropertyNameOrValue + pp$8.regexp_eatUnicodePropertyValueExpression = function(state) { + var start = state.pos; + + // UnicodePropertyName `=` UnicodePropertyValue + if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { + var name = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name, value); + return true + } + } + state.pos = start; + + // LoneUnicodePropertyNameOrValue + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); + return true + } + return false + }; + pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!has(state.unicodeProperties.nonBinary, name)) + { state.raise("Invalid property name"); } + if (!state.unicodeProperties.nonBinary[name].test(value)) + { state.raise("Invalid property value"); } + }; + pp$8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (!state.unicodeProperties.binary.test(nameOrValue)) + { state.raise("Invalid property name"); } + }; + + // UnicodePropertyName :: + // UnicodePropertyNameCharacters + pp$8.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== "" + }; + function isUnicodePropertyNameCharacter(ch) { + return isControlLetter(ch) || ch === 0x5F /* _ */ + } + + // UnicodePropertyValue :: + // UnicodePropertyValueCharacters + pp$8.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== "" + }; + function isUnicodePropertyValueCharacter(ch) { + return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch) + } + + // LoneUnicodePropertyNameOrValue :: + // UnicodePropertyValueCharacters + pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state) + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass + pp$8.regexp_eatCharacterClass = function(state) { + if (state.eat(0x5B /* [ */)) { + state.eat(0x5E /* ^ */); + this.regexp_classRanges(state); + if (state.eat(0x5D /* [ */)) { + return true + } + // Unreachable since it threw "unterminated regular expression" error before. + state.raise("Unterminated character class"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges + // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges + // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash + pp$8.regexp_classRanges = function(state) { + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + } + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash + pp$8.regexp_eatClassAtom = function(state) { + var start = state.pos; + + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatClassEscape(state)) { + return true + } + if (state.switchU) { + // Make the same message as V8. + var ch$1 = state.current(); + if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start; + } + + var ch = state.current(); + if (ch !== 0x5D /* [ */) { + state.lastIntValue = ch; + state.advance(); + return true + } + + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape + pp$8.regexp_eatClassEscape = function(state) { + var start = state.pos; + + if (state.eat(0x62 /* b */)) { + state.lastIntValue = 0x08; /* */ + return true + } + + if (state.switchU && state.eat(0x2D /* - */)) { + state.lastIntValue = 0x2D; /* - */ + return true + } + + if (!state.switchU && state.eat(0x63 /* c */)) { + if (this.regexp_eatClassControlLetter(state)) { + return true + } + state.pos = start; + } + + return ( + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) + ) + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter + pp$8.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence + pp$8.regexp_eatHexEscapeSequence = function(state) { + var start = state.pos; + if (state.eat(0x78 /* x */)) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start; + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits + pp$8.regexp_eatDecimalDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } + return state.pos !== start + }; + function isDecimalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits + pp$8.regexp_eatHexDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return state.pos !== start + }; + function isHexDigit(ch) { + return ( + (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) || + (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) || + (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) + ) + } + function hexToInt(ch) { + if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { + return 10 + (ch - 0x41 /* A */) + } + if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { + return 10 + (ch - 0x61 /* a */) + } + return ch - 0x30 /* 0 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence + // Allows only 0-377(octal) i.e. 0-255(decimal). + pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n2 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n2; + } + } else { + state.lastIntValue = n1; + } + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit + pp$8.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit(ch)) { + state.lastIntValue = ch - 0x30; /* 0 */ + state.advance(); + return true + } + state.lastIntValue = 0; + return false + }; + function isOctalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit + // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence + pp$8.regexp_eatFixedHexDigits = function(state, length) { + var start = state.pos; + state.lastIntValue = 0; + for (var i = 0; i < length; ++i) { + var ch = state.current(); + if (!isHexDigit(ch)) { + state.pos = start; + return false + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return true + }; + + // Object type used to represent tokens. Note that normally, tokens + // simply exist as properties on the parser object. This is only + // used for the onToken callback and the external tokenizer. + + var Token = function Token(p) { + this.type = p.type; + this.value = p.value; + this.start = p.start; + this.end = p.end; + if (p.options.locations) + { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } + if (p.options.ranges) + { this.range = [p.start, p.end]; } + }; + + // ## Tokenizer + + var pp$9 = Parser.prototype; + + // Move to the next token + + pp$9.next = function() { + if (this.options.onToken) + { this.options.onToken(new Token(this)); } + + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); + }; + + pp$9.getToken = function() { + this.next(); + return new Token(this) + }; + + // If we're in an ES6 environment, make parsers iterable + if (typeof Symbol !== "undefined") + { pp$9[Symbol.iterator] = function() { + var this$1 = this; + + return { + next: function () { + var token = this$1.getToken(); + return { + done: token.type === types.eof, + value: token + } + } + } + }; } + + // Toggle strict mode. Re-reads the next number or string to please + // pedantic tests (`"use strict"; 010;` should fail). + + pp$9.curContext = function() { + return this.context[this.context.length - 1] + }; + + // Read a single token, updating the parser object's token-related + // properties. + + pp$9.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } + + this.start = this.pos; + if (this.options.locations) { this.startLoc = this.curPosition(); } + if (this.pos >= this.input.length) { return this.finishToken(types.eof) } + + if (curContext.override) { return curContext.override(this) } + else { this.readToken(this.fullCharCodeAtPos()); } + }; + + pp$9.readToken = function(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) + { return this.readWord() } + + return this.getTokenFromCode(code) + }; + + pp$9.fullCharCodeAtPos = function() { + var code = this.input.charCodeAt(this.pos); + if (code <= 0xd7ff || code >= 0xe000) { return code } + var next = this.input.charCodeAt(this.pos + 1); + return (code << 10) + next - 0x35fdc00 + }; + + pp$9.skipBlockComment = function() { + var startLoc = this.options.onComment && this.curPosition(); + var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } + this.pos = end + 2; + if (this.options.locations) { + lineBreakG.lastIndex = start; + var match; + while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { + ++this.curLine; + this.lineStart = match.index + match[0].length; + } + } + if (this.options.onComment) + { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, + startLoc, this.curPosition()); } + }; + + pp$9.skipLineComment = function(startSkip) { + var start = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine(ch)) { + ch = this.input.charCodeAt(++this.pos); + } + if (this.options.onComment) + { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, + startLoc, this.curPosition()); } + }; + + // Called at the start of the parse and after every token. Skips + // whitespace and comments, and. + + pp$9.skipSpace = function() { + loop: while (this.pos < this.input.length) { + var ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 32: case 160: // ' ' + ++this.pos; + break + case 13: + if (this.input.charCodeAt(this.pos + 1) === 10) { + ++this.pos; + } + case 10: case 8232: case 8233: + ++this.pos; + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + break + case 47: // '/' + switch (this.input.charCodeAt(this.pos + 1)) { + case 42: // '*' + this.skipBlockComment(); + break + case 47: + this.skipLineComment(2); + break + default: + break loop + } + break + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this.pos; + } else { + break loop + } + } + } + }; + + // Called at the end of every token. Sets `end`, `val`, and + // maintains `context` and `exprAllowed`, and skips the space after + // the token, so that the next one's `start` will point at the + // right position. + + pp$9.finishToken = function(type, val) { + this.end = this.pos; + if (this.options.locations) { this.endLoc = this.curPosition(); } + var prevType = this.type; + this.type = type; + this.value = val; + + this.updateContext(prevType); + }; + + // ### Token reading + + // This is the function that is called to fetch the next token. It + // is somewhat obscure, because it works in character codes rather + // than characters, and because operator parsing has been inlined + // into it. + // + // All in the name of speed. + // + pp$9.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { return this.readNumber(true) } + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' + this.pos += 3; + return this.finishToken(types.ellipsis) + } else { + ++this.pos; + return this.finishToken(types.dot) + } + }; + + pp$9.readToken_slash = function() { // '/' + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { ++this.pos; return this.readRegexp() } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.slash, 1) + }; + + pp$9.readToken_mult_modulo_exp = function(code) { // '%*' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + var tokentype = code === 42 ? types.star : types.modulo; + + // exponentiation operator ** and **= + if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { + ++size; + tokentype = types.starstar; + next = this.input.charCodeAt(this.pos + 2); + } + + if (next === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(tokentype, size) + }; + + pp$9.readToken_pipe_amp = function(code) { // '|&' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1) + }; + + pp$9.readToken_caret = function() { // '^' + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.bitwiseXOR, 1) + }; + + pp$9.readToken_plus_min = function(code) { // '+-' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && + (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { + // A `-->` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken() + } + return this.finishOp(types.incDec, 2) + } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.plusMin, 1) + }; + + pp$9.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(types.bitShift, size) + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && + this.input.charCodeAt(this.pos + 3) === 45) { + // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken() + } + return this.finishOp(types.incDec, 2) + } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.plusMin, 1) +}; + +pp$9.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(types.bitShift, size) + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && + this.input.charCodeAt(this.pos + 3) === 45) { + // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // ` + +

License

+ +Unless stated otherwise all works are: + +
+ +and licensed under: + + + +

MIT License

+ +
+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.
+
+ + diff --git a/node_modules/domain-browser/README.md b/node_modules/domain-browser/README.md new file mode 100644 index 0000000..68c936b --- /dev/null +++ b/node_modules/domain-browser/README.md @@ -0,0 +1,121 @@ + + +

domain-browser

+ + + + + + +Travis CI Build Status +NPM version +NPM downloads +Dependency Status +Dev Dependency Status +
+Patreon donate button +Open Collective donate button +Gratipay donate button +Flattr donate button +PayPal donate button +Bitcoin donate button +Wishlist browse button +
+Slack community badge + + + + + + +Node's domain module for the web browser. This is merely an evented try...catch with the same API as node, nothing more. + + + + + + +

Install

+ +

NPM

    +
  • Install: npm install --save domain-browser
  • +
  • Module: require('domain-browser')
+ +

Browserify

    +
  • Install: npm install --save domain-browser
  • +
  • Module: require('domain-browser')
  • +
  • CDN URL: //wzrd.in/bundle/domain-browser@1.2.0
+ +

Ender

    +
  • Install: ender add domain-browser
  • +
  • Module: require('domain-browser')
+ +

Editions

+ +

This package is published with the following editions:

+ +
  • domain-browser aliases domain-browser/source/index.js
  • +
  • domain-browser/source/index.js is Source + ES5 + Require
+ + + + + + +

History

+ +Discover the release history by heading on over to the HISTORY.md file. + + + + + + +

Backers

+ +

Maintainers

+ +These amazing people are maintaining this project: + + + +

Sponsors

+ +No sponsors yet! Will you be the first? + +Patreon donate button +Open Collective donate button +Gratipay donate button +Flattr donate button +PayPal donate button +Bitcoin donate button +Wishlist browse button + +

Contributors

+ +These amazing people have contributed code to this project: + + + +Discover how you can contribute by heading on over to the CONTRIBUTING.md file. + + + + + + +

License

+ +Unless stated otherwise all works are: + + + +and licensed under: + + + + diff --git a/node_modules/domain-browser/package.json b/node_modules/domain-browser/package.json new file mode 100644 index 0000000..7ccfc1a --- /dev/null +++ b/node_modules/domain-browser/package.json @@ -0,0 +1,172 @@ +{ + "_from": "domain-browser@^1.1.1", + "_id": "domain-browser@1.2.0", + "_inBundle": false, + "_integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "_location": "/domain-browser", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "domain-browser@^1.1.1", + "name": "domain-browser", + "escapedName": "domain-browser", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/node-libs-browser" + ], + "_resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "_shasum": "3d31f50191a6749dd1375a7f522e823d42e54eda", + "_spec": "domain-browser@^1.1.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/node-libs-browser", + "author": { + "name": "2013+ Bevry Pty Ltd", + "email": "us@bevry.me", + "url": "http://bevry.me" + }, + "badges": { + "list": [ + "travisci", + "npmversion", + "npmdownloads", + "daviddm", + "daviddmdev", + "---", + "patreon", + "opencollective", + "gratipay", + "flattr", + "paypal", + "bitcoin", + "wishlist", + "---", + "slackin" + ], + "config": { + "patreonUsername": "bevry", + "opencollectiveUsername": "bevry", + "gratipayUsername": "bevry", + "flattrUsername": "balupton", + "paypalURL": "https://bevry.me/paypal", + "bitcoinURL": "https://bevry.me/bitcoin", + "wishlistURL": "https://bevry.me/wishlist", + "slackinURL": "https://slack.bevry.me" + } + }, + "browser": "source/index.js", + "bugs": { + "url": "https://github.com/bevry/domain-browser/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Benjamin Lupton", + "email": "b@lupton.cc", + "url": "http://balupton.com" + }, + { + "name": "Evan Solomon", + "url": "http://evansolomon.me" + }, + { + "name": "James Halliday", + "email": "substack@gmail.com", + "url": "http://substack.neocities.org/" + }, + { + "name": "Guy Bedford", + "email": "guybedford@gmail.com", + "url": "twitter.com/guybedford" + }, + { + "name": "Bogdan Chadkin", + "email": "trysound@yandex.ru", + "url": "https://github.com/TrySound" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Node's domain module for the web browser. This is merely an evented try...catch with the same API as node, nothing more.", + "devDependencies": { + "assert-helpers": "^4.5.0", + "eslint": "^4.16.0", + "joe": "^2.0.2", + "joe-reporter-console": "^2.0.1", + "projectz": "^1.4.0" + }, + "editions": [ + { + "description": "Source + ES5 + Require", + "directory": "source", + "entry": "index.js", + "syntaxes": [ + "javascript", + "es5", + "require" + ] + } + ], + "engines": { + "node": ">=0.4", + "npm": ">=1.2" + }, + "homepage": "https://github.com/bevry/domain-browser", + "jspm": { + "map": { + "source/index.js": { + "node": "@node/domain" + } + } + }, + "keywords": [ + "domain", + "trycatch", + "try", + "catch", + "node-compat", + "ender.js", + "component", + "component.io", + "umd", + "amd", + "require.js", + "browser" + ], + "license": "MIT", + "main": "source/index.js", + "maintainers": [ + { + "name": "Benjamin Lupton", + "email": "b@lupton.cc", + "url": "http://balupton.com" + } + ], + "name": "domain-browser", + "repository": { + "type": "git", + "url": "git+https://github.com/bevry/domain-browser.git" + }, + "scripts": { + "our:clean": "rm -Rf ./docs ./es2015 ./es5 ./out", + "our:compile": "echo no need for this project", + "our:meta": "npm run our:meta:projectz", + "our:meta:projectz": "projectz compile", + "our:release": "npm run our:release:prepare && npm run our:release:check && npm run our:release:tag && npm run our:release:push", + "our:release:check": "npm run our:release:check:changelog && npm run our:release:check:dirty", + "our:release:check:changelog": "cat ./HISTORY.md | grep v$npm_package_version || (echo add a changelog entry for v$npm_package_version && exit -1)", + "our:release:check:dirty": "git diff --exit-code", + "our:release:prepare": "npm run our:clean && npm run our:compile && npm run our:test && npm run our:meta", + "our:release:push": "git push origin master && git push origin --tags", + "our:release:tag": "export MESSAGE=$(cat ./HISTORY.md | sed -n \"/## v$npm_package_version/,/##/p\" | sed 's/## //' | awk 'NR>1{print buf}{buf = $0}') && test \"$MESSAGE\" || (echo 'proper changelog entry not found' && exit -1) && git tag v$npm_package_version -am \"$MESSAGE\"", + "our:setup": "npm run our:setup:npm", + "our:setup:npm": "npm install", + "our:test": "npm run our:verify && npm test", + "our:verify": "npm run our:verify:eslint", + "our:verify:eslint": "eslint --fix ./source", + "test": "node --harmony source/test.js --joe-reporter=console" + }, + "version": "1.2.0" +} diff --git a/node_modules/domain-browser/source/index.js b/node_modules/domain-browser/source/index.js new file mode 100644 index 0000000..e06b3a1 --- /dev/null +++ b/node_modules/domain-browser/source/index.js @@ -0,0 +1,70 @@ +// This file should be ES5 compatible +/* eslint prefer-spread:0, no-var:0, prefer-reflect:0, no-magic-numbers:0 */ +'use strict' + +module.exports = (function () { + // Import Events + var events = require('events') + + // Export Domain + var domain = {} + domain.createDomain = domain.create = function () { + var d = new events.EventEmitter() + + function emitError (e) { + d.emit('error', e) + } + + d.add = function (emitter) { + emitter.on('error', emitError) + } + d.remove = function (emitter) { + emitter.removeListener('error', emitError) + } + d.bind = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments) + try { + fn.apply(null, args) + } + catch (err) { + emitError(err) + } + } + } + d.intercept = function (fn) { + return function (err) { + if ( err ) { + emitError(err) + } + else { + var args = Array.prototype.slice.call(arguments, 1) + try { + fn.apply(null, args) + } + catch (err) { + emitError(err) + } + } + } + } + d.run = function (fn) { + try { + fn() + } + catch (err) { + emitError(err) + } + return this + } + d.dispose = function () { + this.removeAllListeners() + return this + } + d.enter = d.exit = function () { + return this + } + return d + } + return domain +}).call(this) diff --git a/node_modules/duplexify/.travis.yml b/node_modules/duplexify/.travis.yml new file mode 100644 index 0000000..cb6e182 --- /dev/null +++ b/node_modules/duplexify/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - "4" + - "6" + - "8" + - "10" diff --git a/node_modules/duplexify/LICENSE b/node_modules/duplexify/LICENSE new file mode 100644 index 0000000..757562e --- /dev/null +++ b/node_modules/duplexify/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mathias Buus + +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. \ No newline at end of file diff --git a/node_modules/duplexify/README.md b/node_modules/duplexify/README.md new file mode 100644 index 0000000..8352900 --- /dev/null +++ b/node_modules/duplexify/README.md @@ -0,0 +1,97 @@ +# duplexify + +Turn a writeable and readable stream into a single streams2 duplex stream. + +Similar to [duplexer2](https://github.com/deoxxa/duplexer2) except it supports both streams2 and streams1 as input +and it allows you to set the readable and writable part asynchronously using `setReadable(stream)` and `setWritable(stream)` + +``` +npm install duplexify +``` + +[![build status](http://img.shields.io/travis/mafintosh/duplexify.svg?style=flat)](http://travis-ci.org/mafintosh/duplexify) + +## Usage + +Use `duplexify(writable, readable, streamOptions)` (or `duplexify.obj(writable, readable)` to create an object stream) + +``` js +var duplexify = require('duplexify') + +// turn writableStream and readableStream into a single duplex stream +var dup = duplexify(writableStream, readableStream) + +dup.write('hello world') // will write to writableStream +dup.on('data', function(data) { + // will read from readableStream +}) +``` + +You can also set the readable and writable parts asynchronously + +``` js +var dup = duplexify() + +dup.write('hello world') // write will buffer until the writable + // part has been set + +// wait a bit ... +dup.setReadable(readableStream) + +// maybe wait some more? +dup.setWritable(writableStream) +``` + +If you call `setReadable` or `setWritable` multiple times it will unregister the previous readable/writable stream. +To disable the readable or writable part call `setReadable` or `setWritable` with `null`. + +If the readable or writable streams emits an error or close it will destroy both streams and bubble up the event. +You can also explicitly destroy the streams by calling `dup.destroy()`. The `destroy` method optionally takes an +error object as argument, in which case the error is emitted as part of the `error` event. + +``` js +dup.on('error', function(err) { + console.log('readable or writable emitted an error - close will follow') +}) + +dup.on('close', function() { + console.log('the duplex stream is destroyed') +}) + +dup.destroy() // calls destroy on the readable and writable part (if present) +``` + +## HTTP request example + +Turn a node core http request into a duplex stream is as easy as + +``` js +var duplexify = require('duplexify') +var http = require('http') + +var request = function(opts) { + var req = http.request(opts) + var dup = duplexify(req) + req.on('response', function(res) { + dup.setReadable(res) + }) + return dup +} + +var req = request({ + method: 'GET', + host: 'www.google.com', + port: 80 +}) + +req.end() +req.pipe(process.stdout) +``` + +## License + +MIT + +## Related + +`duplexify` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/node_modules/duplexify/example.js b/node_modules/duplexify/example.js new file mode 100644 index 0000000..5585c19 --- /dev/null +++ b/node_modules/duplexify/example.js @@ -0,0 +1,21 @@ +var duplexify = require('duplexify') +var http = require('http') + +var request = function(opts) { + var req = http.request(opts) + var dup = duplexify() + dup.setWritable(req) + req.on('response', function(res) { + dup.setReadable(res) + }) + return dup +} + +var req = request({ + method: 'GET', + host: 'www.google.com', + port: 80 +}) + +req.end() +req.pipe(process.stdout) diff --git a/node_modules/duplexify/index.js b/node_modules/duplexify/index.js new file mode 100644 index 0000000..18634c2 --- /dev/null +++ b/node_modules/duplexify/index.js @@ -0,0 +1,234 @@ +var stream = require('readable-stream') +var eos = require('end-of-stream') +var inherits = require('inherits') +var shift = require('stream-shift') + +var SIGNAL_FLUSH = (Buffer.from && Buffer.from !== Uint8Array.from) + ? Buffer.from([0]) + : new Buffer([0]) + +var onuncork = function(self, fn) { + if (self._corked) self.once('uncork', fn) + else fn() +} + +var autoDestroy = function (self, err) { + if (self._autoDestroy) self.destroy(err) +} + +var destroyer = function(self, end) { + return function(err) { + if (err) autoDestroy(self, err.message === 'premature close' ? null : err) + else if (end && !self._ended) self.end() + } +} + +var end = function(ws, fn) { + if (!ws) return fn() + if (ws._writableState && ws._writableState.finished) return fn() + if (ws._writableState) return ws.end(fn) + ws.end() + fn() +} + +var toStreams2 = function(rs) { + return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs) +} + +var Duplexify = function(writable, readable, opts) { + if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts) + stream.Duplex.call(this, opts) + + this._writable = null + this._readable = null + this._readable2 = null + + this._autoDestroy = !opts || opts.autoDestroy !== false + this._forwardDestroy = !opts || opts.destroy !== false + this._forwardEnd = !opts || opts.end !== false + this._corked = 1 // start corked + this._ondrain = null + this._drained = false + this._forwarding = false + this._unwrite = null + this._unread = null + this._ended = false + + this.destroyed = false + + if (writable) this.setWritable(writable) + if (readable) this.setReadable(readable) +} + +inherits(Duplexify, stream.Duplex) + +Duplexify.obj = function(writable, readable, opts) { + if (!opts) opts = {} + opts.objectMode = true + opts.highWaterMark = 16 + return new Duplexify(writable, readable, opts) +} + +Duplexify.prototype.cork = function() { + if (++this._corked === 1) this.emit('cork') +} + +Duplexify.prototype.uncork = function() { + if (this._corked && --this._corked === 0) this.emit('uncork') +} + +Duplexify.prototype.setWritable = function(writable) { + if (this._unwrite) this._unwrite() + + if (this.destroyed) { + if (writable && writable.destroy) writable.destroy() + return + } + + if (writable === null || writable === false) { + this.end() + return + } + + var self = this + var unend = eos(writable, {writable:true, readable:false}, destroyer(this, this._forwardEnd)) + + var ondrain = function() { + var ondrain = self._ondrain + self._ondrain = null + if (ondrain) ondrain() + } + + var clear = function() { + self._writable.removeListener('drain', ondrain) + unend() + } + + if (this._unwrite) process.nextTick(ondrain) // force a drain on stream reset to avoid livelocks + + this._writable = writable + this._writable.on('drain', ondrain) + this._unwrite = clear + + this.uncork() // always uncork setWritable +} + +Duplexify.prototype.setReadable = function(readable) { + if (this._unread) this._unread() + + if (this.destroyed) { + if (readable && readable.destroy) readable.destroy() + return + } + + if (readable === null || readable === false) { + this.push(null) + this.resume() + return + } + + var self = this + var unend = eos(readable, {writable:false, readable:true}, destroyer(this)) + + var onreadable = function() { + self._forward() + } + + var onend = function() { + self.push(null) + } + + var clear = function() { + self._readable2.removeListener('readable', onreadable) + self._readable2.removeListener('end', onend) + unend() + } + + this._drained = true + this._readable = readable + this._readable2 = readable._readableState ? readable : toStreams2(readable) + this._readable2.on('readable', onreadable) + this._readable2.on('end', onend) + this._unread = clear + + this._forward() +} + +Duplexify.prototype._read = function() { + this._drained = true + this._forward() +} + +Duplexify.prototype._forward = function() { + if (this._forwarding || !this._readable2 || !this._drained) return + this._forwarding = true + + var data + + while (this._drained && (data = shift(this._readable2)) !== null) { + if (this.destroyed) continue + this._drained = this.push(data) + } + + this._forwarding = false +} + +Duplexify.prototype.destroy = function(err) { + if (this.destroyed) return + this.destroyed = true + + var self = this + process.nextTick(function() { + self._destroy(err) + }) +} + +Duplexify.prototype._destroy = function(err) { + if (err) { + var ondrain = this._ondrain + this._ondrain = null + if (ondrain) ondrain(err) + else this.emit('error', err) + } + + if (this._forwardDestroy) { + if (this._readable && this._readable.destroy) this._readable.destroy() + if (this._writable && this._writable.destroy) this._writable.destroy() + } + + this.emit('close') +} + +Duplexify.prototype._write = function(data, enc, cb) { + if (this.destroyed) return cb() + if (this._corked) return onuncork(this, this._write.bind(this, data, enc, cb)) + if (data === SIGNAL_FLUSH) return this._finish(cb) + if (!this._writable) return cb() + + if (this._writable.write(data) === false) this._ondrain = cb + else cb() +} + +Duplexify.prototype._finish = function(cb) { + var self = this + this.emit('preend') + onuncork(this, function() { + end(self._forwardEnd && self._writable, function() { + // haxx to not emit prefinish twice + if (self._writableState.prefinished === false) self._writableState.prefinished = true + self.emit('prefinish') + onuncork(self, cb) + }) + }) +} + +Duplexify.prototype.end = function(data, enc, cb) { + if (typeof data === 'function') return this.end(null, null, data) + if (typeof enc === 'function') return this.end(data, null, enc) + this._ended = true + if (data) this.write(data) + if (!this._writableState.ending) this.write(SIGNAL_FLUSH) + return stream.Writable.prototype.end.call(this, cb) +} + +module.exports = Duplexify diff --git a/node_modules/duplexify/package.json b/node_modules/duplexify/package.json new file mode 100644 index 0000000..6b41f17 --- /dev/null +++ b/node_modules/duplexify/package.json @@ -0,0 +1,67 @@ +{ + "_from": "duplexify@^3.4.2", + "_id": "duplexify@3.7.1", + "_inBundle": false, + "_integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "_location": "/duplexify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "duplexify@^3.4.2", + "name": "duplexify", + "escapedName": "duplexify", + "rawSpec": "^3.4.2", + "saveSpec": null, + "fetchSpec": "^3.4.2" + }, + "_requiredBy": [ + "/mississippi", + "/pumpify" + ], + "_resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "_shasum": "2a4df5317f6ccfd91f86d6fd25d8d8a103b88309", + "_spec": "duplexify@^3.4.2", + "_where": "/usr/share/r3-server/beta/r3/node_modules/mississippi", + "author": { + "name": "Mathias Buus" + }, + "bugs": { + "url": "https://github.com/mafintosh/duplexify/issues" + }, + "bundleDependencies": false, + "dependencies": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + }, + "deprecated": false, + "description": "Turn a writable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input", + "devDependencies": { + "concat-stream": "^1.5.2", + "tape": "^4.0.0", + "through2": "^2.0.0" + }, + "homepage": "https://github.com/mafintosh/duplexify", + "keywords": [ + "duplex", + "streams2", + "streams", + "stream", + "writable", + "readable", + "async" + ], + "license": "MIT", + "main": "index.js", + "name": "duplexify", + "repository": { + "type": "git", + "url": "git://github.com/mafintosh/duplexify.git" + }, + "scripts": { + "test": "tape test.js" + }, + "version": "3.7.1" +} diff --git a/node_modules/duplexify/test.js b/node_modules/duplexify/test.js new file mode 100644 index 0000000..0074060 --- /dev/null +++ b/node_modules/duplexify/test.js @@ -0,0 +1,295 @@ +var tape = require('tape') +var through = require('through2') +var concat = require('concat-stream') +var net = require('net') +var duplexify = require('./') + +var HELLO_WORLD = (Buffer.from && Buffer.from !== Uint8Array.from) + ? Buffer.from('hello world') + : new Buffer('hello world') + +tape('passthrough', function(t) { + t.plan(2) + + var pt = through() + var dup = duplexify(pt, pt) + + dup.end('hello world') + dup.on('finish', function() { + t.ok(true, 'should finish') + }) + dup.pipe(concat(function(data) { + t.same(data.toString(), 'hello world', 'same in as out') + })) +}) + +tape('passthrough + double end', function(t) { + t.plan(2) + + var pt = through() + var dup = duplexify(pt, pt) + + dup.end('hello world') + dup.end() + + dup.on('finish', function() { + t.ok(true, 'should finish') + }) + dup.pipe(concat(function(data) { + t.same(data.toString(), 'hello world', 'same in as out') + })) +}) + +tape('async passthrough + end', function(t) { + t.plan(2) + + var pt = through.obj({highWaterMark:1}, function(data, enc, cb) { + setTimeout(function() { + cb(null, data) + }, 100) + }) + + var dup = duplexify(pt, pt) + + dup.write('hello ') + dup.write('world') + dup.end() + + dup.on('finish', function() { + t.ok(true, 'should finish') + }) + dup.pipe(concat(function(data) { + t.same(data.toString(), 'hello world', 'same in as out') + })) +}) + +tape('duplex', function(t) { + var readExpected = ['read-a', 'read-b', 'read-c'] + var writeExpected = ['write-a', 'write-b', 'write-c'] + + t.plan(readExpected.length+writeExpected.length+2) + + var readable = through.obj() + var writable = through.obj(function(data, enc, cb) { + t.same(data, writeExpected.shift(), 'onwrite should match') + cb() + }) + + var dup = duplexify.obj(writable, readable) + + readExpected.slice().forEach(function(data) { + readable.write(data) + }) + readable.end() + + writeExpected.slice().forEach(function(data) { + dup.write(data) + }) + dup.end() + + dup.on('data', function(data) { + t.same(data, readExpected.shift(), 'ondata should match') + }) + dup.on('end', function() { + t.ok(true, 'should end') + }) + dup.on('finish', function() { + t.ok(true, 'should finish') + }) +}) + +tape('async', function(t) { + var dup = duplexify() + var pt = through() + + dup.pipe(concat(function(data) { + t.same(data.toString(), 'i was async', 'same in as out') + t.end() + })) + + dup.write('i') + dup.write(' was ') + dup.end('async') + + setTimeout(function() { + dup.setWritable(pt) + setTimeout(function() { + dup.setReadable(pt) + }, 50) + }, 50) +}) + +tape('destroy', function(t) { + t.plan(2) + + var write = through() + var read = through() + var dup = duplexify(write, read) + + write.destroy = function() { + t.ok(true, 'write destroyed') + } + + dup.on('close', function() { + t.ok(true, 'close emitted') + }) + + dup.destroy() + dup.destroy() // should only work once +}) + +tape('destroy both', function(t) { + t.plan(3) + + var write = through() + var read = through() + var dup = duplexify(write, read) + + write.destroy = function() { + t.ok(true, 'write destroyed') + } + + read.destroy = function() { + t.ok(true, 'read destroyed') + } + + dup.on('close', function() { + t.ok(true, 'close emitted') + }) + + dup.destroy() + dup.destroy() // should only work once +}) + +tape('bubble read errors', function(t) { + t.plan(2) + + var write = through() + var read = through() + var dup = duplexify(write, read) + + dup.on('error', function(err) { + t.same(err.message, 'read-error', 'received read error') + }) + dup.on('close', function() { + t.ok(true, 'close emitted') + }) + + read.emit('error', new Error('read-error')) + write.emit('error', new Error('write-error')) // only emit first error +}) + +tape('bubble write errors', function(t) { + t.plan(2) + + var write = through() + var read = through() + var dup = duplexify(write, read) + + dup.on('error', function(err) { + t.same(err.message, 'write-error', 'received write error') + }) + dup.on('close', function() { + t.ok(true, 'close emitted') + }) + + write.emit('error', new Error('write-error')) + read.emit('error', new Error('read-error')) // only emit first error +}) + +tape('reset writable / readable', function(t) { + t.plan(3) + + var toUpperCase = function(data, enc, cb) { + cb(null, data.toString().toUpperCase()) + } + + var passthrough = through() + var upper = through(toUpperCase) + var dup = duplexify(passthrough, passthrough) + + dup.once('data', function(data) { + t.same(data.toString(), 'hello') + dup.setWritable(upper) + dup.setReadable(upper) + dup.once('data', function(data) { + t.same(data.toString(), 'HELLO') + dup.once('data', function(data) { + t.same(data.toString(), 'HI') + t.end() + }) + }) + dup.write('hello') + dup.write('hi') + }) + dup.write('hello') +}) + +tape('cork', function(t) { + var passthrough = through() + var dup = duplexify(passthrough, passthrough) + var ok = false + + dup.on('prefinish', function() { + dup.cork() + setTimeout(function() { + ok = true + dup.uncork() + }, 100) + }) + dup.on('finish', function() { + t.ok(ok) + t.end() + }) + dup.end() +}) + +tape('prefinish not twice', function(t) { + var passthrough = through() + var dup = duplexify(passthrough, passthrough) + var prefinished = false + + dup.on('prefinish', function() { + t.ok(!prefinished, 'only prefinish once') + prefinished = true + }) + + dup.on('finish', function() { + t.end() + }) + + dup.end() +}) + +tape('close', function(t) { + var passthrough = through() + var dup = duplexify(passthrough, passthrough) + + passthrough.emit('close') + dup.on('close', function() { + t.ok(true, 'should forward close') + t.end() + }) +}) + +tape('works with node native streams (net)', function(t) { + t.plan(1) + + var server = net.createServer(function(socket) { + var dup = duplexify(socket, socket) + + dup.once('data', function(chunk) { + t.same(chunk, HELLO_WORLD) + server.close() + socket.end() + t.end() + }) + }) + + server.listen(0, function () { + var socket = net.connect(server.address().port) + var dup = duplexify(socket, socket) + + dup.write(HELLO_WORLD) + }) +}) diff --git a/node_modules/each-props/LICENSE b/node_modules/each-props/LICENSE new file mode 100644 index 0000000..39223b4 --- /dev/null +++ b/node_modules/each-props/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Takayuki Sato + +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. diff --git a/node_modules/each-props/README.md b/node_modules/each-props/README.md new file mode 100644 index 0000000..4ba167b --- /dev/null +++ b/node_modules/each-props/README.md @@ -0,0 +1,125 @@ +# [each-props][repo-url] [![NPM][npm-img]][npm-url] [![MIT License][mit-img]][mit-url] [![Build Status][travis-img]][travis-url] [![Build Status][appveyor-img]][appveyor-url] [![Coverage Status][coverage-img]][coverage-url] + +Processes each properties of an object deeply. + +## Install + +To install from npm: + +```sh +$ npm i each-props --save +``` + +## Load this module + +For Node.js: + +```js +const eachProps = require('each-props'); +``` + +For Web browser: + +```html + +``` + +## Usage + +Apply a function to all (non plain object) properties. + +```js +var obj = { a: 1, b: { c: 'CCC', d: { e: 'EEE' } } }; + +eachProps(obj, function(value, keyChain, nodeInfo) { + if (keyChain === 'a') { + nodeInfo.parent['a'] = value * 2; + } else if (keyChain === 'b.c') { + nodeInfo.parent['c'] = value.toLowerCase(); + } else if (keyChain === 'b.d') { + return true; // stop to dig + } else if (keyChain === 'b.d.e') { + nodeInfo.parent['e'] = value.toLowerCase(); + } +}); + +console.log(obj); +// => { a: 2, b: { c: 'ccc', d: { e: 'EEE' } } }; +``` + +## API + +### eachProps(obj, fn [, opts]) : void + +Executes the *fn* function for all properties. + +#### Parameters: + +| Parameter | Type | Description | +|:------------|:------:|:-----------------------------------------------| +| *obj* | object | A plain object to be treated. | +| *fn* |function| A function to operate each properties. | +| *opts* | object | An object to pass any data to each properties. | + +* **API of *fn* function** + + #### fn(value, keyChain, nodeInfo) : boolean + + This function is applied to all properties in an object. + + ##### Parameters: + + | Parameter | Type | Description | + |:------------|:------:|:-----------------------------------------------| + | *value* | any | A property value. | + | *keyChain* | string | A string concatenating the hierarchical keys with dots. | + | *nodeInfo* | object | An object which contains node informations (See [below](#nodeinfo)). | + + ##### Returns: + + True, if stops digging child properties. + + **Type:** boolean + + + +* **Properties of nodeInfo** + + | Properties | Type | Description | + |:-------------|:------:|:-----------------------------------------| + | *name* | string | The property name of this node. | + | *index* | number | The index of the property among the sibling properties. | + | *count* | number | The count of the sibling properties. | + | *depth* | number | The depth of the property. | + | *parent* | object | The parent node of the property. | + | *sort* |function| A sort function which orders the child properties. This function is inherited from *opts*, if be specified. | + + ... and any properties inherited from *opts*. + +* **Properties of opts** + + | Properties | Type | Description | + |:-------------|:------:|:-----------------------------------------| + | *sort* |function| A sort function which orders the same level properties. (Optional) | + + ... and any properties you want to pass to each node. + +## License + +Copyright (C) 2016-2018 Takayuki Sato + +This program is free software under [MIT][mit-url] License. +See the file LICENSE in this distribution for more details. + +[repo-url]: https://github.com/sttk/each-props/ +[npm-img]: https://img.shields.io/badge/npm-v1.3.2-blue.svg +[npm-url]: https://www.npmjs.org/package/each-props/ +[mit-img]: https://img.shields.io/badge/license-MIT-green.svg +[mit-url]: https://opensource.org/licenses.MIT +[travis-img]: https://travis-ci.org/sttk/each-props.svg?branch=master +[travis-url]: https://travis-ci.org/sttk/each-props +[appveyor-img]: https://ci.appveyor.com/api/projects/status/github/sttk/each-props?branch=master&svg=true +[appveyor-url]: https://ci.appveyor.com/project/sttk/each-props +[coverage-img]: https://coveralls.io/repos/github/sttk/each-props/badge.svg?branch=master +[coverage-url]: https://coveralls.io/github/sttk/each-props?branch=master + diff --git a/node_modules/each-props/index.js b/node_modules/each-props/index.js new file mode 100644 index 0000000..ce61aeb --- /dev/null +++ b/node_modules/each-props/index.js @@ -0,0 +1,57 @@ +'use strict'; + +var isPlainObject = require('is-plain-object'); +var defaults = require('object.defaults/immutable'); + +module.exports = function(obj, fn, opts) { + if (!isObject(obj)) { + return; + } + + if (typeof fn !== 'function') { + return; + } + + if (!isPlainObject(opts)) { + opts = {}; + } + + forEachChild(obj, '', fn, 0, opts); +}; + +function forEachChild(node, baseKey, fn, depth, opts) { + var keys = Object.keys(node); + if (typeof opts.sort === 'function') { + var sortedKeys = opts.sort(keys); + if (Array.isArray(sortedKeys)) { + keys = sortedKeys; + } + } + + depth += 1; + + for (var i = 0, n = keys.length; i < n; i++) { + var key = keys[i]; + var keyChain = baseKey + '.' + key; + var value = node[key]; + + var nodeInfo = defaults(opts); + nodeInfo.name = key; + nodeInfo.index = i; + nodeInfo.count = n; + nodeInfo.depth = depth; + nodeInfo.parent = node; + + var notDigg = fn(value, keyChain.slice(1), nodeInfo); + if (notDigg || !isPlainObject(value)) { + continue; + } + + forEachChild(value, keyChain, fn, depth, opts); + } +} + +function isObject(v) { + return Object.prototype.toString.call(v) === '[object Object]'; +} + diff --git a/node_modules/each-props/package.json b/node_modules/each-props/package.json new file mode 100644 index 0000000..7a2dfbb --- /dev/null +++ b/node_modules/each-props/package.json @@ -0,0 +1,77 @@ +{ + "_from": "each-props@^1.3.0", + "_id": "each-props@1.3.2", + "_inBundle": false, + "_integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", + "_location": "/each-props", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "each-props@^1.3.0", + "name": "each-props", + "escapedName": "each-props", + "rawSpec": "^1.3.0", + "saveSpec": null, + "fetchSpec": "^1.3.0" + }, + "_requiredBy": [ + "/copy-props" + ], + "_resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", + "_shasum": "ea45a414d16dd5cfa419b1a81720d5ca06892333", + "_spec": "each-props@^1.3.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/copy-props", + "author": { + "name": "Takayuki Sato" + }, + "bugs": { + "url": "https://github.com/sttk/each-props/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-plain-object": "^2.0.1", + "object.defaults": "^1.1.0" + }, + "deprecated": false, + "description": "Processes each properties of an object deeply.", + "devDependencies": { + "browserify": "^16.2.2", + "chai": "^3.5.0", + "coveralls": "^3.0.1", + "eslint": "^4.19.1", + "mocha": "^3.2.0", + "nyc": "^11.7.2", + "uglify-js": "^3.3.24" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sttk/each-props#readme", + "keywords": [ + "deep", + "each", + "object", + "property", + "properties", + "props" + ], + "license": "MIT", + "main": "index.js", + "name": "each-props", + "repository": { + "type": "git", + "url": "git+https://github.com/sttk/each-props.git" + }, + "scripts": { + "build": "npm run lint && npm run coverage && npm run web:build && node test/web/make.js", + "chrome:install": "npm i --no-save mocha-chrome", + "chrome:test": "mocha-chrome test/web/browser-test.html", + "coverage": "nyc --reporter=lcov --reporter=text-summary npm test", + "coveralls": "nyc --reporter=text-lcov npm test | coveralls", + "lint": "eslint .", + "test": "mocha", + "web:build": "browserify index.js --standalone eachProps -o web/each-props.js && cd web && uglifyjs each-props.js --compress --mangle -o each-props.min.js --source-map url=each-props.min.js.map" + }, + "version": "1.3.2" +} diff --git a/node_modules/elliptic/README.md b/node_modules/elliptic/README.md new file mode 100644 index 0000000..96219e5 --- /dev/null +++ b/node_modules/elliptic/README.md @@ -0,0 +1,238 @@ +# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic) [![Coverage Status](https://coveralls.io/repos/indutny/elliptic/badge.svg?branch=master&service=github)](https://coveralls.io/github/indutny/elliptic?branch=master) [![Code Climate](https://codeclimate.com/github/indutny/elliptic/badges/gpa.svg)](https://codeclimate.com/github/indutny/elliptic) + +[![Saucelabs Test Status](https://saucelabs.com/browser-matrix/gh-indutny-elliptic.svg)](https://saucelabs.com/u/gh-indutny-elliptic) + +Fast elliptic-curve cryptography in a plain javascript implementation. + +NOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve +for your cryptography operations. + +## Incentive + +ECC is much slower than regular RSA cryptography, the JS implementations are +even more slower. + +## Benchmarks + +```bash +$ node benchmarks/index.js +Benchmarking: sign +elliptic#sign x 262 ops/sec ±0.51% (177 runs sampled) +eccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled) +------------------------ +Fastest is elliptic#sign +======================== +Benchmarking: verify +elliptic#verify x 113 ops/sec ±0.50% (166 runs sampled) +eccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled) +------------------------ +Fastest is elliptic#verify +======================== +Benchmarking: gen +elliptic#gen x 294 ops/sec ±0.43% (176 runs sampled) +eccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled) +------------------------ +Fastest is elliptic#gen +======================== +Benchmarking: ecdh +elliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled) +------------------------ +Fastest is elliptic#ecdh +======================== +``` + +## API + +### ECDSA + +```javascript +var EC = require('elliptic').ec; + +// Create and initialize EC context +// (better do it once and reuse it) +var ec = new EC('secp256k1'); + +// Generate keys +var key = ec.genKeyPair(); + +// Sign the message's hash (input must be an array, or a hex-string) +var msgHash = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; +var signature = key.sign(msgHash); + +// Export DER encoded signature in Array +var derSign = signature.toDER(); + +// Verify signature +console.log(key.verify(msgHash, derSign)); + +// CHECK WITH NO PRIVATE KEY + +var pubPoint = key.getPublic(); +var x = pubPoint.getX(); +var y = pubPoint.getY(); + +// Public Key MUST be either: +// 1) '04' + hex string of x + hex string of y; or +// 2) object with two hex string properties (x and y); or +// 3) object with two buffer properties (x and y) +var pub = pubPoint.encode('hex'); // case 1 +var pub = { x: x.toString('hex'), y: y.toString('hex') }; // case 2 +var pub = { x: x.toBuffer(), y: y.toBuffer() }; // case 3 +var pub = { x: x.toArrayLike(Buffer), y: y.toArrayLike(Buffer) }; // case 3 + +// Import public key +var key = ec.keyFromPublic(pub, 'hex'); + +// Signature MUST be either: +// 1) DER-encoded signature as hex-string; or +// 2) DER-encoded signature as buffer; or +// 3) object with two hex-string properties (r and s); or +// 4) object with two buffer properties (r and s) + +var signature = '3046022100...'; // case 1 +var signature = new Buffer('...'); // case 2 +var signature = { r: 'b1fc...', s: '9c42...' }; // case 3 + +// Verify signature +console.log(key.verify(msgHash, signature)); +``` + +### EdDSA + +```javascript +var EdDSA = require('elliptic').eddsa; + +// Create and initialize EdDSA context +// (better do it once and reuse it) +var ec = new EdDSA('ed25519'); + +// Create key pair from secret +var key = ec.keyFromSecret('693e3c...'); // hex string, array or Buffer + +// Sign the message's hash (input must be an array, or a hex-string) +var msgHash = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; +var signature = key.sign(msgHash).toHex(); + +// Verify signature +console.log(key.verify(msgHash, signature)); + +// CHECK WITH NO PRIVATE KEY + +// Import public key +var pub = '0a1af638...'; +var key = ec.keyFromPublic(pub, 'hex'); + +// Verify signature +var signature = '70bed1...'; +console.log(key.verify(msgHash, signature)); +``` + +### ECDH + +```javascript +var EC = require('elliptic').ec; +var ec = new EC('curve25519'); + +// Generate keys +var key1 = ec.genKeyPair(); +var key2 = ec.genKeyPair(); + +var shared1 = key1.derive(key2.getPublic()); +var shared2 = key2.derive(key1.getPublic()); + +console.log('Both shared secrets are BN instances'); +console.log(shared1.toString(16)); +console.log(shared2.toString(16)); +``` + +three and more members: +```javascript +var EC = require('elliptic').ec; +var ec = new EC('curve25519'); + +var A = ec.genKeyPair(); +var B = ec.genKeyPair(); +var C = ec.genKeyPair(); + +var AB = A.getPublic().mul(B.getPrivate()) +var BC = B.getPublic().mul(C.getPrivate()) +var CA = C.getPublic().mul(A.getPrivate()) + +var ABC = AB.mul(C.getPrivate()) +var BCA = BC.mul(A.getPrivate()) +var CAB = CA.mul(B.getPrivate()) + +console.log(ABC.getX().toString(16)) +console.log(BCA.getX().toString(16)) +console.log(CAB.getX().toString(16)) +``` + +NOTE: `.derive()` returns a [BN][1] instance. + +## Supported curves + +Elliptic.js support following curve types: + +* Short Weierstrass +* Montgomery +* Edwards +* Twisted Edwards + +Following curve 'presets' are embedded into the library: + +* `secp256k1` +* `p192` +* `p224` +* `p256` +* `p384` +* `p521` +* `curve25519` +* `ed25519` + +NOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead. + +### Implementation details + +ECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of +the curve operations are performed on non-affine coordinates (either projective +or extended), various windowing techniques are used for different cases. + +All operations are performed in reduction context using [bn.js][1], hashing is +provided by [hash.js][2] + +### Related projects + +* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both + browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for + node) + +#### LICENSE + +This software is licensed under the MIT License. + +Copyright Fedor Indutny, 2014. + +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. + +[0]: http://tools.ietf.org/html/rfc6979 +[1]: https://github.com/indutny/bn.js +[2]: https://github.com/indutny/hash.js +[3]: https://github.com/bitchan/eccrypto +[4]: https://github.com/wanderer/secp256k1-node diff --git a/node_modules/elliptic/lib/elliptic.js b/node_modules/elliptic/lib/elliptic.js new file mode 100644 index 0000000..dfe2fe7 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic.js @@ -0,0 +1,13 @@ +'use strict'; + +var elliptic = exports; + +elliptic.version = require('../package.json').version; +elliptic.utils = require('./elliptic/utils'); +elliptic.rand = require('brorand'); +elliptic.curve = require('./elliptic/curve'); +elliptic.curves = require('./elliptic/curves'); + +// Protocols +elliptic.ec = require('./elliptic/ec'); +elliptic.eddsa = require('./elliptic/eddsa'); diff --git a/node_modules/elliptic/lib/elliptic/curve/base.js b/node_modules/elliptic/lib/elliptic/curve/base.js new file mode 100644 index 0000000..83ffe9f --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/curve/base.js @@ -0,0 +1,376 @@ +'use strict'; + +var BN = require('bn.js'); +var utils = require('../utils'); +var getNAF = utils.getNAF; +var getJSF = utils.getJSF; +var assert = utils.assert; + +function BaseCurve(type, conf) { + this.type = type; + this.p = new BN(conf.p, 16); + + // Use Montgomery, when there is no fast reduction for the prime + this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); + + // Useful for many curves + this.zero = new BN(0).toRed(this.red); + this.one = new BN(1).toRed(this.red); + this.two = new BN(2).toRed(this.red); + + // Curve configuration, optional + this.n = conf.n && new BN(conf.n, 16); + this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed); + + // Temporary arrays + this._wnafT1 = new Array(4); + this._wnafT2 = new Array(4); + this._wnafT3 = new Array(4); + this._wnafT4 = new Array(4); + + this._bitLength = this.n ? this.n.bitLength() : 0; + + // Generalized Greg Maxwell's trick + var adjustCount = this.n && this.p.div(this.n); + if (!adjustCount || adjustCount.cmpn(100) > 0) { + this.redN = null; + } else { + this._maxwellTrick = true; + this.redN = this.n.toRed(this.red); + } +} +module.exports = BaseCurve; + +BaseCurve.prototype.point = function point() { + throw new Error('Not implemented'); +}; + +BaseCurve.prototype.validate = function validate() { + throw new Error('Not implemented'); +}; + +BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) { + assert(p.precomputed); + var doubles = p._getDoubles(); + + var naf = getNAF(k, 1, this._bitLength); + var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1); + I /= 3; + + // Translate into more windowed form + var repr = []; + for (var j = 0; j < naf.length; j += doubles.step) { + var nafW = 0; + for (var k = j + doubles.step - 1; k >= j; k--) + nafW = (nafW << 1) + naf[k]; + repr.push(nafW); + } + + var a = this.jpoint(null, null, null); + var b = this.jpoint(null, null, null); + for (var i = I; i > 0; i--) { + for (var j = 0; j < repr.length; j++) { + var nafW = repr[j]; + if (nafW === i) + b = b.mixedAdd(doubles.points[j]); + else if (nafW === -i) + b = b.mixedAdd(doubles.points[j].neg()); + } + a = a.add(b); + } + return a.toP(); +}; + +BaseCurve.prototype._wnafMul = function _wnafMul(p, k) { + var w = 4; + + // Precompute window + var nafPoints = p._getNAFPoints(w); + w = nafPoints.wnd; + var wnd = nafPoints.points; + + // Get NAF form + var naf = getNAF(k, w, this._bitLength); + + // Add `this`*(N+1) for every w-NAF index + var acc = this.jpoint(null, null, null); + for (var i = naf.length - 1; i >= 0; i--) { + // Count zeroes + for (var k = 0; i >= 0 && naf[i] === 0; i--) + k++; + if (i >= 0) + k++; + acc = acc.dblp(k); + + if (i < 0) + break; + var z = naf[i]; + assert(z !== 0); + if (p.type === 'affine') { + // J +- P + if (z > 0) + acc = acc.mixedAdd(wnd[(z - 1) >> 1]); + else + acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg()); + } else { + // J +- J + if (z > 0) + acc = acc.add(wnd[(z - 1) >> 1]); + else + acc = acc.add(wnd[(-z - 1) >> 1].neg()); + } + } + return p.type === 'affine' ? acc.toP() : acc; +}; + +BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, + points, + coeffs, + len, + jacobianResult) { + var wndWidth = this._wnafT1; + var wnd = this._wnafT2; + var naf = this._wnafT3; + + // Fill all arrays + var max = 0; + for (var i = 0; i < len; i++) { + var p = points[i]; + var nafPoints = p._getNAFPoints(defW); + wndWidth[i] = nafPoints.wnd; + wnd[i] = nafPoints.points; + } + + // Comb small window NAFs + for (var i = len - 1; i >= 1; i -= 2) { + var a = i - 1; + var b = i; + if (wndWidth[a] !== 1 || wndWidth[b] !== 1) { + naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength); + naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength); + max = Math.max(naf[a].length, max); + max = Math.max(naf[b].length, max); + continue; + } + + var comb = [ + points[a], /* 1 */ + null, /* 3 */ + null, /* 5 */ + points[b] /* 7 */ + ]; + + // Try to avoid Projective points, if possible + if (points[a].y.cmp(points[b].y) === 0) { + comb[1] = points[a].add(points[b]); + comb[2] = points[a].toJ().mixedAdd(points[b].neg()); + } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) { + comb[1] = points[a].toJ().mixedAdd(points[b]); + comb[2] = points[a].add(points[b].neg()); + } else { + comb[1] = points[a].toJ().mixedAdd(points[b]); + comb[2] = points[a].toJ().mixedAdd(points[b].neg()); + } + + var index = [ + -3, /* -1 -1 */ + -1, /* -1 0 */ + -5, /* -1 1 */ + -7, /* 0 -1 */ + 0, /* 0 0 */ + 7, /* 0 1 */ + 5, /* 1 -1 */ + 1, /* 1 0 */ + 3 /* 1 1 */ + ]; + + var jsf = getJSF(coeffs[a], coeffs[b]); + max = Math.max(jsf[0].length, max); + naf[a] = new Array(max); + naf[b] = new Array(max); + for (var j = 0; j < max; j++) { + var ja = jsf[0][j] | 0; + var jb = jsf[1][j] | 0; + + naf[a][j] = index[(ja + 1) * 3 + (jb + 1)]; + naf[b][j] = 0; + wnd[a] = comb; + } + } + + var acc = this.jpoint(null, null, null); + var tmp = this._wnafT4; + for (var i = max; i >= 0; i--) { + var k = 0; + + while (i >= 0) { + var zero = true; + for (var j = 0; j < len; j++) { + tmp[j] = naf[j][i] | 0; + if (tmp[j] !== 0) + zero = false; + } + if (!zero) + break; + k++; + i--; + } + if (i >= 0) + k++; + acc = acc.dblp(k); + if (i < 0) + break; + + for (var j = 0; j < len; j++) { + var z = tmp[j]; + var p; + if (z === 0) + continue; + else if (z > 0) + p = wnd[j][(z - 1) >> 1]; + else if (z < 0) + p = wnd[j][(-z - 1) >> 1].neg(); + + if (p.type === 'affine') + acc = acc.mixedAdd(p); + else + acc = acc.add(p); + } + } + // Zeroify references + for (var i = 0; i < len; i++) + wnd[i] = null; + + if (jacobianResult) + return acc; + else + return acc.toP(); +}; + +function BasePoint(curve, type) { + this.curve = curve; + this.type = type; + this.precomputed = null; +} +BaseCurve.BasePoint = BasePoint; + +BasePoint.prototype.eq = function eq(/*other*/) { + throw new Error('Not implemented'); +}; + +BasePoint.prototype.validate = function validate() { + return this.curve.validate(this); +}; + +BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) { + bytes = utils.toArray(bytes, enc); + + var len = this.p.byteLength(); + + // uncompressed, hybrid-odd, hybrid-even + if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) && + bytes.length - 1 === 2 * len) { + if (bytes[0] === 0x06) + assert(bytes[bytes.length - 1] % 2 === 0); + else if (bytes[0] === 0x07) + assert(bytes[bytes.length - 1] % 2 === 1); + + var res = this.point(bytes.slice(1, 1 + len), + bytes.slice(1 + len, 1 + 2 * len)); + + return res; + } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) && + bytes.length - 1 === len) { + return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03); + } + throw new Error('Unknown point format'); +}; + +BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) { + return this.encode(enc, true); +}; + +BasePoint.prototype._encode = function _encode(compact) { + var len = this.curve.p.byteLength(); + var x = this.getX().toArray('be', len); + + if (compact) + return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x); + + return [ 0x04 ].concat(x, this.getY().toArray('be', len)) ; +}; + +BasePoint.prototype.encode = function encode(enc, compact) { + return utils.encode(this._encode(compact), enc); +}; + +BasePoint.prototype.precompute = function precompute(power) { + if (this.precomputed) + return this; + + var precomputed = { + doubles: null, + naf: null, + beta: null + }; + precomputed.naf = this._getNAFPoints(8); + precomputed.doubles = this._getDoubles(4, power); + precomputed.beta = this._getBeta(); + this.precomputed = precomputed; + + return this; +}; + +BasePoint.prototype._hasDoubles = function _hasDoubles(k) { + if (!this.precomputed) + return false; + + var doubles = this.precomputed.doubles; + if (!doubles) + return false; + + return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step); +}; + +BasePoint.prototype._getDoubles = function _getDoubles(step, power) { + if (this.precomputed && this.precomputed.doubles) + return this.precomputed.doubles; + + var doubles = [ this ]; + var acc = this; + for (var i = 0; i < power; i += step) { + for (var j = 0; j < step; j++) + acc = acc.dbl(); + doubles.push(acc); + } + return { + step: step, + points: doubles + }; +}; + +BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) { + if (this.precomputed && this.precomputed.naf) + return this.precomputed.naf; + + var res = [ this ]; + var max = (1 << wnd) - 1; + var dbl = max === 1 ? null : this.dbl(); + for (var i = 1; i < max; i++) + res[i] = res[i - 1].add(dbl); + return { + wnd: wnd, + points: res + }; +}; + +BasePoint.prototype._getBeta = function _getBeta() { + return null; +}; + +BasePoint.prototype.dblp = function dblp(k) { + var r = this; + for (var i = 0; i < k; i++) + r = r.dbl(); + return r; +}; diff --git a/node_modules/elliptic/lib/elliptic/curve/edwards.js b/node_modules/elliptic/lib/elliptic/curve/edwards.js new file mode 100644 index 0000000..1c53fe9 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/curve/edwards.js @@ -0,0 +1,432 @@ +'use strict'; + +var utils = require('../utils'); +var BN = require('bn.js'); +var inherits = require('inherits'); +var Base = require('./base'); + +var assert = utils.assert; + +function EdwardsCurve(conf) { + // NOTE: Important as we are creating point in Base.call() + this.twisted = (conf.a | 0) !== 1; + this.mOneA = this.twisted && (conf.a | 0) === -1; + this.extended = this.mOneA; + + Base.call(this, 'edwards', conf); + + this.a = new BN(conf.a, 16).umod(this.red.m); + this.a = this.a.toRed(this.red); + this.c = new BN(conf.c, 16).toRed(this.red); + this.c2 = this.c.redSqr(); + this.d = new BN(conf.d, 16).toRed(this.red); + this.dd = this.d.redAdd(this.d); + + assert(!this.twisted || this.c.fromRed().cmpn(1) === 0); + this.oneC = (conf.c | 0) === 1; +} +inherits(EdwardsCurve, Base); +module.exports = EdwardsCurve; + +EdwardsCurve.prototype._mulA = function _mulA(num) { + if (this.mOneA) + return num.redNeg(); + else + return this.a.redMul(num); +}; + +EdwardsCurve.prototype._mulC = function _mulC(num) { + if (this.oneC) + return num; + else + return this.c.redMul(num); +}; + +// Just for compatibility with Short curve +EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) { + return this.point(x, y, z, t); +}; + +EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) { + x = new BN(x, 16); + if (!x.red) + x = x.toRed(this.red); + + var x2 = x.redSqr(); + var rhs = this.c2.redSub(this.a.redMul(x2)); + var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2)); + + var y2 = rhs.redMul(lhs.redInvm()); + var y = y2.redSqrt(); + if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) + throw new Error('invalid point'); + + var isOdd = y.fromRed().isOdd(); + if (odd && !isOdd || !odd && isOdd) + y = y.redNeg(); + + return this.point(x, y); +}; + +EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) { + y = new BN(y, 16); + if (!y.red) + y = y.toRed(this.red); + + // x^2 = (y^2 - c^2) / (c^2 d y^2 - a) + var y2 = y.redSqr(); + var lhs = y2.redSub(this.c2); + var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a); + var x2 = lhs.redMul(rhs.redInvm()); + + if (x2.cmp(this.zero) === 0) { + if (odd) + throw new Error('invalid point'); + else + return this.point(this.zero, y); + } + + var x = x2.redSqrt(); + if (x.redSqr().redSub(x2).cmp(this.zero) !== 0) + throw new Error('invalid point'); + + if (x.fromRed().isOdd() !== odd) + x = x.redNeg(); + + return this.point(x, y); +}; + +EdwardsCurve.prototype.validate = function validate(point) { + if (point.isInfinity()) + return true; + + // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2) + point.normalize(); + + var x2 = point.x.redSqr(); + var y2 = point.y.redSqr(); + var lhs = x2.redMul(this.a).redAdd(y2); + var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2))); + + return lhs.cmp(rhs) === 0; +}; + +function Point(curve, x, y, z, t) { + Base.BasePoint.call(this, curve, 'projective'); + if (x === null && y === null && z === null) { + this.x = this.curve.zero; + this.y = this.curve.one; + this.z = this.curve.one; + this.t = this.curve.zero; + this.zOne = true; + } else { + this.x = new BN(x, 16); + this.y = new BN(y, 16); + this.z = z ? new BN(z, 16) : this.curve.one; + this.t = t && new BN(t, 16); + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + if (this.t && !this.t.red) + this.t = this.t.toRed(this.curve.red); + this.zOne = this.z === this.curve.one; + + // Use extended coordinates + if (this.curve.extended && !this.t) { + this.t = this.x.redMul(this.y); + if (!this.zOne) + this.t = this.t.redMul(this.z.redInvm()); + } + } +} +inherits(Point, Base.BasePoint); + +EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) { + return Point.fromJSON(this, obj); +}; + +EdwardsCurve.prototype.point = function point(x, y, z, t) { + return new Point(this, x, y, z, t); +}; + +Point.fromJSON = function fromJSON(curve, obj) { + return new Point(curve, obj[0], obj[1], obj[2]); +}; + +Point.prototype.inspect = function inspect() { + if (this.isInfinity()) + return ''; + return ''; +}; + +Point.prototype.isInfinity = function isInfinity() { + // XXX This code assumes that zero is always zero in red + return this.x.cmpn(0) === 0 && + (this.y.cmp(this.z) === 0 || + (this.zOne && this.y.cmp(this.curve.c) === 0)); +}; + +Point.prototype._extDbl = function _extDbl() { + // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html + // #doubling-dbl-2008-hwcd + // 4M + 4S + + // A = X1^2 + var a = this.x.redSqr(); + // B = Y1^2 + var b = this.y.redSqr(); + // C = 2 * Z1^2 + var c = this.z.redSqr(); + c = c.redIAdd(c); + // D = a * A + var d = this.curve._mulA(a); + // E = (X1 + Y1)^2 - A - B + var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b); + // G = D + B + var g = d.redAdd(b); + // F = G - C + var f = g.redSub(c); + // H = D - B + var h = d.redSub(b); + // X3 = E * F + var nx = e.redMul(f); + // Y3 = G * H + var ny = g.redMul(h); + // T3 = E * H + var nt = e.redMul(h); + // Z3 = F * G + var nz = f.redMul(g); + return this.curve.point(nx, ny, nz, nt); +}; + +Point.prototype._projDbl = function _projDbl() { + // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html + // #doubling-dbl-2008-bbjlp + // #doubling-dbl-2007-bl + // and others + // Generally 3M + 4S or 2M + 4S + + // B = (X1 + Y1)^2 + var b = this.x.redAdd(this.y).redSqr(); + // C = X1^2 + var c = this.x.redSqr(); + // D = Y1^2 + var d = this.y.redSqr(); + + var nx; + var ny; + var nz; + if (this.curve.twisted) { + // E = a * C + var e = this.curve._mulA(c); + // F = E + D + var f = e.redAdd(d); + if (this.zOne) { + // X3 = (B - C - D) * (F - 2) + nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)); + // Y3 = F * (E - D) + ny = f.redMul(e.redSub(d)); + // Z3 = F^2 - 2 * F + nz = f.redSqr().redSub(f).redSub(f); + } else { + // H = Z1^2 + var h = this.z.redSqr(); + // J = F - 2 * H + var j = f.redSub(h).redISub(h); + // X3 = (B-C-D)*J + nx = b.redSub(c).redISub(d).redMul(j); + // Y3 = F * (E - D) + ny = f.redMul(e.redSub(d)); + // Z3 = F * J + nz = f.redMul(j); + } + } else { + // E = C + D + var e = c.redAdd(d); + // H = (c * Z1)^2 + var h = this.curve._mulC(this.z).redSqr(); + // J = E - 2 * H + var j = e.redSub(h).redSub(h); + // X3 = c * (B - E) * J + nx = this.curve._mulC(b.redISub(e)).redMul(j); + // Y3 = c * E * (C - D) + ny = this.curve._mulC(e).redMul(c.redISub(d)); + // Z3 = E * J + nz = e.redMul(j); + } + return this.curve.point(nx, ny, nz); +}; + +Point.prototype.dbl = function dbl() { + if (this.isInfinity()) + return this; + + // Double in extended coordinates + if (this.curve.extended) + return this._extDbl(); + else + return this._projDbl(); +}; + +Point.prototype._extAdd = function _extAdd(p) { + // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html + // #addition-add-2008-hwcd-3 + // 8M + + // A = (Y1 - X1) * (Y2 - X2) + var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)); + // B = (Y1 + X1) * (Y2 + X2) + var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)); + // C = T1 * k * T2 + var c = this.t.redMul(this.curve.dd).redMul(p.t); + // D = Z1 * 2 * Z2 + var d = this.z.redMul(p.z.redAdd(p.z)); + // E = B - A + var e = b.redSub(a); + // F = D - C + var f = d.redSub(c); + // G = D + C + var g = d.redAdd(c); + // H = B + A + var h = b.redAdd(a); + // X3 = E * F + var nx = e.redMul(f); + // Y3 = G * H + var ny = g.redMul(h); + // T3 = E * H + var nt = e.redMul(h); + // Z3 = F * G + var nz = f.redMul(g); + return this.curve.point(nx, ny, nz, nt); +}; + +Point.prototype._projAdd = function _projAdd(p) { + // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html + // #addition-add-2008-bbjlp + // #addition-add-2007-bl + // 10M + 1S + + // A = Z1 * Z2 + var a = this.z.redMul(p.z); + // B = A^2 + var b = a.redSqr(); + // C = X1 * X2 + var c = this.x.redMul(p.x); + // D = Y1 * Y2 + var d = this.y.redMul(p.y); + // E = d * C * D + var e = this.curve.d.redMul(c).redMul(d); + // F = B - E + var f = b.redSub(e); + // G = B + E + var g = b.redAdd(e); + // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D) + var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d); + var nx = a.redMul(f).redMul(tmp); + var ny; + var nz; + if (this.curve.twisted) { + // Y3 = A * G * (D - a * C) + ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c))); + // Z3 = F * G + nz = f.redMul(g); + } else { + // Y3 = A * G * (D - C) + ny = a.redMul(g).redMul(d.redSub(c)); + // Z3 = c * F * G + nz = this.curve._mulC(f).redMul(g); + } + return this.curve.point(nx, ny, nz); +}; + +Point.prototype.add = function add(p) { + if (this.isInfinity()) + return p; + if (p.isInfinity()) + return this; + + if (this.curve.extended) + return this._extAdd(p); + else + return this._projAdd(p); +}; + +Point.prototype.mul = function mul(k) { + if (this._hasDoubles(k)) + return this.curve._fixedNafMul(this, k); + else + return this.curve._wnafMul(this, k); +}; + +Point.prototype.mulAdd = function mulAdd(k1, p, k2) { + return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false); +}; + +Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) { + return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true); +}; + +Point.prototype.normalize = function normalize() { + if (this.zOne) + return this; + + // Normalize coordinates + var zi = this.z.redInvm(); + this.x = this.x.redMul(zi); + this.y = this.y.redMul(zi); + if (this.t) + this.t = this.t.redMul(zi); + this.z = this.curve.one; + this.zOne = true; + return this; +}; + +Point.prototype.neg = function neg() { + return this.curve.point(this.x.redNeg(), + this.y, + this.z, + this.t && this.t.redNeg()); +}; + +Point.prototype.getX = function getX() { + this.normalize(); + return this.x.fromRed(); +}; + +Point.prototype.getY = function getY() { + this.normalize(); + return this.y.fromRed(); +}; + +Point.prototype.eq = function eq(other) { + return this === other || + this.getX().cmp(other.getX()) === 0 && + this.getY().cmp(other.getY()) === 0; +}; + +Point.prototype.eqXToP = function eqXToP(x) { + var rx = x.toRed(this.curve.red).redMul(this.z); + if (this.x.cmp(rx) === 0) + return true; + + var xc = x.clone(); + var t = this.curve.redN.redMul(this.z); + for (;;) { + xc.iadd(this.curve.n); + if (xc.cmp(this.curve.p) >= 0) + return false; + + rx.redIAdd(t); + if (this.x.cmp(rx) === 0) + return true; + } +}; + +// Compatibility with BaseCurve +Point.prototype.toP = Point.prototype.normalize; +Point.prototype.mixedAdd = Point.prototype.add; diff --git a/node_modules/elliptic/lib/elliptic/curve/index.js b/node_modules/elliptic/lib/elliptic/curve/index.js new file mode 100644 index 0000000..c589281 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/curve/index.js @@ -0,0 +1,8 @@ +'use strict'; + +var curve = exports; + +curve.base = require('./base'); +curve.short = require('./short'); +curve.mont = require('./mont'); +curve.edwards = require('./edwards'); diff --git a/node_modules/elliptic/lib/elliptic/curve/mont.js b/node_modules/elliptic/lib/elliptic/curve/mont.js new file mode 100644 index 0000000..4b9f80f --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/curve/mont.js @@ -0,0 +1,178 @@ +'use strict'; + +var BN = require('bn.js'); +var inherits = require('inherits'); +var Base = require('./base'); + +var utils = require('../utils'); + +function MontCurve(conf) { + Base.call(this, 'mont', conf); + + this.a = new BN(conf.a, 16).toRed(this.red); + this.b = new BN(conf.b, 16).toRed(this.red); + this.i4 = new BN(4).toRed(this.red).redInvm(); + this.two = new BN(2).toRed(this.red); + this.a24 = this.i4.redMul(this.a.redAdd(this.two)); +} +inherits(MontCurve, Base); +module.exports = MontCurve; + +MontCurve.prototype.validate = function validate(point) { + var x = point.normalize().x; + var x2 = x.redSqr(); + var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x); + var y = rhs.redSqrt(); + + return y.redSqr().cmp(rhs) === 0; +}; + +function Point(curve, x, z) { + Base.BasePoint.call(this, curve, 'projective'); + if (x === null && z === null) { + this.x = this.curve.one; + this.z = this.curve.zero; + } else { + this.x = new BN(x, 16); + this.z = new BN(z, 16); + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + } +} +inherits(Point, Base.BasePoint); + +MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) { + return this.point(utils.toArray(bytes, enc), 1); +}; + +MontCurve.prototype.point = function point(x, z) { + return new Point(this, x, z); +}; + +MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) { + return Point.fromJSON(this, obj); +}; + +Point.prototype.precompute = function precompute() { + // No-op +}; + +Point.prototype._encode = function _encode() { + return this.getX().toArray('be', this.curve.p.byteLength()); +}; + +Point.fromJSON = function fromJSON(curve, obj) { + return new Point(curve, obj[0], obj[1] || curve.one); +}; + +Point.prototype.inspect = function inspect() { + if (this.isInfinity()) + return ''; + return ''; +}; + +Point.prototype.isInfinity = function isInfinity() { + // XXX This code assumes that zero is always zero in red + return this.z.cmpn(0) === 0; +}; + +Point.prototype.dbl = function dbl() { + // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3 + // 2M + 2S + 4A + + // A = X1 + Z1 + var a = this.x.redAdd(this.z); + // AA = A^2 + var aa = a.redSqr(); + // B = X1 - Z1 + var b = this.x.redSub(this.z); + // BB = B^2 + var bb = b.redSqr(); + // C = AA - BB + var c = aa.redSub(bb); + // X3 = AA * BB + var nx = aa.redMul(bb); + // Z3 = C * (BB + A24 * C) + var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c))); + return this.curve.point(nx, nz); +}; + +Point.prototype.add = function add() { + throw new Error('Not supported on Montgomery curve'); +}; + +Point.prototype.diffAdd = function diffAdd(p, diff) { + // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3 + // 4M + 2S + 6A + + // A = X2 + Z2 + var a = this.x.redAdd(this.z); + // B = X2 - Z2 + var b = this.x.redSub(this.z); + // C = X3 + Z3 + var c = p.x.redAdd(p.z); + // D = X3 - Z3 + var d = p.x.redSub(p.z); + // DA = D * A + var da = d.redMul(a); + // CB = C * B + var cb = c.redMul(b); + // X5 = Z1 * (DA + CB)^2 + var nx = diff.z.redMul(da.redAdd(cb).redSqr()); + // Z5 = X1 * (DA - CB)^2 + var nz = diff.x.redMul(da.redISub(cb).redSqr()); + return this.curve.point(nx, nz); +}; + +Point.prototype.mul = function mul(k) { + var t = k.clone(); + var a = this; // (N / 2) * Q + Q + var b = this.curve.point(null, null); // (N / 2) * Q + var c = this; // Q + + for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1)) + bits.push(t.andln(1)); + + for (var i = bits.length - 1; i >= 0; i--) { + if (bits[i] === 0) { + // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q + a = a.diffAdd(b, c); + // N * Q = 2 * ((N / 2) * Q + Q)) + b = b.dbl(); + } else { + // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q) + b = a.diffAdd(b, c); + // N * Q + Q = 2 * ((N / 2) * Q + Q) + a = a.dbl(); + } + } + return b; +}; + +Point.prototype.mulAdd = function mulAdd() { + throw new Error('Not supported on Montgomery curve'); +}; + +Point.prototype.jumlAdd = function jumlAdd() { + throw new Error('Not supported on Montgomery curve'); +}; + +Point.prototype.eq = function eq(other) { + return this.getX().cmp(other.getX()) === 0; +}; + +Point.prototype.normalize = function normalize() { + this.x = this.x.redMul(this.z.redInvm()); + this.z = this.curve.one; + return this; +}; + +Point.prototype.getX = function getX() { + // Normalize coordinates + this.normalize(); + + return this.x.fromRed(); +}; diff --git a/node_modules/elliptic/lib/elliptic/curve/short.js b/node_modules/elliptic/lib/elliptic/curve/short.js new file mode 100644 index 0000000..b263ecf --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/curve/short.js @@ -0,0 +1,937 @@ +'use strict'; + +var utils = require('../utils'); +var BN = require('bn.js'); +var inherits = require('inherits'); +var Base = require('./base'); + +var assert = utils.assert; + +function ShortCurve(conf) { + Base.call(this, 'short', conf); + + this.a = new BN(conf.a, 16).toRed(this.red); + this.b = new BN(conf.b, 16).toRed(this.red); + this.tinv = this.two.redInvm(); + + this.zeroA = this.a.fromRed().cmpn(0) === 0; + this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0; + + // If the curve is endomorphic, precalculate beta and lambda + this.endo = this._getEndomorphism(conf); + this._endoWnafT1 = new Array(4); + this._endoWnafT2 = new Array(4); +} +inherits(ShortCurve, Base); +module.exports = ShortCurve; + +ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) { + // No efficient endomorphism + if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) + return; + + // Compute beta and lambda, that lambda * P = (beta * Px; Py) + var beta; + var lambda; + if (conf.beta) { + beta = new BN(conf.beta, 16).toRed(this.red); + } else { + var betas = this._getEndoRoots(this.p); + // Choose the smallest beta + beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1]; + beta = beta.toRed(this.red); + } + if (conf.lambda) { + lambda = new BN(conf.lambda, 16); + } else { + // Choose the lambda that is matching selected beta + var lambdas = this._getEndoRoots(this.n); + if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) { + lambda = lambdas[0]; + } else { + lambda = lambdas[1]; + assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0); + } + } + + // Get basis vectors, used for balanced length-two representation + var basis; + if (conf.basis) { + basis = conf.basis.map(function(vec) { + return { + a: new BN(vec.a, 16), + b: new BN(vec.b, 16) + }; + }); + } else { + basis = this._getEndoBasis(lambda); + } + + return { + beta: beta, + lambda: lambda, + basis: basis + }; +}; + +ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) { + // Find roots of for x^2 + x + 1 in F + // Root = (-1 +- Sqrt(-3)) / 2 + // + var red = num === this.p ? this.red : BN.mont(num); + var tinv = new BN(2).toRed(red).redInvm(); + var ntinv = tinv.redNeg(); + + var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv); + + var l1 = ntinv.redAdd(s).fromRed(); + var l2 = ntinv.redSub(s).fromRed(); + return [ l1, l2 ]; +}; + +ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) { + // aprxSqrt >= sqrt(this.n) + var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)); + + // 3.74 + // Run EGCD, until r(L + 1) < aprxSqrt + var u = lambda; + var v = this.n.clone(); + var x1 = new BN(1); + var y1 = new BN(0); + var x2 = new BN(0); + var y2 = new BN(1); + + // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n) + var a0; + var b0; + // First vector + var a1; + var b1; + // Second vector + var a2; + var b2; + + var prevR; + var i = 0; + var r; + var x; + while (u.cmpn(0) !== 0) { + var q = v.div(u); + r = v.sub(q.mul(u)); + x = x2.sub(q.mul(x1)); + var y = y2.sub(q.mul(y1)); + + if (!a1 && r.cmp(aprxSqrt) < 0) { + a0 = prevR.neg(); + b0 = x1; + a1 = r.neg(); + b1 = x; + } else if (a1 && ++i === 2) { + break; + } + prevR = r; + + v = u; + u = r; + x2 = x1; + x1 = x; + y2 = y1; + y1 = y; + } + a2 = r.neg(); + b2 = x; + + var len1 = a1.sqr().add(b1.sqr()); + var len2 = a2.sqr().add(b2.sqr()); + if (len2.cmp(len1) >= 0) { + a2 = a0; + b2 = b0; + } + + // Normalize signs + if (a1.negative) { + a1 = a1.neg(); + b1 = b1.neg(); + } + if (a2.negative) { + a2 = a2.neg(); + b2 = b2.neg(); + } + + return [ + { a: a1, b: b1 }, + { a: a2, b: b2 } + ]; +}; + +ShortCurve.prototype._endoSplit = function _endoSplit(k) { + var basis = this.endo.basis; + var v1 = basis[0]; + var v2 = basis[1]; + + var c1 = v2.b.mul(k).divRound(this.n); + var c2 = v1.b.neg().mul(k).divRound(this.n); + + var p1 = c1.mul(v1.a); + var p2 = c2.mul(v2.a); + var q1 = c1.mul(v1.b); + var q2 = c2.mul(v2.b); + + // Calculate answer + var k1 = k.sub(p1).sub(p2); + var k2 = q1.add(q2).neg(); + return { k1: k1, k2: k2 }; +}; + +ShortCurve.prototype.pointFromX = function pointFromX(x, odd) { + x = new BN(x, 16); + if (!x.red) + x = x.toRed(this.red); + + var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b); + var y = y2.redSqrt(); + if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) + throw new Error('invalid point'); + + // XXX Is there any way to tell if the number is odd without converting it + // to non-red form? + var isOdd = y.fromRed().isOdd(); + if (odd && !isOdd || !odd && isOdd) + y = y.redNeg(); + + return this.point(x, y); +}; + +ShortCurve.prototype.validate = function validate(point) { + if (point.inf) + return true; + + var x = point.x; + var y = point.y; + + var ax = this.a.redMul(x); + var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b); + return y.redSqr().redISub(rhs).cmpn(0) === 0; +}; + +ShortCurve.prototype._endoWnafMulAdd = + function _endoWnafMulAdd(points, coeffs, jacobianResult) { + var npoints = this._endoWnafT1; + var ncoeffs = this._endoWnafT2; + for (var i = 0; i < points.length; i++) { + var split = this._endoSplit(coeffs[i]); + var p = points[i]; + var beta = p._getBeta(); + + if (split.k1.negative) { + split.k1.ineg(); + p = p.neg(true); + } + if (split.k2.negative) { + split.k2.ineg(); + beta = beta.neg(true); + } + + npoints[i * 2] = p; + npoints[i * 2 + 1] = beta; + ncoeffs[i * 2] = split.k1; + ncoeffs[i * 2 + 1] = split.k2; + } + var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult); + + // Clean-up references to points and coefficients + for (var j = 0; j < i * 2; j++) { + npoints[j] = null; + ncoeffs[j] = null; + } + return res; +}; + +function Point(curve, x, y, isRed) { + Base.BasePoint.call(this, curve, 'affine'); + if (x === null && y === null) { + this.x = null; + this.y = null; + this.inf = true; + } else { + this.x = new BN(x, 16); + this.y = new BN(y, 16); + // Force redgomery representation when loading from JSON + if (isRed) { + this.x.forceRed(this.curve.red); + this.y.forceRed(this.curve.red); + } + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + this.inf = false; + } +} +inherits(Point, Base.BasePoint); + +ShortCurve.prototype.point = function point(x, y, isRed) { + return new Point(this, x, y, isRed); +}; + +ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) { + return Point.fromJSON(this, obj, red); +}; + +Point.prototype._getBeta = function _getBeta() { + if (!this.curve.endo) + return; + + var pre = this.precomputed; + if (pre && pre.beta) + return pre.beta; + + var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); + if (pre) { + var curve = this.curve; + var endoMul = function(p) { + return curve.point(p.x.redMul(curve.endo.beta), p.y); + }; + pre.beta = beta; + beta.precomputed = { + beta: null, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(endoMul) + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(endoMul) + } + }; + } + return beta; +}; + +Point.prototype.toJSON = function toJSON() { + if (!this.precomputed) + return [ this.x, this.y ]; + + return [ this.x, this.y, this.precomputed && { + doubles: this.precomputed.doubles && { + step: this.precomputed.doubles.step, + points: this.precomputed.doubles.points.slice(1) + }, + naf: this.precomputed.naf && { + wnd: this.precomputed.naf.wnd, + points: this.precomputed.naf.points.slice(1) + } + } ]; +}; + +Point.fromJSON = function fromJSON(curve, obj, red) { + if (typeof obj === 'string') + obj = JSON.parse(obj); + var res = curve.point(obj[0], obj[1], red); + if (!obj[2]) + return res; + + function obj2point(obj) { + return curve.point(obj[0], obj[1], red); + } + + var pre = obj[2]; + res.precomputed = { + beta: null, + doubles: pre.doubles && { + step: pre.doubles.step, + points: [ res ].concat(pre.doubles.points.map(obj2point)) + }, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: [ res ].concat(pre.naf.points.map(obj2point)) + } + }; + return res; +}; + +Point.prototype.inspect = function inspect() { + if (this.isInfinity()) + return ''; + return ''; +}; + +Point.prototype.isInfinity = function isInfinity() { + return this.inf; +}; + +Point.prototype.add = function add(p) { + // O + P = P + if (this.inf) + return p; + + // P + O = P + if (p.inf) + return this; + + // P + P = 2P + if (this.eq(p)) + return this.dbl(); + + // P + (-P) = O + if (this.neg().eq(p)) + return this.curve.point(null, null); + + // P + Q = O + if (this.x.cmp(p.x) === 0) + return this.curve.point(null, null); + + var c = this.y.redSub(p.y); + if (c.cmpn(0) !== 0) + c = c.redMul(this.x.redSub(p.x).redInvm()); + var nx = c.redSqr().redISub(this.x).redISub(p.x); + var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); +}; + +Point.prototype.dbl = function dbl() { + if (this.inf) + return this; + + // 2P = O + var ys1 = this.y.redAdd(this.y); + if (ys1.cmpn(0) === 0) + return this.curve.point(null, null); + + var a = this.curve.a; + + var x2 = this.x.redSqr(); + var dyinv = ys1.redInvm(); + var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv); + + var nx = c.redSqr().redISub(this.x.redAdd(this.x)); + var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); +}; + +Point.prototype.getX = function getX() { + return this.x.fromRed(); +}; + +Point.prototype.getY = function getY() { + return this.y.fromRed(); +}; + +Point.prototype.mul = function mul(k) { + k = new BN(k, 16); + if (this.isInfinity()) + return this; + else if (this._hasDoubles(k)) + return this.curve._fixedNafMul(this, k); + else if (this.curve.endo) + return this.curve._endoWnafMulAdd([ this ], [ k ]); + else + return this.curve._wnafMul(this, k); +}; + +Point.prototype.mulAdd = function mulAdd(k1, p2, k2) { + var points = [ this, p2 ]; + var coeffs = [ k1, k2 ]; + if (this.curve.endo) + return this.curve._endoWnafMulAdd(points, coeffs); + else + return this.curve._wnafMulAdd(1, points, coeffs, 2); +}; + +Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) { + var points = [ this, p2 ]; + var coeffs = [ k1, k2 ]; + if (this.curve.endo) + return this.curve._endoWnafMulAdd(points, coeffs, true); + else + return this.curve._wnafMulAdd(1, points, coeffs, 2, true); +}; + +Point.prototype.eq = function eq(p) { + return this === p || + this.inf === p.inf && + (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0); +}; + +Point.prototype.neg = function neg(_precompute) { + if (this.inf) + return this; + + var res = this.curve.point(this.x, this.y.redNeg()); + if (_precompute && this.precomputed) { + var pre = this.precomputed; + var negate = function(p) { + return p.neg(); + }; + res.precomputed = { + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(negate) + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(negate) + } + }; + } + return res; +}; + +Point.prototype.toJ = function toJ() { + if (this.inf) + return this.curve.jpoint(null, null, null); + + var res = this.curve.jpoint(this.x, this.y, this.curve.one); + return res; +}; + +function JPoint(curve, x, y, z) { + Base.BasePoint.call(this, curve, 'jacobian'); + if (x === null && y === null && z === null) { + this.x = this.curve.one; + this.y = this.curve.one; + this.z = new BN(0); + } else { + this.x = new BN(x, 16); + this.y = new BN(y, 16); + this.z = new BN(z, 16); + } + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + + this.zOne = this.z === this.curve.one; +} +inherits(JPoint, Base.BasePoint); + +ShortCurve.prototype.jpoint = function jpoint(x, y, z) { + return new JPoint(this, x, y, z); +}; + +JPoint.prototype.toP = function toP() { + if (this.isInfinity()) + return this.curve.point(null, null); + + var zinv = this.z.redInvm(); + var zinv2 = zinv.redSqr(); + var ax = this.x.redMul(zinv2); + var ay = this.y.redMul(zinv2).redMul(zinv); + + return this.curve.point(ax, ay); +}; + +JPoint.prototype.neg = function neg() { + return this.curve.jpoint(this.x, this.y.redNeg(), this.z); +}; + +JPoint.prototype.add = function add(p) { + // O + P = P + if (this.isInfinity()) + return p; + + // P + O = P + if (p.isInfinity()) + return this; + + // 12M + 4S + 7A + var pz2 = p.z.redSqr(); + var z2 = this.z.redSqr(); + var u1 = this.x.redMul(pz2); + var u2 = p.x.redMul(z2); + var s1 = this.y.redMul(pz2.redMul(p.z)); + var s2 = p.y.redMul(z2.redMul(this.z)); + + var h = u1.redSub(u2); + var r = s1.redSub(s2); + if (h.cmpn(0) === 0) { + if (r.cmpn(0) !== 0) + return this.curve.jpoint(null, null, null); + else + return this.dbl(); + } + + var h2 = h.redSqr(); + var h3 = h2.redMul(h); + var v = u1.redMul(h2); + + var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); + var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); + var nz = this.z.redMul(p.z).redMul(h); + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype.mixedAdd = function mixedAdd(p) { + // O + P = P + if (this.isInfinity()) + return p.toJ(); + + // P + O = P + if (p.isInfinity()) + return this; + + // 8M + 3S + 7A + var z2 = this.z.redSqr(); + var u1 = this.x; + var u2 = p.x.redMul(z2); + var s1 = this.y; + var s2 = p.y.redMul(z2).redMul(this.z); + + var h = u1.redSub(u2); + var r = s1.redSub(s2); + if (h.cmpn(0) === 0) { + if (r.cmpn(0) !== 0) + return this.curve.jpoint(null, null, null); + else + return this.dbl(); + } + + var h2 = h.redSqr(); + var h3 = h2.redMul(h); + var v = u1.redMul(h2); + + var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); + var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); + var nz = this.z.redMul(h); + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype.dblp = function dblp(pow) { + if (pow === 0) + return this; + if (this.isInfinity()) + return this; + if (!pow) + return this.dbl(); + + if (this.curve.zeroA || this.curve.threeA) { + var r = this; + for (var i = 0; i < pow; i++) + r = r.dbl(); + return r; + } + + // 1M + 2S + 1A + N * (4S + 5M + 8A) + // N = 1 => 6M + 6S + 9A + var a = this.curve.a; + var tinv = this.curve.tinv; + + var jx = this.x; + var jy = this.y; + var jz = this.z; + var jz4 = jz.redSqr().redSqr(); + + // Reuse results + var jyd = jy.redAdd(jy); + for (var i = 0; i < pow; i++) { + var jx2 = jx.redSqr(); + var jyd2 = jyd.redSqr(); + var jyd4 = jyd2.redSqr(); + var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); + + var t1 = jx.redMul(jyd2); + var nx = c.redSqr().redISub(t1.redAdd(t1)); + var t2 = t1.redISub(nx); + var dny = c.redMul(t2); + dny = dny.redIAdd(dny).redISub(jyd4); + var nz = jyd.redMul(jz); + if (i + 1 < pow) + jz4 = jz4.redMul(jyd4); + + jx = nx; + jz = nz; + jyd = dny; + } + + return this.curve.jpoint(jx, jyd.redMul(tinv), jz); +}; + +JPoint.prototype.dbl = function dbl() { + if (this.isInfinity()) + return this; + + if (this.curve.zeroA) + return this._zeroDbl(); + else if (this.curve.threeA) + return this._threeDbl(); + else + return this._dbl(); +}; + +JPoint.prototype._zeroDbl = function _zeroDbl() { + var nx; + var ny; + var nz; + // Z = 1 + if (this.zOne) { + // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html + // #doubling-mdbl-2007-bl + // 1M + 5S + 14A + + // XX = X1^2 + var xx = this.x.redSqr(); + // YY = Y1^2 + var yy = this.y.redSqr(); + // YYYY = YY^2 + var yyyy = yy.redSqr(); + // S = 2 * ((X1 + YY)^2 - XX - YYYY) + var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s = s.redIAdd(s); + // M = 3 * XX + a; a = 0 + var m = xx.redAdd(xx).redIAdd(xx); + // T = M ^ 2 - 2*S + var t = m.redSqr().redISub(s).redISub(s); + + // 8 * YYYY + var yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8); + yyyy8 = yyyy8.redIAdd(yyyy8); + + // X3 = T + nx = t; + // Y3 = M * (S - T) - 8 * YYYY + ny = m.redMul(s.redISub(t)).redISub(yyyy8); + // Z3 = 2*Y1 + nz = this.y.redAdd(this.y); + } else { + // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html + // #doubling-dbl-2009-l + // 2M + 5S + 13A + + // A = X1^2 + var a = this.x.redSqr(); + // B = Y1^2 + var b = this.y.redSqr(); + // C = B^2 + var c = b.redSqr(); + // D = 2 * ((X1 + B)^2 - A - C) + var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c); + d = d.redIAdd(d); + // E = 3 * A + var e = a.redAdd(a).redIAdd(a); + // F = E^2 + var f = e.redSqr(); + + // 8 * C + var c8 = c.redIAdd(c); + c8 = c8.redIAdd(c8); + c8 = c8.redIAdd(c8); + + // X3 = F - 2 * D + nx = f.redISub(d).redISub(d); + // Y3 = E * (D - X3) - 8 * C + ny = e.redMul(d.redISub(nx)).redISub(c8); + // Z3 = 2 * Y1 * Z1 + nz = this.y.redMul(this.z); + nz = nz.redIAdd(nz); + } + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype._threeDbl = function _threeDbl() { + var nx; + var ny; + var nz; + // Z = 1 + if (this.zOne) { + // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html + // #doubling-mdbl-2007-bl + // 1M + 5S + 15A + + // XX = X1^2 + var xx = this.x.redSqr(); + // YY = Y1^2 + var yy = this.y.redSqr(); + // YYYY = YY^2 + var yyyy = yy.redSqr(); + // S = 2 * ((X1 + YY)^2 - XX - YYYY) + var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s = s.redIAdd(s); + // M = 3 * XX + a + var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a); + // T = M^2 - 2 * S + var t = m.redSqr().redISub(s).redISub(s); + // X3 = T + nx = t; + // Y3 = M * (S - T) - 8 * YYYY + var yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8); + yyyy8 = yyyy8.redIAdd(yyyy8); + ny = m.redMul(s.redISub(t)).redISub(yyyy8); + // Z3 = 2 * Y1 + nz = this.y.redAdd(this.y); + } else { + // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b + // 3M + 5S + + // delta = Z1^2 + var delta = this.z.redSqr(); + // gamma = Y1^2 + var gamma = this.y.redSqr(); + // beta = X1 * gamma + var beta = this.x.redMul(gamma); + // alpha = 3 * (X1 - delta) * (X1 + delta) + var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta)); + alpha = alpha.redAdd(alpha).redIAdd(alpha); + // X3 = alpha^2 - 8 * beta + var beta4 = beta.redIAdd(beta); + beta4 = beta4.redIAdd(beta4); + var beta8 = beta4.redAdd(beta4); + nx = alpha.redSqr().redISub(beta8); + // Z3 = (Y1 + Z1)^2 - gamma - delta + nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); + // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2 + var ggamma8 = gamma.redSqr(); + ggamma8 = ggamma8.redIAdd(ggamma8); + ggamma8 = ggamma8.redIAdd(ggamma8); + ggamma8 = ggamma8.redIAdd(ggamma8); + ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8); + } + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype._dbl = function _dbl() { + var a = this.curve.a; + + // 4M + 6S + 10A + var jx = this.x; + var jy = this.y; + var jz = this.z; + var jz4 = jz.redSqr().redSqr(); + + var jx2 = jx.redSqr(); + var jy2 = jy.redSqr(); + + var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); + + var jxd4 = jx.redAdd(jx); + jxd4 = jxd4.redIAdd(jxd4); + var t1 = jxd4.redMul(jy2); + var nx = c.redSqr().redISub(t1.redAdd(t1)); + var t2 = t1.redISub(nx); + + var jyd8 = jy2.redSqr(); + jyd8 = jyd8.redIAdd(jyd8); + jyd8 = jyd8.redIAdd(jyd8); + jyd8 = jyd8.redIAdd(jyd8); + var ny = c.redMul(t2).redISub(jyd8); + var nz = jy.redAdd(jy).redMul(jz); + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype.trpl = function trpl() { + if (!this.curve.zeroA) + return this.dbl().add(this); + + // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl + // 5M + 10S + ... + + // XX = X1^2 + var xx = this.x.redSqr(); + // YY = Y1^2 + var yy = this.y.redSqr(); + // ZZ = Z1^2 + var zz = this.z.redSqr(); + // YYYY = YY^2 + var yyyy = yy.redSqr(); + // M = 3 * XX + a * ZZ2; a = 0 + var m = xx.redAdd(xx).redIAdd(xx); + // MM = M^2 + var mm = m.redSqr(); + // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM + var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + e = e.redIAdd(e); + e = e.redAdd(e).redIAdd(e); + e = e.redISub(mm); + // EE = E^2 + var ee = e.redSqr(); + // T = 16*YYYY + var t = yyyy.redIAdd(yyyy); + t = t.redIAdd(t); + t = t.redIAdd(t); + t = t.redIAdd(t); + // U = (M + E)^2 - MM - EE - T + var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t); + // X3 = 4 * (X1 * EE - 4 * YY * U) + var yyu4 = yy.redMul(u); + yyu4 = yyu4.redIAdd(yyu4); + yyu4 = yyu4.redIAdd(yyu4); + var nx = this.x.redMul(ee).redISub(yyu4); + nx = nx.redIAdd(nx); + nx = nx.redIAdd(nx); + // Y3 = 8 * Y1 * (U * (T - U) - E * EE) + var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee))); + ny = ny.redIAdd(ny); + ny = ny.redIAdd(ny); + ny = ny.redIAdd(ny); + // Z3 = (Z1 + E)^2 - ZZ - EE + var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee); + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype.mul = function mul(k, kbase) { + k = new BN(k, kbase); + + return this.curve._wnafMul(this, k); +}; + +JPoint.prototype.eq = function eq(p) { + if (p.type === 'affine') + return this.eq(p.toJ()); + + if (this === p) + return true; + + // x1 * z2^2 == x2 * z1^2 + var z2 = this.z.redSqr(); + var pz2 = p.z.redSqr(); + if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0) + return false; + + // y1 * z2^3 == y2 * z1^3 + var z3 = z2.redMul(this.z); + var pz3 = pz2.redMul(p.z); + return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0; +}; + +JPoint.prototype.eqXToP = function eqXToP(x) { + var zs = this.z.redSqr(); + var rx = x.toRed(this.curve.red).redMul(zs); + if (this.x.cmp(rx) === 0) + return true; + + var xc = x.clone(); + var t = this.curve.redN.redMul(zs); + for (;;) { + xc.iadd(this.curve.n); + if (xc.cmp(this.curve.p) >= 0) + return false; + + rx.redIAdd(t); + if (this.x.cmp(rx) === 0) + return true; + } +}; + +JPoint.prototype.inspect = function inspect() { + if (this.isInfinity()) + return ''; + return ''; +}; + +JPoint.prototype.isInfinity = function isInfinity() { + // XXX This code assumes that zero is always zero in red + return this.z.cmpn(0) === 0; +}; diff --git a/node_modules/elliptic/lib/elliptic/curves.js b/node_modules/elliptic/lib/elliptic/curves.js new file mode 100644 index 0000000..63d8655 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/curves.js @@ -0,0 +1,206 @@ +'use strict'; + +var curves = exports; + +var hash = require('hash.js'); +var curve = require('./curve'); +var utils = require('./utils'); + +var assert = utils.assert; + +function PresetCurve(options) { + if (options.type === 'short') + this.curve = new curve.short(options); + else if (options.type === 'edwards') + this.curve = new curve.edwards(options); + else + this.curve = new curve.mont(options); + this.g = this.curve.g; + this.n = this.curve.n; + this.hash = options.hash; + + assert(this.g.validate(), 'Invalid curve'); + assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O'); +} +curves.PresetCurve = PresetCurve; + +function defineCurve(name, options) { + Object.defineProperty(curves, name, { + configurable: true, + enumerable: true, + get: function() { + var curve = new PresetCurve(options); + Object.defineProperty(curves, name, { + configurable: true, + enumerable: true, + value: curve + }); + return curve; + } + }); +} + +defineCurve('p192', { + type: 'short', + prime: 'p192', + p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff', + a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc', + b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1', + n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831', + hash: hash.sha256, + gRed: false, + g: [ + '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012', + '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811' + ] +}); + +defineCurve('p224', { + type: 'short', + prime: 'p224', + p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001', + a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe', + b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4', + n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d', + hash: hash.sha256, + gRed: false, + g: [ + 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21', + 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34' + ] +}); + +defineCurve('p256', { + type: 'short', + prime: null, + p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff', + a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc', + b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b', + n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551', + hash: hash.sha256, + gRed: false, + g: [ + '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296', + '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5' + ] +}); + +defineCurve('p384', { + type: 'short', + prime: null, + p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'fffffffe ffffffff 00000000 00000000 ffffffff', + a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'fffffffe ffffffff 00000000 00000000 fffffffc', + b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' + + '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef', + n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' + + 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973', + hash: hash.sha384, + gRed: false, + g: [ + 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' + + '5502f25d bf55296c 3a545e38 72760ab7', + '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' + + '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f' + ] +}); + +defineCurve('p521', { + type: 'short', + prime: null, + p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'ffffffff ffffffff ffffffff ffffffff ffffffff', + a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'ffffffff ffffffff ffffffff ffffffff fffffffc', + b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' + + '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' + + '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00', + n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' + + 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409', + hash: hash.sha512, + gRed: false, + g: [ + '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' + + '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' + + 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66', + '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' + + '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' + + '3fad0761 353c7086 a272c240 88be9476 9fd16650' + ] +}); + +defineCurve('curve25519', { + type: 'mont', + prime: 'p25519', + p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', + a: '76d06', + b: '1', + n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', + hash: hash.sha256, + gRed: false, + g: [ + '9' + ] +}); + +defineCurve('ed25519', { + type: 'edwards', + prime: 'p25519', + p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', + a: '-1', + c: '1', + // -121665 * (121666^(-1)) (mod P) + d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3', + n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', + hash: hash.sha256, + gRed: false, + g: [ + '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a', + + // 4/5 + '6666666666666666666666666666666666666666666666666666666666666658' + ] +}); + +var pre; +try { + pre = require('./precomputed/secp256k1'); +} catch (e) { + pre = undefined; +} + +defineCurve('secp256k1', { + type: 'short', + prime: 'k256', + p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f', + a: '0', + b: '7', + n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141', + h: '1', + hash: hash.sha256, + + // Precomputed endomorphism + beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee', + lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72', + basis: [ + { + a: '3086d221a7d46bcde86c90e49284eb15', + b: '-e4437ed6010e88286f547fa90abfe4c3' + }, + { + a: '114ca50f7a8e2f3f657c1108d9d44cfd8', + b: '3086d221a7d46bcde86c90e49284eb15' + } + ], + + gRed: false, + g: [ + '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', + '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8', + pre + ] +}); diff --git a/node_modules/elliptic/lib/elliptic/ec/index.js b/node_modules/elliptic/lib/elliptic/ec/index.js new file mode 100644 index 0000000..0f1d8ce --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/ec/index.js @@ -0,0 +1,241 @@ +'use strict'; + +var BN = require('bn.js'); +var HmacDRBG = require('hmac-drbg'); +var utils = require('../utils'); +var curves = require('../curves'); +var rand = require('brorand'); +var assert = utils.assert; + +var KeyPair = require('./key'); +var Signature = require('./signature'); + +function EC(options) { + if (!(this instanceof EC)) + return new EC(options); + + // Shortcut `elliptic.ec(curve-name)` + if (typeof options === 'string') { + assert(curves.hasOwnProperty(options), 'Unknown curve ' + options); + + options = curves[options]; + } + + // Shortcut for `elliptic.ec(elliptic.curves.curveName)` + if (options instanceof curves.PresetCurve) + options = { curve: options }; + + this.curve = options.curve.curve; + this.n = this.curve.n; + this.nh = this.n.ushrn(1); + this.g = this.curve.g; + + // Point on curve + this.g = options.curve.g; + this.g.precompute(options.curve.n.bitLength() + 1); + + // Hash for function for DRBG + this.hash = options.hash || options.curve.hash; +} +module.exports = EC; + +EC.prototype.keyPair = function keyPair(options) { + return new KeyPair(this, options); +}; + +EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) { + return KeyPair.fromPrivate(this, priv, enc); +}; + +EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) { + return KeyPair.fromPublic(this, pub, enc); +}; + +EC.prototype.genKeyPair = function genKeyPair(options) { + if (!options) + options = {}; + + // Instantiate Hmac_DRBG + var drbg = new HmacDRBG({ + hash: this.hash, + pers: options.pers, + persEnc: options.persEnc || 'utf8', + entropy: options.entropy || rand(this.hash.hmacStrength), + entropyEnc: options.entropy && options.entropyEnc || 'utf8', + nonce: this.n.toArray() + }); + + var bytes = this.n.byteLength(); + var ns2 = this.n.sub(new BN(2)); + do { + var priv = new BN(drbg.generate(bytes)); + if (priv.cmp(ns2) > 0) + continue; + + priv.iaddn(1); + return this.keyFromPrivate(priv); + } while (true); +}; + +EC.prototype._truncateToN = function truncateToN(msg, truncOnly) { + var delta = msg.byteLength() * 8 - this.n.bitLength(); + if (delta > 0) + msg = msg.ushrn(delta); + if (!truncOnly && msg.cmp(this.n) >= 0) + return msg.sub(this.n); + else + return msg; +}; + +EC.prototype.sign = function sign(msg, key, enc, options) { + if (typeof enc === 'object') { + options = enc; + enc = null; + } + if (!options) + options = {}; + + key = this.keyFromPrivate(key, enc); + msg = this._truncateToN(new BN(msg, 16)); + + // Zero-extend key to provide enough entropy + var bytes = this.n.byteLength(); + var bkey = key.getPrivate().toArray('be', bytes); + + // Zero-extend nonce to have the same byte size as N + var nonce = msg.toArray('be', bytes); + + // Instantiate Hmac_DRBG + var drbg = new HmacDRBG({ + hash: this.hash, + entropy: bkey, + nonce: nonce, + pers: options.pers, + persEnc: options.persEnc || 'utf8' + }); + + // Number of bytes to generate + var ns1 = this.n.sub(new BN(1)); + + for (var iter = 0; true; iter++) { + var k = options.k ? + options.k(iter) : + new BN(drbg.generate(this.n.byteLength())); + k = this._truncateToN(k, true); + if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0) + continue; + + var kp = this.g.mul(k); + if (kp.isInfinity()) + continue; + + var kpX = kp.getX(); + var r = kpX.umod(this.n); + if (r.cmpn(0) === 0) + continue; + + var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg)); + s = s.umod(this.n); + if (s.cmpn(0) === 0) + continue; + + var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | + (kpX.cmp(r) !== 0 ? 2 : 0); + + // Use complement of `s`, if it is > `n / 2` + if (options.canonical && s.cmp(this.nh) > 0) { + s = this.n.sub(s); + recoveryParam ^= 1; + } + + return new Signature({ r: r, s: s, recoveryParam: recoveryParam }); + } +}; + +EC.prototype.verify = function verify(msg, signature, key, enc) { + msg = this._truncateToN(new BN(msg, 16)); + key = this.keyFromPublic(key, enc); + signature = new Signature(signature, 'hex'); + + // Perform primitive values validation + var r = signature.r; + var s = signature.s; + if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0) + return false; + if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0) + return false; + + // Validate signature + var sinv = s.invm(this.n); + var u1 = sinv.mul(msg).umod(this.n); + var u2 = sinv.mul(r).umod(this.n); + + if (!this.curve._maxwellTrick) { + var p = this.g.mulAdd(u1, key.getPublic(), u2); + if (p.isInfinity()) + return false; + + return p.getX().umod(this.n).cmp(r) === 0; + } + + // NOTE: Greg Maxwell's trick, inspired by: + // https://git.io/vad3K + + var p = this.g.jmulAdd(u1, key.getPublic(), u2); + if (p.isInfinity()) + return false; + + // Compare `p.x` of Jacobian point with `r`, + // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the + // inverse of `p.z^2` + return p.eqXToP(r); +}; + +EC.prototype.recoverPubKey = function(msg, signature, j, enc) { + assert((3 & j) === j, 'The recovery param is more than two bits'); + signature = new Signature(signature, enc); + + var n = this.n; + var e = new BN(msg); + var r = signature.r; + var s = signature.s; + + // A set LSB signifies that the y-coordinate is odd + var isYOdd = j & 1; + var isSecondKey = j >> 1; + if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey) + throw new Error('Unable to find sencond key candinate'); + + // 1.1. Let x = r + jn. + if (isSecondKey) + r = this.curve.pointFromX(r.add(this.curve.n), isYOdd); + else + r = this.curve.pointFromX(r, isYOdd); + + var rInv = signature.r.invm(n); + var s1 = n.sub(e).mul(rInv).umod(n); + var s2 = s.mul(rInv).umod(n); + + // 1.6.1 Compute Q = r^-1 (sR - eG) + // Q = r^-1 (sR + -eG) + return this.g.mulAdd(s1, r, s2); +}; + +EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) { + signature = new Signature(signature, enc); + if (signature.recoveryParam !== null) + return signature.recoveryParam; + + for (var i = 0; i < 4; i++) { + var Qprime; + try { + Qprime = this.recoverPubKey(e, signature, i); + } catch (e) { + continue; + } + + if (Qprime.eq(Q)) + return i; + } + throw new Error('Unable to find valid recovery factor'); +}; diff --git a/node_modules/elliptic/lib/elliptic/ec/key.js b/node_modules/elliptic/lib/elliptic/ec/key.js new file mode 100644 index 0000000..4a56d69 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/ec/key.js @@ -0,0 +1,118 @@ +'use strict'; + +var BN = require('bn.js'); +var utils = require('../utils'); +var assert = utils.assert; + +function KeyPair(ec, options) { + this.ec = ec; + this.priv = null; + this.pub = null; + + // KeyPair(ec, { priv: ..., pub: ... }) + if (options.priv) + this._importPrivate(options.priv, options.privEnc); + if (options.pub) + this._importPublic(options.pub, options.pubEnc); +} +module.exports = KeyPair; + +KeyPair.fromPublic = function fromPublic(ec, pub, enc) { + if (pub instanceof KeyPair) + return pub; + + return new KeyPair(ec, { + pub: pub, + pubEnc: enc + }); +}; + +KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) { + if (priv instanceof KeyPair) + return priv; + + return new KeyPair(ec, { + priv: priv, + privEnc: enc + }); +}; + +KeyPair.prototype.validate = function validate() { + var pub = this.getPublic(); + + if (pub.isInfinity()) + return { result: false, reason: 'Invalid public key' }; + if (!pub.validate()) + return { result: false, reason: 'Public key is not a point' }; + if (!pub.mul(this.ec.curve.n).isInfinity()) + return { result: false, reason: 'Public key * N != O' }; + + return { result: true, reason: null }; +}; + +KeyPair.prototype.getPublic = function getPublic(compact, enc) { + // compact is optional argument + if (typeof compact === 'string') { + enc = compact; + compact = null; + } + + if (!this.pub) + this.pub = this.ec.g.mul(this.priv); + + if (!enc) + return this.pub; + + return this.pub.encode(enc, compact); +}; + +KeyPair.prototype.getPrivate = function getPrivate(enc) { + if (enc === 'hex') + return this.priv.toString(16, 2); + else + return this.priv; +}; + +KeyPair.prototype._importPrivate = function _importPrivate(key, enc) { + this.priv = new BN(key, enc || 16); + + // Ensure that the priv won't be bigger than n, otherwise we may fail + // in fixed multiplication method + this.priv = this.priv.umod(this.ec.curve.n); +}; + +KeyPair.prototype._importPublic = function _importPublic(key, enc) { + if (key.x || key.y) { + // Montgomery points only have an `x` coordinate. + // Weierstrass/Edwards points on the other hand have both `x` and + // `y` coordinates. + if (this.ec.curve.type === 'mont') { + assert(key.x, 'Need x coordinate'); + } else if (this.ec.curve.type === 'short' || + this.ec.curve.type === 'edwards') { + assert(key.x && key.y, 'Need both x and y coordinate'); + } + this.pub = this.ec.curve.point(key.x, key.y); + return; + } + this.pub = this.ec.curve.decodePoint(key, enc); +}; + +// ECDH +KeyPair.prototype.derive = function derive(pub) { + return pub.mul(this.priv).getX(); +}; + +// ECDSA +KeyPair.prototype.sign = function sign(msg, enc, options) { + return this.ec.sign(msg, this, enc, options); +}; + +KeyPair.prototype.verify = function verify(msg, signature) { + return this.ec.verify(msg, signature, this); +}; + +KeyPair.prototype.inspect = function inspect() { + return ''; +}; diff --git a/node_modules/elliptic/lib/elliptic/ec/signature.js b/node_modules/elliptic/lib/elliptic/ec/signature.js new file mode 100644 index 0000000..2cb6b49 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/ec/signature.js @@ -0,0 +1,134 @@ +'use strict'; + +var BN = require('bn.js'); + +var utils = require('../utils'); +var assert = utils.assert; + +function Signature(options, enc) { + if (options instanceof Signature) + return options; + + if (this._importDER(options, enc)) + return; + + assert(options.r && options.s, 'Signature without r or s'); + this.r = new BN(options.r, 16); + this.s = new BN(options.s, 16); + if (options.recoveryParam === undefined) + this.recoveryParam = null; + else + this.recoveryParam = options.recoveryParam; +} +module.exports = Signature; + +function Position() { + this.place = 0; +} + +function getLength(buf, p) { + var initial = buf[p.place++]; + if (!(initial & 0x80)) { + return initial; + } + var octetLen = initial & 0xf; + var val = 0; + for (var i = 0, off = p.place; i < octetLen; i++, off++) { + val <<= 8; + val |= buf[off]; + } + p.place = off; + return val; +} + +function rmPadding(buf) { + var i = 0; + var len = buf.length - 1; + while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) { + i++; + } + if (i === 0) { + return buf; + } + return buf.slice(i); +} + +Signature.prototype._importDER = function _importDER(data, enc) { + data = utils.toArray(data, enc); + var p = new Position(); + if (data[p.place++] !== 0x30) { + return false; + } + var len = getLength(data, p); + if ((len + p.place) !== data.length) { + return false; + } + if (data[p.place++] !== 0x02) { + return false; + } + var rlen = getLength(data, p); + var r = data.slice(p.place, rlen + p.place); + p.place += rlen; + if (data[p.place++] !== 0x02) { + return false; + } + var slen = getLength(data, p); + if (data.length !== slen + p.place) { + return false; + } + var s = data.slice(p.place, slen + p.place); + if (r[0] === 0 && (r[1] & 0x80)) { + r = r.slice(1); + } + if (s[0] === 0 && (s[1] & 0x80)) { + s = s.slice(1); + } + + this.r = new BN(r); + this.s = new BN(s); + this.recoveryParam = null; + + return true; +}; + +function constructLength(arr, len) { + if (len < 0x80) { + arr.push(len); + return; + } + var octets = 1 + (Math.log(len) / Math.LN2 >>> 3); + arr.push(octets | 0x80); + while (--octets) { + arr.push((len >>> (octets << 3)) & 0xff); + } + arr.push(len); +} + +Signature.prototype.toDER = function toDER(enc) { + var r = this.r.toArray(); + var s = this.s.toArray(); + + // Pad values + if (r[0] & 0x80) + r = [ 0 ].concat(r); + // Pad values + if (s[0] & 0x80) + s = [ 0 ].concat(s); + + r = rmPadding(r); + s = rmPadding(s); + + while (!s[0] && !(s[1] & 0x80)) { + s = s.slice(1); + } + var arr = [ 0x02 ]; + constructLength(arr, r.length); + arr = arr.concat(r); + arr.push(0x02); + constructLength(arr, s.length); + var backHalf = arr.concat(s); + var res = [ 0x30 ]; + constructLength(res, backHalf.length); + res = res.concat(backHalf); + return utils.encode(res, enc); +}; diff --git a/node_modules/elliptic/lib/elliptic/eddsa/index.js b/node_modules/elliptic/lib/elliptic/eddsa/index.js new file mode 100644 index 0000000..f82fa35 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/eddsa/index.js @@ -0,0 +1,118 @@ +'use strict'; + +var hash = require('hash.js'); +var curves = require('../curves'); +var utils = require('../utils'); +var assert = utils.assert; +var parseBytes = utils.parseBytes; +var KeyPair = require('./key'); +var Signature = require('./signature'); + +function EDDSA(curve) { + assert(curve === 'ed25519', 'only tested with ed25519 so far'); + + if (!(this instanceof EDDSA)) + return new EDDSA(curve); + + var curve = curves[curve].curve; + this.curve = curve; + this.g = curve.g; + this.g.precompute(curve.n.bitLength() + 1); + + this.pointClass = curve.point().constructor; + this.encodingLength = Math.ceil(curve.n.bitLength() / 8); + this.hash = hash.sha512; +} + +module.exports = EDDSA; + +/** +* @param {Array|String} message - message bytes +* @param {Array|String|KeyPair} secret - secret bytes or a keypair +* @returns {Signature} - signature +*/ +EDDSA.prototype.sign = function sign(message, secret) { + message = parseBytes(message); + var key = this.keyFromSecret(secret); + var r = this.hashInt(key.messagePrefix(), message); + var R = this.g.mul(r); + var Rencoded = this.encodePoint(R); + var s_ = this.hashInt(Rencoded, key.pubBytes(), message) + .mul(key.priv()); + var S = r.add(s_).umod(this.curve.n); + return this.makeSignature({ R: R, S: S, Rencoded: Rencoded }); +}; + +/** +* @param {Array} message - message bytes +* @param {Array|String|Signature} sig - sig bytes +* @param {Array|String|Point|KeyPair} pub - public key +* @returns {Boolean} - true if public key matches sig of message +*/ +EDDSA.prototype.verify = function verify(message, sig, pub) { + message = parseBytes(message); + sig = this.makeSignature(sig); + var key = this.keyFromPublic(pub); + var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message); + var SG = this.g.mul(sig.S()); + var RplusAh = sig.R().add(key.pub().mul(h)); + return RplusAh.eq(SG); +}; + +EDDSA.prototype.hashInt = function hashInt() { + var hash = this.hash(); + for (var i = 0; i < arguments.length; i++) + hash.update(arguments[i]); + return utils.intFromLE(hash.digest()).umod(this.curve.n); +}; + +EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) { + return KeyPair.fromPublic(this, pub); +}; + +EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) { + return KeyPair.fromSecret(this, secret); +}; + +EDDSA.prototype.makeSignature = function makeSignature(sig) { + if (sig instanceof Signature) + return sig; + return new Signature(this, sig); +}; + +/** +* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2 +* +* EDDSA defines methods for encoding and decoding points and integers. These are +* helper convenience methods, that pass along to utility functions implied +* parameters. +* +*/ +EDDSA.prototype.encodePoint = function encodePoint(point) { + var enc = point.getY().toArray('le', this.encodingLength); + enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0; + return enc; +}; + +EDDSA.prototype.decodePoint = function decodePoint(bytes) { + bytes = utils.parseBytes(bytes); + + var lastIx = bytes.length - 1; + var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80); + var xIsOdd = (bytes[lastIx] & 0x80) !== 0; + + var y = utils.intFromLE(normed); + return this.curve.pointFromY(y, xIsOdd); +}; + +EDDSA.prototype.encodeInt = function encodeInt(num) { + return num.toArray('le', this.encodingLength); +}; + +EDDSA.prototype.decodeInt = function decodeInt(bytes) { + return utils.intFromLE(bytes); +}; + +EDDSA.prototype.isPoint = function isPoint(val) { + return val instanceof this.pointClass; +}; diff --git a/node_modules/elliptic/lib/elliptic/eddsa/key.js b/node_modules/elliptic/lib/elliptic/eddsa/key.js new file mode 100644 index 0000000..a00028f --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/eddsa/key.js @@ -0,0 +1,95 @@ +'use strict'; + +var utils = require('../utils'); +var assert = utils.assert; +var parseBytes = utils.parseBytes; +var cachedProperty = utils.cachedProperty; + +/** +* @param {EDDSA} eddsa - instance +* @param {Object} params - public/private key parameters +* +* @param {Array} [params.secret] - secret seed bytes +* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms) +* @param {Array} [params.pub] - public key point encoded as bytes +* +*/ +function KeyPair(eddsa, params) { + this.eddsa = eddsa; + this._secret = parseBytes(params.secret); + if (eddsa.isPoint(params.pub)) + this._pub = params.pub; + else + this._pubBytes = parseBytes(params.pub); +} + +KeyPair.fromPublic = function fromPublic(eddsa, pub) { + if (pub instanceof KeyPair) + return pub; + return new KeyPair(eddsa, { pub: pub }); +}; + +KeyPair.fromSecret = function fromSecret(eddsa, secret) { + if (secret instanceof KeyPair) + return secret; + return new KeyPair(eddsa, { secret: secret }); +}; + +KeyPair.prototype.secret = function secret() { + return this._secret; +}; + +cachedProperty(KeyPair, 'pubBytes', function pubBytes() { + return this.eddsa.encodePoint(this.pub()); +}); + +cachedProperty(KeyPair, 'pub', function pub() { + if (this._pubBytes) + return this.eddsa.decodePoint(this._pubBytes); + return this.eddsa.g.mul(this.priv()); +}); + +cachedProperty(KeyPair, 'privBytes', function privBytes() { + var eddsa = this.eddsa; + var hash = this.hash(); + var lastIx = eddsa.encodingLength - 1; + + var a = hash.slice(0, eddsa.encodingLength); + a[0] &= 248; + a[lastIx] &= 127; + a[lastIx] |= 64; + + return a; +}); + +cachedProperty(KeyPair, 'priv', function priv() { + return this.eddsa.decodeInt(this.privBytes()); +}); + +cachedProperty(KeyPair, 'hash', function hash() { + return this.eddsa.hash().update(this.secret()).digest(); +}); + +cachedProperty(KeyPair, 'messagePrefix', function messagePrefix() { + return this.hash().slice(this.eddsa.encodingLength); +}); + +KeyPair.prototype.sign = function sign(message) { + assert(this._secret, 'KeyPair can only verify'); + return this.eddsa.sign(message, this); +}; + +KeyPair.prototype.verify = function verify(message, sig) { + return this.eddsa.verify(message, sig, this); +}; + +KeyPair.prototype.getSecret = function getSecret(enc) { + assert(this._secret, 'KeyPair is public only'); + return utils.encode(this.secret(), enc); +}; + +KeyPair.prototype.getPublic = function getPublic(enc) { + return utils.encode(this.pubBytes(), enc); +}; + +module.exports = KeyPair; diff --git a/node_modules/elliptic/lib/elliptic/eddsa/signature.js b/node_modules/elliptic/lib/elliptic/eddsa/signature.js new file mode 100644 index 0000000..17b96d7 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/eddsa/signature.js @@ -0,0 +1,65 @@ +'use strict'; + +var BN = require('bn.js'); +var utils = require('../utils'); +var assert = utils.assert; +var cachedProperty = utils.cachedProperty; +var parseBytes = utils.parseBytes; + +/** +* @param {EDDSA} eddsa - eddsa instance +* @param {Array|Object} sig - +* @param {Array|Point} [sig.R] - R point as Point or bytes +* @param {Array|bn} [sig.S] - S scalar as bn or bytes +* @param {Array} [sig.Rencoded] - R point encoded +* @param {Array} [sig.Sencoded] - S scalar encoded +*/ +function Signature(eddsa, sig) { + this.eddsa = eddsa; + + if (typeof sig !== 'object') + sig = parseBytes(sig); + + if (Array.isArray(sig)) { + sig = { + R: sig.slice(0, eddsa.encodingLength), + S: sig.slice(eddsa.encodingLength) + }; + } + + assert(sig.R && sig.S, 'Signature without R or S'); + + if (eddsa.isPoint(sig.R)) + this._R = sig.R; + if (sig.S instanceof BN) + this._S = sig.S; + + this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded; + this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded; +} + +cachedProperty(Signature, 'S', function S() { + return this.eddsa.decodeInt(this.Sencoded()); +}); + +cachedProperty(Signature, 'R', function R() { + return this.eddsa.decodePoint(this.Rencoded()); +}); + +cachedProperty(Signature, 'Rencoded', function Rencoded() { + return this.eddsa.encodePoint(this.R()); +}); + +cachedProperty(Signature, 'Sencoded', function Sencoded() { + return this.eddsa.encodeInt(this.S()); +}); + +Signature.prototype.toBytes = function toBytes() { + return this.Rencoded().concat(this.Sencoded()); +}; + +Signature.prototype.toHex = function toHex() { + return utils.encode(this.toBytes(), 'hex').toUpperCase(); +}; + +module.exports = Signature; diff --git a/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js b/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js new file mode 100644 index 0000000..e4c91e5 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js @@ -0,0 +1,780 @@ +module.exports = { + doubles: { + step: 4, + points: [ + [ + 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a', + 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821' + ], + [ + '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508', + '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf' + ], + [ + '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739', + 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695' + ], + [ + '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640', + '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9' + ], + [ + '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c', + '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36' + ], + [ + '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda', + '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f' + ], + [ + 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa', + '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999' + ], + [ + '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0', + 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09' + ], + [ + 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d', + '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d' + ], + [ + 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d', + 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088' + ], + [ + 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1', + '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d' + ], + [ + '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0', + '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8' + ], + [ + '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047', + '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a' + ], + [ + '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862', + '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453' + ], + [ + '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7', + '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160' + ], + [ + '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd', + '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0' + ], + [ + '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83', + '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6' + ], + [ + '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a', + '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589' + ], + [ + '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8', + 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17' + ], + [ + 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d', + '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda' + ], + [ + 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725', + '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd' + ], + [ + '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754', + '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2' + ], + [ + '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c', + '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6' + ], + [ + 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6', + '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f' + ], + [ + '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39', + 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01' + ], + [ + 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891', + '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3' + ], + [ + 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b', + 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f' + ], + [ + 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03', + '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7' + ], + [ + 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d', + 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78' + ], + [ + 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070', + '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1' + ], + [ + '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4', + 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150' + ], + [ + '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da', + '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82' + ], + [ + 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11', + '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc' + ], + [ + '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e', + 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b' + ], + [ + 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41', + '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51' + ], + [ + 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef', + '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45' + ], + [ + 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8', + 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120' + ], + [ + '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d', + '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84' + ], + [ + '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96', + '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d' + ], + [ + '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd', + 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d' + ], + [ + '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5', + '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8' + ], + [ + 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266', + '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8' + ], + [ + '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71', + '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac' + ], + [ + '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac', + 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f' + ], + [ + '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751', + '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962' + ], + [ + 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e', + '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907' + ], + [ + '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241', + 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec' + ], + [ + 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3', + 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d' + ], + [ + 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f', + '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414' + ], + [ + '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19', + 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd' + ], + [ + '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be', + 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0' + ], + [ + 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9', + '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811' + ], + [ + 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2', + '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1' + ], + [ + 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13', + '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c' + ], + [ + '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c', + 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73' + ], + [ + '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba', + '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd' + ], + [ + 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151', + 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405' + ], + [ + '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073', + 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589' + ], + [ + '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458', + '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e' + ], + [ + '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b', + '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27' + ], + [ + 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366', + 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1' + ], + [ + '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa', + '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482' + ], + [ + '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0', + '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945' + ], + [ + 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787', + '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573' + ], + [ + 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e', + 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82' + ] + ] + }, + naf: { + wnd: 7, + points: [ + [ + 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9', + '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672' + ], + [ + '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4', + 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6' + ], + [ + '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc', + '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da' + ], + [ + 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe', + 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37' + ], + [ + '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb', + 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b' + ], + [ + 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8', + 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81' + ], + [ + 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e', + '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58' + ], + [ + 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34', + '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77' + ], + [ + '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c', + '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a' + ], + [ + '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5', + '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c' + ], + [ + '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f', + '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67' + ], + [ + '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714', + '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402' + ], + [ + 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729', + 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55' + ], + [ + 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db', + '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482' + ], + [ + '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4', + 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82' + ], + [ + '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5', + 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396' + ], + [ + '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479', + '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49' + ], + [ + '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d', + '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf' + ], + [ + '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f', + '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a' + ], + [ + '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb', + 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7' + ], + [ + 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9', + 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933' + ], + [ + '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963', + '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a' + ], + [ + '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74', + '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6' + ], + [ + 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530', + 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37' + ], + [ + '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b', + '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e' + ], + [ + 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247', + 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6' + ], + [ + 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1', + 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476' + ], + [ + '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120', + '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40' + ], + [ + '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435', + '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61' + ], + [ + '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18', + '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683' + ], + [ + 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8', + '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5' + ], + [ + '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb', + '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b' + ], + [ + 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f', + '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417' + ], + [ + '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143', + 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868' + ], + [ + '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba', + 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a' + ], + [ + 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45', + 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6' + ], + [ + '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a', + '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996' + ], + [ + '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e', + 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e' + ], + [ + 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8', + 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d' + ], + [ + '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c', + '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2' + ], + [ + '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519', + 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e' + ], + [ + '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab', + '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437' + ], + [ + '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca', + 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311' + ], + [ + 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf', + '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4' + ], + [ + '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610', + '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575' + ], + [ + '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4', + 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d' + ], + [ + '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c', + 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d' + ], + [ + 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940', + 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629' + ], + [ + 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980', + 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06' + ], + [ + '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3', + '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374' + ], + [ + '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf', + '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee' + ], + [ + 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63', + '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1' + ], + [ + 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448', + 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b' + ], + [ + '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf', + '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661' + ], + [ + '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5', + '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6' + ], + [ + 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6', + '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e' + ], + [ + '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5', + '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d' + ], + [ + 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99', + 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc' + ], + [ + '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51', + 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4' + ], + [ + '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5', + '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c' + ], + [ + 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5', + '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b' + ], + [ + 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997', + '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913' + ], + [ + '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881', + '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154' + ], + [ + '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5', + '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865' + ], + [ + '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66', + 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc' + ], + [ + '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726', + 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224' + ], + [ + '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede', + '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e' + ], + [ + '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94', + '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6' + ], + [ + '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31', + '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511' + ], + [ + '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51', + 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b' + ], + [ + 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252', + 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2' + ], + [ + '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5', + 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c' + ], + [ + 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b', + '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3' + ], + [ + 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4', + '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d' + ], + [ + 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f', + '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700' + ], + [ + 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889', + '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4' + ], + [ + '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246', + 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196' + ], + [ + '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984', + '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4' + ], + [ + '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a', + 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257' + ], + [ + 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030', + 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13' + ], + [ + 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197', + '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096' + ], + [ + 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593', + 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38' + ], + [ + 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef', + '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f' + ], + [ + '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38', + '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448' + ], + [ + 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a', + '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a' + ], + [ + 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111', + '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4' + ], + [ + '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502', + '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437' + ], + [ + '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea', + 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7' + ], + [ + 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26', + '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d' + ], + [ + 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986', + '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a' + ], + [ + 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e', + '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54' + ], + [ + '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4', + '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77' + ], + [ + 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda', + 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517' + ], + [ + '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859', + 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10' + ], + [ + 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f', + 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125' + ], + [ + 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c', + '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e' + ], + [ + '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942', + 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1' + ], + [ + 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a', + '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2' + ], + [ + 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80', + '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423' + ], + [ + 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d', + '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8' + ], + [ + '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1', + 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758' + ], + [ + '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63', + 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375' + ], + [ + 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352', + '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d' + ], + [ + '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193', + 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec' + ], + [ + '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00', + '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0' + ], + [ + '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58', + 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c' + ], + [ + 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7', + 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4' + ], + [ + '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8', + 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f' + ], + [ + '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e', + '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649' + ], + [ + '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d', + 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826' + ], + [ + '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b', + '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5' + ], + [ + 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f', + 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87' + ], + [ + '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6', + '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b' + ], + [ + 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297', + '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc' + ], + [ + '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a', + '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c' + ], + [ + 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c', + 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f' + ], + [ + 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52', + '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a' + ], + [ + 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb', + 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46' + ], + [ + '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065', + 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f' + ], + [ + '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917', + '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03' + ], + [ + '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9', + 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08' + ], + [ + '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3', + '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8' + ], + [ + '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57', + '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373' + ], + [ + '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66', + 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3' + ], + [ + '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8', + '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8' + ], + [ + '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721', + '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1' + ], + [ + '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180', + '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9' + ] + ] + } +}; diff --git a/node_modules/elliptic/lib/elliptic/utils.js b/node_modules/elliptic/lib/elliptic/utils.js new file mode 100644 index 0000000..f6d5616 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/utils.js @@ -0,0 +1,119 @@ +'use strict'; + +var utils = exports; +var BN = require('bn.js'); +var minAssert = require('minimalistic-assert'); +var minUtils = require('minimalistic-crypto-utils'); + +utils.assert = minAssert; +utils.toArray = minUtils.toArray; +utils.zero2 = minUtils.zero2; +utils.toHex = minUtils.toHex; +utils.encode = minUtils.encode; + +// Represent num in a w-NAF form +function getNAF(num, w, bits) { + var naf = new Array(Math.max(num.bitLength(), bits) + 1); + naf.fill(0); + + var ws = 1 << (w + 1); + var k = num.clone(); + + for (var i = 0; i < naf.length; i++) { + var z; + var mod = k.andln(ws - 1); + if (k.isOdd()) { + if (mod > (ws >> 1) - 1) + z = (ws >> 1) - mod; + else + z = mod; + k.isubn(z); + } else { + z = 0; + } + + naf[i] = z; + k.iushrn(1); + } + + return naf; +} +utils.getNAF = getNAF; + +// Represent k1, k2 in a Joint Sparse Form +function getJSF(k1, k2) { + var jsf = [ + [], + [] + ]; + + k1 = k1.clone(); + k2 = k2.clone(); + var d1 = 0; + var d2 = 0; + while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) { + + // First phase + var m14 = (k1.andln(3) + d1) & 3; + var m24 = (k2.andln(3) + d2) & 3; + if (m14 === 3) + m14 = -1; + if (m24 === 3) + m24 = -1; + var u1; + if ((m14 & 1) === 0) { + u1 = 0; + } else { + var m8 = (k1.andln(7) + d1) & 7; + if ((m8 === 3 || m8 === 5) && m24 === 2) + u1 = -m14; + else + u1 = m14; + } + jsf[0].push(u1); + + var u2; + if ((m24 & 1) === 0) { + u2 = 0; + } else { + var m8 = (k2.andln(7) + d2) & 7; + if ((m8 === 3 || m8 === 5) && m14 === 2) + u2 = -m24; + else + u2 = m24; + } + jsf[1].push(u2); + + // Second phase + if (2 * d1 === u1 + 1) + d1 = 1 - d1; + if (2 * d2 === u2 + 1) + d2 = 1 - d2; + k1.iushrn(1); + k2.iushrn(1); + } + + return jsf; +} +utils.getJSF = getJSF; + +function cachedProperty(obj, name, computer) { + var key = '_' + name; + obj.prototype[name] = function cachedProperty() { + return this[key] !== undefined ? this[key] : + this[key] = computer.call(this); + }; +} +utils.cachedProperty = cachedProperty; + +function parseBytes(bytes) { + return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') : + bytes; +} +utils.parseBytes = parseBytes; + +function intFromLE(bytes) { + return new BN(bytes, 'hex', 'le'); +} +utils.intFromLE = intFromLE; + diff --git a/node_modules/elliptic/package.json b/node_modules/elliptic/package.json new file mode 100644 index 0000000..0fb9c7e --- /dev/null +++ b/node_modules/elliptic/package.json @@ -0,0 +1,87 @@ +{ + "_from": "elliptic@^6.0.0", + "_id": "elliptic@6.5.2", + "_inBundle": false, + "_integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", + "_location": "/elliptic", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "elliptic@^6.0.0", + "name": "elliptic", + "escapedName": "elliptic", + "rawSpec": "^6.0.0", + "saveSpec": null, + "fetchSpec": "^6.0.0" + }, + "_requiredBy": [ + "/browserify-sign", + "/create-ecdh" + ], + "_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", + "_shasum": "05c5678d7173c049d8ca433552224a495d0e3762", + "_spec": "elliptic@^6.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/browserify-sign", + "author": { + "name": "Fedor Indutny", + "email": "fedor@indutny.com" + }, + "bugs": { + "url": "https://github.com/indutny/elliptic/issues" + }, + "bundleDependencies": false, + "dependencies": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + }, + "deprecated": false, + "description": "EC cryptography", + "devDependencies": { + "brfs": "^1.4.3", + "coveralls": "^3.0.8", + "grunt": "^1.0.4", + "grunt-browserify": "^5.0.0", + "grunt-cli": "^1.2.0", + "grunt-contrib-connect": "^1.0.0", + "grunt-contrib-copy": "^1.0.0", + "grunt-contrib-uglify": "^1.0.1", + "grunt-mocha-istanbul": "^3.0.1", + "grunt-saucelabs": "^9.0.1", + "istanbul": "^0.4.2", + "jscs": "^3.0.7", + "jshint": "^2.10.3", + "mocha": "^6.2.2" + }, + "files": [ + "lib" + ], + "homepage": "https://github.com/indutny/elliptic", + "keywords": [ + "EC", + "Elliptic", + "curve", + "Cryptography" + ], + "license": "MIT", + "main": "lib/elliptic.js", + "name": "elliptic", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/indutny/elliptic.git" + }, + "scripts": { + "jscs": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", + "jshint": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", + "lint": "npm run jscs && npm run jshint", + "test": "npm run lint && npm run unit", + "unit": "istanbul test _mocha --reporter=spec test/index.js", + "version": "grunt dist && git add dist/" + }, + "version": "6.5.2" +} diff --git a/node_modules/emoji-regex/LICENSE-MIT.txt b/node_modules/emoji-regex/LICENSE-MIT.txt new file mode 100644 index 0000000..a41e0a7 --- /dev/null +++ b/node_modules/emoji-regex/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +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. diff --git a/node_modules/emoji-regex/README.md b/node_modules/emoji-regex/README.md new file mode 100644 index 0000000..37cf14e --- /dev/null +++ b/node_modules/emoji-regex/README.md @@ -0,0 +1,73 @@ +# emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex) + +_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard. + +This repository contains a script that generates this regular expression based on [the data from Unicode Technical Report #51](https://github.com/mathiasbynens/unicode-tr51). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install emoji-regex +``` + +In [Node.js](https://nodejs.org/): + +```js +const emojiRegex = require('emoji-regex'); +// Note: because the regular expression has the global flag set, this module +// exports a function that returns the regex rather than exporting the regular +// expression itself, to make it impossible to (accidentally) mutate the +// original regular expression. + +const text = ` +\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation) +\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji +\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base) +\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier +`; + +const regex = emojiRegex(); +let match; +while (match = regex.exec(text)) { + const emoji = match[0]; + console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`); +} +``` + +Console output: + +``` +Matched sequence ⌚ — code points: 1 +Matched sequence ⌚ — code points: 1 +Matched sequence ↔️ — code points: 2 +Matched sequence ↔️ — code points: 2 +Matched sequence 👩 — code points: 1 +Matched sequence 👩 — code points: 1 +Matched sequence 👩🏿 — code points: 2 +Matched sequence 👩🏿 — code points: 2 +``` + +To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex: + +```js +const emojiRegex = require('emoji-regex/text.js'); +``` + +Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes: + +```js +const emojiRegex = require('emoji-regex/es2015/index.js'); +const emojiRegexText = require('emoji-regex/es2015/text.js'); +``` + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +_emoji-regex_ is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/emoji-regex/es2015/index.js b/node_modules/emoji-regex/es2015/index.js new file mode 100644 index 0000000..0216db9 --- /dev/null +++ b/node_modules/emoji-regex/es2015/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}(?:\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0077}\u{E006C}\u{E0073}|\u{E0073}\u{E0063}\u{E0074})\u{E007F}|\u200D\u2620\uFE0F)|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F468}(?:\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u{1F468}(?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F469}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|\u{1F468}(?:\u200D(?:[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u{1F466}\u{1F467}])|[\u{1F3FB}-\u{1F3FF}])|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F469}\u200D\u{1F467}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}]|\u{1F469}\u200D\u{1F466}|\u{1F1F6}\u{1F1E6}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|[#\*0-9]\uFE0F\u20E3|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9D1}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]\uFE0F|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F469}\u{1F46E}\u{1F470}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/node_modules/emoji-regex/es2015/text.js b/node_modules/emoji-regex/es2015/text.js new file mode 100644 index 0000000..d0a771d --- /dev/null +++ b/node_modules/emoji-regex/es2015/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}(?:\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0077}\u{E006C}\u{E0073}|\u{E0073}\u{E0063}\u{E0074})\u{E007F}|\u200D\u2620\uFE0F)|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F468}(?:\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u{1F468}(?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F469}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|\u{1F468}(?:\u200D(?:[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u{1F466}\u{1F467}])|[\u{1F3FB}-\u{1F3FF}])|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F469}\u200D\u{1F467}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}]|\u{1F469}\u200D\u{1F466}|\u{1F1F6}\u{1F1E6}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|[#\*0-9]\uFE0F\u20E3|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9D1}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]\uFE0F?|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F469}\u{1F46E}\u{1F470}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/node_modules/emoji-regex/index.d.ts b/node_modules/emoji-regex/index.d.ts new file mode 100644 index 0000000..2c317cd --- /dev/null +++ b/node_modules/emoji-regex/index.d.ts @@ -0,0 +1,5 @@ +declare module 'emoji-regex' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} diff --git a/node_modules/emoji-regex/index.js b/node_modules/emoji-regex/index.js new file mode 100644 index 0000000..e2237a4 --- /dev/null +++ b/node_modules/emoji-regex/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4(?:\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74)\uDB40\uDC7F|\u200D\u2620\uFE0F)|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3]))|\uD83D\uDC69\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83D\uDC69\u200D[\u2695\u2696\u2708])\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC68(?:\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDD1-\uDDDD])/g; +}; diff --git a/node_modules/emoji-regex/package.json b/node_modules/emoji-regex/package.json new file mode 100644 index 0000000..db91c20 --- /dev/null +++ b/node_modules/emoji-regex/package.json @@ -0,0 +1,78 @@ +{ + "_from": "emoji-regex@^7.0.1", + "_id": "emoji-regex@7.0.3", + "_inBundle": false, + "_integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "_location": "/emoji-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "emoji-regex@^7.0.1", + "name": "emoji-regex", + "escapedName": "emoji-regex", + "rawSpec": "^7.0.1", + "saveSpec": null, + "fetchSpec": "^7.0.1" + }, + "_requiredBy": [ + "/string-width" + ], + "_resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "_shasum": "933a04052860c85e83c122479c4748a8e4c72156", + "_spec": "emoji-regex@^7.0.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/string-width", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "bugs": { + "url": "https://github.com/mathiasbynens/emoji-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", + "devDependencies": { + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "mocha": "^5.2.0", + "regexgen": "^1.3.0", + "unicode-11.0.0": "^0.7.7", + "unicode-tr51": "^9.0.1" + }, + "files": [ + "LICENSE-MIT.txt", + "index.js", + "index.d.ts", + "text.js", + "es2015/index.js", + "es2015/text.js" + ], + "homepage": "https://mths.be/emoji-regex", + "keywords": [ + "unicode", + "regex", + "regexp", + "regular expressions", + "code points", + "symbols", + "characters", + "emoji" + ], + "license": "MIT", + "main": "index.js", + "name": "emoji-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/mathiasbynens/emoji-regex.git" + }, + "scripts": { + "build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js", + "test": "mocha", + "test:watch": "npm run test -- --watch" + }, + "types": "index.d.ts", + "version": "7.0.3" +} diff --git a/node_modules/emoji-regex/text.js b/node_modules/emoji-regex/text.js new file mode 100644 index 0000000..199ae3b --- /dev/null +++ b/node_modules/emoji-regex/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4(?:\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74)\uDB40\uDC7F|\u200D\u2620\uFE0F)|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3]))|\uD83D\uDC69\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83D\uDC69\u200D[\u2695\u2696\u2708])\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC68(?:\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])\uFE0F?|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDD1-\uDDDD])/g; +}; diff --git a/node_modules/emojis-list/CHANGELOG.md b/node_modules/emojis-list/CHANGELOG.md new file mode 100644 index 0000000..acaede6 --- /dev/null +++ b/node_modules/emojis-list/CHANGELOG.md @@ -0,0 +1,85 @@ + +# 3.0.0 (2019-05-12) + +* build: bye bower ([4acc7c0](https://github.com/kikobeats/emojis-list/commit/4acc7c0)) +* build: remove gulp and bower ([12c83f3](https://github.com/kikobeats/emojis-list/commit/12c83f3)) +* build: update meta ([de14b12](https://github.com/kikobeats/emojis-list/commit/de14b12)) +* moar emojis ([b4a153f](https://github.com/kikobeats/emojis-list/commit/b4a153f)) +* chore: drop support for Node.js 0.10 ([20ed4f1](https://github.com/kikobeats/emojis-list/commit/20ed4f1)) + + +### BREAKING CHANGE + +* This module no longer supports Node.js 0.10 + + + +# 2.1.0 (2016-10-03) + +* Fetch new emoji ([7dbe84d](https://github.com/kikobeats/emojis-list/commit/7dbe84d)) + + + + +## 2.0.1 (2016-05-12) + +* Fix typo ([3808909](https://github.com/kikobeats/emojis-list/commit/3808909)) + + + + +# 2.0.0 (2016-05-12) + +* Add update script ([f846dd6](https://github.com/kikobeats/emojis-list/commit/f846dd6)) +* Block dependencies in last version ([1d9e0a5](https://github.com/kikobeats/emojis-list/commit/1d9e0a5)) +* Extract main file name ([9ffe7bb](https://github.com/kikobeats/emojis-list/commit/9ffe7bb)) +* Remove unnecessary files ([4c34729](https://github.com/kikobeats/emojis-list/commit/4c34729)) +* Update docs, special webpack setup is not necessary ([c4aefe9](https://github.com/kikobeats/emojis-list/commit/c4aefe9)) +* Update example ([1e2ae03](https://github.com/kikobeats/emojis-list/commit/1e2ae03)) +* Update how to generate emojis array ([b56bad9](https://github.com/kikobeats/emojis-list/commit/b56bad9)) +* Update main file based in the new interface ([996fccb](https://github.com/kikobeats/emojis-list/commit/996fccb)) + + + + +## 1.0.3 (2016-05-12) + +* Add standard as linter ([5e939d6](https://github.com/kikobeats/emojis-list/commit/5e939d6)) +* Change interface ([16bc0c0](https://github.com/kikobeats/emojis-list/commit/16bc0c0)) +* Generate emoji file ([fbcf8e9](https://github.com/kikobeats/emojis-list/commit/fbcf8e9)) +* Remove unnecessary special doc ([2b12bec](https://github.com/kikobeats/emojis-list/commit/2b12bec)) +* chore(package): update browserify to version 13.0.1 ([e2c98bf](https://github.com/kikobeats/emojis-list/commit/e2c98bf)) +* chore(package): update gulp-header to version 1.8.1 ([28de793](https://github.com/kikobeats/emojis-list/commit/28de793)) + + + + +## 1.0.2 (2016-05-05) + +* fixed #2 ([9a6abe7](https://github.com/kikobeats/emojis-list/commit/9a6abe7)), closes [#2](https://github.com/kikobeats/emojis-list/issues/2) +* Fomar using standard ([5202f9f](https://github.com/kikobeats/emojis-list/commit/5202f9f)) +* Update badge ([53fad9b](https://github.com/kikobeats/emojis-list/commit/53fad9b)) + + + + +## 1.0.1 (2016-04-13) + +* lock versions ([4a5d82e](https://github.com/kikobeats/emojis-list/commit/4a5d82e)) +* setup devDependencies ([d1de0fc](https://github.com/kikobeats/emojis-list/commit/d1de0fc)) +* update bumped ([9941038](https://github.com/kikobeats/emojis-list/commit/9941038)) +* Update package.json ([6c14b74](https://github.com/kikobeats/emojis-list/commit/6c14b74)) +* Update README.md ([1d9beeb](https://github.com/kikobeats/emojis-list/commit/1d9beeb)) +* Update README.md ([73f215e](https://github.com/kikobeats/emojis-list/commit/73f215e)) +* Update tests ([a94f7dc](https://github.com/kikobeats/emojis-list/commit/a94f7dc)) + + + + +# 1.0.0 (2015-05-12) + +* first commit ([a65b79d](https://github.com/kikobeats/emojis-list/commit/a65b79d)) +* updated ([9f0564c](https://github.com/kikobeats/emojis-list/commit/9f0564c)) + + + diff --git a/node_modules/emojis-list/LICENSE.md b/node_modules/emojis-list/LICENSE.md new file mode 100755 index 0000000..c0928ae --- /dev/null +++ b/node_modules/emojis-list/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright © 2015 Kiko Beats + +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. diff --git a/node_modules/emojis-list/README.md b/node_modules/emojis-list/README.md new file mode 100755 index 0000000..a103fbb --- /dev/null +++ b/node_modules/emojis-list/README.md @@ -0,0 +1,36 @@ +# emojis-list + +[![Dependency status](http://img.shields.io/david/Kikobeats/emojis-list.svg?style=flat-square)](https://david-dm.org/Kikobeats/emojis-list) +[![Dev Dependencies Status](http://img.shields.io/david/dev/Kikobeats/emojis-list.svg?style=flat-square)](https://david-dm.org/Kikobeats/emojis-list#info=devDependencies) +[![NPM Status](http://img.shields.io/npm/dm/emojis-list.svg?style=flat-square)](https://www.npmjs.org/package/emojis-list) +[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square)](https://paypal.me/kikobeats) + +> Complete list of standard Unicode Hex Character Code that represent emojis. + +**NOTE**: The lists is related with the Unicode Hex Character Code. The representation of the emoji depend of the system. Will be possible that the system don't have all the representations. + +## Install + +```bash +npm install emojis-list --save +``` + +## Usage + +```js +const emojis = require('emojis-list') +console.log(emojis[0]) +// => 🀄 +``` + +## Related + +* [emojis-unicode](https://github.com/Kikobeats/emojis-unicode) – Complete list of standard Unicode codes that represent emojis. +* [emojis-keywords](https://github.com/Kikobeats/emojis-keywords) – Complete list of am emoji shortcuts. +* [is-emoji-keyword](https://github.com/Kikobeats/is-emoji-keyword) – Check if a word is a emoji shortcut. +* [is-standard-emoji](https://github.com/kikobeats/is-standard-emoji) – Simply way to check if a emoji is a standard emoji. +* [trim-emoji](https://github.com/Kikobeats/trim-emoji) – Deletes ':' from the begin and the end of an emoji shortcut. + +## License + +MIT © [Kiko Beats](http://www.kikobeats.com) diff --git a/node_modules/emojis-list/index.js b/node_modules/emojis-list/index.js new file mode 100644 index 0000000..2c2f75a --- /dev/null +++ b/node_modules/emojis-list/index.js @@ -0,0 +1,3077 @@ +module.exports = [ + "🀄️", + "🃏", + "🅰️", + "🅱️", + "🅾️", + "🅿️", + "🆎", + "🆑", + "🆒", + "🆓", + "🆔", + "🆕", + "🆖", + "🆗", + "🆘", + "🆙", + "🆚", + "🇦🇨", + "🇦🇩", + "🇦🇪", + "🇦🇫", + "🇦🇬", + "🇦🇮", + "🇦🇱", + "🇦🇲", + "🇦🇴", + "🇦🇶", + "🇦🇷", + "🇦🇸", + "🇦🇹", + "🇦🇺", + "🇦🇼", + "🇦🇽", + "🇦🇿", + "🇦", + "🇧🇦", + "🇧🇧", + "🇧🇩", + "🇧🇪", + "🇧🇫", + "🇧🇬", + "🇧🇭", + "🇧🇮", + "🇧🇯", + "🇧🇱", + "🇧🇲", + "🇧🇳", + "🇧🇴", + "🇧🇶", + "🇧🇷", + "🇧🇸", + "🇧🇹", + "🇧🇻", + "🇧🇼", + "🇧🇾", + "🇧🇿", + "🇧", + "🇨🇦", + "🇨🇨", + "🇨🇩", + "🇨🇫", + "🇨🇬", + "🇨🇭", + "🇨🇮", + "🇨🇰", + "🇨🇱", + "🇨🇲", + "🇨🇳", + "🇨🇴", + "🇨🇵", + "🇨🇷", + "🇨🇺", + "🇨🇻", + "🇨🇼", + "🇨🇽", + "🇨🇾", + "🇨🇿", + "🇨", + "🇩🇪", + "🇩🇬", + "🇩🇯", + "🇩🇰", + "🇩🇲", + "🇩🇴", + "🇩🇿", + "🇩", + "🇪🇦", + "🇪🇨", + "🇪🇪", + "🇪🇬", + "🇪🇭", + "🇪🇷", + "🇪🇸", + "🇪🇹", + "🇪🇺", + "🇪", + "🇫🇮", + "🇫🇯", + "🇫🇰", + "🇫🇲", + "🇫🇴", + "🇫🇷", + "🇫", + "🇬🇦", + "🇬🇧", + "🇬🇩", + "🇬🇪", + "🇬🇫", + "🇬🇬", + "🇬🇭", + "🇬🇮", + "🇬🇱", + "🇬🇲", + "🇬🇳", + "🇬🇵", + "🇬🇶", + "🇬🇷", + "🇬🇸", + "🇬🇹", + "🇬🇺", + "🇬🇼", + "🇬🇾", + "🇬", + "🇭🇰", + "🇭🇲", + "🇭🇳", + "🇭🇷", + "🇭🇹", + "🇭🇺", + "🇭", + "🇮🇨", + "🇮🇩", + "🇮🇪", + "🇮🇱", + "🇮🇲", + "🇮🇳", + "🇮🇴", + "🇮🇶", + "🇮🇷", + "🇮🇸", + "🇮🇹", + "🇮", + "🇯🇪", + "🇯🇲", + "🇯🇴", + "🇯🇵", + "🇯", + "🇰🇪", + "🇰🇬", + "🇰🇭", + "🇰🇮", + "🇰🇲", + "🇰🇳", + "🇰🇵", + "🇰🇷", + "🇰🇼", + "🇰🇾", + "🇰🇿", + "🇰", + "🇱🇦", + "🇱🇧", + "🇱🇨", + "🇱🇮", + "🇱🇰", + "🇱🇷", + "🇱🇸", + "🇱🇹", + "🇱🇺", + "🇱🇻", + "🇱🇾", + "🇱", + "🇲🇦", + "🇲🇨", + "🇲🇩", + "🇲🇪", + "🇲🇫", + "🇲🇬", + "🇲🇭", + "🇲🇰", + "🇲🇱", + "🇲🇲", + "🇲🇳", + "🇲🇴", + "🇲🇵", + "🇲🇶", + "🇲🇷", + "🇲🇸", + "🇲🇹", + "🇲🇺", + "🇲🇻", + "🇲🇼", + "🇲🇽", + "🇲🇾", + "🇲🇿", + "🇲", + "🇳🇦", + "🇳🇨", + "🇳🇪", + "🇳🇫", + "🇳🇬", + "🇳🇮", + "🇳🇱", + "🇳🇴", + "🇳🇵", + "🇳🇷", + "🇳🇺", + "🇳🇿", + "🇳", + "🇴🇲", + "🇴", + "🇵🇦", + "🇵🇪", + "🇵🇫", + "🇵🇬", + "🇵🇭", + "🇵🇰", + "🇵🇱", + "🇵🇲", + "🇵🇳", + "🇵🇷", + "🇵🇸", + "🇵🇹", + "🇵🇼", + "🇵🇾", + "🇵", + "🇶🇦", + "🇶", + "🇷🇪", + "🇷🇴", + "🇷🇸", + "🇷🇺", + "🇷🇼", + "🇷", + "🇸🇦", + "🇸🇧", + "🇸🇨", + "🇸🇩", + "🇸🇪", + "🇸🇬", + "🇸🇭", + "🇸🇮", + "🇸🇯", + "🇸🇰", + "🇸🇱", + "🇸🇲", + "🇸🇳", + "🇸🇴", + "🇸🇷", + "🇸🇸", + "🇸🇹", + "🇸🇻", + "🇸🇽", + "🇸🇾", + "🇸🇿", + "🇸", + "🇹🇦", + "🇹🇨", + "🇹🇩", + "🇹🇫", + "🇹🇬", + "🇹🇭", + "🇹🇯", + "🇹🇰", + "🇹🇱", + "🇹🇲", + "🇹🇳", + "🇹🇴", + "🇹🇷", + "🇹🇹", + "🇹🇻", + "🇹🇼", + "🇹🇿", + "🇹", + "🇺🇦", + "🇺🇬", + "🇺🇲", + "🇺🇳", + "🇺🇸", + "🇺🇾", + "🇺🇿", + "🇺", + "🇻🇦", + "🇻🇨", + "🇻🇪", + "🇻🇬", + "🇻🇮", + "🇻🇳", + "🇻🇺", + "🇻", + "🇼🇫", + "🇼🇸", + "🇼", + "🇽🇰", + "🇽", + "🇾🇪", + "🇾🇹", + "🇾", + "🇿🇦", + "🇿🇲", + "🇿🇼", + "🇿", + "🈁", + "🈂️", + "🈚️", + "🈯️", + "🈲", + "🈳", + "🈴", + "🈵", + "🈶", + "🈷️", + "🈸", + "🈹", + "🈺", + "🉐", + "🉑", + "🌀", + "🌁", + "🌂", + "🌃", + "🌄", + "🌅", + "🌆", + "🌇", + "🌈", + "🌉", + "🌊", + "🌋", + "🌌", + "🌍", + "🌎", + "🌏", + "🌐", + "🌑", + "🌒", + "🌓", + "🌔", + "🌕", + "🌖", + "🌗", + "🌘", + "🌙", + "🌚", + "🌛", + "🌜", + "🌝", + "🌞", + "🌟", + "🌠", + "🌡️", + "🌤️", + "🌥️", + "🌦️", + "🌧️", + "🌨️", + "🌩️", + "🌪️", + "🌫️", + "🌬️", + "🌭", + "🌮", + "🌯", + "🌰", + "🌱", + "🌲", + "🌳", + "🌴", + "🌵", + "🌶️", + "🌷", + "🌸", + "🌹", + "🌺", + "🌻", + "🌼", + "🌽", + "🌾", + "🌿", + "🍀", + "🍁", + "🍂", + "🍃", + "🍄", + "🍅", + "🍆", + "🍇", + "🍈", + "🍉", + "🍊", + "🍋", + "🍌", + "🍍", + "🍎", + "🍏", + "🍐", + "🍑", + "🍒", + "🍓", + "🍔", + "🍕", + "🍖", + "🍗", + "🍘", + "🍙", + "🍚", + "🍛", + "🍜", + "🍝", + "🍞", + "🍟", + "🍠", + "🍡", + "🍢", + "🍣", + "🍤", + "🍥", + "🍦", + "🍧", + "🍨", + "🍩", + "🍪", + "🍫", + "🍬", + "🍭", + "🍮", + "🍯", + "🍰", + "🍱", + "🍲", + "🍳", + "🍴", + "🍵", + "🍶", + "🍷", + "🍸", + "🍹", + "🍺", + "🍻", + "🍼", + "🍽️", + "🍾", + "🍿", + "🎀", + "🎁", + "🎂", + "🎃", + "🎄", + "🎅🏻", + "🎅🏼", + "🎅🏽", + "🎅🏾", + "🎅🏿", + "🎅", + "🎆", + "🎇", + "🎈", + "🎉", + "🎊", + "🎋", + "🎌", + "🎍", + "🎎", + "🎏", + "🎐", + "🎑", + "🎒", + "🎓", + "🎖️", + "🎗️", + "🎙️", + "🎚️", + "🎛️", + "🎞️", + "🎟️", + "🎠", + "🎡", + "🎢", + "🎣", + "🎤", + "🎥", + "🎦", + "🎧", + "🎨", + "🎩", + "🎪", + "🎫", + "🎬", + "🎭", + "🎮", + "🎯", + "🎰", + "🎱", + "🎲", + "🎳", + "🎴", + "🎵", + "🎶", + "🎷", + "🎸", + "🎹", + "🎺", + "🎻", + "🎼", + "🎽", + "🎾", + "🎿", + "🏀", + "🏁", + "🏂🏻", + "🏂🏼", + "🏂🏽", + "🏂🏾", + "🏂🏿", + "🏂", + "🏃🏻‍♀️", + "🏃🏻‍♂️", + "🏃🏻", + "🏃🏼‍♀️", + "🏃🏼‍♂️", + "🏃🏼", + "🏃🏽‍♀️", + "🏃🏽‍♂️", + "🏃🏽", + "🏃🏾‍♀️", + "🏃🏾‍♂️", + "🏃🏾", + "🏃🏿‍♀️", + "🏃🏿‍♂️", + "🏃🏿", + "🏃‍♀️", + "🏃‍♂️", + "🏃", + "🏄🏻‍♀️", + "🏄🏻‍♂️", + "🏄🏻", + "🏄🏼‍♀️", + "🏄🏼‍♂️", + "🏄🏼", + "🏄🏽‍♀️", + "🏄🏽‍♂️", + "🏄🏽", + "🏄🏾‍♀️", + "🏄🏾‍♂️", + "🏄🏾", + "🏄🏿‍♀️", + "🏄🏿‍♂️", + "🏄🏿", + "🏄‍♀️", + "🏄‍♂️", + "🏄", + "🏅", + "🏆", + "🏇🏻", + "🏇🏼", + "🏇🏽", + "🏇🏾", + "🏇🏿", + "🏇", + "🏈", + "🏉", + "🏊🏻‍♀️", + "🏊🏻‍♂️", + "🏊🏻", + "🏊🏼‍♀️", + "🏊🏼‍♂️", + "🏊🏼", + "🏊🏽‍♀️", + "🏊🏽‍♂️", + "🏊🏽", + "🏊🏾‍♀️", + "🏊🏾‍♂️", + "🏊🏾", + "🏊🏿‍♀️", + "🏊🏿‍♂️", + "🏊🏿", + "🏊‍♀️", + "🏊‍♂️", + "🏊", + "🏋🏻‍♀️", + "🏋🏻‍♂️", + "🏋🏻", + "🏋🏼‍♀️", + "🏋🏼‍♂️", + "🏋🏼", + "🏋🏽‍♀️", + "🏋🏽‍♂️", + "🏋🏽", + "🏋🏾‍♀️", + "🏋🏾‍♂️", + "🏋🏾", + "🏋🏿‍♀️", + "🏋🏿‍♂️", + "🏋🏿", + "🏋️‍♀️", + "🏋️‍♂️", + "🏋️", + "🏌🏻‍♀️", + "🏌🏻‍♂️", + "🏌🏻", + "🏌🏼‍♀️", + "🏌🏼‍♂️", + "🏌🏼", + "🏌🏽‍♀️", + "🏌🏽‍♂️", + "🏌🏽", + "🏌🏾‍♀️", + "🏌🏾‍♂️", + "🏌🏾", + "🏌🏿‍♀️", + "🏌🏿‍♂️", + "🏌🏿", + "🏌️‍♀️", + "🏌️‍♂️", + "🏌️", + "🏍️", + "🏎️", + "🏏", + "🏐", + "🏑", + "🏒", + "🏓", + "🏔️", + "🏕️", + "🏖️", + "🏗️", + "🏘️", + "🏙️", + "🏚️", + "🏛️", + "🏜️", + "🏝️", + "🏞️", + "🏟️", + "🏠", + "🏡", + "🏢", + "🏣", + "🏤", + "🏥", + "🏦", + "🏧", + "🏨", + "🏩", + "🏪", + "🏫", + "🏬", + "🏭", + "🏮", + "🏯", + "🏰", + "🏳️‍🌈", + "🏳️", + "🏴‍☠️", + "🏴󠁧󠁢󠁥󠁮󠁧󠁿", + "🏴󠁧󠁢󠁳󠁣󠁴󠁿", + "🏴󠁧󠁢󠁷󠁬󠁳󠁿", + "🏴", + "🏵️", + "🏷️", + "🏸", + "🏹", + "🏺", + "🏻", + "🏼", + "🏽", + "🏾", + "🏿", + "🐀", + "🐁", + "🐂", + "🐃", + "🐄", + "🐅", + "🐆", + "🐇", + "🐈", + "🐉", + "🐊", + "🐋", + "🐌", + "🐍", + "🐎", + "🐏", + "🐐", + "🐑", + "🐒", + "🐓", + "🐔", + "🐕‍🦺", + "🐕", + "🐖", + "🐗", + "🐘", + "🐙", + "🐚", + "🐛", + "🐜", + "🐝", + "🐞", + "🐟", + "🐠", + "🐡", + "🐢", + "🐣", + "🐤", + "🐥", + "🐦", + "🐧", + "🐨", + "🐩", + "🐪", + "🐫", + "🐬", + "🐭", + "🐮", + "🐯", + "🐰", + "🐱", + "🐲", + "🐳", + "🐴", + "🐵", + "🐶", + "🐷", + "🐸", + "🐹", + "🐺", + "🐻", + "🐼", + "🐽", + "🐾", + "🐿️", + "👀", + "👁‍🗨", + "👁️", + "👂🏻", + "👂🏼", + "👂🏽", + "👂🏾", + "👂🏿", + "👂", + "👃🏻", + "👃🏼", + "👃🏽", + "👃🏾", + "👃🏿", + "👃", + "👄", + "👅", + "👆🏻", + "👆🏼", + "👆🏽", + "👆🏾", + "👆🏿", + "👆", + "👇🏻", + "👇🏼", + "👇🏽", + "👇🏾", + "👇🏿", + "👇", + "👈🏻", + "👈🏼", + "👈🏽", + "👈🏾", + "👈🏿", + "👈", + "👉🏻", + "👉🏼", + "👉🏽", + "👉🏾", + "👉🏿", + "👉", + "👊🏻", + "👊🏼", + "👊🏽", + "👊🏾", + "👊🏿", + "👊", + "👋🏻", + "👋🏼", + "👋🏽", + "👋🏾", + "👋🏿", + "👋", + "👌🏻", + "👌🏼", + "👌🏽", + "👌🏾", + "👌🏿", + "👌", + "👍🏻", + "👍🏼", + "👍🏽", + "👍🏾", + "👍🏿", + "👍", + "👎🏻", + "👎🏼", + "👎🏽", + "👎🏾", + "👎🏿", + "👎", + "👏🏻", + "👏🏼", + "👏🏽", + "👏🏾", + "👏🏿", + "👏", + "👐🏻", + "👐🏼", + "👐🏽", + "👐🏾", + "👐🏿", + "👐", + "👑", + "👒", + "👓", + "👔", + "👕", + "👖", + "👗", + "👘", + "👙", + "👚", + "👛", + "👜", + "👝", + "👞", + "👟", + "👠", + "👡", + "👢", + "👣", + "👤", + "👥", + "👦🏻", + "👦🏼", + "👦🏽", + "👦🏾", + "👦🏿", + "👦", + "👧🏻", + "👧🏼", + "👧🏽", + "👧🏾", + "👧🏿", + "👧", + "👨🏻‍🌾", + "👨🏻‍🍳", + "👨🏻‍🎓", + "👨🏻‍🎤", + "👨🏻‍🎨", + "👨🏻‍🏫", + "👨🏻‍🏭", + "👨🏻‍💻", + "👨🏻‍💼", + "👨🏻‍🔧", + "👨🏻‍🔬", + "👨🏻‍🚀", + "👨🏻‍🚒", + "👨🏻‍🦯", + "👨🏻‍🦰", + "👨🏻‍🦱", + "👨🏻‍🦲", + "👨🏻‍🦳", + "👨🏻‍🦼", + "👨🏻‍🦽", + "👨🏻‍⚕️", + "👨🏻‍⚖️", + "👨🏻‍✈️", + "👨🏻", + "👨🏼‍🌾", + "👨🏼‍🍳", + "👨🏼‍🎓", + "👨🏼‍🎤", + "👨🏼‍🎨", + "👨🏼‍🏫", + "👨🏼‍🏭", + "👨🏼‍💻", + "👨🏼‍💼", + "👨🏼‍🔧", + "👨🏼‍🔬", + "👨🏼‍🚀", + "👨🏼‍🚒", + "👨🏼‍🤝‍👨🏻", + "👨🏼‍🦯", + "👨🏼‍🦰", + "👨🏼‍🦱", + "👨🏼‍🦲", + "👨🏼‍🦳", + "👨🏼‍🦼", + "👨🏼‍🦽", + "👨🏼‍⚕️", + "👨🏼‍⚖️", + "👨🏼‍✈️", + "👨🏼", + "👨🏽‍🌾", + "👨🏽‍🍳", + "👨🏽‍🎓", + "👨🏽‍🎤", + "👨🏽‍🎨", + "👨🏽‍🏫", + "👨🏽‍🏭", + "👨🏽‍💻", + "👨🏽‍💼", + "👨🏽‍🔧", + "👨🏽‍🔬", + "👨🏽‍🚀", + "👨🏽‍🚒", + "👨🏽‍🤝‍👨🏻", + "👨🏽‍🤝‍👨🏼", + "👨🏽‍🦯", + "👨🏽‍🦰", + "👨🏽‍🦱", + "👨🏽‍🦲", + "👨🏽‍🦳", + "👨🏽‍🦼", + "👨🏽‍🦽", + "👨🏽‍⚕️", + "👨🏽‍⚖️", + "👨🏽‍✈️", + "👨🏽", + "👨🏾‍🌾", + "👨🏾‍🍳", + "👨🏾‍🎓", + "👨🏾‍🎤", + "👨🏾‍🎨", + "👨🏾‍🏫", + "👨🏾‍🏭", + "👨🏾‍💻", + "👨🏾‍💼", + "👨🏾‍🔧", + "👨🏾‍🔬", + "👨🏾‍🚀", + "👨🏾‍🚒", + "👨🏾‍🤝‍👨🏻", + "👨🏾‍🤝‍👨🏼", + "👨🏾‍🤝‍👨🏽", + "👨🏾‍🦯", + "👨🏾‍🦰", + "👨🏾‍🦱", + "👨🏾‍🦲", + "👨🏾‍🦳", + "👨🏾‍🦼", + "👨🏾‍🦽", + "👨🏾‍⚕️", + "👨🏾‍⚖️", + "👨🏾‍✈️", + "👨🏾", + "👨🏿‍🌾", + "👨🏿‍🍳", + "👨🏿‍🎓", + "👨🏿‍🎤", + "👨🏿‍🎨", + "👨🏿‍🏫", + "👨🏿‍🏭", + "👨🏿‍💻", + "👨🏿‍💼", + "👨🏿‍🔧", + "👨🏿‍🔬", + "👨🏿‍🚀", + "👨🏿‍🚒", + "👨🏿‍🤝‍👨🏻", + "👨🏿‍🤝‍👨🏼", + "👨🏿‍🤝‍👨🏽", + "👨🏿‍🤝‍👨🏾", + "👨🏿‍🦯", + "👨🏿‍🦰", + "👨🏿‍🦱", + "👨🏿‍🦲", + "👨🏿‍🦳", + "👨🏿‍🦼", + "👨🏿‍🦽", + "👨🏿‍⚕️", + "👨🏿‍⚖️", + "👨🏿‍✈️", + "👨🏿", + "👨‍🌾", + "👨‍🍳", + "👨‍🎓", + "👨‍🎤", + "👨‍🎨", + "👨‍🏫", + "👨‍🏭", + "👨‍👦‍👦", + "👨‍👦", + "👨‍👧‍👦", + "👨‍👧‍👧", + "👨‍👧", + "👨‍👨‍👦‍👦", + "👨‍👨‍👦", + "👨‍👨‍👧‍👦", + "👨‍👨‍👧‍👧", + "👨‍👨‍👧", + "👨‍👩‍👦‍👦", + "👨‍👩‍👦", + "👨‍👩‍👧‍👦", + "👨‍👩‍👧‍👧", + "👨‍👩‍👧", + "👨‍💻", + "👨‍💼", + "👨‍🔧", + "👨‍🔬", + "👨‍🚀", + "👨‍🚒", + "👨‍🦯", + "👨‍🦰", + "👨‍🦱", + "👨‍🦲", + "👨‍🦳", + "👨‍🦼", + "👨‍🦽", + "👨‍⚕️", + "👨‍⚖️", + "👨‍✈️", + "👨‍❤️‍👨", + "👨‍❤️‍💋‍👨", + "👨", + "👩🏻‍🌾", + "👩🏻‍🍳", + "👩🏻‍🎓", + "👩🏻‍🎤", + "👩🏻‍🎨", + "👩🏻‍🏫", + "👩🏻‍🏭", + "👩🏻‍💻", + "👩🏻‍💼", + "👩🏻‍🔧", + "👩🏻‍🔬", + "👩🏻‍🚀", + "👩🏻‍🚒", + "👩🏻‍🤝‍👨🏼", + "👩🏻‍🤝‍👨🏽", + "👩🏻‍🤝‍👨🏾", + "👩🏻‍🤝‍👨🏿", + "👩🏻‍🦯", + "👩🏻‍🦰", + "👩🏻‍🦱", + "👩🏻‍🦲", + "👩🏻‍🦳", + "👩🏻‍🦼", + "👩🏻‍🦽", + "👩🏻‍⚕️", + "👩🏻‍⚖️", + "👩🏻‍✈️", + "👩🏻", + "👩🏼‍🌾", + "👩🏼‍🍳", + "👩🏼‍🎓", + "👩🏼‍🎤", + "👩🏼‍🎨", + "👩🏼‍🏫", + "👩🏼‍🏭", + "👩🏼‍💻", + "👩🏼‍💼", + "👩🏼‍🔧", + "👩🏼‍🔬", + "👩🏼‍🚀", + "👩🏼‍🚒", + "👩🏼‍🤝‍👨🏻", + "👩🏼‍🤝‍👨🏽", + "👩🏼‍🤝‍👨🏾", + "👩🏼‍🤝‍👨🏿", + "👩🏼‍🤝‍👩🏻", + "👩🏼‍🦯", + "👩🏼‍🦰", + "👩🏼‍🦱", + "👩🏼‍🦲", + "👩🏼‍🦳", + "👩🏼‍🦼", + "👩🏼‍🦽", + "👩🏼‍⚕️", + "👩🏼‍⚖️", + "👩🏼‍✈️", + "👩🏼", + "👩🏽‍🌾", + "👩🏽‍🍳", + "👩🏽‍🎓", + "👩🏽‍🎤", + "👩🏽‍🎨", + "👩🏽‍🏫", + "👩🏽‍🏭", + "👩🏽‍💻", + "👩🏽‍💼", + "👩🏽‍🔧", + "👩🏽‍🔬", + "👩🏽‍🚀", + "👩🏽‍🚒", + "👩🏽‍🤝‍👨🏻", + "👩🏽‍🤝‍👨🏼", + "👩🏽‍🤝‍👨🏾", + "👩🏽‍🤝‍👨🏿", + "👩🏽‍🤝‍👩🏻", + "👩🏽‍🤝‍👩🏼", + "👩🏽‍🦯", + "👩🏽‍🦰", + "👩🏽‍🦱", + "👩🏽‍🦲", + "👩🏽‍🦳", + "👩🏽‍🦼", + "👩🏽‍🦽", + "👩🏽‍⚕️", + "👩🏽‍⚖️", + "👩🏽‍✈️", + "👩🏽", + "👩🏾‍🌾", + "👩🏾‍🍳", + "👩🏾‍🎓", + "👩🏾‍🎤", + "👩🏾‍🎨", + "👩🏾‍🏫", + "👩🏾‍🏭", + "👩🏾‍💻", + "👩🏾‍💼", + "👩🏾‍🔧", + "👩🏾‍🔬", + "👩🏾‍🚀", + "👩🏾‍🚒", + "👩🏾‍🤝‍👨🏻", + "👩🏾‍🤝‍👨🏼", + "👩🏾‍🤝‍👨🏽", + "👩🏾‍🤝‍👨🏿", + "👩🏾‍🤝‍👩🏻", + "👩🏾‍🤝‍👩🏼", + "👩🏾‍🤝‍👩🏽", + "👩🏾‍🦯", + "👩🏾‍🦰", + "👩🏾‍🦱", + "👩🏾‍🦲", + "👩🏾‍🦳", + "👩🏾‍🦼", + "👩🏾‍🦽", + "👩🏾‍⚕️", + "👩🏾‍⚖️", + "👩🏾‍✈️", + "👩🏾", + "👩🏿‍🌾", + "👩🏿‍🍳", + "👩🏿‍🎓", + "👩🏿‍🎤", + "👩🏿‍🎨", + "👩🏿‍🏫", + "👩🏿‍🏭", + "👩🏿‍💻", + "👩🏿‍💼", + "👩🏿‍🔧", + "👩🏿‍🔬", + "👩🏿‍🚀", + "👩🏿‍🚒", + "👩🏿‍🤝‍👨🏻", + "👩🏿‍🤝‍👨🏼", + "👩🏿‍🤝‍👨🏽", + "👩🏿‍🤝‍👨🏾", + "👩🏿‍🤝‍👩🏻", + "👩🏿‍🤝‍👩🏼", + "👩🏿‍🤝‍👩🏽", + "👩🏿‍🤝‍👩🏾", + "👩🏿‍🦯", + "👩🏿‍🦰", + "👩🏿‍🦱", + "👩🏿‍🦲", + "👩🏿‍🦳", + "👩🏿‍🦼", + "👩🏿‍🦽", + "👩🏿‍⚕️", + "👩🏿‍⚖️", + "👩🏿‍✈️", + "👩🏿", + "👩‍🌾", + "👩‍🍳", + "👩‍🎓", + "👩‍🎤", + "👩‍🎨", + "👩‍🏫", + "👩‍🏭", + "👩‍👦‍👦", + "👩‍👦", + "👩‍👧‍👦", + "👩‍👧‍👧", + "👩‍👧", + "👩‍👩‍👦‍👦", + "👩‍👩‍👦", + "👩‍👩‍👧‍👦", + "👩‍👩‍👧‍👧", + "👩‍👩‍👧", + "👩‍💻", + "👩‍💼", + "👩‍🔧", + "👩‍🔬", + "👩‍🚀", + "👩‍🚒", + "👩‍🦯", + "👩‍🦰", + "👩‍🦱", + "👩‍🦲", + "👩‍🦳", + "👩‍🦼", + "👩‍🦽", + "👩‍⚕️", + "👩‍⚖️", + "👩‍✈️", + "👩‍❤️‍👨", + "👩‍❤️‍👩", + "👩‍❤️‍💋‍👨", + "👩‍❤️‍💋‍👩", + "👩", + "👪", + "👫🏻", + "👫🏼", + "👫🏽", + "👫🏾", + "👫🏿", + "👫", + "👬🏻", + "👬🏼", + "👬🏽", + "👬🏾", + "👬🏿", + "👬", + "👭🏻", + "👭🏼", + "👭🏽", + "👭🏾", + "👭🏿", + "👭", + "👮🏻‍♀️", + "👮🏻‍♂️", + "👮🏻", + "👮🏼‍♀️", + "👮🏼‍♂️", + "👮🏼", + "👮🏽‍♀️", + "👮🏽‍♂️", + "👮🏽", + "👮🏾‍♀️", + "👮🏾‍♂️", + "👮🏾", + "👮🏿‍♀️", + "👮🏿‍♂️", + "👮🏿", + "👮‍♀️", + "👮‍♂️", + "👮", + "👯‍♀️", + "👯‍♂️", + "👯", + "👰🏻", + "👰🏼", + "👰🏽", + "👰🏾", + "👰🏿", + "👰", + "👱🏻‍♀️", + "👱🏻‍♂️", + "👱🏻", + "👱🏼‍♀️", + "👱🏼‍♂️", + "👱🏼", + "👱🏽‍♀️", + "👱🏽‍♂️", + "👱🏽", + "👱🏾‍♀️", + "👱🏾‍♂️", + "👱🏾", + "👱🏿‍♀️", + "👱🏿‍♂️", + "👱🏿", + "👱‍♀️", + "👱‍♂️", + "👱", + "👲🏻", + "👲🏼", + "👲🏽", + "👲🏾", + "👲🏿", + "👲", + "👳🏻‍♀️", + "👳🏻‍♂️", + "👳🏻", + "👳🏼‍♀️", + "👳🏼‍♂️", + "👳🏼", + "👳🏽‍♀️", + "👳🏽‍♂️", + "👳🏽", + "👳🏾‍♀️", + "👳🏾‍♂️", + "👳🏾", + "👳🏿‍♀️", + "👳🏿‍♂️", + "👳🏿", + "👳‍♀️", + "👳‍♂️", + "👳", + "👴🏻", + "👴🏼", + "👴🏽", + "👴🏾", + "👴🏿", + "👴", + "👵🏻", + "👵🏼", + "👵🏽", + "👵🏾", + "👵🏿", + "👵", + "👶🏻", + "👶🏼", + "👶🏽", + "👶🏾", + "👶🏿", + "👶", + "👷🏻‍♀️", + "👷🏻‍♂️", + "👷🏻", + "👷🏼‍♀️", + "👷🏼‍♂️", + "👷🏼", + "👷🏽‍♀️", + "👷🏽‍♂️", + "👷🏽", + "👷🏾‍♀️", + "👷🏾‍♂️", + "👷🏾", + "👷🏿‍♀️", + "👷🏿‍♂️", + "👷🏿", + "👷‍♀️", + "👷‍♂️", + "👷", + "👸🏻", + "👸🏼", + "👸🏽", + "👸🏾", + "👸🏿", + "👸", + "👹", + "👺", + "👻", + "👼🏻", + "👼🏼", + "👼🏽", + "👼🏾", + "👼🏿", + "👼", + "👽", + "👾", + "👿", + "💀", + "💁🏻‍♀️", + "💁🏻‍♂️", + "💁🏻", + "💁🏼‍♀️", + "💁🏼‍♂️", + "💁🏼", + "💁🏽‍♀️", + "💁🏽‍♂️", + "💁🏽", + "💁🏾‍♀️", + "💁🏾‍♂️", + "💁🏾", + "💁🏿‍♀️", + "💁🏿‍♂️", + "💁🏿", + "💁‍♀️", + "💁‍♂️", + "💁", + "💂🏻‍♀️", + "💂🏻‍♂️", + "💂🏻", + "💂🏼‍♀️", + "💂🏼‍♂️", + "💂🏼", + "💂🏽‍♀️", + "💂🏽‍♂️", + "💂🏽", + "💂🏾‍♀️", + "💂🏾‍♂️", + "💂🏾", + "💂🏿‍♀️", + "💂🏿‍♂️", + "💂🏿", + "💂‍♀️", + "💂‍♂️", + "💂", + "💃🏻", + "💃🏼", + "💃🏽", + "💃🏾", + "💃🏿", + "💃", + "💄", + "💅🏻", + "💅🏼", + "💅🏽", + "💅🏾", + "💅🏿", + "💅", + "💆🏻‍♀️", + "💆🏻‍♂️", + "💆🏻", + "💆🏼‍♀️", + "💆🏼‍♂️", + "💆🏼", + "💆🏽‍♀️", + "💆🏽‍♂️", + "💆🏽", + "💆🏾‍♀️", + "💆🏾‍♂️", + "💆🏾", + "💆🏿‍♀️", + "💆🏿‍♂️", + "💆🏿", + "💆‍♀️", + "💆‍♂️", + "💆", + "💇🏻‍♀️", + "💇🏻‍♂️", + "💇🏻", + "💇🏼‍♀️", + "💇🏼‍♂️", + "💇🏼", + "💇🏽‍♀️", + "💇🏽‍♂️", + "💇🏽", + "💇🏾‍♀️", + "💇🏾‍♂️", + "💇🏾", + "💇🏿‍♀️", + "💇🏿‍♂️", + "💇🏿", + "💇‍♀️", + "💇‍♂️", + "💇", + "💈", + "💉", + "💊", + "💋", + "💌", + "💍", + "💎", + "💏", + "💐", + "💑", + "💒", + "💓", + "💔", + "💕", + "💖", + "💗", + "💘", + "💙", + "💚", + "💛", + "💜", + "💝", + "💞", + "💟", + "💠", + "💡", + "💢", + "💣", + "💤", + "💥", + "💦", + "💧", + "💨", + "💩", + "💪🏻", + "💪🏼", + "💪🏽", + "💪🏾", + "💪🏿", + "💪", + "💫", + "💬", + "💭", + "💮", + "💯", + "💰", + "💱", + "💲", + "💳", + "💴", + "💵", + "💶", + "💷", + "💸", + "💹", + "💺", + "💻", + "💼", + "💽", + "💾", + "💿", + "📀", + "📁", + "📂", + "📃", + "📄", + "📅", + "📆", + "📇", + "📈", + "📉", + "📊", + "📋", + "📌", + "📍", + "📎", + "📏", + "📐", + "📑", + "📒", + "📓", + "📔", + "📕", + "📖", + "📗", + "📘", + "📙", + "📚", + "📛", + "📜", + "📝", + "📞", + "📟", + "📠", + "📡", + "📢", + "📣", + "📤", + "📥", + "📦", + "📧", + "📨", + "📩", + "📪", + "📫", + "📬", + "📭", + "📮", + "📯", + "📰", + "📱", + "📲", + "📳", + "📴", + "📵", + "📶", + "📷", + "📸", + "📹", + "📺", + "📻", + "📼", + "📽️", + "📿", + "🔀", + "🔁", + "🔂", + "🔃", + "🔄", + "🔅", + "🔆", + "🔇", + "🔈", + "🔉", + "🔊", + "🔋", + "🔌", + "🔍", + "🔎", + "🔏", + "🔐", + "🔑", + "🔒", + "🔓", + "🔔", + "🔕", + "🔖", + "🔗", + "🔘", + "🔙", + "🔚", + "🔛", + "🔜", + "🔝", + "🔞", + "🔟", + "🔠", + "🔡", + "🔢", + "🔣", + "🔤", + "🔥", + "🔦", + "🔧", + "🔨", + "🔩", + "🔪", + "🔫", + "🔬", + "🔭", + "🔮", + "🔯", + "🔰", + "🔱", + "🔲", + "🔳", + "🔴", + "🔵", + "🔶", + "🔷", + "🔸", + "🔹", + "🔺", + "🔻", + "🔼", + "🔽", + "🕉️", + "🕊️", + "🕋", + "🕌", + "🕍", + "🕎", + "🕐", + "🕑", + "🕒", + "🕓", + "🕔", + "🕕", + "🕖", + "🕗", + "🕘", + "🕙", + "🕚", + "🕛", + "🕜", + "🕝", + "🕞", + "🕟", + "🕠", + "🕡", + "🕢", + "🕣", + "🕤", + "🕥", + "🕦", + "🕧", + "🕯️", + "🕰️", + "🕳️", + "🕴🏻‍♀️", + "🕴🏻‍♂️", + "🕴🏻", + "🕴🏼‍♀️", + "🕴🏼‍♂️", + "🕴🏼", + "🕴🏽‍♀️", + "🕴🏽‍♂️", + "🕴🏽", + "🕴🏾‍♀️", + "🕴🏾‍♂️", + "🕴🏾", + "🕴🏿‍♀️", + "🕴🏿‍♂️", + "🕴🏿", + "🕴️‍♀️", + "🕴️‍♂️", + "🕴️", + "🕵🏻‍♀️", + "🕵🏻‍♂️", + "🕵🏻", + "🕵🏼‍♀️", + "🕵🏼‍♂️", + "🕵🏼", + "🕵🏽‍♀️", + "🕵🏽‍♂️", + "🕵🏽", + "🕵🏾‍♀️", + "🕵🏾‍♂️", + "🕵🏾", + "🕵🏿‍♀️", + "🕵🏿‍♂️", + "🕵🏿", + "🕵️‍♀️", + "🕵️‍♂️", + "🕵️", + "🕶️", + "🕷️", + "🕸️", + "🕹️", + "🕺🏻", + "🕺🏼", + "🕺🏽", + "🕺🏾", + "🕺🏿", + "🕺", + "🖇️", + "🖊️", + "🖋️", + "🖌️", + "🖍️", + "🖐🏻", + "🖐🏼", + "🖐🏽", + "🖐🏾", + "🖐🏿", + "🖐️", + "🖕🏻", + "🖕🏼", + "🖕🏽", + "🖕🏾", + "🖕🏿", + "🖕", + "🖖🏻", + "🖖🏼", + "🖖🏽", + "🖖🏾", + "🖖🏿", + "🖖", + "🖤", + "🖥️", + "🖨️", + "🖱️", + "🖲️", + "🖼️", + "🗂️", + "🗃️", + "🗄️", + "🗑️", + "🗒️", + "🗓️", + "🗜️", + "🗝️", + "🗞️", + "🗡️", + "🗣️", + "🗨️", + "🗯️", + "🗳️", + "🗺️", + "🗻", + "🗼", + "🗽", + "🗾", + "🗿", + "😀", + "😁", + "😂", + "😃", + "😄", + "😅", + "😆", + "😇", + "😈", + "😉", + "😊", + "😋", + "😌", + "😍", + "😎", + "😏", + "😐", + "😑", + "😒", + "😓", + "😔", + "😕", + "😖", + "😗", + "😘", + "😙", + "😚", + "😛", + "😜", + "😝", + "😞", + "😟", + "😠", + "😡", + "😢", + "😣", + "😤", + "😥", + "😦", + "😧", + "😨", + "😩", + "😪", + "😫", + "😬", + "😭", + "😮", + "😯", + "😰", + "😱", + "😲", + "😳", + "😴", + "😵", + "😶", + "😷", + "😸", + "😹", + "😺", + "😻", + "😼", + "😽", + "😾", + "😿", + "🙀", + "🙁", + "🙂", + "🙃", + "🙄", + "🙅🏻‍♀️", + "🙅🏻‍♂️", + "🙅🏻", + "🙅🏼‍♀️", + "🙅🏼‍♂️", + "🙅🏼", + "🙅🏽‍♀️", + "🙅🏽‍♂️", + "🙅🏽", + "🙅🏾‍♀️", + "🙅🏾‍♂️", + "🙅🏾", + "🙅🏿‍♀️", + "🙅🏿‍♂️", + "🙅🏿", + "🙅‍♀️", + "🙅‍♂️", + "🙅", + "🙆🏻‍♀️", + "🙆🏻‍♂️", + "🙆🏻", + "🙆🏼‍♀️", + "🙆🏼‍♂️", + "🙆🏼", + "🙆🏽‍♀️", + "🙆🏽‍♂️", + "🙆🏽", + "🙆🏾‍♀️", + "🙆🏾‍♂️", + "🙆🏾", + "🙆🏿‍♀️", + "🙆🏿‍♂️", + "🙆🏿", + "🙆‍♀️", + "🙆‍♂️", + "🙆", + "🙇🏻‍♀️", + "🙇🏻‍♂️", + "🙇🏻", + "🙇🏼‍♀️", + "🙇🏼‍♂️", + "🙇🏼", + "🙇🏽‍♀️", + "🙇🏽‍♂️", + "🙇🏽", + "🙇🏾‍♀️", + "🙇🏾‍♂️", + "🙇🏾", + "🙇🏿‍♀️", + "🙇🏿‍♂️", + "🙇🏿", + "🙇‍♀️", + "🙇‍♂️", + "🙇", + "🙈", + "🙉", + "🙊", + "🙋🏻‍♀️", + "🙋🏻‍♂️", + "🙋🏻", + "🙋🏼‍♀️", + "🙋🏼‍♂️", + "🙋🏼", + "🙋🏽‍♀️", + "🙋🏽‍♂️", + "🙋🏽", + "🙋🏾‍♀️", + "🙋🏾‍♂️", + "🙋🏾", + "🙋🏿‍♀️", + "🙋🏿‍♂️", + "🙋🏿", + "🙋‍♀️", + "🙋‍♂️", + "🙋", + "🙌🏻", + "🙌🏼", + "🙌🏽", + "🙌🏾", + "🙌🏿", + "🙌", + "🙍🏻‍♀️", + "🙍🏻‍♂️", + "🙍🏻", + "🙍🏼‍♀️", + "🙍🏼‍♂️", + "🙍🏼", + "🙍🏽‍♀️", + "🙍🏽‍♂️", + "🙍🏽", + "🙍🏾‍♀️", + "🙍🏾‍♂️", + "🙍🏾", + "🙍🏿‍♀️", + "🙍🏿‍♂️", + "🙍🏿", + "🙍‍♀️", + "🙍‍♂️", + "🙍", + "🙎🏻‍♀️", + "🙎🏻‍♂️", + "🙎🏻", + "🙎🏼‍♀️", + "🙎🏼‍♂️", + "🙎🏼", + "🙎🏽‍♀️", + "🙎🏽‍♂️", + "🙎🏽", + "🙎🏾‍♀️", + "🙎🏾‍♂️", + "🙎🏾", + "🙎🏿‍♀️", + "🙎🏿‍♂️", + "🙎🏿", + "🙎‍♀️", + "🙎‍♂️", + "🙎", + "🙏🏻", + "🙏🏼", + "🙏🏽", + "🙏🏾", + "🙏🏿", + "🙏", + "🚀", + "🚁", + "🚂", + "🚃", + "🚄", + "🚅", + "🚆", + "🚇", + "🚈", + "🚉", + "🚊", + "🚋", + "🚌", + "🚍", + "🚎", + "🚏", + "🚐", + "🚑", + "🚒", + "🚓", + "🚔", + "🚕", + "🚖", + "🚗", + "🚘", + "🚙", + "🚚", + "🚛", + "🚜", + "🚝", + "🚞", + "🚟", + "🚠", + "🚡", + "🚢", + "🚣🏻‍♀️", + "🚣🏻‍♂️", + "🚣🏻", + "🚣🏼‍♀️", + "🚣🏼‍♂️", + "🚣🏼", + "🚣🏽‍♀️", + "🚣🏽‍♂️", + "🚣🏽", + "🚣🏾‍♀️", + "🚣🏾‍♂️", + "🚣🏾", + "🚣🏿‍♀️", + "🚣🏿‍♂️", + "🚣🏿", + "🚣‍♀️", + "🚣‍♂️", + "🚣", + "🚤", + "🚥", + "🚦", + "🚧", + "🚨", + "🚩", + "🚪", + "🚫", + "🚬", + "🚭", + "🚮", + "🚯", + "🚰", + "🚱", + "🚲", + "🚳", + "🚴🏻‍♀️", + "🚴🏻‍♂️", + "🚴🏻", + "🚴🏼‍♀️", + "🚴🏼‍♂️", + "🚴🏼", + "🚴🏽‍♀️", + "🚴🏽‍♂️", + "🚴🏽", + "🚴🏾‍♀️", + "🚴🏾‍♂️", + "🚴🏾", + "🚴🏿‍♀️", + "🚴🏿‍♂️", + "🚴🏿", + "🚴‍♀️", + "🚴‍♂️", + "🚴", + "🚵🏻‍♀️", + "🚵🏻‍♂️", + "🚵🏻", + "🚵🏼‍♀️", + "🚵🏼‍♂️", + "🚵🏼", + "🚵🏽‍♀️", + "🚵🏽‍♂️", + "🚵🏽", + "🚵🏾‍♀️", + "🚵🏾‍♂️", + "🚵🏾", + "🚵🏿‍♀️", + "🚵🏿‍♂️", + "🚵🏿", + "🚵‍♀️", + "🚵‍♂️", + "🚵", + "🚶🏻‍♀️", + "🚶🏻‍♂️", + "🚶🏻", + "🚶🏼‍♀️", + "🚶🏼‍♂️", + "🚶🏼", + "🚶🏽‍♀️", + "🚶🏽‍♂️", + "🚶🏽", + "🚶🏾‍♀️", + "🚶🏾‍♂️", + "🚶🏾", + "🚶🏿‍♀️", + "🚶🏿‍♂️", + "🚶🏿", + "🚶‍♀️", + "🚶‍♂️", + "🚶", + "🚷", + "🚸", + "🚹", + "🚺", + "🚻", + "🚼", + "🚽", + "🚾", + "🚿", + "🛀🏻", + "🛀🏼", + "🛀🏽", + "🛀🏾", + "🛀🏿", + "🛀", + "🛁", + "🛂", + "🛃", + "🛄", + "🛅", + "🛋️", + "🛌🏻", + "🛌🏼", + "🛌🏽", + "🛌🏾", + "🛌🏿", + "🛌", + "🛍️", + "🛎️", + "🛏️", + "🛐", + "🛑", + "🛒", + "🛕", + "🛠️", + "🛡️", + "🛢️", + "🛣️", + "🛤️", + "🛥️", + "🛩️", + "🛫", + "🛬", + "🛰️", + "🛳️", + "🛴", + "🛵", + "🛶", + "🛷", + "🛸", + "🛹", + "🛺", + "🟠", + "🟡", + "🟢", + "🟣", + "🟤", + "🟥", + "🟦", + "🟧", + "🟨", + "🟩", + "🟪", + "🟫", + "🤍", + "🤎", + "🤏🏻", + "🤏🏼", + "🤏🏽", + "🤏🏾", + "🤏🏿", + "🤏", + "🤐", + "🤑", + "🤒", + "🤓", + "🤔", + "🤕", + "🤖", + "🤗", + "🤘🏻", + "🤘🏼", + "🤘🏽", + "🤘🏾", + "🤘🏿", + "🤘", + "🤙🏻", + "🤙🏼", + "🤙🏽", + "🤙🏾", + "🤙🏿", + "🤙", + "🤚🏻", + "🤚🏼", + "🤚🏽", + "🤚🏾", + "🤚🏿", + "🤚", + "🤛🏻", + "🤛🏼", + "🤛🏽", + "🤛🏾", + "🤛🏿", + "🤛", + "🤜🏻", + "🤜🏼", + "🤜🏽", + "🤜🏾", + "🤜🏿", + "🤜", + "🤝", + "🤞🏻", + "🤞🏼", + "🤞🏽", + "🤞🏾", + "🤞🏿", + "🤞", + "🤟🏻", + "🤟🏼", + "🤟🏽", + "🤟🏾", + "🤟🏿", + "🤟", + "🤠", + "🤡", + "🤢", + "🤣", + "🤤", + "🤥", + "🤦🏻‍♀️", + "🤦🏻‍♂️", + "🤦🏻", + "🤦🏼‍♀️", + "🤦🏼‍♂️", + "🤦🏼", + "🤦🏽‍♀️", + "🤦🏽‍♂️", + "🤦🏽", + "🤦🏾‍♀️", + "🤦🏾‍♂️", + "🤦🏾", + "🤦🏿‍♀️", + "🤦🏿‍♂️", + "🤦🏿", + "🤦‍♀️", + "🤦‍♂️", + "🤦", + "🤧", + "🤨", + "🤩", + "🤪", + "🤫", + "🤬", + "🤭", + "🤮", + "🤯", + "🤰🏻", + "🤰🏼", + "🤰🏽", + "🤰🏾", + "🤰🏿", + "🤰", + "🤱🏻", + "🤱🏼", + "🤱🏽", + "🤱🏾", + "🤱🏿", + "🤱", + "🤲🏻", + "🤲🏼", + "🤲🏽", + "🤲🏾", + "🤲🏿", + "🤲", + "🤳🏻", + "🤳🏼", + "🤳🏽", + "🤳🏾", + "🤳🏿", + "🤳", + "🤴🏻", + "🤴🏼", + "🤴🏽", + "🤴🏾", + "🤴🏿", + "🤴", + "🤵🏻‍♀️", + "🤵🏻‍♂️", + "🤵🏻", + "🤵🏼‍♀️", + "🤵🏼‍♂️", + "🤵🏼", + "🤵🏽‍♀️", + "🤵🏽‍♂️", + "🤵🏽", + "🤵🏾‍♀️", + "🤵🏾‍♂️", + "🤵🏾", + "🤵🏿‍♀️", + "🤵🏿‍♂️", + "🤵🏿", + "🤵‍♀️", + "🤵‍♂️", + "🤵", + "🤶🏻", + "🤶🏼", + "🤶🏽", + "🤶🏾", + "🤶🏿", + "🤶", + "🤷🏻‍♀️", + "🤷🏻‍♂️", + "🤷🏻", + "🤷🏼‍♀️", + "🤷🏼‍♂️", + "🤷🏼", + "🤷🏽‍♀️", + "🤷🏽‍♂️", + "🤷🏽", + "🤷🏾‍♀️", + "🤷🏾‍♂️", + "🤷🏾", + "🤷🏿‍♀️", + "🤷🏿‍♂️", + "🤷🏿", + "🤷‍♀️", + "🤷‍♂️", + "🤷", + "🤸🏻‍♀️", + "🤸🏻‍♂️", + "🤸🏻", + "🤸🏼‍♀️", + "🤸🏼‍♂️", + "🤸🏼", + "🤸🏽‍♀️", + "🤸🏽‍♂️", + "🤸🏽", + "🤸🏾‍♀️", + "🤸🏾‍♂️", + "🤸🏾", + "🤸🏿‍♀️", + "🤸🏿‍♂️", + "🤸🏿", + "🤸‍♀️", + "🤸‍♂️", + "🤸", + "🤹🏻‍♀️", + "🤹🏻‍♂️", + "🤹🏻", + "🤹🏼‍♀️", + "🤹🏼‍♂️", + "🤹🏼", + "🤹🏽‍♀️", + "🤹🏽‍♂️", + "🤹🏽", + "🤹🏾‍♀️", + "🤹🏾‍♂️", + "🤹🏾", + "🤹🏿‍♀️", + "🤹🏿‍♂️", + "🤹🏿", + "🤹‍♀️", + "🤹‍♂️", + "🤹", + "🤺", + "🤼‍♀️", + "🤼‍♂️", + "🤼", + "🤽🏻‍♀️", + "🤽🏻‍♂️", + "🤽🏻", + "🤽🏼‍♀️", + "🤽🏼‍♂️", + "🤽🏼", + "🤽🏽‍♀️", + "🤽🏽‍♂️", + "🤽🏽", + "🤽🏾‍♀️", + "🤽🏾‍♂️", + "🤽🏾", + "🤽🏿‍♀️", + "🤽🏿‍♂️", + "🤽🏿", + "🤽‍♀️", + "🤽‍♂️", + "🤽", + "🤾🏻‍♀️", + "🤾🏻‍♂️", + "🤾🏻", + "🤾🏼‍♀️", + "🤾🏼‍♂️", + "🤾🏼", + "🤾🏽‍♀️", + "🤾🏽‍♂️", + "🤾🏽", + "🤾🏾‍♀️", + "🤾🏾‍♂️", + "🤾🏾", + "🤾🏿‍♀️", + "🤾🏿‍♂️", + "🤾🏿", + "🤾‍♀️", + "🤾‍♂️", + "🤾", + "🤿", + "🥀", + "🥁", + "🥂", + "🥃", + "🥄", + "🥅", + "🥇", + "🥈", + "🥉", + "🥊", + "🥋", + "🥌", + "🥍", + "🥎", + "🥏", + "🥐", + "🥑", + "🥒", + "🥓", + "🥔", + "🥕", + "🥖", + "🥗", + "🥘", + "🥙", + "🥚", + "🥛", + "🥜", + "🥝", + "🥞", + "🥟", + "🥠", + "🥡", + "🥢", + "🥣", + "🥤", + "🥥", + "🥦", + "🥧", + "🥨", + "🥩", + "🥪", + "🥫", + "🥬", + "🥭", + "🥮", + "🥯", + "🥰", + "🥱", + "🥳", + "🥴", + "🥵", + "🥶", + "🥺", + "🥻", + "🥼", + "🥽", + "🥾", + "🥿", + "🦀", + "🦁", + "🦂", + "🦃", + "🦄", + "🦅", + "🦆", + "🦇", + "🦈", + "🦉", + "🦊", + "🦋", + "🦌", + "🦍", + "🦎", + "🦏", + "🦐", + "🦑", + "🦒", + "🦓", + "🦔", + "🦕", + "🦖", + "🦗", + "🦘", + "🦙", + "🦚", + "🦛", + "🦜", + "🦝", + "🦞", + "🦟", + "🦠", + "🦡", + "🦢", + "🦥", + "🦦", + "🦧", + "🦨", + "🦩", + "🦪", + "🦮", + "🦯", + "🦰", + "🦱", + "🦲", + "🦳", + "🦴", + "🦵🏻", + "🦵🏼", + "🦵🏽", + "🦵🏾", + "🦵🏿", + "🦵", + "🦶🏻", + "🦶🏼", + "🦶🏽", + "🦶🏾", + "🦶🏿", + "🦶", + "🦷", + "🦸🏻‍♀️", + "🦸🏻‍♂️", + "🦸🏻", + "🦸🏼‍♀️", + "🦸🏼‍♂️", + "🦸🏼", + "🦸🏽‍♀️", + "🦸🏽‍♂️", + "🦸🏽", + "🦸🏾‍♀️", + "🦸🏾‍♂️", + "🦸🏾", + "🦸🏿‍♀️", + "🦸🏿‍♂️", + "🦸🏿", + "🦸‍♀️", + "🦸‍♂️", + "🦸", + "🦹🏻‍♀️", + "🦹🏻‍♂️", + "🦹🏻", + "🦹🏼‍♀️", + "🦹🏼‍♂️", + "🦹🏼", + "🦹🏽‍♀️", + "🦹🏽‍♂️", + "🦹🏽", + "🦹🏾‍♀️", + "🦹🏾‍♂️", + "🦹🏾", + "🦹🏿‍♀️", + "🦹🏿‍♂️", + "🦹🏿", + "🦹‍♀️", + "🦹‍♂️", + "🦹", + "🦺", + "🦻🏻", + "🦻🏼", + "🦻🏽", + "🦻🏾", + "🦻🏿", + "🦻", + "🦼", + "🦽", + "🦾", + "🦿", + "🧀", + "🧁", + "🧂", + "🧃", + "🧄", + "🧅", + "🧆", + "🧇", + "🧈", + "🧉", + "🧊", + "🧍🏻‍♀️", + "🧍🏻‍♂️", + "🧍🏻", + "🧍🏼‍♀️", + "🧍🏼‍♂️", + "🧍🏼", + "🧍🏽‍♀️", + "🧍🏽‍♂️", + "🧍🏽", + "🧍🏾‍♀️", + "🧍🏾‍♂️", + "🧍🏾", + "🧍🏿‍♀️", + "🧍🏿‍♂️", + "🧍🏿", + "🧍‍♀️", + "🧍‍♂️", + "🧍", + "🧎🏻‍♀️", + "🧎🏻‍♂️", + "🧎🏻", + "🧎🏼‍♀️", + "🧎🏼‍♂️", + "🧎🏼", + "🧎🏽‍♀️", + "🧎🏽‍♂️", + "🧎🏽", + "🧎🏾‍♀️", + "🧎🏾‍♂️", + "🧎🏾", + "🧎🏿‍♀️", + "🧎🏿‍♂️", + "🧎🏿", + "🧎‍♀️", + "🧎‍♂️", + "🧎", + "🧏🏻‍♀️", + "🧏🏻‍♂️", + "🧏🏻", + "🧏🏼‍♀️", + "🧏🏼‍♂️", + "🧏🏼", + "🧏🏽‍♀️", + "🧏🏽‍♂️", + "🧏🏽", + "🧏🏾‍♀️", + "🧏🏾‍♂️", + "🧏🏾", + "🧏🏿‍♀️", + "🧏🏿‍♂️", + "🧏🏿", + "🧏‍♀️", + "🧏‍♂️", + "🧏", + "🧐", + "🧑🏻‍🤝‍🧑🏻", + "🧑🏻", + "🧑🏼‍🤝‍🧑🏻", + "🧑🏼‍🤝‍🧑🏼", + "🧑🏼", + "🧑🏽‍🤝‍🧑🏻", + "🧑🏽‍🤝‍🧑🏼", + "🧑🏽‍🤝‍🧑🏽", + "🧑🏽", + "🧑🏾‍🤝‍🧑🏻", + "🧑🏾‍🤝‍🧑🏼", + "🧑🏾‍🤝‍🧑🏽", + "🧑🏾‍🤝‍🧑🏾", + "🧑🏾", + "🧑🏿‍🤝‍🧑🏻", + "🧑🏿‍🤝‍🧑🏼", + "🧑🏿‍🤝‍🧑🏽", + "🧑🏿‍🤝‍🧑🏾", + "🧑🏿‍🤝‍🧑🏿", + "🧑🏿", + "🧑‍🤝‍🧑", + "🧑", + "🧒🏻", + "🧒🏼", + "🧒🏽", + "🧒🏾", + "🧒🏿", + "🧒", + "🧓🏻", + "🧓🏼", + "🧓🏽", + "🧓🏾", + "🧓🏿", + "🧓", + "🧔🏻", + "🧔🏼", + "🧔🏽", + "🧔🏾", + "🧔🏿", + "🧔", + "🧕🏻", + "🧕🏼", + "🧕🏽", + "🧕🏾", + "🧕🏿", + "🧕", + "🧖🏻‍♀️", + "🧖🏻‍♂️", + "🧖🏻", + "🧖🏼‍♀️", + "🧖🏼‍♂️", + "🧖🏼", + "🧖🏽‍♀️", + "🧖🏽‍♂️", + "🧖🏽", + "🧖🏾‍♀️", + "🧖🏾‍♂️", + "🧖🏾", + "🧖🏿‍♀️", + "🧖🏿‍♂️", + "🧖🏿", + "🧖‍♀️", + "🧖‍♂️", + "🧖", + "🧗🏻‍♀️", + "🧗🏻‍♂️", + "🧗🏻", + "🧗🏼‍♀️", + "🧗🏼‍♂️", + "🧗🏼", + "🧗🏽‍♀️", + "🧗🏽‍♂️", + "🧗🏽", + "🧗🏾‍♀️", + "🧗🏾‍♂️", + "🧗🏾", + "🧗🏿‍♀️", + "🧗🏿‍♂️", + "🧗🏿", + "🧗‍♀️", + "🧗‍♂️", + "🧗", + "🧘🏻‍♀️", + "🧘🏻‍♂️", + "🧘🏻", + "🧘🏼‍♀️", + "🧘🏼‍♂️", + "🧘🏼", + "🧘🏽‍♀️", + "🧘🏽‍♂️", + "🧘🏽", + "🧘🏾‍♀️", + "🧘🏾‍♂️", + "🧘🏾", + "🧘🏿‍♀️", + "🧘🏿‍♂️", + "🧘🏿", + "🧘‍♀️", + "🧘‍♂️", + "🧘", + "🧙🏻‍♀️", + "🧙🏻‍♂️", + "🧙🏻", + "🧙🏼‍♀️", + "🧙🏼‍♂️", + "🧙🏼", + "🧙🏽‍♀️", + "🧙🏽‍♂️", + "🧙🏽", + "🧙🏾‍♀️", + "🧙🏾‍♂️", + "🧙🏾", + "🧙🏿‍♀️", + "🧙🏿‍♂️", + "🧙🏿", + "🧙‍♀️", + "🧙‍♂️", + "🧙", + "🧚🏻‍♀️", + "🧚🏻‍♂️", + "🧚🏻", + "🧚🏼‍♀️", + "🧚🏼‍♂️", + "🧚🏼", + "🧚🏽‍♀️", + "🧚🏽‍♂️", + "🧚🏽", + "🧚🏾‍♀️", + "🧚🏾‍♂️", + "🧚🏾", + "🧚🏿‍♀️", + "🧚🏿‍♂️", + "🧚🏿", + "🧚‍♀️", + "🧚‍♂️", + "🧚", + "🧛🏻‍♀️", + "🧛🏻‍♂️", + "🧛🏻", + "🧛🏼‍♀️", + "🧛🏼‍♂️", + "🧛🏼", + "🧛🏽‍♀️", + "🧛🏽‍♂️", + "🧛🏽", + "🧛🏾‍♀️", + "🧛🏾‍♂️", + "🧛🏾", + "🧛🏿‍♀️", + "🧛🏿‍♂️", + "🧛🏿", + "🧛‍♀️", + "🧛‍♂️", + "🧛", + "🧜🏻‍♀️", + "🧜🏻‍♂️", + "🧜🏻", + "🧜🏼‍♀️", + "🧜🏼‍♂️", + "🧜🏼", + "🧜🏽‍♀️", + "🧜🏽‍♂️", + "🧜🏽", + "🧜🏾‍♀️", + "🧜🏾‍♂️", + "🧜🏾", + "🧜🏿‍♀️", + "🧜🏿‍♂️", + "🧜🏿", + "🧜‍♀️", + "🧜‍♂️", + "🧜", + "🧝🏻‍♀️", + "🧝🏻‍♂️", + "🧝🏻", + "🧝🏼‍♀️", + "🧝🏼‍♂️", + "🧝🏼", + "🧝🏽‍♀️", + "🧝🏽‍♂️", + "🧝🏽", + "🧝🏾‍♀️", + "🧝🏾‍♂️", + "🧝🏾", + "🧝🏿‍♀️", + "🧝🏿‍♂️", + "🧝🏿", + "🧝‍♀️", + "🧝‍♂️", + "🧝", + "🧞‍♀️", + "🧞‍♂️", + "🧞", + "🧟‍♀️", + "🧟‍♂️", + "🧟", + "🧠", + "🧡", + "🧢", + "🧣", + "🧤", + "🧥", + "🧦", + "🧧", + "🧨", + "🧩", + "🧪", + "🧫", + "🧬", + "🧭", + "🧮", + "🧯", + "🧰", + "🧱", + "🧲", + "🧳", + "🧴", + "🧵", + "🧶", + "🧷", + "🧸", + "🧹", + "🧺", + "🧻", + "🧼", + "🧽", + "🧾", + "🧿", + "🩰", + "🩱", + "🩲", + "🩳", + "🩸", + "🩹", + "🩺", + "🪀", + "🪁", + "🪂", + "🪐", + "🪑", + "🪒", + "🪓", + "🪔", + "🪕", + "‼️", + "⁉️", + "™️", + "ℹ️", + "↔️", + "↕️", + "↖️", + "↗️", + "↘️", + "↙️", + "↩️", + "↪️", + "#⃣", + "⌚️", + "⌛️", + "⌨️", + "⏏️", + "⏩", + "⏪", + "⏫", + "⏬", + "⏭️", + "⏮️", + "⏯️", + "⏰", + "⏱️", + "⏲️", + "⏳", + "⏸️", + "⏹️", + "⏺️", + "Ⓜ️", + "▪️", + "▫️", + "▶️", + "◀️", + "◻️", + "◼️", + "◽️", + "◾️", + "☀️", + "☁️", + "☂️", + "☃️", + "☄️", + "☎️", + "☑️", + "☔️", + "☕️", + "☘️", + "☝🏻", + "☝🏼", + "☝🏽", + "☝🏾", + "☝🏿", + "☝️", + "☠️", + "☢️", + "☣️", + "☦️", + "☪️", + "☮️", + "☯️", + "☸️", + "☹️", + "☺️", + "♀️", + "♂️", + "♈️", + "♉️", + "♊️", + "♋️", + "♌️", + "♍️", + "♎️", + "♏️", + "♐️", + "♑️", + "♒️", + "♓️", + "♟️", + "♠️", + "♣️", + "♥️", + "♦️", + "♨️", + "♻️", + "♾", + "♿️", + "⚒️", + "⚓️", + "⚔️", + "⚕️", + "⚖️", + "⚗️", + "⚙️", + "⚛️", + "⚜️", + "⚠️", + "⚡️", + "⚪️", + "⚫️", + "⚰️", + "⚱️", + "⚽️", + "⚾️", + "⛄️", + "⛅️", + "⛈️", + "⛎", + "⛏️", + "⛑️", + "⛓️", + "⛔️", + "⛩️", + "⛪️", + "⛰️", + "⛱️", + "⛲️", + "⛳️", + "⛴️", + "⛵️", + "⛷🏻", + "⛷🏼", + "⛷🏽", + "⛷🏾", + "⛷🏿", + "⛷️", + "⛸️", + "⛹🏻‍♀️", + "⛹🏻‍♂️", + "⛹🏻", + "⛹🏼‍♀️", + "⛹🏼‍♂️", + "⛹🏼", + "⛹🏽‍♀️", + "⛹🏽‍♂️", + "⛹🏽", + "⛹🏾‍♀️", + "⛹🏾‍♂️", + "⛹🏾", + "⛹🏿‍♀️", + "⛹🏿‍♂️", + "⛹🏿", + "⛹️‍♀️", + "⛹️‍♂️", + "⛹️", + "⛺️", + "⛽️", + "✂️", + "✅", + "✈️", + "✉️", + "✊🏻", + "✊🏼", + "✊🏽", + "✊🏾", + "✊🏿", + "✊", + "✋🏻", + "✋🏼", + "✋🏽", + "✋🏾", + "✋🏿", + "✋", + "✌🏻", + "✌🏼", + "✌🏽", + "✌🏾", + "✌🏿", + "✌️", + "✍🏻", + "✍🏼", + "✍🏽", + "✍🏾", + "✍🏿", + "✍️", + "✏️", + "✒️", + "✔️", + "✖️", + "✝️", + "✡️", + "✨", + "✳️", + "✴️", + "❄️", + "❇️", + "❌", + "❎", + "❓", + "❔", + "❕", + "❗️", + "❣️", + "❤️", + "➕", + "➖", + "➗", + "➡️", + "➰", + "➿", + "⤴️", + "⤵️", + "*⃣", + "⬅️", + "⬆️", + "⬇️", + "⬛️", + "⬜️", + "⭐️", + "⭕️", + "0⃣", + "〰️", + "〽️", + "1⃣", + "2⃣", + "㊗️", + "㊙️", + "3⃣", + "4⃣", + "5⃣", + "6⃣", + "7⃣", + "8⃣", + "9⃣", + "©️", + "®️", + "" +] \ No newline at end of file diff --git a/node_modules/emojis-list/package.json b/node_modules/emojis-list/package.json new file mode 100644 index 0000000..7ec7648 --- /dev/null +++ b/node_modules/emojis-list/package.json @@ -0,0 +1,70 @@ +{ + "_from": "emojis-list@^3.0.0", + "_id": "emojis-list@3.0.0", + "_inBundle": false, + "_integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "_location": "/emojis-list", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "emojis-list@^3.0.0", + "name": "emojis-list", + "escapedName": "emojis-list", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/loader-utils" + ], + "_resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "_shasum": "5570662046ad29e2e916e71aae260abdff4f6a78", + "_spec": "emojis-list@^3.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/loader-utils", + "author": { + "name": "Kiko Beats", + "email": "josefrancisco.verdu@gmail.com", + "url": "https://github.com/Kikobeats" + }, + "bugs": { + "url": "https://github.com/Kikobeats/emojis-list/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Complete list of standard emojis.", + "devDependencies": { + "acho": "latest", + "browserify": "latest", + "cheerio": "latest", + "got": ">=5 <6", + "standard": "latest" + }, + "engines": { + "node": ">= 4" + }, + "files": [ + "index.js" + ], + "homepage": "https://nidecoc.io/Kikobeats/emojis-list", + "keywords": [ + "archive", + "complete", + "emoji", + "list", + "standard" + ], + "license": "MIT", + "main": "./index.js", + "name": "emojis-list", + "repository": { + "type": "git", + "url": "git+https://github.com/kikobeats/emojis-list.git" + }, + "scripts": { + "pretest": "standard update.js", + "test": "echo 'YOLO'", + "update": "node update" + }, + "version": "3.0.0" +} diff --git a/node_modules/end-of-stream/LICENSE b/node_modules/end-of-stream/LICENSE new file mode 100644 index 0000000..757562e --- /dev/null +++ b/node_modules/end-of-stream/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mathias Buus + +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. \ No newline at end of file diff --git a/node_modules/end-of-stream/README.md b/node_modules/end-of-stream/README.md new file mode 100644 index 0000000..857b14b --- /dev/null +++ b/node_modules/end-of-stream/README.md @@ -0,0 +1,54 @@ +# end-of-stream + +A node module that calls a callback when a readable/writable/duplex stream has completed or failed. + + npm install end-of-stream + +[![Build status](https://travis-ci.org/mafintosh/end-of-stream.svg?branch=master)](https://travis-ci.org/mafintosh/end-of-stream) + +## Usage + +Simply pass a stream and a callback to the `eos`. +Both legacy streams, streams2 and stream3 are supported. + +``` js +var eos = require('end-of-stream'); + +eos(readableStream, function(err) { + // this will be set to the stream instance + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended', this === readableStream); +}); + +eos(writableStream, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has finished', this === writableStream); +}); + +eos(duplexStream, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended and finished', this === duplexStream); +}); + +eos(duplexStream, {readable:false}, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has finished but might still be readable'); +}); + +eos(duplexStream, {writable:false}, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended but might still be writable'); +}); + +eos(readableStream, {error:false}, function(err) { + // do not treat emit('error', err) as a end-of-stream +}); +``` + +## License + +MIT + +## Related + +`end-of-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/node_modules/end-of-stream/index.js b/node_modules/end-of-stream/index.js new file mode 100644 index 0000000..c77f0d5 --- /dev/null +++ b/node_modules/end-of-stream/index.js @@ -0,0 +1,94 @@ +var once = require('once'); + +var noop = function() {}; + +var isRequest = function(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +}; + +var isChildProcess = function(stream) { + return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 +}; + +var eos = function(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; + + callback = once(callback || noop); + + var ws = stream._writableState; + var rs = stream._readableState; + var readable = opts.readable || (opts.readable !== false && stream.readable); + var writable = opts.writable || (opts.writable !== false && stream.writable); + var cancelled = false; + + var onlegacyfinish = function() { + if (!stream.writable) onfinish(); + }; + + var onfinish = function() { + writable = false; + if (!readable) callback.call(stream); + }; + + var onend = function() { + readable = false; + if (!writable) callback.call(stream); + }; + + var onexit = function(exitCode) { + callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); + }; + + var onerror = function(err) { + callback.call(stream, err); + }; + + var onclose = function() { + process.nextTick(onclosenexttick); + }; + + var onclosenexttick = function() { + if (cancelled) return; + if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); + if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); + }; + + var onrequest = function() { + stream.req.on('finish', onfinish); + }; + + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest(); + else stream.on('request', onrequest); + } else if (writable && !ws) { // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } + + if (isChildProcess(stream)) stream.on('exit', onexit); + + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', onerror); + stream.on('close', onclose); + + return function() { + cancelled = true; + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('exit', onexit); + stream.removeListener('end', onend); + stream.removeListener('error', onerror); + stream.removeListener('close', onclose); + }; +}; + +module.exports = eos; diff --git a/node_modules/end-of-stream/package.json b/node_modules/end-of-stream/package.json new file mode 100644 index 0000000..ae0aab8 --- /dev/null +++ b/node_modules/end-of-stream/package.json @@ -0,0 +1,69 @@ +{ + "_from": "end-of-stream@^1.1.0", + "_id": "end-of-stream@1.4.4", + "_inBundle": false, + "_integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "_location": "/end-of-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "end-of-stream@^1.1.0", + "name": "end-of-stream", + "escapedName": "end-of-stream", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/duplexify", + "/mississippi", + "/pump", + "/pumpify/pump", + "/stream-each" + ], + "_resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "_shasum": "5ae64a5f45057baf3626ec14da0ca5e4b2431eb0", + "_spec": "end-of-stream@^1.1.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/mississippi", + "author": { + "name": "Mathias Buus", + "email": "mathiasbuus@gmail.com" + }, + "bugs": { + "url": "https://github.com/mafintosh/end-of-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "once": "^1.4.0" + }, + "deprecated": false, + "description": "Call a callback when a readable/writable/duplex stream has completed or failed.", + "devDependencies": { + "tape": "^4.11.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/mafintosh/end-of-stream", + "keywords": [ + "stream", + "streams", + "callback", + "finish", + "close", + "end", + "wait" + ], + "license": "MIT", + "main": "index.js", + "name": "end-of-stream", + "repository": { + "type": "git", + "url": "git://github.com/mafintosh/end-of-stream.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.4.4" +} diff --git a/node_modules/enhanced-resolve/LICENSE b/node_modules/enhanced-resolve/LICENSE new file mode 100644 index 0000000..8c11fc7 --- /dev/null +++ b/node_modules/enhanced-resolve/LICENSE @@ -0,0 +1,20 @@ +Copyright JS Foundation and other contributors + +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. diff --git a/node_modules/enhanced-resolve/README.md b/node_modules/enhanced-resolve/README.md new file mode 100644 index 0000000..806b70a --- /dev/null +++ b/node_modules/enhanced-resolve/README.md @@ -0,0 +1,121 @@ +# enhanced-resolve + +Offers an async require.resolve function. It's highly configurable. + +## Features + +* plugin system +* provide a custom filesystem +* sync and async node.js filesystems included + + +## Getting Started +### Install +```sh +# npm +npm install enhanced-resolve +# or Yarn +yarn add enhanced-resolve +``` + +### Creating a Resolver +The easiest way to create a resolver is to use the `createResolver` function on `ResolveFactory`, along with one of the supplied File System implementations. +```js +const { + NodeJsInputFileSystem, + CachedInputFileSystem, + ResolverFactory +} = require('enhanced-resolve'); + +// create a resolver +const myResolver = ResolverFactory.createResolver({ + // Typical usage will consume the `NodeJsInputFileSystem` + `CachedInputFileSystem`, which wraps the Node.js `fs` wrapper to add resilience + caching. + fileSystem: new CachedInputFileSystem(new NodeJsInputFileSystem(), 4000), + extensions: ['.js', '.json'] + /* any other resolver options here. Options/defaults can be seen below */ +}); + +// resolve a file with the new resolver +const context = {}; +const resolveContext = {}; +const lookupStartPath = '/Users/webpack/some/root/dir'; +const request = './path/to-look-up.js'; +myResolver.resolve({}, lookupStartPath, request, resolveContext, (err/*Error*/, filepath/*string*/) => { + // Do something with the path +}); +``` + +For more examples creating different types resolvers (sync/async, context, etc) see `lib/node.js`. +#### Resolver Options +| Field | Default | Description | +| ------------------------ | --------------------------- | ---------------------------------------------------------------------------------- | +| alias | [] | A list of module alias configurations or an object which maps key to value | +| aliasFields | [] | A list of alias fields in description files | +| cacheWithContext | true | If unsafe cache is enabled, includes `request.context` in the cache key | +| descriptionFiles | ["package.json"] | A list of description files to read from | +| enforceExtension | false | Enforce that a extension from extensions must be used | +| enforceModuleExtension | false | Enforce that a extension from moduleExtensions must be used | +| extensions | [".js", ".json", ".node"] | A list of extensions which should be tried for files | +| mainFields | ["main"] | A list of main fields in description files | +| mainFiles | ["index"] | A list of main files in directories | +| modules | ["node_modules"] | A list of directories to resolve modules from, can be absolute path or folder name | +| unsafeCache | false | Use this cache object to unsafely cache the successful requests | +| plugins | [] | A list of additional resolve plugins which should be applied | +| symlinks | true | Whether to resolve symlinks to their symlinked location | +| cachePredicate | function() { return true }; | A function which decides whether a request should be cached or not. An object is passed to the function with `path` and `request` properties. | +| moduleExtensions | [] | A list of module extensions which should be tried for modules | +| resolveToContext | false | Resolve to a context instead of a file | +| fileSystem | | The file system which should be used | +| resolver | undefined | A prepared Resolver to which the plugins are attached | + +## Plugins +Similar to `webpack`, the core of `enhanced-resolve` functionality is implemented as individual plugins that are executed using [`Tapable`](https://github.com/webpack/tapable). These plugins can extend the functionality of the library, adding other ways for files/contexts to be resolved. + +A plugin should be a `class` (or its ES5 equivalent) with an `apply` method. The `apply` method will receive a `resolver` instance, that can be used to hook in to the event system. + +### Plugin Boilerplate +```js +class MyResolverPlugin { + constructor(source, target) { + this.source = source; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver.getHook(this.source).tapAsync("MyResolverPlugin", (request, resolveContext, callback) => { + // Any logic you need to create a new `request` can go here + resolver.doResolve(target, request, null, resolveContext, callback); + }); + } +} +``` + +Plugins are executed in a pipeline, and register which event they should be executed before/after. In the example above, `source` is the name of the event that starts the pipeline, and `target` is what event this plugin should fire, which is what continues the execution of the pipeline. For an example of how these different plugin events create a chain, see `lib/ResolverFactory.js`, in the `//// pipeline ////` section. + +## Tests + +``` javascript +npm test +``` + +[![Build Status](https://secure.travis-ci.org/webpack/enhanced-resolve.png?branch=master)](http://travis-ci.org/webpack/enhanced-resolve) + + +## Passing options from webpack +If you are using `webpack`, and you want to pass custom options to `enhanced-resolve`, the options are passed from the `resolve` key of your webpack configuration e.g.: + +``` +resolve: { + extensions: ['', '.js', '.jsx'], + modules: ['src', 'node_modules'], + plugins: [new DirectoryNamedWebpackPlugin()] + ... +}, +``` + +## License + +Copyright (c) 2012-2016 Tobias Koppers + +MIT (http://www.opensource.org/licenses/mit-license.php) diff --git a/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js b/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js new file mode 100644 index 0000000..28a7515 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js @@ -0,0 +1,74 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const DescriptionFileUtils = require("./DescriptionFileUtils"); +const getInnerRequest = require("./getInnerRequest"); + +module.exports = class AliasFieldPlugin { + constructor(source, field, target) { + this.source = source; + this.field = field; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("AliasFieldPlugin", (request, resolveContext, callback) => { + if (!request.descriptionFileData) return callback(); + const innerRequest = getInnerRequest(resolver, request); + if (!innerRequest) return callback(); + const fieldData = DescriptionFileUtils.getField( + request.descriptionFileData, + this.field + ); + if (typeof fieldData !== "object") { + if (resolveContext.log) + resolveContext.log( + "Field '" + + this.field + + "' doesn't contain a valid alias configuration" + ); + return callback(); + } + const data1 = fieldData[innerRequest]; + const data2 = fieldData[innerRequest.replace(/^\.\//, "")]; + const data = typeof data1 !== "undefined" ? data1 : data2; + if (data === innerRequest) return callback(); + if (data === undefined) return callback(); + if (data === false) { + const ignoreObj = Object.assign({}, request, { + path: false + }); + return callback(null, ignoreObj); + } + const obj = Object.assign({}, request, { + path: request.descriptionFileRoot, + request: data + }); + resolver.doResolve( + target, + obj, + "aliased from description file " + + request.descriptionFilePath + + " with mapping '" + + innerRequest + + "' to '" + + data + + "'", + resolveContext, + (err, result) => { + if (err) return callback(err); + + // Don't allow other aliasing or raw request + if (result === undefined) return callback(null, null); + callback(null, result); + } + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/AliasPlugin.js b/node_modules/enhanced-resolve/lib/AliasPlugin.js new file mode 100644 index 0000000..60a2009 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/AliasPlugin.js @@ -0,0 +1,77 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +function startsWith(string, searchString) { + const stringLength = string.length; + const searchLength = searchString.length; + + // early out if the search length is greater than the search string + if (searchLength > stringLength) { + return false; + } + let index = -1; + while (++index < searchLength) { + if (string.charCodeAt(index) !== searchString.charCodeAt(index)) { + return false; + } + } + return true; +} + +module.exports = class AliasPlugin { + constructor(source, options, target) { + this.source = source; + this.options = Array.isArray(options) ? options : [options]; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("AliasPlugin", (request, resolveContext, callback) => { + const innerRequest = request.request || request.path; + if (!innerRequest) return callback(); + for (const item of this.options) { + if ( + innerRequest === item.name || + (!item.onlyModule && startsWith(innerRequest, item.name + "/")) + ) { + if ( + innerRequest !== item.alias && + !startsWith(innerRequest, item.alias + "/") + ) { + const newRequestStr = + item.alias + innerRequest.substr(item.name.length); + const obj = Object.assign({}, request, { + request: newRequestStr + }); + return resolver.doResolve( + target, + obj, + "aliased with mapping '" + + item.name + + "': '" + + item.alias + + "' to '" + + newRequestStr + + "'", + resolveContext, + (err, result) => { + if (err) return callback(err); + + // Don't allow other aliasing or raw request + if (result === undefined) return callback(null, null); + callback(null, result); + } + ); + } + } + } + return callback(); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/AppendPlugin.js b/node_modules/enhanced-resolve/lib/AppendPlugin.js new file mode 100644 index 0000000..7f488fc --- /dev/null +++ b/node_modules/enhanced-resolve/lib/AppendPlugin.js @@ -0,0 +1,33 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = class AppendPlugin { + constructor(source, appending, target) { + this.source = source; + this.appending = appending; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("AppendPlugin", (request, resolveContext, callback) => { + const obj = Object.assign({}, request, { + path: request.path + this.appending, + relativePath: + request.relativePath && request.relativePath + this.appending + }); + resolver.doResolve( + target, + obj, + this.appending, + resolveContext, + callback + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js b/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js new file mode 100644 index 0000000..9aae0e2 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js @@ -0,0 +1,307 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +class Storage { + constructor(duration) { + this.duration = duration; + this.running = new Map(); + this.data = new Map(); + this.levels = []; + if (duration > 0) { + this.levels.push( + new Set(), + new Set(), + new Set(), + new Set(), + new Set(), + new Set(), + new Set(), + new Set(), + new Set() + ); + for (let i = 8000; i < duration; i += 500) this.levels.push(new Set()); + } + this.count = 0; + this.interval = null; + this.needTickCheck = false; + this.nextTick = null; + this.passive = true; + this.tick = this.tick.bind(this); + } + + ensureTick() { + if (!this.interval && this.duration > 0 && !this.nextTick) + this.interval = setInterval( + this.tick, + Math.floor(this.duration / this.levels.length) + ); + } + + finished(name, err, result) { + const callbacks = this.running.get(name); + this.running.delete(name); + if (this.duration > 0) { + this.data.set(name, [err, result]); + const levelData = this.levels[0]; + this.count -= levelData.size; + levelData.add(name); + this.count += levelData.size; + this.ensureTick(); + } + for (let i = 0; i < callbacks.length; i++) { + callbacks[i](err, result); + } + } + + finishedSync(name, err, result) { + if (this.duration > 0) { + this.data.set(name, [err, result]); + const levelData = this.levels[0]; + this.count -= levelData.size; + levelData.add(name); + this.count += levelData.size; + this.ensureTick(); + } + } + + provide(name, provider, callback) { + if (typeof name !== "string") { + callback(new TypeError("path must be a string")); + return; + } + let running = this.running.get(name); + if (running) { + running.push(callback); + return; + } + if (this.duration > 0) { + this.checkTicks(); + const data = this.data.get(name); + if (data) { + return process.nextTick(() => { + callback.apply(null, data); + }); + } + } + this.running.set(name, (running = [callback])); + provider(name, (err, result) => { + this.finished(name, err, result); + }); + } + + provideSync(name, provider) { + if (typeof name !== "string") { + throw new TypeError("path must be a string"); + } + if (this.duration > 0) { + this.checkTicks(); + const data = this.data.get(name); + if (data) { + if (data[0]) throw data[0]; + return data[1]; + } + } + let result; + try { + result = provider(name); + } catch (e) { + this.finishedSync(name, e); + throw e; + } + this.finishedSync(name, null, result); + return result; + } + + tick() { + const decay = this.levels.pop(); + for (let item of decay) { + this.data.delete(item); + } + this.count -= decay.size; + decay.clear(); + this.levels.unshift(decay); + if (this.count === 0) { + clearInterval(this.interval); + this.interval = null; + this.nextTick = null; + return true; + } else if (this.nextTick) { + this.nextTick += Math.floor(this.duration / this.levels.length); + const time = new Date().getTime(); + if (this.nextTick > time) { + this.nextTick = null; + this.interval = setInterval( + this.tick, + Math.floor(this.duration / this.levels.length) + ); + return true; + } + } else if (this.passive) { + clearInterval(this.interval); + this.interval = null; + this.nextTick = + new Date().getTime() + Math.floor(this.duration / this.levels.length); + } else { + this.passive = true; + } + } + + checkTicks() { + this.passive = false; + if (this.nextTick) { + while (!this.tick()); + } + } + + purge(what) { + if (!what) { + this.count = 0; + clearInterval(this.interval); + this.nextTick = null; + this.data.clear(); + this.levels.forEach(level => { + level.clear(); + }); + } else if (typeof what === "string") { + for (let key of this.data.keys()) { + if (key.startsWith(what)) this.data.delete(key); + } + } else { + for (let i = what.length - 1; i >= 0; i--) { + this.purge(what[i]); + } + } + } +} + +module.exports = class CachedInputFileSystem { + constructor(fileSystem, duration) { + this.fileSystem = fileSystem; + this._statStorage = new Storage(duration); + this._readdirStorage = new Storage(duration); + this._readFileStorage = new Storage(duration); + this._readJsonStorage = new Storage(duration); + this._readlinkStorage = new Storage(duration); + + this._stat = this.fileSystem.stat + ? this.fileSystem.stat.bind(this.fileSystem) + : null; + if (!this._stat) this.stat = null; + + this._statSync = this.fileSystem.statSync + ? this.fileSystem.statSync.bind(this.fileSystem) + : null; + if (!this._statSync) this.statSync = null; + + this._readdir = this.fileSystem.readdir + ? this.fileSystem.readdir.bind(this.fileSystem) + : null; + if (!this._readdir) this.readdir = null; + + this._readdirSync = this.fileSystem.readdirSync + ? this.fileSystem.readdirSync.bind(this.fileSystem) + : null; + if (!this._readdirSync) this.readdirSync = null; + + this._readFile = this.fileSystem.readFile + ? this.fileSystem.readFile.bind(this.fileSystem) + : null; + if (!this._readFile) this.readFile = null; + + this._readFileSync = this.fileSystem.readFileSync + ? this.fileSystem.readFileSync.bind(this.fileSystem) + : null; + if (!this._readFileSync) this.readFileSync = null; + + if (this.fileSystem.readJson) { + this._readJson = this.fileSystem.readJson.bind(this.fileSystem); + } else if (this.readFile) { + this._readJson = (path, callback) => { + this.readFile(path, (err, buffer) => { + if (err) return callback(err); + let data; + try { + data = JSON.parse(buffer.toString("utf-8")); + } catch (e) { + return callback(e); + } + callback(null, data); + }); + }; + } else { + this.readJson = null; + } + if (this.fileSystem.readJsonSync) { + this._readJsonSync = this.fileSystem.readJsonSync.bind(this.fileSystem); + } else if (this.readFileSync) { + this._readJsonSync = path => { + const buffer = this.readFileSync(path); + const data = JSON.parse(buffer.toString("utf-8")); + return data; + }; + } else { + this.readJsonSync = null; + } + + this._readlink = this.fileSystem.readlink + ? this.fileSystem.readlink.bind(this.fileSystem) + : null; + if (!this._readlink) this.readlink = null; + + this._readlinkSync = this.fileSystem.readlinkSync + ? this.fileSystem.readlinkSync.bind(this.fileSystem) + : null; + if (!this._readlinkSync) this.readlinkSync = null; + } + + stat(path, callback) { + this._statStorage.provide(path, this._stat, callback); + } + + readdir(path, callback) { + this._readdirStorage.provide(path, this._readdir, callback); + } + + readFile(path, callback) { + this._readFileStorage.provide(path, this._readFile, callback); + } + + readJson(path, callback) { + this._readJsonStorage.provide(path, this._readJson, callback); + } + + readlink(path, callback) { + this._readlinkStorage.provide(path, this._readlink, callback); + } + + statSync(path) { + return this._statStorage.provideSync(path, this._statSync); + } + + readdirSync(path) { + return this._readdirStorage.provideSync(path, this._readdirSync); + } + + readFileSync(path) { + return this._readFileStorage.provideSync(path, this._readFileSync); + } + + readJsonSync(path) { + return this._readJsonStorage.provideSync(path, this._readJsonSync); + } + + readlinkSync(path) { + return this._readlinkStorage.provideSync(path, this._readlinkSync); + } + + purge(what) { + this._statStorage.purge(what); + this._readdirStorage.purge(what); + this._readFileStorage.purge(what); + this._readlinkStorage.purge(what); + this._readJsonStorage.purge(what); + } +}; diff --git a/node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js b/node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js new file mode 100644 index 0000000..39a413d --- /dev/null +++ b/node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js @@ -0,0 +1,37 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const basename = require("./getPaths").basename; + +module.exports = class CloneBasenamePlugin { + constructor(source, target) { + this.source = source; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("CloneBasenamePlugin", (request, resolveContext, callback) => { + const filename = basename(request.path); + const filePath = resolver.join(request.path, filename); + const obj = Object.assign({}, request, { + path: filePath, + relativePath: + request.relativePath && + resolver.join(request.relativePath, filename) + }); + resolver.doResolve( + target, + obj, + "using path: " + filePath, + resolveContext, + callback + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/ConcordExtensionsPlugin.js b/node_modules/enhanced-resolve/lib/ConcordExtensionsPlugin.js new file mode 100644 index 0000000..f16ed99 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ConcordExtensionsPlugin.js @@ -0,0 +1,62 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const concord = require("./concord"); +const DescriptionFileUtils = require("./DescriptionFileUtils"); +const forEachBail = require("./forEachBail"); + +module.exports = class ConcordExtensionsPlugin { + constructor(source, options, target) { + this.source = source; + this.options = options; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync( + "ConcordExtensionsPlugin", + (request, resolveContext, callback) => { + const concordField = DescriptionFileUtils.getField( + request.descriptionFileData, + "concord" + ); + if (!concordField) return callback(); + const extensions = concord.getExtensions( + request.context, + concordField + ); + if (!extensions) return callback(); + forEachBail( + extensions, + (appending, callback) => { + const obj = Object.assign({}, request, { + path: request.path + appending, + relativePath: + request.relativePath && request.relativePath + appending + }); + resolver.doResolve( + target, + obj, + "concord extension: " + appending, + resolveContext, + callback + ); + }, + (err, result) => { + if (err) return callback(err); + + // Don't allow other processing + if (result === undefined) return callback(null, null); + callback(null, result); + } + ); + } + ); + } +}; diff --git a/node_modules/enhanced-resolve/lib/ConcordMainPlugin.js b/node_modules/enhanced-resolve/lib/ConcordMainPlugin.js new file mode 100644 index 0000000..921c7ac --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ConcordMainPlugin.js @@ -0,0 +1,44 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const path = require("path"); +const concord = require("./concord"); +const DescriptionFileUtils = require("./DescriptionFileUtils"); + +module.exports = class ConcordMainPlugin { + constructor(source, options, target) { + this.source = source; + this.options = options; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("ConcordMainPlugin", (request, resolveContext, callback) => { + if (request.path !== request.descriptionFileRoot) return callback(); + const concordField = DescriptionFileUtils.getField( + request.descriptionFileData, + "concord" + ); + if (!concordField) return callback(); + const mainModule = concord.getMain(request.context, concordField); + if (!mainModule) return callback(); + const obj = Object.assign({}, request, { + request: mainModule + }); + const filename = path.basename(request.descriptionFilePath); + return resolver.doResolve( + target, + obj, + "use " + mainModule + " from " + filename, + resolveContext, + callback + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/ConcordModulesPlugin.js b/node_modules/enhanced-resolve/lib/ConcordModulesPlugin.js new file mode 100644 index 0000000..87c9ace --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ConcordModulesPlugin.js @@ -0,0 +1,68 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const concord = require("./concord"); +const DescriptionFileUtils = require("./DescriptionFileUtils"); +const getInnerRequest = require("./getInnerRequest"); + +module.exports = class ConcordModulesPlugin { + constructor(source, options, target) { + this.source = source; + this.options = options; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("ConcordModulesPlugin", (request, resolveContext, callback) => { + const innerRequest = getInnerRequest(resolver, request); + if (!innerRequest) return callback(); + const concordField = DescriptionFileUtils.getField( + request.descriptionFileData, + "concord" + ); + if (!concordField) return callback(); + const data = concord.matchModule( + request.context, + concordField, + innerRequest + ); + if (data === innerRequest) return callback(); + if (data === undefined) return callback(); + if (data === false) { + const ignoreObj = Object.assign({}, request, { + path: false + }); + return callback(null, ignoreObj); + } + const obj = Object.assign({}, request, { + path: request.descriptionFileRoot, + request: data + }); + resolver.doResolve( + target, + obj, + "aliased from description file " + + request.descriptionFilePath + + " with mapping '" + + innerRequest + + "' to '" + + data + + "'", + resolveContext, + (err, result) => { + if (err) return callback(err); + + // Don't allow other aliasing or raw request + if (result === undefined) return callback(null, null); + callback(null, result); + } + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js b/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js new file mode 100644 index 0000000..3a7f802 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js @@ -0,0 +1,76 @@ +/* +MIT License http://www.opensource.org/licenses/mit-license.php +Author Tobias Koppers @sokra +*/ +"use strict"; + +const DescriptionFileUtils = require("./DescriptionFileUtils"); + +module.exports = class DescriptionFilePlugin { + constructor(source, filenames, target) { + this.source = source; + this.filenames = [].concat(filenames); + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync( + "DescriptionFilePlugin", + (request, resolveContext, callback) => { + const directory = request.path; + DescriptionFileUtils.loadDescriptionFile( + resolver, + directory, + this.filenames, + resolveContext, + (err, result) => { + if (err) return callback(err); + if (!result) { + if (resolveContext.missing) { + this.filenames.forEach(filename => { + resolveContext.missing.add( + resolver.join(directory, filename) + ); + }); + } + if (resolveContext.log) + resolveContext.log("No description file found"); + return callback(); + } + const relativePath = + "." + + request.path + .substr(result.directory.length) + .replace(/\\/g, "/"); + const obj = Object.assign({}, request, { + descriptionFilePath: result.path, + descriptionFileData: result.content, + descriptionFileRoot: result.directory, + relativePath: relativePath + }); + resolver.doResolve( + target, + obj, + "using description file: " + + result.path + + " (relative path: " + + relativePath + + ")", + resolveContext, + (err, result) => { + if (err) return callback(err); + + // Don't allow other processing + if (result === undefined) return callback(null, null); + callback(null, result); + } + ); + } + ); + } + ); + } +}; diff --git a/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js b/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js new file mode 100644 index 0000000..276704b --- /dev/null +++ b/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js @@ -0,0 +1,109 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const forEachBail = require("./forEachBail"); + +function loadDescriptionFile( + resolver, + directory, + filenames, + resolveContext, + callback +) { + (function findDescriptionFile() { + forEachBail( + filenames, + (filename, callback) => { + const descriptionFilePath = resolver.join(directory, filename); + if (resolver.fileSystem.readJson) { + resolver.fileSystem.readJson(descriptionFilePath, (err, content) => { + if (err) { + if (typeof err.code !== "undefined") return callback(); + return onJson(err); + } + onJson(null, content); + }); + } else { + resolver.fileSystem.readFile(descriptionFilePath, (err, content) => { + if (err) return callback(); + let json; + try { + json = JSON.parse(content); + } catch (e) { + onJson(e); + } + onJson(null, json); + }); + } + + function onJson(err, content) { + if (err) { + if (resolveContext.log) + resolveContext.log( + descriptionFilePath + " (directory description file): " + err + ); + else + err.message = + descriptionFilePath + " (directory description file): " + err; + return callback(err); + } + callback(null, { + content: content, + directory: directory, + path: descriptionFilePath + }); + } + }, + (err, result) => { + if (err) return callback(err); + if (result) { + return callback(null, result); + } else { + directory = cdUp(directory); + if (!directory) { + return callback(); + } else { + return findDescriptionFile(); + } + } + } + ); + })(); +} + +function getField(content, field) { + if (!content) return undefined; + if (Array.isArray(field)) { + let current = content; + for (let j = 0; j < field.length; j++) { + if (current === null || typeof current !== "object") { + current = null; + break; + } + current = current[field[j]]; + } + if (typeof current === "object") { + return current; + } + } else { + if (typeof content[field] === "object") { + return content[field]; + } + } +} + +function cdUp(directory) { + if (directory === "/") return null; + const i = directory.lastIndexOf("/"), + j = directory.lastIndexOf("\\"); + const p = i < 0 ? j : j < 0 ? i : i < j ? j : i; + if (p < 0) return null; + return directory.substr(0, p || 1); +} + +exports.loadDescriptionFile = loadDescriptionFile; +exports.getField = getField; +exports.cdUp = cdUp; diff --git a/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js b/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js new file mode 100644 index 0000000..628c274 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js @@ -0,0 +1,46 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = class DirectoryExistsPlugin { + constructor(source, target) { + this.source = source; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync( + "DirectoryExistsPlugin", + (request, resolveContext, callback) => { + const fs = resolver.fileSystem; + const directory = request.path; + fs.stat(directory, (err, stat) => { + if (err || !stat) { + if (resolveContext.missing) resolveContext.missing.add(directory); + if (resolveContext.log) + resolveContext.log(directory + " doesn't exist"); + return callback(); + } + if (!stat.isDirectory()) { + if (resolveContext.missing) resolveContext.missing.add(directory); + if (resolveContext.log) + resolveContext.log(directory + " is not a directory"); + return callback(); + } + resolver.doResolve( + target, + request, + "existing directory", + resolveContext, + callback + ); + }); + } + ); + } +}; diff --git a/node_modules/enhanced-resolve/lib/FileExistsPlugin.js b/node_modules/enhanced-resolve/lib/FileExistsPlugin.js new file mode 100644 index 0000000..a1d3362 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/FileExistsPlugin.js @@ -0,0 +1,41 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = class FileExistsPlugin { + constructor(source, target) { + this.source = source; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + const fs = resolver.fileSystem; + resolver + .getHook(this.source) + .tapAsync("FileExistsPlugin", (request, resolveContext, callback) => { + const file = request.path; + fs.stat(file, (err, stat) => { + if (err || !stat) { + if (resolveContext.missing) resolveContext.missing.add(file); + if (resolveContext.log) resolveContext.log(file + " doesn't exist"); + return callback(); + } + if (!stat.isFile()) { + if (resolveContext.missing) resolveContext.missing.add(file); + if (resolveContext.log) resolveContext.log(file + " is not a file"); + return callback(); + } + resolver.doResolve( + target, + request, + "existing file: " + file, + resolveContext, + callback + ); + }); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/FileKindPlugin.js b/node_modules/enhanced-resolve/lib/FileKindPlugin.js new file mode 100644 index 0000000..583f0c9 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/FileKindPlugin.js @@ -0,0 +1,24 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = class FileKindPlugin { + constructor(source, target) { + this.source = source; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("FileKindPlugin", (request, resolveContext, callback) => { + if (request.directory) return callback(); + const obj = Object.assign({}, request); + delete obj.directory; + resolver.doResolve(target, obj, null, resolveContext, callback); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/JoinRequestPlugin.js b/node_modules/enhanced-resolve/lib/JoinRequestPlugin.js new file mode 100644 index 0000000..6808f7c --- /dev/null +++ b/node_modules/enhanced-resolve/lib/JoinRequestPlugin.js @@ -0,0 +1,28 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = class JoinRequestPlugin { + constructor(source, target) { + this.source = source; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("JoinRequestPlugin", (request, resolveContext, callback) => { + const obj = Object.assign({}, request, { + path: resolver.join(request.path, request.request), + relativePath: + request.relativePath && + resolver.join(request.relativePath, request.request), + request: undefined + }); + resolver.doResolve(target, obj, null, resolveContext, callback); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/LogInfoPlugin.js b/node_modules/enhanced-resolve/lib/LogInfoPlugin.js new file mode 100644 index 0000000..784e85b --- /dev/null +++ b/node_modules/enhanced-resolve/lib/LogInfoPlugin.js @@ -0,0 +1,41 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = class LogInfoPlugin { + constructor(source) { + this.source = source; + } + + apply(resolver) { + const source = this.source; + resolver + .getHook(this.source) + .tapAsync("LogInfoPlugin", (request, resolveContext, callback) => { + if (!resolveContext.log) return callback(); + const log = resolveContext.log; + const prefix = "[" + source + "] "; + if (request.path) + log(prefix + "Resolving in directory: " + request.path); + if (request.request) + log(prefix + "Resolving request: " + request.request); + if (request.module) log(prefix + "Request is an module request."); + if (request.directory) log(prefix + "Request is a directory request."); + if (request.query) + log(prefix + "Resolving request query: " + request.query); + if (request.descriptionFilePath) + log( + prefix + "Has description data from " + request.descriptionFilePath + ); + if (request.relativePath) + log( + prefix + + "Relative path from description file is: " + + request.relativePath + ); + callback(); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/MainFieldPlugin.js b/node_modules/enhanced-resolve/lib/MainFieldPlugin.js new file mode 100644 index 0000000..66208fc --- /dev/null +++ b/node_modules/enhanced-resolve/lib/MainFieldPlugin.js @@ -0,0 +1,66 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const path = require("path"); + +module.exports = class MainFieldPlugin { + constructor(source, options, target) { + this.source = source; + this.options = options; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("MainFieldPlugin", (request, resolveContext, callback) => { + if (request.path !== request.descriptionFileRoot) return callback(); + if (request.alreadyTriedMainField === request.descriptionFilePath) + return callback(); + const content = request.descriptionFileData; + const filename = path.basename(request.descriptionFilePath); + let mainModule; + const field = this.options.name; + if (Array.isArray(field)) { + let current = content; + for (let j = 0; j < field.length; j++) { + if (current === null || typeof current !== "object") { + current = null; + break; + } + current = current[field[j]]; + } + if (typeof current === "string") { + mainModule = current; + } + } else { + if (typeof content[field] === "string") { + mainModule = content[field]; + } + } + if (!mainModule) return callback(); + if (this.options.forceRelative && !/^\.\.?\//.test(mainModule)) + mainModule = "./" + mainModule; + const obj = Object.assign({}, request, { + request: mainModule, + alreadyTriedMainField: request.descriptionFilePath + }); + return resolver.doResolve( + target, + obj, + "use " + + mainModule + + " from " + + this.options.name + + " in " + + filename, + resolveContext, + callback + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/ModuleAppendPlugin.js b/node_modules/enhanced-resolve/lib/ModuleAppendPlugin.js new file mode 100644 index 0000000..845bc81 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ModuleAppendPlugin.js @@ -0,0 +1,44 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = class ModuleAppendPlugin { + constructor(source, appending, target) { + this.source = source; + this.appending = appending; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("ModuleAppendPlugin", (request, resolveContext, callback) => { + const i = request.request.indexOf("/"), + j = request.request.indexOf("\\"); + const p = i < 0 ? j : j < 0 ? i : i < j ? i : j; + let moduleName, remainingRequest; + if (p < 0) { + moduleName = request.request; + remainingRequest = ""; + } else { + moduleName = request.request.substr(0, p); + remainingRequest = request.request.substr(p); + } + if (moduleName === "." || moduleName === "..") return callback(); + const moduleFinalName = moduleName + this.appending; + const obj = Object.assign({}, request, { + request: moduleFinalName + remainingRequest + }); + resolver.doResolve( + target, + obj, + "module variation " + moduleFinalName, + resolveContext, + callback + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/ModuleKindPlugin.js b/node_modules/enhanced-resolve/lib/ModuleKindPlugin.js new file mode 100644 index 0000000..b42d7fb --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ModuleKindPlugin.js @@ -0,0 +1,36 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = class ModuleKindPlugin { + constructor(source, target) { + this.source = source; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("ModuleKindPlugin", (request, resolveContext, callback) => { + if (!request.module) return callback(); + const obj = Object.assign({}, request); + delete obj.module; + resolver.doResolve( + target, + obj, + "resolve as module", + resolveContext, + (err, result) => { + if (err) return callback(err); + + // Don't allow other alternatives + if (result === undefined) return callback(null, null); + callback(null, result); + } + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js b/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js new file mode 100644 index 0000000..37b5731 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js @@ -0,0 +1,64 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const forEachBail = require("./forEachBail"); +const getPaths = require("./getPaths"); + +module.exports = class ModulesInHierachicDirectoriesPlugin { + constructor(source, directories, target) { + this.source = source; + this.directories = [].concat(directories); + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync( + "ModulesInHierachicDirectoriesPlugin", + (request, resolveContext, callback) => { + const fs = resolver.fileSystem; + const addrs = getPaths(request.path) + .paths.map(p => { + return this.directories.map(d => resolver.join(p, d)); + }) + .reduce((array, p) => { + array.push.apply(array, p); + return array; + }, []); + forEachBail( + addrs, + (addr, callback) => { + fs.stat(addr, (err, stat) => { + if (!err && stat && stat.isDirectory()) { + const obj = Object.assign({}, request, { + path: addr, + request: "./" + request.request + }); + const message = "looking for modules in " + addr; + return resolver.doResolve( + target, + obj, + message, + resolveContext, + callback + ); + } + if (resolveContext.log) + resolveContext.log( + addr + " doesn't exist or is not a directory" + ); + if (resolveContext.missing) resolveContext.missing.add(addr); + return callback(); + }); + }, + callback + ); + } + ); + } +}; diff --git a/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js b/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js new file mode 100644 index 0000000..315a9df --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js @@ -0,0 +1,32 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = class ModulesInRootPlugin { + constructor(source, path, target) { + this.source = source; + this.path = path; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("ModulesInRootPlugin", (request, resolveContext, callback) => { + const obj = Object.assign({}, request, { + path: this.path, + request: "./" + request.request + }); + resolver.doResolve( + target, + obj, + "looking for modules in " + this.path, + resolveContext, + callback + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/NextPlugin.js b/node_modules/enhanced-resolve/lib/NextPlugin.js new file mode 100644 index 0000000..9cd20d8 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/NextPlugin.js @@ -0,0 +1,21 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = class NextPlugin { + constructor(source, target) { + this.source = source; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("NextPlugin", (request, resolveContext, callback) => { + resolver.doResolve(target, request, null, resolveContext, callback); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/NodeJsInputFileSystem.js b/node_modules/enhanced-resolve/lib/NodeJsInputFileSystem.js new file mode 100644 index 0000000..6bfd4d0 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/NodeJsInputFileSystem.js @@ -0,0 +1,50 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const fs = require("graceful-fs"); + +class NodeJsInputFileSystem { + readdir(path, callback) { + fs.readdir(path, (err, files) => { + callback( + err, + files && + files.map(file => { + return file.normalize ? file.normalize("NFC") : file; + }) + ); + }); + } + + readdirSync(path) { + const files = fs.readdirSync(path); + return ( + files && + files.map(file => { + return file.normalize ? file.normalize("NFC") : file; + }) + ); + } +} + +const fsMethods = [ + "stat", + "statSync", + "readFile", + "readFileSync", + "readlink", + "readlinkSync" +]; + +for (const key of fsMethods) { + Object.defineProperty(NodeJsInputFileSystem.prototype, key, { + configurable: true, + writable: true, + value: fs[key].bind(fs) + }); +} + +module.exports = NodeJsInputFileSystem; diff --git a/node_modules/enhanced-resolve/lib/ParsePlugin.js b/node_modules/enhanced-resolve/lib/ParsePlugin.js new file mode 100644 index 0000000..efaefb3 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ParsePlugin.js @@ -0,0 +1,31 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = class ParsePlugin { + constructor(source, target) { + this.source = source; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("ParsePlugin", (request, resolveContext, callback) => { + const parsed = resolver.parse(request.request); + const obj = Object.assign({}, request, parsed); + if (request.query && !parsed.query) { + obj.query = request.query; + } + if (parsed && resolveContext.log) { + if (parsed.module) resolveContext.log("Parsed request is a module"); + if (parsed.directory) + resolveContext.log("Parsed request is a directory"); + } + resolver.doResolve(target, obj, null, resolveContext, callback); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/Resolver.js b/node_modules/enhanced-resolve/lib/Resolver.js new file mode 100644 index 0000000..442030d --- /dev/null +++ b/node_modules/enhanced-resolve/lib/Resolver.js @@ -0,0 +1,347 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const util = require("util"); + +const Tapable = require("tapable/lib/Tapable"); +const SyncHook = require("tapable/lib/SyncHook"); +const AsyncSeriesBailHook = require("tapable/lib/AsyncSeriesBailHook"); +const AsyncSeriesHook = require("tapable/lib/AsyncSeriesHook"); +const createInnerContext = require("./createInnerContext"); + +const REGEXP_NOT_MODULE = /^\.$|^\.[\\/]|^\.\.$|^\.\.[\\/]|^\/|^[A-Z]:[\\/]/i; +const REGEXP_DIRECTORY = /[\\/]$/i; + +const memoryFsJoin = require("memory-fs/lib/join"); +const memoizedJoin = new Map(); +const memoryFsNormalize = require("memory-fs/lib/normalize"); + +function withName(name, hook) { + hook.name = name; + return hook; +} + +function toCamelCase(str) { + return str.replace(/-([a-z])/g, str => str.substr(1).toUpperCase()); +} + +const deprecatedPushToMissing = util.deprecate((set, item) => { + set.add(item); +}, "Resolver: 'missing' is now a Set. Use add instead of push."); + +const deprecatedResolveContextInCallback = util.deprecate(x => { + return x; +}, "Resolver: The callback argument was splitted into resolveContext and callback."); + +const deprecatedHookAsString = util.deprecate(x => { + return x; +}, "Resolver#doResolve: The type arguments (string) is now a hook argument (Hook). Pass a reference to the hook instead."); + +class Resolver extends Tapable { + constructor(fileSystem) { + super(); + this.fileSystem = fileSystem; + this.hooks = { + resolveStep: withName("resolveStep", new SyncHook(["hook", "request"])), + noResolve: withName("noResolve", new SyncHook(["request", "error"])), + resolve: withName( + "resolve", + new AsyncSeriesBailHook(["request", "resolveContext"]) + ), + result: new AsyncSeriesHook(["result", "resolveContext"]) + }; + this._pluginCompat.tap("Resolver: before/after", options => { + if (/^before-/.test(options.name)) { + options.name = options.name.substr(7); + options.stage = -10; + } else if (/^after-/.test(options.name)) { + options.name = options.name.substr(6); + options.stage = 10; + } + }); + this._pluginCompat.tap("Resolver: step hooks", options => { + const name = options.name; + const stepHook = !/^resolve(-s|S)tep$|^no(-r|R)esolve$/.test(name); + if (stepHook) { + options.async = true; + this.ensureHook(name); + const fn = options.fn; + options.fn = (request, resolverContext, callback) => { + const innerCallback = (err, result) => { + if (err) return callback(err); + if (result !== undefined) return callback(null, result); + callback(); + }; + for (const key in resolverContext) { + innerCallback[key] = resolverContext[key]; + } + fn.call(this, request, innerCallback); + }; + } + }); + } + + ensureHook(name) { + if (typeof name !== "string") return name; + name = toCamelCase(name); + if (/^before/.test(name)) { + return this.ensureHook( + name[6].toLowerCase() + name.substr(7) + ).withOptions({ + stage: -10 + }); + } + if (/^after/.test(name)) { + return this.ensureHook( + name[5].toLowerCase() + name.substr(6) + ).withOptions({ + stage: 10 + }); + } + const hook = this.hooks[name]; + if (!hook) { + return (this.hooks[name] = withName( + name, + new AsyncSeriesBailHook(["request", "resolveContext"]) + )); + } + return hook; + } + + getHook(name) { + if (typeof name !== "string") return name; + name = toCamelCase(name); + if (/^before/.test(name)) { + return this.getHook(name[6].toLowerCase() + name.substr(7)).withOptions({ + stage: -10 + }); + } + if (/^after/.test(name)) { + return this.getHook(name[5].toLowerCase() + name.substr(6)).withOptions({ + stage: 10 + }); + } + const hook = this.hooks[name]; + if (!hook) { + throw new Error(`Hook ${name} doesn't exist`); + } + return hook; + } + + resolveSync(context, path, request) { + let err, + result, + sync = false; + this.resolve(context, path, request, {}, (e, r) => { + err = e; + result = r; + sync = true; + }); + if (!sync) + throw new Error( + "Cannot 'resolveSync' because the fileSystem is not sync. Use 'resolve'!" + ); + if (err) throw err; + return result; + } + + resolve(context, path, request, resolveContext, callback) { + // TODO remove in enhanced-resolve 5 + // For backward compatiblity START + if (typeof callback !== "function") { + callback = deprecatedResolveContextInCallback(resolveContext); + // resolveContext is a function containing additional properties + // It's now used for resolveContext and callback + } + // END + const obj = { + context: context, + path: path, + request: request + }; + + const message = "resolve '" + request + "' in '" + path + "'"; + + // Try to resolve assuming there is no error + // We don't log stuff in this case + return this.doResolve( + this.hooks.resolve, + obj, + message, + { + missing: resolveContext.missing, + stack: resolveContext.stack + }, + (err, result) => { + if (!err && result) { + return callback( + null, + result.path === false ? false : result.path + (result.query || ""), + result + ); + } + + const localMissing = new Set(); + // TODO remove in enhanced-resolve 5 + localMissing.push = item => deprecatedPushToMissing(localMissing, item); + const log = []; + + return this.doResolve( + this.hooks.resolve, + obj, + message, + { + log: msg => { + if (resolveContext.log) { + resolveContext.log(msg); + } + log.push(msg); + }, + missing: localMissing, + stack: resolveContext.stack + }, + (err, result) => { + if (err) return callback(err); + + const error = new Error("Can't " + message); + error.details = log.join("\n"); + error.missing = Array.from(localMissing); + this.hooks.noResolve.call(obj, error); + return callback(error); + } + ); + } + ); + } + + doResolve(hook, request, message, resolveContext, callback) { + // TODO remove in enhanced-resolve 5 + // For backward compatiblity START + if (typeof callback !== "function") { + callback = deprecatedResolveContextInCallback(resolveContext); + // resolveContext is a function containing additional properties + // It's now used for resolveContext and callback + } + if (typeof hook === "string") { + const name = toCamelCase(hook); + hook = deprecatedHookAsString(this.hooks[name]); + if (!hook) { + throw new Error(`Hook "${name}" doesn't exist`); + } + } + // END + if (typeof callback !== "function") + throw new Error("callback is not a function " + Array.from(arguments)); + if (!resolveContext) + throw new Error( + "resolveContext is not an object " + Array.from(arguments) + ); + + const stackLine = + hook.name + + ": (" + + request.path + + ") " + + (request.request || "") + + (request.query || "") + + (request.directory ? " directory" : "") + + (request.module ? " module" : ""); + + let newStack; + if (resolveContext.stack) { + newStack = new Set(resolveContext.stack); + if (resolveContext.stack.has(stackLine)) { + // Prevent recursion + const recursionError = new Error( + "Recursion in resolving\nStack:\n " + + Array.from(newStack).join("\n ") + ); + recursionError.recursion = true; + if (resolveContext.log) + resolveContext.log("abort resolving because of recursion"); + return callback(recursionError); + } + newStack.add(stackLine); + } else { + newStack = new Set([stackLine]); + } + this.hooks.resolveStep.call(hook, request); + + if (hook.isUsed()) { + const innerContext = createInnerContext( + { + log: resolveContext.log, + missing: resolveContext.missing, + stack: newStack + }, + message + ); + return hook.callAsync(request, innerContext, (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + callback(); + }); + } else { + callback(); + } + } + + parse(identifier) { + if (identifier === "") return null; + const part = { + request: "", + query: "", + module: false, + directory: false, + file: false + }; + const idxQuery = identifier.indexOf("?"); + if (idxQuery === 0) { + part.query = identifier; + } else if (idxQuery > 0) { + part.request = identifier.slice(0, idxQuery); + part.query = identifier.slice(idxQuery); + } else { + part.request = identifier; + } + if (part.request) { + part.module = this.isModule(part.request); + part.directory = this.isDirectory(part.request); + if (part.directory) { + part.request = part.request.substr(0, part.request.length - 1); + } + } + return part; + } + + isModule(path) { + return !REGEXP_NOT_MODULE.test(path); + } + + isDirectory(path) { + return REGEXP_DIRECTORY.test(path); + } + + join(path, request) { + let cacheEntry; + let pathCache = memoizedJoin.get(path); + if (typeof pathCache === "undefined") { + memoizedJoin.set(path, (pathCache = new Map())); + } else { + cacheEntry = pathCache.get(request); + if (typeof cacheEntry !== "undefined") return cacheEntry; + } + cacheEntry = memoryFsJoin(path, request); + pathCache.set(request, cacheEntry); + return cacheEntry; + } + + normalize(path) { + return memoryFsNormalize(path); + } +} + +module.exports = Resolver; diff --git a/node_modules/enhanced-resolve/lib/ResolverFactory.js b/node_modules/enhanced-resolve/lib/ResolverFactory.js new file mode 100644 index 0000000..508e2a8 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ResolverFactory.js @@ -0,0 +1,339 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const Resolver = require("./Resolver"); + +const SyncAsyncFileSystemDecorator = require("./SyncAsyncFileSystemDecorator"); + +const ParsePlugin = require("./ParsePlugin"); +const DescriptionFilePlugin = require("./DescriptionFilePlugin"); +const NextPlugin = require("./NextPlugin"); +const TryNextPlugin = require("./TryNextPlugin"); +const ModuleKindPlugin = require("./ModuleKindPlugin"); +const FileKindPlugin = require("./FileKindPlugin"); +const JoinRequestPlugin = require("./JoinRequestPlugin"); +const ModulesInHierachicDirectoriesPlugin = require("./ModulesInHierachicDirectoriesPlugin"); +const ModulesInRootPlugin = require("./ModulesInRootPlugin"); +const AliasPlugin = require("./AliasPlugin"); +const AliasFieldPlugin = require("./AliasFieldPlugin"); +const ConcordExtensionsPlugin = require("./ConcordExtensionsPlugin"); +const ConcordMainPlugin = require("./ConcordMainPlugin"); +const ConcordModulesPlugin = require("./ConcordModulesPlugin"); +const DirectoryExistsPlugin = require("./DirectoryExistsPlugin"); +const FileExistsPlugin = require("./FileExistsPlugin"); +const SymlinkPlugin = require("./SymlinkPlugin"); +const MainFieldPlugin = require("./MainFieldPlugin"); +const UseFilePlugin = require("./UseFilePlugin"); +const AppendPlugin = require("./AppendPlugin"); +const ResultPlugin = require("./ResultPlugin"); +const ModuleAppendPlugin = require("./ModuleAppendPlugin"); +const UnsafeCachePlugin = require("./UnsafeCachePlugin"); + +exports.createResolver = function(options) { + //// OPTIONS //// + + // A list of directories to resolve modules from, can be absolute path or folder name + let modules = options.modules || ["node_modules"]; + + // A list of description files to read from + const descriptionFiles = options.descriptionFiles || ["package.json"]; + + // A list of additional resolve plugins which should be applied + // The slice is there to create a copy, because otherwise pushing into plugins + // changes the original options.plugins array, causing duplicate plugins + const plugins = (options.plugins && options.plugins.slice()) || []; + + // A list of main fields in description files + let mainFields = options.mainFields || ["main"]; + + // A list of alias fields in description files + const aliasFields = options.aliasFields || []; + + // A list of main files in directories + const mainFiles = options.mainFiles || ["index"]; + + // A list of extensions which should be tried for files + let extensions = options.extensions || [".js", ".json", ".node"]; + + // Enforce that a extension from extensions must be used + const enforceExtension = options.enforceExtension || false; + + // A list of module extensions which should be tried for modules + let moduleExtensions = options.moduleExtensions || []; + + // Enforce that a extension from moduleExtensions must be used + const enforceModuleExtension = options.enforceModuleExtension || false; + + // A list of module alias configurations or an object which maps key to value + let alias = options.alias || []; + + // Resolve symlinks to their symlinked location + const symlinks = + typeof options.symlinks !== "undefined" ? options.symlinks : true; + + // Resolve to a context instead of a file + const resolveToContext = options.resolveToContext || false; + + // Use this cache object to unsafely cache the successful requests + let unsafeCache = options.unsafeCache || false; + + // Whether or not the unsafeCache should include request context as part of the cache key. + const cacheWithContext = + typeof options.cacheWithContext !== "undefined" + ? options.cacheWithContext + : true; + + // Enable concord description file instructions + const enableConcord = options.concord || false; + + // A function which decides whether a request should be cached or not. + // an object is passed with `path` and `request` properties. + const cachePredicate = + options.cachePredicate || + function() { + return true; + }; + + // The file system which should be used + const fileSystem = options.fileSystem; + + // Use only the sync constiants of the file system calls + const useSyncFileSystemCalls = options.useSyncFileSystemCalls; + + // A prepared Resolver to which the plugins are attached + let resolver = options.resolver; + + //// options processing //// + + if (!resolver) { + resolver = new Resolver( + useSyncFileSystemCalls + ? new SyncAsyncFileSystemDecorator(fileSystem) + : fileSystem + ); + } + + extensions = [].concat(extensions); + moduleExtensions = [].concat(moduleExtensions); + + modules = mergeFilteredToArray([].concat(modules), item => { + return !isAbsolutePath(item); + }); + + mainFields = mainFields.map(item => { + if (typeof item === "string" || Array.isArray(item)) { + item = { + name: item, + forceRelative: true + }; + } + return item; + }); + + if (typeof alias === "object" && !Array.isArray(alias)) { + alias = Object.keys(alias).map(key => { + let onlyModule = false; + let obj = alias[key]; + if (/\$$/.test(key)) { + onlyModule = true; + key = key.substr(0, key.length - 1); + } + if (typeof obj === "string") { + obj = { + alias: obj + }; + } + obj = Object.assign( + { + name: key, + onlyModule: onlyModule + }, + obj + ); + return obj; + }); + } + + if (unsafeCache && typeof unsafeCache !== "object") { + unsafeCache = {}; + } + + //// pipeline //// + + resolver.ensureHook("resolve"); + resolver.ensureHook("parsedResolve"); + resolver.ensureHook("describedResolve"); + resolver.ensureHook("rawModule"); + resolver.ensureHook("module"); + resolver.ensureHook("relative"); + resolver.ensureHook("describedRelative"); + resolver.ensureHook("directory"); + resolver.ensureHook("existingDirectory"); + resolver.ensureHook("undescribedRawFile"); + resolver.ensureHook("rawFile"); + resolver.ensureHook("file"); + resolver.ensureHook("existingFile"); + resolver.ensureHook("resolved"); + + // resolve + if (unsafeCache) { + plugins.push( + new UnsafeCachePlugin( + "resolve", + cachePredicate, + unsafeCache, + cacheWithContext, + "new-resolve" + ) + ); + plugins.push(new ParsePlugin("new-resolve", "parsed-resolve")); + } else { + plugins.push(new ParsePlugin("resolve", "parsed-resolve")); + } + + // parsed-resolve + plugins.push( + new DescriptionFilePlugin( + "parsed-resolve", + descriptionFiles, + "described-resolve" + ) + ); + plugins.push(new NextPlugin("after-parsed-resolve", "described-resolve")); + + // described-resolve + if (alias.length > 0) + plugins.push(new AliasPlugin("described-resolve", alias, "resolve")); + if (enableConcord) { + plugins.push(new ConcordModulesPlugin("described-resolve", {}, "resolve")); + } + aliasFields.forEach(item => { + plugins.push(new AliasFieldPlugin("described-resolve", item, "resolve")); + }); + plugins.push(new ModuleKindPlugin("after-described-resolve", "raw-module")); + plugins.push(new JoinRequestPlugin("after-described-resolve", "relative")); + + // raw-module + moduleExtensions.forEach(item => { + plugins.push(new ModuleAppendPlugin("raw-module", item, "module")); + }); + if (!enforceModuleExtension) + plugins.push(new TryNextPlugin("raw-module", null, "module")); + + // module + modules.forEach(item => { + if (Array.isArray(item)) + plugins.push( + new ModulesInHierachicDirectoriesPlugin("module", item, "resolve") + ); + else plugins.push(new ModulesInRootPlugin("module", item, "resolve")); + }); + + // relative + plugins.push( + new DescriptionFilePlugin( + "relative", + descriptionFiles, + "described-relative" + ) + ); + plugins.push(new NextPlugin("after-relative", "described-relative")); + + // described-relative + plugins.push(new FileKindPlugin("described-relative", "raw-file")); + plugins.push( + new TryNextPlugin("described-relative", "as directory", "directory") + ); + + // directory + plugins.push(new DirectoryExistsPlugin("directory", "existing-directory")); + + if (resolveToContext) { + // existing-directory + plugins.push(new NextPlugin("existing-directory", "resolved")); + } else { + // existing-directory + if (enableConcord) { + plugins.push(new ConcordMainPlugin("existing-directory", {}, "resolve")); + } + mainFields.forEach(item => { + plugins.push(new MainFieldPlugin("existing-directory", item, "resolve")); + }); + mainFiles.forEach(item => { + plugins.push( + new UseFilePlugin("existing-directory", item, "undescribed-raw-file") + ); + }); + + // undescribed-raw-file + plugins.push( + new DescriptionFilePlugin( + "undescribed-raw-file", + descriptionFiles, + "raw-file" + ) + ); + plugins.push(new NextPlugin("after-undescribed-raw-file", "raw-file")); + + // raw-file + if (!enforceExtension) { + plugins.push(new TryNextPlugin("raw-file", "no extension", "file")); + } + if (enableConcord) { + plugins.push(new ConcordExtensionsPlugin("raw-file", {}, "file")); + } + extensions.forEach(item => { + plugins.push(new AppendPlugin("raw-file", item, "file")); + }); + + // file + if (alias.length > 0) + plugins.push(new AliasPlugin("file", alias, "resolve")); + if (enableConcord) { + plugins.push(new ConcordModulesPlugin("file", {}, "resolve")); + } + aliasFields.forEach(item => { + plugins.push(new AliasFieldPlugin("file", item, "resolve")); + }); + if (symlinks) plugins.push(new SymlinkPlugin("file", "relative")); + plugins.push(new FileExistsPlugin("file", "existing-file")); + + // existing-file + plugins.push(new NextPlugin("existing-file", "resolved")); + } + + // resolved + plugins.push(new ResultPlugin(resolver.hooks.resolved)); + + //// RESOLVER //// + + plugins.forEach(plugin => { + plugin.apply(resolver); + }); + + return resolver; +}; + +function mergeFilteredToArray(array, filter) { + return array.reduce((array, item) => { + if (filter(item)) { + const lastElement = array[array.length - 1]; + if (Array.isArray(lastElement)) { + lastElement.push(item); + } else { + array.push([item]); + } + return array; + } else { + array.push(item); + return array; + } + }, []); +} + +function isAbsolutePath(path) { + return /^[A-Z]:|^\//.test(path); +} diff --git a/node_modules/enhanced-resolve/lib/ResultPlugin.js b/node_modules/enhanced-resolve/lib/ResultPlugin.js new file mode 100644 index 0000000..7ddd48c --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ResultPlugin.js @@ -0,0 +1,26 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = class ResultPlugin { + constructor(source) { + this.source = source; + } + + apply(resolver) { + this.source.tapAsync( + "ResultPlugin", + (request, resolverContext, callback) => { + const obj = Object.assign({}, request); + if (resolverContext.log) + resolverContext.log("reporting result " + obj.path); + resolver.hooks.result.callAsync(obj, resolverContext, err => { + if (err) return callback(err); + callback(null, obj); + }); + } + ); + } +}; diff --git a/node_modules/enhanced-resolve/lib/SymlinkPlugin.js b/node_modules/enhanced-resolve/lib/SymlinkPlugin.js new file mode 100644 index 0000000..cc22b2d --- /dev/null +++ b/node_modules/enhanced-resolve/lib/SymlinkPlugin.js @@ -0,0 +1,64 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const getPaths = require("./getPaths"); +const forEachBail = require("./forEachBail"); + +module.exports = class SymlinkPlugin { + constructor(source, target) { + this.source = source; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + const fs = resolver.fileSystem; + resolver + .getHook(this.source) + .tapAsync("SymlinkPlugin", (request, resolveContext, callback) => { + const pathsResult = getPaths(request.path); + const pathSeqments = pathsResult.seqments; + const paths = pathsResult.paths; + + let containsSymlink = false; + forEachBail.withIndex( + paths, + (path, idx, callback) => { + fs.readlink(path, (err, result) => { + if (!err && result) { + pathSeqments[idx] = result; + containsSymlink = true; + // Shortcut when absolute symlink found + if (/^(\/|[a-zA-Z]:($|\\))/.test(result)) + return callback(null, idx); + } + callback(); + }); + }, + (err, idx) => { + if (!containsSymlink) return callback(); + const resultSeqments = + typeof idx === "number" + ? pathSeqments.slice(0, idx + 1) + : pathSeqments.slice(); + const result = resultSeqments.reverse().reduce((a, b) => { + return resolver.join(a, b); + }); + const obj = Object.assign({}, request, { + path: result + }); + resolver.doResolve( + target, + obj, + "resolved symlink to " + result, + resolveContext, + callback + ); + } + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js b/node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js new file mode 100644 index 0000000..1c8320a --- /dev/null +++ b/node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js @@ -0,0 +1,65 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +function SyncAsyncFileSystemDecorator(fs) { + this.fs = fs; + if (fs.statSync) { + this.stat = function(arg, callback) { + let result; + try { + result = fs.statSync(arg); + } catch (e) { + return callback(e); + } + callback(null, result); + }; + } + if (fs.readdirSync) { + this.readdir = function(arg, callback) { + let result; + try { + result = fs.readdirSync(arg); + } catch (e) { + return callback(e); + } + callback(null, result); + }; + } + if (fs.readFileSync) { + this.readFile = function(arg, callback) { + let result; + try { + result = fs.readFileSync(arg); + } catch (e) { + return callback(e); + } + callback(null, result); + }; + } + if (fs.readlinkSync) { + this.readlink = function(arg, callback) { + let result; + try { + result = fs.readlinkSync(arg); + } catch (e) { + return callback(e); + } + callback(null, result); + }; + } + if (fs.readJsonSync) { + this.readJson = function(arg, callback) { + let result; + try { + result = fs.readJsonSync(arg); + } catch (e) { + return callback(e); + } + callback(null, result); + }; + } +} +module.exports = SyncAsyncFileSystemDecorator; diff --git a/node_modules/enhanced-resolve/lib/TryNextPlugin.js b/node_modules/enhanced-resolve/lib/TryNextPlugin.js new file mode 100644 index 0000000..d244bfb --- /dev/null +++ b/node_modules/enhanced-resolve/lib/TryNextPlugin.js @@ -0,0 +1,28 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = class TryNextPlugin { + constructor(source, message, target) { + this.source = source; + this.message = message; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("TryNextPlugin", (request, resolveContext, callback) => { + resolver.doResolve( + target, + request, + this.message, + resolveContext, + callback + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js b/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js new file mode 100644 index 0000000..e2c44d0 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js @@ -0,0 +1,49 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +function getCacheId(request, withContext) { + return JSON.stringify({ + context: withContext ? request.context : "", + path: request.path, + query: request.query, + request: request.request + }); +} + +module.exports = class UnsafeCachePlugin { + constructor(source, filterPredicate, cache, withContext, target) { + this.source = source; + this.filterPredicate = filterPredicate; + this.withContext = withContext; + this.cache = cache || {}; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("UnsafeCachePlugin", (request, resolveContext, callback) => { + if (!this.filterPredicate(request)) return callback(); + const cacheId = getCacheId(request, this.withContext); + const cacheEntry = this.cache[cacheId]; + if (cacheEntry) { + return callback(null, cacheEntry); + } + resolver.doResolve( + target, + request, + null, + resolveContext, + (err, result) => { + if (err) return callback(err); + if (result) return callback(null, (this.cache[cacheId] = result)); + callback(); + } + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/UseFilePlugin.js b/node_modules/enhanced-resolve/lib/UseFilePlugin.js new file mode 100644 index 0000000..3fd9c33 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/UseFilePlugin.js @@ -0,0 +1,35 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = class UseFilePlugin { + constructor(source, filename, target) { + this.source = source; + this.filename = filename; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("UseFilePlugin", (request, resolveContext, callback) => { + const filePath = resolver.join(request.path, this.filename); + const obj = Object.assign({}, request, { + path: filePath, + relativePath: + request.relativePath && + resolver.join(request.relativePath, this.filename) + }); + resolver.doResolve( + target, + obj, + "using path: " + filePath, + resolveContext, + callback + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/concord.js b/node_modules/enhanced-resolve/lib/concord.js new file mode 100644 index 0000000..8dab66e --- /dev/null +++ b/node_modules/enhanced-resolve/lib/concord.js @@ -0,0 +1,205 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const globToRegExp = require("./globToRegExp").globToRegExp; + +function parseType(type) { + const items = type.split("+"); + const t = items.shift(); + return { + type: t === "*" ? null : t, + features: items + }; +} + +function isTypeMatched(baseType, testedType) { + if (typeof baseType === "string") baseType = parseType(baseType); + if (typeof testedType === "string") testedType = parseType(testedType); + if (testedType.type && testedType.type !== baseType.type) return false; + return testedType.features.every(requiredFeature => { + return baseType.features.indexOf(requiredFeature) >= 0; + }); +} + +function isResourceTypeMatched(baseType, testedType) { + baseType = baseType.split("/"); + testedType = testedType.split("/"); + if (baseType.length !== testedType.length) return false; + for (let i = 0; i < baseType.length; i++) { + if (!isTypeMatched(baseType[i], testedType[i])) return false; + } + return true; +} + +function isResourceTypeSupported(context, type) { + return ( + context.supportedResourceTypes && + context.supportedResourceTypes.some(supportedType => { + return isResourceTypeMatched(supportedType, type); + }) + ); +} + +function isEnvironment(context, env) { + return ( + context.environments && + context.environments.every(environment => { + return isTypeMatched(environment, env); + }) + ); +} + +const globCache = {}; + +function getGlobRegExp(glob) { + const regExp = globCache[glob] || (globCache[glob] = globToRegExp(glob)); + return regExp; +} + +function matchGlob(glob, relativePath) { + const regExp = getGlobRegExp(glob); + return regExp.exec(relativePath); +} + +function isGlobMatched(glob, relativePath) { + return !!matchGlob(glob, relativePath); +} + +function isConditionMatched(context, condition) { + const items = condition.split("|"); + return items.some(function testFn(item) { + item = item.trim(); + const inverted = /^!/.test(item); + if (inverted) return !testFn(item.substr(1)); + if (/^[a-z]+:/.test(item)) { + // match named condition + const match = /^([a-z]+):\s*/.exec(item); + const value = item.substr(match[0].length); + const name = match[1]; + switch (name) { + case "referrer": + return isGlobMatched(value, context.referrer); + default: + return false; + } + } else if (item.indexOf("/") >= 0) { + // match supported type + return isResourceTypeSupported(context, item); + } else { + // match environment + return isEnvironment(context, item); + } + }); +} + +function isKeyMatched(context, key) { + for (;;) { + const match = /^\[([^\]]+)\]\s*/.exec(key); + if (!match) return key; + key = key.substr(match[0].length); + const condition = match[1]; + if (!isConditionMatched(context, condition)) { + return false; + } + } +} + +function getField(context, configuration, field) { + let value; + Object.keys(configuration).forEach(key => { + const pureKey = isKeyMatched(context, key); + if (pureKey === field) { + value = configuration[key]; + } + }); + return value; +} + +function getMain(context, configuration) { + return getField(context, configuration, "main"); +} + +function getExtensions(context, configuration) { + return getField(context, configuration, "extensions"); +} + +function matchModule(context, configuration, request) { + const modulesField = getField(context, configuration, "modules"); + if (!modulesField) return request; + let newRequest = request; + const keys = Object.keys(modulesField); + let iteration = 0; + let match; + let index; + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const pureKey = isKeyMatched(context, key); + match = matchGlob(pureKey, newRequest); + if (match) { + const value = modulesField[key]; + if (typeof value !== "string") { + return value; + } else if (/^\(.+\)$/.test(pureKey)) { + newRequest = newRequest.replace(getGlobRegExp(pureKey), value); + } else { + index = 1; + newRequest = value.replace(/(\/?\*)?\*/g, replaceMatcher); + } + i = -1; + if (iteration++ > keys.length) { + throw new Error("Request '" + request + "' matches recursively"); + } + } + } + return newRequest; + + function replaceMatcher(find) { + switch (find) { + case "/**": { + const m = match[index++]; + return m ? "/" + m : ""; + } + case "**": + case "*": + return match[index++]; + } + } +} + +function matchType(context, configuration, relativePath) { + const typesField = getField(context, configuration, "types"); + if (!typesField) return undefined; + let type; + Object.keys(typesField).forEach(key => { + const pureKey = isKeyMatched(context, key); + if (isGlobMatched(pureKey, relativePath)) { + const value = typesField[key]; + if (!type && /\/\*$/.test(value)) + throw new Error( + "value ('" + + value + + "') of key '" + + key + + "' contains '*', but there is no previous value defined" + ); + type = value.replace(/\/\*$/, "/" + type); + } + }); + return type; +} + +exports.parseType = parseType; +exports.isTypeMatched = isTypeMatched; +exports.isResourceTypeSupported = isResourceTypeSupported; +exports.isEnvironment = isEnvironment; +exports.isGlobMatched = isGlobMatched; +exports.isConditionMatched = isConditionMatched; +exports.isKeyMatched = isKeyMatched; +exports.getField = getField; +exports.getMain = getMain; +exports.getExtensions = getExtensions; +exports.matchModule = matchModule; +exports.matchType = matchType; diff --git a/node_modules/enhanced-resolve/lib/createInnerCallback.js b/node_modules/enhanced-resolve/lib/createInnerCallback.js new file mode 100644 index 0000000..fc6a64d --- /dev/null +++ b/node_modules/enhanced-resolve/lib/createInnerCallback.js @@ -0,0 +1,52 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const util = require("util"); + +// TODO remove in enhanced-resolve 5 +module.exports = util.deprecate(function createInnerCallback( + callback, + options, + message, + messageOptional +) { + const log = options.log; + if (!log) { + if (options.stack !== callback.stack) { + const callbackWrapper = function callbackWrapper() { + return callback.apply(this, arguments); + }; + callbackWrapper.stack = options.stack; + callbackWrapper.missing = options.missing; + return callbackWrapper; + } + return callback; + } + + function loggingCallbackWrapper() { + return callback.apply(this, arguments); + } + if (message) { + if (!messageOptional) { + log(message); + } + loggingCallbackWrapper.log = function writeLog(msg) { + if (messageOptional) { + log(message); + messageOptional = false; + } + log(" " + msg); + }; + } else { + loggingCallbackWrapper.log = function writeLog(msg) { + log(msg); + }; + } + loggingCallbackWrapper.stack = options.stack; + loggingCallbackWrapper.missing = options.missing; + return loggingCallbackWrapper; +}, +"Pass resolveContext instead and use createInnerContext"); diff --git a/node_modules/enhanced-resolve/lib/createInnerContext.js b/node_modules/enhanced-resolve/lib/createInnerContext.js new file mode 100644 index 0000000..758e1b4 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/createInnerContext.js @@ -0,0 +1,30 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = function createInnerContext( + options, + message, + messageOptional +) { + let messageReported = false; + const childContext = { + log: (() => { + if (!options.log) return undefined; + if (!message) return options.log; + const logFunction = msg => { + if (!messageReported) { + options.log(message); + messageReported = true; + } + options.log(" " + msg); + }; + return logFunction; + })(), + stack: options.stack, + missing: options.missing + }; + return childContext; +}; diff --git a/node_modules/enhanced-resolve/lib/forEachBail.js b/node_modules/enhanced-resolve/lib/forEachBail.js new file mode 100644 index 0000000..8834ea5 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/forEachBail.js @@ -0,0 +1,69 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = function forEachBail(array, iterator, callback) { + if (array.length === 0) return callback(); + let currentPos = array.length; + let currentResult; + let done = []; + for (let i = 0; i < array.length; i++) { + const itCb = createIteratorCallback(i); + iterator(array[i], itCb); + if (currentPos === 0) break; + } + + function createIteratorCallback(i) { + return (...args) => { + if (i >= currentPos) return; // ignore + done.push(i); + if (args.length > 0) { + currentPos = i + 1; + done = done.filter(item => { + return item <= i; + }); + currentResult = args; + } + if (done.length === currentPos) { + callback.apply(null, currentResult); + currentPos = 0; + } + }; + } +}; + +module.exports.withIndex = function forEachBailWithIndex( + array, + iterator, + callback +) { + if (array.length === 0) return callback(); + let currentPos = array.length; + let currentResult; + let done = []; + for (let i = 0; i < array.length; i++) { + const itCb = createIteratorCallback(i); + iterator(array[i], i, itCb); + if (currentPos === 0) break; + } + + function createIteratorCallback(i) { + return (...args) => { + if (i >= currentPos) return; // ignore + done.push(i); + if (args.length > 0) { + currentPos = i + 1; + done = done.filter(item => { + return item <= i; + }); + currentResult = args; + } + if (done.length === currentPos) { + callback.apply(null, currentResult); + currentPos = 0; + } + }; + } +}; diff --git a/node_modules/enhanced-resolve/lib/getInnerRequest.js b/node_modules/enhanced-resolve/lib/getInnerRequest.js new file mode 100644 index 0000000..8063a4a --- /dev/null +++ b/node_modules/enhanced-resolve/lib/getInnerRequest.js @@ -0,0 +1,26 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = function getInnerRequest(resolver, request) { + if ( + typeof request.__innerRequest === "string" && + request.__innerRequest_request === request.request && + request.__innerRequest_relativePath === request.relativePath + ) + return request.__innerRequest; + let innerRequest; + if (request.request) { + innerRequest = request.request; + if (/^\.\.?\//.test(innerRequest) && request.relativePath) { + innerRequest = resolver.join(request.relativePath, innerRequest); + } + } else { + innerRequest = request.relativePath; + } + request.__innerRequest_request = request.request; + request.__innerRequest_relativePath = request.relativePath; + return (request.__innerRequest = innerRequest); +}; diff --git a/node_modules/enhanced-resolve/lib/getPaths.js b/node_modules/enhanced-resolve/lib/getPaths.js new file mode 100644 index 0000000..4b1aa1c --- /dev/null +++ b/node_modules/enhanced-resolve/lib/getPaths.js @@ -0,0 +1,35 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = function getPaths(path) { + const parts = path.split(/(.*?[\\/]+)/); + const paths = [path]; + const seqments = [parts[parts.length - 1]]; + let part = parts[parts.length - 1]; + path = path.substr(0, path.length - part.length - 1); + for (let i = parts.length - 2; i > 2; i -= 2) { + paths.push(path); + part = parts[i]; + path = path.substr(0, path.length - part.length) || "/"; + seqments.push(part.substr(0, part.length - 1)); + } + part = parts[1]; + seqments.push(part); + paths.push(part); + return { + paths: paths, + seqments: seqments + }; +}; + +module.exports.basename = function basename(path) { + const i = path.lastIndexOf("/"), + j = path.lastIndexOf("\\"); + const p = i < 0 ? j : j < 0 ? i : i < j ? j : i; + if (p < 0) return null; + const s = path.substr(p + 1); + return s; +}; diff --git a/node_modules/enhanced-resolve/lib/globToRegExp.js b/node_modules/enhanced-resolve/lib/globToRegExp.js new file mode 100644 index 0000000..480b64c --- /dev/null +++ b/node_modules/enhanced-resolve/lib/globToRegExp.js @@ -0,0 +1,201 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +function globToRegExp(glob) { + // * [^\\\/]* + // /**/ /.+/ + // ^* \./.+ (concord special) + // ? [^\\\/] + // [!...] [^...] + // [^...] [^...] + // / [\\\/] + // {...,...} (...|...) + // ?(...|...) (...|...)? + // +(...|...) (...|...)+ + // *(...|...) (...|...)* + // @(...|...) (...|...) + if (/^\(.+\)$/.test(glob)) { + // allow to pass an RegExp in brackets + return new RegExp(glob.substr(1, glob.length - 2)); + } + const tokens = tokenize(glob); + const process = createRoot(); + const regExpStr = tokens.map(process).join(""); + return new RegExp("^" + regExpStr + "$"); +} + +const SIMPLE_TOKENS = { + "@(": "one", + "?(": "zero-one", + "+(": "one-many", + "*(": "zero-many", + "|": "segment-sep", + "/**/": "any-path-segments", + "**": "any-path", + "*": "any-path-segment", + "?": "any-char", + "{": "or", + "/": "path-sep", + ",": "comma", + ")": "closing-segment", + "}": "closing-or" +}; + +function tokenize(glob) { + return glob + .split( + /([@?+*]\(|\/\*\*\/|\*\*|[?*]|\[[!^]?(?:[^\]\\]|\\.)+\]|\{|,|\/|[|)}])/g + ) + .map(item => { + if (!item) return null; + const t = SIMPLE_TOKENS[item]; + if (t) { + return { + type: t + }; + } + if (item[0] === "[") { + if (item[1] === "^" || item[1] === "!") { + return { + type: "inverted-char-set", + value: item.substr(2, item.length - 3) + }; + } else { + return { + type: "char-set", + value: item.substr(1, item.length - 2) + }; + } + } + return { + type: "string", + value: item + }; + }) + .filter(Boolean) + .concat({ + type: "end" + }); +} + +function createRoot() { + const inOr = []; + const process = createSeqment(); + let initial = true; + return function(token) { + switch (token.type) { + case "or": + inOr.push(initial); + return "("; + case "comma": + if (inOr.length) { + initial = inOr[inOr.length - 1]; + return "|"; + } else { + return process( + { + type: "string", + value: "," + }, + initial + ); + } + case "closing-or": + if (inOr.length === 0) throw new Error("Unmatched '}'"); + inOr.pop(); + return ")"; + case "end": + if (inOr.length) throw new Error("Unmatched '{'"); + return process(token, initial); + default: { + const result = process(token, initial); + initial = false; + return result; + } + } + }; +} + +function createSeqment() { + const inSeqment = []; + const process = createSimple(); + return function(token, initial) { + switch (token.type) { + case "one": + case "one-many": + case "zero-many": + case "zero-one": + inSeqment.push(token.type); + return "("; + case "segment-sep": + if (inSeqment.length) { + return "|"; + } else { + return process( + { + type: "string", + value: "|" + }, + initial + ); + } + case "closing-segment": { + const segment = inSeqment.pop(); + switch (segment) { + case "one": + return ")"; + case "one-many": + return ")+"; + case "zero-many": + return ")*"; + case "zero-one": + return ")?"; + } + throw new Error("Unexcepted segment " + segment); + } + case "end": + if (inSeqment.length > 0) { + throw new Error("Unmatched segment, missing ')'"); + } + return process(token, initial); + default: + return process(token, initial); + } + }; +} + +function createSimple() { + return function(token, initial) { + switch (token.type) { + case "path-sep": + return "[\\\\/]+"; + case "any-path-segments": + return "[\\\\/]+(?:(.+)[\\\\/]+)?"; + case "any-path": + return "(.*)"; + case "any-path-segment": + if (initial) { + return "\\.[\\\\/]+(?:.*[\\\\/]+)?([^\\\\/]+)"; + } else { + return "([^\\\\/]*)"; + } + case "any-char": + return "[^\\\\/]"; + case "inverted-char-set": + return "[^" + token.value + "]"; + case "char-set": + return "[" + token.value + "]"; + case "string": + return token.value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + case "end": + return ""; + default: + throw new Error("Unsupported token '" + token.type + "'"); + } + }; +} + +exports.globToRegExp = globToRegExp; diff --git a/node_modules/enhanced-resolve/lib/node.js b/node_modules/enhanced-resolve/lib/node.js new file mode 100644 index 0000000..c824696 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/node.js @@ -0,0 +1,201 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const ResolverFactory = require("./ResolverFactory"); + +const NodeJsInputFileSystem = require("./NodeJsInputFileSystem"); +const CachedInputFileSystem = require("./CachedInputFileSystem"); + +const nodeFileSystem = new CachedInputFileSystem( + new NodeJsInputFileSystem(), + 4000 +); + +const nodeContext = { + environments: ["node+es3+es5+process+native"] +}; + +const asyncResolver = ResolverFactory.createResolver({ + extensions: [".js", ".json", ".node"], + fileSystem: nodeFileSystem +}); +module.exports = function resolve( + context, + path, + request, + resolveContext, + callback +) { + if (typeof context === "string") { + callback = resolveContext; + resolveContext = request; + request = path; + path = context; + context = nodeContext; + } + if (typeof callback !== "function") { + callback = resolveContext; + } + asyncResolver.resolve(context, path, request, resolveContext, callback); +}; + +const syncResolver = ResolverFactory.createResolver({ + extensions: [".js", ".json", ".node"], + useSyncFileSystemCalls: true, + fileSystem: nodeFileSystem +}); +module.exports.sync = function resolveSync(context, path, request) { + if (typeof context === "string") { + request = path; + path = context; + context = nodeContext; + } + return syncResolver.resolveSync(context, path, request); +}; + +const asyncContextResolver = ResolverFactory.createResolver({ + extensions: [".js", ".json", ".node"], + resolveToContext: true, + fileSystem: nodeFileSystem +}); +module.exports.context = function resolveContext( + context, + path, + request, + resolveContext, + callback +) { + if (typeof context === "string") { + callback = resolveContext; + resolveContext = request; + request = path; + path = context; + context = nodeContext; + } + if (typeof callback !== "function") { + callback = resolveContext; + } + asyncContextResolver.resolve( + context, + path, + request, + resolveContext, + callback + ); +}; + +const syncContextResolver = ResolverFactory.createResolver({ + extensions: [".js", ".json", ".node"], + resolveToContext: true, + useSyncFileSystemCalls: true, + fileSystem: nodeFileSystem +}); +module.exports.context.sync = function resolveContextSync( + context, + path, + request +) { + if (typeof context === "string") { + request = path; + path = context; + context = nodeContext; + } + return syncContextResolver.resolveSync(context, path, request); +}; + +const asyncLoaderResolver = ResolverFactory.createResolver({ + extensions: [".js", ".json", ".node"], + moduleExtensions: ["-loader"], + mainFields: ["loader", "main"], + fileSystem: nodeFileSystem +}); +module.exports.loader = function resolveLoader( + context, + path, + request, + resolveContext, + callback +) { + if (typeof context === "string") { + callback = resolveContext; + resolveContext = request; + request = path; + path = context; + context = nodeContext; + } + if (typeof callback !== "function") { + callback = resolveContext; + } + asyncLoaderResolver.resolve(context, path, request, resolveContext, callback); +}; + +const syncLoaderResolver = ResolverFactory.createResolver({ + extensions: [".js", ".json", ".node"], + moduleExtensions: ["-loader"], + mainFields: ["loader", "main"], + useSyncFileSystemCalls: true, + fileSystem: nodeFileSystem +}); +module.exports.loader.sync = function resolveLoaderSync( + context, + path, + request +) { + if (typeof context === "string") { + request = path; + path = context; + context = nodeContext; + } + return syncLoaderResolver.resolveSync(context, path, request); +}; + +module.exports.create = function create(options) { + options = Object.assign( + { + fileSystem: nodeFileSystem + }, + options + ); + const resolver = ResolverFactory.createResolver(options); + return function(context, path, request, resolveContext, callback) { + if (typeof context === "string") { + callback = resolveContext; + resolveContext = request; + request = path; + path = context; + context = nodeContext; + } + if (typeof callback !== "function") { + callback = resolveContext; + } + resolver.resolve(context, path, request, resolveContext, callback); + }; +}; + +module.exports.create.sync = function createSync(options) { + options = Object.assign( + { + useSyncFileSystemCalls: true, + fileSystem: nodeFileSystem + }, + options + ); + const resolver = ResolverFactory.createResolver(options); + return function(context, path, request) { + if (typeof context === "string") { + request = path; + path = context; + context = nodeContext; + } + return resolver.resolveSync(context, path, request); + }; +}; + +// Export Resolver, FileSystems and Plugins +module.exports.ResolverFactory = ResolverFactory; + +module.exports.NodeJsInputFileSystem = NodeJsInputFileSystem; +module.exports.CachedInputFileSystem = CachedInputFileSystem; diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/LICENSE b/node_modules/enhanced-resolve/node_modules/memory-fs/LICENSE new file mode 100644 index 0000000..8c11fc7 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/LICENSE @@ -0,0 +1,20 @@ +Copyright JS Foundation and other contributors + +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. diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/README.md b/node_modules/enhanced-resolve/node_modules/memory-fs/README.md new file mode 100644 index 0000000..62cd776 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/README.md @@ -0,0 +1,29 @@ +# memory-fs + +A simple in-memory filesystem. Holds data in a javascript object. + +``` javascript +var MemoryFileSystem = require("memory-fs"); +var fs = new MemoryFileSystem(); // Optionally pass a javascript object + +fs.mkdirpSync("/a/test/dir"); +fs.writeFileSync("/a/test/dir/file.txt", "Hello World"); +fs.readFileSync("/a/test/dir/file.txt"); // returns Buffer("Hello World") + +// Async variants too +fs.unlink("/a/test/dir/file.txt", function(err) { + // ... +}); + +fs.readdirSync("/a/test"); // returns ["dir"] +fs.statSync("/a/test/dir").isDirectory(); // returns true +fs.rmdirSync("/a/test/dir"); + +fs.mkdirpSync("C:\\use\\windows\\style\\paths"); +``` + +## License + +Copyright (c) 2012-2014 Tobias Koppers + +MIT (http://www.opensource.org/licenses/mit-license.php) diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/lib/MemoryFileSystem.js b/node_modules/enhanced-resolve/node_modules/memory-fs/lib/MemoryFileSystem.js new file mode 100644 index 0000000..1d9d3d2 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/lib/MemoryFileSystem.js @@ -0,0 +1,335 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const normalize = require("./normalize"); +const join = require("./join"); +const MemoryFileSystemError = require("./MemoryFileSystemError"); +const errors = require("errno"); +const stream = require("readable-stream"); + +const ReadableStream = stream.Readable; +const WritableStream = stream.Writable; + +function isDir(item) { + if(typeof item !== "object") return false; + return item[""] === true; +} + +function isFile(item) { + if(typeof item !== "object") return false; + return !item[""]; +} + +function pathToArray(path) { + path = normalize(path); + const nix = /^\//.test(path); + if(!nix) { + if(!/^[A-Za-z]:/.test(path)) { + throw new MemoryFileSystemError(errors.code.EINVAL, path); + } + path = path.replace(/[\\\/]+/g, "\\"); // multi slashs + path = path.split(/[\\\/]/); + path[0] = path[0].toUpperCase(); + } else { + path = path.replace(/\/+/g, "/"); // multi slashs + path = path.substr(1).split("/"); + } + if(!path[path.length-1]) path.pop(); + return path; +} + +function trueFn() { return true; } +function falseFn() { return false; } + +class MemoryFileSystem { + constructor(data) { + this.data = data || {}; + this.join = join; + this.pathToArray = pathToArray; + this.normalize = normalize; + } + + meta(_path) { + const path = pathToArray(_path); + let current = this.data; + let i = 0; + for(; i < path.length - 1; i++) { + if(!isDir(current[path[i]])) + return; + current = current[path[i]]; + } + return current[path[i]]; + } + + existsSync(_path) { + return !!this.meta(_path); + } + + statSync(_path) { + let current = this.meta(_path); + if(_path === "/" || isDir(current)) { + return { + isFile: falseFn, + isDirectory: trueFn, + isBlockDevice: falseFn, + isCharacterDevice: falseFn, + isSymbolicLink: falseFn, + isFIFO: falseFn, + isSocket: falseFn + }; + } else if(isFile(current)) { + return { + isFile: trueFn, + isDirectory: falseFn, + isBlockDevice: falseFn, + isCharacterDevice: falseFn, + isSymbolicLink: falseFn, + isFIFO: falseFn, + isSocket: falseFn + }; + } else { + throw new MemoryFileSystemError(errors.code.ENOENT, _path, "stat"); + } + } + + readFileSync(_path, optionsOrEncoding) { + const path = pathToArray(_path); + let current = this.data; + let i = 0 + for(; i < path.length - 1; i++) { + if(!isDir(current[path[i]])) + throw new MemoryFileSystemError(errors.code.ENOENT, _path, "readFile"); + current = current[path[i]]; + } + if(!isFile(current[path[i]])) { + if(isDir(current[path[i]])) + throw new MemoryFileSystemError(errors.code.EISDIR, _path, "readFile"); + else + throw new MemoryFileSystemError(errors.code.ENOENT, _path, "readFile"); + } + current = current[path[i]]; + const encoding = typeof optionsOrEncoding === "object" ? optionsOrEncoding.encoding : optionsOrEncoding; + return encoding ? current.toString(encoding) : current; + } + + readdirSync(_path) { + if(_path === "/") return Object.keys(this.data).filter(Boolean); + const path = pathToArray(_path); + let current = this.data; + let i = 0; + for(; i < path.length - 1; i++) { + if(!isDir(current[path[i]])) + throw new MemoryFileSystemError(errors.code.ENOENT, _path, "readdir"); + current = current[path[i]]; + } + if(!isDir(current[path[i]])) { + if(isFile(current[path[i]])) + throw new MemoryFileSystemError(errors.code.ENOTDIR, _path, "readdir"); + else + throw new MemoryFileSystemError(errors.code.ENOENT, _path, "readdir"); + } + return Object.keys(current[path[i]]).filter(Boolean); + } + + mkdirpSync(_path) { + const path = pathToArray(_path); + if(path.length === 0) return; + let current = this.data; + for(let i = 0; i < path.length; i++) { + if(isFile(current[path[i]])) + throw new MemoryFileSystemError(errors.code.ENOTDIR, _path, "mkdirp"); + else if(!isDir(current[path[i]])) + current[path[i]] = {"":true}; + current = current[path[i]]; + } + return; + } + + mkdirSync(_path) { + const path = pathToArray(_path); + if(path.length === 0) return; + let current = this.data; + let i = 0; + for(; i < path.length - 1; i++) { + if(!isDir(current[path[i]])) + throw new MemoryFileSystemError(errors.code.ENOENT, _path, "mkdir"); + current = current[path[i]]; + } + if(isDir(current[path[i]])) + throw new MemoryFileSystemError(errors.code.EEXIST, _path, "mkdir"); + else if(isFile(current[path[i]])) + throw new MemoryFileSystemError(errors.code.ENOTDIR, _path, "mkdir"); + current[path[i]] = {"":true}; + return; + } + + _remove(_path, name, testFn) { + const path = pathToArray(_path); + const operation = name === "File" ? "unlink" : "rmdir"; + if(path.length === 0) { + throw new MemoryFileSystemError(errors.code.EPERM, _path, operation); + } + let current = this.data; + let i = 0; + for(; i < path.length - 1; i++) { + if(!isDir(current[path[i]])) + throw new MemoryFileSystemError(errors.code.ENOENT, _path, operation); + current = current[path[i]]; + } + if(!testFn(current[path[i]])) + throw new MemoryFileSystemError(errors.code.ENOENT, _path, operation); + delete current[path[i]]; + return; + } + + rmdirSync(_path) { + return this._remove(_path, "Directory", isDir); + } + + unlinkSync(_path) { + return this._remove(_path, "File", isFile); + } + + readlinkSync(_path) { + throw new MemoryFileSystemError(errors.code.ENOSYS, _path, "readlink"); + } + + writeFileSync(_path, content, optionsOrEncoding) { + if(!content && !optionsOrEncoding) throw new Error("No content"); + const path = pathToArray(_path); + if(path.length === 0) { + throw new MemoryFileSystemError(errors.code.EISDIR, _path, "writeFile"); + } + let current = this.data; + let i = 0 + for(; i < path.length - 1; i++) { + if(!isDir(current[path[i]])) + throw new MemoryFileSystemError(errors.code.ENOENT, _path, "writeFile"); + current = current[path[i]]; + } + if(isDir(current[path[i]])) + throw new MemoryFileSystemError(errors.code.EISDIR, _path, "writeFile"); + const encoding = typeof optionsOrEncoding === "object" ? optionsOrEncoding.encoding : optionsOrEncoding; + current[path[i]] = optionsOrEncoding || typeof content === "string" ? new Buffer(content, encoding) : content; + return; + } + + // stream methods + createReadStream(path, options) { + let stream = new ReadableStream(); + let done = false; + let data; + try { + data = this.readFileSync(path); + } catch (e) { + stream._read = function() { + if (done) { + return; + } + done = true; + this.emit('error', e); + this.push(null); + }; + return stream; + } + options = options || { }; + options.start = options.start || 0; + options.end = options.end || data.length; + stream._read = function() { + if (done) { + return; + } + done = true; + this.push(data.slice(options.start, options.end)); + this.push(null); + }; + return stream; + } + + createWriteStream(path) { + let stream = new WritableStream(); + try { + // Zero the file and make sure it is writable + this.writeFileSync(path, new Buffer(0)); + } catch(e) { + // This or setImmediate? + stream.once('prefinish', function() { + stream.emit('error', e); + }); + return stream; + } + let bl = [ ], len = 0; + stream._write = (chunk, encoding, callback) => { + bl.push(chunk); + len += chunk.length; + this.writeFile(path, Buffer.concat(bl, len), callback); + } + return stream; + } + + // async functions + exists(path, callback) { + return callback(this.existsSync(path)); + } + + writeFile(path, content, encoding, callback) { + if(!callback) { + callback = encoding; + encoding = undefined; + } + try { + this.writeFileSync(path, content, encoding); + } catch(e) { + return callback(e); + } + return callback(); + } +} + +// async functions + +["stat", "readdir", "mkdirp", "rmdir", "unlink", "readlink"].forEach(function(fn) { + MemoryFileSystem.prototype[fn] = function(path, callback) { + let result; + try { + result = this[fn + "Sync"](path); + } catch(e) { + setImmediate(function() { + callback(e); + }); + + return; + } + setImmediate(function() { + callback(null, result); + }); + }; +}); + +["mkdir", "readFile"].forEach(function(fn) { + MemoryFileSystem.prototype[fn] = function(path, optArg, callback) { + if(!callback) { + callback = optArg; + optArg = undefined; + } + let result; + try { + result = this[fn + "Sync"](path, optArg); + } catch(e) { + setImmediate(function() { + callback(e); + }); + + return; + } + setImmediate(function() { + callback(null, result); + }); + }; +}); + +module.exports = MemoryFileSystem; diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/lib/MemoryFileSystemError.js b/node_modules/enhanced-resolve/node_modules/memory-fs/lib/MemoryFileSystemError.js new file mode 100644 index 0000000..e2d7962 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/lib/MemoryFileSystemError.js @@ -0,0 +1,31 @@ + +"use strict"; + +class MemoryFileSystemError extends Error { + constructor(err, path, operation) { + super(err, path); + + // Set `name` and `message` before call `Error.captureStackTrace` \ + // so that we will obtain the correct 1st line of stack, like: + // [Error]: [Message] + this.name = this.constructor.name; + var message = [`${err.code}:`, `${err.description},`]; + // Add operation name and path into message, similar to node `fs` style. + if(operation) { + message.push(operation); + } + message.push(`\'${path}\'`); + this.message = message.join(' '); + + this.code = err.code; + this.errno = err.errno; + this.path = path; + this.operation = operation; + + if(Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + } +} + +module.exports = MemoryFileSystemError; diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/lib/join.js b/node_modules/enhanced-resolve/node_modules/memory-fs/lib/join.js new file mode 100644 index 0000000..962c0ae --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/lib/join.js @@ -0,0 +1,16 @@ +"use strict"; + +const normalize = require("./normalize"); + +const absoluteWinRegExp = /^[A-Z]:([\\\/]|$)/i; +const absoluteNixRegExp = /^\//i; + +module.exports = function join(path, request) { + if(!request) return normalize(path); + if(absoluteWinRegExp.test(request)) return normalize(request.replace(/\//g, "\\")); + if(absoluteNixRegExp.test(request)) return normalize(request); + if(path == "/") return normalize(path + request); + if(absoluteWinRegExp.test(path)) return normalize(path.replace(/\//g, "\\") + "\\" + request.replace(/\//g, "\\")); + if(absoluteNixRegExp.test(path)) return normalize(path + "/" + request); + return normalize(path + "/" + request); +}; diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/lib/normalize.js b/node_modules/enhanced-resolve/node_modules/memory-fs/lib/normalize.js new file mode 100644 index 0000000..a0307bc --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/lib/normalize.js @@ -0,0 +1,99 @@ +"use strict"; + +// eslint-disable-next-line complexity +module.exports = function normalize(path) { + var parts = path.split(/(\\+|\/+)/); + if(parts.length === 1) + return path; + var result = []; + var absolutePathStart = 0; + for(var i = 0, sep = false; i < parts.length; i += 1, sep = !sep) { + var part = parts[i]; + if(i === 0 && /^([A-Z]:)?$/i.test(part)) { + result.push(part); + absolutePathStart = 2; + } else if(sep) { + // UNC paths on Windows begin with a double backslash. + if (i === 1 && parts[0].length === 0 && part === "\\\\") { + result.push(part); + } else { + result.push(part[0]); + } + } else if(part === "..") { + switch(result.length) { + case 0: + // i. e. ".." => ".." + // i. e. "../a/b/c" => "../a/b/c" + result.push(part); + break; + case 2: + // i. e. "a/.." => "" + // i. e. "/.." => "/" + // i. e. "C:\.." => "C:\" + // i. e. "a/../b/c" => "b/c" + // i. e. "/../b/c" => "/b/c" + // i. e. "C:\..\a\b\c" => "C:\a\b\c" + if (result[0] !== ".") { + i += 1; + sep = !sep; + result.length = absolutePathStart; + } else { + result.length = 0; + result.push(part); + } + break; + case 4: + // i. e. "a/b/.." => "a" + // i. e. "/a/.." => "/" + // i. e. "C:\a\.." => "C:\" + // i. e. "/a/../b/c" => "/b/c" + if(absolutePathStart === 0) { + result.length -= 3; + } else { + i += 1; + sep = !sep; + result.length = 2; + } + break; + default: + // i. e. "/a/b/.." => "/a" + // i. e. "/a/b/../c" => "/a/c" + result.length -= 3; + break; + } + } else if(part === ".") { + switch(result.length) { + case 0: + // i. e. "." => "." + // i. e. "./a/b/c" => "./a/b/c" + result.push(part); + break; + case 2: + // i. e. "a/." => "a" + // i. e. "/." => "/" + // i. e. "C:\." => "C:\" + // i. e. "C:\.\a\b\c" => "C:\a\b\c" + if(absolutePathStart === 0) { + result.length -= 1; + } else { + i += 1; + sep = !sep; + } + break; + default: + // i. e. "a/b/." => "a/b" + // i. e. "/a/." => "/" + // i. e. "C:\a\." => "C:\" + // i. e. "a/./b/c" => "a/b/c" + // i. e. "/a/./b/c" => "/a/b/c" + result.length -= 1; + break; + } + } else if(part) { + result.push(part); + } + } + if(result.length === 1 && /^[A-Za-z]:$/.test(result[0])) + return result[0] + "\\"; + return result.join(""); +}; diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/package.json b/node_modules/enhanced-resolve/node_modules/memory-fs/package.json new file mode 100644 index 0000000..4806b47 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/package.json @@ -0,0 +1,75 @@ +{ + "_from": "memory-fs@^0.5.0", + "_id": "memory-fs@0.5.0", + "_inBundle": false, + "_integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", + "_location": "/enhanced-resolve/memory-fs", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "memory-fs@^0.5.0", + "name": "memory-fs", + "escapedName": "memory-fs", + "rawSpec": "^0.5.0", + "saveSpec": null, + "fetchSpec": "^0.5.0" + }, + "_requiredBy": [ + "/enhanced-resolve" + ], + "_resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", + "_shasum": "324c01288b88652966d161db77838720845a8e3c", + "_spec": "memory-fs@^0.5.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/enhanced-resolve", + "author": { + "name": "Tobias Koppers @sokra" + }, + "bugs": { + "url": "https://github.com/webpack/memory-fs/issues" + }, + "bundleDependencies": false, + "dependencies": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + }, + "deprecated": false, + "description": "A simple in-memory filesystem. Holds data in a javascript object.", + "devDependencies": { + "bl": "^1.0.0", + "codecov.io": "^0.1.4", + "coveralls": "^2.11.2", + "eslint": "^4.0.0", + "istanbul": "0.4.5", + "mocha": "3.2.0", + "should": "^4.0.4" + }, + "directories": { + "test": "test" + }, + "engines": { + "node": ">=4.3.0 <5.0.0 || >=5.10" + }, + "files": [ + "lib/" + ], + "homepage": "https://github.com/webpack/memory-fs", + "keywords": [ + "fs", + "memory" + ], + "license": "MIT", + "main": "lib/MemoryFileSystem.js", + "name": "memory-fs", + "repository": { + "type": "git", + "url": "git+https://github.com/webpack/memory-fs.git" + }, + "scripts": { + "cover": "istanbul cover node_modules/mocha/bin/_mocha", + "lint": "eslint lib/*", + "test": "mocha", + "travis": "npm run cover -- --report lcovonly && npm run lint" + }, + "version": "0.5.0" +} diff --git a/node_modules/enhanced-resolve/package.json b/node_modules/enhanced-resolve/package.json new file mode 100644 index 0000000..358d594 --- /dev/null +++ b/node_modules/enhanced-resolve/package.json @@ -0,0 +1,96 @@ +{ + "_from": "enhanced-resolve@^4.1.0", + "_id": "enhanced-resolve@4.1.1", + "_inBundle": false, + "_integrity": "sha512-98p2zE+rL7/g/DzMHMTF4zZlCgeVdJ7yr6xzEpJRYwFYrGi9ANdn5DnJURg6RpBkyk60XYDnWIv51VfIhfNGuA==", + "_location": "/enhanced-resolve", + "_phantomChildren": { + "errno": "0.1.7", + "readable-stream": "2.3.7" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "enhanced-resolve@^4.1.0", + "name": "enhanced-resolve", + "escapedName": "enhanced-resolve", + "rawSpec": "^4.1.0", + "saveSpec": null, + "fetchSpec": "^4.1.0" + }, + "_requiredBy": [ + "/webpack" + ], + "_resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.1.tgz", + "_shasum": "2937e2b8066cd0fe7ce0990a98f0d71a35189f66", + "_spec": "enhanced-resolve@^4.1.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/webpack", + "author": { + "name": "Tobias Koppers @sokra" + }, + "bugs": { + "url": "https://github.com/webpack/enhanced-resolve/issues" + }, + "bundleDependencies": false, + "dependencies": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.5.0", + "tapable": "^1.0.0" + }, + "deprecated": false, + "description": "Offers a async require.resolve function. It's highly configurable.", + "devDependencies": { + "codecov.io": "^0.1.6", + "coveralls": "^2.11.6", + "eslint": "^5.9.0", + "eslint-config-prettier": "^3.3.0", + "eslint-plugin-node": "^8.0.0", + "eslint-plugin-prettier": "^3.0.0", + "husky": "^1.2.0", + "istanbul": "^0.4.1", + "lint-staged": "^8.1.0", + "mocha": "^2.3.4", + "prettier": "^1.15.2", + "should": "^8.0.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "files": [ + "lib", + "LICENSE" + ], + "homepage": "http://github.com/webpack/enhanced-resolve", + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "licenses": [ + { + "type": "MIT", + "url": "http://www.opensource.org/licenses/mit-license.php" + } + ], + "lint-staged": { + "*.js": [ + "eslint --cache" + ] + }, + "main": "lib/node.js", + "name": "enhanced-resolve", + "repository": { + "type": "git", + "url": "git://github.com/webpack/enhanced-resolve.git" + }, + "scripts": { + "cover": "istanbul cover node_modules/mocha/bin/_mocha", + "lint": "eslint lib test", + "precover": "yarn lint", + "pretest": "yarn lint", + "pretty": "prettier --loglevel warn --write \"{lib,test}/**/*.{js,json}\"", + "test": "mocha --full-trace --check-leaks", + "travis": "yarn cover --report lcovonly" + }, + "version": "4.1.1" +} diff --git a/node_modules/errno/.jshintrc b/node_modules/errno/.jshintrc new file mode 100644 index 0000000..c8ef3ca --- /dev/null +++ b/node_modules/errno/.jshintrc @@ -0,0 +1,59 @@ +{ + "predef": [ ] + , "bitwise": false + , "camelcase": false + , "curly": false + , "eqeqeq": false + , "forin": false + , "immed": false + , "latedef": false + , "noarg": true + , "noempty": true + , "nonew": true + , "plusplus": false + , "quotmark": true + , "regexp": false + , "undef": true + , "unused": true + , "strict": false + , "trailing": true + , "maxlen": 120 + , "asi": true + , "boss": true + , "debug": true + , "eqnull": true + , "esnext": true + , "evil": true + , "expr": true + , "funcscope": false + , "globalstrict": false + , "iterator": false + , "lastsemic": true + , "laxbreak": true + , "laxcomma": true + , "loopfunc": true + , "multistr": false + , "onecase": false + , "proto": false + , "regexdash": false + , "scripturl": true + , "smarttabs": false + , "shadow": false + , "sub": true + , "supernew": false + , "validthis": true + , "browser": true + , "couch": false + , "devel": false + , "dojo": false + , "mootools": false + , "node": true + , "nonstandard": true + , "prototypejs": false + , "rhino": false + , "worker": true + , "wsh": false + , "nomen": false + , "onevar": false + , "passfail": false +} \ No newline at end of file diff --git a/node_modules/errno/.travis.yml b/node_modules/errno/.travis.yml new file mode 100644 index 0000000..f996821 --- /dev/null +++ b/node_modules/errno/.travis.yml @@ -0,0 +1,11 @@ +sudo: false + +language: node_js + +node_js: + - 9 + - 8 + - 7 + - 6 + - 5 + - 4 diff --git a/node_modules/errno/README.md b/node_modules/errno/README.md new file mode 100644 index 0000000..a4d0fb5 --- /dev/null +++ b/node_modules/errno/README.md @@ -0,0 +1,145 @@ +# node-errno + +> Better [libuv](https://github.com/libuv/libuv)/[Node.js](https://nodejs.org)/[io.js](https://iojs.org) error handling & reporting. Available in npm as *errno*. + +[![npm](https://img.shields.io/npm/v/errno.svg)](https://www.npmjs.com/package/errno) +[![Build Status](https://secure.travis-ci.org/rvagg/node-errno.png)](http://travis-ci.org/rvagg/node-errno) +[![npm](https://img.shields.io/npm/dm/errno.svg)](https://www.npmjs.com/package/errno) + +* [errno exposed](#errnoexposed) +* [Custom errors](#customerrors) + + +## errno exposed + +Ever find yourself needing more details about Node.js errors? Me too, so *node-errno* contains the errno mappings direct from libuv so you can use them in your code. + +**By errno:** + +```js +require('errno').errno[3] +// → { +// "errno": 3, +// "code": "EACCES", +// "description": "permission denied" +// } +``` + +**By code:** + +```js +require('errno').code.ENOTEMPTY +// → { +// "errno": 53, +// "code": "ENOTEMPTY", +// "description": "directory not empty" +// } +``` + +**Make your errors more descriptive:** + +```js +var errno = require('errno') + +function errmsg(err) { + var str = 'Error: ' + // if it's a libuv error then get the description from errno + if (errno.errno[err.errno]) + str += errno.errno[err.errno].description + else + str += err.message + + // if it's a `fs` error then it'll have a 'path' property + if (err.path) + str += ' [' + err.path + ']' + + return str +} + +var fs = require('fs') + +fs.readFile('thisisnotarealfile.txt', function (err, data) { + if (err) + console.log(errmsg(err)) +}) +``` + +**Use as a command line tool:** + +``` +~ $ errno 53 +{ + "errno": 53, + "code": "ENOTEMPTY", + "description": "directory not empty" +} +~ $ errno EROFS +{ + "errno": 56, + "code": "EROFS", + "description": "read-only file system" +} +~ $ errno foo +No such errno/code: "foo" +``` + +Supply no arguments for the full list. Error codes are processed case-insensitive. + +You will need to install with `npm install errno -g` if you want the `errno` command to be available without supplying a full path to the node_modules installation. + + +## Custom errors + +Use `errno.custom.createError()` to create custom `Error` objects to throw around in your Node.js library. Create error hierarchies so `instanceof` becomes a useful tool in tracking errors. Call-stack is correctly captured at the time you create an instance of the error object, plus a `cause` property will make available the original error object if you pass one in to the constructor. + +```js +var create = require('errno').custom.createError +var MyError = create('MyError') // inherits from Error +var SpecificError = create('SpecificError', MyError) // inherits from MyError +var OtherError = create('OtherError', MyError) + +// use them! +if (condition) throw new SpecificError('Eeek! Something bad happened') + +if (err) return callback(new OtherError(err)) +``` + +Also available is a `errno.custom.FilesystemError` with in-built access to errno properties: + +```js +fs.readFile('foo', function (err, data) { + if (err) return callback(new errno.custom.FilesystemError(err)) + // do something else +}) +``` + +The resulting error object passed through the callback will have the following properties: `code`, `errno`, `path` and `message` will contain a descriptive human-readable message. + +## Contributors + +* [bahamas10](https://github.com/bahamas10) (Dave Eddy) - Added CLI +* [ralphtheninja](https://github.com/ralphtheninja) (Lars-Magnus Skog) + +## Copyright & Licence + +*Copyright (c) 2012-2015 [Rod Vagg](https://github.com/rvagg) ([@rvagg](https://twitter.com/rvagg))* + +Made available under the MIT licence: + +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. diff --git a/node_modules/errno/build.js b/node_modules/errno/build.js new file mode 100755 index 0000000..fce8926 --- /dev/null +++ b/node_modules/errno/build.js @@ -0,0 +1,43 @@ +#!/usr/bin/env node + +var request = require('request') + , fs = require('fs') + + , uvheadloc = 'https://raw.github.com/joyent/libuv/master/include/uv.h' + , defreg = /^\s*XX\(\s*([\-\d]+),\s*([A-Z]+),\s*"([^"]*)"\s*\)\s*\\?$/ + + +request(uvheadloc, function (err, response) { + if (err) + throw err + + var data, out + + data = response.body + .split('\n') + .map(function (line) { return line.match(defreg) }) + .filter(function (match) { return match }) + .map(function (match) { return { + errno: parseInt(match[1], 10) + , code: match[2] + , description: match[3] + }}) + + out = 'var all = module.exports.all = ' + JSON.stringify(data, 0, 1) + '\n\n' + + out += '\nmodule.exports.errno = {\n ' + + data.map(function (e, i) { + return '\'' + e.errno + '\': all[' + i + ']' + }).join('\n , ') + + '\n}\n\n' + + out += '\nmodule.exports.code = {\n ' + + data.map(function (e, i) { + return '\'' + e.code + '\': all[' + i + ']' + }).join('\n , ') + + '\n}\n\n' + + out += '\nmodule.exports.custom = require("./custom")(module.exports)\n' + + fs.writeFile('errno.js', out) +}) \ No newline at end of file diff --git a/node_modules/errno/cli.js b/node_modules/errno/cli.js new file mode 100755 index 0000000..61d179b --- /dev/null +++ b/node_modules/errno/cli.js @@ -0,0 +1,22 @@ +#!/usr/bin/env node + +var errno = require('./') + , arg = process.argv[2] + , data, code + +if (arg === undefined) { + console.log(JSON.stringify(errno.code, null, 2)) + process.exit(0) +} + +if ((code = +arg) == arg) + data = errno.errno[code] +else + data = errno.code[arg] || errno.code[arg.toUpperCase()] + +if (data) + console.log(JSON.stringify(data, null, 2)) +else { + console.error('No such errno/code: "' + arg + '"') + process.exit(1) +} diff --git a/node_modules/errno/custom.js b/node_modules/errno/custom.js new file mode 100644 index 0000000..ca8c1d8 --- /dev/null +++ b/node_modules/errno/custom.js @@ -0,0 +1,57 @@ +var prr = require('prr') + +function init (type, message, cause) { + if (!!message && typeof message != 'string') { + message = message.message || message.name + } + prr(this, { + type : type + , name : type + // can be passed just a 'cause' + , cause : typeof message != 'string' ? message : cause + , message : message + }, 'ewr') +} + +// generic prototype, not intended to be actually used - helpful for `instanceof` +function CustomError (message, cause) { + Error.call(this) + if (Error.captureStackTrace) + Error.captureStackTrace(this, this.constructor) + init.call(this, 'CustomError', message, cause) +} + +CustomError.prototype = new Error() + +function createError (errno, type, proto) { + var err = function (message, cause) { + init.call(this, type, message, cause) + //TODO: the specificity here is stupid, errno should be available everywhere + if (type == 'FilesystemError') { + this.code = this.cause.code + this.path = this.cause.path + this.errno = this.cause.errno + this.message = + (errno.errno[this.cause.errno] + ? errno.errno[this.cause.errno].description + : this.cause.message) + + (this.cause.path ? ' [' + this.cause.path + ']' : '') + } + Error.call(this) + if (Error.captureStackTrace) + Error.captureStackTrace(this, err) + } + err.prototype = !!proto ? new proto() : new CustomError() + return err +} + +module.exports = function (errno) { + var ce = function (type, proto) { + return createError(errno, type, proto) + } + return { + CustomError : CustomError + , FilesystemError : ce('FilesystemError') + , createError : ce + } +} diff --git a/node_modules/errno/errno.js b/node_modules/errno/errno.js new file mode 100644 index 0000000..efb79d4 --- /dev/null +++ b/node_modules/errno/errno.js @@ -0,0 +1,313 @@ +var all = module.exports.all = [ + { + errno: -2, + code: 'ENOENT', + description: 'no such file or directory' + }, + { + errno: -1, + code: 'UNKNOWN', + description: 'unknown error' + }, + { + errno: 0, + code: 'OK', + description: 'success' + }, + { + errno: 1, + code: 'EOF', + description: 'end of file' + }, + { + errno: 2, + code: 'EADDRINFO', + description: 'getaddrinfo error' + }, + { + errno: 3, + code: 'EACCES', + description: 'permission denied' + }, + { + errno: 4, + code: 'EAGAIN', + description: 'resource temporarily unavailable' + }, + { + errno: 5, + code: 'EADDRINUSE', + description: 'address already in use' + }, + { + errno: 6, + code: 'EADDRNOTAVAIL', + description: 'address not available' + }, + { + errno: 7, + code: 'EAFNOSUPPORT', + description: 'address family not supported' + }, + { + errno: 8, + code: 'EALREADY', + description: 'connection already in progress' + }, + { + errno: 9, + code: 'EBADF', + description: 'bad file descriptor' + }, + { + errno: 10, + code: 'EBUSY', + description: 'resource busy or locked' + }, + { + errno: 11, + code: 'ECONNABORTED', + description: 'software caused connection abort' + }, + { + errno: 12, + code: 'ECONNREFUSED', + description: 'connection refused' + }, + { + errno: 13, + code: 'ECONNRESET', + description: 'connection reset by peer' + }, + { + errno: 14, + code: 'EDESTADDRREQ', + description: 'destination address required' + }, + { + errno: 15, + code: 'EFAULT', + description: 'bad address in system call argument' + }, + { + errno: 16, + code: 'EHOSTUNREACH', + description: 'host is unreachable' + }, + { + errno: 17, + code: 'EINTR', + description: 'interrupted system call' + }, + { + errno: 18, + code: 'EINVAL', + description: 'invalid argument' + }, + { + errno: 19, + code: 'EISCONN', + description: 'socket is already connected' + }, + { + errno: 20, + code: 'EMFILE', + description: 'too many open files' + }, + { + errno: 21, + code: 'EMSGSIZE', + description: 'message too long' + }, + { + errno: 22, + code: 'ENETDOWN', + description: 'network is down' + }, + { + errno: 23, + code: 'ENETUNREACH', + description: 'network is unreachable' + }, + { + errno: 24, + code: 'ENFILE', + description: 'file table overflow' + }, + { + errno: 25, + code: 'ENOBUFS', + description: 'no buffer space available' + }, + { + errno: 26, + code: 'ENOMEM', + description: 'not enough memory' + }, + { + errno: 27, + code: 'ENOTDIR', + description: 'not a directory' + }, + { + errno: 28, + code: 'EISDIR', + description: 'illegal operation on a directory' + }, + { + errno: 29, + code: 'ENONET', + description: 'machine is not on the network' + }, + { + errno: 31, + code: 'ENOTCONN', + description: 'socket is not connected' + }, + { + errno: 32, + code: 'ENOTSOCK', + description: 'socket operation on non-socket' + }, + { + errno: 33, + code: 'ENOTSUP', + description: 'operation not supported on socket' + }, + { + errno: 34, + code: 'ENOENT', + description: 'no such file or directory' + }, + { + errno: 35, + code: 'ENOSYS', + description: 'function not implemented' + }, + { + errno: 36, + code: 'EPIPE', + description: 'broken pipe' + }, + { + errno: 37, + code: 'EPROTO', + description: 'protocol error' + }, + { + errno: 38, + code: 'EPROTONOSUPPORT', + description: 'protocol not supported' + }, + { + errno: 39, + code: 'EPROTOTYPE', + description: 'protocol wrong type for socket' + }, + { + errno: 40, + code: 'ETIMEDOUT', + description: 'connection timed out' + }, + { + errno: 41, + code: 'ECHARSET', + description: 'invalid Unicode character' + }, + { + errno: 42, + code: 'EAIFAMNOSUPPORT', + description: 'address family for hostname not supported' + }, + { + errno: 44, + code: 'EAISERVICE', + description: 'servname not supported for ai_socktype' + }, + { + errno: 45, + code: 'EAISOCKTYPE', + description: 'ai_socktype not supported' + }, + { + errno: 46, + code: 'ESHUTDOWN', + description: 'cannot send after transport endpoint shutdown' + }, + { + errno: 47, + code: 'EEXIST', + description: 'file already exists' + }, + { + errno: 48, + code: 'ESRCH', + description: 'no such process' + }, + { + errno: 49, + code: 'ENAMETOOLONG', + description: 'name too long' + }, + { + errno: 50, + code: 'EPERM', + description: 'operation not permitted' + }, + { + errno: 51, + code: 'ELOOP', + description: 'too many symbolic links encountered' + }, + { + errno: 52, + code: 'EXDEV', + description: 'cross-device link not permitted' + }, + { + errno: 53, + code: 'ENOTEMPTY', + description: 'directory not empty' + }, + { + errno: 54, + code: 'ENOSPC', + description: 'no space left on device' + }, + { + errno: 55, + code: 'EIO', + description: 'i/o error' + }, + { + errno: 56, + code: 'EROFS', + description: 'read-only file system' + }, + { + errno: 57, + code: 'ENODEV', + description: 'no such device' + }, + { + errno: 58, + code: 'ESPIPE', + description: 'invalid seek' + }, + { + errno: 59, + code: 'ECANCELED', + description: 'operation canceled' + } +] + +module.exports.errno = {} +module.exports.code = {} + +all.forEach(function (error) { + module.exports.errno[error.errno] = error + module.exports.code[error.code] = error +}) + +module.exports.custom = require('./custom')(module.exports) +module.exports.create = module.exports.custom.createError diff --git a/node_modules/errno/package.json b/node_modules/errno/package.json new file mode 100644 index 0000000..dc7c62b --- /dev/null +++ b/node_modules/errno/package.json @@ -0,0 +1,64 @@ +{ + "_from": "errno@^0.1.3", + "_id": "errno@0.1.7", + "_inBundle": false, + "_integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "_location": "/errno", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "errno@^0.1.3", + "name": "errno", + "escapedName": "errno", + "rawSpec": "^0.1.3", + "saveSpec": null, + "fetchSpec": "^0.1.3" + }, + "_requiredBy": [ + "/enhanced-resolve/memory-fs", + "/memory-fs", + "/worker-farm" + ], + "_resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "_shasum": "4684d71779ad39af177e3f007996f7c67c852618", + "_spec": "errno@^0.1.3", + "_where": "/usr/share/r3-server/beta/r3/node_modules/enhanced-resolve/node_modules/memory-fs", + "authors": [ + "Rod Vagg @rvagg (https://github.com/rvagg)" + ], + "bin": { + "errno": "cli.js" + }, + "bugs": { + "url": "https://github.com/rvagg/node-errno/issues" + }, + "bundleDependencies": false, + "dependencies": { + "prr": "~1.0.1" + }, + "deprecated": false, + "description": "libuv errno details exposed", + "devDependencies": { + "error-stack-parser": "^2.0.1", + "inherits": "^2.0.3", + "tape": "~4.8.0" + }, + "homepage": "https://github.com/rvagg/node-errno#readme", + "keywords": [ + "errors", + "errno", + "libuv" + ], + "license": "MIT", + "main": "errno.js", + "name": "errno", + "repository": { + "type": "git", + "url": "git+https://github.com/rvagg/node-errno.git" + }, + "scripts": { + "test": "node --use_strict test.js" + }, + "version": "0.1.7" +} diff --git a/node_modules/errno/test.js b/node_modules/errno/test.js new file mode 100644 index 0000000..1c04635 --- /dev/null +++ b/node_modules/errno/test.js @@ -0,0 +1,88 @@ +var test = require('tape') + , inherits = require('inherits') + , ErrorStackParser = require('error-stack-parser') + , errno = require('./') + +test('sanity checks', function (t) { + t.ok(errno.all, 'errno.all not found') + t.ok(errno.errno, 'errno.errno not found') + t.ok(errno.code, 'errno.code not found') + + t.equal(errno.all.length, 60, 'found ' + errno.all.length + ', expected 60') + t.equal(errno.errno['-1'], errno.all[1], 'errno -1 not second element') + + t.equal(errno.code['UNKNOWN'], errno.all[1], 'code UNKNOWN not second element') + + t.equal(errno.errno[1], errno.all[3], 'errno 1 not fourth element') + + t.equal(errno.code['EOF'], errno.all[3], 'code EOF not fourth element') + t.end() +}) + +test('custom errors', function (t) { + const Cust = errno.create('FooNotBarError') + const cust = new Cust('foo is not bar') + + t.equal(cust.name, 'FooNotBarError', 'correct custom name') + t.equal(cust.type, 'FooNotBarError', 'correct custom type') + t.equal(cust.message, 'foo is not bar', 'correct custom message') + t.notOk(cust.cause, 'no cause') + t.end() +}) + +test('callstack', function (t) { + const MyError = errno.create('MyError') + + function lastFunction (ErrorType, cb) { + process.nextTick(cb, new ErrorType('oh noes!')) + } + + function secondLastFunction (ErrorType, cb) { + lastFunction(ErrorType, cb) + } + + function testFrames (t) { + return function (err) { + const stack = ErrorStackParser.parse(err) + t.same(stack[0].functionName, 'lastFunction', 'last stack frame ok') + t.same(stack[1].functionName, 'secondLastFunction', 'second last stack frame ok') + t.end() + } + } + + t.test('custom error, default prototype', function (t) { + secondLastFunction(MyError, testFrames(t)) + }) + + t.test('custom error, custom prototype', function (t) { + const MyError2 = errno.create('MyError2', MyError) + secondLastFunction(MyError2, testFrames(t)) + }) + + t.test('custom error, using inheritance', function (t) { + const CustomError = errno.custom.CustomError + + function MyError3 (message, cause) { + CustomError.call(this, message, cause) + } + + inherits(MyError3, CustomError) + + secondLastFunction(MyError3, testFrames(t)) + }) +}) + +test('error without message', function (t) { + const Cust = errno.create('WriteError') + const cust = new Cust({ + code: 22, + message: '', + name: 'QuotaExceededError' + }) + + t.equal(cust.name, 'WriteError', 'correct custom name') + t.equal(cust.type, 'WriteError', 'correct custom type') + t.equal(cust.message, 'QuotaExceededError', 'message is the name') + t.notOk(cust.cause, 'no cause') + t.end() +}) diff --git a/node_modules/error-ex/LICENSE b/node_modules/error-ex/LICENSE new file mode 100644 index 0000000..0a5f461 --- /dev/null +++ b/node_modules/error-ex/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 JD Ballard + +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. diff --git a/node_modules/error-ex/README.md b/node_modules/error-ex/README.md new file mode 100644 index 0000000..97f744a --- /dev/null +++ b/node_modules/error-ex/README.md @@ -0,0 +1,144 @@ +# node-error-ex [![Travis-CI.org Build Status](https://img.shields.io/travis/Qix-/node-error-ex.svg?style=flat-square)](https://travis-ci.org/Qix-/node-error-ex) [![Coveralls.io Coverage Rating](https://img.shields.io/coveralls/Qix-/node-error-ex.svg?style=flat-square)](https://coveralls.io/r/Qix-/node-error-ex) +> Easily subclass and customize new Error types + +## Examples +To include in your project: +```javascript +var errorEx = require('error-ex'); +``` + +To create an error message type with a specific name (note, that `ErrorFn.name` +will not reflect this): +```javascript +var JSONError = errorEx('JSONError'); + +var err = new JSONError('error'); +err.name; //-> JSONError +throw err; //-> JSONError: error +``` + +To add a stack line: +```javascript +var JSONError = errorEx('JSONError', {fileName: errorEx.line('in %s')}); + +var err = new JSONError('error') +err.fileName = '/a/b/c/foo.json'; +throw err; //-> (line 2)-> in /a/b/c/foo.json +``` + +To append to the error message: +```javascript +var JSONError = errorEx('JSONError', {fileName: errorEx.append('in %s')}); + +var err = new JSONError('error'); +err.fileName = '/a/b/c/foo.json'; +throw err; //-> JSONError: error in /a/b/c/foo.json +``` + +## API + +#### `errorEx([name], [properties])` +Creates a new ErrorEx error type + +- `name`: the name of the new type (appears in the error message upon throw; + defaults to `Error.name`) +- `properties`: if supplied, used as a key/value dictionary of properties to + use when building up the stack message. Keys are property names that are + looked up on the error message, and then passed to function values. + - `line`: if specified and is a function, return value is added as a stack + entry (error-ex will indent for you). Passed the property value given + the key. + - `stack`: if specified and is a function, passed the value of the property + using the key, and the raw stack lines as a second argument. Takes no + return value (but the stack can be modified directly). + - `message`: if specified and is a function, return value is used as new + `.message` value upon get. Passed the property value of the property named + by key, and the existing message is passed as the second argument as an + array of lines (suitable for multi-line messages). + +Returns a constructor (Function) that can be used just like the regular Error +constructor. + +```javascript +var errorEx = require('error-ex'); + +var BasicError = errorEx(); + +var NamedError = errorEx('NamedError'); + +// -- + +var AdvancedError = errorEx('AdvancedError', { + foo: { + line: function (value, stack) { + if (value) { + return 'bar ' + value; + } + return null; + } + } +} + +var err = new AdvancedError('hello, world'); +err.foo = 'baz'; +throw err; + +/* + AdvancedError: hello, world + bar baz + at tryReadme() (readme.js:20:1) +*/ +``` + +#### `errorEx.line(str)` +Creates a stack line using a delimiter + +> This is a helper function. It is to be used in lieu of writing a value object +> for `properties` values. + +- `str`: The string to create + - Use the delimiter `%s` to specify where in the string the value should go + +```javascript +var errorEx = require('error-ex'); + +var FileError = errorEx('FileError', {fileName: errorEx.line('in %s')}); + +var err = new FileError('problem reading file'); +err.fileName = '/a/b/c/d/foo.js'; +throw err; + +/* + FileError: problem reading file + in /a/b/c/d/foo.js + at tryReadme() (readme.js:7:1) +*/ +``` + +#### `errorEx.append(str)` +Appends to the `error.message` string + +> This is a helper function. It is to be used in lieu of writing a value object +> for `properties` values. + +- `str`: The string to append + - Use the delimiter `%s` to specify where in the string the value should go + +```javascript +var errorEx = require('error-ex'); + +var SyntaxError = errorEx('SyntaxError', {fileName: errorEx.append('in %s')}); + +var err = new SyntaxError('improper indentation'); +err.fileName = '/a/b/c/d/foo.js'; +throw err; + +/* + SyntaxError: improper indentation in /a/b/c/d/foo.js + at tryReadme() (readme.js:7:1) +*/ +``` + +## License +Licensed under the [MIT License](http://opensource.org/licenses/MIT). +You can find a copy of it in [LICENSE](LICENSE). diff --git a/node_modules/error-ex/index.js b/node_modules/error-ex/index.js new file mode 100644 index 0000000..4fb20b4 --- /dev/null +++ b/node_modules/error-ex/index.js @@ -0,0 +1,141 @@ +'use strict'; + +var util = require('util'); +var isArrayish = require('is-arrayish'); + +var errorEx = function errorEx(name, properties) { + if (!name || name.constructor !== String) { + properties = name || {}; + name = Error.name; + } + + var errorExError = function ErrorEXError(message) { + if (!this) { + return new ErrorEXError(message); + } + + message = message instanceof Error + ? message.message + : (message || this.message); + + Error.call(this, message); + Error.captureStackTrace(this, errorExError); + + this.name = name; + + Object.defineProperty(this, 'message', { + configurable: true, + enumerable: false, + get: function () { + var newMessage = message.split(/\r?\n/g); + + for (var key in properties) { + if (!properties.hasOwnProperty(key)) { + continue; + } + + var modifier = properties[key]; + + if ('message' in modifier) { + newMessage = modifier.message(this[key], newMessage) || newMessage; + if (!isArrayish(newMessage)) { + newMessage = [newMessage]; + } + } + } + + return newMessage.join('\n'); + }, + set: function (v) { + message = v; + } + }); + + var overwrittenStack = null; + + var stackDescriptor = Object.getOwnPropertyDescriptor(this, 'stack'); + var stackGetter = stackDescriptor.get; + var stackValue = stackDescriptor.value; + delete stackDescriptor.value; + delete stackDescriptor.writable; + + stackDescriptor.set = function (newstack) { + overwrittenStack = newstack; + }; + + stackDescriptor.get = function () { + var stack = (overwrittenStack || ((stackGetter) + ? stackGetter.call(this) + : stackValue)).split(/\r?\n+/g); + + // starting in Node 7, the stack builder caches the message. + // just replace it. + if (!overwrittenStack) { + stack[0] = this.name + ': ' + this.message; + } + + var lineCount = 1; + for (var key in properties) { + if (!properties.hasOwnProperty(key)) { + continue; + } + + var modifier = properties[key]; + + if ('line' in modifier) { + var line = modifier.line(this[key]); + if (line) { + stack.splice(lineCount++, 0, ' ' + line); + } + } + + if ('stack' in modifier) { + modifier.stack(this[key], stack); + } + } + + return stack.join('\n'); + }; + + Object.defineProperty(this, 'stack', stackDescriptor); + }; + + if (Object.setPrototypeOf) { + Object.setPrototypeOf(errorExError.prototype, Error.prototype); + Object.setPrototypeOf(errorExError, Error); + } else { + util.inherits(errorExError, Error); + } + + return errorExError; +}; + +errorEx.append = function (str, def) { + return { + message: function (v, message) { + v = v || def; + + if (v) { + message[0] += ' ' + str.replace('%s', v.toString()); + } + + return message; + } + }; +}; + +errorEx.line = function (str, def) { + return { + line: function (v) { + v = v || def; + + if (v) { + return str.replace('%s', v.toString()); + } + + return null; + } + }; +}; + +module.exports = errorEx; diff --git a/node_modules/error-ex/package.json b/node_modules/error-ex/package.json new file mode 100644 index 0000000..4973b6e --- /dev/null +++ b/node_modules/error-ex/package.json @@ -0,0 +1,86 @@ +{ + "_from": "error-ex@^1.2.0", + "_id": "error-ex@1.3.2", + "_inBundle": false, + "_integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "_location": "/error-ex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "error-ex@^1.2.0", + "name": "error-ex", + "escapedName": "error-ex", + "rawSpec": "^1.2.0", + "saveSpec": null, + "fetchSpec": "^1.2.0" + }, + "_requiredBy": [ + "/parse-json" + ], + "_resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "_shasum": "b4ac40648107fdcdcfae242f428bea8a14d4f1bf", + "_spec": "error-ex@^1.2.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/parse-json", + "bugs": { + "url": "https://github.com/qix-/node-error-ex/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-arrayish": "^0.2.1" + }, + "deprecated": false, + "description": "Easy error subclassing and stack customization", + "devDependencies": { + "coffee-script": "^1.9.3", + "coveralls": "^2.11.2", + "istanbul": "^0.3.17", + "mocha": "^2.2.5", + "should": "^7.0.1", + "xo": "^0.7.1" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/qix-/node-error-ex#readme", + "keywords": [ + "error", + "errors", + "extend", + "extending", + "extension", + "subclass", + "stack", + "custom" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Josh Junon", + "email": "i.am.qix@gmail.com", + "url": "github.com/qix-" + }, + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + } + ], + "name": "error-ex", + "repository": { + "type": "git", + "url": "git+https://github.com/qix-/node-error-ex.git" + }, + "scripts": { + "pretest": "xo", + "test": "mocha --compilers coffee:coffee-script/register" + }, + "version": "1.3.2", + "xo": { + "rules": { + "operator-linebreak": [ + 0 + ] + } + } +} diff --git a/node_modules/es5-ext/.editorconfig b/node_modules/es5-ext/.editorconfig new file mode 100644 index 0000000..bd6d81e --- /dev/null +++ b/node_modules/es5-ext/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +trim_trailing_whitespace = true + +[*.md] +indent_size = 2 +indent_style = space +trim_trailing_whitespace = false diff --git a/node_modules/es5-ext/.github/FUNDING.yml b/node_modules/es5-ext/.github/FUNDING.yml new file mode 100644 index 0000000..71426b0 --- /dev/null +++ b/node_modules/es5-ext/.github/FUNDING.yml @@ -0,0 +1 @@ +tidelift: "npm/es5-ext" diff --git a/node_modules/es5-ext/CHANGELOG.md b/node_modules/es5-ext/CHANGELOG.md new file mode 100644 index 0000000..0c5801d --- /dev/null +++ b/node_modules/es5-ext/CHANGELOG.md @@ -0,0 +1,325 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +### [0.10.53](https://github.com/medikoo/es5-ext/compare/v0.10.52...v0.10.53) (2019-11-21) + +### [0.10.52](https://github.com/medikoo/es5-ext/compare/v0.10.51...v0.10.52) (2019-10-29) + +### Bug Fixes + +- Fix global resolution for Safari ([00731d2](https://github.com/medikoo/es5-ext/commit/00731d2)) +- Keep support for old Node.js versions ([2fa2a11](https://github.com/medikoo/es5-ext/commit/2fa2a11)) + +### [0.10.51](https://github.com/medikoo/es5-ext/compare/v0.10.50...v0.10.51) (2019-08-30) + +### Bug Fixes + +- Ensure Function.isFunction recognizes async functions ([6f06e66](https://github.com/medikoo/es5-ext/commit/6f06e66)) + +### Tests + +- Fix after prettification changes ([dd6fc3f](https://github.com/medikoo/es5-ext/commit/dd6fc3f)) + +## [0.10.50](https://github.com/medikoo/es5-ext/compare/v0.10.49...v0.10.50) (2019-04-30) + +### Bug Fixes + +- maximum time value reference ([708202d](https://github.com/medikoo/es5-ext/commit/708202d)) + +### Features + +- ensure global resolves in strict mode ([c6a19d7](https://github.com/medikoo/es5-ext/commit/c6a19d7)), closes [#86](https://github.com/medikoo/es5-ext/issues/86) + +## [0.10.49](https://github.com/medikoo/es5-ext/compare/v0.10.48...v0.10.49) (2019-03-11) + +### Features + +- allow plain function usage of fn.compose ([2bafef7](https://github.com/medikoo/es5-ext/commit/2bafef7)) + +## [0.10.48](https://github.com/medikoo/es5-ext/compare/v0.10.47...v0.10.48) (2019-02-22) + +### Features + +- Object.ensurePlainObject util ([f48fbcf](https://github.com/medikoo/es5-ext/commit/f48fbcf)) + + + +## [0.10.47](https://github.com/medikoo/es5-ext/compare/v0.10.46...v0.10.47) (2019-01-16) + +### Features + +- Promise.prototype.finally shim ([4dadbc7](https://github.com/medikoo/es5-ext/commit/4dadbc7)) + + + +## [0.10.46](https://github.com/medikoo/es5-ext/compare/v0.10.45...v0.10.46) (2018-08-13) + +### Bug Fixes + +- assign-deep to not modify following arguments ([bf43d57](https://github.com/medikoo/es5-ext/commit/bf43d57)) + + + +## [0.10.45](https://github.com/medikoo/es5-ext/compare/v0.10.44...v0.10.45) (2018-06-01) + +### Bug Fixes + +- improve error message readbility ([adc91b9](https://github.com/medikoo/es5-ext/commit/adc91b9)) + + + +## [0.10.44](https://github.com/medikoo/es5-ext/compare/v0.10.43...v0.10.44) (2018-05-30) + +### Features + +- add Object.entries ([51d2f43](https://github.com/medikoo/es5-ext/commit/51d2f43)) + + + +## [0.10.43](https://github.com/medikoo/es5-ext/compare/v0.10.42...v0.10.43) (2018-05-28) + +### Features + +- improve patch string ([6a25b10](https://github.com/medikoo/es5-ext/commit/6a25b10)) + + + +## [0.10.42](https://github.com/medikoo/es5-ext/compare/v0.10.41...v0.10.42) (2018-03-28) + +### Bug Fixes + +- Date.isDate to exclude NaN dates ([3b61bc6](https://github.com/medikoo/es5-ext/commit/3b61bc6)) + +### Features + +- improve non-coercible string representation ([20bfb78](https://github.com/medikoo/es5-ext/commit/20bfb78)) +- improve non-stringifiable string representation ([2e4512d](https://github.com/medikoo/es5-ext/commit/2e4512d)) + + + +## [0.10.41](https://github.com/medikoo/es5-ext/compare/v0.10.40...v0.10.41) (2018-03-16) + +### Features + +- Add function.microtaskDelay method ([66481c0](https://github.com/medikoo/es5-ext/commit/66481c0)) +- Add Object.isThenable ([8d5a45c](https://github.com/medikoo/es5-ext/commit/8d5a45c)) +- Add promise.asCallback method ([dcc1451](https://github.com/medikoo/es5-ext/commit/dcc1451)) +- Object.ensurePlainFunction ([2682be6](https://github.com/medikoo/es5-ext/commit/2682be6)) + + + +## [0.10.40](https://github.com/medikoo/es5-ext/compare/v0.10.39...v0.10.40) (2018-03-09) + +### Features + +- **math:** decimal round, floor and ceil ([39290c6](https://github.com/medikoo/es5-ext/commit/39290c6)) +- **object:** isInteger and ensureInteger ([a5f7d04](https://github.com/medikoo/es5-ext/commit/a5f7d04)) + + + +## [0.10.39](https://github.com/medikoo/es5-ext/compare/v0.10.38...v0.10.39) (2018-02-16) + +### Features + +- Promise.lazy ([7a30a78](https://github.com/medikoo/es5-ext/commit/7a30a78)) + + + +## [0.10.38](https://github.com/medikoo/es5-ext/compare/v0.10.37...v0.10.38) (2018-01-16) + +### Features + +- Object.isNaturalNumber an Object.isNaturalNumberValue ([66a40af](https://github.com/medikoo/es5-ext/commit/66a40af)) + + + +## [0.10.37](https://github.com/medikoo/es5-ext/compare/v0.10.36...v0.10.37) (2017-11-23) + +### Features + +- String.random util ([7c28739](https://github.com/medikoo/es5-ext/commit/7c28739)) + + + +## [0.10.36](https://github.com/medikoo/es5-ext/compare/v0.10.35...v0.10.36) (2017-11-23) + +### Features + +- **date:** isTimeValue and ensureTimeValue utils ([7659dc5](https://github.com/medikoo/es5-ext/commit/7659dc5)) + + + +## [0.10.35](https://github.com/medikoo/es5-ext/compare/v0.10.34...v0.10.35) (2017-10-13) + +### Bug Fixes + +- **Object.copy:** do not upgrade primitives to objects ([dd4d88f](https://github.com/medikoo/es5-ext/commit/dd4d88f)) + + + +## [0.10.34](https://github.com/medikoo/es5-ext/compare/v0.10.33...v0.10.34) (2017-10-13) + +### Features + +- **copyDeep:** duplicate only recursive instances ([bba529a](https://github.com/medikoo/es5-ext/commit/bba529a)) + + + +## [0.10.33](https://github.com/medikoo/es5-ext/compare/v0.10.32...v0.10.33) (2017-10-13) + +### Bug Fixes + +- **Object.assignDeep:** relax input validation ([1baf57d](https://github.com/medikoo/es5-ext/commit/1baf57d)) + + + +## [0.10.32](https://github.com/medikoo/es5-ext/compare/v0.10.31...v0.10.32) (2017-10-13) + +### Features + +- Object.assignDeep ([2345e0b](https://github.com/medikoo/es5-ext/commit/2345e0b)) + + + +## [0.10.31](https://github.com/medikoo/es5-ext/compare/v0.10.30...v0.10.31) (2017-10-09) + +### Features + +- Object.isPlainFunction utility ([031be0a](https://github.com/medikoo/es5-ext/commit/031be0a)) + + + +## [0.10.30](https://github.com/medikoo/es5-ext/compare/v0.10.29...v0.10.30) (2017-08-25) + +### Bug Fixes + +- value stringification for error message ([37bb96b](https://github.com/medikoo/es5-ext/commit/37bb96b)) + + + +## [0.10.29](https://github.com/medikoo/es5-ext/compare/v0.10.28...v0.10.29) (2017-08-18) + +### Bug Fixes + +- string.repeat after recent regression ([b02fab4](https://github.com/medikoo/es5-ext/commit/b02fab4)) + + + +## [0.10.28](https://github.com/medikoo/es5-ext/compare/v0.10.27...v0.10.28) (2017-08-18) + +### Features + +- array.isEmpty method ([b0cfbdd](https://github.com/medikoo/es5-ext/commit/b0cfbdd)) +- improve new lines representation ([860fe8b](https://github.com/medikoo/es5-ext/commit/860fe8b)) +- Object.ensureArray util ([595c341](https://github.com/medikoo/es5-ext/commit/595c341)) +- toShortStringRepresentation util ([6842d06](https://github.com/medikoo/es5-ext/commit/6842d06)) + + + +## [0.10.27](https://github.com/medikoo/es5-ext/compare/v0.10.26...v0.10.27) (2017-08-11) + +### Bug Fixes + +- isNumberValue should not crash on non-coercible values ([0db765e](https://github.com/medikoo/es5-ext/commit/0db765e)) + +### Features + +- add Object.ensureFiniteNumber util ([11c67f5](https://github.com/medikoo/es5-ext/commit/11c67f5)) +- add Object.isFiniteNumber util ([fe5b55a](https://github.com/medikoo/es5-ext/commit/fe5b55a)) + + + +## [0.10.26](https://github.com/medikoo/es5-ext/compare/v0.10.25...v0.10.26) (2017-08-02) + +### Bug Fixes + +- **general:** ensure optionalChaining in index ([3df879a](https://github.com/medikoo/es5-ext/commit/3df879a)) + + + +## [0.10.25](https://github.com/medikoo/es5-ext/compare/v0.10.24...v0.10.25) (2017-08-02) + +### Features + +- **general:** optionalChaining utility ([26332b5](https://github.com/medikoo/es5-ext/commit/26332b5)) + + + +## [0.10.24](https://github.com/medikoo/es5-ext/compare/v0.10.23...v0.10.24) (2017-07-10) + +### Features + +- resolve global with CSP safe method ([d386449](https://github.com/medikoo/es5-ext/commit/d386449)) + + + +## [0.10.23](https://github.com/medikoo/es5-ext/compare/v0.10.22...v0.10.23) (2017-06-05) + +### Bug Fixes + +- **Error.custom:** allow non-string code ([e8db3a0](https://github.com/medikoo/es5-ext/commit/e8db3a0)) +- **Error.custom:** improve `ext` argument detection ([0edbfbc](https://github.com/medikoo/es5-ext/commit/0edbfbc)) + + + +## [0.10.22](https://github.com/medikoo/es5-ext/compare/v0.10.21...v0.10.22) (2017-05-31) + +### Bug Fixes + +- ensure proper symbols stringification in early implementations ([ce51900](https://github.com/medikoo/es5-ext/commit/ce51900)) + + + +## [0.10.21](https://github.com/medikoo/es5-ext/compare/v0.10.20...v0.10.21) (2017-05-22) + +### Features + +- support arrow functions in Function/#/to-tring-tokens.js ([ad3de1e](https://github.com/medikoo/es5-ext/commit/ad3de1e)) + + + +## [0.10.20](https://github.com/medikoo/es5-ext/compare/v0.10.19...v0.10.20) (2017-05-17) + +### Features + +- if listed copy not only if own property ([d7e7cef](https://github.com/medikoo/es5-ext/commit/d7e7cef)) +- support `ensure` option in Object.copy ([295326f](https://github.com/medikoo/es5-ext/commit/295326f)) + + + +## [0.10.19](https://github.com/medikoo/es5-ext/compare/v0.10.18...v0.10.19) (2017-05-17) + +### Features + +- support propertyNames option in Object.copy ([5442279](https://github.com/medikoo/es5-ext/commit/5442279)) + + + +## [0.10.18](https://github.com/medikoo/es5-ext/compare/v0.10.17...v0.10.18) (2017-05-15) + +### Bug Fixes + +- take all changes in safeToString ([3c5cd12](https://github.com/medikoo/es5-ext/commit/3c5cd12)) + + + +## [0.10.17](https://github.com/medikoo/es5-ext/compare/v0.10.16...v0.10.17) (2017-05-15) + +### Features + +- introduce Object.ensurePromise ([46a2f45](https://github.com/medikoo/es5-ext/commit/46a2f45)) +- introduce Object.isPromise ([27aecc8](https://github.com/medikoo/es5-ext/commit/27aecc8)) +- introduce safeToString ([0cc6a7b](https://github.com/medikoo/es5-ext/commit/0cc6a7b)) + + + +## [0.10.16](https://github.com/medikoo/es5-ext/compare/v0.10.15...v0.10.16) (2017-05-09) + +### Features + +- add String.prototype.count ([2e53241](https://github.com/medikoo/es5-ext/commit/2e53241)) + +## Changelog for previous versions + +See `CHANGES` file diff --git a/node_modules/es5-ext/CHANGES b/node_modules/es5-ext/CHANGES new file mode 100644 index 0000000..bb84bab --- /dev/null +++ b/node_modules/es5-ext/CHANGES @@ -0,0 +1,650 @@ +For recent changelog see CHANGELOG.md + +----- + +v0.10.15 -- 2017.03.20 +* Fix Object.isValue (it was actually isNotValue) + +v0.10.14 -- 2017.03.15 +* Object.isValue util + +v0.10.13 -- 2017.03.13 +* Introduce JSON.safeStringify +* Improve message handling in error/custom +* Fix Array#concat shim +* Improve Array#flatten algorithm so it's stack trace friendly +* Make Object.isObject ES3 compatible + +v0.10.12 -- 2016.07.01 +* Ensure symbols are copied in Object.mixin +* Prevent RangeError errors in array#flatten +* Do not validate invalidate dates in validDate + +v0.10.11 -- 2015.12.18 +* Ensure that check for implementation of RegExp flags doesn't crash in V8 (thanks @mathiasbynens) + +v0.10.10 -- 2015.12.11 +* Add Object.isNumberValue util + +v0.10.9 -- 2015.12.01 +* Add Object.ensureNaturalNumber and Object.ensureNaturalNumberValue + +v0.10.8 -- 2015.10.02 +* Add Number.isNatural +* Add Object.find and Object.findKey +* Support arrays in Object.copyDeep +* Fix iteration issue in forEachRight and someRight +* Fix detection of native sinh +* Depend on es6-symbol v3 + +v0.10.7 -- 2015.04.22 +* New utlitities. They're convention differs from v0.10, as they were supposed to land in v1. + Still they're non breaking and start the conventions to be used in v1 + * Object.validateArrayLike + * Object.validateArrayLikeObject + * Object.validateStringifiable + * Object.validateStringifiableValue + * Universal utilities for array-like/iterable objects + * Iterable.is + * Iterable.validate + * Iterable.validateObject + * Iterable.forEach +* Fix camelToHyphen resolution, it must be absolutely reversable by hyphenToCamel +* Fix calculations of large numbers in Math.tanh +* Fix algorithm of Math.sinh +* Fix indexes to not use real symbols +* Fix length of String.fromCodePoint +* Fix tests of Array#copyWithin +* Update Travis CI configuration + +v0.10.6 -- 2015.02.02 +* Fix handling of infinite values in Math.trunc +* Fix handling of getters in Object.normalizeOptions + +v0.10.5 -- 2015.01.20 +* Add Function#toStringTokens +* Add Object.serialize and Object.unserialize +* Add String.randomUniq +* Fix Strin#camelToHyphen issue with tokens that end with digit +* Optimise Number.isInteger logic +* Improve documentation +* Configure lint scripts +* Fix spelling of LICENSE + +v0.10.4 -- 2014.04.30 +* Assure maximum spec compliance of Array.of and Array.from (thanks @mathiasbynens) +* Improve documentations + +v0.10.3 -- 2014.04.29 +Provide accurate iterators handling: +* Array.from improvements: + * Assure right unicode symbols resolution when processing strings in Array.from + * Rely on ES6 symbol shim and use native @@iterator Symbol if provided by environment +* Add methods: + * Array.prototype.entries + * Array.prototype.keys + * Array.prototype.values + * Array.prototype[@@iterator] + * String.prototype[@@iterator] + +Improve documentation + +v0.10.2 -- 2014.04.24 +- Simplify and deprecate `isCallable`. It seems in ES5 based engines there are + no callable objects which are `typeof obj !== 'function'` +- Update Array.from map callback signature (up to latest resolution of TC39) +- Improve documentation + +v0.10.1 -- 2014.04.14 +Bump version for npm +(Workaround for accidental premature publish & unpublish of v0.10.0 a while ago) + +v0.10.0 -- 2014.04.13 +Major update: +- All methods and function specified for ECMAScript 6 are now introduced as + shims accompanied with functions through which (optionally) they can be + implementend on native objects +- Filename convention was changed to shorter and strictly lower case names. e.g. + `lib/String/prototype/starts-with` became `string/#/starts-with` +- Generated functions are guaranteed to have expected length +- Objects with null prototype (created via `Object.create(null)`) are widely + supported (older version have crashed due to implied `obj.hasOwnProperty` and + related invocations) +- Support array subclasses +- When handling lists do not limit its length to Uint32 range +- Use newly introduced `Object.eq` for strict equality in place of `Object.is` +- Iteration of Object have been improved so properties that were hidden or + removed after iteration started are not iterated. + +Additions: +- `Array.isPlainArray` +- `Array.validArray` +- `Array.prototype.concat` (as updated with ES6) +- `Array.prototype.copyWithin` (as introduced with ES6) +- `Array.prototype.fill` (as introduced with ES6) +- `Array.prototype.filter` (as updated with ES6) +- `Array.prototype.findIndex` (as introduced with ES6) +- `Array.prototype.map` (as updated with ES6) +- `Array.prototype.separate` +- `Array.prototype.slice` (as updated with ES6) +- `Array.prototype.splice` (as updated with ES6) +- `Function.prototype.copy` +- `Math.acosh` (as introduced with ES6) +- `Math.atanh` (as introduced with ES6) +- `Math.cbrt` (as introduced with ES6) +- `Math.clz32` (as introduced with ES6) +- `Math.cosh` (as introduced with ES6) +- `Math.expm1` (as introduced with ES6) +- `Math.fround` (as introduced with ES6) +- `Math.hypot` (as introduced with ES6) +- `Math.imul` (as introduced with ES6) +- `Math.log2` (as introduced with ES6) +- `Math.log10` (as introduced with ES6) +- `Math.log1p` (as introduced with ES6) +- `Math.sinh` (as introduced with ES6) +- `Math.tanh` (as introduced with ES6) +- `Math.trunc` (as introduced with ES6) +- `Number.EPSILON` (as introduced with ES6) +- `Number.MIN_SAFE_INTEGER` (as introduced with ES6) +- `Number.MAX_SAFE_INTEGER` (as introduced with ES6) +- `Number.isFinite` (as introduced with ES6) +- `Number.isInteger` (as introduced with ES6) +- `Number.isSafeInteger` (as introduced with ES6) +- `Object.create` (with fix for V8 issue which disallows prototype turn of + objects derived from null +- `Object.eq` - Less restrictive version of `Object.is` based on SameValueZero + algorithm +- `Object.firstKey` +- `Object.keys` (as updated with ES6) +- `Object.mixinPrototypes` +- `Object.primitiveSet` +- `Object.setPrototypeOf` (as introduced with ES6) +- `Object.validObject` +- `RegExp.escape` +- `RegExp.prototype.match` (as introduced with ES6) +- `RegExp.prototype.replace` (as introduced with ES6) +- `RegExp.prototype.search` (as introduced with ES6) +- `RegExp.prototype.split` (as introduced with ES6) +- `RegExp.prototype.sticky` (as introduced with ES6) +- `RegExp.prototype.unicode` (as introduced with ES6) +- `String.fromCodePoint` (as introduced with ES6) +- `String.raw` (as introduced with ES6) +- `String.prototype.at` +- `String.prototype.codePointAt` (as introduced with ES6) +- `String.prototype.normalize` (as introduced with ES6) +- `String.prototype.plainReplaceAll` + +Removals: +- `reserved` set +- `Array.prototype.commonLeft` +- `Function.insert` +- `Function.remove` +- `Function.prototype.silent` +- `Function.prototype.wrap` +- `Object.descriptor` Move to external `d` project. + See: https://github.com/medikoo/d +- `Object.diff` +- `Object.extendDeep` +- `Object.reduce` +- `Object.values` +- `String.prototype.trimCommonLeft` + +Renames: +- `Function.i` into `Function.identity` +- `Function.k` into `Function.constant` +- `Number.toInt` into `Number.toInteger` +- `Number.toUint` into `Number.toPosInteger` +- `Object.extend` into `Object.assign` (as introduced in ES 6) +- `Object.extendProperties` into `Object.mixin`, with improved internal + handling, so it matches temporarily specified `Object.mixin` for ECMAScript 6 +- `Object.isList` into `Object.isArrayLike` +- `Object.mapToArray` into `Object.toArray` (with fixed function length) +- `Object.toPlainObject` into `Object.normalizeOptions` (as this is the real + use case where we use this function) +- `Function.prototype.chain` into `Function.prototype.compose` +- `Function.prototype.match` into `Function.prototype.spread` +- `String.prototype.format` into `String.formatMethod` + +Improvements & Fixes: +- Remove workaround for primitive values handling in object iterators +- `Array.from`: Update so it follows ES 6 spec +- `Array.prototype.compact`: filters just null and undefined values + (not all falsies) +- `Array.prototype.eIndexOf` and `Array.prototype.eLastIndexOf`: fix position + handling, improve internals +- `Array.prototype.find`: return undefined not null, in case of not found + (follow ES 6) +- `Array.prototype.remove` fix function length +- `Error.custom`: simplify, Custom class case is addressed by outer + `error-create` project -> https://github.com/medikoo/error-create +- `Error.isError` true only for Error instances (remove detection of host + Exception objects) +- `Number.prototype.pad`: Normalize negative pad +- `Object.clear`: Handle errors same way as in `Object.assign` +- `Object.compact`: filters just null and undefined values (not all falsies) +- `Object.compare`: Take into account NaN values +- `Object.copy`: Split into `Object.copy` and `Object.copyDeep` +- `Object.isCopy`: Separate into `Object.isCopy` and `Object.isCopyDeep`, where + `isCopyDeep` handles nested plain objects and plain arrays only +- `String.prototype.endsWith`: Adjust up to ES6 specification +- `String.prototype.repeat`: Adjust up to ES6 specification and improve algorithm +- `String.prototype.simpleReplace`: Rename into `String.prototype.plainReplace` +- `String.prototype.startsWith`: Adjust up to ES6 specification +- Update lint rules, and adjust code to that +- Update Travis CI configuration +- Remove Makefile (it's cross-env utility) + +v0.9.2 -- 2013.03.11 +Added: +* Array.prototype.isCopy +* Array.prototype.isUniq +* Error.CustomError +* Function.validFunction +* Object.extendDeep +* Object.descriptor.binder +* Object.safeTraverse +* RegExp.validRegExp +* String.prototype.capitalize +* String.prototype.simpleReplace + +Fixed: +* Fix Array.prototype.diff for sparse arrays +* Accept primitive objects as input values in Object iteration methods and + Object.clear, Object.count, Object.diff, Object.extend, + Object.getPropertyNames, Object.values +* Pass expected arguments to callbacks of Object.filter, Object.mapKeys, + Object.mapToArray, Object.map +* Improve callable callback support in Object.mapToArray + +v0.9.1 -- 2012.09.17 +* Object.reduce - reduce for hash-like collections +* Accapt any callable object as callback in Object.filter, mapKeys and map +* Convention cleanup + +v0.9.0 -- 2012.09.13 +We're getting to real solid API + +Removed: +* Function#memoize - it's grown up to be external package, to be soon published + as 'memoizee' +* String.guid - it doesn't fit es5-ext (extensions) concept, will be provided as + external package +# Function.arguments - obsolete +# Function.context - obsolete +# Function#flip - not readable when used, so it was never used +# Object.clone - obsolete and confusing + +Added: +* String#camelToHyphen - String format convertion + +Renamed: +* String#dashToCamelCase -> String#hyphenToCamel + +Fixes: +* Object.isObject - Quote names in literals that match reserved keywords + (older implementations crashed on that) +* String#repeat - Do not accept negative values (coerce them to 1) + +Improvements: +* Array#remove - Accepts many arguments, we can now remove many values at once +* Object iterators (forEach, map, some) - Compare function invoked with scope + object bound to this +* Function#curry - Algorithm cleanup +* Object.isCopy - Support for all types, not just plain objects +* Object.isPlainObject - Support for cross-frame objects +* Do not memoize any of the functions, it shouldn't be decided internally +* Remove Object.freeze calls in reserved, it's not up to convention +* Improved documentation +* Better linting (hard-core approach using both JSLint mod and JSHint) +* Optional arguments are now documented in funtions signature + +v0.8.2 -- 2012.06.22 +Fix errors in Array's intersection and exclusion methods, related to improper +usage of contains method + +v0.8.1 -- 2012.06.13 +Reorganized internal logic of Function.prototype.memoize. So it's more safe now +and clears cache properly. Additionally preventCache option was provided. + +v0.8.0 -- 2012.05.28 +Again, major overhaul. Probably last experimental stuff was trashed, all API +looks more like standard extensions now. + +Changes: +* Turn all Object.prototype extensions into functions and move them to Object +namespace. We learned that extending Object.prototype is bad idea in any case. +* Rename Function.prototype.curry into Function.prototype.partial. This function + is really doing partial application while currying is slightly different + concept. +* Convert Function.prototype.ncurry to new implementation of + Function.prototype.curry, it now serves real curry concept additionaly it + covers use cases for aritize and hold, which were removed. +* Rename Array's peek to last, and provide support for sparse arrays in it +* Rename Date's monthDaysCount into daysInMonth +* Simplify object iterators, now order of iteration can be configured with just + compareFn argument (no extra byKeys option) +* Rename Object.isDuplicate to Object.isCopy +* Rename Object.isEqual to Object.is which is compatible with future 'is' + keyword +* Function.memoize is now Function.prototype.memoize. Additionally clear cache + functionality is added, and access to original arguments object. +* Rename validation functions: assertNotNull to validValue, assertCallable to + validCallable. validValue was moved to Object namespace. On success they now + return validated value instead of true, it supports better composition. + Additionally created Date.validDate and Error.validError +* All documentation is now held in README.md not in code files. +* Move guid to String namespace. All guids now start with numbers. +* Array.generate: fill argument is now optional +* Object.toArray is now Array.from (as new ES6 specification draft suggests) +* All methods that rely on indexOf or lastIndexOf, now rely on egal (Object.is) + versions of them (eIndexOf, eLastIndexOf) +* Turn all get* functions that returned methods into actuall methods (get* + functionality can still be achieved with help of Function.prototype.partial). + So: Date.getFormat is now Date.prototype.format, + Number.getPad is now Number.prototype.pad, + String.getFormat is now String.prototype.format, + String.getIndent is now String.prototype.indent, + String.getPad is now String.prototype.pad +* Refactored Object.descriptor, it is now just two functions, main one and + main.gs, main is for describing values, and gs for describing getters and + setters. Configuration is passed with first argument as string e.g. 'ce' for + configurable and enumerable. If no configuration string is provided then by + default it returns configurable and writable but not enumerable for value or + configurable but not enumerable for getter/setter +* Function.prototype.silent now returns prepared function (it was + expected to be fixed for 0.7) +* Reserved keywords map (reserved) is now array not hash. +* Object.merge is now Object.extend (while former Object.extend was completely + removed) - 'extend' implies that we change object, not creating new one (as + 'merge' may imply). Similarily Object.mergeProperties was renamed to + Object.extendProperties +* Position argument support in Array.prototype.contains and + String.prototype.contains (so it follows ES6 specification draft) +* endPosition argument support in String.prototype.endsWith and fromPosition + argument support in String.prototype.startsWith (so it follows ES6 + specification draft) +* Better and cleaner String.prototype.indent implementation. No default value + for indent string argument, optional nest value (defaults to 1), remove + nostart argument +* Correct length values for most methods (so they reflect length of similar + methods in standard) +* Length argument is now optional in number and string pad methods. +* Improve arguments validation in general, so it adheres to standard conventions +* Fixed format of package.json + +Removed methods and functions: +* Object.prototype.slice - Object is not ordered collection, so slice doesn't + make sense. +* Function's rcurry, rncurry, s - too cumbersome for JS, not many use cases for + that +* Function.prototype.aritize and Function.prototype.hold - same functionality + can be achieved with new Function.prototype.curry +* Function.prototype.log - provided more generic Function.prototype.wrap for + same use case +* getNextIdGenerator - no use case for that (String.guid should be used if + needed) +* Object.toObject - Can be now acheived with Object(validValue(x)) +* Array.prototype.someValue - no real use case (personally used once and + case was already controversial) +* Date.prototype.duration - moved to external package +* Number.getAutoincrement - No real use case +* Object.prototype.extend, Object.prototype.override, + Object.prototype.plainCreate, Object.prototype.plainExtend - It was probably + too complex, same should be achieved just with Object.create, + Object.descriptor and by saving references to super methods in local scope. +* Object.getCompareBy - Functions should be created individually for each use + case +* Object.get, Object.getSet, Object.set, Object.unset - Not many use cases and + same can be easily achieved with simple inline function +* String.getPrefixWith - Not real use case for something that can be easily + achieved with '+' operator +* Object.isPrimitive - It's just negation of Object.isObject +* Number.prototype.isLess, Number.prototype.isLessOrEqual - they shouldn't be in + Number namespace and should rather be addressed with simple inline functions. +* Number.prototype.subtract - Should rather be addressed with simple inline + function + +New methods and functions: +* Array.prototype.lastIndex - Returns last declared index in array +* String.prototype.last - last for strings +* Function.prototype.wrap - Wrap function with other, it allows to specify + before and after behavior transform return value or prevent original function + from being called. +* Math.sign - Returns sign of a number (already in ES6 specification draft) +* Number.toInt - Converts value to integer (already in ES6 specification draft) +* Number.isNaN - Returns true if value is NaN (already in ES6 specification + draft) +* Number.toUint - Converts value to unsigned integer +* Number.toUint32 - Converts value to 32bit unsigned integer +* Array.prototype.eIndexOf, eLastIndexOf - Egal version (that uses Object.is) of + standard methods (all methods that were using native indexOf or lastIndexOf + now uses eIndexOf and elastIndexOf respectively) +* Array.of - as it's specified for ES6 + +Fixes: +* Fixed binarySearch so it always returns valid list index +* Object.isList - it failed on lists that are callable (e.g. NodeList in Nitro + engine) +* Object.map now supports third argument for callback + +v0.7.1 -- 2012.01.05 +New methods: +* Array.prototype.firstIndex - returns first valid index of array (for + sparse arrays it may not be '0' + +Improvements: +* Array.prototype.first - now returns value for index returned by firstIndex +* Object.prototype.mapToArray - can be called without callback, then array of + key-value pairs is returned + +Fixes +* Array.prototype.forEachRight, object's length read through UInt32 conversion + +v0.7.0 -- 2011.12.27 +Major update. +Stepped back from experimental ideas and introduced more standard approach +taking example from how ES5 methods and functions are designed. One exceptions +is that, we don’t refrain from declaring methods for Object.prototype - it’s up +to developer whether how he decides to use it in his context (as function or as +method). + +In general: +* Removed any method 'functionalization' and functionalize method itself. + es5-ext declares plain methods, which can be configured to work as functions + with call.bind(method) - see documentation. +* Removed separation of Object methods for ES5 (with descriptors) and + ES3 (plain) - we're following ES5 idea on that, some methods are intended just + for enumerable properties and some are for all properties, all are declared + for Object.prototype +* Removed separation of Array generic (collected in List folder) and not generic + methods (collected in Array folder). Now all methods are generic and are in + Array/prototype folder. This separation also meant, that methods in Array are + usually destructive. We don’t do that separation now, there’s generally no use + case for destructive iterators, we should be fine with one version of each + method, (same as ES5 is fine with e.g. one, non destructive 'filter' method) +* Folder structure resembles tree of native ES5 Objects +* All methods are written with ES5 conventions in mind, it means that most + methods are generic and can be run on any object. In more detail: + ** Array.prototype and Object.prototype methods can be run on any object (any + not null or undefined value), + ** Date.prototype methods should be called only on Date instances. + ** Function.prototype methods can be called on any callable objects (not + necessarily functions) + ** Number.prototype & String.prototype methods can be called on any value, in + case of Number it it’ll be degraded to number, in case of string it’ll be + degraded to string. +* Travis CI support (only for Node v0.6 branch, as v0.4 has buggy V8 version) + +Improvements for existing functions and methods: +* Function.memoize (was Function.cache) is now fully generic, can operate on any + type of arguments and it’s NaN safe (all NaN objects are considered equal) +* Method properties passed to Object.prototype.extend or + Object.prototype.override can aside of _super optionally take prototype object + via _proto argument +* Object iterators: forEach, mapToArray and every can now iterate in specified + order +* pluck, invoke and other functions that return reusable functions or methods + have now their results memoized. + +New methods: +* Global: assertNotNull, getNextIdGenerator, guid, isEqual, isPrimitive, + toObject +* Array: generate +* Array.prototype: binarySearch, clear, contains, diff, exclusion, find, first, + forEachRight, group, indexesOf, intersection, remove, someRight, someValue +* Boolean: isBoolean +* Date: isDate +* Function: arguments, context, insert, isArguments, remove +* Function.prototype: not, silent +* Number: getAutoincrement, isNumber +* Number.prototype: isLessOrEqual, isLess, subtract +* Object: assertCallable, descriptor (functions for clean descriptors), + getCompareBy, isCallable, isObject +* Object.prototype: clone (real clone), compact, count, diff, empty, + getPropertyNames, get, keyOf, mapKeys, override, plainCreate, plainExtend, + slice, some, unset +* RegExp: isRegExp +* String: getPrefixWith, isString +* String.prototype: caseInsensitiveCompare, contains, isNumeric + +Renamed methods: +* Date.clone -> Date.prototype.copy +* Date.format -> Date.getFormat +* Date/day/floor -> Date.prototype.floorDay +* Date/month/floor -> Date.prototype.floorMonth +* Date/month/year -> Date.prototype.floorYear +* Function.cache -> Function.memoize +* Function.getApplyArg -> Function.prototype.match +* Function.sequence -> Function.prototype.chain +* List.findSameStartLength -> Array.prototype.commonLeft +* Number.pad -> Number.getPad +* Object/plain/clone -> Object.prototype.copy +* Object/plain/elevate -> Object.prototype.flatten +* Object/plain/same -> Object.prototype.isDuplicate +* Object/plain/setValue -> Object.getSet +* String.format -> String.getFormat +* String.indent -> String.getIndent +* String.pad -> String.getPad +* String.trimLeftStr -> String.prototype.trimCommonLeft +* Object.merge -> Object.prototype.mergeProperties +* Object/plain/pluck -> Object.prototype.get +* Array.clone is now Array.prototype.copy and can be used also on any array-like + objects +* List.isList -> Object.isList +* List.toArray -> Object.prototype.toArray +* String/convert/dashToCamelCase -> String.prototype.dashToCamelCase + +Removed methods: +* Array.compact - removed destructive version (that operated on same array), we + have now non destructive version as Array.prototype.compact. +* Function.applyBind -> use apply.bind directly +* Function.bindBind -> use bind.bind directly +* Function.callBind -> use call.bind directly +* Fuction.clone -> no valid use case +* Function.dscope -> controversial approach, shouldn’t be considered seriously +* Function.functionalize -> It was experimental but standards are standards +* List/sort/length -> It can be easy obtained by Object.getCompareBy(‘length’) +* List.concat -> Concat’s for array-like’s makes no sense, just convert to array + first +* List.every -> Use Array.prototype.every directly +* List.filter -> Use Array.prototype.filter directly +* List.forEach -> User Array.prototype.forEach directly +* List.isListObject -> No valid use case, do: isList(list) && (typeof list === + 'object’) +* List.map -> Use Array.prototype.map directly +* List.reduce -> Use Array.prototype.reduce directly +* List.shiftSame -> Use Array.prototype.commonLeft and do slice +* List.slice -> Use Array.prototype.slice directly +* List.some -> Use Array.prototype.some directly +* Object.bindMethods -> it was version that considered descriptors, we have now + Object.prototype.bindMethods which operates only on enumerable properties +* Object.every -> version that considered all properties, we have now + Object.prototype.every which iterates only enumerables +* Object.invoke -> no use case +* Object.mergeDeep -> no use case +* Object.pluck -> no use case +* Object.same -> it considered descriptors, now there’s only Object.isDuplicate + which compares only enumerable properties +* Object.sameType -> no use case +* Object.toDescriptor and Object.toDescriptors -> replaced by much nicer + Object.descriptor functions +* Object/plain/link -> no use case (it was used internally only by + Object/plain/merge) +* Object/plain/setTrue -> now easily configurable by more universal + Object.getSet(true) +* String.trimRightStr -> Eventually String.prototype.trimCommonRight will be + added + +v0.6.3 -- 2011.12.12 +* Cleared npm warning for misnamed property in package.json + +v0.6.2 -- 2011.08.12 +* Calling String.indent without scope (global scope then) now treated as calling + it with null scope, it allows more direct invocations when using default nest + string: indent().call(str, nest) + +v0.6.1 -- 2011.08.08 +* Added TAD test suite to devDependencies, configured test commands. + Tests can be run with 'make test' or 'npm test' + +v0.6.0 -- 2011.08.07 +New methods: +* Array: clone, compact (in place) +* Date: format, duration, clone, monthDaysCount, day.floor, month.floor, + year.floor +* Function: getApplyArg, , ncurry, rncurry, hold, cache, log +* List: findSameStartLength, shiftSame, peek, isListObject +* Number: pad +* Object: sameType, toString, mapToArray, mergeDeep, toDescriptor, + toDescriptors, invoke +* String: startsWith, endsWith, indent, trimLeftStr, trimRightStr, pad, format + +Fixed: +* Object.extend does now prototypal extend as exptected +* Object.merge now tries to overwrite only configurable properties +* Function.flip + +Improved: +* Faster List.toArray +* Better global retrieval +* Functionalized all Function methods +* Renamed bindApply and bindCall to applyBind and callBind +* Removed Function.inherit (as it's unintuitive curry clone) +* Straightforward logic in Function.k +* Fixed naming of some tests files (letter case issue) +* Renamed Function.saturate into Function.lock +* String.dashToCamelCase digits support +* Strings now considered as List objects +* Improved List.compact +* Concise logic for List.concat +* Test wit TAD in clean ES5 context + +v0.5.1 -- 2011.07.11 +* Function's bindBind, bindCall and bindApply now more versatile + +v0.5.0 -- 2011.07.07 +* Removed Object.is and List.apply +* Renamed Object.plain.is to Object.plain.isPlainObject (keep naming convention + consistent) +* Improved documentation + +v0.4.0 -- 2011.07.05 +* Take most functions on Object to Object.plain to keep them away from object + descriptors +* Object functions with ES5 standard in mind (object descriptors) + +v0.3.0 -- 2011.06.24 +* New functions +* Consistent file naming (dash instead of camelCase) + +v0.2.1 -- 2011.05.28 +* Renamed Functions.K and Function.S to to lowercase versions (use consistent + naming) + +v0.2.0 -- 2011.05.28 +* Renamed Array folder to List (as its generic functions for array-like objects) +* Added Makefile +* Added various functions + +v0.1.0 -- 2011.05.24 +* Initial version diff --git a/node_modules/es5-ext/LICENSE b/node_modules/es5-ext/LICENSE new file mode 100644 index 0000000..89a96ea --- /dev/null +++ b/node_modules/es5-ext/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2011-2019, Mariusz Nowak, @medikoo, medikoo.com + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/es5-ext/README.md b/node_modules/es5-ext/README.md new file mode 100644 index 0000000..c7f09cd --- /dev/null +++ b/node_modules/es5-ext/README.md @@ -0,0 +1,1039 @@ +[![Build status][nix-build-image]][nix-build-url] +[![Windows status][win-build-image]][win-build-url] +![Transpilation status][transpilation-image] +[![npm version][npm-image]][npm-url] + +# es5-ext + +## ECMAScript 5 extensions + +### (with respect to ECMAScript 6 standard) + +Shims for upcoming ES6 standard and other goodies implemented strictly with ECMAScript conventions in mind. + +It's designed to be used in compliant ECMAScript 5 or ECMAScript 6 environments. Older environments are not supported, although most of the features should work with correct ECMAScript 5 shim on board. + +When used in ECMAScript 6 environment, native implementation (if valid) takes precedence over shims. + +### Installation + + $ npm install es5-ext + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +### Usage + +#### ECMAScript 6 features + +You can force ES6 features to be implemented in your environment, e.g. following will assign `from` function to `Array` (only if it's not implemented already). + +```javascript +require("es5-ext/array/from/implement"); +Array.from("foo"); // ['f', 'o', 'o'] +``` + +You can also access shims directly, without fixing native objects. Following will return native `Array.from` if it's available and fallback to shim if it's not. + +```javascript +var aFrom = require("es5-ext/array/from"); +aFrom("foo"); // ['f', 'o', 'o'] +``` + +If you want to use shim unconditionally (even if native implementation exists) do: + +```javascript +var aFrom = require("es5-ext/array/from/shim"); +aFrom("foo"); // ['f', 'o', 'o'] +``` + +##### List of ES6 shims + +It's about properties introduced with ES6 and those that have been updated in new spec. + +- `Array.from` -> `require('es5-ext/array/from')` +- `Array.of` -> `require('es5-ext/array/of')` +- `Array.prototype.concat` -> `require('es5-ext/array/#/concat')` +- `Array.prototype.copyWithin` -> `require('es5-ext/array/#/copy-within')` +- `Array.prototype.entries` -> `require('es5-ext/array/#/entries')` +- `Array.prototype.fill` -> `require('es5-ext/array/#/fill')` +- `Array.prototype.filter` -> `require('es5-ext/array/#/filter')` +- `Array.prototype.find` -> `require('es5-ext/array/#/find')` +- `Array.prototype.findIndex` -> `require('es5-ext/array/#/find-index')` +- `Array.prototype.keys` -> `require('es5-ext/array/#/keys')` +- `Array.prototype.map` -> `require('es5-ext/array/#/map')` +- `Array.prototype.slice` -> `require('es5-ext/array/#/slice')` +- `Array.prototype.splice` -> `require('es5-ext/array/#/splice')` +- `Array.prototype.values` -> `require('es5-ext/array/#/values')` +- `Array.prototype[@@iterator]` -> `require('es5-ext/array/#/@@iterator')` +- `Math.acosh` -> `require('es5-ext/math/acosh')` +- `Math.asinh` -> `require('es5-ext/math/asinh')` +- `Math.atanh` -> `require('es5-ext/math/atanh')` +- `Math.cbrt` -> `require('es5-ext/math/cbrt')` +- `Math.clz32` -> `require('es5-ext/math/clz32')` +- `Math.cosh` -> `require('es5-ext/math/cosh')` +- `Math.exmp1` -> `require('es5-ext/math/expm1')` +- `Math.fround` -> `require('es5-ext/math/fround')` +- `Math.hypot` -> `require('es5-ext/math/hypot')` +- `Math.imul` -> `require('es5-ext/math/imul')` +- `Math.log1p` -> `require('es5-ext/math/log1p')` +- `Math.log2` -> `require('es5-ext/math/log2')` +- `Math.log10` -> `require('es5-ext/math/log10')` +- `Math.sign` -> `require('es5-ext/math/sign')` +- `Math.signh` -> `require('es5-ext/math/signh')` +- `Math.tanh` -> `require('es5-ext/math/tanh')` +- `Math.trunc` -> `require('es5-ext/math/trunc')` +- `Number.EPSILON` -> `require('es5-ext/number/epsilon')` +- `Number.MAX_SAFE_INTEGER` -> `require('es5-ext/number/max-safe-integer')` +- `Number.MIN_SAFE_INTEGER` -> `require('es5-ext/number/min-safe-integer')` +- `Number.isFinite` -> `require('es5-ext/number/is-finite')` +- `Number.isInteger` -> `require('es5-ext/number/is-integer')` +- `Number.isNaN` -> `require('es5-ext/number/is-nan')` +- `Number.isSafeInteger` -> `require('es5-ext/number/is-safe-integer')` +- `Object.assign` -> `require('es5-ext/object/assign')` +- `Object.keys` -> `require('es5-ext/object/keys')` +- `Object.setPrototypeOf` -> `require('es5-ext/object/set-prototype-of')` +- `Promise.prototype.finally` -> `require('es5-ext/promise/#/finally')` +- `RegExp.prototype.match` -> `require('es5-ext/reg-exp/#/match')` +- `RegExp.prototype.replace` -> `require('es5-ext/reg-exp/#/replace')` +- `RegExp.prototype.search` -> `require('es5-ext/reg-exp/#/search')` +- `RegExp.prototype.split` -> `require('es5-ext/reg-exp/#/split')` +- `RegExp.prototype.sticky` -> Implement with `require('es5-ext/reg-exp/#/sticky/implement')`, use as function with `require('es5-ext/reg-exp/#/is-sticky')` +- `RegExp.prototype.unicode` -> Implement with `require('es5-ext/reg-exp/#/unicode/implement')`, use as function with `require('es5-ext/reg-exp/#/is-unicode')` +- `String.fromCodePoint` -> `require('es5-ext/string/from-code-point')` +- `String.raw` -> `require('es5-ext/string/raw')` +- `String.prototype.codePointAt` -> `require('es5-ext/string/#/code-point-at')` +- `String.prototype.contains` -> `require('es5-ext/string/#/contains')` +- `String.prototype.endsWith` -> `require('es5-ext/string/#/ends-with')` +- `String.prototype.normalize` -> `require('es5-ext/string/#/normalize')` +- `String.prototype.repeat` -> `require('es5-ext/string/#/repeat')` +- `String.prototype.startsWith` -> `require('es5-ext/string/#/starts-with')` +- `String.prototype[@@iterator]` -> `require('es5-ext/string/#/@@iterator')` + +#### Non ECMAScript standard features + +**es5-ext** provides also other utils, and implements them as if they were proposed for a standard. It mostly offers methods (not functions) which can directly be assigned to native prototypes: + +```javascript +Object.defineProperty(Function.prototype, "partial", { + value: require("es5-ext/function/#/partial"), + configurable: true, + enumerable: false, + writable: true +}); +Object.defineProperty(Array.prototype, "flatten", { + value: require("es5-ext/array/#/flatten"), + configurable: true, + enumerable: false, + writable: true +}); +Object.defineProperty(String.prototype, "capitalize", { + value: require("es5-ext/string/#/capitalize"), + configurable: true, + enumerable: false, + writable: true +}); +``` + +See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you. + +**Important:** Remember to **not** extend natives in scope of generic reusable packages (e.g. ones you intend to publish to npm). Extending natives is fine **only** if you're the _owner_ of the global scope, so e.g. in final project you lead development of. + +When you're in situation when native extensions are not good idea, then you should use methods indirectly: + +```javascript +var flatten = require("es5-ext/array/#/flatten"); + +flatten.call([1, [2, [3, 4]]]); // [1, 2, 3, 4] +``` + +for better convenience you can turn methods into functions: + +```javascript +var call = Function.prototype.call; +var flatten = call.bind(require("es5-ext/array/#/flatten")); + +flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4] +``` + +You can configure custom toolkit (like [underscorejs](http://underscorejs.org/)), and use it throughout your application + +```javascript +var util = {}; +util.partial = call.bind(require("es5-ext/function/#/partial")); +util.flatten = call.bind(require("es5-ext/array/#/flatten")); +util.startsWith = call.bind(require("es5-ext/string/#/starts-with")); + +util.flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4] +``` + +As with native ones most methods are generic and can be run on any type of object. + +## API + +### Global extensions + +#### global _(es5-ext/global)_ + +Object that represents global scope + +### Array Constructor extensions + +#### from(arrayLike[, mapFn[, thisArg]]) _(es5-ext/array/from)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from). +Returns array representation of _iterable_ or _arrayLike_. If _arrayLike_ is an instance of array, its copy is returned. + +#### generate([length[, …fill]]) _(es5-ext/array/generate)_ + +Generate an array of pre-given _length_ built of repeated arguments. + +#### isPlainArray(x) _(es5-ext/array/is-plain-array)_ + +Returns true if object is plain array (not instance of one of the Array's extensions). + +#### of([…items]) _(es5-ext/array/of)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.of). +Create an array from given arguments. + +#### toArray(obj) _(es5-ext/array/to-array)_ + +Returns array representation of `obj`. If `obj` is already an array, `obj` is returned back. + +#### validArray(obj) _(es5-ext/array/valid-array)_ + +Returns `obj` if it's an array, otherwise throws `TypeError` + +### Array Prototype extensions + +#### arr.binarySearch(compareFn) _(es5-ext/array/#/binary-search)_ + +In **sorted** list search for index of item for which _compareFn_ returns value closest to _0_. +It's variant of binary search algorithm + +#### arr.clear() _(es5-ext/array/#/clear)_ + +Clears the array + +#### arr.compact() _(es5-ext/array/#/compact)_ + +Returns a copy of the context with all non-values (`null` or `undefined`) removed. + +#### arr.concat() _(es5-ext/array/#/concat)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.concat). +ES6's version of `concat`. Supports `isConcatSpreadable` symbol, and returns array of same type as the context. + +#### arr.contains(searchElement[, position]) _(es5-ext/array/#/contains)_ + +Whether list contains the given value. + +#### arr.copyWithin(target, start[, end]) _(es5-ext/array/#/copy-within)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.copywithin). + +#### arr.diff(other) _(es5-ext/array/#/diff)_ + +Returns the array of elements that are present in context list but not present in other list. + +#### arr.eIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-index-of)_ + +_egal_ version of `indexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision + +#### arr.eLastIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-last-index-of)_ + +_egal_ version of `lastIndexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision + +#### arr.entries() _(es5-ext/array/#/entries)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.entries). +Returns iterator object, which traverses the array. Each value is represented with an array, where first value is an index and second is corresponding to index value. + +#### arr.exclusion([…lists]]) _(es5-ext/array/#/exclusion)_ + +Returns the array of elements that are found only in one of the lists (either context list or list provided in arguments). + +#### arr.fill(value[, start, end]) _(es5-ext/array/#/fill)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.fill). + +#### arr.filter(callback[, thisArg]) _(es5-ext/array/#/filter)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.filter). +ES6's version of `filter`, returns array of same type as the context. + +#### arr.find(predicate[, thisArg]) _(es5-ext/array/#/find)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.find). +Return first element for which given function returns true + +#### arr.findIndex(predicate[, thisArg]) _(es5-ext/array/#/find-index)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.findindex). +Return first index for which given function returns true + +#### arr.first() _(es5-ext/array/#/first)_ + +Returns value for first defined index + +#### arr.firstIndex() _(es5-ext/array/#/first-index)_ + +Returns first declared index of the array + +#### arr.flatten() _(es5-ext/array/#/flatten)_ + +Returns flattened version of the array + +#### arr.forEachRight(cb[, thisArg]) _(es5-ext/array/#/for-each-right)_ + +`forEach` starting from last element + +#### arr.group(cb[, thisArg]) _(es5-ext/array/#/group)_ + +Group list elements by value returned by _cb_ function + +#### arr.indexesOf(searchElement[, fromIndex]) _(es5-ext/array/#/indexes-of)_ + +Returns array of all indexes of given value + +#### arr.intersection([…lists]) _(es5-ext/array/#/intersection)_ + +Computes the array of values that are the intersection of all lists (context list and lists given in arguments) + +#### arr.isCopy(other) _(es5-ext/array/#/is-copy)_ + +Returns true if both context and _other_ lists have same content + +#### arr.isUniq() _(es5-ext/array/#/is-uniq)_ + +Returns true if all values in array are unique + +#### arr.keys() _(es5-ext/array/#/keys)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.keys). +Returns iterator object, which traverses all array indexes. + +#### arr.last() _(es5-ext/array/#/last)_ + +Returns value of last defined index + +#### arr.lastIndex() _(es5-ext/array/#/last)_ + +Returns last defined index of the array + +#### arr.map(callback[, thisArg]) _(es5-ext/array/#/map)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.map). +ES6's version of `map`, returns array of same type as the context. + +#### arr.remove(value[, …valuen]) _(es5-ext/array/#/remove)_ + +Remove values from the array + +#### arr.separate(sep) _(es5-ext/array/#/separate)_ + +Returns array with items separated with `sep` value + +#### arr.slice(callback[, thisArg]) _(es5-ext/array/#/slice)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.slice). +ES6's version of `slice`, returns array of same type as the context. + +#### arr.someRight(cb[, thisArg]) _(es5-ext/array/#/someRight)_ + +`some` starting from last element + +#### arr.splice(callback[, thisArg]) _(es5-ext/array/#/splice)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.splice). +ES6's version of `splice`, returns array of same type as the context. + +#### arr.uniq() _(es5-ext/array/#/uniq)_ + +Returns duplicate-free version of the array + +#### arr.values() _(es5-ext/array/#/values)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.values). +Returns iterator object which traverses all array values. + +#### arr[@@iterator] _(es5-ext/array/#/@@iterator)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype-@@iterator). +Returns iterator object which traverses all array values. + +### Boolean Constructor extensions + +#### isBoolean(x) _(es5-ext/boolean/is-boolean)_ + +Whether value is boolean + +### Date Constructor extensions + +#### isDate(x) _(es5-ext/date/is-date)_ + +Whether value is date instance + +#### validDate(x) _(es5-ext/date/valid-date)_ + +If given object is not date throw TypeError in other case return it. + +### Date Prototype extensions + +#### date.copy(date) _(es5-ext/date/#/copy)_ + +Returns a copy of the date object + +#### date.daysInMonth() _(es5-ext/date/#/days-in-month)_ + +Returns number of days of date's month + +#### date.floorDay() _(es5-ext/date/#/floor-day)_ + +Sets the date time to 00:00:00.000 + +#### date.floorMonth() _(es5-ext/date/#/floor-month)_ + +Sets date day to 1 and date time to 00:00:00.000 + +#### date.floorYear() _(es5-ext/date/#/floor-year)_ + +Sets date month to 0, day to 1 and date time to 00:00:00.000 + +#### date.format(pattern) _(es5-ext/date/#/format)_ + +Formats date up to given string. Supported patterns: + +- `%Y` - Year with century, 1999, 2003 +- `%y` - Year without century, 99, 03 +- `%m` - Month, 01..12 +- `%d` - Day of the month 01..31 +- `%H` - Hour (24-hour clock), 00..23 +- `%M` - Minute, 00..59 +- `%S` - Second, 00..59 +- `%L` - Milliseconds, 000..999 + +### Error Constructor extensions + +#### custom(message/_, code, ext_/) _(es5-ext/error/custom)_ + +Creates custom error object, optinally extended with `code` and other extension properties (provided with `ext` object) + +#### isError(x) _(es5-ext/error/is-error)_ + +Whether value is an error (instance of `Error`). + +#### validError(x) _(es5-ext/error/valid-error)_ + +If given object is not error throw TypeError in other case return it. + +### Error Prototype extensions + +#### err.throw() _(es5-ext/error/#/throw)_ + +Throws error + +### Function Constructor extensions + +Some of the functions were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele + +#### constant(x) _(es5-ext/function/constant)_ + +Returns a constant function that returns pregiven argument + +_k(x)(y) =def x_ + +#### identity(x) _(es5-ext/function/identity)_ + +Identity function. Returns first argument + +_i(x) =def x_ + +#### invoke(name[, …args]) _(es5-ext/function/invoke)_ + +Returns a function that takes an object as an argument, and applies object's +_name_ method to arguments. +_name_ can be name of the method or method itself. + +_invoke(name, …args)(object, …args2) =def object\[name\]\(…args, …args2\)_ + +#### isArguments(x) _(es5-ext/function/is-arguments)_ + +Whether value is arguments object + +#### isFunction(arg) _(es5-ext/function/is-function)_ + +Whether value is instance of function + +#### noop() _(es5-ext/function/noop)_ + +No operation function + +#### pluck(name) _(es5-ext/function/pluck)_ + +Returns a function that takes an object, and returns the value of its _name_ +property + +_pluck(name)(obj) =def obj[name]_ + +#### validFunction(arg) _(es5-ext/function/valid-function)_ + +If given object is not function throw TypeError in other case return it. + +### Function Prototype extensions + +Some of the methods were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele + +#### fn.compose([…fns]) _(es5-ext/function/#/compose)_ + +Applies the functions in reverse argument-list order. + +_f1.compose(f2, f3, f4)(…args) =def f1(f2(f3(f4(…arg))))_ + +`compose` can also be used in plain function form as: + +_compose(f1, f2, f3, f4)(…args) =def f1(f2(f3(f4(…arg))))_ + +#### fn.copy() _(es5-ext/function/#/copy)_ + +Produces copy of given function + +#### fn.curry([n]) _(es5-ext/function/#/curry)_ + +Invoking the function returned by this function only _n_ arguments are passed to the underlying function. If the underlying function is not saturated, the result is a function that passes all its arguments to the underlying function. +If _n_ is not provided then it defaults to context function length + +_f.curry(4)(arg1, arg2)(arg3)(arg4) =def f(arg1, args2, arg3, arg4)_ + +#### fn.lock([…args]) _(es5-ext/function/#/lock)_ + +Returns a function that applies the underlying function to _args_, and ignores its own arguments. + +_f.lock(…args)(…args2) =def f(…args)_ + +_Named after it's counterpart in Google Closure_ + +#### fn.not() _(es5-ext/function/#/not)_ + +Returns a function that returns boolean negation of value returned by underlying function. + +_f.not()(…args) =def !f(…args)_ + +#### fn.partial([…args]) _(es5-ext/function/#/partial)_ + +Returns a function that when called will behave like context function called with initially passed arguments. If more arguments are suplilied, they are appended to initial args. + +_f.partial(…args1)(…args2) =def f(…args1, …args2)_ + +#### fn.spread() _(es5-ext/function/#/spread)_ + +Returns a function that applies underlying function with first list argument + +_f.match()(args) =def f.apply(null, args)_ + +#### fn.toStringTokens() _(es5-ext/function/#/to-string-tokens)_ + +Serializes function into two (arguments and body) string tokens. Result is plain object with `args` and `body` properties. + +### Math extensions + +#### acosh(x) _(es5-ext/math/acosh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.acosh). + +#### asinh(x) _(es5-ext/math/asinh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.asinh). + +#### atanh(x) _(es5-ext/math/atanh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.atanh). + +#### cbrt(x) _(es5-ext/math/cbrt)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cbrt). + +#### clz32(x) _(es5-ext/math/clz32)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.clz32). + +#### cosh(x) _(es5-ext/math/cosh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cosh). + +#### expm1(x) _(es5-ext/math/expm1)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.expm1). + +#### fround(x) _(es5-ext/math/fround)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.fround). + +#### hypot([…values]) _(es5-ext/math/hypot)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot). + +#### imul(x, y) _(es5-ext/math/imul)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.imul). + +#### log1p(x) _(es5-ext/math/log1p)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log1p). + +#### log2(x) _(es5-ext/math/log2)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log2). + +#### log10(x) _(es5-ext/math/log10)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log10). + +#### sign(x) _(es5-ext/math/sign)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sign). + +#### sinh(x) _(es5-ext/math/sinh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sinh). + +#### tanh(x) _(es5-ext/math/tanh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.tanh). + +#### trunc(x) _(es5-ext/math/trunc)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.trunc). + +### Number Constructor extensions + +#### EPSILON _(es5-ext/number/epsilon)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.epsilon). + +The difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately 2.2204460492503130808472633361816 x 10-16. + +#### isFinite(x) _(es5-ext/number/is-finite)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite). +Whether value is finite. Differs from global isNaN that it doesn't do type coercion. + +#### isInteger(x) _(es5-ext/number/is-integer)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isinteger). +Whether value is integer. + +#### isNaN(x) _(es5-ext/number/is-nan)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isnan). +Whether value is NaN. Differs from global isNaN that it doesn't do type coercion. + +#### isNumber(x) _(es5-ext/number/is-number)_ + +Whether given value is number + +#### isSafeInteger(x) _(es5-ext/number/is-safe-integer)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.issafeinteger). + +#### MAX*SAFE_INTEGER *(es5-ext/number/max-safe-integer)\_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.maxsafeinteger). +The value of Number.MAX_SAFE_INTEGER is 9007199254740991. + +#### MIN*SAFE_INTEGER *(es5-ext/number/min-safe-integer)\_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.minsafeinteger). +The value of Number.MIN_SAFE_INTEGER is -9007199254740991 (253-1). + +#### toInteger(x) _(es5-ext/number/to-integer)_ + +Converts value to integer + +#### toPosInteger(x) _(es5-ext/number/to-pos-integer)_ + +Converts value to positive integer. If provided value is less than 0, then 0 is returned + +#### toUint32(x) _(es5-ext/number/to-uint32)_ + +Converts value to unsigned 32 bit integer. This type is used for array lengths. +See: http://www.2ality.com/2012/02/js-integers.html + +### Number Prototype extensions + +#### num.pad(length[, precision]) _(es5-ext/number/#/pad)_ + +Pad given number with zeros. Returns string + +### Object Constructor extensions + +#### assign(target, source[, …sourcen]) _(es5-ext/object/assign)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign). +Extend _target_ by enumerable own properties of other objects. If properties are already set on target object, they will be overwritten. + +#### clear(obj) _(es5-ext/object/clear)_ + +Remove all enumerable own properties of the object + +#### compact(obj) _(es5-ext/object/compact)_ + +Returns copy of the object with all enumerable properties that have no falsy values + +#### compare(obj1, obj2) _(es5-ext/object/compare)_ + +Universal cross-type compare function. To be used for e.g. array sort. + +#### copy(obj) _(es5-ext/object/copy)_ + +Returns copy of the object with all enumerable properties. + +#### copyDeep(obj) _(es5-ext/object/copy-deep)_ + +Returns deep copy of the object with all enumerable properties. + +#### count(obj) _(es5-ext/object/count)_ + +Counts number of enumerable own properties on object + +#### create(obj[, properties]) _(es5-ext/object/create)_ + +`Object.create` alternative that provides workaround for [V8 issue](http://code.google.com/p/v8/issues/detail?id=2804). + +When `null` is provided as a prototype, it's substituted with specially prepared object that derives from Object.prototype but has all Object.prototype properties shadowed with undefined. + +It's quirky solution that allows us to have plain objects with no truthy properties but with turnable prototype. + +Use only for objects that you plan to switch prototypes of and be aware of limitations of this workaround. + +#### eq(x, y) _(es5-ext/object/eq)_ + +Whether two values are equal, using [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm. + +#### every(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/every)_ + +Analogous to Array.prototype.every. Returns true if every key-value pair in this object satisfies the provided testing function. +Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### filter(obj, cb[, thisArg]) _(es5-ext/object/filter)_ + +Analogous to Array.prototype.filter. Returns new object with properites for which _cb_ function returned truthy value. + +#### firstKey(obj) _(es5-ext/object/first-key)_ + +Returns first enumerable key of the object, as keys are unordered by specification, it can be any key of an object. + +#### flatten(obj) _(es5-ext/object/flatten)_ + +Returns new object, with flatten properties of input object + +_flatten({ a: { b: 1 }, c: { d: 1 } }) =def { b: 1, d: 1 }_ + +#### forEach(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/for-each)_ + +Analogous to Array.prototype.forEach. Calls a function for each key-value pair found in object +Optionally _compareFn_ can be provided which assures that properties are iterated in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### getPropertyNames() _(es5-ext/object/get-property-names)_ + +Get all (not just own) property names of the object + +#### is(x, y) _(es5-ext/object/is)_ + +Whether two values are equal, using [_SameValue_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm. + +#### isArrayLike(x) _(es5-ext/object/is-array-like)_ + +Whether object is array-like object + +#### isCopy(x, y) _(es5-ext/object/is-copy)_ + +Two values are considered a copy of same value when all of their own enumerable properties have same values. + +#### isCopyDeep(x, y) _(es5-ext/object/is-copy-deep)_ + +Deep comparision of objects + +#### isEmpty(obj) _(es5-ext/object/is-empty)_ + +True if object doesn't have any own enumerable property + +#### isObject(arg) _(es5-ext/object/is-object)_ + +Whether value is not primitive + +#### isPlainObject(arg) _(es5-ext/object/is-plain-object)_ + +Whether object is plain object, its protototype should be Object.prototype and it cannot be host object. + +#### keyOf(obj, searchValue) _(es5-ext/object/key-of)_ + +Search object for value + +#### keys(obj) _(es5-ext/object/keys)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys). +ES6's version of `keys`, doesn't throw on primitive input + +#### map(obj, cb[, thisArg]) _(es5-ext/object/map)_ + +Analogous to Array.prototype.map. Creates a new object with properties which values are results of calling a provided function on every key-value pair in this object. + +#### mapKeys(obj, cb[, thisArg]) _(es5-ext/object/map-keys)_ + +Create new object with same values, but remapped keys + +#### mixin(target, source) _(es5-ext/object/mixin)_ + +Extend _target_ by all own properties of other objects. Properties found in both objects will be overwritten (unless they're not configurable and cannot be overwritten). +_It was for a moment part of ECMAScript 6 draft._ + +#### mixinPrototypes(target, …source]) _(es5-ext/object/mixin-prototypes)_ + +Extends _target_, with all source and source's prototype properties. +Useful as an alternative for `setPrototypeOf` in environments in which it cannot be shimmed (no `__proto__` support). + +#### normalizeOptions(options) _(es5-ext/object/normalize-options)_ + +Normalizes options object into flat plain object. + +Useful for functions in which we either need to keep options object for future reference or need to modify it for internal use. + +- It never returns input `options` object back (always a copy is created) +- `options` can be undefined in such case empty plain object is returned. +- Copies all enumerable properties found down prototype chain. + +#### primitiveSet([…names]) _(es5-ext/object/primitive-set)_ + +Creates `null` prototype based plain object, and sets on it all property names provided in arguments to true. + +#### safeTraverse(obj[, …names]) _(es5-ext/object/safe-traverse)_ + +Safe navigation of object properties. See http://wiki.ecmascript.org/doku.php?id=strawman:existential_operator + +#### serialize(value) _(es5-ext/object/serialize)_ + +Serialize value into string. Differs from [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that it serializes also dates, functions and regular expresssions. + +#### setPrototypeOf(object, proto) _(es5-ext/object/set-prototype-of)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof). +If native version is not provided, it depends on existence of `__proto__` functionality, if it's missing, `null` instead of function is exposed. + +#### some(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/some)_ + +Analogous to Array.prototype.some Returns true if any key-value pair satisfies the provided +testing function. +Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### toArray(obj[, cb[, thisArg[, compareFn]]]) _(es5-ext/object/to-array)_ + +Creates an array of results of calling a provided function on every key-value pair in this object. +Optionally _compareFn_ can be provided which assures that results are added in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### unserialize(str) _(es5-ext/object/unserialize)_ + +Userializes value previously serialized with [serialize](#serializevalue-es5-extobjectserialize) + +#### validCallable(x) _(es5-ext/object/valid-callable)_ + +If given object is not callable throw TypeError in other case return it. + +#### validObject(x) _(es5-ext/object/valid-object)_ + +Throws error if given value is not an object, otherwise it is returned. + +#### validValue(x) _(es5-ext/object/valid-value)_ + +Throws error if given value is `null` or `undefined`, otherwise returns value. + +### Promise Prototype extensions + +#### promise.finally(onFinally) _(es5-ext/promise/#/finally)_ + +[_Introduced with ECMAScript 2018_](https://tc39.github.io/ecma262/#sec-promise.prototype.finally). + +### RegExp Constructor extensions + +#### escape(str) _(es5-ext/reg-exp/escape)_ + +Escapes string to be used in regular expression + +#### isRegExp(x) _(es5-ext/reg-exp/is-reg-exp)_ + +Whether object is regular expression + +#### validRegExp(x) _(es5-ext/reg-exp/valid-reg-exp)_ + +If object is regular expression it is returned, otherwise TypeError is thrown. + +### RegExp Prototype extensions + +#### re.isSticky(x) _(es5-ext/reg-exp/#/is-sticky)_ + +Whether regular expression has `sticky` flag. + +It's to be used as counterpart to [regExp.sticky](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.sticky) if it's not implemented. + +#### re.isUnicode(x) _(es5-ext/reg-exp/#/is-unicode)_ + +Whether regular expression has `unicode` flag. + +It's to be used as counterpart to [regExp.unicode](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.unicode) if it's not implemented. + +#### re.match(string) _(es5-ext/reg-exp/#/match)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.match). + +#### re.replace(string, replaceValue) _(es5-ext/reg-exp/#/replace)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.replace). + +#### re.search(string) _(es5-ext/reg-exp/#/search)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.search). + +#### re.split(string) _(es5-ext/reg-exp/#/search)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.split). + +#### re.sticky _(es5-ext/reg-exp/#/sticky/implement)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.sticky). +It's a getter, so only `implement` and `is-implemented` modules are provided. + +#### re.unicode _(es5-ext/reg-exp/#/unicode/implement)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.unicode). +It's a getter, so only `implement` and `is-implemented` modules are provided. + +### String Constructor extensions + +#### formatMethod(fMap) _(es5-ext/string/format-method)_ + +Creates format method. It's used e.g. to create `Date.prototype.format` method + +#### fromCodePoint([…codePoints]) _(es5-ext/string/from-code-point)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.fromcodepoint) + +#### isString(x) _(es5-ext/string/is-string)_ + +Whether object is string + +#### randomUniq() _(es5-ext/string/random-uniq)_ + +Returns randomly generated id, with guarantee of local uniqueness (no same id will be returned twice) + +#### raw(callSite[, …substitutions]) _(es5-ext/string/raw)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.raw) + +### String Prototype extensions + +#### str.at(pos) _(es5-ext/string/#/at)_ + +_Proposed for ECMAScript 6/7 standard, but not (yet) in a draft_ + +Returns a string at given position in Unicode-safe manner. +Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.at). + +#### str.camelToHyphen() _(es5-ext/string/#/camel-to-hyphen)_ + +Convert camelCase string to hyphen separated, e.g. one-two-three -> oneTwoThree. +Useful when converting names from js property convention into filename convention. + +#### str.capitalize() _(es5-ext/string/#/capitalize)_ + +Capitalize first character of a string + +#### str.caseInsensitiveCompare(str) _(es5-ext/string/#/case-insensitive-compare)_ + +Case insensitive compare + +#### str.codePointAt(pos) _(es5-ext/string/#/code-point-at)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.codepointat) + +Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.codePointAt). + +#### str.contains(searchString[, position]) _(es5-ext/string/#/contains)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.contains) + +Whether string contains given string. + +#### str.endsWith(searchString[, endPosition]) _(es5-ext/string/#/ends-with)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith). +Whether strings ends with given string + +#### str.hyphenToCamel() _(es5-ext/string/#/hyphen-to-camel)_ + +Convert hyphen separated string to camelCase, e.g. one-two-three -> oneTwoThree. +Useful when converting names from filename convention to js property name convention. + +#### str.indent(str[, count]) _(es5-ext/string/#/indent)_ + +Indents each line with provided _str_ (if _count_ given then _str_ is repeated _count_ times). + +#### str.last() _(es5-ext/string/#/last)_ + +Return last character + +#### str.normalize([form]) _(es5-ext/string/#/normalize)_ + +[_Introduced with ECMAScript 6_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize). +Returns the Unicode Normalization Form of a given string. +Based on Matsuza's version. Code used for integrated shim can be found at [github.com/walling/unorm](https://github.com/walling/unorm/blob/master/lib/unorm.js) + +#### str.pad(fill[, length]) _(es5-ext/string/#/pad)_ + +Pad string with _fill_. +If _length_ si given than _fill_ is reapated _length_ times. +If _length_ is negative then pad is applied from right. + +#### str.repeat(n) _(es5-ext/string/#/repeat)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.repeat). +Repeat given string _n_ times + +#### str.plainReplace(search, replace) _(es5-ext/string/#/plain-replace)_ + +Simple `replace` version. Doesn't support regular expressions. Replaces just first occurrence of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _\$_ characters escape in such case). + +#### str.plainReplaceAll(search, replace) _(es5-ext/string/#/plain-replace-all)_ + +Simple `replace` version. Doesn't support regular expressions. Replaces all occurrences of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _\$_ characters escape in such case). + +#### str.startsWith(searchString[, position]) _(es5-ext/string/#/starts-with)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith). +Whether strings starts with given string + +#### str[@@iterator] _(es5-ext/string/#/@@iterator)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype-@@iterator). +Returns iterator object which traverses all string characters (with respect to unicode symbols) + +### Tests + + $ npm test + +## Security contact information + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + +## es5-ext for enterprise + +Available as part of the Tidelift Subscription + +The maintainers of es5-ext and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-es5-ext?utm_source=npm-es5-ext&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +[nix-build-image]: https://semaphoreci.com/api/v1/medikoo-org/es5-ext/branches/master/shields_badge.svg +[nix-build-url]: https://semaphoreci.com/medikoo-org/es5-ext +[win-build-image]: https://ci.appveyor.com/api/projects/status/3jox67ksw3p8hkwh/branch/master?svg=true +[win-build-url]: https://ci.appveyor.com/project/medikoo/es5-ext +[transpilation-image]: https://img.shields.io/badge/transpilation-free-brightgreen.svg +[npm-image]: https://img.shields.io/npm/v/es5-ext.svg +[npm-url]: https://www.npmjs.com/package/es5-ext diff --git a/node_modules/es5-ext/array/#/@@iterator/implement.js b/node_modules/es5-ext/array/#/@@iterator/implement.js new file mode 100644 index 0000000..8073f2b --- /dev/null +++ b/node_modules/es5-ext/array/#/@@iterator/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, require("es6-symbol").iterator, { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/array/#/@@iterator/index.js b/node_modules/es5-ext/array/#/@@iterator/index.js new file mode 100644 index 0000000..1d0a389 --- /dev/null +++ b/node_modules/es5-ext/array/#/@@iterator/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Array.prototype[require("es6-symbol").iterator] + : require("./shim"); diff --git a/node_modules/es5-ext/array/#/@@iterator/is-implemented.js b/node_modules/es5-ext/array/#/@@iterator/is-implemented.js new file mode 100644 index 0000000..6445c04 --- /dev/null +++ b/node_modules/es5-ext/array/#/@@iterator/is-implemented.js @@ -0,0 +1,16 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function () { + var arr = ["foo", 1], iterator, result; + if (typeof arr[iteratorSymbol] !== "function") return false; + iterator = arr[iteratorSymbol](); + if (!iterator) return false; + if (typeof iterator.next !== "function") return false; + result = iterator.next(); + if (!result) return false; + if (result.value !== "foo") return false; + if (result.done !== false) return false; + return true; +}; diff --git a/node_modules/es5-ext/array/#/@@iterator/shim.js b/node_modules/es5-ext/array/#/@@iterator/shim.js new file mode 100644 index 0000000..307b1c0 --- /dev/null +++ b/node_modules/es5-ext/array/#/@@iterator/shim.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("../values/shim"); diff --git a/node_modules/es5-ext/array/#/_compare-by-length.js b/node_modules/es5-ext/array/#/_compare-by-length.js new file mode 100644 index 0000000..db5a040 --- /dev/null +++ b/node_modules/es5-ext/array/#/_compare-by-length.js @@ -0,0 +1,7 @@ +// Used internally to sort array of lists by length + +"use strict"; + +var toPosInt = require("../../number/to-pos-integer"); + +module.exports = function (arr1, arr2) { return toPosInt(arr1.length) - toPosInt(arr2.length); }; diff --git a/node_modules/es5-ext/array/#/binary-search.js b/node_modules/es5-ext/array/#/binary-search.js new file mode 100644 index 0000000..bdabe27 --- /dev/null +++ b/node_modules/es5-ext/array/#/binary-search.js @@ -0,0 +1,27 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , callable = require("../../object/valid-callable") + , value = require("../../object/valid-value") + , floor = Math.floor; + +module.exports = function (compareFn) { + var length, low, high, middle; + + value(this); + callable(compareFn); + + length = toPosInt(this.length); + low = 0; + high = length - 1; + + while (low <= high) { + middle = floor((low + high) / 2); + if (compareFn(this[middle]) < 0) high = middle - 1; + else low = middle + 1; + } + + if (high < 0) return 0; + if (high >= length) return length - 1; + return high; +}; diff --git a/node_modules/es5-ext/array/#/clear.js b/node_modules/es5-ext/array/#/clear.js new file mode 100644 index 0000000..fd539c9 --- /dev/null +++ b/node_modules/es5-ext/array/#/clear.js @@ -0,0 +1,12 @@ +// Inspired by Google Closure: +// http://closure-library.googlecode.com/svn/docs/ +// closure_goog_array_array.js.html#goog.array.clear + +"use strict"; + +var value = require("../../object/valid-value"); + +module.exports = function () { + value(this).length = 0; + return this; +}; diff --git a/node_modules/es5-ext/array/#/compact.js b/node_modules/es5-ext/array/#/compact.js new file mode 100644 index 0000000..462e100 --- /dev/null +++ b/node_modules/es5-ext/array/#/compact.js @@ -0,0 +1,11 @@ +// Inspired by: http://documentcloud.github.com/underscore/#compact + +"use strict"; + +var isValue = require("../../object/is-value"); + +var filter = Array.prototype.filter; + +module.exports = function () { + return filter.call(this, function (val) { return isValue(val); }); +}; diff --git a/node_modules/es5-ext/array/#/concat/implement.js b/node_modules/es5-ext/array/#/concat/implement.js new file mode 100644 index 0000000..714a3c1 --- /dev/null +++ b/node_modules/es5-ext/array/#/concat/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "concat", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/array/#/concat/index.js b/node_modules/es5-ext/array/#/concat/index.js new file mode 100644 index 0000000..deac0ee --- /dev/null +++ b/node_modules/es5-ext/array/#/concat/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.prototype.concat : require("./shim"); diff --git a/node_modules/es5-ext/array/#/concat/is-implemented.js b/node_modules/es5-ext/array/#/concat/is-implemented.js new file mode 100644 index 0000000..ba5a154 --- /dev/null +++ b/node_modules/es5-ext/array/#/concat/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +var SubArray = require("../../_sub-array-dummy-safe"); + +module.exports = function () { return new SubArray().concat("foo") instanceof SubArray; }; diff --git a/node_modules/es5-ext/array/#/concat/shim.js b/node_modules/es5-ext/array/#/concat/shim.js new file mode 100644 index 0000000..7e00f27 --- /dev/null +++ b/node_modules/es5-ext/array/#/concat/shim.js @@ -0,0 +1,44 @@ +"use strict"; + +var isPlainArray = require("../../is-plain-array") + , toPosInt = require("../../../number/to-pos-integer") + , isObject = require("../../../object/is-object") + , isConcatSpreadable = require("es6-symbol").isConcatSpreadable + , isArray = Array.isArray + , concat = Array.prototype.concat + , forEach = Array.prototype.forEach + , isSpreadable; + +isSpreadable = function (value) { + if (!value) return false; + if (!isObject(value)) return false; + if (value[isConcatSpreadable] !== undefined) { + return Boolean(value[isConcatSpreadable]); + } + return isArray(value); +}; + +// eslint-disable-next-line no-unused-vars +module.exports = function (item/*, …items*/) { + var result; + if (!this || !isArray(this) || isPlainArray(this)) { + return concat.apply(this, arguments); + } + result = new this.constructor(); + if (isSpreadable(this)) { + forEach.call(this, function (val, i) { result[i] = val; }); + } else { + result[0] = this; + } + forEach.call(arguments, function (arg) { + var base; + if (isSpreadable(arg)) { + base = result.length; + result.length += toPosInt(arg.length); + forEach.call(arg, function (val, i) { result[base + i] = val; }); + return; + } + result.push(arg); + }); + return result; +}; diff --git a/node_modules/es5-ext/array/#/contains.js b/node_modules/es5-ext/array/#/contains.js new file mode 100644 index 0000000..cde6850 --- /dev/null +++ b/node_modules/es5-ext/array/#/contains.js @@ -0,0 +1,7 @@ +"use strict"; + +var indexOf = require("./e-index-of"); + +module.exports = function (searchElement/*, position*/) { + return indexOf.call(this, searchElement, arguments[1]) > -1; +}; diff --git a/node_modules/es5-ext/array/#/copy-within/implement.js b/node_modules/es5-ext/array/#/copy-within/implement.js new file mode 100644 index 0000000..4658fcb --- /dev/null +++ b/node_modules/es5-ext/array/#/copy-within/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "copyWithin", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/array/#/copy-within/index.js b/node_modules/es5-ext/array/#/copy-within/index.js new file mode 100644 index 0000000..37db0ec --- /dev/null +++ b/node_modules/es5-ext/array/#/copy-within/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.prototype.copyWithin : require("./shim"); diff --git a/node_modules/es5-ext/array/#/copy-within/is-implemented.js b/node_modules/es5-ext/array/#/copy-within/is-implemented.js new file mode 100644 index 0000000..40c499e --- /dev/null +++ b/node_modules/es5-ext/array/#/copy-within/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var arr = [1, 2, 3, 4, 5]; + if (typeof arr.copyWithin !== "function") return false; + return String(arr.copyWithin(1, 3)) === "1,4,5,4,5"; +}; diff --git a/node_modules/es5-ext/array/#/copy-within/shim.js b/node_modules/es5-ext/array/#/copy-within/shim.js new file mode 100644 index 0000000..6ed7e44 --- /dev/null +++ b/node_modules/es5-ext/array/#/copy-within/shim.js @@ -0,0 +1,45 @@ +// Taken from: https://github.com/paulmillr/es6-shim/ + +"use strict"; + +var toInteger = require("../../../number/to-integer") + , toPosInt = require("../../../number/to-pos-integer") + , validValue = require("../../../object/valid-value") + , objHasOwnProperty = Object.prototype.hasOwnProperty + , max = Math.max + , min = Math.min; + +module.exports = function (target, start/*, end*/) { + var arr = validValue(this) + , end = arguments[2] + , length = toPosInt(arr.length) + , to + , from + , fin + , count + , direction; + + target = toInteger(target); + start = toInteger(start); + end = end === undefined ? length : toInteger(end); + + to = target < 0 ? max(length + target, 0) : min(target, length); + from = start < 0 ? max(length + start, 0) : min(start, length); + fin = end < 0 ? max(length + end, 0) : min(end, length); + count = min(fin - from, length - to); + direction = 1; + + if (from < to && to < from + count) { + direction = -1; + from += count - 1; + to += count - 1; + } + while (count > 0) { + if (objHasOwnProperty.call(arr, from)) arr[to] = arr[from]; + else delete arr[from]; + from += direction; + to += direction; + count -= 1; + } + return arr; +}; diff --git a/node_modules/es5-ext/array/#/diff.js b/node_modules/es5-ext/array/#/diff.js new file mode 100644 index 0000000..002e6a3 --- /dev/null +++ b/node_modules/es5-ext/array/#/diff.js @@ -0,0 +1,11 @@ +"use strict"; + +var value = require("../../object/valid-value") + , contains = require("./contains") + , filter = Array.prototype.filter; + +module.exports = function (other) { + value(this); + value(other); + return filter.call(this, function (item) { return !contains.call(other, item); }); +}; diff --git a/node_modules/es5-ext/array/#/e-index-of.js b/node_modules/es5-ext/array/#/e-index-of.js new file mode 100644 index 0000000..e3ed14e --- /dev/null +++ b/node_modules/es5-ext/array/#/e-index-of.js @@ -0,0 +1,28 @@ +"use strict"; + +var numberIsNaN = require("../../number/is-nan") + , toPosInt = require("../../number/to-pos-integer") + , value = require("../../object/valid-value") + , indexOf = Array.prototype.indexOf + , objHasOwnProperty = Object.prototype.hasOwnProperty + , abs = Math.abs + , floor = Math.floor; + +module.exports = function (searchElement/*, fromIndex*/) { + var i, length, fromIndex, val; + if (!numberIsNaN(searchElement)) return indexOf.apply(this, arguments); + + length = toPosInt(value(this).length); + fromIndex = arguments[1]; + if (isNaN(fromIndex)) fromIndex = 0; + else if (fromIndex >= 0) fromIndex = floor(fromIndex); + else fromIndex = toPosInt(this.length) - floor(abs(fromIndex)); + + for (i = fromIndex; i < length; ++i) { + if (objHasOwnProperty.call(this, i)) { + val = this[i]; + if (numberIsNaN(val)) return i; // Jslint: ignore + } + } + return -1; +}; diff --git a/node_modules/es5-ext/array/#/e-last-index-of.js b/node_modules/es5-ext/array/#/e-last-index-of.js new file mode 100644 index 0000000..2f6a38a --- /dev/null +++ b/node_modules/es5-ext/array/#/e-last-index-of.js @@ -0,0 +1,31 @@ +"use strict"; + +var numberIsNaN = require("../../number/is-nan") + , toPosInt = require("../../number/to-pos-integer") + , value = require("../../object/valid-value") + , lastIndexOf = Array.prototype.lastIndexOf + , objHasOwnProperty = Object.prototype.hasOwnProperty + , abs = Math.abs + , floor = Math.floor; + +module.exports = function (searchElement/*, fromIndex*/) { + var i, fromIndex, val; + if (!numberIsNaN(searchElement)) { + // Jslint: ignore + return lastIndexOf.apply(this, arguments); + } + + value(this); + fromIndex = arguments[1]; + if (isNaN(fromIndex)) fromIndex = toPosInt(this.length) - 1; + else if (fromIndex >= 0) fromIndex = floor(fromIndex); + else fromIndex = toPosInt(this.length) - floor(abs(fromIndex)); + + for (i = fromIndex; i >= 0; --i) { + if (objHasOwnProperty.call(this, i)) { + val = this[i]; + if (numberIsNaN(val)) return i; // Jslint: ignore + } + } + return -1; +}; diff --git a/node_modules/es5-ext/array/#/entries/implement.js b/node_modules/es5-ext/array/#/entries/implement.js new file mode 100644 index 0000000..b89ce44 --- /dev/null +++ b/node_modules/es5-ext/array/#/entries/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "entries", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/array/#/entries/index.js b/node_modules/es5-ext/array/#/entries/index.js new file mode 100644 index 0000000..e7588f7 --- /dev/null +++ b/node_modules/es5-ext/array/#/entries/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.prototype.entries : require("./shim"); diff --git a/node_modules/es5-ext/array/#/entries/is-implemented.js b/node_modules/es5-ext/array/#/entries/is-implemented.js new file mode 100644 index 0000000..335f1c2 --- /dev/null +++ b/node_modules/es5-ext/array/#/entries/is-implemented.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function () { + var arr = [1, "foo"], iterator, result; + if (typeof arr.entries !== "function") return false; + iterator = arr.entries(); + if (!iterator) return false; + if (typeof iterator.next !== "function") return false; + result = iterator.next(); + if (!result || !result.value) return false; + if (result.value[0] !== 0) return false; + if (result.value[1] !== 1) return false; + if (result.done !== false) return false; + return true; +}; diff --git a/node_modules/es5-ext/array/#/entries/shim.js b/node_modules/es5-ext/array/#/entries/shim.js new file mode 100644 index 0000000..f47af86 --- /dev/null +++ b/node_modules/es5-ext/array/#/entries/shim.js @@ -0,0 +1,4 @@ +"use strict"; + +var ArrayIterator = require("es6-iterator/array"); +module.exports = function () { return new ArrayIterator(this, "key+value"); }; diff --git a/node_modules/es5-ext/array/#/exclusion.js b/node_modules/es5-ext/array/#/exclusion.js new file mode 100644 index 0000000..4e9e71d --- /dev/null +++ b/node_modules/es5-ext/array/#/exclusion.js @@ -0,0 +1,25 @@ +"use strict"; + +var value = require("../../object/valid-value") + , aFrom = require("../from") + , toArray = require("../to-array") + , contains = require("./contains") + , byLength = require("./_compare-by-length") + , filter = Array.prototype.filter + , push = Array.prototype.push; + +module.exports = function (/* …lists*/) { + var lists, seen, result; + if (!arguments.length) return aFrom(this); + push.apply((lists = [this]), arguments); + lists.forEach(value); + seen = []; + result = []; + lists.sort(byLength).forEach(function (list) { + result = result + .filter(function (item) { return !contains.call(list, item); }) + .concat(filter.call(list, function (item) { return !contains.call(seen, item); })); + push.apply(seen, toArray(list)); + }); + return result; +}; diff --git a/node_modules/es5-ext/array/#/fill/implement.js b/node_modules/es5-ext/array/#/fill/implement.js new file mode 100644 index 0000000..0efad16 --- /dev/null +++ b/node_modules/es5-ext/array/#/fill/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "fill", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/array/#/fill/index.js b/node_modules/es5-ext/array/#/fill/index.js new file mode 100644 index 0000000..6a66ae1 --- /dev/null +++ b/node_modules/es5-ext/array/#/fill/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.prototype.fill : require("./shim"); diff --git a/node_modules/es5-ext/array/#/fill/is-implemented.js b/node_modules/es5-ext/array/#/fill/is-implemented.js new file mode 100644 index 0000000..5d6d02e --- /dev/null +++ b/node_modules/es5-ext/array/#/fill/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var arr = [1, 2, 3, 4, 5, 6]; + if (typeof arr.fill !== "function") return false; + return String(arr.fill(-1, -3)) === "1,2,3,-1,-1,-1"; +}; diff --git a/node_modules/es5-ext/array/#/fill/shim.js b/node_modules/es5-ext/array/#/fill/shim.js new file mode 100644 index 0000000..2327d35 --- /dev/null +++ b/node_modules/es5-ext/array/#/fill/shim.js @@ -0,0 +1,25 @@ +// Taken from: https://github.com/paulmillr/es6-shim/ + +"use strict"; + +var toInteger = require("../../../number/to-integer") + , toPosInt = require("../../../number/to-pos-integer") + , validValue = require("../../../object/valid-value") + , max = Math.max + , min = Math.min; + +module.exports = function (value/*, start, end*/) { + var arr = validValue(this) + , start = arguments[1] + , end = arguments[2] + , length = toPosInt(arr.length) + , relativeStart + , i; + + start = start === undefined ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + + relativeStart = start < 0 ? max(length + start, 0) : min(start, length); + for (i = relativeStart; i < length && i < end; ++i) arr[i] = value; + return arr; +}; diff --git a/node_modules/es5-ext/array/#/filter/implement.js b/node_modules/es5-ext/array/#/filter/implement.js new file mode 100644 index 0000000..76f4a5e --- /dev/null +++ b/node_modules/es5-ext/array/#/filter/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "filter", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/array/#/filter/index.js b/node_modules/es5-ext/array/#/filter/index.js new file mode 100644 index 0000000..9a25c9b --- /dev/null +++ b/node_modules/es5-ext/array/#/filter/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.prototype.filter : require("./shim"); diff --git a/node_modules/es5-ext/array/#/filter/is-implemented.js b/node_modules/es5-ext/array/#/filter/is-implemented.js new file mode 100644 index 0000000..6082513 --- /dev/null +++ b/node_modules/es5-ext/array/#/filter/is-implemented.js @@ -0,0 +1,6 @@ +"use strict"; + +var SubArray = require("../../_sub-array-dummy-safe") + , pass = function () { return true; }; + +module.exports = function () { return new SubArray().filter(pass) instanceof SubArray; }; diff --git a/node_modules/es5-ext/array/#/filter/shim.js b/node_modules/es5-ext/array/#/filter/shim.js new file mode 100644 index 0000000..d4ca0cd --- /dev/null +++ b/node_modules/es5-ext/array/#/filter/shim.js @@ -0,0 +1,23 @@ +"use strict"; + +var isPlainArray = require("../../is-plain-array") + , callable = require("../../../object/valid-callable") + , isArray = Array.isArray + , filter = Array.prototype.filter + , forEach = Array.prototype.forEach + , call = Function.prototype.call; + +module.exports = function (callbackFn/*, thisArg*/) { + var result, thisArg, i; + if (!this || !isArray(this) || isPlainArray(this)) { + return filter.apply(this, arguments); + } + callable(callbackFn); + thisArg = arguments[1]; + result = new this.constructor(); + i = 0; + forEach.call(this, function (val, j, self) { + if (call.call(callbackFn, thisArg, val, j, self)) result[i++] = val; + }); + return result; +}; diff --git a/node_modules/es5-ext/array/#/find-index/implement.js b/node_modules/es5-ext/array/#/find-index/implement.js new file mode 100644 index 0000000..4e14e29 --- /dev/null +++ b/node_modules/es5-ext/array/#/find-index/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "findIndex", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/array/#/find-index/index.js b/node_modules/es5-ext/array/#/find-index/index.js new file mode 100644 index 0000000..5e07d8d --- /dev/null +++ b/node_modules/es5-ext/array/#/find-index/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.prototype.findIndex : require("./shim"); diff --git a/node_modules/es5-ext/array/#/find-index/is-implemented.js b/node_modules/es5-ext/array/#/find-index/is-implemented.js new file mode 100644 index 0000000..72aa28f --- /dev/null +++ b/node_modules/es5-ext/array/#/find-index/is-implemented.js @@ -0,0 +1,9 @@ +"use strict"; + +var fn = function (value) { return value > 3; }; + +module.exports = function () { + var arr = [1, 2, 3, 4, 5, 6]; + if (typeof arr.findIndex !== "function") return false; + return arr.findIndex(fn) === 3; +}; diff --git a/node_modules/es5-ext/array/#/find-index/shim.js b/node_modules/es5-ext/array/#/find-index/shim.js new file mode 100644 index 0000000..7db9bef --- /dev/null +++ b/node_modules/es5-ext/array/#/find-index/shim.js @@ -0,0 +1,26 @@ +"use strict"; + +var callable = require("../../../object/valid-callable") + , ensureValue = require("../../../object/valid-value") + , some = Array.prototype.some + , apply = Function.prototype.apply; + +module.exports = function (predicate/*, thisArg*/) { + var k, self; + self = Object(ensureValue(this)); + callable(predicate); + + return some.call( + self, + function (value, index) { + if (apply.call(predicate, this, arguments)) { + k = index; + return true; + } + return false; + }, + arguments[1] + ) + ? k + : -1; +}; diff --git a/node_modules/es5-ext/array/#/find/implement.js b/node_modules/es5-ext/array/#/find/implement.js new file mode 100644 index 0000000..66035a5 --- /dev/null +++ b/node_modules/es5-ext/array/#/find/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "find", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/array/#/find/index.js b/node_modules/es5-ext/array/#/find/index.js new file mode 100644 index 0000000..2f9d0d6 --- /dev/null +++ b/node_modules/es5-ext/array/#/find/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.prototype.find : require("./shim"); diff --git a/node_modules/es5-ext/array/#/find/is-implemented.js b/node_modules/es5-ext/array/#/find/is-implemented.js new file mode 100644 index 0000000..8fdacb1 --- /dev/null +++ b/node_modules/es5-ext/array/#/find/is-implemented.js @@ -0,0 +1,9 @@ +"use strict"; + +var fn = function (value) { return value > 3; }; + +module.exports = function () { + var arr = [1, 2, 3, 4, 5, 6]; + if (typeof arr.find !== "function") return false; + return arr.find(fn) === 4; +}; diff --git a/node_modules/es5-ext/array/#/find/shim.js b/node_modules/es5-ext/array/#/find/shim.js new file mode 100644 index 0000000..bbb0442 --- /dev/null +++ b/node_modules/es5-ext/array/#/find/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +var findIndex = require("../find-index/shim"); + +// eslint-disable-next-line no-unused-vars +module.exports = function (predicate/*, thisArg*/) { + var index = findIndex.apply(this, arguments); + return index === -1 ? undefined : this[index]; +}; diff --git a/node_modules/es5-ext/array/#/first-index.js b/node_modules/es5-ext/array/#/first-index.js new file mode 100644 index 0000000..19bff54 --- /dev/null +++ b/node_modules/es5-ext/array/#/first-index.js @@ -0,0 +1,15 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , value = require("../../object/valid-value") + , objHasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function () { + var i, length; + if (!(length = toPosInt(value(this).length))) return null; + i = 0; + while (!objHasOwnProperty.call(this, i)) { + if (++i === length) return null; + } + return i; +}; diff --git a/node_modules/es5-ext/array/#/first.js b/node_modules/es5-ext/array/#/first.js new file mode 100644 index 0000000..ca76833 --- /dev/null +++ b/node_modules/es5-ext/array/#/first.js @@ -0,0 +1,9 @@ +"use strict"; + +var firstIndex = require("./first-index"); + +module.exports = function () { + var i; + if ((i = firstIndex.call(this)) !== null) return this[i]; + return undefined; +}; diff --git a/node_modules/es5-ext/array/#/flatten.js b/node_modules/es5-ext/array/#/flatten.js new file mode 100644 index 0000000..4016727 --- /dev/null +++ b/node_modules/es5-ext/array/#/flatten.js @@ -0,0 +1,40 @@ +// Stack grow safe implementation + +"use strict"; + +var ensureValue = require("../../object/valid-value") + , isArray = Array.isArray + , objHasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function () { + var input = ensureValue(this), index = 0, remaining, remainingIndexes, length, i, result = []; + // Jslint: ignore + main: while (input) { + length = input.length; + for (i = index; i < length; ++i) { + if (!objHasOwnProperty.call(input, i)) continue; + if (isArray(input[i])) { + if (i < length - 1) { + // eslint-disable-next-line max-depth + if (!remaining) { + remaining = []; + remainingIndexes = []; + } + remaining.push(input); + remainingIndexes.push(i + 1); + } + input = input[i]; + index = 0; + continue main; + } + result.push(input[i]); + } + if (remaining) { + input = remaining.pop(); + index = remainingIndexes.pop(); + } else { + input = null; + } + } + return result; +}; diff --git a/node_modules/es5-ext/array/#/for-each-right.js b/node_modules/es5-ext/array/#/for-each-right.js new file mode 100644 index 0000000..1c6bccc --- /dev/null +++ b/node_modules/es5-ext/array/#/for-each-right.js @@ -0,0 +1,19 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , callable = require("../../object/valid-callable") + , value = require("../../object/valid-value") + , objHasOwnProperty = Object.prototype.hasOwnProperty + , call = Function.prototype.call; + +module.exports = function (cb/*, thisArg*/) { + var i, self, thisArg; + + self = Object(value(this)); + callable(cb); + thisArg = arguments[1]; + + for (i = toPosInt(self.length) - 1; i >= 0; --i) { + if (objHasOwnProperty.call(self, i)) call.call(cb, thisArg, self[i], i, self); + } +}; diff --git a/node_modules/es5-ext/array/#/group.js b/node_modules/es5-ext/array/#/group.js new file mode 100644 index 0000000..7f40e8a --- /dev/null +++ b/node_modules/es5-ext/array/#/group.js @@ -0,0 +1,28 @@ +// Inspired by Underscore's groupBy: +// http://documentcloud.github.com/underscore/#groupBy + +"use strict"; + +var callable = require("../../object/valid-callable") + , value = require("../../object/valid-value") + , forEach = Array.prototype.forEach + , apply = Function.prototype.apply; + +module.exports = function (cb/*, thisArg*/) { + var result; + + value(this); + callable(cb); + + result = Object.create(null); + forEach.call( + this, + function (item) { + var key = apply.call(cb, this, arguments); + if (!result[key]) result[key] = []; + result[key].push(item); + }, + arguments[1] + ); + return result; +}; diff --git a/node_modules/es5-ext/array/#/index.js b/node_modules/es5-ext/array/#/index.js new file mode 100644 index 0000000..596e83b --- /dev/null +++ b/node_modules/es5-ext/array/#/index.js @@ -0,0 +1,41 @@ +"use strict"; + +module.exports = { + "@@iterator": require("./@@iterator"), + "binarySearch": require("./binary-search"), + "clear": require("./clear"), + "compact": require("./compact"), + "concat": require("./concat"), + "contains": require("./contains"), + "copyWithin": require("./copy-within"), + "diff": require("./diff"), + "eIndexOf": require("./e-index-of"), + "eLastIndexOf": require("./e-last-index-of"), + "entries": require("./entries"), + "exclusion": require("./exclusion"), + "fill": require("./fill"), + "filter": require("./filter"), + "find": require("./find"), + "findIndex": require("./find-index"), + "first": require("./first"), + "firstIndex": require("./first-index"), + "flatten": require("./flatten"), + "forEachRight": require("./for-each-right"), + "keys": require("./keys"), + "group": require("./group"), + "indexesOf": require("./indexes-of"), + "intersection": require("./intersection"), + "isCopy": require("./is-copy"), + "isEmpty": require("./is-empty"), + "isUniq": require("./is-uniq"), + "last": require("./last"), + "lastIndex": require("./last-index"), + "map": require("./map"), + "remove": require("./remove"), + "separate": require("./separate"), + "slice": require("./slice"), + "someRight": require("./some-right"), + "splice": require("./splice"), + "uniq": require("./uniq"), + "values": require("./values") +}; diff --git a/node_modules/es5-ext/array/#/indexes-of.js b/node_modules/es5-ext/array/#/indexes-of.js new file mode 100644 index 0000000..1b92132 --- /dev/null +++ b/node_modules/es5-ext/array/#/indexes-of.js @@ -0,0 +1,12 @@ +"use strict"; + +var indexOf = require("./e-index-of"); + +module.exports = function (value/*, fromIndex*/) { + var result = [], i, fromIndex = arguments[1]; + while ((i = indexOf.call(this, value, fromIndex)) !== -1) { + result.push(i); + fromIndex = i + 1; + } + return result; +}; diff --git a/node_modules/es5-ext/array/#/intersection.js b/node_modules/es5-ext/array/#/intersection.js new file mode 100644 index 0000000..7dca9dc --- /dev/null +++ b/node_modules/es5-ext/array/#/intersection.js @@ -0,0 +1,19 @@ +"use strict"; + +var value = require("../../object/valid-value") + , contains = require("./contains") + , byLength = require("./_compare-by-length") + , filter = Array.prototype.filter + , push = Array.prototype.push + , slice = Array.prototype.slice; + +module.exports = function (/* …list*/) { + var lists; + if (!arguments.length) slice.call(this); + push.apply((lists = [this]), arguments); + lists.forEach(value); + lists.sort(byLength); + return lists.reduce(function (list1, list2) { + return filter.call(list1, function (item) { return contains.call(list2, item); }); + }); +}; diff --git a/node_modules/es5-ext/array/#/is-copy.js b/node_modules/es5-ext/array/#/is-copy.js new file mode 100644 index 0000000..1413b95 --- /dev/null +++ b/node_modules/es5-ext/array/#/is-copy.js @@ -0,0 +1,21 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , eq = require("../../object/eq") + , value = require("../../object/valid-value") + , objHasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function (other) { + var i, length; + value(this); + value(other); + length = toPosInt(this.length); + if (length !== toPosInt(other.length)) return false; + for (i = 0; i < length; ++i) { + if (objHasOwnProperty.call(this, i) !== objHasOwnProperty.call(other, i)) { + return false; + } + if (!eq(this[i], other[i])) return false; + } + return true; +}; diff --git a/node_modules/es5-ext/array/#/is-empty.js b/node_modules/es5-ext/array/#/is-empty.js new file mode 100644 index 0000000..9b336fe --- /dev/null +++ b/node_modules/es5-ext/array/#/is-empty.js @@ -0,0 +1,6 @@ +"use strict"; + +var ensureArray = require("../../object/ensure-array") + , firstIndex = require("./first-index"); + +module.exports = function () { return firstIndex.call(ensureArray(this)) === null; }; diff --git a/node_modules/es5-ext/array/#/is-uniq.js b/node_modules/es5-ext/array/#/is-uniq.js new file mode 100644 index 0000000..75f7734 --- /dev/null +++ b/node_modules/es5-ext/array/#/is-uniq.js @@ -0,0 +1,9 @@ +"use strict"; + +var indexOf = require("./e-index-of") + , every = Array.prototype.every + , isFirst; + +isFirst = function (value, index) { return indexOf.call(this, value) === index; }; + +module.exports = function () { return every.call(this, isFirst, this); }; diff --git a/node_modules/es5-ext/array/#/keys/implement.js b/node_modules/es5-ext/array/#/keys/implement.js new file mode 100644 index 0000000..101a5e3 --- /dev/null +++ b/node_modules/es5-ext/array/#/keys/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "keys", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/array/#/keys/index.js b/node_modules/es5-ext/array/#/keys/index.js new file mode 100644 index 0000000..c8753e5 --- /dev/null +++ b/node_modules/es5-ext/array/#/keys/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.prototype.keys : require("./shim"); diff --git a/node_modules/es5-ext/array/#/keys/is-implemented.js b/node_modules/es5-ext/array/#/keys/is-implemented.js new file mode 100644 index 0000000..70a171f --- /dev/null +++ b/node_modules/es5-ext/array/#/keys/is-implemented.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function () { + var arr = [1, "foo"], iterator, result; + if (typeof arr.keys !== "function") return false; + iterator = arr.keys(); + if (!iterator) return false; + if (typeof iterator.next !== "function") return false; + result = iterator.next(); + if (!result) return false; + if (result.value !== 0) return false; + if (result.done !== false) return false; + return true; +}; diff --git a/node_modules/es5-ext/array/#/keys/shim.js b/node_modules/es5-ext/array/#/keys/shim.js new file mode 100644 index 0000000..8136cdc --- /dev/null +++ b/node_modules/es5-ext/array/#/keys/shim.js @@ -0,0 +1,4 @@ +"use strict"; + +var ArrayIterator = require("es6-iterator/array"); +module.exports = function () { return new ArrayIterator(this, "key"); }; diff --git a/node_modules/es5-ext/array/#/last-index.js b/node_modules/es5-ext/array/#/last-index.js new file mode 100644 index 0000000..74aaba4 --- /dev/null +++ b/node_modules/es5-ext/array/#/last-index.js @@ -0,0 +1,15 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , value = require("../../object/valid-value") + , objHasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function () { + var i, length; + if (!(length = toPosInt(value(this).length))) return null; + i = length - 1; + while (!objHasOwnProperty.call(this, i)) { + if (--i === -1) return null; + } + return i; +}; diff --git a/node_modules/es5-ext/array/#/last.js b/node_modules/es5-ext/array/#/last.js new file mode 100644 index 0000000..38bb359 --- /dev/null +++ b/node_modules/es5-ext/array/#/last.js @@ -0,0 +1,9 @@ +"use strict"; + +var lastIndex = require("./last-index"); + +module.exports = function () { + var i; + if ((i = lastIndex.call(this)) !== null) return this[i]; + return undefined; +}; diff --git a/node_modules/es5-ext/array/#/map/implement.js b/node_modules/es5-ext/array/#/map/implement.js new file mode 100644 index 0000000..42e0b47 --- /dev/null +++ b/node_modules/es5-ext/array/#/map/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "map", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/array/#/map/index.js b/node_modules/es5-ext/array/#/map/index.js new file mode 100644 index 0000000..49e0267 --- /dev/null +++ b/node_modules/es5-ext/array/#/map/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.prototype.map : require("./shim"); diff --git a/node_modules/es5-ext/array/#/map/is-implemented.js b/node_modules/es5-ext/array/#/map/is-implemented.js new file mode 100644 index 0000000..f09bd7d --- /dev/null +++ b/node_modules/es5-ext/array/#/map/is-implemented.js @@ -0,0 +1,6 @@ +"use strict"; + +var identity = require("../../../function/identity") + , SubArray = require("../../_sub-array-dummy-safe"); + +module.exports = function () { return new SubArray().map(identity) instanceof SubArray; }; diff --git a/node_modules/es5-ext/array/#/map/shim.js b/node_modules/es5-ext/array/#/map/shim.js new file mode 100644 index 0000000..288be93 --- /dev/null +++ b/node_modules/es5-ext/array/#/map/shim.js @@ -0,0 +1,22 @@ +"use strict"; + +var isPlainArray = require("../../is-plain-array") + , callable = require("../../../object/valid-callable") + , isArray = Array.isArray + , map = Array.prototype.map + , forEach = Array.prototype.forEach + , call = Function.prototype.call; + +module.exports = function (callbackFn/*, thisArg*/) { + var result, thisArg; + if (!this || !isArray(this) || isPlainArray(this)) { + return map.apply(this, arguments); + } + callable(callbackFn); + thisArg = arguments[1]; + result = new this.constructor(this.length); + forEach.call(this, function (val, i, self) { + result[i] = call.call(callbackFn, thisArg, val, i, self); + }); + return result; +}; diff --git a/node_modules/es5-ext/array/#/remove.js b/node_modules/es5-ext/array/#/remove.js new file mode 100644 index 0000000..7e12664 --- /dev/null +++ b/node_modules/es5-ext/array/#/remove.js @@ -0,0 +1,17 @@ +"use strict"; + +var indexOf = require("./e-index-of") + , forEach = Array.prototype.forEach + , splice = Array.prototype.splice; + +// eslint-disable-next-line no-unused-vars +module.exports = function (itemToRemove/*, …item*/) { + forEach.call( + arguments, + function (item) { + var index = indexOf.call(this, item); + if (index !== -1) splice.call(this, index, 1); + }, + this + ); +}; diff --git a/node_modules/es5-ext/array/#/separate.js b/node_modules/es5-ext/array/#/separate.js new file mode 100644 index 0000000..248662f --- /dev/null +++ b/node_modules/es5-ext/array/#/separate.js @@ -0,0 +1,10 @@ +"use strict"; + +var forEach = Array.prototype.forEach; + +module.exports = function (sep) { + var result = []; + forEach.call(this, function (val) { result.push(val, sep); }); + result.pop(); + return result; +}; diff --git a/node_modules/es5-ext/array/#/slice/implement.js b/node_modules/es5-ext/array/#/slice/implement.js new file mode 100644 index 0000000..113d34d --- /dev/null +++ b/node_modules/es5-ext/array/#/slice/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "slice", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/array/#/slice/index.js b/node_modules/es5-ext/array/#/slice/index.js new file mode 100644 index 0000000..716b7e0 --- /dev/null +++ b/node_modules/es5-ext/array/#/slice/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.prototype.slice : require("./shim"); diff --git a/node_modules/es5-ext/array/#/slice/is-implemented.js b/node_modules/es5-ext/array/#/slice/is-implemented.js new file mode 100644 index 0000000..4c83bfa --- /dev/null +++ b/node_modules/es5-ext/array/#/slice/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +var SubArray = require("../../_sub-array-dummy-safe"); + +module.exports = function () { return new SubArray().slice() instanceof SubArray; }; diff --git a/node_modules/es5-ext/array/#/slice/shim.js b/node_modules/es5-ext/array/#/slice/shim.js new file mode 100644 index 0000000..ff13085 --- /dev/null +++ b/node_modules/es5-ext/array/#/slice/shim.js @@ -0,0 +1,36 @@ +"use strict"; + +var toInteger = require("../../../number/to-integer") + , toPosInt = require("../../../number/to-pos-integer") + , isPlainArray = require("../../is-plain-array") + , isArray = Array.isArray + , slice = Array.prototype.slice + , objHasOwnProperty = Object.prototype.hasOwnProperty + , max = Math.max; + +module.exports = function (start, end) { + var length, result, i; + if (!this || !isArray(this) || isPlainArray(this)) { + return slice.apply(this, arguments); + } + length = toPosInt(this.length); + start = toInteger(start); + if (start < 0) start = max(length + start, 0); + else if (start > length) start = length; + if (end === undefined) { + end = length; + } else { + end = toInteger(end); + if (end < 0) end = max(length + end, 0); + else if (end > length) end = length; + } + if (start > end) start = end; + result = new this.constructor(end - start); + i = 0; + while (start !== end) { + if (objHasOwnProperty.call(this, start)) result[i] = this[start]; + ++i; + ++start; + } + return result; +}; diff --git a/node_modules/es5-ext/array/#/some-right.js b/node_modules/es5-ext/array/#/some-right.js new file mode 100644 index 0000000..3baaf76 --- /dev/null +++ b/node_modules/es5-ext/array/#/some-right.js @@ -0,0 +1,21 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , callable = require("../../object/valid-callable") + , value = require("../../object/valid-value") + , objHasOwnProperty = Object.prototype.hasOwnProperty + , call = Function.prototype.call; + +module.exports = function (cb/*, thisArg*/) { + var i, self, thisArg; + self = Object(value(this)); + callable(cb); + thisArg = arguments[1]; + + for (i = toPosInt(self.length) - 1; i >= 0; --i) { + if (objHasOwnProperty.call(self, i) && call.call(cb, thisArg, self[i], i, self)) { + return true; + } + } + return false; +}; diff --git a/node_modules/es5-ext/array/#/splice/implement.js b/node_modules/es5-ext/array/#/splice/implement.js new file mode 100644 index 0000000..236b1cb --- /dev/null +++ b/node_modules/es5-ext/array/#/splice/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "splice", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/array/#/splice/index.js b/node_modules/es5-ext/array/#/splice/index.js new file mode 100644 index 0000000..cd5c3ec --- /dev/null +++ b/node_modules/es5-ext/array/#/splice/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.prototype.splice : require("./shim"); diff --git a/node_modules/es5-ext/array/#/splice/is-implemented.js b/node_modules/es5-ext/array/#/splice/is-implemented.js new file mode 100644 index 0000000..085cba5 --- /dev/null +++ b/node_modules/es5-ext/array/#/splice/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +var SubArray = require("../../_sub-array-dummy-safe"); + +module.exports = function () { return new SubArray().splice(0) instanceof SubArray; }; diff --git a/node_modules/es5-ext/array/#/splice/shim.js b/node_modules/es5-ext/array/#/splice/shim.js new file mode 100644 index 0000000..a9c53ea --- /dev/null +++ b/node_modules/es5-ext/array/#/splice/shim.js @@ -0,0 +1,15 @@ +"use strict"; + +var isPlainArray = require("../../is-plain-array") + , isArray = Array.isArray + , splice = Array.prototype.splice + , forEach = Array.prototype.forEach; + +// eslint-disable-next-line no-unused-vars +module.exports = function (start, deleteCount/*, …items*/) { + var arr = splice.apply(this, arguments), result; + if (!this || !isArray(this) || isPlainArray(this)) return arr; + result = new this.constructor(arr.length); + forEach.call(arr, function (val, i) { result[i] = val; }); + return result; +}; diff --git a/node_modules/es5-ext/array/#/uniq.js b/node_modules/es5-ext/array/#/uniq.js new file mode 100644 index 0000000..2d28bf5 --- /dev/null +++ b/node_modules/es5-ext/array/#/uniq.js @@ -0,0 +1,9 @@ +"use strict"; + +var indexOf = require("./e-index-of") + , filter = Array.prototype.filter + , isFirst; + +isFirst = function (value, index) { return indexOf.call(this, value) === index; }; + +module.exports = function () { return filter.call(this, isFirst, this); }; diff --git a/node_modules/es5-ext/array/#/values/implement.js b/node_modules/es5-ext/array/#/values/implement.js new file mode 100644 index 0000000..dce17ac --- /dev/null +++ b/node_modules/es5-ext/array/#/values/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "values", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/array/#/values/index.js b/node_modules/es5-ext/array/#/values/index.js new file mode 100644 index 0000000..30a50ba --- /dev/null +++ b/node_modules/es5-ext/array/#/values/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.prototype.values : require("./shim"); diff --git a/node_modules/es5-ext/array/#/values/is-implemented.js b/node_modules/es5-ext/array/#/values/is-implemented.js new file mode 100644 index 0000000..8b72568 --- /dev/null +++ b/node_modules/es5-ext/array/#/values/is-implemented.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function () { + var arr = ["foo", 1], iterator, result; + if (typeof arr.values !== "function") return false; + iterator = arr.values(); + if (!iterator) return false; + if (typeof iterator.next !== "function") return false; + result = iterator.next(); + if (!result) return false; + if (result.value !== "foo") return false; + if (result.done !== false) return false; + return true; +}; diff --git a/node_modules/es5-ext/array/#/values/shim.js b/node_modules/es5-ext/array/#/values/shim.js new file mode 100644 index 0000000..5d013ab --- /dev/null +++ b/node_modules/es5-ext/array/#/values/shim.js @@ -0,0 +1,4 @@ +"use strict"; + +var ArrayIterator = require("es6-iterator/array"); +module.exports = function () { return new ArrayIterator(this, "value"); }; diff --git a/node_modules/es5-ext/array/_is-extensible.js b/node_modules/es5-ext/array/_is-extensible.js new file mode 100644 index 0000000..c475711 --- /dev/null +++ b/node_modules/es5-ext/array/_is-extensible.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = (function () { + var SubArray = require("./_sub-array-dummy") + , arr; + + if (!SubArray) return false; + arr = new SubArray(); + if (!Array.isArray(arr)) return false; + if (!(arr instanceof SubArray)) return false; + + arr[34] = "foo"; + return arr.length === 35; +})(); diff --git a/node_modules/es5-ext/array/_sub-array-dummy-safe.js b/node_modules/es5-ext/array/_sub-array-dummy-safe.js new file mode 100644 index 0000000..bef50be --- /dev/null +++ b/node_modules/es5-ext/array/_sub-array-dummy-safe.js @@ -0,0 +1,22 @@ +"use strict"; + +var setPrototypeOf = require("../object/set-prototype-of") + , isExtensible = require("./_is-extensible"); + +module.exports = (function () { + var SubArray; + + if (isExtensible) return require("./_sub-array-dummy"); + + if (!setPrototypeOf) return null; + SubArray = function () { + var arr = Array.apply(this, arguments); + setPrototypeOf(arr, SubArray.prototype); + return arr; + }; + setPrototypeOf(SubArray, Array); + SubArray.prototype = Object.create(Array.prototype, { + constructor: { value: SubArray, enumerable: false, writable: true, configurable: true } + }); + return SubArray; +})(); diff --git a/node_modules/es5-ext/array/_sub-array-dummy.js b/node_modules/es5-ext/array/_sub-array-dummy.js new file mode 100644 index 0000000..5969309 --- /dev/null +++ b/node_modules/es5-ext/array/_sub-array-dummy.js @@ -0,0 +1,15 @@ +"use strict"; + +var setPrototypeOf = require("../object/set-prototype-of"); + +module.exports = (function () { + var SubArray; + + if (!setPrototypeOf) return null; + SubArray = function () { Array.apply(this, arguments); }; + setPrototypeOf(SubArray, Array); + SubArray.prototype = Object.create(Array.prototype, { + constructor: { value: SubArray, enumerable: false, writable: true, configurable: true } + }); + return SubArray; +})(); diff --git a/node_modules/es5-ext/array/from/implement.js b/node_modules/es5-ext/array/from/implement.js new file mode 100644 index 0000000..c08d407 --- /dev/null +++ b/node_modules/es5-ext/array/from/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array, "from", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/array/from/index.js b/node_modules/es5-ext/array/from/index.js new file mode 100644 index 0000000..81cf8d9 --- /dev/null +++ b/node_modules/es5-ext/array/from/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.from : require("./shim"); diff --git a/node_modules/es5-ext/array/from/is-implemented.js b/node_modules/es5-ext/array/from/is-implemented.js new file mode 100644 index 0000000..a786c76 --- /dev/null +++ b/node_modules/es5-ext/array/from/is-implemented.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function () { + var from = Array.from, arr, result; + if (typeof from !== "function") return false; + arr = ["raz", "dwa"]; + result = from(arr); + return Boolean(result && result !== arr && result[1] === "dwa"); +}; diff --git a/node_modules/es5-ext/array/from/shim.js b/node_modules/es5-ext/array/from/shim.js new file mode 100644 index 0000000..4a2a59a --- /dev/null +++ b/node_modules/es5-ext/array/from/shim.js @@ -0,0 +1,119 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator + , isArguments = require("../../function/is-arguments") + , isFunction = require("../../function/is-function") + , toPosInt = require("../../number/to-pos-integer") + , callable = require("../../object/valid-callable") + , validValue = require("../../object/valid-value") + , isValue = require("../../object/is-value") + , isString = require("../../string/is-string") + , isArray = Array.isArray + , call = Function.prototype.call + , desc = { configurable: true, enumerable: true, writable: true, value: null } + , defineProperty = Object.defineProperty; + +// eslint-disable-next-line complexity, max-lines-per-function +module.exports = function (arrayLike/*, mapFn, thisArg*/) { + var mapFn = arguments[1] + , thisArg = arguments[2] + , Context + , i + , j + , arr + , length + , code + , iterator + , result + , getIterator + , value; + + arrayLike = Object(validValue(arrayLike)); + + if (isValue(mapFn)) callable(mapFn); + if (!this || this === Array || !isFunction(this)) { + // Result: Plain array + if (!mapFn) { + if (isArguments(arrayLike)) { + // Source: Arguments + length = arrayLike.length; + if (length !== 1) return Array.apply(null, arrayLike); + arr = new Array(1); + arr[0] = arrayLike[0]; + return arr; + } + if (isArray(arrayLike)) { + // Source: Array + arr = new Array((length = arrayLike.length)); + for (i = 0; i < length; ++i) arr[i] = arrayLike[i]; + return arr; + } + } + arr = []; + } else { + // Result: Non plain array + Context = this; + } + + if (!isArray(arrayLike)) { + if ((getIterator = arrayLike[iteratorSymbol]) !== undefined) { + // Source: Iterator + iterator = callable(getIterator).call(arrayLike); + if (Context) arr = new Context(); + result = iterator.next(); + i = 0; + while (!result.done) { + value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value; + if (Context) { + desc.value = value; + defineProperty(arr, i, desc); + } else { + arr[i] = value; + } + result = iterator.next(); + ++i; + } + length = i; + } else if (isString(arrayLike)) { + // Source: String + length = arrayLike.length; + if (Context) arr = new Context(); + for (i = 0, j = 0; i < length; ++i) { + value = arrayLike[i]; + if (i + 1 < length) { + code = value.charCodeAt(0); + // eslint-disable-next-line max-depth + if (code >= 0xd800 && code <= 0xdbff) value += arrayLike[++i]; + } + value = mapFn ? call.call(mapFn, thisArg, value, j) : value; + if (Context) { + desc.value = value; + defineProperty(arr, j, desc); + } else { + arr[j] = value; + } + ++j; + } + length = j; + } + } + if (length === undefined) { + // Source: array or array-like + length = toPosInt(arrayLike.length); + if (Context) arr = new Context(length); + for (i = 0; i < length; ++i) { + value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i]; + if (Context) { + desc.value = value; + defineProperty(arr, i, desc); + } else { + arr[i] = value; + } + } + } + if (Context) { + desc.value = null; + arr.length = length; + } + return arr; +}; diff --git a/node_modules/es5-ext/array/generate.js b/node_modules/es5-ext/array/generate.js new file mode 100644 index 0000000..b99160e --- /dev/null +++ b/node_modules/es5-ext/array/generate.js @@ -0,0 +1,18 @@ +"use strict"; + +var toPosInt = require("../number/to-pos-integer") + , value = require("../object/valid-value") + , slice = Array.prototype.slice; + +module.exports = function (length/*, …fill*/) { + var arr, currentLength; + length = toPosInt(value(length)); + if (length === 0) return []; + + arr = arguments.length < 2 ? [undefined] : slice.call(arguments, 1, 1 + length); + + while ((currentLength = arr.length) < length) { + arr = arr.concat(arr.slice(0, length - currentLength)); + } + return arr; +}; diff --git a/node_modules/es5-ext/array/index.js b/node_modules/es5-ext/array/index.js new file mode 100644 index 0000000..49ff58e --- /dev/null +++ b/node_modules/es5-ext/array/index.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = { + "#": require("./#"), + "from": require("./from"), + "generate": require("./generate"), + "isPlainArray": require("./is-plain-array"), + "of": require("./of"), + "toArray": require("./to-array"), + "validArray": require("./valid-array") +}; diff --git a/node_modules/es5-ext/array/is-plain-array.js b/node_modules/es5-ext/array/is-plain-array.js new file mode 100644 index 0000000..ca3d25b --- /dev/null +++ b/node_modules/es5-ext/array/is-plain-array.js @@ -0,0 +1,11 @@ +"use strict"; + +var isArray = Array.isArray, getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (obj) { + var proto; + if (!obj || !isArray(obj)) return false; + proto = getPrototypeOf(obj); + if (!isArray(proto)) return false; + return !isArray(getPrototypeOf(proto)); +}; diff --git a/node_modules/es5-ext/array/of/implement.js b/node_modules/es5-ext/array/of/implement.js new file mode 100644 index 0000000..6665c77 --- /dev/null +++ b/node_modules/es5-ext/array/of/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array, "of", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/array/of/index.js b/node_modules/es5-ext/array/of/index.js new file mode 100644 index 0000000..503c749 --- /dev/null +++ b/node_modules/es5-ext/array/of/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.of : require("./shim"); diff --git a/node_modules/es5-ext/array/of/is-implemented.js b/node_modules/es5-ext/array/of/is-implemented.js new file mode 100644 index 0000000..3f232ca --- /dev/null +++ b/node_modules/es5-ext/array/of/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function () { + var of = Array.of, result; + if (typeof of !== "function") return false; + result = of("foo", "bar"); + return Boolean(result && result[1] === "bar"); +}; diff --git a/node_modules/es5-ext/array/of/shim.js b/node_modules/es5-ext/array/of/shim.js new file mode 100644 index 0000000..0202a8a --- /dev/null +++ b/node_modules/es5-ext/array/of/shim.js @@ -0,0 +1,19 @@ +"use strict"; + +var isFunction = require("../../function/is-function") + , slice = Array.prototype.slice + , defineProperty = Object.defineProperty + , desc = { configurable: true, enumerable: true, writable: true, value: null }; + +module.exports = function (/* …items*/) { + var result, i, length; + if (!this || this === Array || !isFunction(this)) return slice.call(arguments); + result = new this((length = arguments.length)); + for (i = 0; i < length; ++i) { + desc.value = arguments[i]; + defineProperty(result, i, desc); + } + desc.value = null; + result.length = length; + return result; +}; diff --git a/node_modules/es5-ext/array/to-array.js b/node_modules/es5-ext/array/to-array.js new file mode 100644 index 0000000..2515e02 --- /dev/null +++ b/node_modules/es5-ext/array/to-array.js @@ -0,0 +1,6 @@ +"use strict"; + +var from = require("./from") + , isArray = Array.isArray; + +module.exports = function (arrayLike) { return isArray(arrayLike) ? arrayLike : from(arrayLike); }; diff --git a/node_modules/es5-ext/array/valid-array.js b/node_modules/es5-ext/array/valid-array.js new file mode 100644 index 0000000..1e58c39 --- /dev/null +++ b/node_modules/es5-ext/array/valid-array.js @@ -0,0 +1,8 @@ +"use strict"; + +var isArray = Array.isArray; + +module.exports = function (value) { + if (isArray(value)) return value; + throw new TypeError(value + " is not an array"); +}; diff --git a/node_modules/es5-ext/boolean/index.js b/node_modules/es5-ext/boolean/index.js new file mode 100644 index 0000000..3513642 --- /dev/null +++ b/node_modules/es5-ext/boolean/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = { isBoolean: require("./is-boolean") }; diff --git a/node_modules/es5-ext/boolean/is-boolean.js b/node_modules/es5-ext/boolean/is-boolean.js new file mode 100644 index 0000000..394845f --- /dev/null +++ b/node_modules/es5-ext/boolean/is-boolean.js @@ -0,0 +1,10 @@ +"use strict"; + +var objToString = Object.prototype.toString, id = objToString.call(true); + +module.exports = function (value) { + return ( + typeof value === "boolean" || + (typeof value === "object" && (value instanceof Boolean || objToString.call(value) === id)) + ); +}; diff --git a/node_modules/es5-ext/date/#/copy.js b/node_modules/es5-ext/date/#/copy.js new file mode 100644 index 0000000..1262ae0 --- /dev/null +++ b/node_modules/es5-ext/date/#/copy.js @@ -0,0 +1,5 @@ +"use strict"; + +var getTime = Date.prototype.getTime; + +module.exports = function () { return new Date(getTime.call(this)); }; diff --git a/node_modules/es5-ext/date/#/days-in-month.js b/node_modules/es5-ext/date/#/days-in-month.js new file mode 100644 index 0000000..731d4d5 --- /dev/null +++ b/node_modules/es5-ext/date/#/days-in-month.js @@ -0,0 +1,17 @@ +"use strict"; + +var getMonth = Date.prototype.getMonth; + +module.exports = function () { + switch (getMonth.call(this)) { + case 1: + return this.getFullYear() % 4 ? 28 : 29; + case 3: + case 5: + case 8: + case 10: + return 30; + default: + return 31; + } +}; diff --git a/node_modules/es5-ext/date/#/floor-day.js b/node_modules/es5-ext/date/#/floor-day.js new file mode 100644 index 0000000..db696d3 --- /dev/null +++ b/node_modules/es5-ext/date/#/floor-day.js @@ -0,0 +1,8 @@ +"use strict"; + +var setHours = Date.prototype.setHours; + +module.exports = function () { + setHours.call(this, 0, 0, 0, 0); + return this; +}; diff --git a/node_modules/es5-ext/date/#/floor-month.js b/node_modules/es5-ext/date/#/floor-month.js new file mode 100644 index 0000000..c9c0460 --- /dev/null +++ b/node_modules/es5-ext/date/#/floor-month.js @@ -0,0 +1,8 @@ +"use strict"; + +var floorDay = require("./floor-day"); + +module.exports = function () { + floorDay.call(this).setDate(1); + return this; +}; diff --git a/node_modules/es5-ext/date/#/floor-year.js b/node_modules/es5-ext/date/#/floor-year.js new file mode 100644 index 0000000..e9b6f0f --- /dev/null +++ b/node_modules/es5-ext/date/#/floor-year.js @@ -0,0 +1,8 @@ +"use strict"; + +var floorMonth = require("./floor-month"); + +module.exports = function () { + floorMonth.call(this).setMonth(0); + return this; +}; diff --git a/node_modules/es5-ext/date/#/format.js b/node_modules/es5-ext/date/#/format.js new file mode 100644 index 0000000..8474dbb --- /dev/null +++ b/node_modules/es5-ext/date/#/format.js @@ -0,0 +1,20 @@ +/* eslint id-length: "off" */ + +"use strict"; + +var pad = require("../../number/#/pad") + , date = require("../valid-date") + , format; + +format = require("../../string/format-method")({ + Y: function () { return String(this.getFullYear()); }, + y: function () { return String(this.getFullYear()).slice(-2); }, + m: function () { return pad.call(this.getMonth() + 1, 2); }, + d: function () { return pad.call(this.getDate(), 2); }, + H: function () { return pad.call(this.getHours(), 2); }, + M: function () { return pad.call(this.getMinutes(), 2); }, + S: function () { return pad.call(this.getSeconds(), 2); }, + L: function () { return pad.call(this.getMilliseconds(), 3); } +}); + +module.exports = function (pattern) { return format.call(date(this), pattern); }; diff --git a/node_modules/es5-ext/date/#/index.js b/node_modules/es5-ext/date/#/index.js new file mode 100644 index 0000000..1781e21 --- /dev/null +++ b/node_modules/es5-ext/date/#/index.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = { + copy: require("./copy"), + daysInMonth: require("./days-in-month"), + floorDay: require("./floor-day"), + floorMonth: require("./floor-month"), + floorYear: require("./floor-year"), + format: require("./format") +}; diff --git a/node_modules/es5-ext/date/ensure-time-value.js b/node_modules/es5-ext/date/ensure-time-value.js new file mode 100644 index 0000000..09f5afc --- /dev/null +++ b/node_modules/es5-ext/date/ensure-time-value.js @@ -0,0 +1,10 @@ +"use strict"; + +var safeToString = require("../safe-to-string") + , toInteger = require("../number/to-integer") + , isTimeValue = require("./is-time-value"); + +module.exports = function (value) { + if (isTimeValue(value)) return toInteger(value); + throw new TypeError(safeToString(value) + " is not a valid time value"); +}; diff --git a/node_modules/es5-ext/date/index.js b/node_modules/es5-ext/date/index.js new file mode 100644 index 0000000..c143149 --- /dev/null +++ b/node_modules/es5-ext/date/index.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = { + "#": require("./#"), + "ensureTimeValue": require("./ensure-time-value"), + "isDate": require("./is-date"), + "isTimeValue": require("./is-time-value"), + "validDate": require("./valid-date") +}; diff --git a/node_modules/es5-ext/date/is-date.js b/node_modules/es5-ext/date/is-date.js new file mode 100644 index 0000000..f45bde4 --- /dev/null +++ b/node_modules/es5-ext/date/is-date.js @@ -0,0 +1,10 @@ +"use strict"; + +var objToString = Object.prototype.toString, id = objToString.call(new Date()); + +module.exports = function (value) { + return ( + (value && !isNaN(value) && (value instanceof Date || objToString.call(value) === id)) || + false + ); +}; diff --git a/node_modules/es5-ext/date/is-time-value.js b/node_modules/es5-ext/date/is-time-value.js new file mode 100644 index 0000000..0deb0b9 --- /dev/null +++ b/node_modules/es5-ext/date/is-time-value.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (value) { + try { value = Number(value); } + catch (e) { return false; } + if (isNaN(value)) return false; + if (Math.abs(value) > 8.64e15) return false; + return true; +}; diff --git a/node_modules/es5-ext/date/valid-date.js b/node_modules/es5-ext/date/valid-date.js new file mode 100644 index 0000000..0c73dc5 --- /dev/null +++ b/node_modules/es5-ext/date/valid-date.js @@ -0,0 +1,8 @@ +"use strict"; + +var isDate = require("./is-date"); + +module.exports = function (value) { + if (!isDate(value)) throw new TypeError(value + " is not valid Date object"); + return value; +}; diff --git a/node_modules/es5-ext/error/#/index.js b/node_modules/es5-ext/error/#/index.js new file mode 100644 index 0000000..973a9d4 --- /dev/null +++ b/node_modules/es5-ext/error/#/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = { throw: require("./throw") }; diff --git a/node_modules/es5-ext/error/#/throw.js b/node_modules/es5-ext/error/#/throw.js new file mode 100644 index 0000000..3eb196d --- /dev/null +++ b/node_modules/es5-ext/error/#/throw.js @@ -0,0 +1,5 @@ +"use strict"; + +var error = require("../valid-error"); + +module.exports = function () { throw error(this); }; diff --git a/node_modules/es5-ext/error/custom.js b/node_modules/es5-ext/error/custom.js new file mode 100644 index 0000000..416d571 --- /dev/null +++ b/node_modules/es5-ext/error/custom.js @@ -0,0 +1,20 @@ +"use strict"; + +var assign = require("../object/assign") + , isObject = require("../object/is-object") + , isValue = require("../object/is-value") + , captureStackTrace = Error.captureStackTrace; + +module.exports = function (message/*, code, ext*/) { + var err = new Error(message), code = arguments[1], ext = arguments[2]; + if (!isValue(ext)) { + if (isObject(code)) { + ext = code; + code = null; + } + } + if (isValue(ext)) assign(err, ext); + if (isValue(code)) err.code = code; + if (captureStackTrace) captureStackTrace(err, module.exports); + return err; +}; diff --git a/node_modules/es5-ext/error/index.js b/node_modules/es5-ext/error/index.js new file mode 100644 index 0000000..cb7054a --- /dev/null +++ b/node_modules/es5-ext/error/index.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = { + "#": require("./#"), + "custom": require("./custom"), + "isError": require("./is-error"), + "validError": require("./valid-error") +}; diff --git a/node_modules/es5-ext/error/is-error.js b/node_modules/es5-ext/error/is-error.js new file mode 100644 index 0000000..aad67ed --- /dev/null +++ b/node_modules/es5-ext/error/is-error.js @@ -0,0 +1,7 @@ +"use strict"; + +var objToString = Object.prototype.toString, id = objToString.call(new Error()); + +module.exports = function (value) { + return (value && (value instanceof Error || objToString.call(value) === id)) || false; +}; diff --git a/node_modules/es5-ext/error/valid-error.js b/node_modules/es5-ext/error/valid-error.js new file mode 100644 index 0000000..432f7ba --- /dev/null +++ b/node_modules/es5-ext/error/valid-error.js @@ -0,0 +1,8 @@ +"use strict"; + +var isError = require("./is-error"); + +module.exports = function (value) { + if (!isError(value)) throw new TypeError(value + " is not an Error object"); + return value; +}; diff --git a/node_modules/es5-ext/function/#/compose.js b/node_modules/es5-ext/function/#/compose.js new file mode 100644 index 0000000..c1d37b4 --- /dev/null +++ b/node_modules/es5-ext/function/#/compose.js @@ -0,0 +1,20 @@ +"use strict"; + +var isValue = require("../../object/is-value") + , callable = require("../../object/valid-callable") + , aFrom = require("../../array/from"); + +var apply = Function.prototype.apply + , call = Function.prototype.call + , callFn = function (arg, fn) { return call.call(fn, this, arg); }; + +module.exports = function (fnIgnored/*, …fnn*/) { + var fns, first; + var args = aFrom(arguments); + fns = isValue(this) ? [this].concat(args) : args; + fns.forEach(callable); + fns = fns.reverse(); + first = fns[0]; + fns = fns.slice(1); + return function (argIgnored) { return fns.reduce(callFn, apply.call(first, this, arguments)); }; +}; diff --git a/node_modules/es5-ext/function/#/copy.js b/node_modules/es5-ext/function/#/copy.js new file mode 100644 index 0000000..81ae783 --- /dev/null +++ b/node_modules/es5-ext/function/#/copy.js @@ -0,0 +1,22 @@ +"use strict"; + +var mixin = require("../../object/mixin") + , validFunction = require("../valid-function") + , re = /^\s*function\s*([\0-')-\uffff]+)*\s*\(([\0-(*-\uffff]*)\)\s*\{/; + +module.exports = function () { + var match = String(validFunction(this)).match(re), fn; + + // eslint-disable-next-line no-new-func + fn = new Function( + "fn", + "return function " + + match[1].trim() + + "(" + + match[2] + + ") { return fn.apply(this, arguments); };" + )(this); + try { mixin(fn, this); } + catch (ignore) {} + return fn; +}; diff --git a/node_modules/es5-ext/function/#/curry.js b/node_modules/es5-ext/function/#/curry.js new file mode 100644 index 0000000..9296458 --- /dev/null +++ b/node_modules/es5-ext/function/#/curry.js @@ -0,0 +1,25 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , callable = require("../../object/valid-callable") + , defineLength = require("../_define-length") + , slice = Array.prototype.slice + , apply = Function.prototype.apply + , curry; + +curry = function self(fn, length, preArgs) { + return defineLength( + function () { + var args = preArgs + ? preArgs.concat(slice.call(arguments, 0, length - preArgs.length)) + : slice.call(arguments, 0, length); + return args.length === length ? apply.call(fn, this, args) : self(fn, length, args); + }, + preArgs ? length - preArgs.length : length + ); +}; + +module.exports = function (/* Length*/) { + var length = arguments[0]; + return curry(callable(this), isNaN(length) ? toPosInt(this.length) : toPosInt(length)); +}; diff --git a/node_modules/es5-ext/function/#/index.js b/node_modules/es5-ext/function/#/index.js new file mode 100644 index 0000000..02ae9f4 --- /dev/null +++ b/node_modules/es5-ext/function/#/index.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = { + compose: require("./compose"), + copy: require("./copy"), + curry: require("./curry"), + lock: require("./lock"), + microtaskDelay: require("./microtask-delay"), + not: require("./not"), + partial: require("./partial"), + spread: require("./spread"), + toStringTokens: require("./to-string-tokens") +}; diff --git a/node_modules/es5-ext/function/#/lock.js b/node_modules/es5-ext/function/#/lock.js new file mode 100644 index 0000000..afd83b9 --- /dev/null +++ b/node_modules/es5-ext/function/#/lock.js @@ -0,0 +1,10 @@ +"use strict"; + +var callable = require("../../object/valid-callable") + , apply = Function.prototype.apply; + +module.exports = function (/* …args*/) { + var fn = callable(this), args = arguments; + + return function () { return apply.call(fn, this, args); }; +}; diff --git a/node_modules/es5-ext/function/#/microtask-delay.js b/node_modules/es5-ext/function/#/microtask-delay.js new file mode 100644 index 0000000..3741ebe --- /dev/null +++ b/node_modules/es5-ext/function/#/microtask-delay.js @@ -0,0 +1,12 @@ +"use strict"; + +var ensurePlainFunction = require("../../object/ensure-plain-function") + , defineLength = require("../_define-length") + , nextTick = require("next-tick"); + +var apply = Function.prototype.apply; + +module.exports = function () { + var src = ensurePlainFunction(this); + return defineLength(function () { nextTick(apply.bind(src, this, arguments)); }, this.length); +}; diff --git a/node_modules/es5-ext/function/#/not.js b/node_modules/es5-ext/function/#/not.js new file mode 100644 index 0000000..b3b7d62 --- /dev/null +++ b/node_modules/es5-ext/function/#/not.js @@ -0,0 +1,11 @@ +"use strict"; + +var callable = require("../../object/valid-callable") + , defineLength = require("../_define-length") + , apply = Function.prototype.apply; + +module.exports = function () { + var fn = callable(this); + + return defineLength(function () { return !apply.call(fn, this, arguments); }, fn.length); +}; diff --git a/node_modules/es5-ext/function/#/partial.js b/node_modules/es5-ext/function/#/partial.js new file mode 100644 index 0000000..8f09c4f --- /dev/null +++ b/node_modules/es5-ext/function/#/partial.js @@ -0,0 +1,14 @@ +"use strict"; + +var callable = require("../../object/valid-callable") + , aFrom = require("../../array/from") + , defineLength = require("../_define-length") + , apply = Function.prototype.apply; + +module.exports = function (/* …args*/) { + var fn = callable(this), args = aFrom(arguments); + + return defineLength(function () { + return apply.call(fn, this, args.concat(aFrom(arguments))); + }, fn.length - args.length); +}; diff --git a/node_modules/es5-ext/function/#/spread.js b/node_modules/es5-ext/function/#/spread.js new file mode 100644 index 0000000..555d991 --- /dev/null +++ b/node_modules/es5-ext/function/#/spread.js @@ -0,0 +1,9 @@ +"use strict"; + +var callable = require("../../object/valid-callable") + , apply = Function.prototype.apply; + +module.exports = function () { + var fn = callable(this); + return function (args) { return apply.call(fn, this, args); }; +}; diff --git a/node_modules/es5-ext/function/#/to-string-tokens.js b/node_modules/es5-ext/function/#/to-string-tokens.js new file mode 100644 index 0000000..4ce026a --- /dev/null +++ b/node_modules/es5-ext/function/#/to-string-tokens.js @@ -0,0 +1,17 @@ +"use strict"; + +var validFunction = require("../valid-function"); + +var re1 = /^\s*function[\0-')-\uffff]*\(([\0-(*-\uffff]*)\)\s*\{([\0-\uffff]*)\}\s*$/ + , re2 = /^\s*\(?([\0-'*-\uffff]*)\)?\s*=>\s*(\{?[\0-\uffff]*\}?)\s*$/; + +module.exports = function () { + var str = String(validFunction(this)), data = str.match(re1); + if (!data) { + data = str.match(re2); + if (!data) throw new Error("Unrecognized string format"); + data[1] = data[1].trim(); + if (data[2][0] === "{") data[2] = data[2].trim().slice(1, -1); + } + return { args: data[1], body: data[2] }; +}; diff --git a/node_modules/es5-ext/function/_define-length.js b/node_modules/es5-ext/function/_define-length.js new file mode 100644 index 0000000..d77a433 --- /dev/null +++ b/node_modules/es5-ext/function/_define-length.js @@ -0,0 +1,54 @@ +"use strict"; + +var toPosInt = require("../number/to-pos-integer"); + +var test = function (arg1, arg2) { return arg2; }; + +var desc, defineProperty, generate, mixin; + +try { + Object.defineProperty(test, "length", { + configurable: true, + writable: false, + enumerable: false, + value: 1 + }); +} +catch (ignore) {} + +if (test.length === 1) { + // ES6 + desc = { configurable: true, writable: false, enumerable: false }; + defineProperty = Object.defineProperty; + module.exports = function (fn, length) { + length = toPosInt(length); + if (fn.length === length) return fn; + desc.value = length; + return defineProperty(fn, "length", desc); + }; +} else { + mixin = require("../object/mixin"); + generate = (function () { + var cache = []; + return function (length) { + var args, i = 0; + if (cache[length]) return cache[length]; + args = []; + while (length--) args.push("a" + (++i).toString(36)); + // eslint-disable-next-line no-new-func + return new Function( + "fn", + "return function (" + args.join(", ") + ") { return fn.apply(this, arguments); };" + ); + }; + })(); + module.exports = function (src, length) { + var target; + length = toPosInt(length); + if (src.length === length) return src; + target = generate(length)(src); + try { mixin(target, src); } + catch (ignore) {} + return target; + }; +} diff --git a/node_modules/es5-ext/function/constant.js b/node_modules/es5-ext/function/constant.js new file mode 100644 index 0000000..79d81e4 --- /dev/null +++ b/node_modules/es5-ext/function/constant.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (value) { + return function () { return value; }; +}; diff --git a/node_modules/es5-ext/function/identity.js b/node_modules/es5-ext/function/identity.js new file mode 100644 index 0000000..cde213f --- /dev/null +++ b/node_modules/es5-ext/function/identity.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (value) { return value; }; diff --git a/node_modules/es5-ext/function/index.js b/node_modules/es5-ext/function/index.js new file mode 100644 index 0000000..1574fbb --- /dev/null +++ b/node_modules/es5-ext/function/index.js @@ -0,0 +1,15 @@ +// Export all modules. + +"use strict"; + +module.exports = { + "#": require("./#"), + "constant": require("./constant"), + "identity": require("./identity"), + "invoke": require("./invoke"), + "isArguments": require("./is-arguments"), + "isFunction": require("./is-function"), + "noop": require("./noop"), + "pluck": require("./pluck"), + "validFunction": require("./valid-function") +}; diff --git a/node_modules/es5-ext/function/invoke.js b/node_modules/es5-ext/function/invoke.js new file mode 100644 index 0000000..fcec0a7 --- /dev/null +++ b/node_modules/es5-ext/function/invoke.js @@ -0,0 +1,14 @@ +"use strict"; + +var isCallable = require("../object/is-callable") + , value = require("../object/valid-value") + , slice = Array.prototype.slice + , apply = Function.prototype.apply; + +module.exports = function (name/*, …args*/) { + var args = slice.call(arguments, 1), isFn = isCallable(name); + return function (obj) { + value(obj); + return apply.call(isFn ? name : obj[name], obj, args.concat(slice.call(arguments, 1))); + }; +}; diff --git a/node_modules/es5-ext/function/is-arguments.js b/node_modules/es5-ext/function/is-arguments.js new file mode 100644 index 0000000..833a747 --- /dev/null +++ b/node_modules/es5-ext/function/is-arguments.js @@ -0,0 +1,6 @@ +"use strict"; + +var objToString = Object.prototype.toString + , id = objToString.call((function () { return arguments; })()); + +module.exports = function (value) { return objToString.call(value) === id; }; diff --git a/node_modules/es5-ext/function/is-function.js b/node_modules/es5-ext/function/is-function.js new file mode 100644 index 0000000..0d7cab3 --- /dev/null +++ b/node_modules/es5-ext/function/is-function.js @@ -0,0 +1,8 @@ +"use strict"; + +var objToString = Object.prototype.toString + , isFunctionStringTag = RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/); + +module.exports = function (value) { + return typeof value === "function" && isFunctionStringTag(objToString.call(value)); +}; diff --git a/node_modules/es5-ext/function/noop.js b/node_modules/es5-ext/function/noop.js new file mode 100644 index 0000000..6174f03 --- /dev/null +++ b/node_modules/es5-ext/function/noop.js @@ -0,0 +1,4 @@ +"use strict"; + +// eslint-disable-next-line no-empty-function +module.exports = function () {}; diff --git a/node_modules/es5-ext/function/pluck.js b/node_modules/es5-ext/function/pluck.js new file mode 100644 index 0000000..432cd46 --- /dev/null +++ b/node_modules/es5-ext/function/pluck.js @@ -0,0 +1,7 @@ +"use strict"; + +var value = require("../object/valid-value"); + +module.exports = function (name) { + return function (obj) { return value(obj)[name]; }; +}; diff --git a/node_modules/es5-ext/function/valid-function.js b/node_modules/es5-ext/function/valid-function.js new file mode 100644 index 0000000..060bd64 --- /dev/null +++ b/node_modules/es5-ext/function/valid-function.js @@ -0,0 +1,8 @@ +"use strict"; + +var isFunction = require("./is-function"); + +module.exports = function (value) { + if (!isFunction(value)) throw new TypeError(value + " is not a function"); + return value; +}; diff --git a/node_modules/es5-ext/global.js b/node_modules/es5-ext/global.js new file mode 100644 index 0000000..61071e6 --- /dev/null +++ b/node_modules/es5-ext/global.js @@ -0,0 +1,35 @@ +var naiveFallback = function () { + if (typeof self === "object" && self) return self; + if (typeof window === "object" && window) return window; + throw new Error("Unable to resolve global `this`"); +}; + +module.exports = (function () { + if (this) return this; + + // Unexpected strict mode (may happen if e.g. bundled into ESM module) + + // Fallback to standard globalThis if available + if (typeof globalThis === "object" && globalThis) return globalThis; + + // Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis + // In all ES5+ engines global object inherits from Object.prototype + // (if you approached one that doesn't please report) + try { + Object.defineProperty(Object.prototype, "__global__", { + get: function () { return this; }, + configurable: true + }); + } catch (error) { + // Unfortunate case of updates to Object.prototype being restricted + // via preventExtensions, seal or freeze + return naiveFallback(); + } + try { + // Safari case (window.__global__ works, but __global__ does not) + if (!__global__) return naiveFallback(); + return __global__; + } finally { + delete Object.prototype.__global__; + } +})(); diff --git a/node_modules/es5-ext/index.js b/node_modules/es5-ext/index.js new file mode 100644 index 0000000..0919764 --- /dev/null +++ b/node_modules/es5-ext/index.js @@ -0,0 +1,22 @@ +"use strict"; + +module.exports = { + global: require("./global"), + optionalChaining: require("./optional-chaining"), + safeToString: require("./safe-to-string"), + toShortStringRepresentation: require("./to-short-string-representation"), + + array: require("./array"), + boolean: require("./boolean"), + date: require("./date"), + error: require("./error"), + function: require("./function"), + iterable: require("./iterable"), + json: require("./json"), + math: require("./math"), + number: require("./number"), + object: require("./object"), + promise: require("./promise"), + regExp: require("./reg-exp"), + string: require("./string") +}; diff --git a/node_modules/es5-ext/iterable/for-each.js b/node_modules/es5-ext/iterable/for-each.js new file mode 100644 index 0000000..6063822 --- /dev/null +++ b/node_modules/es5-ext/iterable/for-each.js @@ -0,0 +1,11 @@ +"use strict"; + +var forOf = require("es6-iterator/for-of") + , isIterable = require("es6-iterator/is-iterable") + , iterable = require("./validate") + , forEach = Array.prototype.forEach; + +module.exports = function (target, cb/*, thisArg*/) { + if (isIterable(iterable(target))) forOf(target, cb, arguments[2]); + else forEach.call(target, cb, arguments[2]); +}; diff --git a/node_modules/es5-ext/iterable/index.js b/node_modules/es5-ext/iterable/index.js new file mode 100644 index 0000000..4b898fc --- /dev/null +++ b/node_modules/es5-ext/iterable/index.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = { + forEach: require("./for-each"), + is: require("./is"), + validate: require("./validate"), + validateObject: require("./validate-object") +}; diff --git a/node_modules/es5-ext/iterable/is.js b/node_modules/es5-ext/iterable/is.js new file mode 100644 index 0000000..aa5a9b9 --- /dev/null +++ b/node_modules/es5-ext/iterable/is.js @@ -0,0 +1,11 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator + , isValue = require("../object/is-value") + , isArrayLike = require("../object/is-array-like"); + +module.exports = function (value) { + if (!isValue(value)) return false; + if (typeof value[iteratorSymbol] === "function") return true; + return isArrayLike(value); +}; diff --git a/node_modules/es5-ext/iterable/validate-object.js b/node_modules/es5-ext/iterable/validate-object.js new file mode 100644 index 0000000..26e622b --- /dev/null +++ b/node_modules/es5-ext/iterable/validate-object.js @@ -0,0 +1,9 @@ +"use strict"; + +var isObject = require("../object/is-object") + , is = require("./is"); + +module.exports = function (value) { + if (is(value) && isObject(value)) return value; + throw new TypeError(value + " is not an iterable or array-like object"); +}; diff --git a/node_modules/es5-ext/iterable/validate.js b/node_modules/es5-ext/iterable/validate.js new file mode 100644 index 0000000..94a91c4 --- /dev/null +++ b/node_modules/es5-ext/iterable/validate.js @@ -0,0 +1,8 @@ +"use strict"; + +var is = require("./is"); + +module.exports = function (value) { + if (is(value)) return value; + throw new TypeError(value + " is not an iterable or array-like"); +}; diff --git a/node_modules/es5-ext/json/index.js b/node_modules/es5-ext/json/index.js new file mode 100644 index 0000000..d26ac56 --- /dev/null +++ b/node_modules/es5-ext/json/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = { safeStringify: require("./safe-stringify") }; diff --git a/node_modules/es5-ext/json/safe-stringify.js b/node_modules/es5-ext/json/safe-stringify.js new file mode 100644 index 0000000..b996a62 --- /dev/null +++ b/node_modules/es5-ext/json/safe-stringify.js @@ -0,0 +1,37 @@ +"use strict"; + +var compact = require("../array/#/compact") + , isObject = require("../object/is-object") + , toArray = require("../object/to-array") + , isArray = Array.isArray + , stringify = JSON.stringify; + +module.exports = function self(value/*, replacer, space*/) { + var replacer = arguments[1], space = arguments[2]; + try { + return stringify(value, replacer, space); + } catch (e) { + if (!isObject(value)) return null; + if (typeof value.toJSON === "function") return null; + if (isArray(value)) { + return ( + "[" + + compact.call(value.map(function (item) { return self(item, replacer, space); })) + + "]" + ); + } + return ( + "{" + + compact + .call( + toArray(value, function (item, key) { + item = self(item, replacer, space); + if (!item) return null; + return stringify(key) + ":" + item; + }) + ) + .join(",") + + "}" + ); + } +}; diff --git a/node_modules/es5-ext/math/_decimal-adjust.js b/node_modules/es5-ext/math/_decimal-adjust.js new file mode 100644 index 0000000..fd0b002 --- /dev/null +++ b/node_modules/es5-ext/math/_decimal-adjust.js @@ -0,0 +1,29 @@ +// Credit: +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round +// #Decimal_rounding + +"use strict"; + +var isValue = require("../object/is-value") + , ensureInteger = require("../object/ensure-integer"); + +var split = String.prototype.split; + +module.exports = function (type) { + return function (value/*, exp*/) { + value = Number(value); + var exp = arguments[1]; + if (isValue(exp)) exp = ensureInteger(exp); + if (!value) return value; + if (!exp) return Math[type](value); + if (!isFinite(value)) return value; + + // Shift + var tokens = split.call(value, "e"); + value = Math[type](tokens[0] + "e" + ((tokens[1] || 0) - exp)); + + // Shift back + tokens = value.toString().split("e"); + return Number(tokens[0] + "e" + (Number(tokens[1] || 0) + exp)); + }; +}; diff --git a/node_modules/es5-ext/math/_pack-ieee754.js b/node_modules/es5-ext/math/_pack-ieee754.js new file mode 100644 index 0000000..b3edf8d --- /dev/null +++ b/node_modules/es5-ext/math/_pack-ieee754.js @@ -0,0 +1,88 @@ +/* eslint no-bitwise: "off" */ +// Credit: https://github.com/paulmillr/es6-shim/ + +"use strict"; + +var abs = Math.abs + , floor = Math.floor + , log = Math.log + , min = Math.min + , pow = Math.pow + , LN2 = Math.LN2 + , roundToEven; + +roundToEven = function (num) { + var whole = floor(num), fraction = num - whole; + if (fraction < 0.5) return whole; + if (fraction > 0.5) return whole + 1; + return whole % 2 ? whole + 1 : whole; +}; + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function (value, ebits, fbits) { + var bias = (1 << (ebits - 1)) - 1, sign, e, fraction, i, bits, str, bytes; + + // Compute sign, exponent, fraction + if (isNaN(value)) { + // NaN + // http://dev.w3.org/2006/webapi/WebIDL/#es-type-mapping + e = (1 << ebits) - 1; + fraction = pow(2, fbits - 1); + sign = 0; + } else if (value === Infinity || value === -Infinity) { + e = (1 << ebits) - 1; + fraction = 0; + sign = value < 0 ? 1 : 0; + } else if (value === 0) { + e = 0; + fraction = 0; + sign = 1 / value === -Infinity ? 1 : 0; + } else { + sign = value < 0; + value = abs(value); + + if (value >= pow(2, 1 - bias)) { + e = min(floor(log(value) / LN2), 1023); + fraction = roundToEven((value / pow(2, e)) * pow(2, fbits)); + if (fraction / pow(2, fbits) >= 2) { + e += 1; + fraction = 1; + } + if (e > bias) { + // Overflow + e = (1 << ebits) - 1; + fraction = 0; + } else { + // Normal + e += bias; + fraction -= pow(2, fbits); + } + } else { + // Subnormal + e = 0; + fraction = roundToEven(value / pow(2, 1 - bias - fbits)); + } + } + + // Pack sign, exponent, fraction + bits = []; + for (i = fbits; i; i -= 1) { + bits.push(fraction % 2 ? 1 : 0); + fraction = floor(fraction / 2); + } + for (i = ebits; i; i -= 1) { + bits.push(e % 2 ? 1 : 0); + e = floor(e / 2); + } + bits.push(sign ? 1 : 0); + bits.reverse(); + str = bits.join(""); + + // Bits to bytes + bytes = []; + while (str.length) { + bytes.push(parseInt(str.substring(0, 8), 2)); + str = str.substring(8); + } + return bytes; +}; diff --git a/node_modules/es5-ext/math/_unpack-ieee754.js b/node_modules/es5-ext/math/_unpack-ieee754.js new file mode 100644 index 0000000..83fa947 --- /dev/null +++ b/node_modules/es5-ext/math/_unpack-ieee754.js @@ -0,0 +1,33 @@ +/* eslint no-bitwise: "off" */ +// Credit: https://github.com/paulmillr/es6-shim/ + +"use strict"; + +var pow = Math.pow; + +module.exports = function (bytes, ebits, fbits) { + // Bytes to bits + var bits = [], i, j, bit, str, bias, sign, e, fraction; + + for (i = bytes.length; i; i -= 1) { + bit = bytes[i - 1]; + for (j = 8; j; j -= 1) { + bits.push(bit % 2 ? 1 : 0); + bit >>= 1; + } + } + bits.reverse(); + str = bits.join(""); + + // Unpack sign, exponent, fraction + bias = (1 << (ebits - 1)) - 1; + sign = parseInt(str.substring(0, 1), 2) ? -1 : 1; + e = parseInt(str.substring(1, 1 + ebits), 2); + fraction = parseInt(str.substring(1 + ebits), 2); + + // Produce number + if (e === (1 << ebits) - 1) return fraction === 0 ? sign * Infinity : NaN; + if (e > 0) return sign * pow(2, e - bias) * (1 + fraction / pow(2, fbits)); + if (fraction !== 0) return sign * pow(2, -(bias - 1)) * (fraction / pow(2, fbits)); + return sign < 0 ? -0 : 0; +}; diff --git a/node_modules/es5-ext/math/acosh/implement.js b/node_modules/es5-ext/math/acosh/implement.js new file mode 100644 index 0000000..9e4582f --- /dev/null +++ b/node_modules/es5-ext/math/acosh/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "acosh", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/acosh/index.js b/node_modules/es5-ext/math/acosh/index.js new file mode 100644 index 0000000..da176cb --- /dev/null +++ b/node_modules/es5-ext/math/acosh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.acosh : require("./shim"); diff --git a/node_modules/es5-ext/math/acosh/is-implemented.js b/node_modules/es5-ext/math/acosh/is-implemented.js new file mode 100644 index 0000000..2e97301 --- /dev/null +++ b/node_modules/es5-ext/math/acosh/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var acosh = Math.acosh; + if (typeof acosh !== "function") return false; + return acosh(2) === 1.3169578969248166; +}; diff --git a/node_modules/es5-ext/math/acosh/shim.js b/node_modules/es5-ext/math/acosh/shim.js new file mode 100644 index 0000000..3e632ff --- /dev/null +++ b/node_modules/es5-ext/math/acosh/shim.js @@ -0,0 +1,12 @@ +"use strict"; + +var log = Math.log, sqrt = Math.sqrt; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value < 1) return NaN; + if (value === 1) return 0; + if (value === Infinity) return value; + return log(value + sqrt(value * value - 1)); +}; diff --git a/node_modules/es5-ext/math/asinh/implement.js b/node_modules/es5-ext/math/asinh/implement.js new file mode 100644 index 0000000..1c0d7e4 --- /dev/null +++ b/node_modules/es5-ext/math/asinh/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "asinh", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/asinh/index.js b/node_modules/es5-ext/math/asinh/index.js new file mode 100644 index 0000000..8ca3026 --- /dev/null +++ b/node_modules/es5-ext/math/asinh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.asinh : require("./shim"); diff --git a/node_modules/es5-ext/math/asinh/is-implemented.js b/node_modules/es5-ext/math/asinh/is-implemented.js new file mode 100644 index 0000000..a7e0f20 --- /dev/null +++ b/node_modules/es5-ext/math/asinh/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var asinh = Math.asinh; + if (typeof asinh !== "function") return false; + return asinh(2) === 1.4436354751788103; +}; diff --git a/node_modules/es5-ext/math/asinh/shim.js b/node_modules/es5-ext/math/asinh/shim.js new file mode 100644 index 0000000..30ce2e4 --- /dev/null +++ b/node_modules/es5-ext/math/asinh/shim.js @@ -0,0 +1,15 @@ +"use strict"; + +var log = Math.log, sqrt = Math.sqrt; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return value; + if (!isFinite(value)) return value; + if (value < 0) { + value = -value; + return -log(value + sqrt(value * value + 1)); + } + return log(value + sqrt(value * value + 1)); +}; diff --git a/node_modules/es5-ext/math/atanh/implement.js b/node_modules/es5-ext/math/atanh/implement.js new file mode 100644 index 0000000..53f5871 --- /dev/null +++ b/node_modules/es5-ext/math/atanh/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "atanh", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/atanh/index.js b/node_modules/es5-ext/math/atanh/index.js new file mode 100644 index 0000000..feff0a7 --- /dev/null +++ b/node_modules/es5-ext/math/atanh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.atanh : require("./shim"); diff --git a/node_modules/es5-ext/math/atanh/is-implemented.js b/node_modules/es5-ext/math/atanh/is-implemented.js new file mode 100644 index 0000000..4787c4f --- /dev/null +++ b/node_modules/es5-ext/math/atanh/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var atanh = Math.atanh; + if (typeof atanh !== "function") return false; + return Math.round(atanh(0.5) * 1e15) === 549306144334055; +}; diff --git a/node_modules/es5-ext/math/atanh/shim.js b/node_modules/es5-ext/math/atanh/shim.js new file mode 100644 index 0000000..9383e97 --- /dev/null +++ b/node_modules/es5-ext/math/atanh/shim.js @@ -0,0 +1,14 @@ +"use strict"; + +var log = Math.log; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value < -1) return NaN; + if (value > 1) return NaN; + if (value === -1) return -Infinity; + if (value === 1) return Infinity; + if (value === 0) return value; + return 0.5 * log((1 + value) / (1 - value)); +}; diff --git a/node_modules/es5-ext/math/cbrt/implement.js b/node_modules/es5-ext/math/cbrt/implement.js new file mode 100644 index 0000000..826314c --- /dev/null +++ b/node_modules/es5-ext/math/cbrt/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "cbrt", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/cbrt/index.js b/node_modules/es5-ext/math/cbrt/index.js new file mode 100644 index 0000000..a6c71c6 --- /dev/null +++ b/node_modules/es5-ext/math/cbrt/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.cbrt : require("./shim"); diff --git a/node_modules/es5-ext/math/cbrt/is-implemented.js b/node_modules/es5-ext/math/cbrt/is-implemented.js new file mode 100644 index 0000000..a8ac0db --- /dev/null +++ b/node_modules/es5-ext/math/cbrt/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var cbrt = Math.cbrt; + if (typeof cbrt !== "function") return false; + return cbrt(2) === 1.2599210498948732; +}; diff --git a/node_modules/es5-ext/math/cbrt/shim.js b/node_modules/es5-ext/math/cbrt/shim.js new file mode 100644 index 0000000..8871c55 --- /dev/null +++ b/node_modules/es5-ext/math/cbrt/shim.js @@ -0,0 +1,12 @@ +"use strict"; + +var pow = Math.pow; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return value; + if (!isFinite(value)) return value; + if (value < 0) return -pow(-value, 1 / 3); + return pow(value, 1 / 3); +}; diff --git a/node_modules/es5-ext/math/ceil-10.js b/node_modules/es5-ext/math/ceil-10.js new file mode 100644 index 0000000..351221f --- /dev/null +++ b/node_modules/es5-ext/math/ceil-10.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./_decimal-adjust")("ceil"); diff --git a/node_modules/es5-ext/math/clz32/implement.js b/node_modules/es5-ext/math/clz32/implement.js new file mode 100644 index 0000000..70562df --- /dev/null +++ b/node_modules/es5-ext/math/clz32/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "clz32", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/clz32/index.js b/node_modules/es5-ext/math/clz32/index.js new file mode 100644 index 0000000..2380335 --- /dev/null +++ b/node_modules/es5-ext/math/clz32/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.clz32 : require("./shim"); diff --git a/node_modules/es5-ext/math/clz32/is-implemented.js b/node_modules/es5-ext/math/clz32/is-implemented.js new file mode 100644 index 0000000..ee6d882 --- /dev/null +++ b/node_modules/es5-ext/math/clz32/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var clz32 = Math.clz32; + if (typeof clz32 !== "function") return false; + return clz32(1000) === 22; +}; diff --git a/node_modules/es5-ext/math/clz32/shim.js b/node_modules/es5-ext/math/clz32/shim.js new file mode 100644 index 0000000..2b526c2 --- /dev/null +++ b/node_modules/es5-ext/math/clz32/shim.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (value) { + // eslint-disable-next-line no-bitwise + value >>>= 0; + return value ? 32 - value.toString(2).length : 32; +}; diff --git a/node_modules/es5-ext/math/cosh/implement.js b/node_modules/es5-ext/math/cosh/implement.js new file mode 100644 index 0000000..74e7eea --- /dev/null +++ b/node_modules/es5-ext/math/cosh/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "cosh", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/cosh/index.js b/node_modules/es5-ext/math/cosh/index.js new file mode 100644 index 0000000..c7a7167 --- /dev/null +++ b/node_modules/es5-ext/math/cosh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.cosh : require("./shim"); diff --git a/node_modules/es5-ext/math/cosh/is-implemented.js b/node_modules/es5-ext/math/cosh/is-implemented.js new file mode 100644 index 0000000..7173054 --- /dev/null +++ b/node_modules/es5-ext/math/cosh/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var cosh = Math.cosh; + if (typeof cosh !== "function") return false; + return cosh(1) === 1.5430806348152437; +}; diff --git a/node_modules/es5-ext/math/cosh/shim.js b/node_modules/es5-ext/math/cosh/shim.js new file mode 100644 index 0000000..c762c84 --- /dev/null +++ b/node_modules/es5-ext/math/cosh/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +var exp = Math.exp; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return 1; + if (!isFinite(value)) return Infinity; + return (exp(value) + exp(-value)) / 2; +}; diff --git a/node_modules/es5-ext/math/expm1/implement.js b/node_modules/es5-ext/math/expm1/implement.js new file mode 100644 index 0000000..9739bf5 --- /dev/null +++ b/node_modules/es5-ext/math/expm1/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "expm1", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/expm1/index.js b/node_modules/es5-ext/math/expm1/index.js new file mode 100644 index 0000000..daf4395 --- /dev/null +++ b/node_modules/es5-ext/math/expm1/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.expm1 : require("./shim"); diff --git a/node_modules/es5-ext/math/expm1/is-implemented.js b/node_modules/es5-ext/math/expm1/is-implemented.js new file mode 100644 index 0000000..dfd056e --- /dev/null +++ b/node_modules/es5-ext/math/expm1/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var expm1 = Math.expm1; + if (typeof expm1 !== "function") return false; + return expm1(1).toFixed(15) === "1.718281828459045"; +}; diff --git a/node_modules/es5-ext/math/expm1/shim.js b/node_modules/es5-ext/math/expm1/shim.js new file mode 100644 index 0000000..6daf2bf --- /dev/null +++ b/node_modules/es5-ext/math/expm1/shim.js @@ -0,0 +1,16 @@ +// Thanks: https://github.com/monolithed/ECMAScript-6 + +"use strict"; + +var exp = Math.exp; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return value; + if (value === Infinity) return Infinity; + if (value === -Infinity) return -1; + + if (value > -1.0e-6 && value < 1.0e-6) return value + (value * value) / 2; + return exp(value) - 1; +}; diff --git a/node_modules/es5-ext/math/floor-10.js b/node_modules/es5-ext/math/floor-10.js new file mode 100644 index 0000000..3cb0c11 --- /dev/null +++ b/node_modules/es5-ext/math/floor-10.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./_decimal-adjust")("floor"); diff --git a/node_modules/es5-ext/math/fround/implement.js b/node_modules/es5-ext/math/fround/implement.js new file mode 100644 index 0000000..9ce9cf2 --- /dev/null +++ b/node_modules/es5-ext/math/fround/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "fround", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/fround/index.js b/node_modules/es5-ext/math/fround/index.js new file mode 100644 index 0000000..9f0dbc0 --- /dev/null +++ b/node_modules/es5-ext/math/fround/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.fround : require("./shim"); diff --git a/node_modules/es5-ext/math/fround/is-implemented.js b/node_modules/es5-ext/math/fround/is-implemented.js new file mode 100644 index 0000000..ad2b705 --- /dev/null +++ b/node_modules/es5-ext/math/fround/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var fround = Math.fround; + if (typeof fround !== "function") return false; + return fround(1.337) === 1.3370000123977661; +}; diff --git a/node_modules/es5-ext/math/fround/shim.js b/node_modules/es5-ext/math/fround/shim.js new file mode 100644 index 0000000..b0dfaab --- /dev/null +++ b/node_modules/es5-ext/math/fround/shim.js @@ -0,0 +1,33 @@ +/* global Float32Array */ + +// Credit: https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js + +"use strict"; + +var toFloat32; + +if (typeof Float32Array === "undefined") { + toFloat32 = (function () { + var pack = require("../_pack-ieee754") + , unpack = require("../_unpack-ieee754"); + + return function (value) { return unpack(pack(value, 8, 23), 8, 23); }; + })(); +} else { + toFloat32 = (function () { + var float32Array = new Float32Array(1); + return function (num) { + float32Array[0] = num; + return float32Array[0]; + }; + })(); +} + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return value; + if (!isFinite(value)) return value; + + return toFloat32(value); +}; diff --git a/node_modules/es5-ext/math/hypot/implement.js b/node_modules/es5-ext/math/hypot/implement.js new file mode 100644 index 0000000..e051add --- /dev/null +++ b/node_modules/es5-ext/math/hypot/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "hypot", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/hypot/index.js b/node_modules/es5-ext/math/hypot/index.js new file mode 100644 index 0000000..f8de46b --- /dev/null +++ b/node_modules/es5-ext/math/hypot/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.hypot : require("./shim"); diff --git a/node_modules/es5-ext/math/hypot/is-implemented.js b/node_modules/es5-ext/math/hypot/is-implemented.js new file mode 100644 index 0000000..d317bc7 --- /dev/null +++ b/node_modules/es5-ext/math/hypot/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var hypot = Math.hypot; + if (typeof hypot !== "function") return false; + return hypot(3, 4) === 5; +}; diff --git a/node_modules/es5-ext/math/hypot/shim.js b/node_modules/es5-ext/math/hypot/shim.js new file mode 100644 index 0000000..201ba7a --- /dev/null +++ b/node_modules/es5-ext/math/hypot/shim.js @@ -0,0 +1,37 @@ +// Thanks for hints: https://github.com/paulmillr/es6-shim + +"use strict"; + +var some = Array.prototype.some + , abs = Math.abs + , sqrt = Math.sqrt + , compare = function (val1, val2) { return val2 - val1; } + , divide = function (value) { return value / this; } + , add = function (sum, number) { return sum + number * number; }; + +// eslint-disable-next-line no-unused-vars +module.exports = function (val1, val2/*, …valn*/) { + var result, numbers; + if (!arguments.length) return 0; + some.call(arguments, function (val) { + if (isNaN(val)) { + result = NaN; + return false; + } + if (!isFinite(val)) { + result = Infinity; + return true; + } + if (result !== undefined) return false; + val = Number(val); + if (val === 0) return false; + if (numbers) numbers.push(abs(val)); + else numbers = [abs(val)]; + return false; + }); + if (result !== undefined) return result; + if (!numbers) return 0; + + numbers.sort(compare); + return numbers[0] * sqrt(numbers.map(divide, numbers[0]).reduce(add, 0)); +}; diff --git a/node_modules/es5-ext/math/imul/implement.js b/node_modules/es5-ext/math/imul/implement.js new file mode 100644 index 0000000..3aff479 --- /dev/null +++ b/node_modules/es5-ext/math/imul/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "imul", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/imul/index.js b/node_modules/es5-ext/math/imul/index.js new file mode 100644 index 0000000..969124c --- /dev/null +++ b/node_modules/es5-ext/math/imul/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.imul : require("./shim"); diff --git a/node_modules/es5-ext/math/imul/is-implemented.js b/node_modules/es5-ext/math/imul/is-implemented.js new file mode 100644 index 0000000..0f32919 --- /dev/null +++ b/node_modules/es5-ext/math/imul/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var imul = Math.imul; + if (typeof imul !== "function") return false; + return imul(-1, 8) === -8; +}; diff --git a/node_modules/es5-ext/math/imul/shim.js b/node_modules/es5-ext/math/imul/shim.js new file mode 100644 index 0000000..7511707 --- /dev/null +++ b/node_modules/es5-ext/math/imul/shim.js @@ -0,0 +1,17 @@ +/* eslint no-bitwise: "off" */ + +// Thanks: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference +// /Global_Objects/Math/imul + +"use strict"; + +module.exports = function (val1, val2) { + var xh = (val1 >>> 16) & 0xffff + , xl = val1 & 0xffff + , yh = (val2 >>> 16) & 0xffff + , yl = val2 & 0xffff; + + // The shift by 0 fixes the sign on the high part + // the final |0 converts the unsigned value into a signed value + return (xl * yl + (((xh * yl + xl * yh) << 16) >>> 0)) | 0; +}; diff --git a/node_modules/es5-ext/math/index.js b/node_modules/es5-ext/math/index.js new file mode 100644 index 0000000..a59269c --- /dev/null +++ b/node_modules/es5-ext/math/index.js @@ -0,0 +1,24 @@ +"use strict"; + +module.exports = { + acosh: require("./acosh"), + asinh: require("./asinh"), + atanh: require("./atanh"), + cbrt: require("./cbrt"), + ceil10: require("./ceil-10"), + clz32: require("./clz32"), + cosh: require("./cosh"), + expm1: require("./expm1"), + floor10: require("./floor-10"), + fround: require("./fround"), + hypot: require("./hypot"), + imul: require("./imul"), + log10: require("./log10"), + log2: require("./log2"), + log1p: require("./log1p"), + round10: require("./round-10"), + sign: require("./sign"), + sinh: require("./sinh"), + tanh: require("./tanh"), + trunc: require("./trunc") +}; diff --git a/node_modules/es5-ext/math/log10/implement.js b/node_modules/es5-ext/math/log10/implement.js new file mode 100644 index 0000000..f6153c1 --- /dev/null +++ b/node_modules/es5-ext/math/log10/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "log10", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/log10/index.js b/node_modules/es5-ext/math/log10/index.js new file mode 100644 index 0000000..abda55b --- /dev/null +++ b/node_modules/es5-ext/math/log10/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.log10 : require("./shim"); diff --git a/node_modules/es5-ext/math/log10/is-implemented.js b/node_modules/es5-ext/math/log10/is-implemented.js new file mode 100644 index 0000000..f221759 --- /dev/null +++ b/node_modules/es5-ext/math/log10/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var log10 = Math.log10; + if (typeof log10 !== "function") return false; + return log10(2) === 0.3010299956639812; +}; diff --git a/node_modules/es5-ext/math/log10/shim.js b/node_modules/es5-ext/math/log10/shim.js new file mode 100644 index 0000000..e8599a2 --- /dev/null +++ b/node_modules/es5-ext/math/log10/shim.js @@ -0,0 +1,14 @@ +"use strict"; + +var log = Math.log, LOG10E = Math.LOG10E; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value < 0) return NaN; + if (value === 0) return -Infinity; + if (value === 1) return 0; + if (value === Infinity) return Infinity; + + return log(value) * LOG10E; +}; diff --git a/node_modules/es5-ext/math/log1p/implement.js b/node_modules/es5-ext/math/log1p/implement.js new file mode 100644 index 0000000..21e94e6 --- /dev/null +++ b/node_modules/es5-ext/math/log1p/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "log1p", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/log1p/index.js b/node_modules/es5-ext/math/log1p/index.js new file mode 100644 index 0000000..76eacc5 --- /dev/null +++ b/node_modules/es5-ext/math/log1p/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.log1p : require("./shim"); diff --git a/node_modules/es5-ext/math/log1p/is-implemented.js b/node_modules/es5-ext/math/log1p/is-implemented.js new file mode 100644 index 0000000..7626ab4 --- /dev/null +++ b/node_modules/es5-ext/math/log1p/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var log1p = Math.log1p; + if (typeof log1p !== "function") return false; + return log1p(1) === 0.6931471805599453; +}; diff --git a/node_modules/es5-ext/math/log1p/shim.js b/node_modules/es5-ext/math/log1p/shim.js new file mode 100644 index 0000000..15f1182 --- /dev/null +++ b/node_modules/es5-ext/math/log1p/shim.js @@ -0,0 +1,17 @@ +// Thanks: https://github.com/monolithed/ECMAScript-6/blob/master/ES6.js + +"use strict"; + +var log = Math.log; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value < -1) return NaN; + if (value === -1) return -Infinity; + if (value === 0) return value; + if (value === Infinity) return Infinity; + + if (value > -1.0e-8 && value < 1.0e-8) return value - (value * value) / 2; + return log(1 + value); +}; diff --git a/node_modules/es5-ext/math/log2/implement.js b/node_modules/es5-ext/math/log2/implement.js new file mode 100644 index 0000000..91c06b1 --- /dev/null +++ b/node_modules/es5-ext/math/log2/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "log2", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/log2/index.js b/node_modules/es5-ext/math/log2/index.js new file mode 100644 index 0000000..a561977 --- /dev/null +++ b/node_modules/es5-ext/math/log2/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.log2 : require("./shim"); diff --git a/node_modules/es5-ext/math/log2/is-implemented.js b/node_modules/es5-ext/math/log2/is-implemented.js new file mode 100644 index 0000000..c70963f --- /dev/null +++ b/node_modules/es5-ext/math/log2/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var log2 = Math.log2; + if (typeof log2 !== "function") return false; + return log2(3).toFixed(15) === "1.584962500721156"; +}; diff --git a/node_modules/es5-ext/math/log2/shim.js b/node_modules/es5-ext/math/log2/shim.js new file mode 100644 index 0000000..51fcdae --- /dev/null +++ b/node_modules/es5-ext/math/log2/shim.js @@ -0,0 +1,14 @@ +"use strict"; + +var log = Math.log, LOG2E = Math.LOG2E; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value < 0) return NaN; + if (value === 0) return -Infinity; + if (value === 1) return 0; + if (value === Infinity) return Infinity; + + return log(value) * LOG2E; +}; diff --git a/node_modules/es5-ext/math/round-10.js b/node_modules/es5-ext/math/round-10.js new file mode 100644 index 0000000..228c235 --- /dev/null +++ b/node_modules/es5-ext/math/round-10.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./_decimal-adjust")("round"); diff --git a/node_modules/es5-ext/math/sign/implement.js b/node_modules/es5-ext/math/sign/implement.js new file mode 100644 index 0000000..daf1769 --- /dev/null +++ b/node_modules/es5-ext/math/sign/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "sign", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/sign/index.js b/node_modules/es5-ext/math/sign/index.js new file mode 100644 index 0000000..d2659cb --- /dev/null +++ b/node_modules/es5-ext/math/sign/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.sign : require("./shim"); diff --git a/node_modules/es5-ext/math/sign/is-implemented.js b/node_modules/es5-ext/math/sign/is-implemented.js new file mode 100644 index 0000000..4318cf2 --- /dev/null +++ b/node_modules/es5-ext/math/sign/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var sign = Math.sign; + if (typeof sign !== "function") return false; + return sign(10) === 1 && sign(-20) === -1; +}; diff --git a/node_modules/es5-ext/math/sign/shim.js b/node_modules/es5-ext/math/sign/shim.js new file mode 100644 index 0000000..9acb495 --- /dev/null +++ b/node_modules/es5-ext/math/sign/shim.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (value) { + value = Number(value); + if (isNaN(value) || value === 0) return value; + return value > 0 ? 1 : -1; +}; diff --git a/node_modules/es5-ext/math/sinh/implement.js b/node_modules/es5-ext/math/sinh/implement.js new file mode 100644 index 0000000..4655f6b --- /dev/null +++ b/node_modules/es5-ext/math/sinh/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "sinh", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/sinh/index.js b/node_modules/es5-ext/math/sinh/index.js new file mode 100644 index 0000000..107ef2e --- /dev/null +++ b/node_modules/es5-ext/math/sinh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.sinh : require("./shim"); diff --git a/node_modules/es5-ext/math/sinh/is-implemented.js b/node_modules/es5-ext/math/sinh/is-implemented.js new file mode 100644 index 0000000..aad22b0 --- /dev/null +++ b/node_modules/es5-ext/math/sinh/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var sinh = Math.sinh; + if (typeof sinh !== "function") return false; + return sinh(1) === 1.1752011936438014 && sinh(Number.MIN_VALUE) === 5e-324; +}; diff --git a/node_modules/es5-ext/math/sinh/shim.js b/node_modules/es5-ext/math/sinh/shim.js new file mode 100644 index 0000000..b161eca --- /dev/null +++ b/node_modules/es5-ext/math/sinh/shim.js @@ -0,0 +1,18 @@ +// Parts of implementation taken from es6-shim project +// See: https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js + +"use strict"; + +var expm1 = require("../expm1") + , abs = Math.abs + , exp = Math.exp + , e = Math.E; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return value; + if (!isFinite(value)) return value; + if (abs(value) < 1) return (expm1(value) - expm1(-value)) / 2; + return ((exp(value - 1) - exp(-value - 1)) * e) / 2; +}; diff --git a/node_modules/es5-ext/math/tanh/implement.js b/node_modules/es5-ext/math/tanh/implement.js new file mode 100644 index 0000000..52d2957 --- /dev/null +++ b/node_modules/es5-ext/math/tanh/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "tanh", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/tanh/index.js b/node_modules/es5-ext/math/tanh/index.js new file mode 100644 index 0000000..54b3251 --- /dev/null +++ b/node_modules/es5-ext/math/tanh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.tanh : require("./shim"); diff --git a/node_modules/es5-ext/math/tanh/is-implemented.js b/node_modules/es5-ext/math/tanh/is-implemented.js new file mode 100644 index 0000000..b6226b4 --- /dev/null +++ b/node_modules/es5-ext/math/tanh/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var tanh = Math.tanh; + if (typeof tanh !== "function") return false; + return tanh(1) === 0.7615941559557649 && tanh(Number.MAX_VALUE) === 1; +}; diff --git a/node_modules/es5-ext/math/tanh/shim.js b/node_modules/es5-ext/math/tanh/shim.js new file mode 100644 index 0000000..974dd7c --- /dev/null +++ b/node_modules/es5-ext/math/tanh/shim.js @@ -0,0 +1,17 @@ +"use strict"; + +var exp = Math.exp; + +module.exports = function (value) { + var num1, num2; + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return value; + if (value === Infinity) return 1; + if (value === -Infinity) return -1; + num1 = exp(value); + if (num1 === Infinity) return 1; + num2 = exp(-value); + if (num2 === Infinity) return -1; + return (num1 - num2) / (num1 + num2); +}; diff --git a/node_modules/es5-ext/math/trunc/implement.js b/node_modules/es5-ext/math/trunc/implement.js new file mode 100644 index 0000000..bf1bf64 --- /dev/null +++ b/node_modules/es5-ext/math/trunc/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "trunc", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/math/trunc/index.js b/node_modules/es5-ext/math/trunc/index.js new file mode 100644 index 0000000..8e3874c --- /dev/null +++ b/node_modules/es5-ext/math/trunc/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.trunc : require("./shim"); diff --git a/node_modules/es5-ext/math/trunc/is-implemented.js b/node_modules/es5-ext/math/trunc/is-implemented.js new file mode 100644 index 0000000..861b5c0 --- /dev/null +++ b/node_modules/es5-ext/math/trunc/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var trunc = Math.trunc; + if (typeof trunc !== "function") return false; + return trunc(13.67) === 13 && trunc(-13.67) === -13; +}; diff --git a/node_modules/es5-ext/math/trunc/shim.js b/node_modules/es5-ext/math/trunc/shim.js new file mode 100644 index 0000000..bf6ac8c --- /dev/null +++ b/node_modules/es5-ext/math/trunc/shim.js @@ -0,0 +1,13 @@ +"use strict"; + +var floor = Math.floor; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return value; + if (value === Infinity) return Infinity; + if (value === -Infinity) return -Infinity; + if (value > 0) return floor(value); + return -floor(-value); +}; diff --git a/node_modules/es5-ext/number/#/index.js b/node_modules/es5-ext/number/#/index.js new file mode 100644 index 0000000..50b6418 --- /dev/null +++ b/node_modules/es5-ext/number/#/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = { pad: require("./pad") }; diff --git a/node_modules/es5-ext/number/#/pad.js b/node_modules/es5-ext/number/#/pad.js new file mode 100644 index 0000000..aebe236 --- /dev/null +++ b/node_modules/es5-ext/number/#/pad.js @@ -0,0 +1,16 @@ +"use strict"; + +var pad = require("../../string/#/pad") + , toPosInt = require("../to-pos-integer") + , toFixed = Number.prototype.toFixed; + +module.exports = function (length/*, precision*/) { + var precision; + length = toPosInt(length); + precision = toPosInt(arguments[1]); + + return pad.call( + precision ? toFixed.call(this, precision) : this, "0", + length + (precision ? 1 + precision : 0) + ); +}; diff --git a/node_modules/es5-ext/number/epsilon/implement.js b/node_modules/es5-ext/number/epsilon/implement.js new file mode 100644 index 0000000..5a22cf5 --- /dev/null +++ b/node_modules/es5-ext/number/epsilon/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Number, "EPSILON", { + value: require("./"), + configurable: false, + enumerable: false, + writable: false + }); +} diff --git a/node_modules/es5-ext/number/epsilon/index.js b/node_modules/es5-ext/number/epsilon/index.js new file mode 100644 index 0000000..12e8a8d --- /dev/null +++ b/node_modules/es5-ext/number/epsilon/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = 2.220446049250313e-16; diff --git a/node_modules/es5-ext/number/epsilon/is-implemented.js b/node_modules/es5-ext/number/epsilon/is-implemented.js new file mode 100644 index 0000000..5ddc9d6 --- /dev/null +++ b/node_modules/es5-ext/number/epsilon/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function () { return typeof Number.EPSILON === "number"; }; diff --git a/node_modules/es5-ext/number/index.js b/node_modules/es5-ext/number/index.js new file mode 100644 index 0000000..b57ff15 --- /dev/null +++ b/node_modules/es5-ext/number/index.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = { + "#": require("./#"), + "EPSILON": require("./epsilon"), + "isFinite": require("./is-finite"), + "isInteger": require("./is-integer"), + "isNaN": require("./is-nan"), + "isNatural": require("./is-natural"), + "isNumber": require("./is-number"), + "isSafeInteger": require("./is-safe-integer"), + "MAX_SAFE_INTEGER": require("./max-safe-integer"), + "MIN_SAFE_INTEGER": require("./min-safe-integer"), + "toInteger": require("./to-integer"), + "toPosInteger": require("./to-pos-integer"), + "toUint32": require("./to-uint32") +}; diff --git a/node_modules/es5-ext/number/is-finite/implement.js b/node_modules/es5-ext/number/is-finite/implement.js new file mode 100644 index 0000000..41109fb --- /dev/null +++ b/node_modules/es5-ext/number/is-finite/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Number, "isFinite", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/number/is-finite/index.js b/node_modules/es5-ext/number/is-finite/index.js new file mode 100644 index 0000000..f3a7112 --- /dev/null +++ b/node_modules/es5-ext/number/is-finite/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Number.isFinite : require("./shim"); diff --git a/node_modules/es5-ext/number/is-finite/is-implemented.js b/node_modules/es5-ext/number/is-finite/is-implemented.js new file mode 100644 index 0000000..eadd050 --- /dev/null +++ b/node_modules/es5-ext/number/is-finite/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var numberIsFinite = Number.isFinite; + if (typeof numberIsFinite !== "function") return false; + return !numberIsFinite("23") && numberIsFinite(34) && !numberIsFinite(Infinity); +}; diff --git a/node_modules/es5-ext/number/is-finite/shim.js b/node_modules/es5-ext/number/is-finite/shim.js new file mode 100644 index 0000000..ce700f6 --- /dev/null +++ b/node_modules/es5-ext/number/is-finite/shim.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (value) { return typeof value === "number" && isFinite(value); }; diff --git a/node_modules/es5-ext/number/is-integer/implement.js b/node_modules/es5-ext/number/is-integer/implement.js new file mode 100644 index 0000000..48b4cd2 --- /dev/null +++ b/node_modules/es5-ext/number/is-integer/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Number, "isInteger", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/number/is-integer/index.js b/node_modules/es5-ext/number/is-integer/index.js new file mode 100644 index 0000000..2805b11 --- /dev/null +++ b/node_modules/es5-ext/number/is-integer/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Number.isInteger : require("./shim"); diff --git a/node_modules/es5-ext/number/is-integer/is-implemented.js b/node_modules/es5-ext/number/is-integer/is-implemented.js new file mode 100644 index 0000000..f357c71 --- /dev/null +++ b/node_modules/es5-ext/number/is-integer/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var isInteger = Number.isInteger; + if (typeof isInteger !== "function") return false; + return !isInteger("23") && isInteger(34) && !isInteger(32.34); +}; diff --git a/node_modules/es5-ext/number/is-integer/shim.js b/node_modules/es5-ext/number/is-integer/shim.js new file mode 100644 index 0000000..12058b5 --- /dev/null +++ b/node_modules/es5-ext/number/is-integer/shim.js @@ -0,0 +1,8 @@ +// Credit: http://www.2ality.com/2014/05/is-integer.html + +"use strict"; + +module.exports = function (value) { + if (typeof value !== "number") return false; + return value % 1 === 0; +}; diff --git a/node_modules/es5-ext/number/is-nan/implement.js b/node_modules/es5-ext/number/is-nan/implement.js new file mode 100644 index 0000000..f704e4c --- /dev/null +++ b/node_modules/es5-ext/number/is-nan/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Number, "isNaN", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/number/is-nan/index.js b/node_modules/es5-ext/number/is-nan/index.js new file mode 100644 index 0000000..2cec8fc --- /dev/null +++ b/node_modules/es5-ext/number/is-nan/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Number.isNaN : require("./shim"); diff --git a/node_modules/es5-ext/number/is-nan/is-implemented.js b/node_modules/es5-ext/number/is-nan/is-implemented.js new file mode 100644 index 0000000..756838a --- /dev/null +++ b/node_modules/es5-ext/number/is-nan/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var numberIsNaN = Number.isNaN; + if (typeof numberIsNaN !== "function") return false; + return !numberIsNaN({}) && numberIsNaN(NaN) && !numberIsNaN(34); +}; diff --git a/node_modules/es5-ext/number/is-nan/shim.js b/node_modules/es5-ext/number/is-nan/shim.js new file mode 100644 index 0000000..b5730d1 --- /dev/null +++ b/node_modules/es5-ext/number/is-nan/shim.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (value) { + // eslint-disable-next-line no-self-compare + return value !== value; +}; diff --git a/node_modules/es5-ext/number/is-natural.js b/node_modules/es5-ext/number/is-natural.js new file mode 100644 index 0000000..2bbb5a2 --- /dev/null +++ b/node_modules/es5-ext/number/is-natural.js @@ -0,0 +1,5 @@ +"use strict"; + +var isInteger = require("./is-integer"); + +module.exports = function (num) { return isInteger(num) && num >= 0; }; diff --git a/node_modules/es5-ext/number/is-number.js b/node_modules/es5-ext/number/is-number.js new file mode 100644 index 0000000..3da0712 --- /dev/null +++ b/node_modules/es5-ext/number/is-number.js @@ -0,0 +1,10 @@ +"use strict"; + +var objToString = Object.prototype.toString, id = objToString.call(1); + +module.exports = function (value) { + return ( + typeof value === "number" || + (value instanceof Number || (typeof value === "object" && objToString.call(value) === id)) + ); +}; diff --git a/node_modules/es5-ext/number/is-safe-integer/implement.js b/node_modules/es5-ext/number/is-safe-integer/implement.js new file mode 100644 index 0000000..571b214 --- /dev/null +++ b/node_modules/es5-ext/number/is-safe-integer/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Number, "isSafeInteger", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/number/is-safe-integer/index.js b/node_modules/es5-ext/number/is-safe-integer/index.js new file mode 100644 index 0000000..26c2b9f --- /dev/null +++ b/node_modules/es5-ext/number/is-safe-integer/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Number.isSafeInteger : require("./shim"); diff --git a/node_modules/es5-ext/number/is-safe-integer/is-implemented.js b/node_modules/es5-ext/number/is-safe-integer/is-implemented.js new file mode 100644 index 0000000..5ed3763 --- /dev/null +++ b/node_modules/es5-ext/number/is-safe-integer/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var isSafeInteger = Number.isSafeInteger; + if (typeof isSafeInteger !== "function") return false; + return !isSafeInteger("23") && isSafeInteger(34232322323) && !isSafeInteger(9007199254740992); +}; diff --git a/node_modules/es5-ext/number/is-safe-integer/shim.js b/node_modules/es5-ext/number/is-safe-integer/shim.js new file mode 100644 index 0000000..fb4f4d5 --- /dev/null +++ b/node_modules/es5-ext/number/is-safe-integer/shim.js @@ -0,0 +1,10 @@ +"use strict"; + +var isInteger = require("../is-integer/shim") + , maxValue = require("../max-safe-integer") + , abs = Math.abs; + +module.exports = function (value) { + if (!isInteger(value)) return false; + return abs(value) <= maxValue; +}; diff --git a/node_modules/es5-ext/number/max-safe-integer/implement.js b/node_modules/es5-ext/number/max-safe-integer/implement.js new file mode 100644 index 0000000..4ee3231 --- /dev/null +++ b/node_modules/es5-ext/number/max-safe-integer/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Number, "MAX_SAFE_INTEGER", { + value: require("./"), + configurable: false, + enumerable: false, + writable: false + }); +} diff --git a/node_modules/es5-ext/number/max-safe-integer/index.js b/node_modules/es5-ext/number/max-safe-integer/index.js new file mode 100644 index 0000000..75a41e7 --- /dev/null +++ b/node_modules/es5-ext/number/max-safe-integer/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = Math.pow(2, 53) - 1; diff --git a/node_modules/es5-ext/number/max-safe-integer/is-implemented.js b/node_modules/es5-ext/number/max-safe-integer/is-implemented.js new file mode 100644 index 0000000..3d6e914 --- /dev/null +++ b/node_modules/es5-ext/number/max-safe-integer/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function () { return typeof Number.MAX_SAFE_INTEGER === "number"; }; diff --git a/node_modules/es5-ext/number/min-safe-integer/implement.js b/node_modules/es5-ext/number/min-safe-integer/implement.js new file mode 100644 index 0000000..979dc39 --- /dev/null +++ b/node_modules/es5-ext/number/min-safe-integer/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Number, "MIN_SAFE_INTEGER", { + value: require("./"), + configurable: false, + enumerable: false, + writable: false + }); +} diff --git a/node_modules/es5-ext/number/min-safe-integer/index.js b/node_modules/es5-ext/number/min-safe-integer/index.js new file mode 100644 index 0000000..cde4514 --- /dev/null +++ b/node_modules/es5-ext/number/min-safe-integer/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = -(Math.pow(2, 53) - 1); diff --git a/node_modules/es5-ext/number/min-safe-integer/is-implemented.js b/node_modules/es5-ext/number/min-safe-integer/is-implemented.js new file mode 100644 index 0000000..71e6a31 --- /dev/null +++ b/node_modules/es5-ext/number/min-safe-integer/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function () { return typeof Number.MIN_SAFE_INTEGER === "number"; }; diff --git a/node_modules/es5-ext/number/to-integer.js b/node_modules/es5-ext/number/to-integer.js new file mode 100644 index 0000000..4df5572 --- /dev/null +++ b/node_modules/es5-ext/number/to-integer.js @@ -0,0 +1,12 @@ +"use strict"; + +var sign = require("../math/sign") + , abs = Math.abs + , floor = Math.floor; + +module.exports = function (value) { + if (isNaN(value)) return 0; + value = Number(value); + if (value === 0 || !isFinite(value)) return value; + return sign(value) * floor(abs(value)); +}; diff --git a/node_modules/es5-ext/number/to-pos-integer.js b/node_modules/es5-ext/number/to-pos-integer.js new file mode 100644 index 0000000..28f6d40 --- /dev/null +++ b/node_modules/es5-ext/number/to-pos-integer.js @@ -0,0 +1,6 @@ +"use strict"; + +var toInteger = require("./to-integer") + , max = Math.max; + +module.exports = function (value) { return max(0, toInteger(value)); }; diff --git a/node_modules/es5-ext/number/to-uint32.js b/node_modules/es5-ext/number/to-uint32.js new file mode 100644 index 0000000..cb3590a --- /dev/null +++ b/node_modules/es5-ext/number/to-uint32.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (value) { + // eslint-disable-next-line no-bitwise + return value >>> 0; +}; diff --git a/node_modules/es5-ext/object/_iterate.js b/node_modules/es5-ext/object/_iterate.js new file mode 100644 index 0000000..0a64fdb --- /dev/null +++ b/node_modules/es5-ext/object/_iterate.js @@ -0,0 +1,30 @@ +// Internal method, used by iteration functions. +// Calls a function for each key-value pair found in object +// Optionally takes compareFn to iterate object in specific order + +"use strict"; + +var callable = require("./valid-callable") + , value = require("./valid-value") + , bind = Function.prototype.bind + , call = Function.prototype.call + , keys = Object.keys + , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = function (method, defVal) { + return function (obj, cb/*, thisArg, compareFn*/) { + var list, thisArg = arguments[2], compareFn = arguments[3]; + obj = Object(value(obj)); + callable(cb); + + list = keys(obj); + if (compareFn) { + list.sort(typeof compareFn === "function" ? bind.call(compareFn, obj) : undefined); + } + if (typeof method !== "function") method = list[method]; + return call.call(method, list, function (key, index) { + if (!objPropertyIsEnumerable.call(obj, key)) return defVal; + return call.call(cb, thisArg, obj[key], key, obj, index); + }); + }; +}; diff --git a/node_modules/es5-ext/object/assign-deep.js b/node_modules/es5-ext/object/assign-deep.js new file mode 100644 index 0000000..4a8597a --- /dev/null +++ b/node_modules/es5-ext/object/assign-deep.js @@ -0,0 +1,34 @@ +"use strict"; + +var includes = require("../array/#/contains") + , uniq = require("../array/#/uniq") + , copyDeep = require("./copy-deep") + , objForEach = require("./for-each") + , isPlainObject = require("./is-plain-object") + , ensureValue = require("./valid-value"); + +var isArray = Array.isArray, slice = Array.prototype.slice; + +var deepAssign = function (target, source) { + if (target === source) return target; + if (isPlainObject(target) && isPlainObject(source)) { + objForEach(source, function (value, key) { target[key] = deepAssign(target[key], value); }); + return target; + } + if (isArray(target) && isArray(source)) { + source.forEach(function (item) { + if (includes.call(target, item)) return; + if (isArray(item) || isPlainObject(item)) item = copyDeep(item); + target.push(item); + }); + return target; + } + if (isPlainObject(source) || isArray(source)) return copyDeep(source); + return source; +}; + +module.exports = function (target/*, ...objects*/) { + return uniq + .call([ensureValue(target)].concat(slice.call(arguments, 1).map(ensureValue))) + .reduce(deepAssign); +}; diff --git a/node_modules/es5-ext/object/assign/implement.js b/node_modules/es5-ext/object/assign/implement.js new file mode 100644 index 0000000..f20371d --- /dev/null +++ b/node_modules/es5-ext/object/assign/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Object, "assign", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/object/assign/index.js b/node_modules/es5-ext/object/assign/index.js new file mode 100644 index 0000000..9585b55 --- /dev/null +++ b/node_modules/es5-ext/object/assign/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Object.assign : require("./shim"); diff --git a/node_modules/es5-ext/object/assign/is-implemented.js b/node_modules/es5-ext/object/assign/is-implemented.js new file mode 100644 index 0000000..8bf71ae --- /dev/null +++ b/node_modules/es5-ext/object/assign/is-implemented.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function () { + var assign = Object.assign, obj; + if (typeof assign !== "function") return false; + obj = { foo: "raz" }; + assign(obj, { bar: "dwa" }, { trzy: "trzy" }); + return obj.foo + obj.bar + obj.trzy === "razdwatrzy"; +}; diff --git a/node_modules/es5-ext/object/assign/shim.js b/node_modules/es5-ext/object/assign/shim.js new file mode 100644 index 0000000..ad1804d --- /dev/null +++ b/node_modules/es5-ext/object/assign/shim.js @@ -0,0 +1,23 @@ +"use strict"; + +var keys = require("../keys") + , value = require("../valid-value") + , max = Math.max; + +module.exports = function (dest, src/*, …srcn*/) { + var error, i, length = max(arguments.length, 2), assign; + dest = Object(value(dest)); + assign = function (key) { + try { + dest[key] = src[key]; + } catch (e) { + if (!error) error = e; + } + }; + for (i = 1; i < length; ++i) { + src = arguments[i]; + keys(src).forEach(assign); + } + if (error !== undefined) throw error; + return dest; +}; diff --git a/node_modules/es5-ext/object/clear.js b/node_modules/es5-ext/object/clear.js new file mode 100644 index 0000000..268cc5b --- /dev/null +++ b/node_modules/es5-ext/object/clear.js @@ -0,0 +1,16 @@ +"use strict"; + +var keys = require("./keys"); + +module.exports = function (obj) { + var error; + keys(obj).forEach(function (key) { + try { + delete this[key]; + } catch (e) { + if (!error) error = e; + } + }, obj); + if (error !== undefined) throw error; + return obj; +}; diff --git a/node_modules/es5-ext/object/compact.js b/node_modules/es5-ext/object/compact.js new file mode 100644 index 0000000..a1794bb --- /dev/null +++ b/node_modules/es5-ext/object/compact.js @@ -0,0 +1,8 @@ +"use strict"; + +var filter = require("./filter") + , isValue = require("./is-value"); + +module.exports = function (obj) { + return filter(obj, function (val) { return isValue(val); }); +}; diff --git a/node_modules/es5-ext/object/compare.js b/node_modules/es5-ext/object/compare.js new file mode 100644 index 0000000..261a732 --- /dev/null +++ b/node_modules/es5-ext/object/compare.js @@ -0,0 +1,39 @@ +"use strict"; + +var strCompare = require("../string/#/case-insensitive-compare") + , isObject = require("./is-object") + , isValue = require("./is-value") + , numIsNaN = require("../number/is-nan") + , resolve + , typeMap; + +typeMap = { undefined: 0, object: 1, boolean: 2, string: 3, number: 4 }; + +resolve = function (a) { + if (isObject(a)) { + if (typeof a.valueOf !== "function") return NaN; + a = a.valueOf(); + if (isObject(a)) { + if (typeof a.toString !== "function") return NaN; + a = a.toString(); + if (typeof a !== "string") return NaN; + } + } + return a; +}; + +module.exports = function (val1, val2) { + if (val1 === val2) return 0; // Same + + val1 = resolve(val1); + val2 = resolve(val2); + // eslint-disable-next-line eqeqeq + if (val1 == val2) return typeMap[typeof val1] - typeMap[typeof val2]; + if (!isValue(val1)) return -1; + if (!isValue(val2)) return 1; + if (typeof val1 === "string" || typeof val2 === "string") { + return strCompare.call(val1, val2); + } + if (numIsNaN(val1) && numIsNaN(val2)) return 0; // Jslint: ignore + return Number(val1) - Number(val2); +}; diff --git a/node_modules/es5-ext/object/copy-deep.js b/node_modules/es5-ext/object/copy-deep.js new file mode 100644 index 0000000..1d1bed2 --- /dev/null +++ b/node_modules/es5-ext/object/copy-deep.js @@ -0,0 +1,35 @@ +"use strict"; + +var forEach = require("./for-each") + , isPlainObject = require("./is-plain-object") + , ensureValue = require("./valid-value") + , isArray = Array.isArray; + +var copyValue = function (value, ancestors, ancestorsCopy) { + var mode; + if (isPlainObject(value)) mode = "object"; + else if (isArray(value)) mode = "array"; + if (!mode) return value; + + var copy = ancestorsCopy[ancestors.indexOf(value)]; + if (copy) return copy; + copy = mode === "object" ? {} : []; + + ancestors.push(value); + ancestorsCopy.push(copy); + if (mode === "object") { + forEach(value, function (item, key) { + copy[key] = copyValue(item, ancestors, ancestorsCopy); + }); + } else { + value.forEach(function (item, index) { + copy[index] = copyValue(item, ancestors, ancestorsCopy); + }); + } + ancestors.pop(); + ancestorsCopy.pop(); + + return copy; +}; + +module.exports = function (source) { return copyValue(ensureValue(source), [], []); }; diff --git a/node_modules/es5-ext/object/copy.js b/node_modules/es5-ext/object/copy.js new file mode 100644 index 0000000..5368e42 --- /dev/null +++ b/node_modules/es5-ext/object/copy.js @@ -0,0 +1,19 @@ +"use strict"; + +var aFrom = require("../array/from") + , assign = require("./assign") + , value = require("./valid-value"); + +module.exports = function (obj/*, propertyNames, options*/) { + var copy = Object(value(obj)), propertyNames = arguments[1], options = Object(arguments[2]); + if (copy !== obj && !propertyNames) return copy; + var result = {}; + if (propertyNames) { + aFrom(propertyNames, function (propertyName) { + if (options.ensure || propertyName in obj) result[propertyName] = obj[propertyName]; + }); + } else { + assign(result, obj); + } + return result; +}; diff --git a/node_modules/es5-ext/object/count.js b/node_modules/es5-ext/object/count.js new file mode 100644 index 0000000..6c018bb --- /dev/null +++ b/node_modules/es5-ext/object/count.js @@ -0,0 +1,5 @@ +"use strict"; + +var keys = require("./keys"); + +module.exports = function (obj) { return keys(obj).length; }; diff --git a/node_modules/es5-ext/object/create.js b/node_modules/es5-ext/object/create.js new file mode 100644 index 0000000..a391ec1 --- /dev/null +++ b/node_modules/es5-ext/object/create.js @@ -0,0 +1,43 @@ +// Workaround for http://code.google.com/p/v8/issues/detail?id=2804 + +"use strict"; + +var create = Object.create, shim; + +if (!require("./set-prototype-of/is-implemented")()) { + shim = require("./set-prototype-of/shim"); +} + +module.exports = (function () { + var nullObject, polyProps, desc; + if (!shim) return create; + if (shim.level !== 1) return create; + + nullObject = {}; + polyProps = {}; + desc = { configurable: false, enumerable: false, writable: true, value: undefined }; + Object.getOwnPropertyNames(Object.prototype).forEach(function (name) { + if (name === "__proto__") { + polyProps[name] = { + configurable: true, + enumerable: false, + writable: true, + value: undefined + }; + return; + } + polyProps[name] = desc; + }); + Object.defineProperties(nullObject, polyProps); + + Object.defineProperty(shim, "nullPolyfill", { + configurable: false, + enumerable: false, + writable: false, + value: nullObject + }); + + return function (prototype, props) { + return create(prototype === null ? nullObject : prototype, props); + }; +})(); diff --git a/node_modules/es5-ext/object/ensure-array.js b/node_modules/es5-ext/object/ensure-array.js new file mode 100644 index 0000000..5ca7a94 --- /dev/null +++ b/node_modules/es5-ext/object/ensure-array.js @@ -0,0 +1,9 @@ +"use strict"; + +var toShortString = require("../to-short-string-representation") + , isArray = require("./is-array-like"); + +module.exports = function (value) { + if (isArray(value)) return value; + throw new TypeError(toShortString(value) + " is not a array"); +}; diff --git a/node_modules/es5-ext/object/ensure-finite-number.js b/node_modules/es5-ext/object/ensure-finite-number.js new file mode 100644 index 0000000..4f6e4b4 --- /dev/null +++ b/node_modules/es5-ext/object/ensure-finite-number.js @@ -0,0 +1,9 @@ +"use strict"; + +var isFiniteNumber = require("./is-finite-number") + , safeToString = require("../safe-to-string"); + +module.exports = function (value) { + if (isFiniteNumber(value)) return Number(value); + throw new TypeError(safeToString(value) + " does not represent a finite number value"); +}; diff --git a/node_modules/es5-ext/object/ensure-integer.js b/node_modules/es5-ext/object/ensure-integer.js new file mode 100644 index 0000000..9ec64b5 --- /dev/null +++ b/node_modules/es5-ext/object/ensure-integer.js @@ -0,0 +1,9 @@ +"use strict"; + +var toShortString = require("../to-short-string-representation") + , isInteger = require("./is-integer"); + +module.exports = function (num) { + if (!isInteger(num)) throw new TypeError(toShortString(num) + " is not a integer"); + return Number(num); +}; diff --git a/node_modules/es5-ext/object/ensure-natural-number-value.js b/node_modules/es5-ext/object/ensure-natural-number-value.js new file mode 100644 index 0000000..1a901aa --- /dev/null +++ b/node_modules/es5-ext/object/ensure-natural-number-value.js @@ -0,0 +1,10 @@ +"use strict"; + +var isNaturalValue = require("./is-natural-number-value") + , toShortString = require("../to-short-string-representation"); + +module.exports = function (arg) { + var num = Number(arg); + if (!isNaturalValue(arg)) throw new TypeError(toShortString(arg) + " is not a natural number"); + return num; +}; diff --git a/node_modules/es5-ext/object/ensure-natural-number.js b/node_modules/es5-ext/object/ensure-natural-number.js new file mode 100644 index 0000000..ec7e514 --- /dev/null +++ b/node_modules/es5-ext/object/ensure-natural-number.js @@ -0,0 +1,10 @@ +"use strict"; + +var isNatural = require("../number/is-natural") + , toShortString = require("../to-short-string-representation"); + +module.exports = function (arg) { + var num = Number(arg); + if (!isNatural(num)) throw new TypeError(toShortString(arg) + " is not a natural number"); + return num; +}; diff --git a/node_modules/es5-ext/object/ensure-plain-function.js b/node_modules/es5-ext/object/ensure-plain-function.js new file mode 100644 index 0000000..6cd9853 --- /dev/null +++ b/node_modules/es5-ext/object/ensure-plain-function.js @@ -0,0 +1,11 @@ +"use strict"; + +var safeToString = require("../safe-to-string") + , isPlainFunction = require("./is-plain-function"); + +module.exports = function (value) { + if (!isPlainFunction(value)) { + throw new TypeError(safeToString(value) + " is not a plain function"); + } + return value; +}; diff --git a/node_modules/es5-ext/object/ensure-plain-object.js b/node_modules/es5-ext/object/ensure-plain-object.js new file mode 100644 index 0000000..7fb2b93 --- /dev/null +++ b/node_modules/es5-ext/object/ensure-plain-object.js @@ -0,0 +1,9 @@ +"use strict"; + +var safeToString = require("../safe-to-string") + , isPlainObject = require("./is-plain-object"); + +module.exports = function (value) { + if (!isPlainObject(value)) throw new TypeError(safeToString(value) + " is not a plain object"); + return value; +}; diff --git a/node_modules/es5-ext/object/ensure-promise.js b/node_modules/es5-ext/object/ensure-promise.js new file mode 100644 index 0000000..b5b5356 --- /dev/null +++ b/node_modules/es5-ext/object/ensure-promise.js @@ -0,0 +1,9 @@ +"use strict"; + +var safeToString = require("../safe-to-string") + , isPromise = require("./is-promise"); + +module.exports = function (value) { + if (!isPromise(value)) throw new TypeError(safeToString(value) + " is not a promise"); + return value; +}; diff --git a/node_modules/es5-ext/object/ensure-thenable.js b/node_modules/es5-ext/object/ensure-thenable.js new file mode 100644 index 0000000..c55c17a --- /dev/null +++ b/node_modules/es5-ext/object/ensure-thenable.js @@ -0,0 +1,9 @@ +"use strict"; + +var safeToString = require("../safe-to-string") + , isThenable = require("./is-thenable"); + +module.exports = function (value) { + if (!isThenable(value)) throw new TypeError(safeToString(value) + " is not a thenable"); + return value; +}; diff --git a/node_modules/es5-ext/object/entries/implement.js b/node_modules/es5-ext/object/entries/implement.js new file mode 100644 index 0000000..5c2a246 --- /dev/null +++ b/node_modules/es5-ext/object/entries/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Object, "entries", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/object/entries/index.js b/node_modules/es5-ext/object/entries/index.js new file mode 100644 index 0000000..4a297d6 --- /dev/null +++ b/node_modules/es5-ext/object/entries/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Object.entries : require("./shim"); diff --git a/node_modules/es5-ext/object/entries/is-implemented.js b/node_modules/es5-ext/object/entries/is-implemented.js new file mode 100644 index 0000000..aad52b2 --- /dev/null +++ b/node_modules/es5-ext/object/entries/is-implemented.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + try { return Object.entries({ foo: 12 })[0][0] === "foo"; } + catch (e) { return false; } +}; diff --git a/node_modules/es5-ext/object/entries/shim.js b/node_modules/es5-ext/object/entries/shim.js new file mode 100644 index 0000000..2348e44 --- /dev/null +++ b/node_modules/es5-ext/object/entries/shim.js @@ -0,0 +1,14 @@ +"use strict"; + +var ensureValue = require("../valid-value"); + +module.exports = function (object) { + ensureValue(object); + var result = []; + object = Object(object); + for (var key in object) { + if (!propertyIsEnumerable.call(object, key)) continue; + result.push([key, object[key]]); + } + return result; +}; diff --git a/node_modules/es5-ext/object/eq.js b/node_modules/es5-ext/object/eq.js new file mode 100644 index 0000000..0312468 --- /dev/null +++ b/node_modules/es5-ext/object/eq.js @@ -0,0 +1,7 @@ +"use strict"; + +var numIsNaN = require("../number/is-nan"); + +module.exports = function (val1, val2) { + return val1 === val2 || (numIsNaN(val1) && numIsNaN(val2)); +}; diff --git a/node_modules/es5-ext/object/every.js b/node_modules/es5-ext/object/every.js new file mode 100644 index 0000000..892b548 --- /dev/null +++ b/node_modules/es5-ext/object/every.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./_iterate")("every", true); diff --git a/node_modules/es5-ext/object/filter.js b/node_modules/es5-ext/object/filter.js new file mode 100644 index 0000000..5c1ed92 --- /dev/null +++ b/node_modules/es5-ext/object/filter.js @@ -0,0 +1,14 @@ +"use strict"; + +var callable = require("./valid-callable") + , forEach = require("./for-each") + , call = Function.prototype.call; + +module.exports = function (obj, cb/*, thisArg*/) { + var result = {}, thisArg = arguments[2]; + callable(cb); + forEach(obj, function (value, key, targetObj, index) { + if (call.call(cb, thisArg, value, key, targetObj, index)) result[key] = targetObj[key]; + }); + return result; +}; diff --git a/node_modules/es5-ext/object/find-key.js b/node_modules/es5-ext/object/find-key.js new file mode 100644 index 0000000..6da6ba6 --- /dev/null +++ b/node_modules/es5-ext/object/find-key.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./_iterate")(require("../array/#/find"), false); diff --git a/node_modules/es5-ext/object/find.js b/node_modules/es5-ext/object/find.js new file mode 100644 index 0000000..650375b --- /dev/null +++ b/node_modules/es5-ext/object/find.js @@ -0,0 +1,10 @@ +"use strict"; + +var findKey = require("./find-key") + , isValue = require("./is-value"); + +// eslint-disable-next-line no-unused-vars +module.exports = function (obj, cb/*, thisArg, compareFn*/) { + var key = findKey.apply(this, arguments); + return isValue(key) ? obj[key] : key; +}; diff --git a/node_modules/es5-ext/object/first-key.js b/node_modules/es5-ext/object/first-key.js new file mode 100644 index 0000000..3666de5 --- /dev/null +++ b/node_modules/es5-ext/object/first-key.js @@ -0,0 +1,13 @@ +"use strict"; + +var value = require("./valid-value") + , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = function (obj) { + var i; + value(obj); + for (i in obj) { + if (objPropertyIsEnumerable.call(obj, i)) return i; + } + return null; +}; diff --git a/node_modules/es5-ext/object/flatten.js b/node_modules/es5-ext/object/flatten.js new file mode 100644 index 0000000..cda7475 --- /dev/null +++ b/node_modules/es5-ext/object/flatten.js @@ -0,0 +1,16 @@ +"use strict"; + +var isPlainObject = require("./is-plain-object") + , forEach = require("./for-each") + , process; + +process = function self(value, key) { + if (isPlainObject(value)) forEach(value, self, this); + else this[key] = value; +}; + +module.exports = function (obj) { + var flattened = {}; + forEach(obj, process, flattened); + return flattened; +}; diff --git a/node_modules/es5-ext/object/for-each.js b/node_modules/es5-ext/object/for-each.js new file mode 100644 index 0000000..d282956 --- /dev/null +++ b/node_modules/es5-ext/object/for-each.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./_iterate")("forEach"); diff --git a/node_modules/es5-ext/object/get-property-names.js b/node_modules/es5-ext/object/get-property-names.js new file mode 100644 index 0000000..7dfef27 --- /dev/null +++ b/node_modules/es5-ext/object/get-property-names.js @@ -0,0 +1,17 @@ +"use strict"; + +var uniq = require("../array/#/uniq") + , value = require("./valid-value") + , push = Array.prototype.push + , getOwnPropertyNames = Object.getOwnPropertyNames + , getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (obj) { + var keys; + obj = Object(value(obj)); + keys = getOwnPropertyNames(obj); + while ((obj = getPrototypeOf(obj))) { + push.apply(keys, getOwnPropertyNames(obj)); + } + return uniq.call(keys); +}; diff --git a/node_modules/es5-ext/object/index.js b/node_modules/es5-ext/object/index.js new file mode 100644 index 0000000..13cfb95 --- /dev/null +++ b/node_modules/es5-ext/object/index.js @@ -0,0 +1,70 @@ +"use strict"; + +module.exports = { + assign: require("./assign"), + assignDeep: require("./assign-deep"), + clear: require("./clear"), + compact: require("./compact"), + compare: require("./compare"), + copy: require("./copy"), + copyDeep: require("./copy-deep"), + count: require("./count"), + create: require("./create"), + ensureArray: require("./ensure-array"), + ensureFiniteNumber: require("./ensure-finite-number"), + ensureInteger: require("./ensure-integer"), + ensureNaturalNumber: require("./ensure-natural-number"), + ensureNaturalNumberValue: require("./ensure-natural-number-value"), + ensurePlainFunction: require("./ensure-plain-function"), + ensurePlainObject: require("./ensure-plain-object"), + ensurePromise: require("./ensure-promise"), + ensureThenable: require("./ensure-thenable"), + entries: require("./entries"), + eq: require("./eq"), + every: require("./every"), + filter: require("./filter"), + find: require("./find"), + findKey: require("./find-key"), + firstKey: require("./first-key"), + flatten: require("./flatten"), + forEach: require("./for-each"), + getPropertyNames: require("./get-property-names"), + is: require("./is"), + isArrayLike: require("./is-array-like"), + isCallable: require("./is-callable"), + isCopy: require("./is-copy"), + isCopyDeep: require("./is-copy-deep"), + isEmpty: require("./is-empty"), + isFiniteNumber: require("./is-finite-number"), + isInteger: require("./is-integer"), + isNaturalNumber: require("./is-natural-number"), + isNaturalNumberValue: require("./is-natural-number-value"), + isNumberValue: require("./is-number-value"), + isObject: require("./is-object"), + isPlainFunction: require("./is-plain-function"), + isPlainObject: require("./is-plain-object"), + isPromise: require("./is-promise"), + isThenable: require("./is-thenable"), + isValue: require("./is-value"), + keyOf: require("./key-of"), + keys: require("./keys"), + map: require("./map"), + mapKeys: require("./map-keys"), + normalizeOptions: require("./normalize-options"), + mixin: require("./mixin"), + mixinPrototypes: require("./mixin-prototypes"), + primitiveSet: require("./primitive-set"), + safeTraverse: require("./safe-traverse"), + serialize: require("./serialize"), + setPrototypeOf: require("./set-prototype-of"), + some: require("./some"), + toArray: require("./to-array"), + unserialize: require("./unserialize"), + validateArrayLike: require("./validate-array-like"), + validateArrayLikeObject: require("./validate-array-like-object"), + validCallable: require("./valid-callable"), + validObject: require("./valid-object"), + validateStringifiable: require("./validate-stringifiable"), + validateStringifiableValue: require("./validate-stringifiable-value"), + validValue: require("./valid-value") +}; diff --git a/node_modules/es5-ext/object/is-array-like.js b/node_modules/es5-ext/object/is-array-like.js new file mode 100644 index 0000000..fcb9115 --- /dev/null +++ b/node_modules/es5-ext/object/is-array-like.js @@ -0,0 +1,17 @@ +"use strict"; + +var isFunction = require("../function/is-function") + , isObject = require("./is-object") + , isValue = require("./is-value"); + +module.exports = function (value) { + return ( + (isValue(value) && + typeof value.length === "number" && + // Just checking ((typeof x === 'object') && (typeof x !== 'function')) + // won't work right for some cases, e.g.: + // type of instance of NodeList in Safari is a 'function' + ((isObject(value) && !isFunction(value)) || typeof value === "string")) || + false + ); +}; diff --git a/node_modules/es5-ext/object/is-callable.js b/node_modules/es5-ext/object/is-callable.js new file mode 100644 index 0000000..927e5e8 --- /dev/null +++ b/node_modules/es5-ext/object/is-callable.js @@ -0,0 +1,5 @@ +// Deprecated + +"use strict"; + +module.exports = function (obj) { return typeof obj === "function"; }; diff --git a/node_modules/es5-ext/object/is-copy-deep.js b/node_modules/es5-ext/object/is-copy-deep.js new file mode 100644 index 0000000..a1206ae --- /dev/null +++ b/node_modules/es5-ext/object/is-copy-deep.js @@ -0,0 +1,59 @@ +"use strict"; + +var eq = require("./eq") + , isPlainObject = require("./is-plain-object") + , value = require("./valid-value"); + +var isArray = Array.isArray + , keys = Object.keys + , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable + , objHasOwnProperty = Object.prototype.hasOwnProperty + , eqArr + , eqVal + , eqObj; + +eqArr = function (arr1, arr2, recMap) { + var i, length = arr1.length; + if (length !== arr2.length) return false; + for (i = 0; i < length; ++i) { + if (objHasOwnProperty.call(arr1, i) !== objHasOwnProperty.call(arr2, i)) return false; + if (!eqVal(arr1[i], arr2[i], recMap)) return false; + } + return true; +}; + +eqObj = function (obj1, obj2, recMap) { + var k1 = keys(obj1), k2 = keys(obj2); + if (k1.length !== k2.length) return false; + return k1.every(function (key) { + if (!objPropertyIsEnumerable.call(obj2, key)) return false; + return eqVal(obj1[key], obj2[key], recMap); + }); +}; + +eqVal = function (val1, val2, recMap) { + var i, eqX, c1, c2; + if (eq(val1, val2)) return true; + if (isPlainObject(val1)) { + if (!isPlainObject(val2)) return false; + eqX = eqObj; + } else if (isArray(val1) && isArray(val2)) { + eqX = eqArr; + } else { + return false; + } + c1 = recMap[0]; + c2 = recMap[1]; + i = c1.indexOf(val1); + if (i === -1) { + i = c1.push(val1) - 1; + c2[i] = []; + } else if (c2[i].indexOf(val2) !== -1) return true; + c2[i].push(val2); + return eqX(val1, val2, recMap); +}; + +module.exports = function (val1, val2) { + if (eq(value(val1), value(val2))) return true; + return eqVal(Object(val1), Object(val2), [[], []]); +}; diff --git a/node_modules/es5-ext/object/is-copy.js b/node_modules/es5-ext/object/is-copy.js new file mode 100644 index 0000000..8c6ae5e --- /dev/null +++ b/node_modules/es5-ext/object/is-copy.js @@ -0,0 +1,23 @@ +"use strict"; + +var eq = require("./eq") + , value = require("./valid-value") + , keys = Object.keys + , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = function (val1, val2) { + var k1, k2; + + if (eq(value(val1), value(val2))) return true; + + val1 = Object(val1); + val2 = Object(val2); + + k1 = keys(val1); + k2 = keys(val2); + if (k1.length !== k2.length) return false; + return k1.every(function (key) { + if (!objPropertyIsEnumerable.call(val2, key)) return false; + return eq(val1[key], val2[key]); + }); +}; diff --git a/node_modules/es5-ext/object/is-empty.js b/node_modules/es5-ext/object/is-empty.js new file mode 100644 index 0000000..dbc52d0 --- /dev/null +++ b/node_modules/es5-ext/object/is-empty.js @@ -0,0 +1,14 @@ +"use strict"; + +var value = require("./valid-value") + , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = function (obj) { + var i; + value(obj); + for (i in obj) { + // Jslint: ignore + if (objPropertyIsEnumerable.call(obj, i)) return false; + } + return true; +}; diff --git a/node_modules/es5-ext/object/is-finite-number.js b/node_modules/es5-ext/object/is-finite-number.js new file mode 100644 index 0000000..e016f8d --- /dev/null +++ b/node_modules/es5-ext/object/is-finite-number.js @@ -0,0 +1,5 @@ +"use strict"; + +var isNumber = require("./is-number-value"); + +module.exports = function (value) { return isNumber(value) && isFinite(value); }; diff --git a/node_modules/es5-ext/object/is-integer.js b/node_modules/es5-ext/object/is-integer.js new file mode 100644 index 0000000..1745b82 --- /dev/null +++ b/node_modules/es5-ext/object/is-integer.js @@ -0,0 +1,10 @@ +"use strict"; + +var isInteger = require("../number/is-integer") + , isValue = require("./is-value"); + +module.exports = function (arg) { + if (!isValue(arg)) return false; + arg = Number(arg); + return isInteger(arg); +}; diff --git a/node_modules/es5-ext/object/is-natural-number-value.js b/node_modules/es5-ext/object/is-natural-number-value.js new file mode 100644 index 0000000..c744521 --- /dev/null +++ b/node_modules/es5-ext/object/is-natural-number-value.js @@ -0,0 +1,9 @@ +"use strict"; + +var isNaturalNumber = require("./is-natural-number") + , isValue = require("./is-value"); + +module.exports = function (arg) { + if (!isValue(arg)) return false; + return isNaturalNumber(arg); +}; diff --git a/node_modules/es5-ext/object/is-natural-number.js b/node_modules/es5-ext/object/is-natural-number.js new file mode 100644 index 0000000..3e2c1f5 --- /dev/null +++ b/node_modules/es5-ext/object/is-natural-number.js @@ -0,0 +1,5 @@ +"use strict"; + +var isNatural = require("../number/is-natural"); + +module.exports = function (arg) { return isNatural(Number(arg)); }; diff --git a/node_modules/es5-ext/object/is-number-value.js b/node_modules/es5-ext/object/is-number-value.js new file mode 100644 index 0000000..f701bf5 --- /dev/null +++ b/node_modules/es5-ext/object/is-number-value.js @@ -0,0 +1,9 @@ +"use strict"; + +var isValue = require("./is-value"); + +module.exports = function (value) { + if (!isValue(value)) return false; + try { return !isNaN(value); } + catch (e) { return false; } +}; diff --git a/node_modules/es5-ext/object/is-object.js b/node_modules/es5-ext/object/is-object.js new file mode 100644 index 0000000..0e576d7 --- /dev/null +++ b/node_modules/es5-ext/object/is-object.js @@ -0,0 +1,7 @@ +"use strict"; + +var isValue = require("./is-value"); + +var map = { function: true, object: true }; + +module.exports = function (value) { return (isValue(value) && map[typeof value]) || false; }; diff --git a/node_modules/es5-ext/object/is-plain-function.js b/node_modules/es5-ext/object/is-plain-function.js new file mode 100644 index 0000000..a2f3234 --- /dev/null +++ b/node_modules/es5-ext/object/is-plain-function.js @@ -0,0 +1,11 @@ +"use strict"; + +var isClassStr = RegExp.prototype.test.bind(/^\s*class[\s{/}]/) + , fnToString = Function.prototype.toString; + +module.exports = function (fn) { + if (typeof fn !== "function") return false; + if (typeof fn.call !== "function") return false; + if (typeof fn.apply !== "function") return false; + return !isClassStr(fnToString.call(fn)); +}; diff --git a/node_modules/es5-ext/object/is-plain-object.js b/node_modules/es5-ext/object/is-plain-object.js new file mode 100644 index 0000000..ff15328 --- /dev/null +++ b/node_modules/es5-ext/object/is-plain-object.js @@ -0,0 +1,20 @@ +"use strict"; + +var getPrototypeOf = Object.getPrototypeOf + , prototype = Object.prototype + , objToString = prototype.toString + , id = Object().toString(); + +module.exports = function (value) { + var proto, valueConstructor; + if (!value || typeof value !== "object" || objToString.call(value) !== id) { + return false; + } + proto = getPrototypeOf(value); + if (proto === null) { + valueConstructor = value.constructor; + if (typeof valueConstructor !== "function") return true; + return valueConstructor.prototype !== value; + } + return proto === prototype || getPrototypeOf(proto) === null; +}; diff --git a/node_modules/es5-ext/object/is-promise.js b/node_modules/es5-ext/object/is-promise.js new file mode 100644 index 0000000..33d6df1 --- /dev/null +++ b/node_modules/es5-ext/object/is-promise.js @@ -0,0 +1,4 @@ +"use strict"; + +// In next major this check will also confirm on promise constructor +module.exports = require("./is-thenable"); diff --git a/node_modules/es5-ext/object/is-thenable.js b/node_modules/es5-ext/object/is-thenable.js new file mode 100644 index 0000000..06db0fd --- /dev/null +++ b/node_modules/es5-ext/object/is-thenable.js @@ -0,0 +1,6 @@ +"use strict"; + +var isCallable = require("./is-callable") + , isObject = require("./is-object"); + +module.exports = function (value) { return isObject(value) && isCallable(value.then); }; diff --git a/node_modules/es5-ext/object/is-value.js b/node_modules/es5-ext/object/is-value.js new file mode 100644 index 0000000..4ee3805 --- /dev/null +++ b/node_modules/es5-ext/object/is-value.js @@ -0,0 +1,5 @@ +"use strict"; + +var _undefined = require("../function/noop")(); // Support ES3 engines + +module.exports = function (val) { return val !== _undefined && val !== null; }; diff --git a/node_modules/es5-ext/object/is.js b/node_modules/es5-ext/object/is.js new file mode 100644 index 0000000..54baade --- /dev/null +++ b/node_modules/es5-ext/object/is.js @@ -0,0 +1,10 @@ +// Implementation credits go to: +// http://wiki.ecmascript.org/doku.php?id=harmony:egal + +"use strict"; + +var numIsNaN = require("../number/is-nan"); + +module.exports = function (val1, val2) { + return val1 === val2 ? val1 !== 0 || 1 / val1 === 1 / val2 : numIsNaN(val1) && numIsNaN(val2); +}; diff --git a/node_modules/es5-ext/object/key-of.js b/node_modules/es5-ext/object/key-of.js new file mode 100644 index 0000000..dc640e4 --- /dev/null +++ b/node_modules/es5-ext/object/key-of.js @@ -0,0 +1,17 @@ +"use strict"; + +var eq = require("./eq") + , some = require("./some"); + +module.exports = function (obj, searchValue) { + var result; + return some(obj, function (value, name) { + if (eq(value, searchValue)) { + result = name; + return true; + } + return false; + }) + ? result + : null; +}; diff --git a/node_modules/es5-ext/object/keys/implement.js b/node_modules/es5-ext/object/keys/implement.js new file mode 100644 index 0000000..72ecfbd --- /dev/null +++ b/node_modules/es5-ext/object/keys/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Object, "keys", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/object/keys/index.js b/node_modules/es5-ext/object/keys/index.js new file mode 100644 index 0000000..d194227 --- /dev/null +++ b/node_modules/es5-ext/object/keys/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Object.keys : require("./shim"); diff --git a/node_modules/es5-ext/object/keys/is-implemented.js b/node_modules/es5-ext/object/keys/is-implemented.js new file mode 100644 index 0000000..2dfcf1b --- /dev/null +++ b/node_modules/es5-ext/object/keys/is-implemented.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function () { + try { + Object.keys("primitive"); + return true; + } catch (e) { + return false; + } +}; diff --git a/node_modules/es5-ext/object/keys/shim.js b/node_modules/es5-ext/object/keys/shim.js new file mode 100644 index 0000000..a8908d5 --- /dev/null +++ b/node_modules/es5-ext/object/keys/shim.js @@ -0,0 +1,7 @@ +"use strict"; + +var isValue = require("../is-value"); + +var keys = Object.keys; + +module.exports = function (object) { return keys(isValue(object) ? Object(object) : object); }; diff --git a/node_modules/es5-ext/object/map-keys.js b/node_modules/es5-ext/object/map-keys.js new file mode 100644 index 0000000..662e6ca --- /dev/null +++ b/node_modules/es5-ext/object/map-keys.js @@ -0,0 +1,18 @@ +"use strict"; + +var callable = require("./valid-callable") + , forEach = require("./for-each") + , call = Function.prototype.call; + +module.exports = function (obj, cb/*, thisArg*/) { + var result = {}, thisArg = arguments[2]; + callable(cb); + forEach( + obj, + function (value, key, targetObj, index) { + result[call.call(cb, thisArg, key, value, this, index)] = value; + }, + obj + ); + return result; +}; diff --git a/node_modules/es5-ext/object/map.js b/node_modules/es5-ext/object/map.js new file mode 100644 index 0000000..e4eb61b --- /dev/null +++ b/node_modules/es5-ext/object/map.js @@ -0,0 +1,14 @@ +"use strict"; + +var callable = require("./valid-callable") + , forEach = require("./for-each") + , call = Function.prototype.call; + +module.exports = function (obj, cb/*, thisArg*/) { + var result = {}, thisArg = arguments[2]; + callable(cb); + forEach(obj, function (value, key, targetObj, index) { + result[key] = call.call(cb, thisArg, value, key, targetObj, index); + }); + return result; +}; diff --git a/node_modules/es5-ext/object/mixin-prototypes.js b/node_modules/es5-ext/object/mixin-prototypes.js new file mode 100644 index 0000000..81e27c7 --- /dev/null +++ b/node_modules/es5-ext/object/mixin-prototypes.js @@ -0,0 +1,25 @@ +"use strict"; + +var value = require("./valid-value") + , mixin = require("./mixin"); + +var getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (target, source) { + target = Object(value(target)); + source = Object(value(source)); + if (target === source) return target; + + var sources = []; + while (source && !isPrototypeOf.call(source, target)) { + sources.unshift(source); + source = getPrototypeOf(source); + } + + var error; + sources.forEach(function (sourceProto) { + try { mixin(target, sourceProto); } catch (mixinError) { error = mixinError; } + }); + if (error) throw error; + return target; +}; diff --git a/node_modules/es5-ext/object/mixin.js b/node_modules/es5-ext/object/mixin.js new file mode 100644 index 0000000..f5cf9dd --- /dev/null +++ b/node_modules/es5-ext/object/mixin.js @@ -0,0 +1,26 @@ +"use strict"; + +var value = require("./valid-value") + , defineProperty = Object.defineProperty + , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor + , getOwnPropertyNames = Object.getOwnPropertyNames + , getOwnPropertySymbols = Object.getOwnPropertySymbols; + +module.exports = function (target, source) { + var error, sourceObject = Object(value(source)); + target = Object(value(target)); + getOwnPropertyNames(sourceObject).forEach(function (name) { + try { + defineProperty(target, name, getOwnPropertyDescriptor(source, name)); + } catch (e) { error = e; } + }); + if (typeof getOwnPropertySymbols === "function") { + getOwnPropertySymbols(sourceObject).forEach(function (symbol) { + try { + defineProperty(target, symbol, getOwnPropertyDescriptor(source, symbol)); + } catch (e) { error = e; } + }); + } + if (error !== undefined) throw error; + return target; +}; diff --git a/node_modules/es5-ext/object/normalize-options.js b/node_modules/es5-ext/object/normalize-options.js new file mode 100644 index 0000000..885dd80 --- /dev/null +++ b/node_modules/es5-ext/object/normalize-options.js @@ -0,0 +1,20 @@ +"use strict"; + +var isValue = require("./is-value"); + +var forEach = Array.prototype.forEach, create = Object.create; + +var process = function (src, obj) { + var key; + for (key in src) obj[key] = src[key]; +}; + +// eslint-disable-next-line no-unused-vars +module.exports = function (opts1/*, …options*/) { + var result = create(null); + forEach.call(arguments, function (options) { + if (!isValue(options)) return; + process(Object(options), result); + }); + return result; +}; diff --git a/node_modules/es5-ext/object/primitive-set.js b/node_modules/es5-ext/object/primitive-set.js new file mode 100644 index 0000000..e6dd636 --- /dev/null +++ b/node_modules/es5-ext/object/primitive-set.js @@ -0,0 +1,10 @@ +"use strict"; + +var forEach = Array.prototype.forEach, create = Object.create; + +// eslint-disable-next-line no-unused-vars +module.exports = function (arg/*, …args*/) { + var set = create(null); + forEach.call(arguments, function (name) { set[name] = true; }); + return set; +}; diff --git a/node_modules/es5-ext/object/safe-traverse.js b/node_modules/es5-ext/object/safe-traverse.js new file mode 100644 index 0000000..43d7cea --- /dev/null +++ b/node_modules/es5-ext/object/safe-traverse.js @@ -0,0 +1,16 @@ +"use strict"; + +var value = require("./valid-value") + , isValue = require("./is-value"); + +module.exports = function (obj/*, …names*/) { + var length, current = 1; + value(obj); + length = arguments.length - 1; + if (!length) return obj; + while (current < length) { + obj = obj[arguments[current++]]; + if (!isValue(obj)) return undefined; + } + return obj[arguments[current]]; +}; diff --git a/node_modules/es5-ext/object/serialize.js b/node_modules/es5-ext/object/serialize.js new file mode 100644 index 0000000..ec868c1 --- /dev/null +++ b/node_modules/es5-ext/object/serialize.js @@ -0,0 +1,41 @@ +"use strict"; + +var toArray = require("./to-array") + , isDate = require("../date/is-date") + , isValue = require("../object/is-value") + , isRegExp = require("../reg-exp/is-reg-exp"); + +var isArray = Array.isArray + , stringify = JSON.stringify + , objHasOwnProperty = Object.prototype.hasOwnProperty; +var keyValueToString = function (value, key) { + return stringify(key) + ":" + module.exports(value); +}; + +var sparseMap = function (arr) { + var i, length = arr.length, result = new Array(length); + for (i = 0; i < length; ++i) { + if (!objHasOwnProperty.call(arr, i)) continue; + result[i] = module.exports(arr[i]); + } + return result; +}; + +module.exports = function (obj) { + if (!isValue(obj)) return String(obj); + switch (typeof obj) { + case "string": + return stringify(obj); + case "number": + case "boolean": + case "function": + return String(obj); + case "object": + if (isArray(obj)) return "[" + sparseMap(obj) + "]"; + if (isRegExp(obj)) return String(obj); + if (isDate(obj)) return "new Date(" + obj.valueOf() + ")"; + return "{" + toArray(obj, keyValueToString) + "}"; + default: + throw new TypeError("Serialization of " + String(obj) + "is unsupported"); + } +}; diff --git a/node_modules/es5-ext/object/set-prototype-of/implement.js b/node_modules/es5-ext/object/set-prototype-of/implement.js new file mode 100644 index 0000000..386a300 --- /dev/null +++ b/node_modules/es5-ext/object/set-prototype-of/implement.js @@ -0,0 +1,12 @@ +"use strict"; + +var shim; + +if (!require("./is-implemented")() && (shim = require("./shim"))) { + Object.defineProperty(Object, "setPrototypeOf", { + value: shim, + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/object/set-prototype-of/index.js b/node_modules/es5-ext/object/set-prototype-of/index.js new file mode 100644 index 0000000..ac07b99 --- /dev/null +++ b/node_modules/es5-ext/object/set-prototype-of/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Object.setPrototypeOf : require("./shim"); diff --git a/node_modules/es5-ext/object/set-prototype-of/is-implemented.js b/node_modules/es5-ext/object/set-prototype-of/is-implemented.js new file mode 100644 index 0000000..1a00627 --- /dev/null +++ b/node_modules/es5-ext/object/set-prototype-of/is-implemented.js @@ -0,0 +1,9 @@ +"use strict"; + +var create = Object.create, getPrototypeOf = Object.getPrototypeOf, plainObject = {}; + +module.exports = function (/* CustomCreate*/) { + var setPrototypeOf = Object.setPrototypeOf, customCreate = arguments[0] || create; + if (typeof setPrototypeOf !== "function") return false; + return getPrototypeOf(setPrototypeOf(customCreate(null), plainObject)) === plainObject; +}; diff --git a/node_modules/es5-ext/object/set-prototype-of/shim.js b/node_modules/es5-ext/object/set-prototype-of/shim.js new file mode 100644 index 0000000..97b0b50 --- /dev/null +++ b/node_modules/es5-ext/object/set-prototype-of/shim.js @@ -0,0 +1,81 @@ +/* eslint no-proto: "off" */ + +// Big thanks to @WebReflection for sorting this out +// https://gist.github.com/WebReflection/5593554 + +"use strict"; + +var isObject = require("../is-object") + , value = require("../valid-value") + , objIsPrototypeOf = Object.prototype.isPrototypeOf + , defineProperty = Object.defineProperty + , nullDesc = { configurable: true, enumerable: false, writable: true, value: undefined } + , validate; + +validate = function (obj, prototype) { + value(obj); + if (prototype === null || isObject(prototype)) return obj; + throw new TypeError("Prototype must be null or an object"); +}; + +module.exports = (function (status) { + var fn, set; + if (!status) return null; + if (status.level === 2) { + if (status.set) { + set = status.set; + fn = function (obj, prototype) { + set.call(validate(obj, prototype), prototype); + return obj; + }; + } else { + fn = function (obj, prototype) { + validate(obj, prototype).__proto__ = prototype; + return obj; + }; + } + } else { + fn = function self(obj, prototype) { + var isNullBase; + validate(obj, prototype); + isNullBase = objIsPrototypeOf.call(self.nullPolyfill, obj); + if (isNullBase) delete self.nullPolyfill.__proto__; + if (prototype === null) prototype = self.nullPolyfill; + obj.__proto__ = prototype; + if (isNullBase) defineProperty(self.nullPolyfill, "__proto__", nullDesc); + return obj; + }; + } + return Object.defineProperty(fn, "level", { + configurable: false, + enumerable: false, + writable: false, + value: status.level + }); +})( + (function () { + var tmpObj1 = Object.create(null) + , tmpObj2 = {} + , set + , desc = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__"); + + if (desc) { + try { + set = desc.set; // Opera crashes at this point + set.call(tmpObj1, tmpObj2); + } catch (ignore) {} + if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { set: set, level: 2 }; + } + + tmpObj1.__proto__ = tmpObj2; + if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { level: 2 }; + + tmpObj1 = {}; + tmpObj1.__proto__ = tmpObj2; + if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { level: 1 }; + + return false; + })() +); + +require("../create"); diff --git a/node_modules/es5-ext/object/some.js b/node_modules/es5-ext/object/some.js new file mode 100644 index 0000000..c919466 --- /dev/null +++ b/node_modules/es5-ext/object/some.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./_iterate")("some", false); diff --git a/node_modules/es5-ext/object/to-array.js b/node_modules/es5-ext/object/to-array.js new file mode 100644 index 0000000..18c0b27 --- /dev/null +++ b/node_modules/es5-ext/object/to-array.js @@ -0,0 +1,21 @@ +"use strict"; + +var callable = require("./valid-callable") + , isValue = require("./is-value") + , forEach = require("./for-each") + , call = Function.prototype.call + , defaultCb = function (value, key) { return [key, value]; }; + +module.exports = function (obj/*, cb, thisArg, compareFn*/) { + var a = [], cb = arguments[1], thisArg = arguments[2]; + cb = isValue(cb) ? callable(cb) : defaultCb; + + forEach( + obj, + function (value, key, targetObj, index) { + a.push(call.call(cb, thisArg, value, key, this, index)); + }, + obj, arguments[3] + ); + return a; +}; diff --git a/node_modules/es5-ext/object/unserialize.js b/node_modules/es5-ext/object/unserialize.js new file mode 100644 index 0000000..f62ea78 --- /dev/null +++ b/node_modules/es5-ext/object/unserialize.js @@ -0,0 +1,8 @@ +"use strict"; + +var value = require("./valid-value"); + +module.exports = function (code) { + // eslint-disable-next-line no-new-func + return new Function("return " + value(code))(); +}; diff --git a/node_modules/es5-ext/object/valid-callable.js b/node_modules/es5-ext/object/valid-callable.js new file mode 100644 index 0000000..a97fb3e --- /dev/null +++ b/node_modules/es5-ext/object/valid-callable.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (fn) { + if (typeof fn !== "function") throw new TypeError(fn + " is not a function"); + return fn; +}; diff --git a/node_modules/es5-ext/object/valid-object.js b/node_modules/es5-ext/object/valid-object.js new file mode 100644 index 0000000..74b5e5f --- /dev/null +++ b/node_modules/es5-ext/object/valid-object.js @@ -0,0 +1,8 @@ +"use strict"; + +var isObject = require("./is-object"); + +module.exports = function (value) { + if (!isObject(value)) throw new TypeError(value + " is not an Object"); + return value; +}; diff --git a/node_modules/es5-ext/object/valid-value.js b/node_modules/es5-ext/object/valid-value.js new file mode 100644 index 0000000..d0ced8a --- /dev/null +++ b/node_modules/es5-ext/object/valid-value.js @@ -0,0 +1,8 @@ +"use strict"; + +var isValue = require("./is-value"); + +module.exports = function (value) { + if (!isValue(value)) throw new TypeError("Cannot use null or undefined"); + return value; +}; diff --git a/node_modules/es5-ext/object/validate-array-like-object.js b/node_modules/es5-ext/object/validate-array-like-object.js new file mode 100644 index 0000000..d7c45b3 --- /dev/null +++ b/node_modules/es5-ext/object/validate-array-like-object.js @@ -0,0 +1,9 @@ +"use strict"; + +var isArrayLike = require("./is-array-like") + , isObject = require("./is-object"); + +module.exports = function (obj) { + if (isObject(obj) && isArrayLike(obj)) return obj; + throw new TypeError(obj + " is not array-like object"); +}; diff --git a/node_modules/es5-ext/object/validate-array-like.js b/node_modules/es5-ext/object/validate-array-like.js new file mode 100644 index 0000000..07aa794 --- /dev/null +++ b/node_modules/es5-ext/object/validate-array-like.js @@ -0,0 +1,8 @@ +"use strict"; + +var isArrayLike = require("./is-array-like"); + +module.exports = function (obj) { + if (isArrayLike(obj)) return obj; + throw new TypeError(obj + " is not array-like value"); +}; diff --git a/node_modules/es5-ext/object/validate-stringifiable-value.js b/node_modules/es5-ext/object/validate-stringifiable-value.js new file mode 100644 index 0000000..b58f18c --- /dev/null +++ b/node_modules/es5-ext/object/validate-stringifiable-value.js @@ -0,0 +1,6 @@ +"use strict"; + +var ensureValue = require("./valid-value") + , stringifiable = require("./validate-stringifiable"); + +module.exports = function (value) { return stringifiable(ensureValue(value)); }; diff --git a/node_modules/es5-ext/object/validate-stringifiable.js b/node_modules/es5-ext/object/validate-stringifiable.js new file mode 100644 index 0000000..2b1f127 --- /dev/null +++ b/node_modules/es5-ext/object/validate-stringifiable.js @@ -0,0 +1,12 @@ +"use strict"; + +var isCallable = require("./is-callable"); + +module.exports = function (stringifiable) { + try { + if (stringifiable && isCallable(stringifiable.toString)) return stringifiable.toString(); + return String(stringifiable); + } catch (e) { + throw new TypeError("Passed argument cannot be stringifed"); + } +}; diff --git a/node_modules/es5-ext/optional-chaining.js b/node_modules/es5-ext/optional-chaining.js new file mode 100644 index 0000000..eba6bd8 --- /dev/null +++ b/node_modules/es5-ext/optional-chaining.js @@ -0,0 +1,12 @@ +"use strict"; + +var isValue = require("./object/is-value"); + +var slice = Array.prototype.slice; + +// eslint-disable-next-line no-unused-vars +module.exports = function (value, propertyName1/*, …propertyNamen*/) { + var propertyNames = slice.call(arguments, 1), index = 0, length = propertyNames.length; + while (isValue(value) && index < length) value = value[propertyNames[index++]]; + return index === length ? value : undefined; +}; diff --git a/node_modules/es5-ext/package.json b/node_modules/es5-ext/package.json new file mode 100644 index 0000000..d3f41f7 --- /dev/null +++ b/node_modules/es5-ext/package.json @@ -0,0 +1,132 @@ +{ + "_from": "es5-ext@^0.10.35", + "_id": "es5-ext@0.10.53", + "_inBundle": false, + "_integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "_location": "/es5-ext", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "es5-ext@^0.10.35", + "name": "es5-ext", + "escapedName": "es5-ext", + "rawSpec": "^0.10.35", + "saveSpec": null, + "fetchSpec": "^0.10.35" + }, + "_requiredBy": [ + "/d", + "/es6-iterator", + "/es6-weak-map" + ], + "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "_shasum": "93c5a3acfdbef275220ad72644ad02ee18368de1", + "_spec": "es5-ext@^0.10.35", + "_where": "/usr/share/r3-server/beta/r3/node_modules/es6-iterator", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/es5-ext/issues" + }, + "bundleDependencies": false, + "dependencies": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + }, + "deprecated": false, + "description": "ECMAScript extensions and shims", + "devDependencies": { + "eslint": "^6.6.0", + "eslint-config-medikoo": "^2.7.0", + "git-list-updated": "^1.2.1", + "husky": "^3.1.0", + "lint-staged": "^9.4.3", + "plain-promise": "^0.1.1", + "prettier-elastic": "^1.18.2", + "tad": "^3.0.1" + }, + "eslintConfig": { + "extends": "medikoo/es5", + "root": true, + "rules": { + "no-extend-native": "off" + }, + "overrides": [ + { + "files": "global.js", + "globals": { + "__global__": true, + "globalThis": true, + "self": true, + "window": true + }, + "rules": { + "strict": "off" + } + } + ] + }, + "homepage": "https://github.com/medikoo/es5-ext#readme", + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "keywords": [ + "ecmascript", + "ecmascript5", + "ecmascript6", + "es5", + "es6", + "extensions", + "ext", + "addons", + "extras", + "harmony", + "javascript", + "polyfill", + "shim", + "util", + "utils", + "utilities" + ], + "license": "ISC", + "lint-staged": { + "*.js": [ + "eslint" + ], + "*.{css,html,js,json,md,yaml,yml}": [ + "prettier -c" + ] + }, + "name": "es5-ext", + "prettier": { + "printWidth": 100, + "tabWidth": 4, + "overrides": [ + { + "files": "*.md", + "options": { + "tabWidth": 2 + } + } + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/medikoo/es5-ext.git" + }, + "scripts": { + "lint": "eslint --ignore-path=.gitignore .", + "lint-updated": "pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'", + "prettier-check-updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c", + "prettify": "prettier --write --ignore-path .gitignore '**/*.{css,html,js,json,md,yaml,yml}'", + "test": "node ./node_modules/tad/bin/tad" + }, + "version": "0.10.53" +} diff --git a/node_modules/es5-ext/promise/#/as-callback.js b/node_modules/es5-ext/promise/#/as-callback.js new file mode 100644 index 0000000..ba310b3 --- /dev/null +++ b/node_modules/es5-ext/promise/#/as-callback.js @@ -0,0 +1,15 @@ +"use strict"; + +var ensurePlainFunction = require("../../object/ensure-plain-function") + , ensureThenable = require("../../object/ensure-thenable") + , microtaskDelay = require("../../function/#/microtask-delay"); + +module.exports = function (callback) { + ensureThenable(this); + ensurePlainFunction(callback); + // Rely on microtaskDelay to escape eventual error swallowing + this.then( + microtaskDelay.call(function (value) { callback(null, value); }), + microtaskDelay.call(function (reason) { callback(reason); }) + ); +}; diff --git a/node_modules/es5-ext/promise/#/finally/implement.js b/node_modules/es5-ext/promise/#/finally/implement.js new file mode 100644 index 0000000..77592b3 --- /dev/null +++ b/node_modules/es5-ext/promise/#/finally/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Promise.prototype, "finally", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/promise/#/finally/index.js b/node_modules/es5-ext/promise/#/finally/index.js new file mode 100644 index 0000000..f6bb447 --- /dev/null +++ b/node_modules/es5-ext/promise/#/finally/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Promise.prototype.finally : require("./shim"); diff --git a/node_modules/es5-ext/promise/#/finally/is-implemented.js b/node_modules/es5-ext/promise/#/finally/is-implemented.js new file mode 100644 index 0000000..0534ce6 --- /dev/null +++ b/node_modules/es5-ext/promise/#/finally/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + if (typeof Promise !== "function") return false; + if (typeof Promise.prototype.finally !== "function") return false; + return true; +}; diff --git a/node_modules/es5-ext/promise/#/finally/shim.js b/node_modules/es5-ext/promise/#/finally/shim.js new file mode 100644 index 0000000..f29f5b3 --- /dev/null +++ b/node_modules/es5-ext/promise/#/finally/shim.js @@ -0,0 +1,24 @@ +"use strict"; + +var ensurePlainFunction = require("../../../object/ensure-plain-function") + , isThenable = require("../../../object/is-thenable") + , ensureThenable = require("../../../object/ensure-thenable"); + +var resolveCallback = function (callback, next) { + var callbackResult = callback(); + if (!isThenable(callbackResult)) return next(); + return callbackResult.then(next); +}; + +module.exports = function (callback) { + ensureThenable(this); + ensurePlainFunction(callback); + return this.then( + function (result) { + return resolveCallback(callback, function () { return result; }); + }, + function (error) { + return resolveCallback(callback, function () { throw error; }); + } + ); +}; diff --git a/node_modules/es5-ext/promise/#/index.js b/node_modules/es5-ext/promise/#/index.js new file mode 100644 index 0000000..4601803 --- /dev/null +++ b/node_modules/es5-ext/promise/#/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = { asCallback: require("./as-callback"), finally: require("./finally") }; diff --git a/node_modules/es5-ext/promise/.eslintrc.json b/node_modules/es5-ext/promise/.eslintrc.json new file mode 100644 index 0000000..0d86fe7 --- /dev/null +++ b/node_modules/es5-ext/promise/.eslintrc.json @@ -0,0 +1 @@ +{ "globals": { "Promise": true } } diff --git a/node_modules/es5-ext/promise/index.js b/node_modules/es5-ext/promise/index.js new file mode 100644 index 0000000..6aa66bb --- /dev/null +++ b/node_modules/es5-ext/promise/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = { "#": require("./#"), "lazy": require("./lazy") }; diff --git a/node_modules/es5-ext/promise/lazy.js b/node_modules/es5-ext/promise/lazy.js new file mode 100644 index 0000000..ad97a53 --- /dev/null +++ b/node_modules/es5-ext/promise/lazy.js @@ -0,0 +1,35 @@ +"use strict"; + +var isFunction = require("../function/is-function"); + +module.exports = function (executor) { + var Constructor; + if (isFunction(this)) { + Constructor = this; + } else if (typeof Promise === "function") { + Constructor = Promise; + } else { + throw new TypeError("Could not resolve Promise constuctor"); + } + + var lazyThen; + var promise = new Constructor(function (resolve, reject) { + lazyThen = function (onSuccess, onFailure) { + if (!hasOwnProperty.call(this, "then")) { + // Sanity check + throw new Error("Unexpected (inherited) lazy then invocation"); + } + + try { executor(resolve, reject); } + catch (reason) { reject(reason); } + delete this.then; + return this.then(onSuccess, onFailure); + }; + }); + + return Object.defineProperty(promise, "then", { + configurable: true, + writable: true, + value: lazyThen + }); +}; diff --git a/node_modules/es5-ext/reg-exp/#/index.js b/node_modules/es5-ext/reg-exp/#/index.js new file mode 100644 index 0000000..9b098e0 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/index.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = { + isSticky: require("./is-sticky"), + isUnicode: require("./is-unicode"), + match: require("./match"), + replace: require("./replace"), + search: require("./search"), + split: require("./split") +}; diff --git a/node_modules/es5-ext/reg-exp/#/is-sticky.js b/node_modules/es5-ext/reg-exp/#/is-sticky.js new file mode 100644 index 0000000..6e99533 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/is-sticky.js @@ -0,0 +1,6 @@ +"use strict"; + +var validRegExp = require("../valid-reg-exp") + , re = /\/[a-xz]*y[a-xz]*$/; + +module.exports = function () { return Boolean(String(validRegExp(this)).match(re)); }; diff --git a/node_modules/es5-ext/reg-exp/#/is-unicode.js b/node_modules/es5-ext/reg-exp/#/is-unicode.js new file mode 100644 index 0000000..63a457f --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/is-unicode.js @@ -0,0 +1,6 @@ +"use strict"; + +var validRegExp = require("../valid-reg-exp") + , re = /\/[a-xz]*u[a-xz]*$/; + +module.exports = function () { return Boolean(String(validRegExp(this)).match(re)); }; diff --git a/node_modules/es5-ext/reg-exp/#/match/implement.js b/node_modules/es5-ext/reg-exp/#/match/implement.js new file mode 100644 index 0000000..68dcd55 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/match/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(RegExp.prototype, "match", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/reg-exp/#/match/index.js b/node_modules/es5-ext/reg-exp/#/match/index.js new file mode 100644 index 0000000..4b33296 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/match/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? RegExp.prototype.match : require("./shim"); diff --git a/node_modules/es5-ext/reg-exp/#/match/is-implemented.js b/node_modules/es5-ext/reg-exp/#/match/is-implemented.js new file mode 100644 index 0000000..a5065fc --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/match/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var re = /foo/; + +module.exports = function () { + if (typeof re.match !== "function") return false; + return re.match("barfoobar") && !re.match("elo"); +}; diff --git a/node_modules/es5-ext/reg-exp/#/match/shim.js b/node_modules/es5-ext/reg-exp/#/match/shim.js new file mode 100644 index 0000000..2955821 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/match/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +var validRegExp = require("../../valid-reg-exp"); + +module.exports = function (string) { + validRegExp(this); + return String(string).match(this); +}; diff --git a/node_modules/es5-ext/reg-exp/#/replace/implement.js b/node_modules/es5-ext/reg-exp/#/replace/implement.js new file mode 100644 index 0000000..f990c4f --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/replace/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(RegExp.prototype, "replace", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/reg-exp/#/replace/index.js b/node_modules/es5-ext/reg-exp/#/replace/index.js new file mode 100644 index 0000000..be54b52 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/replace/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? RegExp.prototype.replace : require("./shim"); diff --git a/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js b/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js new file mode 100644 index 0000000..0a2e7c2 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var re = /foo/; + +module.exports = function () { + if (typeof re.replace !== "function") return false; + return re.replace("foobar", "mar") === "marbar"; +}; diff --git a/node_modules/es5-ext/reg-exp/#/replace/shim.js b/node_modules/es5-ext/reg-exp/#/replace/shim.js new file mode 100644 index 0000000..66f5d5b --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/replace/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +var validRegExp = require("../../valid-reg-exp"); + +module.exports = function (string, replaceValue) { + validRegExp(this); + return String(string).replace(this, replaceValue); +}; diff --git a/node_modules/es5-ext/reg-exp/#/search/implement.js b/node_modules/es5-ext/reg-exp/#/search/implement.js new file mode 100644 index 0000000..df4a337 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/search/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(RegExp.prototype, "search", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/reg-exp/#/search/index.js b/node_modules/es5-ext/reg-exp/#/search/index.js new file mode 100644 index 0000000..25ca76a --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/search/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? RegExp.prototype.search : require("./shim"); diff --git a/node_modules/es5-ext/reg-exp/#/search/is-implemented.js b/node_modules/es5-ext/reg-exp/#/search/is-implemented.js new file mode 100644 index 0000000..7f38669 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/search/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var re = /foo/; + +module.exports = function () { + if (typeof re.search !== "function") return false; + return re.search("barfoo") === 3; +}; diff --git a/node_modules/es5-ext/reg-exp/#/search/shim.js b/node_modules/es5-ext/reg-exp/#/search/shim.js new file mode 100644 index 0000000..c97a787 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/search/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +var validRegExp = require("../../valid-reg-exp"); + +module.exports = function (string) { + validRegExp(this); + return String(string).search(this); +}; diff --git a/node_modules/es5-ext/reg-exp/#/split/implement.js b/node_modules/es5-ext/reg-exp/#/split/implement.js new file mode 100644 index 0000000..b979db0 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/split/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(RegExp.prototype, "split", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/reg-exp/#/split/index.js b/node_modules/es5-ext/reg-exp/#/split/index.js new file mode 100644 index 0000000..6d4f177 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/split/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? RegExp.prototype.split : require("./shim"); diff --git a/node_modules/es5-ext/reg-exp/#/split/is-implemented.js b/node_modules/es5-ext/reg-exp/#/split/is-implemented.js new file mode 100644 index 0000000..90fca0c --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/split/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var re = /\|/; + +module.exports = function () { + if (typeof re.split !== "function") return false; + return re.split("bar|foo")[1] === "foo"; +}; diff --git a/node_modules/es5-ext/reg-exp/#/split/shim.js b/node_modules/es5-ext/reg-exp/#/split/shim.js new file mode 100644 index 0000000..c9c73cc --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/split/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +var validRegExp = require("../../valid-reg-exp"); + +module.exports = function (string) { + validRegExp(this); + return String(string).split(this); +}; diff --git a/node_modules/es5-ext/reg-exp/#/sticky/implement.js b/node_modules/es5-ext/reg-exp/#/sticky/implement.js new file mode 100644 index 0000000..7864c6c --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/sticky/implement.js @@ -0,0 +1,11 @@ +"use strict"; + +var isSticky = require("../is-sticky"); + +if (!require("./is-implemented")()) { + Object.defineProperty(RegExp.prototype, "sticky", { + configurable: true, + enumerable: false, + get: isSticky + }); +} diff --git a/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js b/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js new file mode 100644 index 0000000..a1ade11 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function () { + var dummyRegExp = /a/; + // We need to do check on instance and not on prototype due to how ES2015 spec evolved: + // https://github.com/tc39/ecma262/issues/262 + // https://github.com/tc39/ecma262/pull/263 + // https://bugs.chromium.org/p/v8/issues/detail?id=4617 + return "sticky" in dummyRegExp; +}; diff --git a/node_modules/es5-ext/reg-exp/#/unicode/implement.js b/node_modules/es5-ext/reg-exp/#/unicode/implement.js new file mode 100644 index 0000000..8b99be5 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/unicode/implement.js @@ -0,0 +1,11 @@ +"use strict"; + +var isUnicode = require("../is-unicode"); + +if (!require("./is-implemented")()) { + Object.defineProperty(RegExp.prototype, "unicode", { + configurable: true, + enumerable: false, + get: isUnicode + }); +} diff --git a/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js b/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js new file mode 100644 index 0000000..48605d7 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function () { + var dummyRegExp = /a/; + // We need to do check on instance and not on prototype due to how ES2015 spec evolved: + // https://github.com/tc39/ecma262/issues/262 + // https://github.com/tc39/ecma262/pull/263 + // https://bugs.chromium.org/p/v8/issues/detail?id=4617 + return "unicode" in dummyRegExp; +}; diff --git a/node_modules/es5-ext/reg-exp/escape.js b/node_modules/es5-ext/reg-exp/escape.js new file mode 100644 index 0000000..b65b351 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/escape.js @@ -0,0 +1,9 @@ +// Thanks to Andrew Clover: +// http://stackoverflow.com/questions/3561493 +// /is-there-a-regexp-escape-function-in-javascript + +"use strict"; + +var re = /[-/\\^$*+?.()|[\]{}]/g; + +module.exports = function (str) { return String(str).replace(re, "\\$&"); }; diff --git a/node_modules/es5-ext/reg-exp/index.js b/node_modules/es5-ext/reg-exp/index.js new file mode 100644 index 0000000..f023fe0 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/index.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = { + "#": require("./#"), + "escape": require("./escape"), + "isRegExp": require("./is-reg-exp"), + "validRegExp": require("./valid-reg-exp") +}; diff --git a/node_modules/es5-ext/reg-exp/is-reg-exp.js b/node_modules/es5-ext/reg-exp/is-reg-exp.js new file mode 100644 index 0000000..b966b0f --- /dev/null +++ b/node_modules/es5-ext/reg-exp/is-reg-exp.js @@ -0,0 +1,7 @@ +"use strict"; + +var objToString = Object.prototype.toString, id = objToString.call(/a/); + +module.exports = function (value) { + return (value && (value instanceof RegExp || objToString.call(value) === id)) || false; +}; diff --git a/node_modules/es5-ext/reg-exp/valid-reg-exp.js b/node_modules/es5-ext/reg-exp/valid-reg-exp.js new file mode 100644 index 0000000..a05927a --- /dev/null +++ b/node_modules/es5-ext/reg-exp/valid-reg-exp.js @@ -0,0 +1,8 @@ +"use strict"; + +var isRegExp = require("./is-reg-exp"); + +module.exports = function (value) { + if (!isRegExp(value)) throw new TypeError(value + " is not a RegExp object"); + return value; +}; diff --git a/node_modules/es5-ext/safe-to-string.js b/node_modules/es5-ext/safe-to-string.js new file mode 100644 index 0000000..f49a238 --- /dev/null +++ b/node_modules/es5-ext/safe-to-string.js @@ -0,0 +1,12 @@ +"use strict"; + +var isCallable = require("./object/is-callable"); + +module.exports = function (value) { + try { + if (value && isCallable(value.toString)) return value.toString(); + return String(value); + } catch (e) { + return ""; + } +}; diff --git a/node_modules/es5-ext/string/#/@@iterator/implement.js b/node_modules/es5-ext/string/#/@@iterator/implement.js new file mode 100644 index 0000000..b51ad9f --- /dev/null +++ b/node_modules/es5-ext/string/#/@@iterator/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String.prototype, require("es6-symbol").iterator, { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/string/#/@@iterator/index.js b/node_modules/es5-ext/string/#/@@iterator/index.js new file mode 100644 index 0000000..4572443 --- /dev/null +++ b/node_modules/es5-ext/string/#/@@iterator/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? String.prototype[require("es6-symbol").iterator] + : require("./shim"); diff --git a/node_modules/es5-ext/string/#/@@iterator/is-implemented.js b/node_modules/es5-ext/string/#/@@iterator/is-implemented.js new file mode 100644 index 0000000..bb8a8d6 --- /dev/null +++ b/node_modules/es5-ext/string/#/@@iterator/is-implemented.js @@ -0,0 +1,16 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function () { + var str = "🙈f", iterator, result; + if (typeof str[iteratorSymbol] !== "function") return false; + iterator = str[iteratorSymbol](); + if (!iterator) return false; + if (typeof iterator.next !== "function") return false; + result = iterator.next(); + if (!result) return false; + if (result.value !== "🙈") return false; + if (result.done !== false) return false; + return true; +}; diff --git a/node_modules/es5-ext/string/#/@@iterator/shim.js b/node_modules/es5-ext/string/#/@@iterator/shim.js new file mode 100644 index 0000000..2160619 --- /dev/null +++ b/node_modules/es5-ext/string/#/@@iterator/shim.js @@ -0,0 +1,6 @@ +"use strict"; + +var StringIterator = require("es6-iterator/string") + , value = require("../../../object/valid-value"); + +module.exports = function () { return new StringIterator(value(this)); }; diff --git a/node_modules/es5-ext/string/#/at.js b/node_modules/es5-ext/string/#/at.js new file mode 100644 index 0000000..a8c2917 --- /dev/null +++ b/node_modules/es5-ext/string/#/at.js @@ -0,0 +1,35 @@ +// Based on: https://github.com/mathiasbynens/String.prototype.at +// Thanks @mathiasbynens ! + +"use strict"; + +var toInteger = require("../../number/to-integer") + , validValue = require("../../object/valid-value"); + +module.exports = function (pos) { + var str = String(validValue(this)), size = str.length, cuFirst, cuSecond, nextPos, len; + pos = toInteger(pos); + + // Account for out-of-bounds indices + // The odd lower bound is because the ToInteger operation is + // going to round `n` to `0` for `-1 < n <= 0`. + if (pos <= -1 || pos >= size) return ""; + + // Second half of `ToInteger` + // eslint-disable-next-line no-bitwise + pos |= 0; + // Get the first code unit and code unit value + cuFirst = str.charCodeAt(pos); + nextPos = pos + 1; + len = 1; + if ( + // Check if it’s the start of a surrogate pair + cuFirst >= 0xd800 && + cuFirst <= 0xdbff && // High surrogate + size > nextPos // There is a next code unit + ) { + cuSecond = str.charCodeAt(nextPos); + if (cuSecond >= 0xdc00 && cuSecond <= 0xdfff) len = 2; // Low surrogate + } + return str.slice(pos, pos + len); +}; diff --git a/node_modules/es5-ext/string/#/camel-to-hyphen.js b/node_modules/es5-ext/string/#/camel-to-hyphen.js new file mode 100644 index 0000000..5add3ed --- /dev/null +++ b/node_modules/es5-ext/string/#/camel-to-hyphen.js @@ -0,0 +1,9 @@ +"use strict"; + +var replace = String.prototype.replace, re = /([A-Z])/g; + +module.exports = function () { + var str = replace.call(this, re, "-$1").toLowerCase(); + if (str[0] === "-") str = str.slice(1); + return str; +}; diff --git a/node_modules/es5-ext/string/#/capitalize.js b/node_modules/es5-ext/string/#/capitalize.js new file mode 100644 index 0000000..fc92a9f --- /dev/null +++ b/node_modules/es5-ext/string/#/capitalize.js @@ -0,0 +1,8 @@ +"use strict"; + +var value = require("../../object/valid-value"); + +module.exports = function () { + var str = String(value(this)); + return str.charAt(0).toUpperCase() + str.slice(1); +}; diff --git a/node_modules/es5-ext/string/#/case-insensitive-compare.js b/node_modules/es5-ext/string/#/case-insensitive-compare.js new file mode 100644 index 0000000..5d961a5 --- /dev/null +++ b/node_modules/es5-ext/string/#/case-insensitive-compare.js @@ -0,0 +1,7 @@ +"use strict"; + +var toLowerCase = String.prototype.toLowerCase; + +module.exports = function (other) { + return toLowerCase.call(this).localeCompare(toLowerCase.call(String(other))); +}; diff --git a/node_modules/es5-ext/string/#/code-point-at/implement.js b/node_modules/es5-ext/string/#/code-point-at/implement.js new file mode 100644 index 0000000..25752f9 --- /dev/null +++ b/node_modules/es5-ext/string/#/code-point-at/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String.prototype, "codePointAt", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/string/#/code-point-at/index.js b/node_modules/es5-ext/string/#/code-point-at/index.js new file mode 100644 index 0000000..0a22f84 --- /dev/null +++ b/node_modules/es5-ext/string/#/code-point-at/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? String.prototype.codePointAt : require("./shim"); diff --git a/node_modules/es5-ext/string/#/code-point-at/is-implemented.js b/node_modules/es5-ext/string/#/code-point-at/is-implemented.js new file mode 100644 index 0000000..47e4c93 --- /dev/null +++ b/node_modules/es5-ext/string/#/code-point-at/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var str = "abc\uD834\uDF06def"; + +module.exports = function () { + if (typeof str.codePointAt !== "function") return false; + return str.codePointAt(3) === 0x1d306; +}; diff --git a/node_modules/es5-ext/string/#/code-point-at/shim.js b/node_modules/es5-ext/string/#/code-point-at/shim.js new file mode 100644 index 0000000..0f331c3 --- /dev/null +++ b/node_modules/es5-ext/string/#/code-point-at/shim.js @@ -0,0 +1,26 @@ +// Based on: https://github.com/mathiasbynens/String.prototype.codePointAt +// Thanks @mathiasbynens ! + +"use strict"; + +var toInteger = require("../../../number/to-integer") + , validValue = require("../../../object/valid-value"); + +module.exports = function (pos) { + var str = String(validValue(this)), length = str.length, first, second; + pos = toInteger(pos); + + // Account for out-of-bounds indices: + if (pos < 0 || pos >= length) return undefined; + + // Get the first code unit + first = str.charCodeAt(pos); + if (first >= 0xd800 && first <= 0xdbff && length > pos + 1) { + second = str.charCodeAt(pos + 1); + if (second >= 0xdc00 && second <= 0xdfff) { + // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xd800) * 0x400 + second - 0xdc00 + 0x10000; + } + } + return first; +}; diff --git a/node_modules/es5-ext/string/#/contains/implement.js b/node_modules/es5-ext/string/#/contains/implement.js new file mode 100644 index 0000000..03cc091 --- /dev/null +++ b/node_modules/es5-ext/string/#/contains/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String.prototype, "contains", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/string/#/contains/index.js b/node_modules/es5-ext/string/#/contains/index.js new file mode 100644 index 0000000..5f8d993 --- /dev/null +++ b/node_modules/es5-ext/string/#/contains/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? String.prototype.contains : require("./shim"); diff --git a/node_modules/es5-ext/string/#/contains/is-implemented.js b/node_modules/es5-ext/string/#/contains/is-implemented.js new file mode 100644 index 0000000..d9b3e9a --- /dev/null +++ b/node_modules/es5-ext/string/#/contains/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var str = "razdwatrzy"; + +module.exports = function () { + if (typeof str.contains !== "function") return false; + return str.contains("dwa") === true && str.contains("foo") === false; +}; diff --git a/node_modules/es5-ext/string/#/contains/shim.js b/node_modules/es5-ext/string/#/contains/shim.js new file mode 100644 index 0000000..a7219f2 --- /dev/null +++ b/node_modules/es5-ext/string/#/contains/shim.js @@ -0,0 +1,7 @@ +"use strict"; + +var indexOf = String.prototype.indexOf; + +module.exports = function (searchString/*, position*/) { + return indexOf.call(this, searchString, arguments[1]) > -1; +}; diff --git a/node_modules/es5-ext/string/#/count.js b/node_modules/es5-ext/string/#/count.js new file mode 100644 index 0000000..7607013 --- /dev/null +++ b/node_modules/es5-ext/string/#/count.js @@ -0,0 +1,15 @@ +"use strict"; + +var ensureString = require("../../object/validate-stringifiable-value"); + +module.exports = function (search) { + var string = ensureString(this), count = 0, index = 0; + + search = ensureString(search); + if (!search) throw new TypeError("Search string cannot be empty"); + while ((index = string.indexOf(search, index)) !== -1) { + ++count; + index += search.length; + } + return count; +}; diff --git a/node_modules/es5-ext/string/#/ends-with/implement.js b/node_modules/es5-ext/string/#/ends-with/implement.js new file mode 100644 index 0000000..62457cc --- /dev/null +++ b/node_modules/es5-ext/string/#/ends-with/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String.prototype, "endsWith", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/string/#/ends-with/index.js b/node_modules/es5-ext/string/#/ends-with/index.js new file mode 100644 index 0000000..04c8264 --- /dev/null +++ b/node_modules/es5-ext/string/#/ends-with/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? String.prototype.endsWith : require("./shim"); diff --git a/node_modules/es5-ext/string/#/ends-with/is-implemented.js b/node_modules/es5-ext/string/#/ends-with/is-implemented.js new file mode 100644 index 0000000..1abaff7 --- /dev/null +++ b/node_modules/es5-ext/string/#/ends-with/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var str = "razdwatrzy"; + +module.exports = function () { + if (typeof str.endsWith !== "function") return false; + return str.endsWith("trzy") === true && str.endsWith("raz") === false; +}; diff --git a/node_modules/es5-ext/string/#/ends-with/shim.js b/node_modules/es5-ext/string/#/ends-with/shim.js new file mode 100644 index 0000000..725c2b7 --- /dev/null +++ b/node_modules/es5-ext/string/#/ends-with/shim.js @@ -0,0 +1,18 @@ +"use strict"; + +var toInteger = require("../../../number/to-integer") + , value = require("../../../object/valid-value") + , isValue = require("../../../object/is-value") + , min = Math.min + , max = Math.max; + +module.exports = function (searchString/*, endPosition*/) { + var self, start, endPos; + self = String(value(this)); + searchString = String(searchString); + endPos = arguments[1]; + start = + (isValue(endPos) ? min(max(toInteger(endPos), 0), self.length) : self.length) - + searchString.length; + return start < 0 ? false : self.indexOf(searchString, start) === start; +}; diff --git a/node_modules/es5-ext/string/#/hyphen-to-camel.js b/node_modules/es5-ext/string/#/hyphen-to-camel.js new file mode 100644 index 0000000..9feef5b --- /dev/null +++ b/node_modules/es5-ext/string/#/hyphen-to-camel.js @@ -0,0 +1,6 @@ +"use strict"; + +var replace = String.prototype.replace, re = /-([a-z0-9])/g; +var toUpperCase = function (ignored, a) { return a.toUpperCase(); }; + +module.exports = function () { return replace.call(this, re, toUpperCase); }; diff --git a/node_modules/es5-ext/string/#/indent.js b/node_modules/es5-ext/string/#/indent.js new file mode 100644 index 0000000..67fa9ad --- /dev/null +++ b/node_modules/es5-ext/string/#/indent.js @@ -0,0 +1,12 @@ +"use strict"; + +var isValue = require("../../object/is-value") + , repeat = require("./repeat") + , replace = String.prototype.replace + , re = /(\r\n|[\n\r\u2028\u2029])([\u0000-\u0009\u000b-\uffff]+)/g; + +module.exports = function (indent/*, count*/) { + var count = arguments[1]; + indent = repeat.call(String(indent), isValue(count) ? count : 1); + return indent + replace.call(this, re, "$1" + indent + "$2"); +}; diff --git a/node_modules/es5-ext/string/#/index.js b/node_modules/es5-ext/string/#/index.js new file mode 100644 index 0000000..2344489 --- /dev/null +++ b/node_modules/es5-ext/string/#/index.js @@ -0,0 +1,23 @@ +"use strict"; + +module.exports = { + "@@iterator": require("./@@iterator"), + "at": require("./at"), + "count": require("./count"), + "camelToHyphen": require("./camel-to-hyphen"), + "capitalize": require("./capitalize"), + "caseInsensitiveCompare": require("./case-insensitive-compare"), + "codePointAt": require("./code-point-at"), + "contains": require("./contains"), + "hyphenToCamel": require("./hyphen-to-camel"), + "endsWith": require("./ends-with"), + "indent": require("./indent"), + "last": require("./last"), + "normalize": require("./normalize"), + "pad": require("./pad"), + "plainReplace": require("./plain-replace"), + "plainReplaceAll": require("./plain-replace-all"), + "repeat": require("./repeat"), + "startsWith": require("./starts-with"), + "uncapitalize": require("./uncapitalize") +}; diff --git a/node_modules/es5-ext/string/#/last.js b/node_modules/es5-ext/string/#/last.js new file mode 100644 index 0000000..f5c957f --- /dev/null +++ b/node_modules/es5-ext/string/#/last.js @@ -0,0 +1,8 @@ +"use strict"; + +var value = require("../../object/valid-value"); + +module.exports = function () { + var self = String(value(this)), length = self.length; + return length ? self[length - 1] : null; +}; diff --git a/node_modules/es5-ext/string/#/normalize/_data.js b/node_modules/es5-ext/string/#/normalize/_data.js new file mode 100644 index 0000000..ae4f153 --- /dev/null +++ b/node_modules/es5-ext/string/#/normalize/_data.js @@ -0,0 +1,6988 @@ +/* eslint max-lines: "off", no-sparse-arrays: "off", comma-style: "off" */ + +"use strict"; + +module.exports = { + 0: { + 60: [, , { 824: 8814 }], + 61: [, , { 824: 8800 }], + 62: [, , { 824: 8815 }], + 65: [ + , , + { + 768: 192, + 769: 193, + 770: 194, + 771: 195, + 772: 256, + 774: 258, + 775: 550, + 776: 196, + 777: 7842, + 778: 197, + 780: 461, + 783: 512, + 785: 514, + 803: 7840, + 805: 7680, + 808: 260 + } + ], + 66: [, , { 775: 7682, 803: 7684, 817: 7686 }], + 67: [, , { 769: 262, 770: 264, 775: 266, 780: 268, 807: 199 }], + 68: [, , { 775: 7690, 780: 270, 803: 7692, 807: 7696, 813: 7698, 817: 7694 }], + 69: [ + , , + { + 768: 200, + 769: 201, + 770: 202, + 771: 7868, + 772: 274, + 774: 276, + 775: 278, + 776: 203, + 777: 7866, + 780: 282, + 783: 516, + 785: 518, + 803: 7864, + 807: 552, + 808: 280, + 813: 7704, + 816: 7706 + } + ], + 70: [, , { 775: 7710 }], + 71: [, , { 769: 500, 770: 284, 772: 7712, 774: 286, 775: 288, 780: 486, 807: 290 }], + 72: [, , { 770: 292, 775: 7714, 776: 7718, 780: 542, 803: 7716, 807: 7720, 814: 7722 }], + 73: [ + , , + { + 768: 204, + 769: 205, + 770: 206, + 771: 296, + 772: 298, + 774: 300, + 775: 304, + 776: 207, + 777: 7880, + 780: 463, + 783: 520, + 785: 522, + 803: 7882, + 808: 302, + 816: 7724 + } + ], + 74: [, , { 770: 308 }], + 75: [, , { 769: 7728, 780: 488, 803: 7730, 807: 310, 817: 7732 }], + 76: [, , { 769: 313, 780: 317, 803: 7734, 807: 315, 813: 7740, 817: 7738 }], + 77: [, , { 769: 7742, 775: 7744, 803: 7746 }], + 78: [ + , , + { + 768: 504, + 769: 323, + 771: 209, + 775: 7748, + 780: 327, + 803: 7750, + 807: 325, + 813: 7754, + 817: 7752 + } + ], + 79: [ + , , + { + 768: 210, + 769: 211, + 770: 212, + 771: 213, + 772: 332, + 774: 334, + 775: 558, + 776: 214, + 777: 7886, + 779: 336, + 780: 465, + 783: 524, + 785: 526, + 795: 416, + 803: 7884, + 808: 490 + } + ], + 80: [, , { 769: 7764, 775: 7766 }], + 82: [ + , , + { 769: 340, 775: 7768, 780: 344, 783: 528, 785: 530, 803: 7770, 807: 342, 817: 7774 } + ], + 83: [, , { 769: 346, 770: 348, 775: 7776, 780: 352, 803: 7778, 806: 536, 807: 350 }], + 84: [, , { 775: 7786, 780: 356, 803: 7788, 806: 538, 807: 354, 813: 7792, 817: 7790 }], + 85: [ + , , + { + 768: 217, + 769: 218, + 770: 219, + 771: 360, + 772: 362, + 774: 364, + 776: 220, + 777: 7910, + 778: 366, + 779: 368, + 780: 467, + 783: 532, + 785: 534, + 795: 431, + 803: 7908, + 804: 7794, + 808: 370, + 813: 7798, + 816: 7796 + } + ], + 86: [, , { 771: 7804, 803: 7806 }], + 87: [, , { 768: 7808, 769: 7810, 770: 372, 775: 7814, 776: 7812, 803: 7816 }], + 88: [, , { 775: 7818, 776: 7820 }], + 89: [ + , , + { + 768: 7922, + 769: 221, + 770: 374, + 771: 7928, + 772: 562, + 775: 7822, + 776: 376, + 777: 7926, + 803: 7924 + } + ], + 90: [, , { 769: 377, 770: 7824, 775: 379, 780: 381, 803: 7826, 817: 7828 }], + 97: [ + , , + { + 768: 224, + 769: 225, + 770: 226, + 771: 227, + 772: 257, + 774: 259, + 775: 551, + 776: 228, + 777: 7843, + 778: 229, + 780: 462, + 783: 513, + 785: 515, + 803: 7841, + 805: 7681, + 808: 261 + } + ], + 98: [, , { 775: 7683, 803: 7685, 817: 7687 }], + 99: [, , { 769: 263, 770: 265, 775: 267, 780: 269, 807: 231 }], + 100: [, , { 775: 7691, 780: 271, 803: 7693, 807: 7697, 813: 7699, 817: 7695 }], + 101: [ + , , + { + 768: 232, + 769: 233, + 770: 234, + 771: 7869, + 772: 275, + 774: 277, + 775: 279, + 776: 235, + 777: 7867, + 780: 283, + 783: 517, + 785: 519, + 803: 7865, + 807: 553, + 808: 281, + 813: 7705, + 816: 7707 + } + ], + 102: [, , { 775: 7711 }], + 103: [, , { 769: 501, 770: 285, 772: 7713, 774: 287, 775: 289, 780: 487, 807: 291 }], + 104: [ + , , + { 770: 293, 775: 7715, 776: 7719, 780: 543, 803: 7717, 807: 7721, 814: 7723, 817: 7830 } + ], + 105: [ + , , + { + 768: 236, + 769: 237, + 770: 238, + 771: 297, + 772: 299, + 774: 301, + 776: 239, + 777: 7881, + 780: 464, + 783: 521, + 785: 523, + 803: 7883, + 808: 303, + 816: 7725 + } + ], + 106: [, , { 770: 309, 780: 496 }], + 107: [, , { 769: 7729, 780: 489, 803: 7731, 807: 311, 817: 7733 }], + 108: [, , { 769: 314, 780: 318, 803: 7735, 807: 316, 813: 7741, 817: 7739 }], + 109: [, , { 769: 7743, 775: 7745, 803: 7747 }], + 110: [ + , , + { + 768: 505, + 769: 324, + 771: 241, + 775: 7749, + 780: 328, + 803: 7751, + 807: 326, + 813: 7755, + 817: 7753 + } + ], + 111: [ + , , + { + 768: 242, + 769: 243, + 770: 244, + 771: 245, + 772: 333, + 774: 335, + 775: 559, + 776: 246, + 777: 7887, + 779: 337, + 780: 466, + 783: 525, + 785: 527, + 795: 417, + 803: 7885, + 808: 491 + } + ], + 112: [, , { 769: 7765, 775: 7767 }], + 114: [ + , , + { 769: 341, 775: 7769, 780: 345, 783: 529, 785: 531, 803: 7771, 807: 343, 817: 7775 } + ], + 115: [, , { 769: 347, 770: 349, 775: 7777, 780: 353, 803: 7779, 806: 537, 807: 351 }], + 116: [ + , , + { 775: 7787, 776: 7831, 780: 357, 803: 7789, 806: 539, 807: 355, 813: 7793, 817: 7791 } + ], + 117: [ + , , + { + 768: 249, + 769: 250, + 770: 251, + 771: 361, + 772: 363, + 774: 365, + 776: 252, + 777: 7911, + 778: 367, + 779: 369, + 780: 468, + 783: 533, + 785: 535, + 795: 432, + 803: 7909, + 804: 7795, + 808: 371, + 813: 7799, + 816: 7797 + } + ], + 118: [, , { 771: 7805, 803: 7807 }], + 119: [, , { 768: 7809, 769: 7811, 770: 373, 775: 7815, 776: 7813, 778: 7832, 803: 7817 }], + 120: [, , { 775: 7819, 776: 7821 }], + 121: [ + , , + { + 768: 7923, + 769: 253, + 770: 375, + 771: 7929, + 772: 563, + 775: 7823, + 776: 255, + 777: 7927, + 778: 7833, + 803: 7925 + } + ], + 122: [, , { 769: 378, 770: 7825, 775: 380, 780: 382, 803: 7827, 817: 7829 }], + 160: [[32], 256], + 168: [[32, 776], 256, { 768: 8173, 769: 901, 834: 8129 }], + 170: [[97], 256], + 175: [[32, 772], 256], + 178: [[50], 256], + 179: [[51], 256], + 180: [[32, 769], 256], + 181: [[956], 256], + 184: [[32, 807], 256], + 185: [[49], 256], + 186: [[111], 256], + 188: [[49, 8260, 52], 256], + 189: [[49, 8260, 50], 256], + 190: [[51, 8260, 52], 256], + 192: [[65, 768]], + 193: [[65, 769]], + 194: [[65, 770], , { 768: 7846, 769: 7844, 771: 7850, 777: 7848 }], + 195: [[65, 771]], + 196: [[65, 776], , { 772: 478 }], + 197: [[65, 778], , { 769: 506 }], + 198: [, , { 769: 508, 772: 482 }], + 199: [[67, 807], , { 769: 7688 }], + 200: [[69, 768]], + 201: [[69, 769]], + 202: [[69, 770], , { 768: 7872, 769: 7870, 771: 7876, 777: 7874 }], + 203: [[69, 776]], + 204: [[73, 768]], + 205: [[73, 769]], + 206: [[73, 770]], + 207: [[73, 776], , { 769: 7726 }], + 209: [[78, 771]], + 210: [[79, 768]], + 211: [[79, 769]], + 212: [[79, 770], , { 768: 7890, 769: 7888, 771: 7894, 777: 7892 }], + 213: [[79, 771], , { 769: 7756, 772: 556, 776: 7758 }], + 214: [[79, 776], , { 772: 554 }], + 216: [, , { 769: 510 }], + 217: [[85, 768]], + 218: [[85, 769]], + 219: [[85, 770]], + 220: [[85, 776], , { 768: 475, 769: 471, 772: 469, 780: 473 }], + 221: [[89, 769]], + 224: [[97, 768]], + 225: [[97, 769]], + 226: [[97, 770], , { 768: 7847, 769: 7845, 771: 7851, 777: 7849 }], + 227: [[97, 771]], + 228: [[97, 776], , { 772: 479 }], + 229: [[97, 778], , { 769: 507 }], + 230: [, , { 769: 509, 772: 483 }], + 231: [[99, 807], , { 769: 7689 }], + 232: [[101, 768]], + 233: [[101, 769]], + 234: [[101, 770], , { 768: 7873, 769: 7871, 771: 7877, 777: 7875 }], + 235: [[101, 776]], + 236: [[105, 768]], + 237: [[105, 769]], + 238: [[105, 770]], + 239: [[105, 776], , { 769: 7727 }], + 241: [[110, 771]], + 242: [[111, 768]], + 243: [[111, 769]], + 244: [[111, 770], , { 768: 7891, 769: 7889, 771: 7895, 777: 7893 }], + 245: [[111, 771], , { 769: 7757, 772: 557, 776: 7759 }], + 246: [[111, 776], , { 772: 555 }], + 248: [, , { 769: 511 }], + 249: [[117, 768]], + 250: [[117, 769]], + 251: [[117, 770]], + 252: [[117, 776], , { 768: 476, 769: 472, 772: 470, 780: 474 }], + 253: [[121, 769]], + 255: [[121, 776]] + }, + 256: { + 256: [[65, 772]], + 257: [[97, 772]], + 258: [[65, 774], , { 768: 7856, 769: 7854, 771: 7860, 777: 7858 }], + 259: [[97, 774], , { 768: 7857, 769: 7855, 771: 7861, 777: 7859 }], + 260: [[65, 808]], + 261: [[97, 808]], + 262: [[67, 769]], + 263: [[99, 769]], + 264: [[67, 770]], + 265: [[99, 770]], + 266: [[67, 775]], + 267: [[99, 775]], + 268: [[67, 780]], + 269: [[99, 780]], + 270: [[68, 780]], + 271: [[100, 780]], + 274: [[69, 772], , { 768: 7700, 769: 7702 }], + 275: [[101, 772], , { 768: 7701, 769: 7703 }], + 276: [[69, 774]], + 277: [[101, 774]], + 278: [[69, 775]], + 279: [[101, 775]], + 280: [[69, 808]], + 281: [[101, 808]], + 282: [[69, 780]], + 283: [[101, 780]], + 284: [[71, 770]], + 285: [[103, 770]], + 286: [[71, 774]], + 287: [[103, 774]], + 288: [[71, 775]], + 289: [[103, 775]], + 290: [[71, 807]], + 291: [[103, 807]], + 292: [[72, 770]], + 293: [[104, 770]], + 296: [[73, 771]], + 297: [[105, 771]], + 298: [[73, 772]], + 299: [[105, 772]], + 300: [[73, 774]], + 301: [[105, 774]], + 302: [[73, 808]], + 303: [[105, 808]], + 304: [[73, 775]], + 306: [[73, 74], 256], + 307: [[105, 106], 256], + 308: [[74, 770]], + 309: [[106, 770]], + 310: [[75, 807]], + 311: [[107, 807]], + 313: [[76, 769]], + 314: [[108, 769]], + 315: [[76, 807]], + 316: [[108, 807]], + 317: [[76, 780]], + 318: [[108, 780]], + 319: [[76, 183], 256], + 320: [[108, 183], 256], + 323: [[78, 769]], + 324: [[110, 769]], + 325: [[78, 807]], + 326: [[110, 807]], + 327: [[78, 780]], + 328: [[110, 780]], + 329: [[700, 110], 256], + 332: [[79, 772], , { 768: 7760, 769: 7762 }], + 333: [[111, 772], , { 768: 7761, 769: 7763 }], + 334: [[79, 774]], + 335: [[111, 774]], + 336: [[79, 779]], + 337: [[111, 779]], + 340: [[82, 769]], + 341: [[114, 769]], + 342: [[82, 807]], + 343: [[114, 807]], + 344: [[82, 780]], + 345: [[114, 780]], + 346: [[83, 769], , { 775: 7780 }], + 347: [[115, 769], , { 775: 7781 }], + 348: [[83, 770]], + 349: [[115, 770]], + 350: [[83, 807]], + 351: [[115, 807]], + 352: [[83, 780], , { 775: 7782 }], + 353: [[115, 780], , { 775: 7783 }], + 354: [[84, 807]], + 355: [[116, 807]], + 356: [[84, 780]], + 357: [[116, 780]], + 360: [[85, 771], , { 769: 7800 }], + 361: [[117, 771], , { 769: 7801 }], + 362: [[85, 772], , { 776: 7802 }], + 363: [[117, 772], , { 776: 7803 }], + 364: [[85, 774]], + 365: [[117, 774]], + 366: [[85, 778]], + 367: [[117, 778]], + 368: [[85, 779]], + 369: [[117, 779]], + 370: [[85, 808]], + 371: [[117, 808]], + 372: [[87, 770]], + 373: [[119, 770]], + 374: [[89, 770]], + 375: [[121, 770]], + 376: [[89, 776]], + 377: [[90, 769]], + 378: [[122, 769]], + 379: [[90, 775]], + 380: [[122, 775]], + 381: [[90, 780]], + 382: [[122, 780]], + 383: [[115], 256, { 775: 7835 }], + 416: [[79, 795], , { 768: 7900, 769: 7898, 771: 7904, 777: 7902, 803: 7906 }], + 417: [[111, 795], , { 768: 7901, 769: 7899, 771: 7905, 777: 7903, 803: 7907 }], + 431: [[85, 795], , { 768: 7914, 769: 7912, 771: 7918, 777: 7916, 803: 7920 }], + 432: [[117, 795], , { 768: 7915, 769: 7913, 771: 7919, 777: 7917, 803: 7921 }], + 439: [, , { 780: 494 }], + 452: [[68, 381], 256], + 453: [[68, 382], 256], + 454: [[100, 382], 256], + 455: [[76, 74], 256], + 456: [[76, 106], 256], + 457: [[108, 106], 256], + 458: [[78, 74], 256], + 459: [[78, 106], 256], + 460: [[110, 106], 256], + 461: [[65, 780]], + 462: [[97, 780]], + 463: [[73, 780]], + 464: [[105, 780]], + 465: [[79, 780]], + 466: [[111, 780]], + 467: [[85, 780]], + 468: [[117, 780]], + 469: [[220, 772]], + 470: [[252, 772]], + 471: [[220, 769]], + 472: [[252, 769]], + 473: [[220, 780]], + 474: [[252, 780]], + 475: [[220, 768]], + 476: [[252, 768]], + 478: [[196, 772]], + 479: [[228, 772]], + 480: [[550, 772]], + 481: [[551, 772]], + 482: [[198, 772]], + 483: [[230, 772]], + 486: [[71, 780]], + 487: [[103, 780]], + 488: [[75, 780]], + 489: [[107, 780]], + 490: [[79, 808], , { 772: 492 }], + 491: [[111, 808], , { 772: 493 }], + 492: [[490, 772]], + 493: [[491, 772]], + 494: [[439, 780]], + 495: [[658, 780]], + 496: [[106, 780]], + 497: [[68, 90], 256], + 498: [[68, 122], 256], + 499: [[100, 122], 256], + 500: [[71, 769]], + 501: [[103, 769]], + 504: [[78, 768]], + 505: [[110, 768]], + 506: [[197, 769]], + 507: [[229, 769]], + 508: [[198, 769]], + 509: [[230, 769]], + 510: [[216, 769]], + 511: [[248, 769]], + 66045: [, 220] + }, + 512: { + 512: [[65, 783]], + 513: [[97, 783]], + 514: [[65, 785]], + 515: [[97, 785]], + 516: [[69, 783]], + 517: [[101, 783]], + 518: [[69, 785]], + 519: [[101, 785]], + 520: [[73, 783]], + 521: [[105, 783]], + 522: [[73, 785]], + 523: [[105, 785]], + 524: [[79, 783]], + 525: [[111, 783]], + 526: [[79, 785]], + 527: [[111, 785]], + 528: [[82, 783]], + 529: [[114, 783]], + 530: [[82, 785]], + 531: [[114, 785]], + 532: [[85, 783]], + 533: [[117, 783]], + 534: [[85, 785]], + 535: [[117, 785]], + 536: [[83, 806]], + 537: [[115, 806]], + 538: [[84, 806]], + 539: [[116, 806]], + 542: [[72, 780]], + 543: [[104, 780]], + 550: [[65, 775], , { 772: 480 }], + 551: [[97, 775], , { 772: 481 }], + 552: [[69, 807], , { 774: 7708 }], + 553: [[101, 807], , { 774: 7709 }], + 554: [[214, 772]], + 555: [[246, 772]], + 556: [[213, 772]], + 557: [[245, 772]], + 558: [[79, 775], , { 772: 560 }], + 559: [[111, 775], , { 772: 561 }], + 560: [[558, 772]], + 561: [[559, 772]], + 562: [[89, 772]], + 563: [[121, 772]], + 658: [, , { 780: 495 }], + 688: [[104], 256], + 689: [[614], 256], + 690: [[106], 256], + 691: [[114], 256], + 692: [[633], 256], + 693: [[635], 256], + 694: [[641], 256], + 695: [[119], 256], + 696: [[121], 256], + 728: [[32, 774], 256], + 729: [[32, 775], 256], + 730: [[32, 778], 256], + 731: [[32, 808], 256], + 732: [[32, 771], 256], + 733: [[32, 779], 256], + 736: [[611], 256], + 737: [[108], 256], + 738: [[115], 256], + 739: [[120], 256], + 740: [[661], 256] + }, + 768: { + 768: [, 230], + 769: [, 230], + 770: [, 230], + 771: [, 230], + 772: [, 230], + 773: [, 230], + 774: [, 230], + 775: [, 230], + 776: [, 230, { 769: 836 }], + 777: [, 230], + 778: [, 230], + 779: [, 230], + 780: [, 230], + 781: [, 230], + 782: [, 230], + 783: [, 230], + 784: [, 230], + 785: [, 230], + 786: [, 230], + 787: [, 230], + 788: [, 230], + 789: [, 232], + 790: [, 220], + 791: [, 220], + 792: [, 220], + 793: [, 220], + 794: [, 232], + 795: [, 216], + 796: [, 220], + 797: [, 220], + 798: [, 220], + 799: [, 220], + 800: [, 220], + 801: [, 202], + 802: [, 202], + 803: [, 220], + 804: [, 220], + 805: [, 220], + 806: [, 220], + 807: [, 202], + 808: [, 202], + 809: [, 220], + 810: [, 220], + 811: [, 220], + 812: [, 220], + 813: [, 220], + 814: [, 220], + 815: [, 220], + 816: [, 220], + 817: [, 220], + 818: [, 220], + 819: [, 220], + 820: [, 1], + 821: [, 1], + 822: [, 1], + 823: [, 1], + 824: [, 1], + 825: [, 220], + 826: [, 220], + 827: [, 220], + 828: [, 220], + 829: [, 230], + 830: [, 230], + 831: [, 230], + 832: [[768], 230], + 833: [[769], 230], + 834: [, 230], + 835: [[787], 230], + 836: [[776, 769], 230], + 837: [, 240], + 838: [, 230], + 839: [, 220], + 840: [, 220], + 841: [, 220], + 842: [, 230], + 843: [, 230], + 844: [, 230], + 845: [, 220], + 846: [, 220], + 848: [, 230], + 849: [, 230], + 850: [, 230], + 851: [, 220], + 852: [, 220], + 853: [, 220], + 854: [, 220], + 855: [, 230], + 856: [, 232], + 857: [, 220], + 858: [, 220], + 859: [, 230], + 860: [, 233], + 861: [, 234], + 862: [, 234], + 863: [, 233], + 864: [, 234], + 865: [, 234], + 866: [, 233], + 867: [, 230], + 868: [, 230], + 869: [, 230], + 870: [, 230], + 871: [, 230], + 872: [, 230], + 873: [, 230], + 874: [, 230], + 875: [, 230], + 876: [, 230], + 877: [, 230], + 878: [, 230], + 879: [, 230], + 884: [[697]], + 890: [[32, 837], 256], + 894: [[59]], + 900: [[32, 769], 256], + 901: [[168, 769]], + 902: [[913, 769]], + 903: [[183]], + 904: [[917, 769]], + 905: [[919, 769]], + 906: [[921, 769]], + 908: [[927, 769]], + 910: [[933, 769]], + 911: [[937, 769]], + 912: [[970, 769]], + 913: [, , { 768: 8122, 769: 902, 772: 8121, 774: 8120, 787: 7944, 788: 7945, 837: 8124 }], + 917: [, , { 768: 8136, 769: 904, 787: 7960, 788: 7961 }], + 919: [, , { 768: 8138, 769: 905, 787: 7976, 788: 7977, 837: 8140 }], + 921: [, , { 768: 8154, 769: 906, 772: 8153, 774: 8152, 776: 938, 787: 7992, 788: 7993 }], + 927: [, , { 768: 8184, 769: 908, 787: 8008, 788: 8009 }], + 929: [, , { 788: 8172 }], + 933: [, , { 768: 8170, 769: 910, 772: 8169, 774: 8168, 776: 939, 788: 8025 }], + 937: [, , { 768: 8186, 769: 911, 787: 8040, 788: 8041, 837: 8188 }], + 938: [[921, 776]], + 939: [[933, 776]], + 940: [[945, 769], , { 837: 8116 }], + 941: [[949, 769]], + 942: [[951, 769], , { 837: 8132 }], + 943: [[953, 769]], + 944: [[971, 769]], + 945: [ + , , + { + 768: 8048, + 769: 940, + 772: 8113, + 774: 8112, + 787: 7936, + 788: 7937, + 834: 8118, + 837: 8115 + } + ], + 949: [, , { 768: 8050, 769: 941, 787: 7952, 788: 7953 }], + 951: [, , { 768: 8052, 769: 942, 787: 7968, 788: 7969, 834: 8134, 837: 8131 }], + 953: [ + , , + { 768: 8054, 769: 943, 772: 8145, 774: 8144, 776: 970, 787: 7984, 788: 7985, 834: 8150 } + ], + 959: [, , { 768: 8056, 769: 972, 787: 8000, 788: 8001 }], + 961: [, , { 787: 8164, 788: 8165 }], + 965: [ + , , + { 768: 8058, 769: 973, 772: 8161, 774: 8160, 776: 971, 787: 8016, 788: 8017, 834: 8166 } + ], + 969: [, , { 768: 8060, 769: 974, 787: 8032, 788: 8033, 834: 8182, 837: 8179 }], + 970: [[953, 776], , { 768: 8146, 769: 912, 834: 8151 }], + 971: [[965, 776], , { 768: 8162, 769: 944, 834: 8167 }], + 972: [[959, 769]], + 973: [[965, 769]], + 974: [[969, 769], , { 837: 8180 }], + 976: [[946], 256], + 977: [[952], 256], + 978: [[933], 256, { 769: 979, 776: 980 }], + 979: [[978, 769]], + 980: [[978, 776]], + 981: [[966], 256], + 982: [[960], 256], + 1008: [[954], 256], + 1009: [[961], 256], + 1010: [[962], 256], + 1012: [[920], 256], + 1013: [[949], 256], + 1017: [[931], 256] + }, + 1024: { + 1024: [[1045, 768]], + 1025: [[1045, 776]], + 1027: [[1043, 769]], + 1030: [, , { 776: 1031 }], + 1031: [[1030, 776]], + 1036: [[1050, 769]], + 1037: [[1048, 768]], + 1038: [[1059, 774]], + 1040: [, , { 774: 1232, 776: 1234 }], + 1043: [, , { 769: 1027 }], + 1045: [, , { 768: 1024, 774: 1238, 776: 1025 }], + 1046: [, , { 774: 1217, 776: 1244 }], + 1047: [, , { 776: 1246 }], + 1048: [, , { 768: 1037, 772: 1250, 774: 1049, 776: 1252 }], + 1049: [[1048, 774]], + 1050: [, , { 769: 1036 }], + 1054: [, , { 776: 1254 }], + 1059: [, , { 772: 1262, 774: 1038, 776: 1264, 779: 1266 }], + 1063: [, , { 776: 1268 }], + 1067: [, , { 776: 1272 }], + 1069: [, , { 776: 1260 }], + 1072: [, , { 774: 1233, 776: 1235 }], + 1075: [, , { 769: 1107 }], + 1077: [, , { 768: 1104, 774: 1239, 776: 1105 }], + 1078: [, , { 774: 1218, 776: 1245 }], + 1079: [, , { 776: 1247 }], + 1080: [, , { 768: 1117, 772: 1251, 774: 1081, 776: 1253 }], + 1081: [[1080, 774]], + 1082: [, , { 769: 1116 }], + 1086: [, , { 776: 1255 }], + 1091: [, , { 772: 1263, 774: 1118, 776: 1265, 779: 1267 }], + 1095: [, , { 776: 1269 }], + 1099: [, , { 776: 1273 }], + 1101: [, , { 776: 1261 }], + 1104: [[1077, 768]], + 1105: [[1077, 776]], + 1107: [[1075, 769]], + 1110: [, , { 776: 1111 }], + 1111: [[1110, 776]], + 1116: [[1082, 769]], + 1117: [[1080, 768]], + 1118: [[1091, 774]], + 1140: [, , { 783: 1142 }], + 1141: [, , { 783: 1143 }], + 1142: [[1140, 783]], + 1143: [[1141, 783]], + 1155: [, 230], + 1156: [, 230], + 1157: [, 230], + 1158: [, 230], + 1159: [, 230], + 1217: [[1046, 774]], + 1218: [[1078, 774]], + 1232: [[1040, 774]], + 1233: [[1072, 774]], + 1234: [[1040, 776]], + 1235: [[1072, 776]], + 1238: [[1045, 774]], + 1239: [[1077, 774]], + 1240: [, , { 776: 1242 }], + 1241: [, , { 776: 1243 }], + 1242: [[1240, 776]], + 1243: [[1241, 776]], + 1244: [[1046, 776]], + 1245: [[1078, 776]], + 1246: [[1047, 776]], + 1247: [[1079, 776]], + 1250: [[1048, 772]], + 1251: [[1080, 772]], + 1252: [[1048, 776]], + 1253: [[1080, 776]], + 1254: [[1054, 776]], + 1255: [[1086, 776]], + 1256: [, , { 776: 1258 }], + 1257: [, , { 776: 1259 }], + 1258: [[1256, 776]], + 1259: [[1257, 776]], + 1260: [[1069, 776]], + 1261: [[1101, 776]], + 1262: [[1059, 772]], + 1263: [[1091, 772]], + 1264: [[1059, 776]], + 1265: [[1091, 776]], + 1266: [[1059, 779]], + 1267: [[1091, 779]], + 1268: [[1063, 776]], + 1269: [[1095, 776]], + 1272: [[1067, 776]], + 1273: [[1099, 776]] + }, + 1280: { + 1415: [[1381, 1410], 256], + 1425: [, 220], + 1426: [, 230], + 1427: [, 230], + 1428: [, 230], + 1429: [, 230], + 1430: [, 220], + 1431: [, 230], + 1432: [, 230], + 1433: [, 230], + 1434: [, 222], + 1435: [, 220], + 1436: [, 230], + 1437: [, 230], + 1438: [, 230], + 1439: [, 230], + 1440: [, 230], + 1441: [, 230], + 1442: [, 220], + 1443: [, 220], + 1444: [, 220], + 1445: [, 220], + 1446: [, 220], + 1447: [, 220], + 1448: [, 230], + 1449: [, 230], + 1450: [, 220], + 1451: [, 230], + 1452: [, 230], + 1453: [, 222], + 1454: [, 228], + 1455: [, 230], + 1456: [, 10], + 1457: [, 11], + 1458: [, 12], + 1459: [, 13], + 1460: [, 14], + 1461: [, 15], + 1462: [, 16], + 1463: [, 17], + 1464: [, 18], + 1465: [, 19], + 1466: [, 19], + 1467: [, 20], + 1468: [, 21], + 1469: [, 22], + 1471: [, 23], + 1473: [, 24], + 1474: [, 25], + 1476: [, 230], + 1477: [, 220], + 1479: [, 18] + }, + 1536: { + 1552: [, 230], + 1553: [, 230], + 1554: [, 230], + 1555: [, 230], + 1556: [, 230], + 1557: [, 230], + 1558: [, 230], + 1559: [, 230], + 1560: [, 30], + 1561: [, 31], + 1562: [, 32], + 1570: [[1575, 1619]], + 1571: [[1575, 1620]], + 1572: [[1608, 1620]], + 1573: [[1575, 1621]], + 1574: [[1610, 1620]], + 1575: [, , { 1619: 1570, 1620: 1571, 1621: 1573 }], + 1608: [, , { 1620: 1572 }], + 1610: [, , { 1620: 1574 }], + 1611: [, 27], + 1612: [, 28], + 1613: [, 29], + 1614: [, 30], + 1615: [, 31], + 1616: [, 32], + 1617: [, 33], + 1618: [, 34], + 1619: [, 230], + 1620: [, 230], + 1621: [, 220], + 1622: [, 220], + 1623: [, 230], + 1624: [, 230], + 1625: [, 230], + 1626: [, 230], + 1627: [, 230], + 1628: [, 220], + 1629: [, 230], + 1630: [, 230], + 1631: [, 220], + 1648: [, 35], + 1653: [[1575, 1652], 256], + 1654: [[1608, 1652], 256], + 1655: [[1735, 1652], 256], + 1656: [[1610, 1652], 256], + 1728: [[1749, 1620]], + 1729: [, , { 1620: 1730 }], + 1730: [[1729, 1620]], + 1746: [, , { 1620: 1747 }], + 1747: [[1746, 1620]], + 1749: [, , { 1620: 1728 }], + 1750: [, 230], + 1751: [, 230], + 1752: [, 230], + 1753: [, 230], + 1754: [, 230], + 1755: [, 230], + 1756: [, 230], + 1759: [, 230], + 1760: [, 230], + 1761: [, 230], + 1762: [, 230], + 1763: [, 220], + 1764: [, 230], + 1767: [, 230], + 1768: [, 230], + 1770: [, 220], + 1771: [, 230], + 1772: [, 230], + 1773: [, 220] + }, + 1792: { + 1809: [, 36], + 1840: [, 230], + 1841: [, 220], + 1842: [, 230], + 1843: [, 230], + 1844: [, 220], + 1845: [, 230], + 1846: [, 230], + 1847: [, 220], + 1848: [, 220], + 1849: [, 220], + 1850: [, 230], + 1851: [, 220], + 1852: [, 220], + 1853: [, 230], + 1854: [, 220], + 1855: [, 230], + 1856: [, 230], + 1857: [, 230], + 1858: [, 220], + 1859: [, 230], + 1860: [, 220], + 1861: [, 230], + 1862: [, 220], + 1863: [, 230], + 1864: [, 220], + 1865: [, 230], + 1866: [, 230], + 2027: [, 230], + 2028: [, 230], + 2029: [, 230], + 2030: [, 230], + 2031: [, 230], + 2032: [, 230], + 2033: [, 230], + 2034: [, 220], + 2035: [, 230] + }, + 2048: { + 2070: [, 230], + 2071: [, 230], + 2072: [, 230], + 2073: [, 230], + 2075: [, 230], + 2076: [, 230], + 2077: [, 230], + 2078: [, 230], + 2079: [, 230], + 2080: [, 230], + 2081: [, 230], + 2082: [, 230], + 2083: [, 230], + 2085: [, 230], + 2086: [, 230], + 2087: [, 230], + 2089: [, 230], + 2090: [, 230], + 2091: [, 230], + 2092: [, 230], + 2093: [, 230], + 2137: [, 220], + 2138: [, 220], + 2139: [, 220], + 2276: [, 230], + 2277: [, 230], + 2278: [, 220], + 2279: [, 230], + 2280: [, 230], + 2281: [, 220], + 2282: [, 230], + 2283: [, 230], + 2284: [, 230], + 2285: [, 220], + 2286: [, 220], + 2287: [, 220], + 2288: [, 27], + 2289: [, 28], + 2290: [, 29], + 2291: [, 230], + 2292: [, 230], + 2293: [, 230], + 2294: [, 220], + 2295: [, 230], + 2296: [, 230], + 2297: [, 220], + 2298: [, 220], + 2299: [, 230], + 2300: [, 230], + 2301: [, 230], + 2302: [, 230] + }, + 2304: { + 2344: [, , { 2364: 2345 }], + 2345: [[2344, 2364]], + 2352: [, , { 2364: 2353 }], + 2353: [[2352, 2364]], + 2355: [, , { 2364: 2356 }], + 2356: [[2355, 2364]], + 2364: [, 7], + 2381: [, 9], + 2385: [, 230], + 2386: [, 220], + 2387: [, 230], + 2388: [, 230], + 2392: [[2325, 2364], 512], + 2393: [[2326, 2364], 512], + 2394: [[2327, 2364], 512], + 2395: [[2332, 2364], 512], + 2396: [[2337, 2364], 512], + 2397: [[2338, 2364], 512], + 2398: [[2347, 2364], 512], + 2399: [[2351, 2364], 512], + 2492: [, 7], + 2503: [, , { 2494: 2507, 2519: 2508 }], + 2507: [[2503, 2494]], + 2508: [[2503, 2519]], + 2509: [, 9], + 2524: [[2465, 2492], 512], + 2525: [[2466, 2492], 512], + 2527: [[2479, 2492], 512] + }, + 2560: { + 2611: [[2610, 2620], 512], + 2614: [[2616, 2620], 512], + 2620: [, 7], + 2637: [, 9], + 2649: [[2582, 2620], 512], + 2650: [[2583, 2620], 512], + 2651: [[2588, 2620], 512], + 2654: [[2603, 2620], 512], + 2748: [, 7], + 2765: [, 9], + 68109: [, 220], + 68111: [, 230], + 68152: [, 230], + 68153: [, 1], + 68154: [, 220], + 68159: [, 9] + }, + 2816: { + 2876: [, 7], + 2887: [, , { 2878: 2891, 2902: 2888, 2903: 2892 }], + 2888: [[2887, 2902]], + 2891: [[2887, 2878]], + 2892: [[2887, 2903]], + 2893: [, 9], + 2908: [[2849, 2876], 512], + 2909: [[2850, 2876], 512], + 2962: [, , { 3031: 2964 }], + 2964: [[2962, 3031]], + 3014: [, , { 3006: 3018, 3031: 3020 }], + 3015: [, , { 3006: 3019 }], + 3018: [[3014, 3006]], + 3019: [[3015, 3006]], + 3020: [[3014, 3031]], + 3021: [, 9] + }, + 3072: { + 3142: [, , { 3158: 3144 }], + 3144: [[3142, 3158]], + 3149: [, 9], + 3157: [, 84], + 3158: [, 91], + 3260: [, 7], + 3263: [, , { 3285: 3264 }], + 3264: [[3263, 3285]], + 3270: [, , { 3266: 3274, 3285: 3271, 3286: 3272 }], + 3271: [[3270, 3285]], + 3272: [[3270, 3286]], + 3274: [[3270, 3266], , { 3285: 3275 }], + 3275: [[3274, 3285]], + 3277: [, 9] + }, + 3328: { + 3398: [, , { 3390: 3402, 3415: 3404 }], + 3399: [, , { 3390: 3403 }], + 3402: [[3398, 3390]], + 3403: [[3399, 3390]], + 3404: [[3398, 3415]], + 3405: [, 9], + 3530: [, 9], + 3545: [, , { 3530: 3546, 3535: 3548, 3551: 3550 }], + 3546: [[3545, 3530]], + 3548: [[3545, 3535], , { 3530: 3549 }], + 3549: [[3548, 3530]], + 3550: [[3545, 3551]] + }, + 3584: { + 3635: [[3661, 3634], 256], + 3640: [, 103], + 3641: [, 103], + 3642: [, 9], + 3656: [, 107], + 3657: [, 107], + 3658: [, 107], + 3659: [, 107], + 3763: [[3789, 3762], 256], + 3768: [, 118], + 3769: [, 118], + 3784: [, 122], + 3785: [, 122], + 3786: [, 122], + 3787: [, 122], + 3804: [[3755, 3737], 256], + 3805: [[3755, 3745], 256] + }, + 3840: { + 3852: [[3851], 256], + 3864: [, 220], + 3865: [, 220], + 3893: [, 220], + 3895: [, 220], + 3897: [, 216], + 3907: [[3906, 4023], 512], + 3917: [[3916, 4023], 512], + 3922: [[3921, 4023], 512], + 3927: [[3926, 4023], 512], + 3932: [[3931, 4023], 512], + 3945: [[3904, 4021], 512], + 3953: [, 129], + 3954: [, 130], + 3955: [[3953, 3954], 512], + 3956: [, 132], + 3957: [[3953, 3956], 512], + 3958: [[4018, 3968], 512], + 3959: [[4018, 3969], 256], + 3960: [[4019, 3968], 512], + 3961: [[4019, 3969], 256], + 3962: [, 130], + 3963: [, 130], + 3964: [, 130], + 3965: [, 130], + 3968: [, 130], + 3969: [[3953, 3968], 512], + 3970: [, 230], + 3971: [, 230], + 3972: [, 9], + 3974: [, 230], + 3975: [, 230], + 3987: [[3986, 4023], 512], + 3997: [[3996, 4023], 512], + 4002: [[4001, 4023], 512], + 4007: [[4006, 4023], 512], + 4012: [[4011, 4023], 512], + 4025: [[3984, 4021], 512], + 4038: [, 220] + }, + 4096: { + 4133: [, , { 4142: 4134 }], + 4134: [[4133, 4142]], + 4151: [, 7], + 4153: [, 9], + 4154: [, 9], + 4237: [, 220], + 4348: [[4316], 256], + 69702: [, 9], + 69785: [, , { 69818: 69786 }], + 69786: [[69785, 69818]], + 69787: [, , { 69818: 69788 }], + 69788: [[69787, 69818]], + 69797: [, , { 69818: 69803 }], + 69803: [[69797, 69818]], + 69817: [, 9], + 69818: [, 7] + }, + 4352: { + 69888: [, 230], + 69889: [, 230], + 69890: [, 230], + 69934: [[69937, 69927]], + 69935: [[69938, 69927]], + 69937: [, , { 69927: 69934 }], + 69938: [, , { 69927: 69935 }], + 69939: [, 9], + 69940: [, 9], + 70080: [, 9] + }, + 4864: { 4957: [, 230], 4958: [, 230], 4959: [, 230] }, + 5632: { 71350: [, 9], 71351: [, 7] }, + 5888: { 5908: [, 9], 5940: [, 9], 6098: [, 9], 6109: [, 230] }, + 6144: { 6313: [, 228] }, + 6400: { 6457: [, 222], 6458: [, 230], 6459: [, 220] }, + 6656: { + 6679: [, 230], + 6680: [, 220], + 6752: [, 9], + 6773: [, 230], + 6774: [, 230], + 6775: [, 230], + 6776: [, 230], + 6777: [, 230], + 6778: [, 230], + 6779: [, 230], + 6780: [, 230], + 6783: [, 220] + }, + 6912: { + 6917: [, , { 6965: 6918 }], + 6918: [[6917, 6965]], + 6919: [, , { 6965: 6920 }], + 6920: [[6919, 6965]], + 6921: [, , { 6965: 6922 }], + 6922: [[6921, 6965]], + 6923: [, , { 6965: 6924 }], + 6924: [[6923, 6965]], + 6925: [, , { 6965: 6926 }], + 6926: [[6925, 6965]], + 6929: [, , { 6965: 6930 }], + 6930: [[6929, 6965]], + 6964: [, 7], + 6970: [, , { 6965: 6971 }], + 6971: [[6970, 6965]], + 6972: [, , { 6965: 6973 }], + 6973: [[6972, 6965]], + 6974: [, , { 6965: 6976 }], + 6975: [, , { 6965: 6977 }], + 6976: [[6974, 6965]], + 6977: [[6975, 6965]], + 6978: [, , { 6965: 6979 }], + 6979: [[6978, 6965]], + 6980: [, 9], + 7019: [, 230], + 7020: [, 220], + 7021: [, 230], + 7022: [, 230], + 7023: [, 230], + 7024: [, 230], + 7025: [, 230], + 7026: [, 230], + 7027: [, 230], + 7082: [, 9], + 7083: [, 9], + 7142: [, 7], + 7154: [, 9], + 7155: [, 9] + }, + 7168: { + 7223: [, 7], + 7376: [, 230], + 7377: [, 230], + 7378: [, 230], + 7380: [, 1], + 7381: [, 220], + 7382: [, 220], + 7383: [, 220], + 7384: [, 220], + 7385: [, 220], + 7386: [, 230], + 7387: [, 230], + 7388: [, 220], + 7389: [, 220], + 7390: [, 220], + 7391: [, 220], + 7392: [, 230], + 7394: [, 1], + 7395: [, 1], + 7396: [, 1], + 7397: [, 1], + 7398: [, 1], + 7399: [, 1], + 7400: [, 1], + 7405: [, 220], + 7412: [, 230] + }, + 7424: { + 7468: [[65], 256], + 7469: [[198], 256], + 7470: [[66], 256], + 7472: [[68], 256], + 7473: [[69], 256], + 7474: [[398], 256], + 7475: [[71], 256], + 7476: [[72], 256], + 7477: [[73], 256], + 7478: [[74], 256], + 7479: [[75], 256], + 7480: [[76], 256], + 7481: [[77], 256], + 7482: [[78], 256], + 7484: [[79], 256], + 7485: [[546], 256], + 7486: [[80], 256], + 7487: [[82], 256], + 7488: [[84], 256], + 7489: [[85], 256], + 7490: [[87], 256], + 7491: [[97], 256], + 7492: [[592], 256], + 7493: [[593], 256], + 7494: [[7426], 256], + 7495: [[98], 256], + 7496: [[100], 256], + 7497: [[101], 256], + 7498: [[601], 256], + 7499: [[603], 256], + 7500: [[604], 256], + 7501: [[103], 256], + 7503: [[107], 256], + 7504: [[109], 256], + 7505: [[331], 256], + 7506: [[111], 256], + 7507: [[596], 256], + 7508: [[7446], 256], + 7509: [[7447], 256], + 7510: [[112], 256], + 7511: [[116], 256], + 7512: [[117], 256], + 7513: [[7453], 256], + 7514: [[623], 256], + 7515: [[118], 256], + 7516: [[7461], 256], + 7517: [[946], 256], + 7518: [[947], 256], + 7519: [[948], 256], + 7520: [[966], 256], + 7521: [[967], 256], + 7522: [[105], 256], + 7523: [[114], 256], + 7524: [[117], 256], + 7525: [[118], 256], + 7526: [[946], 256], + 7527: [[947], 256], + 7528: [[961], 256], + 7529: [[966], 256], + 7530: [[967], 256], + 7544: [[1085], 256], + 7579: [[594], 256], + 7580: [[99], 256], + 7581: [[597], 256], + 7582: [[240], 256], + 7583: [[604], 256], + 7584: [[102], 256], + 7585: [[607], 256], + 7586: [[609], 256], + 7587: [[613], 256], + 7588: [[616], 256], + 7589: [[617], 256], + 7590: [[618], 256], + 7591: [[7547], 256], + 7592: [[669], 256], + 7593: [[621], 256], + 7594: [[7557], 256], + 7595: [[671], 256], + 7596: [[625], 256], + 7597: [[624], 256], + 7598: [[626], 256], + 7599: [[627], 256], + 7600: [[628], 256], + 7601: [[629], 256], + 7602: [[632], 256], + 7603: [[642], 256], + 7604: [[643], 256], + 7605: [[427], 256], + 7606: [[649], 256], + 7607: [[650], 256], + 7608: [[7452], 256], + 7609: [[651], 256], + 7610: [[652], 256], + 7611: [[122], 256], + 7612: [[656], 256], + 7613: [[657], 256], + 7614: [[658], 256], + 7615: [[952], 256], + 7616: [, 230], + 7617: [, 230], + 7618: [, 220], + 7619: [, 230], + 7620: [, 230], + 7621: [, 230], + 7622: [, 230], + 7623: [, 230], + 7624: [, 230], + 7625: [, 230], + 7626: [, 220], + 7627: [, 230], + 7628: [, 230], + 7629: [, 234], + 7630: [, 214], + 7631: [, 220], + 7632: [, 202], + 7633: [, 230], + 7634: [, 230], + 7635: [, 230], + 7636: [, 230], + 7637: [, 230], + 7638: [, 230], + 7639: [, 230], + 7640: [, 230], + 7641: [, 230], + 7642: [, 230], + 7643: [, 230], + 7644: [, 230], + 7645: [, 230], + 7646: [, 230], + 7647: [, 230], + 7648: [, 230], + 7649: [, 230], + 7650: [, 230], + 7651: [, 230], + 7652: [, 230], + 7653: [, 230], + 7654: [, 230], + 7676: [, 233], + 7677: [, 220], + 7678: [, 230], + 7679: [, 220] + }, + 7680: { + 7680: [[65, 805]], + 7681: [[97, 805]], + 7682: [[66, 775]], + 7683: [[98, 775]], + 7684: [[66, 803]], + 7685: [[98, 803]], + 7686: [[66, 817]], + 7687: [[98, 817]], + 7688: [[199, 769]], + 7689: [[231, 769]], + 7690: [[68, 775]], + 7691: [[100, 775]], + 7692: [[68, 803]], + 7693: [[100, 803]], + 7694: [[68, 817]], + 7695: [[100, 817]], + 7696: [[68, 807]], + 7697: [[100, 807]], + 7698: [[68, 813]], + 7699: [[100, 813]], + 7700: [[274, 768]], + 7701: [[275, 768]], + 7702: [[274, 769]], + 7703: [[275, 769]], + 7704: [[69, 813]], + 7705: [[101, 813]], + 7706: [[69, 816]], + 7707: [[101, 816]], + 7708: [[552, 774]], + 7709: [[553, 774]], + 7710: [[70, 775]], + 7711: [[102, 775]], + 7712: [[71, 772]], + 7713: [[103, 772]], + 7714: [[72, 775]], + 7715: [[104, 775]], + 7716: [[72, 803]], + 7717: [[104, 803]], + 7718: [[72, 776]], + 7719: [[104, 776]], + 7720: [[72, 807]], + 7721: [[104, 807]], + 7722: [[72, 814]], + 7723: [[104, 814]], + 7724: [[73, 816]], + 7725: [[105, 816]], + 7726: [[207, 769]], + 7727: [[239, 769]], + 7728: [[75, 769]], + 7729: [[107, 769]], + 7730: [[75, 803]], + 7731: [[107, 803]], + 7732: [[75, 817]], + 7733: [[107, 817]], + 7734: [[76, 803], , { 772: 7736 }], + 7735: [[108, 803], , { 772: 7737 }], + 7736: [[7734, 772]], + 7737: [[7735, 772]], + 7738: [[76, 817]], + 7739: [[108, 817]], + 7740: [[76, 813]], + 7741: [[108, 813]], + 7742: [[77, 769]], + 7743: [[109, 769]], + 7744: [[77, 775]], + 7745: [[109, 775]], + 7746: [[77, 803]], + 7747: [[109, 803]], + 7748: [[78, 775]], + 7749: [[110, 775]], + 7750: [[78, 803]], + 7751: [[110, 803]], + 7752: [[78, 817]], + 7753: [[110, 817]], + 7754: [[78, 813]], + 7755: [[110, 813]], + 7756: [[213, 769]], + 7757: [[245, 769]], + 7758: [[213, 776]], + 7759: [[245, 776]], + 7760: [[332, 768]], + 7761: [[333, 768]], + 7762: [[332, 769]], + 7763: [[333, 769]], + 7764: [[80, 769]], + 7765: [[112, 769]], + 7766: [[80, 775]], + 7767: [[112, 775]], + 7768: [[82, 775]], + 7769: [[114, 775]], + 7770: [[82, 803], , { 772: 7772 }], + 7771: [[114, 803], , { 772: 7773 }], + 7772: [[7770, 772]], + 7773: [[7771, 772]], + 7774: [[82, 817]], + 7775: [[114, 817]], + 7776: [[83, 775]], + 7777: [[115, 775]], + 7778: [[83, 803], , { 775: 7784 }], + 7779: [[115, 803], , { 775: 7785 }], + 7780: [[346, 775]], + 7781: [[347, 775]], + 7782: [[352, 775]], + 7783: [[353, 775]], + 7784: [[7778, 775]], + 7785: [[7779, 775]], + 7786: [[84, 775]], + 7787: [[116, 775]], + 7788: [[84, 803]], + 7789: [[116, 803]], + 7790: [[84, 817]], + 7791: [[116, 817]], + 7792: [[84, 813]], + 7793: [[116, 813]], + 7794: [[85, 804]], + 7795: [[117, 804]], + 7796: [[85, 816]], + 7797: [[117, 816]], + 7798: [[85, 813]], + 7799: [[117, 813]], + 7800: [[360, 769]], + 7801: [[361, 769]], + 7802: [[362, 776]], + 7803: [[363, 776]], + 7804: [[86, 771]], + 7805: [[118, 771]], + 7806: [[86, 803]], + 7807: [[118, 803]], + 7808: [[87, 768]], + 7809: [[119, 768]], + 7810: [[87, 769]], + 7811: [[119, 769]], + 7812: [[87, 776]], + 7813: [[119, 776]], + 7814: [[87, 775]], + 7815: [[119, 775]], + 7816: [[87, 803]], + 7817: [[119, 803]], + 7818: [[88, 775]], + 7819: [[120, 775]], + 7820: [[88, 776]], + 7821: [[120, 776]], + 7822: [[89, 775]], + 7823: [[121, 775]], + 7824: [[90, 770]], + 7825: [[122, 770]], + 7826: [[90, 803]], + 7827: [[122, 803]], + 7828: [[90, 817]], + 7829: [[122, 817]], + 7830: [[104, 817]], + 7831: [[116, 776]], + 7832: [[119, 778]], + 7833: [[121, 778]], + 7834: [[97, 702], 256], + 7835: [[383, 775]], + 7840: [[65, 803], , { 770: 7852, 774: 7862 }], + 7841: [[97, 803], , { 770: 7853, 774: 7863 }], + 7842: [[65, 777]], + 7843: [[97, 777]], + 7844: [[194, 769]], + 7845: [[226, 769]], + 7846: [[194, 768]], + 7847: [[226, 768]], + 7848: [[194, 777]], + 7849: [[226, 777]], + 7850: [[194, 771]], + 7851: [[226, 771]], + 7852: [[7840, 770]], + 7853: [[7841, 770]], + 7854: [[258, 769]], + 7855: [[259, 769]], + 7856: [[258, 768]], + 7857: [[259, 768]], + 7858: [[258, 777]], + 7859: [[259, 777]], + 7860: [[258, 771]], + 7861: [[259, 771]], + 7862: [[7840, 774]], + 7863: [[7841, 774]], + 7864: [[69, 803], , { 770: 7878 }], + 7865: [[101, 803], , { 770: 7879 }], + 7866: [[69, 777]], + 7867: [[101, 777]], + 7868: [[69, 771]], + 7869: [[101, 771]], + 7870: [[202, 769]], + 7871: [[234, 769]], + 7872: [[202, 768]], + 7873: [[234, 768]], + 7874: [[202, 777]], + 7875: [[234, 777]], + 7876: [[202, 771]], + 7877: [[234, 771]], + 7878: [[7864, 770]], + 7879: [[7865, 770]], + 7880: [[73, 777]], + 7881: [[105, 777]], + 7882: [[73, 803]], + 7883: [[105, 803]], + 7884: [[79, 803], , { 770: 7896 }], + 7885: [[111, 803], , { 770: 7897 }], + 7886: [[79, 777]], + 7887: [[111, 777]], + 7888: [[212, 769]], + 7889: [[244, 769]], + 7890: [[212, 768]], + 7891: [[244, 768]], + 7892: [[212, 777]], + 7893: [[244, 777]], + 7894: [[212, 771]], + 7895: [[244, 771]], + 7896: [[7884, 770]], + 7897: [[7885, 770]], + 7898: [[416, 769]], + 7899: [[417, 769]], + 7900: [[416, 768]], + 7901: [[417, 768]], + 7902: [[416, 777]], + 7903: [[417, 777]], + 7904: [[416, 771]], + 7905: [[417, 771]], + 7906: [[416, 803]], + 7907: [[417, 803]], + 7908: [[85, 803]], + 7909: [[117, 803]], + 7910: [[85, 777]], + 7911: [[117, 777]], + 7912: [[431, 769]], + 7913: [[432, 769]], + 7914: [[431, 768]], + 7915: [[432, 768]], + 7916: [[431, 777]], + 7917: [[432, 777]], + 7918: [[431, 771]], + 7919: [[432, 771]], + 7920: [[431, 803]], + 7921: [[432, 803]], + 7922: [[89, 768]], + 7923: [[121, 768]], + 7924: [[89, 803]], + 7925: [[121, 803]], + 7926: [[89, 777]], + 7927: [[121, 777]], + 7928: [[89, 771]], + 7929: [[121, 771]] + }, + 7936: { + 7936: [[945, 787], , { 768: 7938, 769: 7940, 834: 7942, 837: 8064 }], + 7937: [[945, 788], , { 768: 7939, 769: 7941, 834: 7943, 837: 8065 }], + 7938: [[7936, 768], , { 837: 8066 }], + 7939: [[7937, 768], , { 837: 8067 }], + 7940: [[7936, 769], , { 837: 8068 }], + 7941: [[7937, 769], , { 837: 8069 }], + 7942: [[7936, 834], , { 837: 8070 }], + 7943: [[7937, 834], , { 837: 8071 }], + 7944: [[913, 787], , { 768: 7946, 769: 7948, 834: 7950, 837: 8072 }], + 7945: [[913, 788], , { 768: 7947, 769: 7949, 834: 7951, 837: 8073 }], + 7946: [[7944, 768], , { 837: 8074 }], + 7947: [[7945, 768], , { 837: 8075 }], + 7948: [[7944, 769], , { 837: 8076 }], + 7949: [[7945, 769], , { 837: 8077 }], + 7950: [[7944, 834], , { 837: 8078 }], + 7951: [[7945, 834], , { 837: 8079 }], + 7952: [[949, 787], , { 768: 7954, 769: 7956 }], + 7953: [[949, 788], , { 768: 7955, 769: 7957 }], + 7954: [[7952, 768]], + 7955: [[7953, 768]], + 7956: [[7952, 769]], + 7957: [[7953, 769]], + 7960: [[917, 787], , { 768: 7962, 769: 7964 }], + 7961: [[917, 788], , { 768: 7963, 769: 7965 }], + 7962: [[7960, 768]], + 7963: [[7961, 768]], + 7964: [[7960, 769]], + 7965: [[7961, 769]], + 7968: [[951, 787], , { 768: 7970, 769: 7972, 834: 7974, 837: 8080 }], + 7969: [[951, 788], , { 768: 7971, 769: 7973, 834: 7975, 837: 8081 }], + 7970: [[7968, 768], , { 837: 8082 }], + 7971: [[7969, 768], , { 837: 8083 }], + 7972: [[7968, 769], , { 837: 8084 }], + 7973: [[7969, 769], , { 837: 8085 }], + 7974: [[7968, 834], , { 837: 8086 }], + 7975: [[7969, 834], , { 837: 8087 }], + 7976: [[919, 787], , { 768: 7978, 769: 7980, 834: 7982, 837: 8088 }], + 7977: [[919, 788], , { 768: 7979, 769: 7981, 834: 7983, 837: 8089 }], + 7978: [[7976, 768], , { 837: 8090 }], + 7979: [[7977, 768], , { 837: 8091 }], + 7980: [[7976, 769], , { 837: 8092 }], + 7981: [[7977, 769], , { 837: 8093 }], + 7982: [[7976, 834], , { 837: 8094 }], + 7983: [[7977, 834], , { 837: 8095 }], + 7984: [[953, 787], , { 768: 7986, 769: 7988, 834: 7990 }], + 7985: [[953, 788], , { 768: 7987, 769: 7989, 834: 7991 }], + 7986: [[7984, 768]], + 7987: [[7985, 768]], + 7988: [[7984, 769]], + 7989: [[7985, 769]], + 7990: [[7984, 834]], + 7991: [[7985, 834]], + 7992: [[921, 787], , { 768: 7994, 769: 7996, 834: 7998 }], + 7993: [[921, 788], , { 768: 7995, 769: 7997, 834: 7999 }], + 7994: [[7992, 768]], + 7995: [[7993, 768]], + 7996: [[7992, 769]], + 7997: [[7993, 769]], + 7998: [[7992, 834]], + 7999: [[7993, 834]], + 8000: [[959, 787], , { 768: 8002, 769: 8004 }], + 8001: [[959, 788], , { 768: 8003, 769: 8005 }], + 8002: [[8000, 768]], + 8003: [[8001, 768]], + 8004: [[8000, 769]], + 8005: [[8001, 769]], + 8008: [[927, 787], , { 768: 8010, 769: 8012 }], + 8009: [[927, 788], , { 768: 8011, 769: 8013 }], + 8010: [[8008, 768]], + 8011: [[8009, 768]], + 8012: [[8008, 769]], + 8013: [[8009, 769]], + 8016: [[965, 787], , { 768: 8018, 769: 8020, 834: 8022 }], + 8017: [[965, 788], , { 768: 8019, 769: 8021, 834: 8023 }], + 8018: [[8016, 768]], + 8019: [[8017, 768]], + 8020: [[8016, 769]], + 8021: [[8017, 769]], + 8022: [[8016, 834]], + 8023: [[8017, 834]], + 8025: [[933, 788], , { 768: 8027, 769: 8029, 834: 8031 }], + 8027: [[8025, 768]], + 8029: [[8025, 769]], + 8031: [[8025, 834]], + 8032: [[969, 787], , { 768: 8034, 769: 8036, 834: 8038, 837: 8096 }], + 8033: [[969, 788], , { 768: 8035, 769: 8037, 834: 8039, 837: 8097 }], + 8034: [[8032, 768], , { 837: 8098 }], + 8035: [[8033, 768], , { 837: 8099 }], + 8036: [[8032, 769], , { 837: 8100 }], + 8037: [[8033, 769], , { 837: 8101 }], + 8038: [[8032, 834], , { 837: 8102 }], + 8039: [[8033, 834], , { 837: 8103 }], + 8040: [[937, 787], , { 768: 8042, 769: 8044, 834: 8046, 837: 8104 }], + 8041: [[937, 788], , { 768: 8043, 769: 8045, 834: 8047, 837: 8105 }], + 8042: [[8040, 768], , { 837: 8106 }], + 8043: [[8041, 768], , { 837: 8107 }], + 8044: [[8040, 769], , { 837: 8108 }], + 8045: [[8041, 769], , { 837: 8109 }], + 8046: [[8040, 834], , { 837: 8110 }], + 8047: [[8041, 834], , { 837: 8111 }], + 8048: [[945, 768], , { 837: 8114 }], + 8049: [[940]], + 8050: [[949, 768]], + 8051: [[941]], + 8052: [[951, 768], , { 837: 8130 }], + 8053: [[942]], + 8054: [[953, 768]], + 8055: [[943]], + 8056: [[959, 768]], + 8057: [[972]], + 8058: [[965, 768]], + 8059: [[973]], + 8060: [[969, 768], , { 837: 8178 }], + 8061: [[974]], + 8064: [[7936, 837]], + 8065: [[7937, 837]], + 8066: [[7938, 837]], + 8067: [[7939, 837]], + 8068: [[7940, 837]], + 8069: [[7941, 837]], + 8070: [[7942, 837]], + 8071: [[7943, 837]], + 8072: [[7944, 837]], + 8073: [[7945, 837]], + 8074: [[7946, 837]], + 8075: [[7947, 837]], + 8076: [[7948, 837]], + 8077: [[7949, 837]], + 8078: [[7950, 837]], + 8079: [[7951, 837]], + 8080: [[7968, 837]], + 8081: [[7969, 837]], + 8082: [[7970, 837]], + 8083: [[7971, 837]], + 8084: [[7972, 837]], + 8085: [[7973, 837]], + 8086: [[7974, 837]], + 8087: [[7975, 837]], + 8088: [[7976, 837]], + 8089: [[7977, 837]], + 8090: [[7978, 837]], + 8091: [[7979, 837]], + 8092: [[7980, 837]], + 8093: [[7981, 837]], + 8094: [[7982, 837]], + 8095: [[7983, 837]], + 8096: [[8032, 837]], + 8097: [[8033, 837]], + 8098: [[8034, 837]], + 8099: [[8035, 837]], + 8100: [[8036, 837]], + 8101: [[8037, 837]], + 8102: [[8038, 837]], + 8103: [[8039, 837]], + 8104: [[8040, 837]], + 8105: [[8041, 837]], + 8106: [[8042, 837]], + 8107: [[8043, 837]], + 8108: [[8044, 837]], + 8109: [[8045, 837]], + 8110: [[8046, 837]], + 8111: [[8047, 837]], + 8112: [[945, 774]], + 8113: [[945, 772]], + 8114: [[8048, 837]], + 8115: [[945, 837]], + 8116: [[940, 837]], + 8118: [[945, 834], , { 837: 8119 }], + 8119: [[8118, 837]], + 8120: [[913, 774]], + 8121: [[913, 772]], + 8122: [[913, 768]], + 8123: [[902]], + 8124: [[913, 837]], + 8125: [[32, 787], 256], + 8126: [[953]], + 8127: [[32, 787], 256, { 768: 8141, 769: 8142, 834: 8143 }], + 8128: [[32, 834], 256], + 8129: [[168, 834]], + 8130: [[8052, 837]], + 8131: [[951, 837]], + 8132: [[942, 837]], + 8134: [[951, 834], , { 837: 8135 }], + 8135: [[8134, 837]], + 8136: [[917, 768]], + 8137: [[904]], + 8138: [[919, 768]], + 8139: [[905]], + 8140: [[919, 837]], + 8141: [[8127, 768]], + 8142: [[8127, 769]], + 8143: [[8127, 834]], + 8144: [[953, 774]], + 8145: [[953, 772]], + 8146: [[970, 768]], + 8147: [[912]], + 8150: [[953, 834]], + 8151: [[970, 834]], + 8152: [[921, 774]], + 8153: [[921, 772]], + 8154: [[921, 768]], + 8155: [[906]], + 8157: [[8190, 768]], + 8158: [[8190, 769]], + 8159: [[8190, 834]], + 8160: [[965, 774]], + 8161: [[965, 772]], + 8162: [[971, 768]], + 8163: [[944]], + 8164: [[961, 787]], + 8165: [[961, 788]], + 8166: [[965, 834]], + 8167: [[971, 834]], + 8168: [[933, 774]], + 8169: [[933, 772]], + 8170: [[933, 768]], + 8171: [[910]], + 8172: [[929, 788]], + 8173: [[168, 768]], + 8174: [[901]], + 8175: [[96]], + 8178: [[8060, 837]], + 8179: [[969, 837]], + 8180: [[974, 837]], + 8182: [[969, 834], , { 837: 8183 }], + 8183: [[8182, 837]], + 8184: [[927, 768]], + 8185: [[908]], + 8186: [[937, 768]], + 8187: [[911]], + 8188: [[937, 837]], + 8189: [[180]], + 8190: [[32, 788], 256, { 768: 8157, 769: 8158, 834: 8159 }] + }, + 8192: { + 8192: [[8194]], + 8193: [[8195]], + 8194: [[32], 256], + 8195: [[32], 256], + 8196: [[32], 256], + 8197: [[32], 256], + 8198: [[32], 256], + 8199: [[32], 256], + 8200: [[32], 256], + 8201: [[32], 256], + 8202: [[32], 256], + 8209: [[8208], 256], + 8215: [[32, 819], 256], + 8228: [[46], 256], + 8229: [[46, 46], 256], + 8230: [[46, 46, 46], 256], + 8239: [[32], 256], + 8243: [[8242, 8242], 256], + 8244: [[8242, 8242, 8242], 256], + 8246: [[8245, 8245], 256], + 8247: [[8245, 8245, 8245], 256], + 8252: [[33, 33], 256], + 8254: [[32, 773], 256], + 8263: [[63, 63], 256], + 8264: [[63, 33], 256], + 8265: [[33, 63], 256], + 8279: [[8242, 8242, 8242, 8242], 256], + 8287: [[32], 256], + 8304: [[48], 256], + 8305: [[105], 256], + 8308: [[52], 256], + 8309: [[53], 256], + 8310: [[54], 256], + 8311: [[55], 256], + 8312: [[56], 256], + 8313: [[57], 256], + 8314: [[43], 256], + 8315: [[8722], 256], + 8316: [[61], 256], + 8317: [[40], 256], + 8318: [[41], 256], + 8319: [[110], 256], + 8320: [[48], 256], + 8321: [[49], 256], + 8322: [[50], 256], + 8323: [[51], 256], + 8324: [[52], 256], + 8325: [[53], 256], + 8326: [[54], 256], + 8327: [[55], 256], + 8328: [[56], 256], + 8329: [[57], 256], + 8330: [[43], 256], + 8331: [[8722], 256], + 8332: [[61], 256], + 8333: [[40], 256], + 8334: [[41], 256], + 8336: [[97], 256], + 8337: [[101], 256], + 8338: [[111], 256], + 8339: [[120], 256], + 8340: [[601], 256], + 8341: [[104], 256], + 8342: [[107], 256], + 8343: [[108], 256], + 8344: [[109], 256], + 8345: [[110], 256], + 8346: [[112], 256], + 8347: [[115], 256], + 8348: [[116], 256], + 8360: [[82, 115], 256], + 8400: [, 230], + 8401: [, 230], + 8402: [, 1], + 8403: [, 1], + 8404: [, 230], + 8405: [, 230], + 8406: [, 230], + 8407: [, 230], + 8408: [, 1], + 8409: [, 1], + 8410: [, 1], + 8411: [, 230], + 8412: [, 230], + 8417: [, 230], + 8421: [, 1], + 8422: [, 1], + 8423: [, 230], + 8424: [, 220], + 8425: [, 230], + 8426: [, 1], + 8427: [, 1], + 8428: [, 220], + 8429: [, 220], + 8430: [, 220], + 8431: [, 220], + 8432: [, 230] + }, + 8448: { + 8448: [[97, 47, 99], 256], + 8449: [[97, 47, 115], 256], + 8450: [[67], 256], + 8451: [[176, 67], 256], + 8453: [[99, 47, 111], 256], + 8454: [[99, 47, 117], 256], + 8455: [[400], 256], + 8457: [[176, 70], 256], + 8458: [[103], 256], + 8459: [[72], 256], + 8460: [[72], 256], + 8461: [[72], 256], + 8462: [[104], 256], + 8463: [[295], 256], + 8464: [[73], 256], + 8465: [[73], 256], + 8466: [[76], 256], + 8467: [[108], 256], + 8469: [[78], 256], + 8470: [[78, 111], 256], + 8473: [[80], 256], + 8474: [[81], 256], + 8475: [[82], 256], + 8476: [[82], 256], + 8477: [[82], 256], + 8480: [[83, 77], 256], + 8481: [[84, 69, 76], 256], + 8482: [[84, 77], 256], + 8484: [[90], 256], + 8486: [[937]], + 8488: [[90], 256], + 8490: [[75]], + 8491: [[197]], + 8492: [[66], 256], + 8493: [[67], 256], + 8495: [[101], 256], + 8496: [[69], 256], + 8497: [[70], 256], + 8499: [[77], 256], + 8500: [[111], 256], + 8501: [[1488], 256], + 8502: [[1489], 256], + 8503: [[1490], 256], + 8504: [[1491], 256], + 8505: [[105], 256], + 8507: [[70, 65, 88], 256], + 8508: [[960], 256], + 8509: [[947], 256], + 8510: [[915], 256], + 8511: [[928], 256], + 8512: [[8721], 256], + 8517: [[68], 256], + 8518: [[100], 256], + 8519: [[101], 256], + 8520: [[105], 256], + 8521: [[106], 256], + 8528: [[49, 8260, 55], 256], + 8529: [[49, 8260, 57], 256], + 8530: [[49, 8260, 49, 48], 256], + 8531: [[49, 8260, 51], 256], + 8532: [[50, 8260, 51], 256], + 8533: [[49, 8260, 53], 256], + 8534: [[50, 8260, 53], 256], + 8535: [[51, 8260, 53], 256], + 8536: [[52, 8260, 53], 256], + 8537: [[49, 8260, 54], 256], + 8538: [[53, 8260, 54], 256], + 8539: [[49, 8260, 56], 256], + 8540: [[51, 8260, 56], 256], + 8541: [[53, 8260, 56], 256], + 8542: [[55, 8260, 56], 256], + 8543: [[49, 8260], 256], + 8544: [[73], 256], + 8545: [[73, 73], 256], + 8546: [[73, 73, 73], 256], + 8547: [[73, 86], 256], + 8548: [[86], 256], + 8549: [[86, 73], 256], + 8550: [[86, 73, 73], 256], + 8551: [[86, 73, 73, 73], 256], + 8552: [[73, 88], 256], + 8553: [[88], 256], + 8554: [[88, 73], 256], + 8555: [[88, 73, 73], 256], + 8556: [[76], 256], + 8557: [[67], 256], + 8558: [[68], 256], + 8559: [[77], 256], + 8560: [[105], 256], + 8561: [[105, 105], 256], + 8562: [[105, 105, 105], 256], + 8563: [[105, 118], 256], + 8564: [[118], 256], + 8565: [[118, 105], 256], + 8566: [[118, 105, 105], 256], + 8567: [[118, 105, 105, 105], 256], + 8568: [[105, 120], 256], + 8569: [[120], 256], + 8570: [[120, 105], 256], + 8571: [[120, 105, 105], 256], + 8572: [[108], 256], + 8573: [[99], 256], + 8574: [[100], 256], + 8575: [[109], 256], + 8585: [[48, 8260, 51], 256], + 8592: [, , { 824: 8602 }], + 8594: [, , { 824: 8603 }], + 8596: [, , { 824: 8622 }], + 8602: [[8592, 824]], + 8603: [[8594, 824]], + 8622: [[8596, 824]], + 8653: [[8656, 824]], + 8654: [[8660, 824]], + 8655: [[8658, 824]], + 8656: [, , { 824: 8653 }], + 8658: [, , { 824: 8655 }], + 8660: [, , { 824: 8654 }] + }, + 8704: { + 8707: [, , { 824: 8708 }], + 8708: [[8707, 824]], + 8712: [, , { 824: 8713 }], + 8713: [[8712, 824]], + 8715: [, , { 824: 8716 }], + 8716: [[8715, 824]], + 8739: [, , { 824: 8740 }], + 8740: [[8739, 824]], + 8741: [, , { 824: 8742 }], + 8742: [[8741, 824]], + 8748: [[8747, 8747], 256], + 8749: [[8747, 8747, 8747], 256], + 8751: [[8750, 8750], 256], + 8752: [[8750, 8750, 8750], 256], + 8764: [, , { 824: 8769 }], + 8769: [[8764, 824]], + 8771: [, , { 824: 8772 }], + 8772: [[8771, 824]], + 8773: [, , { 824: 8775 }], + 8775: [[8773, 824]], + 8776: [, , { 824: 8777 }], + 8777: [[8776, 824]], + 8781: [, , { 824: 8813 }], + 8800: [[61, 824]], + 8801: [, , { 824: 8802 }], + 8802: [[8801, 824]], + 8804: [, , { 824: 8816 }], + 8805: [, , { 824: 8817 }], + 8813: [[8781, 824]], + 8814: [[60, 824]], + 8815: [[62, 824]], + 8816: [[8804, 824]], + 8817: [[8805, 824]], + 8818: [, , { 824: 8820 }], + 8819: [, , { 824: 8821 }], + 8820: [[8818, 824]], + 8821: [[8819, 824]], + 8822: [, , { 824: 8824 }], + 8823: [, , { 824: 8825 }], + 8824: [[8822, 824]], + 8825: [[8823, 824]], + 8826: [, , { 824: 8832 }], + 8827: [, , { 824: 8833 }], + 8828: [, , { 824: 8928 }], + 8829: [, , { 824: 8929 }], + 8832: [[8826, 824]], + 8833: [[8827, 824]], + 8834: [, , { 824: 8836 }], + 8835: [, , { 824: 8837 }], + 8836: [[8834, 824]], + 8837: [[8835, 824]], + 8838: [, , { 824: 8840 }], + 8839: [, , { 824: 8841 }], + 8840: [[8838, 824]], + 8841: [[8839, 824]], + 8849: [, , { 824: 8930 }], + 8850: [, , { 824: 8931 }], + 8866: [, , { 824: 8876 }], + 8872: [, , { 824: 8877 }], + 8873: [, , { 824: 8878 }], + 8875: [, , { 824: 8879 }], + 8876: [[8866, 824]], + 8877: [[8872, 824]], + 8878: [[8873, 824]], + 8879: [[8875, 824]], + 8882: [, , { 824: 8938 }], + 8883: [, , { 824: 8939 }], + 8884: [, , { 824: 8940 }], + 8885: [, , { 824: 8941 }], + 8928: [[8828, 824]], + 8929: [[8829, 824]], + 8930: [[8849, 824]], + 8931: [[8850, 824]], + 8938: [[8882, 824]], + 8939: [[8883, 824]], + 8940: [[8884, 824]], + 8941: [[8885, 824]] + }, + 8960: { 9001: [[12296]], 9002: [[12297]] }, + 9216: { + 9312: [[49], 256], + 9313: [[50], 256], + 9314: [[51], 256], + 9315: [[52], 256], + 9316: [[53], 256], + 9317: [[54], 256], + 9318: [[55], 256], + 9319: [[56], 256], + 9320: [[57], 256], + 9321: [[49, 48], 256], + 9322: [[49, 49], 256], + 9323: [[49, 50], 256], + 9324: [[49, 51], 256], + 9325: [[49, 52], 256], + 9326: [[49, 53], 256], + 9327: [[49, 54], 256], + 9328: [[49, 55], 256], + 9329: [[49, 56], 256], + 9330: [[49, 57], 256], + 9331: [[50, 48], 256], + 9332: [[40, 49, 41], 256], + 9333: [[40, 50, 41], 256], + 9334: [[40, 51, 41], 256], + 9335: [[40, 52, 41], 256], + 9336: [[40, 53, 41], 256], + 9337: [[40, 54, 41], 256], + 9338: [[40, 55, 41], 256], + 9339: [[40, 56, 41], 256], + 9340: [[40, 57, 41], 256], + 9341: [[40, 49, 48, 41], 256], + 9342: [[40, 49, 49, 41], 256], + 9343: [[40, 49, 50, 41], 256], + 9344: [[40, 49, 51, 41], 256], + 9345: [[40, 49, 52, 41], 256], + 9346: [[40, 49, 53, 41], 256], + 9347: [[40, 49, 54, 41], 256], + 9348: [[40, 49, 55, 41], 256], + 9349: [[40, 49, 56, 41], 256], + 9350: [[40, 49, 57, 41], 256], + 9351: [[40, 50, 48, 41], 256], + 9352: [[49, 46], 256], + 9353: [[50, 46], 256], + 9354: [[51, 46], 256], + 9355: [[52, 46], 256], + 9356: [[53, 46], 256], + 9357: [[54, 46], 256], + 9358: [[55, 46], 256], + 9359: [[56, 46], 256], + 9360: [[57, 46], 256], + 9361: [[49, 48, 46], 256], + 9362: [[49, 49, 46], 256], + 9363: [[49, 50, 46], 256], + 9364: [[49, 51, 46], 256], + 9365: [[49, 52, 46], 256], + 9366: [[49, 53, 46], 256], + 9367: [[49, 54, 46], 256], + 9368: [[49, 55, 46], 256], + 9369: [[49, 56, 46], 256], + 9370: [[49, 57, 46], 256], + 9371: [[50, 48, 46], 256], + 9372: [[40, 97, 41], 256], + 9373: [[40, 98, 41], 256], + 9374: [[40, 99, 41], 256], + 9375: [[40, 100, 41], 256], + 9376: [[40, 101, 41], 256], + 9377: [[40, 102, 41], 256], + 9378: [[40, 103, 41], 256], + 9379: [[40, 104, 41], 256], + 9380: [[40, 105, 41], 256], + 9381: [[40, 106, 41], 256], + 9382: [[40, 107, 41], 256], + 9383: [[40, 108, 41], 256], + 9384: [[40, 109, 41], 256], + 9385: [[40, 110, 41], 256], + 9386: [[40, 111, 41], 256], + 9387: [[40, 112, 41], 256], + 9388: [[40, 113, 41], 256], + 9389: [[40, 114, 41], 256], + 9390: [[40, 115, 41], 256], + 9391: [[40, 116, 41], 256], + 9392: [[40, 117, 41], 256], + 9393: [[40, 118, 41], 256], + 9394: [[40, 119, 41], 256], + 9395: [[40, 120, 41], 256], + 9396: [[40, 121, 41], 256], + 9397: [[40, 122, 41], 256], + 9398: [[65], 256], + 9399: [[66], 256], + 9400: [[67], 256], + 9401: [[68], 256], + 9402: [[69], 256], + 9403: [[70], 256], + 9404: [[71], 256], + 9405: [[72], 256], + 9406: [[73], 256], + 9407: [[74], 256], + 9408: [[75], 256], + 9409: [[76], 256], + 9410: [[77], 256], + 9411: [[78], 256], + 9412: [[79], 256], + 9413: [[80], 256], + 9414: [[81], 256], + 9415: [[82], 256], + 9416: [[83], 256], + 9417: [[84], 256], + 9418: [[85], 256], + 9419: [[86], 256], + 9420: [[87], 256], + 9421: [[88], 256], + 9422: [[89], 256], + 9423: [[90], 256], + 9424: [[97], 256], + 9425: [[98], 256], + 9426: [[99], 256], + 9427: [[100], 256], + 9428: [[101], 256], + 9429: [[102], 256], + 9430: [[103], 256], + 9431: [[104], 256], + 9432: [[105], 256], + 9433: [[106], 256], + 9434: [[107], 256], + 9435: [[108], 256], + 9436: [[109], 256], + 9437: [[110], 256], + 9438: [[111], 256], + 9439: [[112], 256], + 9440: [[113], 256], + 9441: [[114], 256], + 9442: [[115], 256], + 9443: [[116], 256], + 9444: [[117], 256], + 9445: [[118], 256], + 9446: [[119], 256], + 9447: [[120], 256], + 9448: [[121], 256], + 9449: [[122], 256], + 9450: [[48], 256] + }, + 10752: { + 10764: [[8747, 8747, 8747, 8747], 256], + 10868: [[58, 58, 61], 256], + 10869: [[61, 61], 256], + 10870: [[61, 61, 61], 256], + 10972: [[10973, 824], 512] + }, + 11264: { + 11388: [[106], 256], + 11389: [[86], 256], + 11503: [, 230], + 11504: [, 230], + 11505: [, 230] + }, + 11520: { + 11631: [[11617], 256], + 11647: [, 9], + 11744: [, 230], + 11745: [, 230], + 11746: [, 230], + 11747: [, 230], + 11748: [, 230], + 11749: [, 230], + 11750: [, 230], + 11751: [, 230], + 11752: [, 230], + 11753: [, 230], + 11754: [, 230], + 11755: [, 230], + 11756: [, 230], + 11757: [, 230], + 11758: [, 230], + 11759: [, 230], + 11760: [, 230], + 11761: [, 230], + 11762: [, 230], + 11763: [, 230], + 11764: [, 230], + 11765: [, 230], + 11766: [, 230], + 11767: [, 230], + 11768: [, 230], + 11769: [, 230], + 11770: [, 230], + 11771: [, 230], + 11772: [, 230], + 11773: [, 230], + 11774: [, 230], + 11775: [, 230] + }, + 11776: { 11935: [[27597], 256], 12019: [[40863], 256] }, + 12032: { + 12032: [[19968], 256], + 12033: [[20008], 256], + 12034: [[20022], 256], + 12035: [[20031], 256], + 12036: [[20057], 256], + 12037: [[20101], 256], + 12038: [[20108], 256], + 12039: [[20128], 256], + 12040: [[20154], 256], + 12041: [[20799], 256], + 12042: [[20837], 256], + 12043: [[20843], 256], + 12044: [[20866], 256], + 12045: [[20886], 256], + 12046: [[20907], 256], + 12047: [[20960], 256], + 12048: [[20981], 256], + 12049: [[20992], 256], + 12050: [[21147], 256], + 12051: [[21241], 256], + 12052: [[21269], 256], + 12053: [[21274], 256], + 12054: [[21304], 256], + 12055: [[21313], 256], + 12056: [[21340], 256], + 12057: [[21353], 256], + 12058: [[21378], 256], + 12059: [[21430], 256], + 12060: [[21448], 256], + 12061: [[21475], 256], + 12062: [[22231], 256], + 12063: [[22303], 256], + 12064: [[22763], 256], + 12065: [[22786], 256], + 12066: [[22794], 256], + 12067: [[22805], 256], + 12068: [[22823], 256], + 12069: [[22899], 256], + 12070: [[23376], 256], + 12071: [[23424], 256], + 12072: [[23544], 256], + 12073: [[23567], 256], + 12074: [[23586], 256], + 12075: [[23608], 256], + 12076: [[23662], 256], + 12077: [[23665], 256], + 12078: [[24027], 256], + 12079: [[24037], 256], + 12080: [[24049], 256], + 12081: [[24062], 256], + 12082: [[24178], 256], + 12083: [[24186], 256], + 12084: [[24191], 256], + 12085: [[24308], 256], + 12086: [[24318], 256], + 12087: [[24331], 256], + 12088: [[24339], 256], + 12089: [[24400], 256], + 12090: [[24417], 256], + 12091: [[24435], 256], + 12092: [[24515], 256], + 12093: [[25096], 256], + 12094: [[25142], 256], + 12095: [[25163], 256], + 12096: [[25903], 256], + 12097: [[25908], 256], + 12098: [[25991], 256], + 12099: [[26007], 256], + 12100: [[26020], 256], + 12101: [[26041], 256], + 12102: [[26080], 256], + 12103: [[26085], 256], + 12104: [[26352], 256], + 12105: [[26376], 256], + 12106: [[26408], 256], + 12107: [[27424], 256], + 12108: [[27490], 256], + 12109: [[27513], 256], + 12110: [[27571], 256], + 12111: [[27595], 256], + 12112: [[27604], 256], + 12113: [[27611], 256], + 12114: [[27663], 256], + 12115: [[27668], 256], + 12116: [[27700], 256], + 12117: [[28779], 256], + 12118: [[29226], 256], + 12119: [[29238], 256], + 12120: [[29243], 256], + 12121: [[29247], 256], + 12122: [[29255], 256], + 12123: [[29273], 256], + 12124: [[29275], 256], + 12125: [[29356], 256], + 12126: [[29572], 256], + 12127: [[29577], 256], + 12128: [[29916], 256], + 12129: [[29926], 256], + 12130: [[29976], 256], + 12131: [[29983], 256], + 12132: [[29992], 256], + 12133: [[30000], 256], + 12134: [[30091], 256], + 12135: [[30098], 256], + 12136: [[30326], 256], + 12137: [[30333], 256], + 12138: [[30382], 256], + 12139: [[30399], 256], + 12140: [[30446], 256], + 12141: [[30683], 256], + 12142: [[30690], 256], + 12143: [[30707], 256], + 12144: [[31034], 256], + 12145: [[31160], 256], + 12146: [[31166], 256], + 12147: [[31348], 256], + 12148: [[31435], 256], + 12149: [[31481], 256], + 12150: [[31859], 256], + 12151: [[31992], 256], + 12152: [[32566], 256], + 12153: [[32593], 256], + 12154: [[32650], 256], + 12155: [[32701], 256], + 12156: [[32769], 256], + 12157: [[32780], 256], + 12158: [[32786], 256], + 12159: [[32819], 256], + 12160: [[32895], 256], + 12161: [[32905], 256], + 12162: [[33251], 256], + 12163: [[33258], 256], + 12164: [[33267], 256], + 12165: [[33276], 256], + 12166: [[33292], 256], + 12167: [[33307], 256], + 12168: [[33311], 256], + 12169: [[33390], 256], + 12170: [[33394], 256], + 12171: [[33400], 256], + 12172: [[34381], 256], + 12173: [[34411], 256], + 12174: [[34880], 256], + 12175: [[34892], 256], + 12176: [[34915], 256], + 12177: [[35198], 256], + 12178: [[35211], 256], + 12179: [[35282], 256], + 12180: [[35328], 256], + 12181: [[35895], 256], + 12182: [[35910], 256], + 12183: [[35925], 256], + 12184: [[35960], 256], + 12185: [[35997], 256], + 12186: [[36196], 256], + 12187: [[36208], 256], + 12188: [[36275], 256], + 12189: [[36523], 256], + 12190: [[36554], 256], + 12191: [[36763], 256], + 12192: [[36784], 256], + 12193: [[36789], 256], + 12194: [[37009], 256], + 12195: [[37193], 256], + 12196: [[37318], 256], + 12197: [[37324], 256], + 12198: [[37329], 256], + 12199: [[38263], 256], + 12200: [[38272], 256], + 12201: [[38428], 256], + 12202: [[38582], 256], + 12203: [[38585], 256], + 12204: [[38632], 256], + 12205: [[38737], 256], + 12206: [[38750], 256], + 12207: [[38754], 256], + 12208: [[38761], 256], + 12209: [[38859], 256], + 12210: [[38893], 256], + 12211: [[38899], 256], + 12212: [[38913], 256], + 12213: [[39080], 256], + 12214: [[39131], 256], + 12215: [[39135], 256], + 12216: [[39318], 256], + 12217: [[39321], 256], + 12218: [[39340], 256], + 12219: [[39592], 256], + 12220: [[39640], 256], + 12221: [[39647], 256], + 12222: [[39717], 256], + 12223: [[39727], 256], + 12224: [[39730], 256], + 12225: [[39740], 256], + 12226: [[39770], 256], + 12227: [[40165], 256], + 12228: [[40565], 256], + 12229: [[40575], 256], + 12230: [[40613], 256], + 12231: [[40635], 256], + 12232: [[40643], 256], + 12233: [[40653], 256], + 12234: [[40657], 256], + 12235: [[40697], 256], + 12236: [[40701], 256], + 12237: [[40718], 256], + 12238: [[40723], 256], + 12239: [[40736], 256], + 12240: [[40763], 256], + 12241: [[40778], 256], + 12242: [[40786], 256], + 12243: [[40845], 256], + 12244: [[40860], 256], + 12245: [[40864], 256] + }, + 12288: { + 12288: [[32], 256], + 12330: [, 218], + 12331: [, 228], + 12332: [, 232], + 12333: [, 222], + 12334: [, 224], + 12335: [, 224], + 12342: [[12306], 256], + 12344: [[21313], 256], + 12345: [[21316], 256], + 12346: [[21317], 256], + 12358: [, , { 12441: 12436 }], + 12363: [, , { 12441: 12364 }], + 12364: [[12363, 12441]], + 12365: [, , { 12441: 12366 }], + 12366: [[12365, 12441]], + 12367: [, , { 12441: 12368 }], + 12368: [[12367, 12441]], + 12369: [, , { 12441: 12370 }], + 12370: [[12369, 12441]], + 12371: [, , { 12441: 12372 }], + 12372: [[12371, 12441]], + 12373: [, , { 12441: 12374 }], + 12374: [[12373, 12441]], + 12375: [, , { 12441: 12376 }], + 12376: [[12375, 12441]], + 12377: [, , { 12441: 12378 }], + 12378: [[12377, 12441]], + 12379: [, , { 12441: 12380 }], + 12380: [[12379, 12441]], + 12381: [, , { 12441: 12382 }], + 12382: [[12381, 12441]], + 12383: [, , { 12441: 12384 }], + 12384: [[12383, 12441]], + 12385: [, , { 12441: 12386 }], + 12386: [[12385, 12441]], + 12388: [, , { 12441: 12389 }], + 12389: [[12388, 12441]], + 12390: [, , { 12441: 12391 }], + 12391: [[12390, 12441]], + 12392: [, , { 12441: 12393 }], + 12393: [[12392, 12441]], + 12399: [, , { 12441: 12400, 12442: 12401 }], + 12400: [[12399, 12441]], + 12401: [[12399, 12442]], + 12402: [, , { 12441: 12403, 12442: 12404 }], + 12403: [[12402, 12441]], + 12404: [[12402, 12442]], + 12405: [, , { 12441: 12406, 12442: 12407 }], + 12406: [[12405, 12441]], + 12407: [[12405, 12442]], + 12408: [, , { 12441: 12409, 12442: 12410 }], + 12409: [[12408, 12441]], + 12410: [[12408, 12442]], + 12411: [, , { 12441: 12412, 12442: 12413 }], + 12412: [[12411, 12441]], + 12413: [[12411, 12442]], + 12436: [[12358, 12441]], + 12441: [, 8], + 12442: [, 8], + 12443: [[32, 12441], 256], + 12444: [[32, 12442], 256], + 12445: [, , { 12441: 12446 }], + 12446: [[12445, 12441]], + 12447: [[12424, 12426], 256], + 12454: [, , { 12441: 12532 }], + 12459: [, , { 12441: 12460 }], + 12460: [[12459, 12441]], + 12461: [, , { 12441: 12462 }], + 12462: [[12461, 12441]], + 12463: [, , { 12441: 12464 }], + 12464: [[12463, 12441]], + 12465: [, , { 12441: 12466 }], + 12466: [[12465, 12441]], + 12467: [, , { 12441: 12468 }], + 12468: [[12467, 12441]], + 12469: [, , { 12441: 12470 }], + 12470: [[12469, 12441]], + 12471: [, , { 12441: 12472 }], + 12472: [[12471, 12441]], + 12473: [, , { 12441: 12474 }], + 12474: [[12473, 12441]], + 12475: [, , { 12441: 12476 }], + 12476: [[12475, 12441]], + 12477: [, , { 12441: 12478 }], + 12478: [[12477, 12441]], + 12479: [, , { 12441: 12480 }], + 12480: [[12479, 12441]], + 12481: [, , { 12441: 12482 }], + 12482: [[12481, 12441]], + 12484: [, , { 12441: 12485 }], + 12485: [[12484, 12441]], + 12486: [, , { 12441: 12487 }], + 12487: [[12486, 12441]], + 12488: [, , { 12441: 12489 }], + 12489: [[12488, 12441]], + 12495: [, , { 12441: 12496, 12442: 12497 }], + 12496: [[12495, 12441]], + 12497: [[12495, 12442]], + 12498: [, , { 12441: 12499, 12442: 12500 }], + 12499: [[12498, 12441]], + 12500: [[12498, 12442]], + 12501: [, , { 12441: 12502, 12442: 12503 }], + 12502: [[12501, 12441]], + 12503: [[12501, 12442]], + 12504: [, , { 12441: 12505, 12442: 12506 }], + 12505: [[12504, 12441]], + 12506: [[12504, 12442]], + 12507: [, , { 12441: 12508, 12442: 12509 }], + 12508: [[12507, 12441]], + 12509: [[12507, 12442]], + 12527: [, , { 12441: 12535 }], + 12528: [, , { 12441: 12536 }], + 12529: [, , { 12441: 12537 }], + 12530: [, , { 12441: 12538 }], + 12532: [[12454, 12441]], + 12535: [[12527, 12441]], + 12536: [[12528, 12441]], + 12537: [[12529, 12441]], + 12538: [[12530, 12441]], + 12541: [, , { 12441: 12542 }], + 12542: [[12541, 12441]], + 12543: [[12467, 12488], 256] + }, + 12544: { + 12593: [[4352], 256], + 12594: [[4353], 256], + 12595: [[4522], 256], + 12596: [[4354], 256], + 12597: [[4524], 256], + 12598: [[4525], 256], + 12599: [[4355], 256], + 12600: [[4356], 256], + 12601: [[4357], 256], + 12602: [[4528], 256], + 12603: [[4529], 256], + 12604: [[4530], 256], + 12605: [[4531], 256], + 12606: [[4532], 256], + 12607: [[4533], 256], + 12608: [[4378], 256], + 12609: [[4358], 256], + 12610: [[4359], 256], + 12611: [[4360], 256], + 12612: [[4385], 256], + 12613: [[4361], 256], + 12614: [[4362], 256], + 12615: [[4363], 256], + 12616: [[4364], 256], + 12617: [[4365], 256], + 12618: [[4366], 256], + 12619: [[4367], 256], + 12620: [[4368], 256], + 12621: [[4369], 256], + 12622: [[4370], 256], + 12623: [[4449], 256], + 12624: [[4450], 256], + 12625: [[4451], 256], + 12626: [[4452], 256], + 12627: [[4453], 256], + 12628: [[4454], 256], + 12629: [[4455], 256], + 12630: [[4456], 256], + 12631: [[4457], 256], + 12632: [[4458], 256], + 12633: [[4459], 256], + 12634: [[4460], 256], + 12635: [[4461], 256], + 12636: [[4462], 256], + 12637: [[4463], 256], + 12638: [[4464], 256], + 12639: [[4465], 256], + 12640: [[4466], 256], + 12641: [[4467], 256], + 12642: [[4468], 256], + 12643: [[4469], 256], + 12644: [[4448], 256], + 12645: [[4372], 256], + 12646: [[4373], 256], + 12647: [[4551], 256], + 12648: [[4552], 256], + 12649: [[4556], 256], + 12650: [[4558], 256], + 12651: [[4563], 256], + 12652: [[4567], 256], + 12653: [[4569], 256], + 12654: [[4380], 256], + 12655: [[4573], 256], + 12656: [[4575], 256], + 12657: [[4381], 256], + 12658: [[4382], 256], + 12659: [[4384], 256], + 12660: [[4386], 256], + 12661: [[4387], 256], + 12662: [[4391], 256], + 12663: [[4393], 256], + 12664: [[4395], 256], + 12665: [[4396], 256], + 12666: [[4397], 256], + 12667: [[4398], 256], + 12668: [[4399], 256], + 12669: [[4402], 256], + 12670: [[4406], 256], + 12671: [[4416], 256], + 12672: [[4423], 256], + 12673: [[4428], 256], + 12674: [[4593], 256], + 12675: [[4594], 256], + 12676: [[4439], 256], + 12677: [[4440], 256], + 12678: [[4441], 256], + 12679: [[4484], 256], + 12680: [[4485], 256], + 12681: [[4488], 256], + 12682: [[4497], 256], + 12683: [[4498], 256], + 12684: [[4500], 256], + 12685: [[4510], 256], + 12686: [[4513], 256], + 12690: [[19968], 256], + 12691: [[20108], 256], + 12692: [[19977], 256], + 12693: [[22235], 256], + 12694: [[19978], 256], + 12695: [[20013], 256], + 12696: [[19979], 256], + 12697: [[30002], 256], + 12698: [[20057], 256], + 12699: [[19993], 256], + 12700: [[19969], 256], + 12701: [[22825], 256], + 12702: [[22320], 256], + 12703: [[20154], 256] + }, + 12800: { + 12800: [[40, 4352, 41], 256], + 12801: [[40, 4354, 41], 256], + 12802: [[40, 4355, 41], 256], + 12803: [[40, 4357, 41], 256], + 12804: [[40, 4358, 41], 256], + 12805: [[40, 4359, 41], 256], + 12806: [[40, 4361, 41], 256], + 12807: [[40, 4363, 41], 256], + 12808: [[40, 4364, 41], 256], + 12809: [[40, 4366, 41], 256], + 12810: [[40, 4367, 41], 256], + 12811: [[40, 4368, 41], 256], + 12812: [[40, 4369, 41], 256], + 12813: [[40, 4370, 41], 256], + 12814: [[40, 4352, 4449, 41], 256], + 12815: [[40, 4354, 4449, 41], 256], + 12816: [[40, 4355, 4449, 41], 256], + 12817: [[40, 4357, 4449, 41], 256], + 12818: [[40, 4358, 4449, 41], 256], + 12819: [[40, 4359, 4449, 41], 256], + 12820: [[40, 4361, 4449, 41], 256], + 12821: [[40, 4363, 4449, 41], 256], + 12822: [[40, 4364, 4449, 41], 256], + 12823: [[40, 4366, 4449, 41], 256], + 12824: [[40, 4367, 4449, 41], 256], + 12825: [[40, 4368, 4449, 41], 256], + 12826: [[40, 4369, 4449, 41], 256], + 12827: [[40, 4370, 4449, 41], 256], + 12828: [[40, 4364, 4462, 41], 256], + 12829: [[40, 4363, 4457, 4364, 4453, 4523, 41], 256], + 12830: [[40, 4363, 4457, 4370, 4462, 41], 256], + 12832: [[40, 19968, 41], 256], + 12833: [[40, 20108, 41], 256], + 12834: [[40, 19977, 41], 256], + 12835: [[40, 22235, 41], 256], + 12836: [[40, 20116, 41], 256], + 12837: [[40, 20845, 41], 256], + 12838: [[40, 19971, 41], 256], + 12839: [[40, 20843, 41], 256], + 12840: [[40, 20061, 41], 256], + 12841: [[40, 21313, 41], 256], + 12842: [[40, 26376, 41], 256], + 12843: [[40, 28779, 41], 256], + 12844: [[40, 27700, 41], 256], + 12845: [[40, 26408, 41], 256], + 12846: [[40, 37329, 41], 256], + 12847: [[40, 22303, 41], 256], + 12848: [[40, 26085, 41], 256], + 12849: [[40, 26666, 41], 256], + 12850: [[40, 26377, 41], 256], + 12851: [[40, 31038, 41], 256], + 12852: [[40, 21517, 41], 256], + 12853: [[40, 29305, 41], 256], + 12854: [[40, 36001, 41], 256], + 12855: [[40, 31069, 41], 256], + 12856: [[40, 21172, 41], 256], + 12857: [[40, 20195, 41], 256], + 12858: [[40, 21628, 41], 256], + 12859: [[40, 23398, 41], 256], + 12860: [[40, 30435, 41], 256], + 12861: [[40, 20225, 41], 256], + 12862: [[40, 36039, 41], 256], + 12863: [[40, 21332, 41], 256], + 12864: [[40, 31085, 41], 256], + 12865: [[40, 20241, 41], 256], + 12866: [[40, 33258, 41], 256], + 12867: [[40, 33267, 41], 256], + 12868: [[21839], 256], + 12869: [[24188], 256], + 12870: [[25991], 256], + 12871: [[31631], 256], + 12880: [[80, 84, 69], 256], + 12881: [[50, 49], 256], + 12882: [[50, 50], 256], + 12883: [[50, 51], 256], + 12884: [[50, 52], 256], + 12885: [[50, 53], 256], + 12886: [[50, 54], 256], + 12887: [[50, 55], 256], + 12888: [[50, 56], 256], + 12889: [[50, 57], 256], + 12890: [[51, 48], 256], + 12891: [[51, 49], 256], + 12892: [[51, 50], 256], + 12893: [[51, 51], 256], + 12894: [[51, 52], 256], + 12895: [[51, 53], 256], + 12896: [[4352], 256], + 12897: [[4354], 256], + 12898: [[4355], 256], + 12899: [[4357], 256], + 12900: [[4358], 256], + 12901: [[4359], 256], + 12902: [[4361], 256], + 12903: [[4363], 256], + 12904: [[4364], 256], + 12905: [[4366], 256], + 12906: [[4367], 256], + 12907: [[4368], 256], + 12908: [[4369], 256], + 12909: [[4370], 256], + 12910: [[4352, 4449], 256], + 12911: [[4354, 4449], 256], + 12912: [[4355, 4449], 256], + 12913: [[4357, 4449], 256], + 12914: [[4358, 4449], 256], + 12915: [[4359, 4449], 256], + 12916: [[4361, 4449], 256], + 12917: [[4363, 4449], 256], + 12918: [[4364, 4449], 256], + 12919: [[4366, 4449], 256], + 12920: [[4367, 4449], 256], + 12921: [[4368, 4449], 256], + 12922: [[4369, 4449], 256], + 12923: [[4370, 4449], 256], + 12924: [[4366, 4449, 4535, 4352, 4457], 256], + 12925: [[4364, 4462, 4363, 4468], 256], + 12926: [[4363, 4462], 256], + 12928: [[19968], 256], + 12929: [[20108], 256], + 12930: [[19977], 256], + 12931: [[22235], 256], + 12932: [[20116], 256], + 12933: [[20845], 256], + 12934: [[19971], 256], + 12935: [[20843], 256], + 12936: [[20061], 256], + 12937: [[21313], 256], + 12938: [[26376], 256], + 12939: [[28779], 256], + 12940: [[27700], 256], + 12941: [[26408], 256], + 12942: [[37329], 256], + 12943: [[22303], 256], + 12944: [[26085], 256], + 12945: [[26666], 256], + 12946: [[26377], 256], + 12947: [[31038], 256], + 12948: [[21517], 256], + 12949: [[29305], 256], + 12950: [[36001], 256], + 12951: [[31069], 256], + 12952: [[21172], 256], + 12953: [[31192], 256], + 12954: [[30007], 256], + 12955: [[22899], 256], + 12956: [[36969], 256], + 12957: [[20778], 256], + 12958: [[21360], 256], + 12959: [[27880], 256], + 12960: [[38917], 256], + 12961: [[20241], 256], + 12962: [[20889], 256], + 12963: [[27491], 256], + 12964: [[19978], 256], + 12965: [[20013], 256], + 12966: [[19979], 256], + 12967: [[24038], 256], + 12968: [[21491], 256], + 12969: [[21307], 256], + 12970: [[23447], 256], + 12971: [[23398], 256], + 12972: [[30435], 256], + 12973: [[20225], 256], + 12974: [[36039], 256], + 12975: [[21332], 256], + 12976: [[22812], 256], + 12977: [[51, 54], 256], + 12978: [[51, 55], 256], + 12979: [[51, 56], 256], + 12980: [[51, 57], 256], + 12981: [[52, 48], 256], + 12982: [[52, 49], 256], + 12983: [[52, 50], 256], + 12984: [[52, 51], 256], + 12985: [[52, 52], 256], + 12986: [[52, 53], 256], + 12987: [[52, 54], 256], + 12988: [[52, 55], 256], + 12989: [[52, 56], 256], + 12990: [[52, 57], 256], + 12991: [[53, 48], 256], + 12992: [[49, 26376], 256], + 12993: [[50, 26376], 256], + 12994: [[51, 26376], 256], + 12995: [[52, 26376], 256], + 12996: [[53, 26376], 256], + 12997: [[54, 26376], 256], + 12998: [[55, 26376], 256], + 12999: [[56, 26376], 256], + 13000: [[57, 26376], 256], + 13001: [[49, 48, 26376], 256], + 13002: [[49, 49, 26376], 256], + 13003: [[49, 50, 26376], 256], + 13004: [[72, 103], 256], + 13005: [[101, 114, 103], 256], + 13006: [[101, 86], 256], + 13007: [[76, 84, 68], 256], + 13008: [[12450], 256], + 13009: [[12452], 256], + 13010: [[12454], 256], + 13011: [[12456], 256], + 13012: [[12458], 256], + 13013: [[12459], 256], + 13014: [[12461], 256], + 13015: [[12463], 256], + 13016: [[12465], 256], + 13017: [[12467], 256], + 13018: [[12469], 256], + 13019: [[12471], 256], + 13020: [[12473], 256], + 13021: [[12475], 256], + 13022: [[12477], 256], + 13023: [[12479], 256], + 13024: [[12481], 256], + 13025: [[12484], 256], + 13026: [[12486], 256], + 13027: [[12488], 256], + 13028: [[12490], 256], + 13029: [[12491], 256], + 13030: [[12492], 256], + 13031: [[12493], 256], + 13032: [[12494], 256], + 13033: [[12495], 256], + 13034: [[12498], 256], + 13035: [[12501], 256], + 13036: [[12504], 256], + 13037: [[12507], 256], + 13038: [[12510], 256], + 13039: [[12511], 256], + 13040: [[12512], 256], + 13041: [[12513], 256], + 13042: [[12514], 256], + 13043: [[12516], 256], + 13044: [[12518], 256], + 13045: [[12520], 256], + 13046: [[12521], 256], + 13047: [[12522], 256], + 13048: [[12523], 256], + 13049: [[12524], 256], + 13050: [[12525], 256], + 13051: [[12527], 256], + 13052: [[12528], 256], + 13053: [[12529], 256], + 13054: [[12530], 256] + }, + 13056: { + 13056: [[12450, 12497, 12540, 12488], 256], + 13057: [[12450, 12523, 12501, 12449], 256], + 13058: [[12450, 12531, 12506, 12450], 256], + 13059: [[12450, 12540, 12523], 256], + 13060: [[12452, 12491, 12531, 12464], 256], + 13061: [[12452, 12531, 12481], 256], + 13062: [[12454, 12457, 12531], 256], + 13063: [[12456, 12473, 12463, 12540, 12489], 256], + 13064: [[12456, 12540, 12459, 12540], 256], + 13065: [[12458, 12531, 12473], 256], + 13066: [[12458, 12540, 12512], 256], + 13067: [[12459, 12452, 12522], 256], + 13068: [[12459, 12521, 12483, 12488], 256], + 13069: [[12459, 12525, 12522, 12540], 256], + 13070: [[12460, 12525, 12531], 256], + 13071: [[12460, 12531, 12510], 256], + 13072: [[12462, 12460], 256], + 13073: [[12462, 12491, 12540], 256], + 13074: [[12461, 12517, 12522, 12540], 256], + 13075: [[12462, 12523, 12480, 12540], 256], + 13076: [[12461, 12525], 256], + 13077: [[12461, 12525, 12464, 12521, 12512], 256], + 13078: [[12461, 12525, 12513, 12540, 12488, 12523], 256], + 13079: [[12461, 12525, 12527, 12483, 12488], 256], + 13080: [[12464, 12521, 12512], 256], + 13081: [[12464, 12521, 12512, 12488, 12531], 256], + 13082: [[12463, 12523, 12476, 12452, 12525], 256], + 13083: [[12463, 12525, 12540, 12493], 256], + 13084: [[12465, 12540, 12473], 256], + 13085: [[12467, 12523, 12490], 256], + 13086: [[12467, 12540, 12509], 256], + 13087: [[12469, 12452, 12463, 12523], 256], + 13088: [[12469, 12531, 12481, 12540, 12512], 256], + 13089: [[12471, 12522, 12531, 12464], 256], + 13090: [[12475, 12531, 12481], 256], + 13091: [[12475, 12531, 12488], 256], + 13092: [[12480, 12540, 12473], 256], + 13093: [[12487, 12471], 256], + 13094: [[12489, 12523], 256], + 13095: [[12488, 12531], 256], + 13096: [[12490, 12494], 256], + 13097: [[12494, 12483, 12488], 256], + 13098: [[12495, 12452, 12484], 256], + 13099: [[12497, 12540, 12475, 12531, 12488], 256], + 13100: [[12497, 12540, 12484], 256], + 13101: [[12496, 12540, 12524, 12523], 256], + 13102: [[12500, 12450, 12473, 12488, 12523], 256], + 13103: [[12500, 12463, 12523], 256], + 13104: [[12500, 12467], 256], + 13105: [[12499, 12523], 256], + 13106: [[12501, 12449, 12521, 12483, 12489], 256], + 13107: [[12501, 12451, 12540, 12488], 256], + 13108: [[12502, 12483, 12471, 12455, 12523], 256], + 13109: [[12501, 12521, 12531], 256], + 13110: [[12504, 12463, 12479, 12540, 12523], 256], + 13111: [[12506, 12477], 256], + 13112: [[12506, 12491, 12498], 256], + 13113: [[12504, 12523, 12484], 256], + 13114: [[12506, 12531, 12473], 256], + 13115: [[12506, 12540, 12472], 256], + 13116: [[12505, 12540, 12479], 256], + 13117: [[12509, 12452, 12531, 12488], 256], + 13118: [[12508, 12523, 12488], 256], + 13119: [[12507, 12531], 256], + 13120: [[12509, 12531, 12489], 256], + 13121: [[12507, 12540, 12523], 256], + 13122: [[12507, 12540, 12531], 256], + 13123: [[12510, 12452, 12463, 12525], 256], + 13124: [[12510, 12452, 12523], 256], + 13125: [[12510, 12483, 12495], 256], + 13126: [[12510, 12523, 12463], 256], + 13127: [[12510, 12531, 12471, 12519, 12531], 256], + 13128: [[12511, 12463, 12525, 12531], 256], + 13129: [[12511, 12522], 256], + 13130: [[12511, 12522, 12496, 12540, 12523], 256], + 13131: [[12513, 12460], 256], + 13132: [[12513, 12460, 12488, 12531], 256], + 13133: [[12513, 12540, 12488, 12523], 256], + 13134: [[12516, 12540, 12489], 256], + 13135: [[12516, 12540, 12523], 256], + 13136: [[12518, 12450, 12531], 256], + 13137: [[12522, 12483, 12488, 12523], 256], + 13138: [[12522, 12521], 256], + 13139: [[12523, 12500, 12540], 256], + 13140: [[12523, 12540, 12502, 12523], 256], + 13141: [[12524, 12512], 256], + 13142: [[12524, 12531, 12488, 12466, 12531], 256], + 13143: [[12527, 12483, 12488], 256], + 13144: [[48, 28857], 256], + 13145: [[49, 28857], 256], + 13146: [[50, 28857], 256], + 13147: [[51, 28857], 256], + 13148: [[52, 28857], 256], + 13149: [[53, 28857], 256], + 13150: [[54, 28857], 256], + 13151: [[55, 28857], 256], + 13152: [[56, 28857], 256], + 13153: [[57, 28857], 256], + 13154: [[49, 48, 28857], 256], + 13155: [[49, 49, 28857], 256], + 13156: [[49, 50, 28857], 256], + 13157: [[49, 51, 28857], 256], + 13158: [[49, 52, 28857], 256], + 13159: [[49, 53, 28857], 256], + 13160: [[49, 54, 28857], 256], + 13161: [[49, 55, 28857], 256], + 13162: [[49, 56, 28857], 256], + 13163: [[49, 57, 28857], 256], + 13164: [[50, 48, 28857], 256], + 13165: [[50, 49, 28857], 256], + 13166: [[50, 50, 28857], 256], + 13167: [[50, 51, 28857], 256], + 13168: [[50, 52, 28857], 256], + 13169: [[104, 80, 97], 256], + 13170: [[100, 97], 256], + 13171: [[65, 85], 256], + 13172: [[98, 97, 114], 256], + 13173: [[111, 86], 256], + 13174: [[112, 99], 256], + 13175: [[100, 109], 256], + 13176: [[100, 109, 178], 256], + 13177: [[100, 109, 179], 256], + 13178: [[73, 85], 256], + 13179: [[24179, 25104], 256], + 13180: [[26157, 21644], 256], + 13181: [[22823, 27491], 256], + 13182: [[26126, 27835], 256], + 13183: [[26666, 24335, 20250, 31038], 256], + 13184: [[112, 65], 256], + 13185: [[110, 65], 256], + 13186: [[956, 65], 256], + 13187: [[109, 65], 256], + 13188: [[107, 65], 256], + 13189: [[75, 66], 256], + 13190: [[77, 66], 256], + 13191: [[71, 66], 256], + 13192: [[99, 97, 108], 256], + 13193: [[107, 99, 97, 108], 256], + 13194: [[112, 70], 256], + 13195: [[110, 70], 256], + 13196: [[956, 70], 256], + 13197: [[956, 103], 256], + 13198: [[109, 103], 256], + 13199: [[107, 103], 256], + 13200: [[72, 122], 256], + 13201: [[107, 72, 122], 256], + 13202: [[77, 72, 122], 256], + 13203: [[71, 72, 122], 256], + 13204: [[84, 72, 122], 256], + 13205: [[956, 8467], 256], + 13206: [[109, 8467], 256], + 13207: [[100, 8467], 256], + 13208: [[107, 8467], 256], + 13209: [[102, 109], 256], + 13210: [[110, 109], 256], + 13211: [[956, 109], 256], + 13212: [[109, 109], 256], + 13213: [[99, 109], 256], + 13214: [[107, 109], 256], + 13215: [[109, 109, 178], 256], + 13216: [[99, 109, 178], 256], + 13217: [[109, 178], 256], + 13218: [[107, 109, 178], 256], + 13219: [[109, 109, 179], 256], + 13220: [[99, 109, 179], 256], + 13221: [[109, 179], 256], + 13222: [[107, 109, 179], 256], + 13223: [[109, 8725, 115], 256], + 13224: [[109, 8725, 115, 178], 256], + 13225: [[80, 97], 256], + 13226: [[107, 80, 97], 256], + 13227: [[77, 80, 97], 256], + 13228: [[71, 80, 97], 256], + 13229: [[114, 97, 100], 256], + 13230: [[114, 97, 100, 8725, 115], 256], + 13231: [[114, 97, 100, 8725, 115, 178], 256], + 13232: [[112, 115], 256], + 13233: [[110, 115], 256], + 13234: [[956, 115], 256], + 13235: [[109, 115], 256], + 13236: [[112, 86], 256], + 13237: [[110, 86], 256], + 13238: [[956, 86], 256], + 13239: [[109, 86], 256], + 13240: [[107, 86], 256], + 13241: [[77, 86], 256], + 13242: [[112, 87], 256], + 13243: [[110, 87], 256], + 13244: [[956, 87], 256], + 13245: [[109, 87], 256], + 13246: [[107, 87], 256], + 13247: [[77, 87], 256], + 13248: [[107, 937], 256], + 13249: [[77, 937], 256], + 13250: [[97, 46, 109, 46], 256], + 13251: [[66, 113], 256], + 13252: [[99, 99], 256], + 13253: [[99, 100], 256], + 13254: [[67, 8725, 107, 103], 256], + 13255: [[67, 111, 46], 256], + 13256: [[100, 66], 256], + 13257: [[71, 121], 256], + 13258: [[104, 97], 256], + 13259: [[72, 80], 256], + 13260: [[105, 110], 256], + 13261: [[75, 75], 256], + 13262: [[75, 77], 256], + 13263: [[107, 116], 256], + 13264: [[108, 109], 256], + 13265: [[108, 110], 256], + 13266: [[108, 111, 103], 256], + 13267: [[108, 120], 256], + 13268: [[109, 98], 256], + 13269: [[109, 105, 108], 256], + 13270: [[109, 111, 108], 256], + 13271: [[80, 72], 256], + 13272: [[112, 46, 109, 46], 256], + 13273: [[80, 80, 77], 256], + 13274: [[80, 82], 256], + 13275: [[115, 114], 256], + 13276: [[83, 118], 256], + 13277: [[87, 98], 256], + 13278: [[86, 8725, 109], 256], + 13279: [[65, 8725, 109], 256], + 13280: [[49, 26085], 256], + 13281: [[50, 26085], 256], + 13282: [[51, 26085], 256], + 13283: [[52, 26085], 256], + 13284: [[53, 26085], 256], + 13285: [[54, 26085], 256], + 13286: [[55, 26085], 256], + 13287: [[56, 26085], 256], + 13288: [[57, 26085], 256], + 13289: [[49, 48, 26085], 256], + 13290: [[49, 49, 26085], 256], + 13291: [[49, 50, 26085], 256], + 13292: [[49, 51, 26085], 256], + 13293: [[49, 52, 26085], 256], + 13294: [[49, 53, 26085], 256], + 13295: [[49, 54, 26085], 256], + 13296: [[49, 55, 26085], 256], + 13297: [[49, 56, 26085], 256], + 13298: [[49, 57, 26085], 256], + 13299: [[50, 48, 26085], 256], + 13300: [[50, 49, 26085], 256], + 13301: [[50, 50, 26085], 256], + 13302: [[50, 51, 26085], 256], + 13303: [[50, 52, 26085], 256], + 13304: [[50, 53, 26085], 256], + 13305: [[50, 54, 26085], 256], + 13306: [[50, 55, 26085], 256], + 13307: [[50, 56, 26085], 256], + 13308: [[50, 57, 26085], 256], + 13309: [[51, 48, 26085], 256], + 13310: [[51, 49, 26085], 256], + 13311: [[103, 97, 108], 256] + }, + 42496: { + 42607: [, 230], + 42612: [, 230], + 42613: [, 230], + 42614: [, 230], + 42615: [, 230], + 42616: [, 230], + 42617: [, 230], + 42618: [, 230], + 42619: [, 230], + 42620: [, 230], + 42621: [, 230], + 42655: [, 230], + 42736: [, 230], + 42737: [, 230] + }, + 42752: { 42864: [[42863], 256], 43000: [[294], 256], 43001: [[339], 256] }, + 43008: { + 43014: [, 9], + 43204: [, 9], + 43232: [, 230], + 43233: [, 230], + 43234: [, 230], + 43235: [, 230], + 43236: [, 230], + 43237: [, 230], + 43238: [, 230], + 43239: [, 230], + 43240: [, 230], + 43241: [, 230], + 43242: [, 230], + 43243: [, 230], + 43244: [, 230], + 43245: [, 230], + 43246: [, 230], + 43247: [, 230], + 43248: [, 230], + 43249: [, 230] + }, + 43264: { + 43307: [, 220], + 43308: [, 220], + 43309: [, 220], + 43347: [, 9], + 43443: [, 7], + 43456: [, 9] + }, + 43520: { + 43696: [, 230], + 43698: [, 230], + 43699: [, 230], + 43700: [, 220], + 43703: [, 230], + 43704: [, 230], + 43710: [, 230], + 43711: [, 230], + 43713: [, 230], + 43766: [, 9] + }, + 43776: { 44013: [, 9] }, + 53504: { + 119134: [[119127, 119141], 512], + 119135: [[119128, 119141], 512], + 119136: [[119135, 119150], 512], + 119137: [[119135, 119151], 512], + 119138: [[119135, 119152], 512], + 119139: [[119135, 119153], 512], + 119140: [[119135, 119154], 512], + 119141: [, 216], + 119142: [, 216], + 119143: [, 1], + 119144: [, 1], + 119145: [, 1], + 119149: [, 226], + 119150: [, 216], + 119151: [, 216], + 119152: [, 216], + 119153: [, 216], + 119154: [, 216], + 119163: [, 220], + 119164: [, 220], + 119165: [, 220], + 119166: [, 220], + 119167: [, 220], + 119168: [, 220], + 119169: [, 220], + 119170: [, 220], + 119173: [, 230], + 119174: [, 230], + 119175: [, 230], + 119176: [, 230], + 119177: [, 230], + 119178: [, 220], + 119179: [, 220], + 119210: [, 230], + 119211: [, 230], + 119212: [, 230], + 119213: [, 230], + 119227: [[119225, 119141], 512], + 119228: [[119226, 119141], 512], + 119229: [[119227, 119150], 512], + 119230: [[119228, 119150], 512], + 119231: [[119227, 119151], 512], + 119232: [[119228, 119151], 512] + }, + 53760: { 119362: [, 230], 119363: [, 230], 119364: [, 230] }, + 54272: { + 119808: [[65], 256], + 119809: [[66], 256], + 119810: [[67], 256], + 119811: [[68], 256], + 119812: [[69], 256], + 119813: [[70], 256], + 119814: [[71], 256], + 119815: [[72], 256], + 119816: [[73], 256], + 119817: [[74], 256], + 119818: [[75], 256], + 119819: [[76], 256], + 119820: [[77], 256], + 119821: [[78], 256], + 119822: [[79], 256], + 119823: [[80], 256], + 119824: [[81], 256], + 119825: [[82], 256], + 119826: [[83], 256], + 119827: [[84], 256], + 119828: [[85], 256], + 119829: [[86], 256], + 119830: [[87], 256], + 119831: [[88], 256], + 119832: [[89], 256], + 119833: [[90], 256], + 119834: [[97], 256], + 119835: [[98], 256], + 119836: [[99], 256], + 119837: [[100], 256], + 119838: [[101], 256], + 119839: [[102], 256], + 119840: [[103], 256], + 119841: [[104], 256], + 119842: [[105], 256], + 119843: [[106], 256], + 119844: [[107], 256], + 119845: [[108], 256], + 119846: [[109], 256], + 119847: [[110], 256], + 119848: [[111], 256], + 119849: [[112], 256], + 119850: [[113], 256], + 119851: [[114], 256], + 119852: [[115], 256], + 119853: [[116], 256], + 119854: [[117], 256], + 119855: [[118], 256], + 119856: [[119], 256], + 119857: [[120], 256], + 119858: [[121], 256], + 119859: [[122], 256], + 119860: [[65], 256], + 119861: [[66], 256], + 119862: [[67], 256], + 119863: [[68], 256], + 119864: [[69], 256], + 119865: [[70], 256], + 119866: [[71], 256], + 119867: [[72], 256], + 119868: [[73], 256], + 119869: [[74], 256], + 119870: [[75], 256], + 119871: [[76], 256], + 119872: [[77], 256], + 119873: [[78], 256], + 119874: [[79], 256], + 119875: [[80], 256], + 119876: [[81], 256], + 119877: [[82], 256], + 119878: [[83], 256], + 119879: [[84], 256], + 119880: [[85], 256], + 119881: [[86], 256], + 119882: [[87], 256], + 119883: [[88], 256], + 119884: [[89], 256], + 119885: [[90], 256], + 119886: [[97], 256], + 119887: [[98], 256], + 119888: [[99], 256], + 119889: [[100], 256], + 119890: [[101], 256], + 119891: [[102], 256], + 119892: [[103], 256], + 119894: [[105], 256], + 119895: [[106], 256], + 119896: [[107], 256], + 119897: [[108], 256], + 119898: [[109], 256], + 119899: [[110], 256], + 119900: [[111], 256], + 119901: [[112], 256], + 119902: [[113], 256], + 119903: [[114], 256], + 119904: [[115], 256], + 119905: [[116], 256], + 119906: [[117], 256], + 119907: [[118], 256], + 119908: [[119], 256], + 119909: [[120], 256], + 119910: [[121], 256], + 119911: [[122], 256], + 119912: [[65], 256], + 119913: [[66], 256], + 119914: [[67], 256], + 119915: [[68], 256], + 119916: [[69], 256], + 119917: [[70], 256], + 119918: [[71], 256], + 119919: [[72], 256], + 119920: [[73], 256], + 119921: [[74], 256], + 119922: [[75], 256], + 119923: [[76], 256], + 119924: [[77], 256], + 119925: [[78], 256], + 119926: [[79], 256], + 119927: [[80], 256], + 119928: [[81], 256], + 119929: [[82], 256], + 119930: [[83], 256], + 119931: [[84], 256], + 119932: [[85], 256], + 119933: [[86], 256], + 119934: [[87], 256], + 119935: [[88], 256], + 119936: [[89], 256], + 119937: [[90], 256], + 119938: [[97], 256], + 119939: [[98], 256], + 119940: [[99], 256], + 119941: [[100], 256], + 119942: [[101], 256], + 119943: [[102], 256], + 119944: [[103], 256], + 119945: [[104], 256], + 119946: [[105], 256], + 119947: [[106], 256], + 119948: [[107], 256], + 119949: [[108], 256], + 119950: [[109], 256], + 119951: [[110], 256], + 119952: [[111], 256], + 119953: [[112], 256], + 119954: [[113], 256], + 119955: [[114], 256], + 119956: [[115], 256], + 119957: [[116], 256], + 119958: [[117], 256], + 119959: [[118], 256], + 119960: [[119], 256], + 119961: [[120], 256], + 119962: [[121], 256], + 119963: [[122], 256], + 119964: [[65], 256], + 119966: [[67], 256], + 119967: [[68], 256], + 119970: [[71], 256], + 119973: [[74], 256], + 119974: [[75], 256], + 119977: [[78], 256], + 119978: [[79], 256], + 119979: [[80], 256], + 119980: [[81], 256], + 119982: [[83], 256], + 119983: [[84], 256], + 119984: [[85], 256], + 119985: [[86], 256], + 119986: [[87], 256], + 119987: [[88], 256], + 119988: [[89], 256], + 119989: [[90], 256], + 119990: [[97], 256], + 119991: [[98], 256], + 119992: [[99], 256], + 119993: [[100], 256], + 119995: [[102], 256], + 119997: [[104], 256], + 119998: [[105], 256], + 119999: [[106], 256], + 120000: [[107], 256], + 120001: [[108], 256], + 120002: [[109], 256], + 120003: [[110], 256], + 120005: [[112], 256], + 120006: [[113], 256], + 120007: [[114], 256], + 120008: [[115], 256], + 120009: [[116], 256], + 120010: [[117], 256], + 120011: [[118], 256], + 120012: [[119], 256], + 120013: [[120], 256], + 120014: [[121], 256], + 120015: [[122], 256], + 120016: [[65], 256], + 120017: [[66], 256], + 120018: [[67], 256], + 120019: [[68], 256], + 120020: [[69], 256], + 120021: [[70], 256], + 120022: [[71], 256], + 120023: [[72], 256], + 120024: [[73], 256], + 120025: [[74], 256], + 120026: [[75], 256], + 120027: [[76], 256], + 120028: [[77], 256], + 120029: [[78], 256], + 120030: [[79], 256], + 120031: [[80], 256], + 120032: [[81], 256], + 120033: [[82], 256], + 120034: [[83], 256], + 120035: [[84], 256], + 120036: [[85], 256], + 120037: [[86], 256], + 120038: [[87], 256], + 120039: [[88], 256], + 120040: [[89], 256], + 120041: [[90], 256], + 120042: [[97], 256], + 120043: [[98], 256], + 120044: [[99], 256], + 120045: [[100], 256], + 120046: [[101], 256], + 120047: [[102], 256], + 120048: [[103], 256], + 120049: [[104], 256], + 120050: [[105], 256], + 120051: [[106], 256], + 120052: [[107], 256], + 120053: [[108], 256], + 120054: [[109], 256], + 120055: [[110], 256], + 120056: [[111], 256], + 120057: [[112], 256], + 120058: [[113], 256], + 120059: [[114], 256], + 120060: [[115], 256], + 120061: [[116], 256], + 120062: [[117], 256], + 120063: [[118], 256] + }, + 54528: { + 120064: [[119], 256], + 120065: [[120], 256], + 120066: [[121], 256], + 120067: [[122], 256], + 120068: [[65], 256], + 120069: [[66], 256], + 120071: [[68], 256], + 120072: [[69], 256], + 120073: [[70], 256], + 120074: [[71], 256], + 120077: [[74], 256], + 120078: [[75], 256], + 120079: [[76], 256], + 120080: [[77], 256], + 120081: [[78], 256], + 120082: [[79], 256], + 120083: [[80], 256], + 120084: [[81], 256], + 120086: [[83], 256], + 120087: [[84], 256], + 120088: [[85], 256], + 120089: [[86], 256], + 120090: [[87], 256], + 120091: [[88], 256], + 120092: [[89], 256], + 120094: [[97], 256], + 120095: [[98], 256], + 120096: [[99], 256], + 120097: [[100], 256], + 120098: [[101], 256], + 120099: [[102], 256], + 120100: [[103], 256], + 120101: [[104], 256], + 120102: [[105], 256], + 120103: [[106], 256], + 120104: [[107], 256], + 120105: [[108], 256], + 120106: [[109], 256], + 120107: [[110], 256], + 120108: [[111], 256], + 120109: [[112], 256], + 120110: [[113], 256], + 120111: [[114], 256], + 120112: [[115], 256], + 120113: [[116], 256], + 120114: [[117], 256], + 120115: [[118], 256], + 120116: [[119], 256], + 120117: [[120], 256], + 120118: [[121], 256], + 120119: [[122], 256], + 120120: [[65], 256], + 120121: [[66], 256], + 120123: [[68], 256], + 120124: [[69], 256], + 120125: [[70], 256], + 120126: [[71], 256], + 120128: [[73], 256], + 120129: [[74], 256], + 120130: [[75], 256], + 120131: [[76], 256], + 120132: [[77], 256], + 120134: [[79], 256], + 120138: [[83], 256], + 120139: [[84], 256], + 120140: [[85], 256], + 120141: [[86], 256], + 120142: [[87], 256], + 120143: [[88], 256], + 120144: [[89], 256], + 120146: [[97], 256], + 120147: [[98], 256], + 120148: [[99], 256], + 120149: [[100], 256], + 120150: [[101], 256], + 120151: [[102], 256], + 120152: [[103], 256], + 120153: [[104], 256], + 120154: [[105], 256], + 120155: [[106], 256], + 120156: [[107], 256], + 120157: [[108], 256], + 120158: [[109], 256], + 120159: [[110], 256], + 120160: [[111], 256], + 120161: [[112], 256], + 120162: [[113], 256], + 120163: [[114], 256], + 120164: [[115], 256], + 120165: [[116], 256], + 120166: [[117], 256], + 120167: [[118], 256], + 120168: [[119], 256], + 120169: [[120], 256], + 120170: [[121], 256], + 120171: [[122], 256], + 120172: [[65], 256], + 120173: [[66], 256], + 120174: [[67], 256], + 120175: [[68], 256], + 120176: [[69], 256], + 120177: [[70], 256], + 120178: [[71], 256], + 120179: [[72], 256], + 120180: [[73], 256], + 120181: [[74], 256], + 120182: [[75], 256], + 120183: [[76], 256], + 120184: [[77], 256], + 120185: [[78], 256], + 120186: [[79], 256], + 120187: [[80], 256], + 120188: [[81], 256], + 120189: [[82], 256], + 120190: [[83], 256], + 120191: [[84], 256], + 120192: [[85], 256], + 120193: [[86], 256], + 120194: [[87], 256], + 120195: [[88], 256], + 120196: [[89], 256], + 120197: [[90], 256], + 120198: [[97], 256], + 120199: [[98], 256], + 120200: [[99], 256], + 120201: [[100], 256], + 120202: [[101], 256], + 120203: [[102], 256], + 120204: [[103], 256], + 120205: [[104], 256], + 120206: [[105], 256], + 120207: [[106], 256], + 120208: [[107], 256], + 120209: [[108], 256], + 120210: [[109], 256], + 120211: [[110], 256], + 120212: [[111], 256], + 120213: [[112], 256], + 120214: [[113], 256], + 120215: [[114], 256], + 120216: [[115], 256], + 120217: [[116], 256], + 120218: [[117], 256], + 120219: [[118], 256], + 120220: [[119], 256], + 120221: [[120], 256], + 120222: [[121], 256], + 120223: [[122], 256], + 120224: [[65], 256], + 120225: [[66], 256], + 120226: [[67], 256], + 120227: [[68], 256], + 120228: [[69], 256], + 120229: [[70], 256], + 120230: [[71], 256], + 120231: [[72], 256], + 120232: [[73], 256], + 120233: [[74], 256], + 120234: [[75], 256], + 120235: [[76], 256], + 120236: [[77], 256], + 120237: [[78], 256], + 120238: [[79], 256], + 120239: [[80], 256], + 120240: [[81], 256], + 120241: [[82], 256], + 120242: [[83], 256], + 120243: [[84], 256], + 120244: [[85], 256], + 120245: [[86], 256], + 120246: [[87], 256], + 120247: [[88], 256], + 120248: [[89], 256], + 120249: [[90], 256], + 120250: [[97], 256], + 120251: [[98], 256], + 120252: [[99], 256], + 120253: [[100], 256], + 120254: [[101], 256], + 120255: [[102], 256], + 120256: [[103], 256], + 120257: [[104], 256], + 120258: [[105], 256], + 120259: [[106], 256], + 120260: [[107], 256], + 120261: [[108], 256], + 120262: [[109], 256], + 120263: [[110], 256], + 120264: [[111], 256], + 120265: [[112], 256], + 120266: [[113], 256], + 120267: [[114], 256], + 120268: [[115], 256], + 120269: [[116], 256], + 120270: [[117], 256], + 120271: [[118], 256], + 120272: [[119], 256], + 120273: [[120], 256], + 120274: [[121], 256], + 120275: [[122], 256], + 120276: [[65], 256], + 120277: [[66], 256], + 120278: [[67], 256], + 120279: [[68], 256], + 120280: [[69], 256], + 120281: [[70], 256], + 120282: [[71], 256], + 120283: [[72], 256], + 120284: [[73], 256], + 120285: [[74], 256], + 120286: [[75], 256], + 120287: [[76], 256], + 120288: [[77], 256], + 120289: [[78], 256], + 120290: [[79], 256], + 120291: [[80], 256], + 120292: [[81], 256], + 120293: [[82], 256], + 120294: [[83], 256], + 120295: [[84], 256], + 120296: [[85], 256], + 120297: [[86], 256], + 120298: [[87], 256], + 120299: [[88], 256], + 120300: [[89], 256], + 120301: [[90], 256], + 120302: [[97], 256], + 120303: [[98], 256], + 120304: [[99], 256], + 120305: [[100], 256], + 120306: [[101], 256], + 120307: [[102], 256], + 120308: [[103], 256], + 120309: [[104], 256], + 120310: [[105], 256], + 120311: [[106], 256], + 120312: [[107], 256], + 120313: [[108], 256], + 120314: [[109], 256], + 120315: [[110], 256], + 120316: [[111], 256], + 120317: [[112], 256], + 120318: [[113], 256], + 120319: [[114], 256] + }, + 54784: { + 120320: [[115], 256], + 120321: [[116], 256], + 120322: [[117], 256], + 120323: [[118], 256], + 120324: [[119], 256], + 120325: [[120], 256], + 120326: [[121], 256], + 120327: [[122], 256], + 120328: [[65], 256], + 120329: [[66], 256], + 120330: [[67], 256], + 120331: [[68], 256], + 120332: [[69], 256], + 120333: [[70], 256], + 120334: [[71], 256], + 120335: [[72], 256], + 120336: [[73], 256], + 120337: [[74], 256], + 120338: [[75], 256], + 120339: [[76], 256], + 120340: [[77], 256], + 120341: [[78], 256], + 120342: [[79], 256], + 120343: [[80], 256], + 120344: [[81], 256], + 120345: [[82], 256], + 120346: [[83], 256], + 120347: [[84], 256], + 120348: [[85], 256], + 120349: [[86], 256], + 120350: [[87], 256], + 120351: [[88], 256], + 120352: [[89], 256], + 120353: [[90], 256], + 120354: [[97], 256], + 120355: [[98], 256], + 120356: [[99], 256], + 120357: [[100], 256], + 120358: [[101], 256], + 120359: [[102], 256], + 120360: [[103], 256], + 120361: [[104], 256], + 120362: [[105], 256], + 120363: [[106], 256], + 120364: [[107], 256], + 120365: [[108], 256], + 120366: [[109], 256], + 120367: [[110], 256], + 120368: [[111], 256], + 120369: [[112], 256], + 120370: [[113], 256], + 120371: [[114], 256], + 120372: [[115], 256], + 120373: [[116], 256], + 120374: [[117], 256], + 120375: [[118], 256], + 120376: [[119], 256], + 120377: [[120], 256], + 120378: [[121], 256], + 120379: [[122], 256], + 120380: [[65], 256], + 120381: [[66], 256], + 120382: [[67], 256], + 120383: [[68], 256], + 120384: [[69], 256], + 120385: [[70], 256], + 120386: [[71], 256], + 120387: [[72], 256], + 120388: [[73], 256], + 120389: [[74], 256], + 120390: [[75], 256], + 120391: [[76], 256], + 120392: [[77], 256], + 120393: [[78], 256], + 120394: [[79], 256], + 120395: [[80], 256], + 120396: [[81], 256], + 120397: [[82], 256], + 120398: [[83], 256], + 120399: [[84], 256], + 120400: [[85], 256], + 120401: [[86], 256], + 120402: [[87], 256], + 120403: [[88], 256], + 120404: [[89], 256], + 120405: [[90], 256], + 120406: [[97], 256], + 120407: [[98], 256], + 120408: [[99], 256], + 120409: [[100], 256], + 120410: [[101], 256], + 120411: [[102], 256], + 120412: [[103], 256], + 120413: [[104], 256], + 120414: [[105], 256], + 120415: [[106], 256], + 120416: [[107], 256], + 120417: [[108], 256], + 120418: [[109], 256], + 120419: [[110], 256], + 120420: [[111], 256], + 120421: [[112], 256], + 120422: [[113], 256], + 120423: [[114], 256], + 120424: [[115], 256], + 120425: [[116], 256], + 120426: [[117], 256], + 120427: [[118], 256], + 120428: [[119], 256], + 120429: [[120], 256], + 120430: [[121], 256], + 120431: [[122], 256], + 120432: [[65], 256], + 120433: [[66], 256], + 120434: [[67], 256], + 120435: [[68], 256], + 120436: [[69], 256], + 120437: [[70], 256], + 120438: [[71], 256], + 120439: [[72], 256], + 120440: [[73], 256], + 120441: [[74], 256], + 120442: [[75], 256], + 120443: [[76], 256], + 120444: [[77], 256], + 120445: [[78], 256], + 120446: [[79], 256], + 120447: [[80], 256], + 120448: [[81], 256], + 120449: [[82], 256], + 120450: [[83], 256], + 120451: [[84], 256], + 120452: [[85], 256], + 120453: [[86], 256], + 120454: [[87], 256], + 120455: [[88], 256], + 120456: [[89], 256], + 120457: [[90], 256], + 120458: [[97], 256], + 120459: [[98], 256], + 120460: [[99], 256], + 120461: [[100], 256], + 120462: [[101], 256], + 120463: [[102], 256], + 120464: [[103], 256], + 120465: [[104], 256], + 120466: [[105], 256], + 120467: [[106], 256], + 120468: [[107], 256], + 120469: [[108], 256], + 120470: [[109], 256], + 120471: [[110], 256], + 120472: [[111], 256], + 120473: [[112], 256], + 120474: [[113], 256], + 120475: [[114], 256], + 120476: [[115], 256], + 120477: [[116], 256], + 120478: [[117], 256], + 120479: [[118], 256], + 120480: [[119], 256], + 120481: [[120], 256], + 120482: [[121], 256], + 120483: [[122], 256], + 120484: [[305], 256], + 120485: [[567], 256], + 120488: [[913], 256], + 120489: [[914], 256], + 120490: [[915], 256], + 120491: [[916], 256], + 120492: [[917], 256], + 120493: [[918], 256], + 120494: [[919], 256], + 120495: [[920], 256], + 120496: [[921], 256], + 120497: [[922], 256], + 120498: [[923], 256], + 120499: [[924], 256], + 120500: [[925], 256], + 120501: [[926], 256], + 120502: [[927], 256], + 120503: [[928], 256], + 120504: [[929], 256], + 120505: [[1012], 256], + 120506: [[931], 256], + 120507: [[932], 256], + 120508: [[933], 256], + 120509: [[934], 256], + 120510: [[935], 256], + 120511: [[936], 256], + 120512: [[937], 256], + 120513: [[8711], 256], + 120514: [[945], 256], + 120515: [[946], 256], + 120516: [[947], 256], + 120517: [[948], 256], + 120518: [[949], 256], + 120519: [[950], 256], + 120520: [[951], 256], + 120521: [[952], 256], + 120522: [[953], 256], + 120523: [[954], 256], + 120524: [[955], 256], + 120525: [[956], 256], + 120526: [[957], 256], + 120527: [[958], 256], + 120528: [[959], 256], + 120529: [[960], 256], + 120530: [[961], 256], + 120531: [[962], 256], + 120532: [[963], 256], + 120533: [[964], 256], + 120534: [[965], 256], + 120535: [[966], 256], + 120536: [[967], 256], + 120537: [[968], 256], + 120538: [[969], 256], + 120539: [[8706], 256], + 120540: [[1013], 256], + 120541: [[977], 256], + 120542: [[1008], 256], + 120543: [[981], 256], + 120544: [[1009], 256], + 120545: [[982], 256], + 120546: [[913], 256], + 120547: [[914], 256], + 120548: [[915], 256], + 120549: [[916], 256], + 120550: [[917], 256], + 120551: [[918], 256], + 120552: [[919], 256], + 120553: [[920], 256], + 120554: [[921], 256], + 120555: [[922], 256], + 120556: [[923], 256], + 120557: [[924], 256], + 120558: [[925], 256], + 120559: [[926], 256], + 120560: [[927], 256], + 120561: [[928], 256], + 120562: [[929], 256], + 120563: [[1012], 256], + 120564: [[931], 256], + 120565: [[932], 256], + 120566: [[933], 256], + 120567: [[934], 256], + 120568: [[935], 256], + 120569: [[936], 256], + 120570: [[937], 256], + 120571: [[8711], 256], + 120572: [[945], 256], + 120573: [[946], 256], + 120574: [[947], 256], + 120575: [[948], 256] + }, + 55040: { + 120576: [[949], 256], + 120577: [[950], 256], + 120578: [[951], 256], + 120579: [[952], 256], + 120580: [[953], 256], + 120581: [[954], 256], + 120582: [[955], 256], + 120583: [[956], 256], + 120584: [[957], 256], + 120585: [[958], 256], + 120586: [[959], 256], + 120587: [[960], 256], + 120588: [[961], 256], + 120589: [[962], 256], + 120590: [[963], 256], + 120591: [[964], 256], + 120592: [[965], 256], + 120593: [[966], 256], + 120594: [[967], 256], + 120595: [[968], 256], + 120596: [[969], 256], + 120597: [[8706], 256], + 120598: [[1013], 256], + 120599: [[977], 256], + 120600: [[1008], 256], + 120601: [[981], 256], + 120602: [[1009], 256], + 120603: [[982], 256], + 120604: [[913], 256], + 120605: [[914], 256], + 120606: [[915], 256], + 120607: [[916], 256], + 120608: [[917], 256], + 120609: [[918], 256], + 120610: [[919], 256], + 120611: [[920], 256], + 120612: [[921], 256], + 120613: [[922], 256], + 120614: [[923], 256], + 120615: [[924], 256], + 120616: [[925], 256], + 120617: [[926], 256], + 120618: [[927], 256], + 120619: [[928], 256], + 120620: [[929], 256], + 120621: [[1012], 256], + 120622: [[931], 256], + 120623: [[932], 256], + 120624: [[933], 256], + 120625: [[934], 256], + 120626: [[935], 256], + 120627: [[936], 256], + 120628: [[937], 256], + 120629: [[8711], 256], + 120630: [[945], 256], + 120631: [[946], 256], + 120632: [[947], 256], + 120633: [[948], 256], + 120634: [[949], 256], + 120635: [[950], 256], + 120636: [[951], 256], + 120637: [[952], 256], + 120638: [[953], 256], + 120639: [[954], 256], + 120640: [[955], 256], + 120641: [[956], 256], + 120642: [[957], 256], + 120643: [[958], 256], + 120644: [[959], 256], + 120645: [[960], 256], + 120646: [[961], 256], + 120647: [[962], 256], + 120648: [[963], 256], + 120649: [[964], 256], + 120650: [[965], 256], + 120651: [[966], 256], + 120652: [[967], 256], + 120653: [[968], 256], + 120654: [[969], 256], + 120655: [[8706], 256], + 120656: [[1013], 256], + 120657: [[977], 256], + 120658: [[1008], 256], + 120659: [[981], 256], + 120660: [[1009], 256], + 120661: [[982], 256], + 120662: [[913], 256], + 120663: [[914], 256], + 120664: [[915], 256], + 120665: [[916], 256], + 120666: [[917], 256], + 120667: [[918], 256], + 120668: [[919], 256], + 120669: [[920], 256], + 120670: [[921], 256], + 120671: [[922], 256], + 120672: [[923], 256], + 120673: [[924], 256], + 120674: [[925], 256], + 120675: [[926], 256], + 120676: [[927], 256], + 120677: [[928], 256], + 120678: [[929], 256], + 120679: [[1012], 256], + 120680: [[931], 256], + 120681: [[932], 256], + 120682: [[933], 256], + 120683: [[934], 256], + 120684: [[935], 256], + 120685: [[936], 256], + 120686: [[937], 256], + 120687: [[8711], 256], + 120688: [[945], 256], + 120689: [[946], 256], + 120690: [[947], 256], + 120691: [[948], 256], + 120692: [[949], 256], + 120693: [[950], 256], + 120694: [[951], 256], + 120695: [[952], 256], + 120696: [[953], 256], + 120697: [[954], 256], + 120698: [[955], 256], + 120699: [[956], 256], + 120700: [[957], 256], + 120701: [[958], 256], + 120702: [[959], 256], + 120703: [[960], 256], + 120704: [[961], 256], + 120705: [[962], 256], + 120706: [[963], 256], + 120707: [[964], 256], + 120708: [[965], 256], + 120709: [[966], 256], + 120710: [[967], 256], + 120711: [[968], 256], + 120712: [[969], 256], + 120713: [[8706], 256], + 120714: [[1013], 256], + 120715: [[977], 256], + 120716: [[1008], 256], + 120717: [[981], 256], + 120718: [[1009], 256], + 120719: [[982], 256], + 120720: [[913], 256], + 120721: [[914], 256], + 120722: [[915], 256], + 120723: [[916], 256], + 120724: [[917], 256], + 120725: [[918], 256], + 120726: [[919], 256], + 120727: [[920], 256], + 120728: [[921], 256], + 120729: [[922], 256], + 120730: [[923], 256], + 120731: [[924], 256], + 120732: [[925], 256], + 120733: [[926], 256], + 120734: [[927], 256], + 120735: [[928], 256], + 120736: [[929], 256], + 120737: [[1012], 256], + 120738: [[931], 256], + 120739: [[932], 256], + 120740: [[933], 256], + 120741: [[934], 256], + 120742: [[935], 256], + 120743: [[936], 256], + 120744: [[937], 256], + 120745: [[8711], 256], + 120746: [[945], 256], + 120747: [[946], 256], + 120748: [[947], 256], + 120749: [[948], 256], + 120750: [[949], 256], + 120751: [[950], 256], + 120752: [[951], 256], + 120753: [[952], 256], + 120754: [[953], 256], + 120755: [[954], 256], + 120756: [[955], 256], + 120757: [[956], 256], + 120758: [[957], 256], + 120759: [[958], 256], + 120760: [[959], 256], + 120761: [[960], 256], + 120762: [[961], 256], + 120763: [[962], 256], + 120764: [[963], 256], + 120765: [[964], 256], + 120766: [[965], 256], + 120767: [[966], 256], + 120768: [[967], 256], + 120769: [[968], 256], + 120770: [[969], 256], + 120771: [[8706], 256], + 120772: [[1013], 256], + 120773: [[977], 256], + 120774: [[1008], 256], + 120775: [[981], 256], + 120776: [[1009], 256], + 120777: [[982], 256], + 120778: [[988], 256], + 120779: [[989], 256], + 120782: [[48], 256], + 120783: [[49], 256], + 120784: [[50], 256], + 120785: [[51], 256], + 120786: [[52], 256], + 120787: [[53], 256], + 120788: [[54], 256], + 120789: [[55], 256], + 120790: [[56], 256], + 120791: [[57], 256], + 120792: [[48], 256], + 120793: [[49], 256], + 120794: [[50], 256], + 120795: [[51], 256], + 120796: [[52], 256], + 120797: [[53], 256], + 120798: [[54], 256], + 120799: [[55], 256], + 120800: [[56], 256], + 120801: [[57], 256], + 120802: [[48], 256], + 120803: [[49], 256], + 120804: [[50], 256], + 120805: [[51], 256], + 120806: [[52], 256], + 120807: [[53], 256], + 120808: [[54], 256], + 120809: [[55], 256], + 120810: [[56], 256], + 120811: [[57], 256], + 120812: [[48], 256], + 120813: [[49], 256], + 120814: [[50], 256], + 120815: [[51], 256], + 120816: [[52], 256], + 120817: [[53], 256], + 120818: [[54], 256], + 120819: [[55], 256], + 120820: [[56], 256], + 120821: [[57], 256], + 120822: [[48], 256], + 120823: [[49], 256], + 120824: [[50], 256], + 120825: [[51], 256], + 120826: [[52], 256], + 120827: [[53], 256], + 120828: [[54], 256], + 120829: [[55], 256], + 120830: [[56], 256], + 120831: [[57], 256] + }, + 60928: { + 126464: [[1575], 256], + 126465: [[1576], 256], + 126466: [[1580], 256], + 126467: [[1583], 256], + 126469: [[1608], 256], + 126470: [[1586], 256], + 126471: [[1581], 256], + 126472: [[1591], 256], + 126473: [[1610], 256], + 126474: [[1603], 256], + 126475: [[1604], 256], + 126476: [[1605], 256], + 126477: [[1606], 256], + 126478: [[1587], 256], + 126479: [[1593], 256], + 126480: [[1601], 256], + 126481: [[1589], 256], + 126482: [[1602], 256], + 126483: [[1585], 256], + 126484: [[1588], 256], + 126485: [[1578], 256], + 126486: [[1579], 256], + 126487: [[1582], 256], + 126488: [[1584], 256], + 126489: [[1590], 256], + 126490: [[1592], 256], + 126491: [[1594], 256], + 126492: [[1646], 256], + 126493: [[1722], 256], + 126494: [[1697], 256], + 126495: [[1647], 256], + 126497: [[1576], 256], + 126498: [[1580], 256], + 126500: [[1607], 256], + 126503: [[1581], 256], + 126505: [[1610], 256], + 126506: [[1603], 256], + 126507: [[1604], 256], + 126508: [[1605], 256], + 126509: [[1606], 256], + 126510: [[1587], 256], + 126511: [[1593], 256], + 126512: [[1601], 256], + 126513: [[1589], 256], + 126514: [[1602], 256], + 126516: [[1588], 256], + 126517: [[1578], 256], + 126518: [[1579], 256], + 126519: [[1582], 256], + 126521: [[1590], 256], + 126523: [[1594], 256], + 126530: [[1580], 256], + 126535: [[1581], 256], + 126537: [[1610], 256], + 126539: [[1604], 256], + 126541: [[1606], 256], + 126542: [[1587], 256], + 126543: [[1593], 256], + 126545: [[1589], 256], + 126546: [[1602], 256], + 126548: [[1588], 256], + 126551: [[1582], 256], + 126553: [[1590], 256], + 126555: [[1594], 256], + 126557: [[1722], 256], + 126559: [[1647], 256], + 126561: [[1576], 256], + 126562: [[1580], 256], + 126564: [[1607], 256], + 126567: [[1581], 256], + 126568: [[1591], 256], + 126569: [[1610], 256], + 126570: [[1603], 256], + 126572: [[1605], 256], + 126573: [[1606], 256], + 126574: [[1587], 256], + 126575: [[1593], 256], + 126576: [[1601], 256], + 126577: [[1589], 256], + 126578: [[1602], 256], + 126580: [[1588], 256], + 126581: [[1578], 256], + 126582: [[1579], 256], + 126583: [[1582], 256], + 126585: [[1590], 256], + 126586: [[1592], 256], + 126587: [[1594], 256], + 126588: [[1646], 256], + 126590: [[1697], 256], + 126592: [[1575], 256], + 126593: [[1576], 256], + 126594: [[1580], 256], + 126595: [[1583], 256], + 126596: [[1607], 256], + 126597: [[1608], 256], + 126598: [[1586], 256], + 126599: [[1581], 256], + 126600: [[1591], 256], + 126601: [[1610], 256], + 126603: [[1604], 256], + 126604: [[1605], 256], + 126605: [[1606], 256], + 126606: [[1587], 256], + 126607: [[1593], 256], + 126608: [[1601], 256], + 126609: [[1589], 256], + 126610: [[1602], 256], + 126611: [[1585], 256], + 126612: [[1588], 256], + 126613: [[1578], 256], + 126614: [[1579], 256], + 126615: [[1582], 256], + 126616: [[1584], 256], + 126617: [[1590], 256], + 126618: [[1592], 256], + 126619: [[1594], 256], + 126625: [[1576], 256], + 126626: [[1580], 256], + 126627: [[1583], 256], + 126629: [[1608], 256], + 126630: [[1586], 256], + 126631: [[1581], 256], + 126632: [[1591], 256], + 126633: [[1610], 256], + 126635: [[1604], 256], + 126636: [[1605], 256], + 126637: [[1606], 256], + 126638: [[1587], 256], + 126639: [[1593], 256], + 126640: [[1601], 256], + 126641: [[1589], 256], + 126642: [[1602], 256], + 126643: [[1585], 256], + 126644: [[1588], 256], + 126645: [[1578], 256], + 126646: [[1579], 256], + 126647: [[1582], 256], + 126648: [[1584], 256], + 126649: [[1590], 256], + 126650: [[1592], 256], + 126651: [[1594], 256] + }, + 61696: { + 127232: [[48, 46], 256], + 127233: [[48, 44], 256], + 127234: [[49, 44], 256], + 127235: [[50, 44], 256], + 127236: [[51, 44], 256], + 127237: [[52, 44], 256], + 127238: [[53, 44], 256], + 127239: [[54, 44], 256], + 127240: [[55, 44], 256], + 127241: [[56, 44], 256], + 127242: [[57, 44], 256], + 127248: [[40, 65, 41], 256], + 127249: [[40, 66, 41], 256], + 127250: [[40, 67, 41], 256], + 127251: [[40, 68, 41], 256], + 127252: [[40, 69, 41], 256], + 127253: [[40, 70, 41], 256], + 127254: [[40, 71, 41], 256], + 127255: [[40, 72, 41], 256], + 127256: [[40, 73, 41], 256], + 127257: [[40, 74, 41], 256], + 127258: [[40, 75, 41], 256], + 127259: [[40, 76, 41], 256], + 127260: [[40, 77, 41], 256], + 127261: [[40, 78, 41], 256], + 127262: [[40, 79, 41], 256], + 127263: [[40, 80, 41], 256], + 127264: [[40, 81, 41], 256], + 127265: [[40, 82, 41], 256], + 127266: [[40, 83, 41], 256], + 127267: [[40, 84, 41], 256], + 127268: [[40, 85, 41], 256], + 127269: [[40, 86, 41], 256], + 127270: [[40, 87, 41], 256], + 127271: [[40, 88, 41], 256], + 127272: [[40, 89, 41], 256], + 127273: [[40, 90, 41], 256], + 127274: [[12308, 83, 12309], 256], + 127275: [[67], 256], + 127276: [[82], 256], + 127277: [[67, 68], 256], + 127278: [[87, 90], 256], + 127280: [[65], 256], + 127281: [[66], 256], + 127282: [[67], 256], + 127283: [[68], 256], + 127284: [[69], 256], + 127285: [[70], 256], + 127286: [[71], 256], + 127287: [[72], 256], + 127288: [[73], 256], + 127289: [[74], 256], + 127290: [[75], 256], + 127291: [[76], 256], + 127292: [[77], 256], + 127293: [[78], 256], + 127294: [[79], 256], + 127295: [[80], 256], + 127296: [[81], 256], + 127297: [[82], 256], + 127298: [[83], 256], + 127299: [[84], 256], + 127300: [[85], 256], + 127301: [[86], 256], + 127302: [[87], 256], + 127303: [[88], 256], + 127304: [[89], 256], + 127305: [[90], 256], + 127306: [[72, 86], 256], + 127307: [[77, 86], 256], + 127308: [[83, 68], 256], + 127309: [[83, 83], 256], + 127310: [[80, 80, 86], 256], + 127311: [[87, 67], 256], + 127338: [[77, 67], 256], + 127339: [[77, 68], 256], + 127376: [[68, 74], 256] + }, + 61952: { + 127488: [[12411, 12363], 256], + 127489: [[12467, 12467], 256], + 127490: [[12469], 256], + 127504: [[25163], 256], + 127505: [[23383], 256], + 127506: [[21452], 256], + 127507: [[12487], 256], + 127508: [[20108], 256], + 127509: [[22810], 256], + 127510: [[35299], 256], + 127511: [[22825], 256], + 127512: [[20132], 256], + 127513: [[26144], 256], + 127514: [[28961], 256], + 127515: [[26009], 256], + 127516: [[21069], 256], + 127517: [[24460], 256], + 127518: [[20877], 256], + 127519: [[26032], 256], + 127520: [[21021], 256], + 127521: [[32066], 256], + 127522: [[29983], 256], + 127523: [[36009], 256], + 127524: [[22768], 256], + 127525: [[21561], 256], + 127526: [[28436], 256], + 127527: [[25237], 256], + 127528: [[25429], 256], + 127529: [[19968], 256], + 127530: [[19977], 256], + 127531: [[36938], 256], + 127532: [[24038], 256], + 127533: [[20013], 256], + 127534: [[21491], 256], + 127535: [[25351], 256], + 127536: [[36208], 256], + 127537: [[25171], 256], + 127538: [[31105], 256], + 127539: [[31354], 256], + 127540: [[21512], 256], + 127541: [[28288], 256], + 127542: [[26377], 256], + 127543: [[26376], 256], + 127544: [[30003], 256], + 127545: [[21106], 256], + 127546: [[21942], 256], + 127552: [[12308, 26412, 12309], 256], + 127553: [[12308, 19977, 12309], 256], + 127554: [[12308, 20108, 12309], 256], + 127555: [[12308, 23433, 12309], 256], + 127556: [[12308, 28857, 12309], 256], + 127557: [[12308, 25171, 12309], 256], + 127558: [[12308, 30423, 12309], 256], + 127559: [[12308, 21213, 12309], 256], + 127560: [[12308, 25943, 12309], 256], + 127568: [[24471], 256], + 127569: [[21487], 256] + }, + 63488: { + 194560: [[20029]], + 194561: [[20024]], + 194562: [[20033]], + 194563: [[131362]], + 194564: [[20320]], + 194565: [[20398]], + 194566: [[20411]], + 194567: [[20482]], + 194568: [[20602]], + 194569: [[20633]], + 194570: [[20711]], + 194571: [[20687]], + 194572: [[13470]], + 194573: [[132666]], + 194574: [[20813]], + 194575: [[20820]], + 194576: [[20836]], + 194577: [[20855]], + 194578: [[132380]], + 194579: [[13497]], + 194580: [[20839]], + 194581: [[20877]], + 194582: [[132427]], + 194583: [[20887]], + 194584: [[20900]], + 194585: [[20172]], + 194586: [[20908]], + 194587: [[20917]], + 194588: [[168415]], + 194589: [[20981]], + 194590: [[20995]], + 194591: [[13535]], + 194592: [[21051]], + 194593: [[21062]], + 194594: [[21106]], + 194595: [[21111]], + 194596: [[13589]], + 194597: [[21191]], + 194598: [[21193]], + 194599: [[21220]], + 194600: [[21242]], + 194601: [[21253]], + 194602: [[21254]], + 194603: [[21271]], + 194604: [[21321]], + 194605: [[21329]], + 194606: [[21338]], + 194607: [[21363]], + 194608: [[21373]], + 194609: [[21375]], + 194610: [[21375]], + 194611: [[21375]], + 194612: [[133676]], + 194613: [[28784]], + 194614: [[21450]], + 194615: [[21471]], + 194616: [[133987]], + 194617: [[21483]], + 194618: [[21489]], + 194619: [[21510]], + 194620: [[21662]], + 194621: [[21560]], + 194622: [[21576]], + 194623: [[21608]], + 194624: [[21666]], + 194625: [[21750]], + 194626: [[21776]], + 194627: [[21843]], + 194628: [[21859]], + 194629: [[21892]], + 194630: [[21892]], + 194631: [[21913]], + 194632: [[21931]], + 194633: [[21939]], + 194634: [[21954]], + 194635: [[22294]], + 194636: [[22022]], + 194637: [[22295]], + 194638: [[22097]], + 194639: [[22132]], + 194640: [[20999]], + 194641: [[22766]], + 194642: [[22478]], + 194643: [[22516]], + 194644: [[22541]], + 194645: [[22411]], + 194646: [[22578]], + 194647: [[22577]], + 194648: [[22700]], + 194649: [[136420]], + 194650: [[22770]], + 194651: [[22775]], + 194652: [[22790]], + 194653: [[22810]], + 194654: [[22818]], + 194655: [[22882]], + 194656: [[136872]], + 194657: [[136938]], + 194658: [[23020]], + 194659: [[23067]], + 194660: [[23079]], + 194661: [[23000]], + 194662: [[23142]], + 194663: [[14062]], + 194664: [[14076]], + 194665: [[23304]], + 194666: [[23358]], + 194667: [[23358]], + 194668: [[137672]], + 194669: [[23491]], + 194670: [[23512]], + 194671: [[23527]], + 194672: [[23539]], + 194673: [[138008]], + 194674: [[23551]], + 194675: [[23558]], + 194676: [[24403]], + 194677: [[23586]], + 194678: [[14209]], + 194679: [[23648]], + 194680: [[23662]], + 194681: [[23744]], + 194682: [[23693]], + 194683: [[138724]], + 194684: [[23875]], + 194685: [[138726]], + 194686: [[23918]], + 194687: [[23915]], + 194688: [[23932]], + 194689: [[24033]], + 194690: [[24034]], + 194691: [[14383]], + 194692: [[24061]], + 194693: [[24104]], + 194694: [[24125]], + 194695: [[24169]], + 194696: [[14434]], + 194697: [[139651]], + 194698: [[14460]], + 194699: [[24240]], + 194700: [[24243]], + 194701: [[24246]], + 194702: [[24266]], + 194703: [[172946]], + 194704: [[24318]], + 194705: [[140081]], + 194706: [[140081]], + 194707: [[33281]], + 194708: [[24354]], + 194709: [[24354]], + 194710: [[14535]], + 194711: [[144056]], + 194712: [[156122]], + 194713: [[24418]], + 194714: [[24427]], + 194715: [[14563]], + 194716: [[24474]], + 194717: [[24525]], + 194718: [[24535]], + 194719: [[24569]], + 194720: [[24705]], + 194721: [[14650]], + 194722: [[14620]], + 194723: [[24724]], + 194724: [[141012]], + 194725: [[24775]], + 194726: [[24904]], + 194727: [[24908]], + 194728: [[24910]], + 194729: [[24908]], + 194730: [[24954]], + 194731: [[24974]], + 194732: [[25010]], + 194733: [[24996]], + 194734: [[25007]], + 194735: [[25054]], + 194736: [[25074]], + 194737: [[25078]], + 194738: [[25104]], + 194739: [[25115]], + 194740: [[25181]], + 194741: [[25265]], + 194742: [[25300]], + 194743: [[25424]], + 194744: [[142092]], + 194745: [[25405]], + 194746: [[25340]], + 194747: [[25448]], + 194748: [[25475]], + 194749: [[25572]], + 194750: [[142321]], + 194751: [[25634]], + 194752: [[25541]], + 194753: [[25513]], + 194754: [[14894]], + 194755: [[25705]], + 194756: [[25726]], + 194757: [[25757]], + 194758: [[25719]], + 194759: [[14956]], + 194760: [[25935]], + 194761: [[25964]], + 194762: [[143370]], + 194763: [[26083]], + 194764: [[26360]], + 194765: [[26185]], + 194766: [[15129]], + 194767: [[26257]], + 194768: [[15112]], + 194769: [[15076]], + 194770: [[20882]], + 194771: [[20885]], + 194772: [[26368]], + 194773: [[26268]], + 194774: [[32941]], + 194775: [[17369]], + 194776: [[26391]], + 194777: [[26395]], + 194778: [[26401]], + 194779: [[26462]], + 194780: [[26451]], + 194781: [[144323]], + 194782: [[15177]], + 194783: [[26618]], + 194784: [[26501]], + 194785: [[26706]], + 194786: [[26757]], + 194787: [[144493]], + 194788: [[26766]], + 194789: [[26655]], + 194790: [[26900]], + 194791: [[15261]], + 194792: [[26946]], + 194793: [[27043]], + 194794: [[27114]], + 194795: [[27304]], + 194796: [[145059]], + 194797: [[27355]], + 194798: [[15384]], + 194799: [[27425]], + 194800: [[145575]], + 194801: [[27476]], + 194802: [[15438]], + 194803: [[27506]], + 194804: [[27551]], + 194805: [[27578]], + 194806: [[27579]], + 194807: [[146061]], + 194808: [[138507]], + 194809: [[146170]], + 194810: [[27726]], + 194811: [[146620]], + 194812: [[27839]], + 194813: [[27853]], + 194814: [[27751]], + 194815: [[27926]] + }, + 63744: { + 63744: [[35912]], + 63745: [[26356]], + 63746: [[36554]], + 63747: [[36040]], + 63748: [[28369]], + 63749: [[20018]], + 63750: [[21477]], + 63751: [[40860]], + 63752: [[40860]], + 63753: [[22865]], + 63754: [[37329]], + 63755: [[21895]], + 63756: [[22856]], + 63757: [[25078]], + 63758: [[30313]], + 63759: [[32645]], + 63760: [[34367]], + 63761: [[34746]], + 63762: [[35064]], + 63763: [[37007]], + 63764: [[27138]], + 63765: [[27931]], + 63766: [[28889]], + 63767: [[29662]], + 63768: [[33853]], + 63769: [[37226]], + 63770: [[39409]], + 63771: [[20098]], + 63772: [[21365]], + 63773: [[27396]], + 63774: [[29211]], + 63775: [[34349]], + 63776: [[40478]], + 63777: [[23888]], + 63778: [[28651]], + 63779: [[34253]], + 63780: [[35172]], + 63781: [[25289]], + 63782: [[33240]], + 63783: [[34847]], + 63784: [[24266]], + 63785: [[26391]], + 63786: [[28010]], + 63787: [[29436]], + 63788: [[37070]], + 63789: [[20358]], + 63790: [[20919]], + 63791: [[21214]], + 63792: [[25796]], + 63793: [[27347]], + 63794: [[29200]], + 63795: [[30439]], + 63796: [[32769]], + 63797: [[34310]], + 63798: [[34396]], + 63799: [[36335]], + 63800: [[38706]], + 63801: [[39791]], + 63802: [[40442]], + 63803: [[30860]], + 63804: [[31103]], + 63805: [[32160]], + 63806: [[33737]], + 63807: [[37636]], + 63808: [[40575]], + 63809: [[35542]], + 63810: [[22751]], + 63811: [[24324]], + 63812: [[31840]], + 63813: [[32894]], + 63814: [[29282]], + 63815: [[30922]], + 63816: [[36034]], + 63817: [[38647]], + 63818: [[22744]], + 63819: [[23650]], + 63820: [[27155]], + 63821: [[28122]], + 63822: [[28431]], + 63823: [[32047]], + 63824: [[32311]], + 63825: [[38475]], + 63826: [[21202]], + 63827: [[32907]], + 63828: [[20956]], + 63829: [[20940]], + 63830: [[31260]], + 63831: [[32190]], + 63832: [[33777]], + 63833: [[38517]], + 63834: [[35712]], + 63835: [[25295]], + 63836: [[27138]], + 63837: [[35582]], + 63838: [[20025]], + 63839: [[23527]], + 63840: [[24594]], + 63841: [[29575]], + 63842: [[30064]], + 63843: [[21271]], + 63844: [[30971]], + 63845: [[20415]], + 63846: [[24489]], + 63847: [[19981]], + 63848: [[27852]], + 63849: [[25976]], + 63850: [[32034]], + 63851: [[21443]], + 63852: [[22622]], + 63853: [[30465]], + 63854: [[33865]], + 63855: [[35498]], + 63856: [[27578]], + 63857: [[36784]], + 63858: [[27784]], + 63859: [[25342]], + 63860: [[33509]], + 63861: [[25504]], + 63862: [[30053]], + 63863: [[20142]], + 63864: [[20841]], + 63865: [[20937]], + 63866: [[26753]], + 63867: [[31975]], + 63868: [[33391]], + 63869: [[35538]], + 63870: [[37327]], + 63871: [[21237]], + 63872: [[21570]], + 63873: [[22899]], + 63874: [[24300]], + 63875: [[26053]], + 63876: [[28670]], + 63877: [[31018]], + 63878: [[38317]], + 63879: [[39530]], + 63880: [[40599]], + 63881: [[40654]], + 63882: [[21147]], + 63883: [[26310]], + 63884: [[27511]], + 63885: [[36706]], + 63886: [[24180]], + 63887: [[24976]], + 63888: [[25088]], + 63889: [[25754]], + 63890: [[28451]], + 63891: [[29001]], + 63892: [[29833]], + 63893: [[31178]], + 63894: [[32244]], + 63895: [[32879]], + 63896: [[36646]], + 63897: [[34030]], + 63898: [[36899]], + 63899: [[37706]], + 63900: [[21015]], + 63901: [[21155]], + 63902: [[21693]], + 63903: [[28872]], + 63904: [[35010]], + 63905: [[35498]], + 63906: [[24265]], + 63907: [[24565]], + 63908: [[25467]], + 63909: [[27566]], + 63910: [[31806]], + 63911: [[29557]], + 63912: [[20196]], + 63913: [[22265]], + 63914: [[23527]], + 63915: [[23994]], + 63916: [[24604]], + 63917: [[29618]], + 63918: [[29801]], + 63919: [[32666]], + 63920: [[32838]], + 63921: [[37428]], + 63922: [[38646]], + 63923: [[38728]], + 63924: [[38936]], + 63925: [[20363]], + 63926: [[31150]], + 63927: [[37300]], + 63928: [[38584]], + 63929: [[24801]], + 63930: [[20102]], + 63931: [[20698]], + 63932: [[23534]], + 63933: [[23615]], + 63934: [[26009]], + 63935: [[27138]], + 63936: [[29134]], + 63937: [[30274]], + 63938: [[34044]], + 63939: [[36988]], + 63940: [[40845]], + 63941: [[26248]], + 63942: [[38446]], + 63943: [[21129]], + 63944: [[26491]], + 63945: [[26611]], + 63946: [[27969]], + 63947: [[28316]], + 63948: [[29705]], + 63949: [[30041]], + 63950: [[30827]], + 63951: [[32016]], + 63952: [[39006]], + 63953: [[20845]], + 63954: [[25134]], + 63955: [[38520]], + 63956: [[20523]], + 63957: [[23833]], + 63958: [[28138]], + 63959: [[36650]], + 63960: [[24459]], + 63961: [[24900]], + 63962: [[26647]], + 63963: [[29575]], + 63964: [[38534]], + 63965: [[21033]], + 63966: [[21519]], + 63967: [[23653]], + 63968: [[26131]], + 63969: [[26446]], + 63970: [[26792]], + 63971: [[27877]], + 63972: [[29702]], + 63973: [[30178]], + 63974: [[32633]], + 63975: [[35023]], + 63976: [[35041]], + 63977: [[37324]], + 63978: [[38626]], + 63979: [[21311]], + 63980: [[28346]], + 63981: [[21533]], + 63982: [[29136]], + 63983: [[29848]], + 63984: [[34298]], + 63985: [[38563]], + 63986: [[40023]], + 63987: [[40607]], + 63988: [[26519]], + 63989: [[28107]], + 63990: [[33256]], + 63991: [[31435]], + 63992: [[31520]], + 63993: [[31890]], + 63994: [[29376]], + 63995: [[28825]], + 63996: [[35672]], + 63997: [[20160]], + 63998: [[33590]], + 63999: [[21050]], + 194816: [[27966]], + 194817: [[28023]], + 194818: [[27969]], + 194819: [[28009]], + 194820: [[28024]], + 194821: [[28037]], + 194822: [[146718]], + 194823: [[27956]], + 194824: [[28207]], + 194825: [[28270]], + 194826: [[15667]], + 194827: [[28363]], + 194828: [[28359]], + 194829: [[147153]], + 194830: [[28153]], + 194831: [[28526]], + 194832: [[147294]], + 194833: [[147342]], + 194834: [[28614]], + 194835: [[28729]], + 194836: [[28702]], + 194837: [[28699]], + 194838: [[15766]], + 194839: [[28746]], + 194840: [[28797]], + 194841: [[28791]], + 194842: [[28845]], + 194843: [[132389]], + 194844: [[28997]], + 194845: [[148067]], + 194846: [[29084]], + 194847: [[148395]], + 194848: [[29224]], + 194849: [[29237]], + 194850: [[29264]], + 194851: [[149000]], + 194852: [[29312]], + 194853: [[29333]], + 194854: [[149301]], + 194855: [[149524]], + 194856: [[29562]], + 194857: [[29579]], + 194858: [[16044]], + 194859: [[29605]], + 194860: [[16056]], + 194861: [[16056]], + 194862: [[29767]], + 194863: [[29788]], + 194864: [[29809]], + 194865: [[29829]], + 194866: [[29898]], + 194867: [[16155]], + 194868: [[29988]], + 194869: [[150582]], + 194870: [[30014]], + 194871: [[150674]], + 194872: [[30064]], + 194873: [[139679]], + 194874: [[30224]], + 194875: [[151457]], + 194876: [[151480]], + 194877: [[151620]], + 194878: [[16380]], + 194879: [[16392]], + 194880: [[30452]], + 194881: [[151795]], + 194882: [[151794]], + 194883: [[151833]], + 194884: [[151859]], + 194885: [[30494]], + 194886: [[30495]], + 194887: [[30495]], + 194888: [[30538]], + 194889: [[16441]], + 194890: [[30603]], + 194891: [[16454]], + 194892: [[16534]], + 194893: [[152605]], + 194894: [[30798]], + 194895: [[30860]], + 194896: [[30924]], + 194897: [[16611]], + 194898: [[153126]], + 194899: [[31062]], + 194900: [[153242]], + 194901: [[153285]], + 194902: [[31119]], + 194903: [[31211]], + 194904: [[16687]], + 194905: [[31296]], + 194906: [[31306]], + 194907: [[31311]], + 194908: [[153980]], + 194909: [[154279]], + 194910: [[154279]], + 194911: [[31470]], + 194912: [[16898]], + 194913: [[154539]], + 194914: [[31686]], + 194915: [[31689]], + 194916: [[16935]], + 194917: [[154752]], + 194918: [[31954]], + 194919: [[17056]], + 194920: [[31976]], + 194921: [[31971]], + 194922: [[32000]], + 194923: [[155526]], + 194924: [[32099]], + 194925: [[17153]], + 194926: [[32199]], + 194927: [[32258]], + 194928: [[32325]], + 194929: [[17204]], + 194930: [[156200]], + 194931: [[156231]], + 194932: [[17241]], + 194933: [[156377]], + 194934: [[32634]], + 194935: [[156478]], + 194936: [[32661]], + 194937: [[32762]], + 194938: [[32773]], + 194939: [[156890]], + 194940: [[156963]], + 194941: [[32864]], + 194942: [[157096]], + 194943: [[32880]], + 194944: [[144223]], + 194945: [[17365]], + 194946: [[32946]], + 194947: [[33027]], + 194948: [[17419]], + 194949: [[33086]], + 194950: [[23221]], + 194951: [[157607]], + 194952: [[157621]], + 194953: [[144275]], + 194954: [[144284]], + 194955: [[33281]], + 194956: [[33284]], + 194957: [[36766]], + 194958: [[17515]], + 194959: [[33425]], + 194960: [[33419]], + 194961: [[33437]], + 194962: [[21171]], + 194963: [[33457]], + 194964: [[33459]], + 194965: [[33469]], + 194966: [[33510]], + 194967: [[158524]], + 194968: [[33509]], + 194969: [[33565]], + 194970: [[33635]], + 194971: [[33709]], + 194972: [[33571]], + 194973: [[33725]], + 194974: [[33767]], + 194975: [[33879]], + 194976: [[33619]], + 194977: [[33738]], + 194978: [[33740]], + 194979: [[33756]], + 194980: [[158774]], + 194981: [[159083]], + 194982: [[158933]], + 194983: [[17707]], + 194984: [[34033]], + 194985: [[34035]], + 194986: [[34070]], + 194987: [[160714]], + 194988: [[34148]], + 194989: [[159532]], + 194990: [[17757]], + 194991: [[17761]], + 194992: [[159665]], + 194993: [[159954]], + 194994: [[17771]], + 194995: [[34384]], + 194996: [[34396]], + 194997: [[34407]], + 194998: [[34409]], + 194999: [[34473]], + 195000: [[34440]], + 195001: [[34574]], + 195002: [[34530]], + 195003: [[34681]], + 195004: [[34600]], + 195005: [[34667]], + 195006: [[34694]], + 195007: [[17879]], + 195008: [[34785]], + 195009: [[34817]], + 195010: [[17913]], + 195011: [[34912]], + 195012: [[34915]], + 195013: [[161383]], + 195014: [[35031]], + 195015: [[35038]], + 195016: [[17973]], + 195017: [[35066]], + 195018: [[13499]], + 195019: [[161966]], + 195020: [[162150]], + 195021: [[18110]], + 195022: [[18119]], + 195023: [[35488]], + 195024: [[35565]], + 195025: [[35722]], + 195026: [[35925]], + 195027: [[162984]], + 195028: [[36011]], + 195029: [[36033]], + 195030: [[36123]], + 195031: [[36215]], + 195032: [[163631]], + 195033: [[133124]], + 195034: [[36299]], + 195035: [[36284]], + 195036: [[36336]], + 195037: [[133342]], + 195038: [[36564]], + 195039: [[36664]], + 195040: [[165330]], + 195041: [[165357]], + 195042: [[37012]], + 195043: [[37105]], + 195044: [[37137]], + 195045: [[165678]], + 195046: [[37147]], + 195047: [[37432]], + 195048: [[37591]], + 195049: [[37592]], + 195050: [[37500]], + 195051: [[37881]], + 195052: [[37909]], + 195053: [[166906]], + 195054: [[38283]], + 195055: [[18837]], + 195056: [[38327]], + 195057: [[167287]], + 195058: [[18918]], + 195059: [[38595]], + 195060: [[23986]], + 195061: [[38691]], + 195062: [[168261]], + 195063: [[168474]], + 195064: [[19054]], + 195065: [[19062]], + 195066: [[38880]], + 195067: [[168970]], + 195068: [[19122]], + 195069: [[169110]], + 195070: [[38923]], + 195071: [[38923]] + }, + 64000: { + 64000: [[20999]], + 64001: [[24230]], + 64002: [[25299]], + 64003: [[31958]], + 64004: [[23429]], + 64005: [[27934]], + 64006: [[26292]], + 64007: [[36667]], + 64008: [[34892]], + 64009: [[38477]], + 64010: [[35211]], + 64011: [[24275]], + 64012: [[20800]], + 64013: [[21952]], + 64016: [[22618]], + 64018: [[26228]], + 64021: [[20958]], + 64022: [[29482]], + 64023: [[30410]], + 64024: [[31036]], + 64025: [[31070]], + 64026: [[31077]], + 64027: [[31119]], + 64028: [[38742]], + 64029: [[31934]], + 64030: [[32701]], + 64032: [[34322]], + 64034: [[35576]], + 64037: [[36920]], + 64038: [[37117]], + 64042: [[39151]], + 64043: [[39164]], + 64044: [[39208]], + 64045: [[40372]], + 64046: [[37086]], + 64047: [[38583]], + 64048: [[20398]], + 64049: [[20711]], + 64050: [[20813]], + 64051: [[21193]], + 64052: [[21220]], + 64053: [[21329]], + 64054: [[21917]], + 64055: [[22022]], + 64056: [[22120]], + 64057: [[22592]], + 64058: [[22696]], + 64059: [[23652]], + 64060: [[23662]], + 64061: [[24724]], + 64062: [[24936]], + 64063: [[24974]], + 64064: [[25074]], + 64065: [[25935]], + 64066: [[26082]], + 64067: [[26257]], + 64068: [[26757]], + 64069: [[28023]], + 64070: [[28186]], + 64071: [[28450]], + 64072: [[29038]], + 64073: [[29227]], + 64074: [[29730]], + 64075: [[30865]], + 64076: [[31038]], + 64077: [[31049]], + 64078: [[31048]], + 64079: [[31056]], + 64080: [[31062]], + 64081: [[31069]], + 64082: [[31117]], + 64083: [[31118]], + 64084: [[31296]], + 64085: [[31361]], + 64086: [[31680]], + 64087: [[32244]], + 64088: [[32265]], + 64089: [[32321]], + 64090: [[32626]], + 64091: [[32773]], + 64092: [[33261]], + 64093: [[33401]], + 64094: [[33401]], + 64095: [[33879]], + 64096: [[35088]], + 64097: [[35222]], + 64098: [[35585]], + 64099: [[35641]], + 64100: [[36051]], + 64101: [[36104]], + 64102: [[36790]], + 64103: [[36920]], + 64104: [[38627]], + 64105: [[38911]], + 64106: [[38971]], + 64107: [[24693]], + 64108: [[148206]], + 64109: [[33304]], + 64112: [[20006]], + 64113: [[20917]], + 64114: [[20840]], + 64115: [[20352]], + 64116: [[20805]], + 64117: [[20864]], + 64118: [[21191]], + 64119: [[21242]], + 64120: [[21917]], + 64121: [[21845]], + 64122: [[21913]], + 64123: [[21986]], + 64124: [[22618]], + 64125: [[22707]], + 64126: [[22852]], + 64127: [[22868]], + 64128: [[23138]], + 64129: [[23336]], + 64130: [[24274]], + 64131: [[24281]], + 64132: [[24425]], + 64133: [[24493]], + 64134: [[24792]], + 64135: [[24910]], + 64136: [[24840]], + 64137: [[24974]], + 64138: [[24928]], + 64139: [[25074]], + 64140: [[25140]], + 64141: [[25540]], + 64142: [[25628]], + 64143: [[25682]], + 64144: [[25942]], + 64145: [[26228]], + 64146: [[26391]], + 64147: [[26395]], + 64148: [[26454]], + 64149: [[27513]], + 64150: [[27578]], + 64151: [[27969]], + 64152: [[28379]], + 64153: [[28363]], + 64154: [[28450]], + 64155: [[28702]], + 64156: [[29038]], + 64157: [[30631]], + 64158: [[29237]], + 64159: [[29359]], + 64160: [[29482]], + 64161: [[29809]], + 64162: [[29958]], + 64163: [[30011]], + 64164: [[30237]], + 64165: [[30239]], + 64166: [[30410]], + 64167: [[30427]], + 64168: [[30452]], + 64169: [[30538]], + 64170: [[30528]], + 64171: [[30924]], + 64172: [[31409]], + 64173: [[31680]], + 64174: [[31867]], + 64175: [[32091]], + 64176: [[32244]], + 64177: [[32574]], + 64178: [[32773]], + 64179: [[33618]], + 64180: [[33775]], + 64181: [[34681]], + 64182: [[35137]], + 64183: [[35206]], + 64184: [[35222]], + 64185: [[35519]], + 64186: [[35576]], + 64187: [[35531]], + 64188: [[35585]], + 64189: [[35582]], + 64190: [[35565]], + 64191: [[35641]], + 64192: [[35722]], + 64193: [[36104]], + 64194: [[36664]], + 64195: [[36978]], + 64196: [[37273]], + 64197: [[37494]], + 64198: [[38524]], + 64199: [[38627]], + 64200: [[38742]], + 64201: [[38875]], + 64202: [[38911]], + 64203: [[38923]], + 64204: [[38971]], + 64205: [[39698]], + 64206: [[40860]], + 64207: [[141386]], + 64208: [[141380]], + 64209: [[144341]], + 64210: [[15261]], + 64211: [[16408]], + 64212: [[16441]], + 64213: [[152137]], + 64214: [[154832]], + 64215: [[163539]], + 64216: [[40771]], + 64217: [[40846]], + 195072: [[38953]], + 195073: [[169398]], + 195074: [[39138]], + 195075: [[19251]], + 195076: [[39209]], + 195077: [[39335]], + 195078: [[39362]], + 195079: [[39422]], + 195080: [[19406]], + 195081: [[170800]], + 195082: [[39698]], + 195083: [[40000]], + 195084: [[40189]], + 195085: [[19662]], + 195086: [[19693]], + 195087: [[40295]], + 195088: [[172238]], + 195089: [[19704]], + 195090: [[172293]], + 195091: [[172558]], + 195092: [[172689]], + 195093: [[40635]], + 195094: [[19798]], + 195095: [[40697]], + 195096: [[40702]], + 195097: [[40709]], + 195098: [[40719]], + 195099: [[40726]], + 195100: [[40763]], + 195101: [[173568]] + }, + 64256: { + 64256: [[102, 102], 256], + 64257: [[102, 105], 256], + 64258: [[102, 108], 256], + 64259: [[102, 102, 105], 256], + 64260: [[102, 102, 108], 256], + 64261: [[383, 116], 256], + 64262: [[115, 116], 256], + 64275: [[1396, 1398], 256], + 64276: [[1396, 1381], 256], + 64277: [[1396, 1387], 256], + 64278: [[1406, 1398], 256], + 64279: [[1396, 1389], 256], + 64285: [[1497, 1460], 512], + 64286: [, 26], + 64287: [[1522, 1463], 512], + 64288: [[1506], 256], + 64289: [[1488], 256], + 64290: [[1491], 256], + 64291: [[1492], 256], + 64292: [[1499], 256], + 64293: [[1500], 256], + 64294: [[1501], 256], + 64295: [[1512], 256], + 64296: [[1514], 256], + 64297: [[43], 256], + 64298: [[1513, 1473], 512], + 64299: [[1513, 1474], 512], + 64300: [[64329, 1473], 512], + 64301: [[64329, 1474], 512], + 64302: [[1488, 1463], 512], + 64303: [[1488, 1464], 512], + 64304: [[1488, 1468], 512], + 64305: [[1489, 1468], 512], + 64306: [[1490, 1468], 512], + 64307: [[1491, 1468], 512], + 64308: [[1492, 1468], 512], + 64309: [[1493, 1468], 512], + 64310: [[1494, 1468], 512], + 64312: [[1496, 1468], 512], + 64313: [[1497, 1468], 512], + 64314: [[1498, 1468], 512], + 64315: [[1499, 1468], 512], + 64316: [[1500, 1468], 512], + 64318: [[1502, 1468], 512], + 64320: [[1504, 1468], 512], + 64321: [[1505, 1468], 512], + 64323: [[1507, 1468], 512], + 64324: [[1508, 1468], 512], + 64326: [[1510, 1468], 512], + 64327: [[1511, 1468], 512], + 64328: [[1512, 1468], 512], + 64329: [[1513, 1468], 512], + 64330: [[1514, 1468], 512], + 64331: [[1493, 1465], 512], + 64332: [[1489, 1471], 512], + 64333: [[1499, 1471], 512], + 64334: [[1508, 1471], 512], + 64335: [[1488, 1500], 256], + 64336: [[1649], 256], + 64337: [[1649], 256], + 64338: [[1659], 256], + 64339: [[1659], 256], + 64340: [[1659], 256], + 64341: [[1659], 256], + 64342: [[1662], 256], + 64343: [[1662], 256], + 64344: [[1662], 256], + 64345: [[1662], 256], + 64346: [[1664], 256], + 64347: [[1664], 256], + 64348: [[1664], 256], + 64349: [[1664], 256], + 64350: [[1658], 256], + 64351: [[1658], 256], + 64352: [[1658], 256], + 64353: [[1658], 256], + 64354: [[1663], 256], + 64355: [[1663], 256], + 64356: [[1663], 256], + 64357: [[1663], 256], + 64358: [[1657], 256], + 64359: [[1657], 256], + 64360: [[1657], 256], + 64361: [[1657], 256], + 64362: [[1700], 256], + 64363: [[1700], 256], + 64364: [[1700], 256], + 64365: [[1700], 256], + 64366: [[1702], 256], + 64367: [[1702], 256], + 64368: [[1702], 256], + 64369: [[1702], 256], + 64370: [[1668], 256], + 64371: [[1668], 256], + 64372: [[1668], 256], + 64373: [[1668], 256], + 64374: [[1667], 256], + 64375: [[1667], 256], + 64376: [[1667], 256], + 64377: [[1667], 256], + 64378: [[1670], 256], + 64379: [[1670], 256], + 64380: [[1670], 256], + 64381: [[1670], 256], + 64382: [[1671], 256], + 64383: [[1671], 256], + 64384: [[1671], 256], + 64385: [[1671], 256], + 64386: [[1677], 256], + 64387: [[1677], 256], + 64388: [[1676], 256], + 64389: [[1676], 256], + 64390: [[1678], 256], + 64391: [[1678], 256], + 64392: [[1672], 256], + 64393: [[1672], 256], + 64394: [[1688], 256], + 64395: [[1688], 256], + 64396: [[1681], 256], + 64397: [[1681], 256], + 64398: [[1705], 256], + 64399: [[1705], 256], + 64400: [[1705], 256], + 64401: [[1705], 256], + 64402: [[1711], 256], + 64403: [[1711], 256], + 64404: [[1711], 256], + 64405: [[1711], 256], + 64406: [[1715], 256], + 64407: [[1715], 256], + 64408: [[1715], 256], + 64409: [[1715], 256], + 64410: [[1713], 256], + 64411: [[1713], 256], + 64412: [[1713], 256], + 64413: [[1713], 256], + 64414: [[1722], 256], + 64415: [[1722], 256], + 64416: [[1723], 256], + 64417: [[1723], 256], + 64418: [[1723], 256], + 64419: [[1723], 256], + 64420: [[1728], 256], + 64421: [[1728], 256], + 64422: [[1729], 256], + 64423: [[1729], 256], + 64424: [[1729], 256], + 64425: [[1729], 256], + 64426: [[1726], 256], + 64427: [[1726], 256], + 64428: [[1726], 256], + 64429: [[1726], 256], + 64430: [[1746], 256], + 64431: [[1746], 256], + 64432: [[1747], 256], + 64433: [[1747], 256], + 64467: [[1709], 256], + 64468: [[1709], 256], + 64469: [[1709], 256], + 64470: [[1709], 256], + 64471: [[1735], 256], + 64472: [[1735], 256], + 64473: [[1734], 256], + 64474: [[1734], 256], + 64475: [[1736], 256], + 64476: [[1736], 256], + 64477: [[1655], 256], + 64478: [[1739], 256], + 64479: [[1739], 256], + 64480: [[1733], 256], + 64481: [[1733], 256], + 64482: [[1737], 256], + 64483: [[1737], 256], + 64484: [[1744], 256], + 64485: [[1744], 256], + 64486: [[1744], 256], + 64487: [[1744], 256], + 64488: [[1609], 256], + 64489: [[1609], 256], + 64490: [[1574, 1575], 256], + 64491: [[1574, 1575], 256], + 64492: [[1574, 1749], 256], + 64493: [[1574, 1749], 256], + 64494: [[1574, 1608], 256], + 64495: [[1574, 1608], 256], + 64496: [[1574, 1735], 256], + 64497: [[1574, 1735], 256], + 64498: [[1574, 1734], 256], + 64499: [[1574, 1734], 256], + 64500: [[1574, 1736], 256], + 64501: [[1574, 1736], 256], + 64502: [[1574, 1744], 256], + 64503: [[1574, 1744], 256], + 64504: [[1574, 1744], 256], + 64505: [[1574, 1609], 256], + 64506: [[1574, 1609], 256], + 64507: [[1574, 1609], 256], + 64508: [[1740], 256], + 64509: [[1740], 256], + 64510: [[1740], 256], + 64511: [[1740], 256] + }, + 64512: { + 64512: [[1574, 1580], 256], + 64513: [[1574, 1581], 256], + 64514: [[1574, 1605], 256], + 64515: [[1574, 1609], 256], + 64516: [[1574, 1610], 256], + 64517: [[1576, 1580], 256], + 64518: [[1576, 1581], 256], + 64519: [[1576, 1582], 256], + 64520: [[1576, 1605], 256], + 64521: [[1576, 1609], 256], + 64522: [[1576, 1610], 256], + 64523: [[1578, 1580], 256], + 64524: [[1578, 1581], 256], + 64525: [[1578, 1582], 256], + 64526: [[1578, 1605], 256], + 64527: [[1578, 1609], 256], + 64528: [[1578, 1610], 256], + 64529: [[1579, 1580], 256], + 64530: [[1579, 1605], 256], + 64531: [[1579, 1609], 256], + 64532: [[1579, 1610], 256], + 64533: [[1580, 1581], 256], + 64534: [[1580, 1605], 256], + 64535: [[1581, 1580], 256], + 64536: [[1581, 1605], 256], + 64537: [[1582, 1580], 256], + 64538: [[1582, 1581], 256], + 64539: [[1582, 1605], 256], + 64540: [[1587, 1580], 256], + 64541: [[1587, 1581], 256], + 64542: [[1587, 1582], 256], + 64543: [[1587, 1605], 256], + 64544: [[1589, 1581], 256], + 64545: [[1589, 1605], 256], + 64546: [[1590, 1580], 256], + 64547: [[1590, 1581], 256], + 64548: [[1590, 1582], 256], + 64549: [[1590, 1605], 256], + 64550: [[1591, 1581], 256], + 64551: [[1591, 1605], 256], + 64552: [[1592, 1605], 256], + 64553: [[1593, 1580], 256], + 64554: [[1593, 1605], 256], + 64555: [[1594, 1580], 256], + 64556: [[1594, 1605], 256], + 64557: [[1601, 1580], 256], + 64558: [[1601, 1581], 256], + 64559: [[1601, 1582], 256], + 64560: [[1601, 1605], 256], + 64561: [[1601, 1609], 256], + 64562: [[1601, 1610], 256], + 64563: [[1602, 1581], 256], + 64564: [[1602, 1605], 256], + 64565: [[1602, 1609], 256], + 64566: [[1602, 1610], 256], + 64567: [[1603, 1575], 256], + 64568: [[1603, 1580], 256], + 64569: [[1603, 1581], 256], + 64570: [[1603, 1582], 256], + 64571: [[1603, 1604], 256], + 64572: [[1603, 1605], 256], + 64573: [[1603, 1609], 256], + 64574: [[1603, 1610], 256], + 64575: [[1604, 1580], 256], + 64576: [[1604, 1581], 256], + 64577: [[1604, 1582], 256], + 64578: [[1604, 1605], 256], + 64579: [[1604, 1609], 256], + 64580: [[1604, 1610], 256], + 64581: [[1605, 1580], 256], + 64582: [[1605, 1581], 256], + 64583: [[1605, 1582], 256], + 64584: [[1605, 1605], 256], + 64585: [[1605, 1609], 256], + 64586: [[1605, 1610], 256], + 64587: [[1606, 1580], 256], + 64588: [[1606, 1581], 256], + 64589: [[1606, 1582], 256], + 64590: [[1606, 1605], 256], + 64591: [[1606, 1609], 256], + 64592: [[1606, 1610], 256], + 64593: [[1607, 1580], 256], + 64594: [[1607, 1605], 256], + 64595: [[1607, 1609], 256], + 64596: [[1607, 1610], 256], + 64597: [[1610, 1580], 256], + 64598: [[1610, 1581], 256], + 64599: [[1610, 1582], 256], + 64600: [[1610, 1605], 256], + 64601: [[1610, 1609], 256], + 64602: [[1610, 1610], 256], + 64603: [[1584, 1648], 256], + 64604: [[1585, 1648], 256], + 64605: [[1609, 1648], 256], + 64606: [[32, 1612, 1617], 256], + 64607: [[32, 1613, 1617], 256], + 64608: [[32, 1614, 1617], 256], + 64609: [[32, 1615, 1617], 256], + 64610: [[32, 1616, 1617], 256], + 64611: [[32, 1617, 1648], 256], + 64612: [[1574, 1585], 256], + 64613: [[1574, 1586], 256], + 64614: [[1574, 1605], 256], + 64615: [[1574, 1606], 256], + 64616: [[1574, 1609], 256], + 64617: [[1574, 1610], 256], + 64618: [[1576, 1585], 256], + 64619: [[1576, 1586], 256], + 64620: [[1576, 1605], 256], + 64621: [[1576, 1606], 256], + 64622: [[1576, 1609], 256], + 64623: [[1576, 1610], 256], + 64624: [[1578, 1585], 256], + 64625: [[1578, 1586], 256], + 64626: [[1578, 1605], 256], + 64627: [[1578, 1606], 256], + 64628: [[1578, 1609], 256], + 64629: [[1578, 1610], 256], + 64630: [[1579, 1585], 256], + 64631: [[1579, 1586], 256], + 64632: [[1579, 1605], 256], + 64633: [[1579, 1606], 256], + 64634: [[1579, 1609], 256], + 64635: [[1579, 1610], 256], + 64636: [[1601, 1609], 256], + 64637: [[1601, 1610], 256], + 64638: [[1602, 1609], 256], + 64639: [[1602, 1610], 256], + 64640: [[1603, 1575], 256], + 64641: [[1603, 1604], 256], + 64642: [[1603, 1605], 256], + 64643: [[1603, 1609], 256], + 64644: [[1603, 1610], 256], + 64645: [[1604, 1605], 256], + 64646: [[1604, 1609], 256], + 64647: [[1604, 1610], 256], + 64648: [[1605, 1575], 256], + 64649: [[1605, 1605], 256], + 64650: [[1606, 1585], 256], + 64651: [[1606, 1586], 256], + 64652: [[1606, 1605], 256], + 64653: [[1606, 1606], 256], + 64654: [[1606, 1609], 256], + 64655: [[1606, 1610], 256], + 64656: [[1609, 1648], 256], + 64657: [[1610, 1585], 256], + 64658: [[1610, 1586], 256], + 64659: [[1610, 1605], 256], + 64660: [[1610, 1606], 256], + 64661: [[1610, 1609], 256], + 64662: [[1610, 1610], 256], + 64663: [[1574, 1580], 256], + 64664: [[1574, 1581], 256], + 64665: [[1574, 1582], 256], + 64666: [[1574, 1605], 256], + 64667: [[1574, 1607], 256], + 64668: [[1576, 1580], 256], + 64669: [[1576, 1581], 256], + 64670: [[1576, 1582], 256], + 64671: [[1576, 1605], 256], + 64672: [[1576, 1607], 256], + 64673: [[1578, 1580], 256], + 64674: [[1578, 1581], 256], + 64675: [[1578, 1582], 256], + 64676: [[1578, 1605], 256], + 64677: [[1578, 1607], 256], + 64678: [[1579, 1605], 256], + 64679: [[1580, 1581], 256], + 64680: [[1580, 1605], 256], + 64681: [[1581, 1580], 256], + 64682: [[1581, 1605], 256], + 64683: [[1582, 1580], 256], + 64684: [[1582, 1605], 256], + 64685: [[1587, 1580], 256], + 64686: [[1587, 1581], 256], + 64687: [[1587, 1582], 256], + 64688: [[1587, 1605], 256], + 64689: [[1589, 1581], 256], + 64690: [[1589, 1582], 256], + 64691: [[1589, 1605], 256], + 64692: [[1590, 1580], 256], + 64693: [[1590, 1581], 256], + 64694: [[1590, 1582], 256], + 64695: [[1590, 1605], 256], + 64696: [[1591, 1581], 256], + 64697: [[1592, 1605], 256], + 64698: [[1593, 1580], 256], + 64699: [[1593, 1605], 256], + 64700: [[1594, 1580], 256], + 64701: [[1594, 1605], 256], + 64702: [[1601, 1580], 256], + 64703: [[1601, 1581], 256], + 64704: [[1601, 1582], 256], + 64705: [[1601, 1605], 256], + 64706: [[1602, 1581], 256], + 64707: [[1602, 1605], 256], + 64708: [[1603, 1580], 256], + 64709: [[1603, 1581], 256], + 64710: [[1603, 1582], 256], + 64711: [[1603, 1604], 256], + 64712: [[1603, 1605], 256], + 64713: [[1604, 1580], 256], + 64714: [[1604, 1581], 256], + 64715: [[1604, 1582], 256], + 64716: [[1604, 1605], 256], + 64717: [[1604, 1607], 256], + 64718: [[1605, 1580], 256], + 64719: [[1605, 1581], 256], + 64720: [[1605, 1582], 256], + 64721: [[1605, 1605], 256], + 64722: [[1606, 1580], 256], + 64723: [[1606, 1581], 256], + 64724: [[1606, 1582], 256], + 64725: [[1606, 1605], 256], + 64726: [[1606, 1607], 256], + 64727: [[1607, 1580], 256], + 64728: [[1607, 1605], 256], + 64729: [[1607, 1648], 256], + 64730: [[1610, 1580], 256], + 64731: [[1610, 1581], 256], + 64732: [[1610, 1582], 256], + 64733: [[1610, 1605], 256], + 64734: [[1610, 1607], 256], + 64735: [[1574, 1605], 256], + 64736: [[1574, 1607], 256], + 64737: [[1576, 1605], 256], + 64738: [[1576, 1607], 256], + 64739: [[1578, 1605], 256], + 64740: [[1578, 1607], 256], + 64741: [[1579, 1605], 256], + 64742: [[1579, 1607], 256], + 64743: [[1587, 1605], 256], + 64744: [[1587, 1607], 256], + 64745: [[1588, 1605], 256], + 64746: [[1588, 1607], 256], + 64747: [[1603, 1604], 256], + 64748: [[1603, 1605], 256], + 64749: [[1604, 1605], 256], + 64750: [[1606, 1605], 256], + 64751: [[1606, 1607], 256], + 64752: [[1610, 1605], 256], + 64753: [[1610, 1607], 256], + 64754: [[1600, 1614, 1617], 256], + 64755: [[1600, 1615, 1617], 256], + 64756: [[1600, 1616, 1617], 256], + 64757: [[1591, 1609], 256], + 64758: [[1591, 1610], 256], + 64759: [[1593, 1609], 256], + 64760: [[1593, 1610], 256], + 64761: [[1594, 1609], 256], + 64762: [[1594, 1610], 256], + 64763: [[1587, 1609], 256], + 64764: [[1587, 1610], 256], + 64765: [[1588, 1609], 256], + 64766: [[1588, 1610], 256], + 64767: [[1581, 1609], 256] + }, + 64768: { + 64768: [[1581, 1610], 256], + 64769: [[1580, 1609], 256], + 64770: [[1580, 1610], 256], + 64771: [[1582, 1609], 256], + 64772: [[1582, 1610], 256], + 64773: [[1589, 1609], 256], + 64774: [[1589, 1610], 256], + 64775: [[1590, 1609], 256], + 64776: [[1590, 1610], 256], + 64777: [[1588, 1580], 256], + 64778: [[1588, 1581], 256], + 64779: [[1588, 1582], 256], + 64780: [[1588, 1605], 256], + 64781: [[1588, 1585], 256], + 64782: [[1587, 1585], 256], + 64783: [[1589, 1585], 256], + 64784: [[1590, 1585], 256], + 64785: [[1591, 1609], 256], + 64786: [[1591, 1610], 256], + 64787: [[1593, 1609], 256], + 64788: [[1593, 1610], 256], + 64789: [[1594, 1609], 256], + 64790: [[1594, 1610], 256], + 64791: [[1587, 1609], 256], + 64792: [[1587, 1610], 256], + 64793: [[1588, 1609], 256], + 64794: [[1588, 1610], 256], + 64795: [[1581, 1609], 256], + 64796: [[1581, 1610], 256], + 64797: [[1580, 1609], 256], + 64798: [[1580, 1610], 256], + 64799: [[1582, 1609], 256], + 64800: [[1582, 1610], 256], + 64801: [[1589, 1609], 256], + 64802: [[1589, 1610], 256], + 64803: [[1590, 1609], 256], + 64804: [[1590, 1610], 256], + 64805: [[1588, 1580], 256], + 64806: [[1588, 1581], 256], + 64807: [[1588, 1582], 256], + 64808: [[1588, 1605], 256], + 64809: [[1588, 1585], 256], + 64810: [[1587, 1585], 256], + 64811: [[1589, 1585], 256], + 64812: [[1590, 1585], 256], + 64813: [[1588, 1580], 256], + 64814: [[1588, 1581], 256], + 64815: [[1588, 1582], 256], + 64816: [[1588, 1605], 256], + 64817: [[1587, 1607], 256], + 64818: [[1588, 1607], 256], + 64819: [[1591, 1605], 256], + 64820: [[1587, 1580], 256], + 64821: [[1587, 1581], 256], + 64822: [[1587, 1582], 256], + 64823: [[1588, 1580], 256], + 64824: [[1588, 1581], 256], + 64825: [[1588, 1582], 256], + 64826: [[1591, 1605], 256], + 64827: [[1592, 1605], 256], + 64828: [[1575, 1611], 256], + 64829: [[1575, 1611], 256], + 64848: [[1578, 1580, 1605], 256], + 64849: [[1578, 1581, 1580], 256], + 64850: [[1578, 1581, 1580], 256], + 64851: [[1578, 1581, 1605], 256], + 64852: [[1578, 1582, 1605], 256], + 64853: [[1578, 1605, 1580], 256], + 64854: [[1578, 1605, 1581], 256], + 64855: [[1578, 1605, 1582], 256], + 64856: [[1580, 1605, 1581], 256], + 64857: [[1580, 1605, 1581], 256], + 64858: [[1581, 1605, 1610], 256], + 64859: [[1581, 1605, 1609], 256], + 64860: [[1587, 1581, 1580], 256], + 64861: [[1587, 1580, 1581], 256], + 64862: [[1587, 1580, 1609], 256], + 64863: [[1587, 1605, 1581], 256], + 64864: [[1587, 1605, 1581], 256], + 64865: [[1587, 1605, 1580], 256], + 64866: [[1587, 1605, 1605], 256], + 64867: [[1587, 1605, 1605], 256], + 64868: [[1589, 1581, 1581], 256], + 64869: [[1589, 1581, 1581], 256], + 64870: [[1589, 1605, 1605], 256], + 64871: [[1588, 1581, 1605], 256], + 64872: [[1588, 1581, 1605], 256], + 64873: [[1588, 1580, 1610], 256], + 64874: [[1588, 1605, 1582], 256], + 64875: [[1588, 1605, 1582], 256], + 64876: [[1588, 1605, 1605], 256], + 64877: [[1588, 1605, 1605], 256], + 64878: [[1590, 1581, 1609], 256], + 64879: [[1590, 1582, 1605], 256], + 64880: [[1590, 1582, 1605], 256], + 64881: [[1591, 1605, 1581], 256], + 64882: [[1591, 1605, 1581], 256], + 64883: [[1591, 1605, 1605], 256], + 64884: [[1591, 1605, 1610], 256], + 64885: [[1593, 1580, 1605], 256], + 64886: [[1593, 1605, 1605], 256], + 64887: [[1593, 1605, 1605], 256], + 64888: [[1593, 1605, 1609], 256], + 64889: [[1594, 1605, 1605], 256], + 64890: [[1594, 1605, 1610], 256], + 64891: [[1594, 1605, 1609], 256], + 64892: [[1601, 1582, 1605], 256], + 64893: [[1601, 1582, 1605], 256], + 64894: [[1602, 1605, 1581], 256], + 64895: [[1602, 1605, 1605], 256], + 64896: [[1604, 1581, 1605], 256], + 64897: [[1604, 1581, 1610], 256], + 64898: [[1604, 1581, 1609], 256], + 64899: [[1604, 1580, 1580], 256], + 64900: [[1604, 1580, 1580], 256], + 64901: [[1604, 1582, 1605], 256], + 64902: [[1604, 1582, 1605], 256], + 64903: [[1604, 1605, 1581], 256], + 64904: [[1604, 1605, 1581], 256], + 64905: [[1605, 1581, 1580], 256], + 64906: [[1605, 1581, 1605], 256], + 64907: [[1605, 1581, 1610], 256], + 64908: [[1605, 1580, 1581], 256], + 64909: [[1605, 1580, 1605], 256], + 64910: [[1605, 1582, 1580], 256], + 64911: [[1605, 1582, 1605], 256], + 64914: [[1605, 1580, 1582], 256], + 64915: [[1607, 1605, 1580], 256], + 64916: [[1607, 1605, 1605], 256], + 64917: [[1606, 1581, 1605], 256], + 64918: [[1606, 1581, 1609], 256], + 64919: [[1606, 1580, 1605], 256], + 64920: [[1606, 1580, 1605], 256], + 64921: [[1606, 1580, 1609], 256], + 64922: [[1606, 1605, 1610], 256], + 64923: [[1606, 1605, 1609], 256], + 64924: [[1610, 1605, 1605], 256], + 64925: [[1610, 1605, 1605], 256], + 64926: [[1576, 1582, 1610], 256], + 64927: [[1578, 1580, 1610], 256], + 64928: [[1578, 1580, 1609], 256], + 64929: [[1578, 1582, 1610], 256], + 64930: [[1578, 1582, 1609], 256], + 64931: [[1578, 1605, 1610], 256], + 64932: [[1578, 1605, 1609], 256], + 64933: [[1580, 1605, 1610], 256], + 64934: [[1580, 1581, 1609], 256], + 64935: [[1580, 1605, 1609], 256], + 64936: [[1587, 1582, 1609], 256], + 64937: [[1589, 1581, 1610], 256], + 64938: [[1588, 1581, 1610], 256], + 64939: [[1590, 1581, 1610], 256], + 64940: [[1604, 1580, 1610], 256], + 64941: [[1604, 1605, 1610], 256], + 64942: [[1610, 1581, 1610], 256], + 64943: [[1610, 1580, 1610], 256], + 64944: [[1610, 1605, 1610], 256], + 64945: [[1605, 1605, 1610], 256], + 64946: [[1602, 1605, 1610], 256], + 64947: [[1606, 1581, 1610], 256], + 64948: [[1602, 1605, 1581], 256], + 64949: [[1604, 1581, 1605], 256], + 64950: [[1593, 1605, 1610], 256], + 64951: [[1603, 1605, 1610], 256], + 64952: [[1606, 1580, 1581], 256], + 64953: [[1605, 1582, 1610], 256], + 64954: [[1604, 1580, 1605], 256], + 64955: [[1603, 1605, 1605], 256], + 64956: [[1604, 1580, 1605], 256], + 64957: [[1606, 1580, 1581], 256], + 64958: [[1580, 1581, 1610], 256], + 64959: [[1581, 1580, 1610], 256], + 64960: [[1605, 1580, 1610], 256], + 64961: [[1601, 1605, 1610], 256], + 64962: [[1576, 1581, 1610], 256], + 64963: [[1603, 1605, 1605], 256], + 64964: [[1593, 1580, 1605], 256], + 64965: [[1589, 1605, 1605], 256], + 64966: [[1587, 1582, 1610], 256], + 64967: [[1606, 1580, 1610], 256], + 65008: [[1589, 1604, 1746], 256], + 65009: [[1602, 1604, 1746], 256], + 65010: [[1575, 1604, 1604, 1607], 256], + 65011: [[1575, 1603, 1576, 1585], 256], + 65012: [[1605, 1581, 1605, 1583], 256], + 65013: [[1589, 1604, 1593, 1605], 256], + 65014: [[1585, 1587, 1608, 1604], 256], + 65015: [[1593, 1604, 1610, 1607], 256], + 65016: [[1608, 1587, 1604, 1605], 256], + 65017: [[1589, 1604, 1609], 256], + 65018: [ + [ + 1589, 1604, 1609, 32, 1575, 1604, 1604, 1607, 32, 1593, 1604, 1610, 1607, 32, 1608, + 1587, 1604, 1605 + ], + 256 + ], + 65019: [[1580, 1604, 32, 1580, 1604, 1575, 1604, 1607], 256], + 65020: [[1585, 1740, 1575, 1604], 256] + }, + 65024: { + 65040: [[44], 256], + 65041: [[12289], 256], + 65042: [[12290], 256], + 65043: [[58], 256], + 65044: [[59], 256], + 65045: [[33], 256], + 65046: [[63], 256], + 65047: [[12310], 256], + 65048: [[12311], 256], + 65049: [[8230], 256], + 65056: [, 230], + 65057: [, 230], + 65058: [, 230], + 65059: [, 230], + 65060: [, 230], + 65061: [, 230], + 65062: [, 230], + 65072: [[8229], 256], + 65073: [[8212], 256], + 65074: [[8211], 256], + 65075: [[95], 256], + 65076: [[95], 256], + 65077: [[40], 256], + 65078: [[41], 256], + 65079: [[123], 256], + 65080: [[125], 256], + 65081: [[12308], 256], + 65082: [[12309], 256], + 65083: [[12304], 256], + 65084: [[12305], 256], + 65085: [[12298], 256], + 65086: [[12299], 256], + 65087: [[12296], 256], + 65088: [[12297], 256], + 65089: [[12300], 256], + 65090: [[12301], 256], + 65091: [[12302], 256], + 65092: [[12303], 256], + 65095: [[91], 256], + 65096: [[93], 256], + 65097: [[8254], 256], + 65098: [[8254], 256], + 65099: [[8254], 256], + 65100: [[8254], 256], + 65101: [[95], 256], + 65102: [[95], 256], + 65103: [[95], 256], + 65104: [[44], 256], + 65105: [[12289], 256], + 65106: [[46], 256], + 65108: [[59], 256], + 65109: [[58], 256], + 65110: [[63], 256], + 65111: [[33], 256], + 65112: [[8212], 256], + 65113: [[40], 256], + 65114: [[41], 256], + 65115: [[123], 256], + 65116: [[125], 256], + 65117: [[12308], 256], + 65118: [[12309], 256], + 65119: [[35], 256], + 65120: [[38], 256], + 65121: [[42], 256], + 65122: [[43], 256], + 65123: [[45], 256], + 65124: [[60], 256], + 65125: [[62], 256], + 65126: [[61], 256], + 65128: [[92], 256], + 65129: [[36], 256], + 65130: [[37], 256], + 65131: [[64], 256], + 65136: [[32, 1611], 256], + 65137: [[1600, 1611], 256], + 65138: [[32, 1612], 256], + 65140: [[32, 1613], 256], + 65142: [[32, 1614], 256], + 65143: [[1600, 1614], 256], + 65144: [[32, 1615], 256], + 65145: [[1600, 1615], 256], + 65146: [[32, 1616], 256], + 65147: [[1600, 1616], 256], + 65148: [[32, 1617], 256], + 65149: [[1600, 1617], 256], + 65150: [[32, 1618], 256], + 65151: [[1600, 1618], 256], + 65152: [[1569], 256], + 65153: [[1570], 256], + 65154: [[1570], 256], + 65155: [[1571], 256], + 65156: [[1571], 256], + 65157: [[1572], 256], + 65158: [[1572], 256], + 65159: [[1573], 256], + 65160: [[1573], 256], + 65161: [[1574], 256], + 65162: [[1574], 256], + 65163: [[1574], 256], + 65164: [[1574], 256], + 65165: [[1575], 256], + 65166: [[1575], 256], + 65167: [[1576], 256], + 65168: [[1576], 256], + 65169: [[1576], 256], + 65170: [[1576], 256], + 65171: [[1577], 256], + 65172: [[1577], 256], + 65173: [[1578], 256], + 65174: [[1578], 256], + 65175: [[1578], 256], + 65176: [[1578], 256], + 65177: [[1579], 256], + 65178: [[1579], 256], + 65179: [[1579], 256], + 65180: [[1579], 256], + 65181: [[1580], 256], + 65182: [[1580], 256], + 65183: [[1580], 256], + 65184: [[1580], 256], + 65185: [[1581], 256], + 65186: [[1581], 256], + 65187: [[1581], 256], + 65188: [[1581], 256], + 65189: [[1582], 256], + 65190: [[1582], 256], + 65191: [[1582], 256], + 65192: [[1582], 256], + 65193: [[1583], 256], + 65194: [[1583], 256], + 65195: [[1584], 256], + 65196: [[1584], 256], + 65197: [[1585], 256], + 65198: [[1585], 256], + 65199: [[1586], 256], + 65200: [[1586], 256], + 65201: [[1587], 256], + 65202: [[1587], 256], + 65203: [[1587], 256], + 65204: [[1587], 256], + 65205: [[1588], 256], + 65206: [[1588], 256], + 65207: [[1588], 256], + 65208: [[1588], 256], + 65209: [[1589], 256], + 65210: [[1589], 256], + 65211: [[1589], 256], + 65212: [[1589], 256], + 65213: [[1590], 256], + 65214: [[1590], 256], + 65215: [[1590], 256], + 65216: [[1590], 256], + 65217: [[1591], 256], + 65218: [[1591], 256], + 65219: [[1591], 256], + 65220: [[1591], 256], + 65221: [[1592], 256], + 65222: [[1592], 256], + 65223: [[1592], 256], + 65224: [[1592], 256], + 65225: [[1593], 256], + 65226: [[1593], 256], + 65227: [[1593], 256], + 65228: [[1593], 256], + 65229: [[1594], 256], + 65230: [[1594], 256], + 65231: [[1594], 256], + 65232: [[1594], 256], + 65233: [[1601], 256], + 65234: [[1601], 256], + 65235: [[1601], 256], + 65236: [[1601], 256], + 65237: [[1602], 256], + 65238: [[1602], 256], + 65239: [[1602], 256], + 65240: [[1602], 256], + 65241: [[1603], 256], + 65242: [[1603], 256], + 65243: [[1603], 256], + 65244: [[1603], 256], + 65245: [[1604], 256], + 65246: [[1604], 256], + 65247: [[1604], 256], + 65248: [[1604], 256], + 65249: [[1605], 256], + 65250: [[1605], 256], + 65251: [[1605], 256], + 65252: [[1605], 256], + 65253: [[1606], 256], + 65254: [[1606], 256], + 65255: [[1606], 256], + 65256: [[1606], 256], + 65257: [[1607], 256], + 65258: [[1607], 256], + 65259: [[1607], 256], + 65260: [[1607], 256], + 65261: [[1608], 256], + 65262: [[1608], 256], + 65263: [[1609], 256], + 65264: [[1609], 256], + 65265: [[1610], 256], + 65266: [[1610], 256], + 65267: [[1610], 256], + 65268: [[1610], 256], + 65269: [[1604, 1570], 256], + 65270: [[1604, 1570], 256], + 65271: [[1604, 1571], 256], + 65272: [[1604, 1571], 256], + 65273: [[1604, 1573], 256], + 65274: [[1604, 1573], 256], + 65275: [[1604, 1575], 256], + 65276: [[1604, 1575], 256] + }, + 65280: { + 65281: [[33], 256], + 65282: [[34], 256], + 65283: [[35], 256], + 65284: [[36], 256], + 65285: [[37], 256], + 65286: [[38], 256], + 65287: [[39], 256], + 65288: [[40], 256], + 65289: [[41], 256], + 65290: [[42], 256], + 65291: [[43], 256], + 65292: [[44], 256], + 65293: [[45], 256], + 65294: [[46], 256], + 65295: [[47], 256], + 65296: [[48], 256], + 65297: [[49], 256], + 65298: [[50], 256], + 65299: [[51], 256], + 65300: [[52], 256], + 65301: [[53], 256], + 65302: [[54], 256], + 65303: [[55], 256], + 65304: [[56], 256], + 65305: [[57], 256], + 65306: [[58], 256], + 65307: [[59], 256], + 65308: [[60], 256], + 65309: [[61], 256], + 65310: [[62], 256], + 65311: [[63], 256], + 65312: [[64], 256], + 65313: [[65], 256], + 65314: [[66], 256], + 65315: [[67], 256], + 65316: [[68], 256], + 65317: [[69], 256], + 65318: [[70], 256], + 65319: [[71], 256], + 65320: [[72], 256], + 65321: [[73], 256], + 65322: [[74], 256], + 65323: [[75], 256], + 65324: [[76], 256], + 65325: [[77], 256], + 65326: [[78], 256], + 65327: [[79], 256], + 65328: [[80], 256], + 65329: [[81], 256], + 65330: [[82], 256], + 65331: [[83], 256], + 65332: [[84], 256], + 65333: [[85], 256], + 65334: [[86], 256], + 65335: [[87], 256], + 65336: [[88], 256], + 65337: [[89], 256], + 65338: [[90], 256], + 65339: [[91], 256], + 65340: [[92], 256], + 65341: [[93], 256], + 65342: [[94], 256], + 65343: [[95], 256], + 65344: [[96], 256], + 65345: [[97], 256], + 65346: [[98], 256], + 65347: [[99], 256], + 65348: [[100], 256], + 65349: [[101], 256], + 65350: [[102], 256], + 65351: [[103], 256], + 65352: [[104], 256], + 65353: [[105], 256], + 65354: [[106], 256], + 65355: [[107], 256], + 65356: [[108], 256], + 65357: [[109], 256], + 65358: [[110], 256], + 65359: [[111], 256], + 65360: [[112], 256], + 65361: [[113], 256], + 65362: [[114], 256], + 65363: [[115], 256], + 65364: [[116], 256], + 65365: [[117], 256], + 65366: [[118], 256], + 65367: [[119], 256], + 65368: [[120], 256], + 65369: [[121], 256], + 65370: [[122], 256], + 65371: [[123], 256], + 65372: [[124], 256], + 65373: [[125], 256], + 65374: [[126], 256], + 65375: [[10629], 256], + 65376: [[10630], 256], + 65377: [[12290], 256], + 65378: [[12300], 256], + 65379: [[12301], 256], + 65380: [[12289], 256], + 65381: [[12539], 256], + 65382: [[12530], 256], + 65383: [[12449], 256], + 65384: [[12451], 256], + 65385: [[12453], 256], + 65386: [[12455], 256], + 65387: [[12457], 256], + 65388: [[12515], 256], + 65389: [[12517], 256], + 65390: [[12519], 256], + 65391: [[12483], 256], + 65392: [[12540], 256], + 65393: [[12450], 256], + 65394: [[12452], 256], + 65395: [[12454], 256], + 65396: [[12456], 256], + 65397: [[12458], 256], + 65398: [[12459], 256], + 65399: [[12461], 256], + 65400: [[12463], 256], + 65401: [[12465], 256], + 65402: [[12467], 256], + 65403: [[12469], 256], + 65404: [[12471], 256], + 65405: [[12473], 256], + 65406: [[12475], 256], + 65407: [[12477], 256], + 65408: [[12479], 256], + 65409: [[12481], 256], + 65410: [[12484], 256], + 65411: [[12486], 256], + 65412: [[12488], 256], + 65413: [[12490], 256], + 65414: [[12491], 256], + 65415: [[12492], 256], + 65416: [[12493], 256], + 65417: [[12494], 256], + 65418: [[12495], 256], + 65419: [[12498], 256], + 65420: [[12501], 256], + 65421: [[12504], 256], + 65422: [[12507], 256], + 65423: [[12510], 256], + 65424: [[12511], 256], + 65425: [[12512], 256], + 65426: [[12513], 256], + 65427: [[12514], 256], + 65428: [[12516], 256], + 65429: [[12518], 256], + 65430: [[12520], 256], + 65431: [[12521], 256], + 65432: [[12522], 256], + 65433: [[12523], 256], + 65434: [[12524], 256], + 65435: [[12525], 256], + 65436: [[12527], 256], + 65437: [[12531], 256], + 65438: [[12441], 256], + 65439: [[12442], 256], + 65440: [[12644], 256], + 65441: [[12593], 256], + 65442: [[12594], 256], + 65443: [[12595], 256], + 65444: [[12596], 256], + 65445: [[12597], 256], + 65446: [[12598], 256], + 65447: [[12599], 256], + 65448: [[12600], 256], + 65449: [[12601], 256], + 65450: [[12602], 256], + 65451: [[12603], 256], + 65452: [[12604], 256], + 65453: [[12605], 256], + 65454: [[12606], 256], + 65455: [[12607], 256], + 65456: [[12608], 256], + 65457: [[12609], 256], + 65458: [[12610], 256], + 65459: [[12611], 256], + 65460: [[12612], 256], + 65461: [[12613], 256], + 65462: [[12614], 256], + 65463: [[12615], 256], + 65464: [[12616], 256], + 65465: [[12617], 256], + 65466: [[12618], 256], + 65467: [[12619], 256], + 65468: [[12620], 256], + 65469: [[12621], 256], + 65470: [[12622], 256], + 65474: [[12623], 256], + 65475: [[12624], 256], + 65476: [[12625], 256], + 65477: [[12626], 256], + 65478: [[12627], 256], + 65479: [[12628], 256], + 65482: [[12629], 256], + 65483: [[12630], 256], + 65484: [[12631], 256], + 65485: [[12632], 256], + 65486: [[12633], 256], + 65487: [[12634], 256], + 65490: [[12635], 256], + 65491: [[12636], 256], + 65492: [[12637], 256], + 65493: [[12638], 256], + 65494: [[12639], 256], + 65495: [[12640], 256], + 65498: [[12641], 256], + 65499: [[12642], 256], + 65500: [[12643], 256], + 65504: [[162], 256], + 65505: [[163], 256], + 65506: [[172], 256], + 65507: [[175], 256], + 65508: [[166], 256], + 65509: [[165], 256], + 65510: [[8361], 256], + 65512: [[9474], 256], + 65513: [[8592], 256], + 65514: [[8593], 256], + 65515: [[8594], 256], + 65516: [[8595], 256], + 65517: [[9632], 256], + 65518: [[9675], 256] + } +}; diff --git a/node_modules/es5-ext/string/#/normalize/implement.js b/node_modules/es5-ext/string/#/normalize/implement.js new file mode 100644 index 0000000..deb6089 --- /dev/null +++ b/node_modules/es5-ext/string/#/normalize/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String.prototype, "normalize", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/string/#/normalize/index.js b/node_modules/es5-ext/string/#/normalize/index.js new file mode 100644 index 0000000..a8c04db --- /dev/null +++ b/node_modules/es5-ext/string/#/normalize/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? String.prototype.normalize : require("./shim"); diff --git a/node_modules/es5-ext/string/#/normalize/is-implemented.js b/node_modules/es5-ext/string/#/normalize/is-implemented.js new file mode 100644 index 0000000..01b48a9 --- /dev/null +++ b/node_modules/es5-ext/string/#/normalize/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var str = "æøåäüö"; + +module.exports = function () { + if (typeof str.normalize !== "function") return false; + return str.normalize("NFKD") === "æøåäüö"; +}; diff --git a/node_modules/es5-ext/string/#/normalize/shim.js b/node_modules/es5-ext/string/#/normalize/shim.js new file mode 100644 index 0000000..95bae26 --- /dev/null +++ b/node_modules/es5-ext/string/#/normalize/shim.js @@ -0,0 +1,309 @@ +/* eslint no-bitwise: "off", max-statements: "off", max-lines: "off" */ + +// Taken from: https://github.com/walling/unorm/blob/master/lib/unorm.js + +/* + * UnicodeNormalizer 1.0.0 + * Copyright (c) 2008 Matsuza + * Dual licensed under the MIT (MIT-LICENSE.txt) and + * GPL (GPL-LICENSE.txt) licenses. + * $Date: 2008-06-05 16:44:17 +0200 (Thu, 05 Jun 2008) $ + * $Rev: 13309 $ + */ + +"use strict"; + +var primitiveSet = require("../../../object/primitive-set") + , validValue = require("../../../object/valid-value") + , data = require("./_data"); + +var floor = Math.floor + , forms = primitiveSet("NFC", "NFD", "NFKC", "NFKD") + , DEFAULT_FEATURE = [null, 0, {}] + , CACHE_THRESHOLD = 10 + , SBase = 0xac00 + , LBase = 0x1100 + , VBase = 0x1161 + , TBase = 0x11a7 + , LCount = 19 + , VCount = 21 + , TCount = 28 + , NCount = VCount * TCount + , SCount = LCount * NCount + , UChar + , cache = {} + , cacheCounter = [] + , fromCache + , fromData + , fromCpOnly + , fromRuleBasedJamo + , fromCpFilter + , strategies + , UCharIterator + , RecursDecompIterator + , DecompIterator + , CompIterator + , createIterator + , normalize; + +UChar = function (cp, feature) { + this.codepoint = cp; + this.feature = feature; +}; + +// Strategies +(function () { for (var i = 0; i <= 0xff; ++i) cacheCounter[i] = 0; })(); + +fromCache = function (nextStep, cp, needFeature) { + var ret = cache[cp]; + if (!ret) { + ret = nextStep(cp, needFeature); + if (Boolean(ret.feature) && ++cacheCounter[(cp >> 8) & 0xff] > CACHE_THRESHOLD) { + cache[cp] = ret; + } + } + return ret; +}; + +fromData = function (next, cp) { + var hash = cp & 0xff00, dunit = UChar.udata[hash] || {}, feature = dunit[cp]; + return feature ? new UChar(cp, feature) : new UChar(cp, DEFAULT_FEATURE); +}; +fromCpOnly = function (next, cp, needFeature) { + return needFeature ? next(cp, needFeature) : new UChar(cp, null); +}; + +fromRuleBasedJamo = function (next, cp, needFeature) { + var char, base, i, arr, SIndex, TIndex, feature, j; + if (cp < LBase || (LBase + LCount <= cp && cp < SBase) || SBase + SCount < cp) { + return next(cp, needFeature); + } + if (LBase <= cp && cp < LBase + LCount) { + char = {}; + base = (cp - LBase) * VCount; + for (i = 0; i < VCount; ++i) { + char[VBase + i] = SBase + TCount * (i + base); + } + arr = new Array(3); + arr[2] = char; + return new UChar(cp, arr); + } + + SIndex = cp - SBase; + TIndex = SIndex % TCount; + feature = []; + if (TIndex === 0) { + feature[0] = [LBase + floor(SIndex / NCount), VBase + floor((SIndex % NCount) / TCount)]; + feature[2] = {}; + for (j = 1; j < TCount; ++j) { + feature[2][TBase + j] = cp + j; + } + } else { + feature[0] = [SBase + SIndex - TIndex, TBase + TIndex]; + } + return new UChar(cp, feature); +}; + +fromCpFilter = function (next, cp, needFeature) { + return cp < 60 || (cp > 13311 && cp < 42607) + ? new UChar(cp, DEFAULT_FEATURE) + : next(cp, needFeature); +}; + +strategies = [fromCpFilter, fromCache, fromCpOnly, fromRuleBasedJamo, fromData]; + +UChar.fromCharCode = strategies.reduceRight(function (next, strategy) { + return function (cp, needFeature) { return strategy(next, cp, needFeature); }; +}, null); + +UChar.isHighSurrogate = function (cp) { return cp >= 0xd800 && cp <= 0xdbff; }; +UChar.isLowSurrogate = function (cp) { return cp >= 0xdc00 && cp <= 0xdfff; }; + +UChar.prototype.prepFeature = function () { + if (!this.feature) { + this.feature = UChar.fromCharCode(this.codepoint, true).feature; + } +}; + +UChar.prototype.toString = function () { + var num; + if (this.codepoint < 0x10000) return String.fromCharCode(this.codepoint); + num = this.codepoint - 0x10000; + return String.fromCharCode(floor(num / 0x400) + 0xd800, (num % 0x400) + 0xdc00); +}; + +UChar.prototype.getDecomp = function () { + this.prepFeature(); + return this.feature[0] || null; +}; + +UChar.prototype.isCompatibility = function () { + this.prepFeature(); + return Boolean(this.feature[1]) && this.feature[1] & (1 << 8); +}; +UChar.prototype.isExclude = function () { + this.prepFeature(); + return Boolean(this.feature[1]) && this.feature[1] & (1 << 9); +}; +UChar.prototype.getCanonicalClass = function () { + this.prepFeature(); + return this.feature[1] ? this.feature[1] & 0xff : 0; +}; +UChar.prototype.getComposite = function (following) { + var cp; + this.prepFeature(); + if (!this.feature[2]) return null; + cp = this.feature[2][following.codepoint]; + return cp ? UChar.fromCharCode(cp) : null; +}; + +UCharIterator = function (str) { + this.str = str; + this.cursor = 0; +}; +UCharIterator.prototype.next = function () { + if (Boolean(this.str) && this.cursor < this.str.length) { + var cp = this.str.charCodeAt(this.cursor++), d; + if ( + UChar.isHighSurrogate(cp) && + this.cursor < this.str.length && + UChar.isLowSurrogate((d = this.str.charCodeAt(this.cursor))) + ) { + cp = (cp - 0xd800) * 0x400 + (d - 0xdc00) + 0x10000; + ++this.cursor; + } + return UChar.fromCharCode(cp); + } + this.str = null; + return null; +}; + +RecursDecompIterator = function (it, cano) { + this.it = it; + this.canonical = cano; + this.resBuf = []; +}; + +RecursDecompIterator.prototype.next = function () { + var recursiveDecomp, uchar; + recursiveDecomp = function (cano, ucharLoc) { + var decomp = ucharLoc.getDecomp(), ret, i, a, j; + if (Boolean(decomp) && !(cano && ucharLoc.isCompatibility())) { + ret = []; + for (i = 0; i < decomp.length; ++i) { + a = recursiveDecomp(cano, UChar.fromCharCode(decomp[i])); + // Ret.concat(a); //<-why does not this work? + // following block is a workaround. + for (j = 0; j < a.length; ++j) ret.push(a[j]); + } + return ret; + } + return [ucharLoc]; + }; + if (this.resBuf.length === 0) { + uchar = this.it.next(); + if (!uchar) return null; + this.resBuf = recursiveDecomp(this.canonical, uchar); + } + return this.resBuf.shift(); +}; + +DecompIterator = function (it) { + this.it = it; + this.resBuf = []; +}; + +DecompIterator.prototype.next = function () { + var cc, uchar, inspt, uchar2, cc2; + if (this.resBuf.length === 0) { + do { + uchar = this.it.next(); + if (!uchar) break; + cc = uchar.getCanonicalClass(); + inspt = this.resBuf.length; + if (cc !== 0) { + for (inspt; inspt > 0; --inspt) { + uchar2 = this.resBuf[inspt - 1]; + cc2 = uchar2.getCanonicalClass(); + // eslint-disable-next-line max-depth + if (cc2 <= cc) break; + } + } + this.resBuf.splice(inspt, 0, uchar); + } while (cc !== 0); + } + return this.resBuf.shift(); +}; + +CompIterator = function (it) { + this.it = it; + this.procBuf = []; + this.resBuf = []; + this.lastClass = null; +}; + +CompIterator.prototype.next = function () { + var uchar, starter, composite, cc; + while (this.resBuf.length === 0) { + uchar = this.it.next(); + if (!uchar) { + this.resBuf = this.procBuf; + this.procBuf = []; + break; + } + if (this.procBuf.length === 0) { + this.lastClass = uchar.getCanonicalClass(); + this.procBuf.push(uchar); + } else { + starter = this.procBuf[0]; + composite = starter.getComposite(uchar); + cc = uchar.getCanonicalClass(); + if (Boolean(composite) && (this.lastClass < cc || this.lastClass === 0)) { + this.procBuf[0] = composite; + } else { + if (cc === 0) { + this.resBuf = this.procBuf; + this.procBuf = []; + } + this.lastClass = cc; + this.procBuf.push(uchar); + } + } + } + return this.resBuf.shift(); +}; + +createIterator = function (mode, str) { + switch (mode) { + case "NFD": + return new DecompIterator(new RecursDecompIterator(new UCharIterator(str), true)); + case "NFKD": + return new DecompIterator(new RecursDecompIterator(new UCharIterator(str), false)); + case "NFC": + return new CompIterator( + new DecompIterator(new RecursDecompIterator(new UCharIterator(str), true)) + ); + case "NFKC": + return new CompIterator( + new DecompIterator(new RecursDecompIterator(new UCharIterator(str), false)) + ); + default: + throw new Error(mode + " is invalid"); + } +}; +normalize = function (mode, str) { + var it = createIterator(mode, str), ret = "", uchar; + while ((uchar = it.next())) ret += uchar.toString(); + return ret; +}; + +/* Unicode data */ +UChar.udata = data; + +module.exports = function (/* Form*/) { + var str = String(validValue(this)), form = arguments[0]; + if (form === undefined) form = "NFC"; + else form = String(form); + if (!forms[form]) throw new RangeError("Invalid normalization form: " + form); + return normalize(form, str); +}; diff --git a/node_modules/es5-ext/string/#/pad.js b/node_modules/es5-ext/string/#/pad.js new file mode 100644 index 0000000..113a873 --- /dev/null +++ b/node_modules/es5-ext/string/#/pad.js @@ -0,0 +1,16 @@ +"use strict"; + +var toInteger = require("../../number/to-integer") + , value = require("../../object/valid-value") + , repeat = require("./repeat") + , abs = Math.abs + , max = Math.max; + +module.exports = function (fill/*, length*/) { + var self = String(value(this)), sLength = self.length, length = arguments[1]; + + length = isNaN(length) ? 1 : toInteger(length); + fill = repeat.call(String(fill), abs(length)); + if (length >= 0) return fill.slice(0, max(0, length - sLength)) + self; + return self + (sLength + length >= 0 ? "" : fill.slice(length + sLength)); +}; diff --git a/node_modules/es5-ext/string/#/plain-replace-all.js b/node_modules/es5-ext/string/#/plain-replace-all.js new file mode 100644 index 0000000..9334fe0 --- /dev/null +++ b/node_modules/es5-ext/string/#/plain-replace-all.js @@ -0,0 +1,16 @@ +"use strict"; + +var value = require("../../object/valid-value"); + +module.exports = function (search, replace) { + var index, pos = 0, str = String(value(this)), sl, rl; + search = String(search); + replace = String(replace); + sl = search.length; + rl = replace.length; + while ((index = str.indexOf(search, pos)) !== -1) { + str = str.slice(0, index) + replace + str.slice(index + sl); + pos = index + rl; + } + return str; +}; diff --git a/node_modules/es5-ext/string/#/plain-replace.js b/node_modules/es5-ext/string/#/plain-replace.js new file mode 100644 index 0000000..b8bfe3d --- /dev/null +++ b/node_modules/es5-ext/string/#/plain-replace.js @@ -0,0 +1,9 @@ +"use strict"; + +var indexOf = String.prototype.indexOf, slice = String.prototype.slice; + +module.exports = function (search, replace) { + var index = indexOf.call(this, search); + if (index === -1) return String(this); + return slice.call(this, 0, index) + replace + slice.call(this, index + String(search).length); +}; diff --git a/node_modules/es5-ext/string/#/repeat/implement.js b/node_modules/es5-ext/string/#/repeat/implement.js new file mode 100644 index 0000000..f237dcd --- /dev/null +++ b/node_modules/es5-ext/string/#/repeat/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String.prototype, "repeat", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/string/#/repeat/index.js b/node_modules/es5-ext/string/#/repeat/index.js new file mode 100644 index 0000000..abcb601 --- /dev/null +++ b/node_modules/es5-ext/string/#/repeat/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? String.prototype.repeat : require("./shim"); diff --git a/node_modules/es5-ext/string/#/repeat/is-implemented.js b/node_modules/es5-ext/string/#/repeat/is-implemented.js new file mode 100644 index 0000000..e8e0240 --- /dev/null +++ b/node_modules/es5-ext/string/#/repeat/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var str = "foo"; + +module.exports = function () { + if (typeof str.repeat !== "function") return false; + return str.repeat(2) === "foofoo"; +}; diff --git a/node_modules/es5-ext/string/#/repeat/shim.js b/node_modules/es5-ext/string/#/repeat/shim.js new file mode 100644 index 0000000..ac259a8 --- /dev/null +++ b/node_modules/es5-ext/string/#/repeat/shim.js @@ -0,0 +1,24 @@ +// Thanks +// @rauchma http://www.2ality.com/2014/01/efficient-string-repeat.html +// @mathiasbynens https://github.com/mathiasbynens/String.prototype.repeat/blob/4a4b567def/repeat.js + +"use strict"; + +var value = require("../../../object/valid-value") + , toInteger = require("../../../number/to-integer"); + +module.exports = function (count) { + var str = String(value(this)), result; + count = toInteger(count); + if (count < 0) throw new RangeError("Count must be >= 0"); + if (!isFinite(count)) throw new RangeError("Count must be < ∞"); + + result = ""; + while (count) { + if (count % 2) result += str; + if (count > 1) str += str; + // eslint-disable-next-line no-bitwise + count >>= 1; + } + return result; +}; diff --git a/node_modules/es5-ext/string/#/starts-with/implement.js b/node_modules/es5-ext/string/#/starts-with/implement.js new file mode 100644 index 0000000..62abadb --- /dev/null +++ b/node_modules/es5-ext/string/#/starts-with/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String.prototype, "startsWith", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/string/#/starts-with/index.js b/node_modules/es5-ext/string/#/starts-with/index.js new file mode 100644 index 0000000..a0a368f --- /dev/null +++ b/node_modules/es5-ext/string/#/starts-with/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? String.prototype.startsWith : require("./shim"); diff --git a/node_modules/es5-ext/string/#/starts-with/is-implemented.js b/node_modules/es5-ext/string/#/starts-with/is-implemented.js new file mode 100644 index 0000000..d1241bc --- /dev/null +++ b/node_modules/es5-ext/string/#/starts-with/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var str = "razdwatrzy"; + +module.exports = function () { + if (typeof str.startsWith !== "function") return false; + return str.startsWith("trzy") === false && str.startsWith("raz") === true; +}; diff --git a/node_modules/es5-ext/string/#/starts-with/shim.js b/node_modules/es5-ext/string/#/starts-with/shim.js new file mode 100644 index 0000000..053c885 --- /dev/null +++ b/node_modules/es5-ext/string/#/starts-with/shim.js @@ -0,0 +1,12 @@ +"use strict"; + +var value = require("../../../object/valid-value") + , toInteger = require("../../../number/to-integer") + , max = Math.max + , min = Math.min; + +module.exports = function (searchString/*, position*/) { + var start, self = String(value(this)); + start = min(max(toInteger(arguments[1]), 0), self.length); + return self.indexOf(searchString, start) === start; +}; diff --git a/node_modules/es5-ext/string/#/uncapitalize.js b/node_modules/es5-ext/string/#/uncapitalize.js new file mode 100644 index 0000000..202dbb7 --- /dev/null +++ b/node_modules/es5-ext/string/#/uncapitalize.js @@ -0,0 +1,8 @@ +"use strict"; + +var ensureStringifiable = require("../../object/validate-stringifiable-value"); + +module.exports = function () { + var str = ensureStringifiable(this); + return str.charAt(0).toLowerCase() + str.slice(1); +}; diff --git a/node_modules/es5-ext/string/format-method.js b/node_modules/es5-ext/string/format-method.js new file mode 100644 index 0000000..28956fe --- /dev/null +++ b/node_modules/es5-ext/string/format-method.js @@ -0,0 +1,27 @@ +"use strict"; + +var isCallable = require("../object/is-callable") + , value = require("../object/valid-value") + , call = Function.prototype.call; + +module.exports = function (fmap) { + fmap = Object(value(fmap)); + return function (pattern) { + var context = this; + value(context); + pattern = String(pattern); + return pattern.replace(/%([a-zA-Z]+)|\\([\u0000-\uffff])/g, function ( + match, + token, + escapeChar + ) { + var t, result; + if (escapeChar) return escapeChar; + t = token; + while (t && !(result = fmap[t])) t = t.slice(0, -1); + if (!result) return match; + if (isCallable(result)) result = call.call(result, context); + return result + token.slice(t.length); + }); + }; +}; diff --git a/node_modules/es5-ext/string/from-code-point/implement.js b/node_modules/es5-ext/string/from-code-point/implement.js new file mode 100644 index 0000000..71728bf --- /dev/null +++ b/node_modules/es5-ext/string/from-code-point/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String, "fromCodePoint", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/string/from-code-point/index.js b/node_modules/es5-ext/string/from-code-point/index.js new file mode 100644 index 0000000..5a5fc5b --- /dev/null +++ b/node_modules/es5-ext/string/from-code-point/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? String.fromCodePoint : require("./shim"); diff --git a/node_modules/es5-ext/string/from-code-point/is-implemented.js b/node_modules/es5-ext/string/from-code-point/is-implemented.js new file mode 100644 index 0000000..ae4b818 --- /dev/null +++ b/node_modules/es5-ext/string/from-code-point/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var fromCodePoint = String.fromCodePoint; + if (typeof fromCodePoint !== "function") return false; + return fromCodePoint(0x1d306, 0x61, 0x1d307) === "\ud834\udf06a\ud834\udf07"; +}; diff --git a/node_modules/es5-ext/string/from-code-point/shim.js b/node_modules/es5-ext/string/from-code-point/shim.js new file mode 100644 index 0000000..c2f1c3a --- /dev/null +++ b/node_modules/es5-ext/string/from-code-point/shim.js @@ -0,0 +1,37 @@ +// Based on: +// http://norbertlindenberg.com/2012/05/ecmascript-supplementary-characters/ +// and: +// https://github.com/mathiasbynens/String.fromCodePoint/blob/master +// /fromcodepoint.js + +"use strict"; + +var floor = Math.floor, fromCharCode = String.fromCharCode; + +// eslint-disable-next-line no-unused-vars +module.exports = function (codePoint1/*, …codePoints*/) { + var chars = [], length = arguments.length, i, codePoint, result = ""; + for (i = 0; i < length; ++i) { + codePoint = Number(arguments[i]); + if ( + !isFinite(codePoint) || + codePoint < 0 || + codePoint > 0x10ffff || + floor(codePoint) !== codePoint + ) { + throw new RangeError("Invalid code point " + codePoint); + } + + if (codePoint < 0x10000) { + chars.push(codePoint); + } else { + codePoint -= 0x10000; + // eslint-disable-next-line no-bitwise + chars.push((codePoint >> 10) + 0xd800, (codePoint % 0x400) + 0xdc00); + } + if (i + 1 !== length && chars.length <= 0x4000) continue; + result += fromCharCode.apply(null, chars); + chars.length = 0; + } + return result; +}; diff --git a/node_modules/es5-ext/string/index.js b/node_modules/es5-ext/string/index.js new file mode 100644 index 0000000..4393588 --- /dev/null +++ b/node_modules/es5-ext/string/index.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = { + "#": require("./#"), + "formatMethod": require("./format-method"), + "fromCodePoint": require("./from-code-point"), + "isString": require("./is-string"), + "random": require("./random"), + "randomUniq": require("./random-uniq"), + "raw": require("./raw") +}; diff --git a/node_modules/es5-ext/string/is-string.js b/node_modules/es5-ext/string/is-string.js new file mode 100644 index 0000000..1b1e863 --- /dev/null +++ b/node_modules/es5-ext/string/is-string.js @@ -0,0 +1,13 @@ +"use strict"; + +var objToString = Object.prototype.toString, id = objToString.call(""); + +module.exports = function (value) { + return ( + typeof value === "string" || + (value && + typeof value === "object" && + (value instanceof String || objToString.call(value) === id)) || + false + ); +}; diff --git a/node_modules/es5-ext/string/random-uniq.js b/node_modules/es5-ext/string/random-uniq.js new file mode 100644 index 0000000..ae57b29 --- /dev/null +++ b/node_modules/es5-ext/string/random-uniq.js @@ -0,0 +1,11 @@ +"use strict"; + +var generated = Object.create(null), random = Math.random; + +module.exports = function () { + var str; + do { + str = random().toString(36).slice(2); + } while (generated[str]); + return str; +}; diff --git a/node_modules/es5-ext/string/random.js b/node_modules/es5-ext/string/random.js new file mode 100644 index 0000000..8fda5de --- /dev/null +++ b/node_modules/es5-ext/string/random.js @@ -0,0 +1,38 @@ +"use strict"; + +var isValue = require("../object/is-value") + , toNaturalNumber = require("../number/to-pos-integer"); + +var generated = Object.create(null), random = Math.random, uniqTryLimit = 100; + +var getChunk = function () { return random().toString(36).slice(2); }; + +var getString = function (/* length */) { + var str = getChunk(), length = arguments[0]; + if (!isValue(length)) return str; + while (str.length < length) str += getChunk(); + return str.slice(0, length); +}; + +module.exports = function (/* options */) { + var options = Object(arguments[0]), length = options.length, isUnique = options.isUnique; + + if (isValue(length)) length = toNaturalNumber(length); + + var str = getString(length); + if (isUnique) { + var count = 0; + while (generated[str]) { + if (++count === uniqTryLimit) { + throw new Error( + "Cannot generate random string.\n" + + "String.random is not designed to effectively generate many short and " + + "unique random strings" + ); + } + str = getString(length); + } + generated[str] = true; + } + return str; +}; diff --git a/node_modules/es5-ext/string/raw/implement.js b/node_modules/es5-ext/string/raw/implement.js new file mode 100644 index 0000000..24f17c2 --- /dev/null +++ b/node_modules/es5-ext/string/raw/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String, "raw", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es5-ext/string/raw/index.js b/node_modules/es5-ext/string/raw/index.js new file mode 100644 index 0000000..39889e9 --- /dev/null +++ b/node_modules/es5-ext/string/raw/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? String.raw : require("./shim"); diff --git a/node_modules/es5-ext/string/raw/is-implemented.js b/node_modules/es5-ext/string/raw/is-implemented.js new file mode 100644 index 0000000..8758108 --- /dev/null +++ b/node_modules/es5-ext/string/raw/is-implemented.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function () { + var raw = String.raw, test; + if (typeof raw !== "function") return false; + test = ["foo\nbar", "marko\n"]; + test.raw = ["foo\\nbar", "marko\\n"]; + return raw(test, "INSE\nRT") === "foo\\nbarINSE\nRTmarko\\n"; +}; diff --git a/node_modules/es5-ext/string/raw/shim.js b/node_modules/es5-ext/string/raw/shim.js new file mode 100644 index 0000000..5d17e5f --- /dev/null +++ b/node_modules/es5-ext/string/raw/shim.js @@ -0,0 +1,14 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , validValue = require("../../object/valid-value") + , reduce = Array.prototype.reduce; + +module.exports = function (callSite/*, …substitutions*/) { + var args, rawValue = Object(validValue(Object(validValue(callSite)).raw)); + if (!toPosInt(rawValue.length)) return ""; + args = arguments; + return reduce.call(rawValue, function (str1, str2, i) { + return str1 + String(args[i]) + str2; + }); +}; diff --git a/node_modules/es5-ext/test/.eslintrc.json b/node_modules/es5-ext/test/.eslintrc.json new file mode 100644 index 0000000..7d69172 --- /dev/null +++ b/node_modules/es5-ext/test/.eslintrc.json @@ -0,0 +1,12 @@ +{ + "globals": { "Symbol": true }, + "rules": { + "consistent-this": "off", + "id-length": "off", + "no-empty-function": "off", + "no-eval": "off", + "no-new-wrappers": "off", + "no-prototype-builtins": "off", + "no-shadow": "off" + } +} diff --git a/node_modules/es5-ext/test/__tad.js b/node_modules/es5-ext/test/__tad.js new file mode 100644 index 0000000..883c379 --- /dev/null +++ b/node_modules/es5-ext/test/__tad.js @@ -0,0 +1,3 @@ +"use strict"; + +exports.context = null; diff --git a/node_modules/es5-ext/test/array/#/@@iterator/implement.js b/node_modules/es5-ext/test/array/#/@@iterator/implement.js new file mode 100644 index 0000000..aac624f --- /dev/null +++ b/node_modules/es5-ext/test/array/#/@@iterator/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/@@iterator/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/array/#/@@iterator/index.js b/node_modules/es5-ext/test/array/#/@@iterator/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/@@iterator/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js b/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/array/#/@@iterator/shim.js b/node_modules/es5-ext/test/array/#/@@iterator/shim.js new file mode 100644 index 0000000..71b71d5 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/@@iterator/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +exports.__generic = function (t, a) { + var iterator = t.call(this); + a.deep(iterator.next(), { value: "1", done: false }); + a.deep(iterator.next(), { value: "2", done: false }); + a.deep(iterator.next(), { value: "3", done: false }); + a.deep(iterator.next(), { value: undefined, done: true }); +}; diff --git a/node_modules/es5-ext/test/array/#/_compare-by-length.js b/node_modules/es5-ext/test/array/#/_compare-by-length.js new file mode 100644 index 0000000..a53d847 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/_compare-by-length.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + var arr = [4, 5, 6], obj1 = { length: 8 }, obj2 = {}, obj3 = { length: 1 }; + + a.deep([arr, obj1, obj2, obj3].sort(t), [obj2, obj3, arr, obj1]); +}; diff --git a/node_modules/es5-ext/test/array/#/binary-search.js b/node_modules/es5-ext/test/array/#/binary-search.js new file mode 100644 index 0000000..7c1d2f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/binary-search.js @@ -0,0 +1,15 @@ +"use strict"; + +var compare = function (value) { return this - value; }; + +module.exports = function (t, a) { + var arr; + arr = [2, 5, 5, 8, 34, 67, 98, 345, 678]; + + // Highest, equal match + a(t.call(arr, compare.bind(1)), 0, "All higher"); + a(t.call(arr, compare.bind(679)), arr.length - 1, "All lower"); + a(t.call(arr, compare.bind(4)), 0, "Mid"); + a(t.call(arr, compare.bind(5)), 2, "Match"); + a(t.call(arr, compare.bind(6)), 2, "Above"); +}; diff --git a/node_modules/es5-ext/test/array/#/clear.js b/node_modules/es5-ext/test/array/#/clear.js new file mode 100644 index 0000000..640cc19 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/clear.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + var arr = [1, 2, {}, 4]; + a(t.call(arr), arr, "Returns same array"); + a.deep(arr, [], "Empties array"); +}; diff --git a/node_modules/es5-ext/test/array/#/compact.js b/node_modules/es5-ext/test/array/#/compact.js new file mode 100644 index 0000000..a7702a1 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/compact.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { a(t.call(this).length, 3); }, + "": function (t, a) { + var o, x, y, z; + o = {}; + x = [0, 1, "", null, o, false, undefined, true]; + y = x.slice(0); + + a.not((z = t.call(x)), x, "Returns different object"); + a.deep(x, y, "Origin not changed"); + a.deep(z, [0, 1, "", o, false, true], "Result"); + } +}; diff --git a/node_modules/es5-ext/test/array/#/concat/implement.js b/node_modules/es5-ext/test/array/#/concat/implement.js new file mode 100644 index 0000000..83a397e --- /dev/null +++ b/node_modules/es5-ext/test/array/#/concat/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/concat/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/array/#/concat/index.js b/node_modules/es5-ext/test/array/#/concat/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/concat/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/array/#/concat/is-implemented.js b/node_modules/es5-ext/test/array/#/concat/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/array/#/concat/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/array/#/concat/shim.js b/node_modules/es5-ext/test/array/#/concat/shim.js new file mode 100644 index 0000000..a9e6273 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/concat/shim.js @@ -0,0 +1,29 @@ +"use strict"; + +var isConcatSpreadable = require("es6-symbol").isConcatSpreadable + , SubArray = require("../../../../array/_sub-array-dummy-safe"); + +module.exports = function (t, a) { + var arr = [1, 3, 45], x = {}, subArr, subArr2, result; + + a.deep( + t.call(arr, "2d", x, ["ere", "fe", x], false, null), + [1, 3, 45, "2d", x, "ere", "fe", x, false, null], "Plain array" + ); + + subArr = new SubArray("lol", "miszko"); + subArr2 = new SubArray("elo", "fol"); + + result = t.call(subArr, "df", arr, "fef", subArr2, null); + a(result instanceof SubArray, true, "Instance of subclass"); + a.deep( + result, ["lol", "miszko", "df", 1, 3, 45, "fef", "elo", "fol", null], "Spreable by default" + ); + + SubArray.prototype[isConcatSpreadable] = false; + + result = t.call(subArr, "df", arr, "fef", subArr2, null); + a.deep(result, [subArr, "df", 1, 3, 45, "fef", subArr2, null], "Non spreadable"); + + delete SubArray.prototype[isConcatSpreadable]; +}; diff --git a/node_modules/es5-ext/test/array/#/contains.js b/node_modules/es5-ext/test/array/#/contains.js new file mode 100644 index 0000000..fb0f96c --- /dev/null +++ b/node_modules/es5-ext/test/array/#/contains.js @@ -0,0 +1,21 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { + a(t.call(this, this[1]), true, "Contains"); + a(t.call(this, {}), false, "Does Not contain"); + }, + "": function (t, a) { + var o, x = {}, y = {}; + + o = [1, "raz", x]; + + a(t.call(o, 1), true, "First"); + a(t.call(o, "1"), false, "Type coercion"); + a(t.call(o, "raz"), true, "Primitive"); + a(t.call(o, "foo"), false, "Primitive not found"); + a(t.call(o, x), true, "Object found"); + a(t.call(o, y), false, "Object not found"); + a(t.call(o, 1, 1), false, "Position"); + } +}; diff --git a/node_modules/es5-ext/test/array/#/copy-within/implement.js b/node_modules/es5-ext/test/array/#/copy-within/implement.js new file mode 100644 index 0000000..6d5a305 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/copy-within/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/copy-within/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/array/#/copy-within/index.js b/node_modules/es5-ext/test/array/#/copy-within/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/copy-within/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js b/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/array/#/copy-within/shim.js b/node_modules/es5-ext/test/array/#/copy-within/shim.js new file mode 100644 index 0000000..03a631f --- /dev/null +++ b/node_modules/es5-ext/test/array/#/copy-within/shim.js @@ -0,0 +1,29 @@ +"use strict"; + +module.exports = function (t, a) { + var args, x; + + a.h1("2 args"); + x = [1, 2, 3, 4, 5]; + t.call(x, 0, 3); + a.deep(x, [4, 5, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 1, 3), [1, 4, 5, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 1, 2), [1, 3, 4, 5, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 2, 2), [1, 2, 3, 4, 5]); + + a.h1("3 args"); + a.deep(t.call([1, 2, 3, 4, 5], 0, 3, 4), [4, 2, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 1, 3, 4), [1, 4, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 1, 2, 4), [1, 3, 4, 4, 5]); + + a.h1("Negative args"); + a.deep(t.call([1, 2, 3, 4, 5], 0, -2), [4, 5, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 0, -2, -1), [4, 2, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], -4, -3, -2), [1, 3, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], -4, -3, -1), [1, 3, 4, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], -4, -3), [1, 3, 4, 5, 5]); + + a.h1("Array-likes"); + args = { 0: 1, 1: 2, 2: 3, length: 3 }; + a.deep(t.call(args, -2, 0), { 0: 1, 1: 1, 2: 2, length: 3 }); +}; diff --git a/node_modules/es5-ext/test/array/#/diff.js b/node_modules/es5-ext/test/array/#/diff.js new file mode 100644 index 0000000..b088d83 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/diff.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { a.deep(t.call(this, this), []); }, + "": function (t, a) { + var x = {}, y = {}; + + a.deep(t.call([1, "raz", x, 2, "trzy", y], [x, 2, "trzy"]), [1, "raz", y], "Scope longer"); + a.deep(t.call([1, "raz", x], [x, 2, "trzy", 1, y]), ["raz"], "Arg longer"); + a.deep(t.call([1, "raz", x], []), [1, "raz", x], "Empty arg"); + a.deep(t.call([], [1, y, "sdfs"]), [], "Empty scope"); + } +}; diff --git a/node_modules/es5-ext/test/array/#/e-index-of.js b/node_modules/es5-ext/test/array/#/e-index-of.js new file mode 100644 index 0000000..1e42cbd --- /dev/null +++ b/node_modules/es5-ext/test/array/#/e-index-of.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}; + a(t.call([3, "raz", {}, x, {}], x), 3, "Regular"); + a(t.call([3, "raz", NaN, {}, NaN], NaN), 2, "NaN"); + a(t.call([3, "raz", 0, {}, -0], -0), 2, "-0"); + a(t.call([3, "raz", -0, {}, 0], +0), 2, "+0"); + a(t.call([3, "raz", NaN, {}, NaN], NaN, 3), 4, "fromIndex"); + a(t.call([3, "raz", NaN, {}, NaN], NaN, -1), 4, "fromIndex negative #1"); + a(t.call([3, "raz", NaN, {}, NaN], NaN, -2), 4, "fromIndex negative #2"); + a(t.call([3, "raz", NaN, {}, NaN], NaN, -3), 2, "fromIndex negative #3"); +}; diff --git a/node_modules/es5-ext/test/array/#/e-last-index-of.js b/node_modules/es5-ext/test/array/#/e-last-index-of.js new file mode 100644 index 0000000..2c7fff9 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/e-last-index-of.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}; + a(t.call([3, "raz", {}, x, {}, x], x), 5, "Regular"); + a(t.call([3, "raz", NaN, {}, x], NaN), 2, "NaN"); + a(t.call([3, "raz", 0, {}, -0], -0), 4, "-0"); + a(t.call([3, "raz", -0, {}, 0], +0), 4, "+0"); + a(t.call([3, "raz", NaN, {}, NaN], NaN, 3), 2, "fromIndex"); + a(t.call([3, "raz", NaN, 2, NaN], NaN, -1), 4, "Negative fromIndex #1"); + a(t.call([3, "raz", NaN, 2, NaN], NaN, -2), 2, "Negative fromIndex #2"); +}; diff --git a/node_modules/es5-ext/test/array/#/entries/implement.js b/node_modules/es5-ext/test/array/#/entries/implement.js new file mode 100644 index 0000000..00dbf0e --- /dev/null +++ b/node_modules/es5-ext/test/array/#/entries/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/entries/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/array/#/entries/index.js b/node_modules/es5-ext/test/array/#/entries/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/entries/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/array/#/entries/is-implemented.js b/node_modules/es5-ext/test/array/#/entries/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/array/#/entries/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/array/#/entries/shim.js b/node_modules/es5-ext/test/array/#/entries/shim.js new file mode 100644 index 0000000..87ac25a --- /dev/null +++ b/node_modules/es5-ext/test/array/#/entries/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +exports.__generic = function (t, a) { + var iterator = t.call(this); + a.deep(iterator.next(), { value: [0, "1"], done: false }); + a.deep(iterator.next(), { value: [1, "2"], done: false }); + a.deep(iterator.next(), { value: [2, "3"], done: false }); + a.deep(iterator.next(), { value: undefined, done: true }); +}; diff --git a/node_modules/es5-ext/test/array/#/exclusion.js b/node_modules/es5-ext/test/array/#/exclusion.js new file mode 100644 index 0000000..827c037 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/exclusion.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { + var x = {}; + a.deep(t.call(this, this, [this[0], this[2], x]), [x]); + }, + "": function (t, a) { + var x = {}, y = {}; + + a.deep(t.call([x, y]), [x, y], "No arguments"); + a.deep(t.call([x, 1], [], []), [x, 1], "Empty arguments"); + a.deep(t.call([1, "raz", x], [2, "raz", y], [2, "raz", x]), [1, y]); + } +}; diff --git a/node_modules/es5-ext/test/array/#/fill/implement.js b/node_modules/es5-ext/test/array/#/fill/implement.js new file mode 100644 index 0000000..41f2a5b --- /dev/null +++ b/node_modules/es5-ext/test/array/#/fill/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/fill/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/array/#/fill/index.js b/node_modules/es5-ext/test/array/#/fill/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/fill/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/array/#/fill/is-implemented.js b/node_modules/es5-ext/test/array/#/fill/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/array/#/fill/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/array/#/fill/shim.js b/node_modules/es5-ext/test/array/#/fill/shim.js new file mode 100644 index 0000000..75906e9 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/fill/shim.js @@ -0,0 +1,15 @@ +// Taken from https://github.com/paulmillr/es6-shim/blob/master/test/array.js + +"use strict"; + +module.exports = function (t, a) { + var x; + + x = [1, 2, 3, 4, 5, 6]; + a(t.call(x, -1), x, "Returns self object"); + a.deep(x, [-1, -1, -1, -1, -1, -1], "Value"); + + a.deep(t.call([1, 2, 3, 4, 5, 6], -1, 3), [1, 2, 3, -1, -1, -1], "Positive start"); + a.deep(t.call([1, 2, 3, 4, 5, 6], -1, -3), [1, 2, 3, -1, -1, -1], "Negative start"); + a.deep(t.call([1, 2, 3, 4, 5, 6], -1, 9), [1, 2, 3, 4, 5, 6], "Large start"); +}; diff --git a/node_modules/es5-ext/test/array/#/filter/implement.js b/node_modules/es5-ext/test/array/#/filter/implement.js new file mode 100644 index 0000000..9a6ad04 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/filter/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/filter/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/array/#/filter/index.js b/node_modules/es5-ext/test/array/#/filter/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/filter/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/array/#/filter/is-implemented.js b/node_modules/es5-ext/test/array/#/filter/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/array/#/filter/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/array/#/filter/shim.js b/node_modules/es5-ext/test/array/#/filter/shim.js new file mode 100644 index 0000000..e20a651 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/filter/shim.js @@ -0,0 +1,17 @@ +"use strict"; + +var SubArray = require("../../../../array/_sub-array-dummy-safe"); + +module.exports = function (t, a) { + var arr, x = {}, subArr, result; + + arr = ["foo", undefined, 0, "2d", false, x, null]; + + a.deep(t.call(arr, Boolean), ["foo", "2d", x], "Plain array"); + + subArr = new SubArray("foo", undefined, 0, "2d", false, x, null); + + result = t.call(subArr, Boolean); + a(result instanceof SubArray, true, "Instance of subclass"); + a.deep(result, ["foo", "2d", x], "Result of subclass"); +}; diff --git a/node_modules/es5-ext/test/array/#/find-index/implement.js b/node_modules/es5-ext/test/array/#/find-index/implement.js new file mode 100644 index 0000000..2291982 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/find-index/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/find-index/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/array/#/find-index/index.js b/node_modules/es5-ext/test/array/#/find-index/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/find-index/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/array/#/find-index/is-implemented.js b/node_modules/es5-ext/test/array/#/find-index/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/array/#/find-index/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/array/#/find-index/shim.js b/node_modules/es5-ext/test/array/#/find-index/shim.js new file mode 100644 index 0000000..665c562 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/find-index/shim.js @@ -0,0 +1,23 @@ +"use strict"; + +exports.__generic = function (t, a) { + var count = 0, o = {}, self = Object(this); + a( + t.call( + self, + function (value, i, scope) { + a(value, this[i], "Value"); + a(i, count++, "Index"); + a(scope, this, "Scope"); + }, + self + ), + -1, + "Falsy result" + ); + a(count, 3); + + count = -1; + a(t.call(this, function () { return ++count ? o : null; }, this), 1, "Truthy result"); + a(count, 1); +}; diff --git a/node_modules/es5-ext/test/array/#/find/implement.js b/node_modules/es5-ext/test/array/#/find/implement.js new file mode 100644 index 0000000..463198b --- /dev/null +++ b/node_modules/es5-ext/test/array/#/find/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/find/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/array/#/find/index.js b/node_modules/es5-ext/test/array/#/find/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/find/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/array/#/find/is-implemented.js b/node_modules/es5-ext/test/array/#/find/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/array/#/find/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/array/#/find/shim.js b/node_modules/es5-ext/test/array/#/find/shim.js new file mode 100644 index 0000000..fdda122 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/find/shim.js @@ -0,0 +1,23 @@ +"use strict"; + +exports.__generic = function (t, a) { + var count = 0, o = {}, self = Object(this); + a( + t.call( + self, + function (value, i, scope) { + a(value, this[i], "Value"); + a(i, count++, "Index"); + a(scope, this, "Scope"); + }, + self + ), + undefined, + "Falsy result" + ); + a(count, 3); + + count = -1; + a(t.call(this, function () { return ++count ? o : null; }, this), this[1], "Truthy result"); + a(count, 1); +}; diff --git a/node_modules/es5-ext/test/array/#/first-index.js b/node_modules/es5-ext/test/array/#/first-index.js new file mode 100644 index 0000000..af3388b --- /dev/null +++ b/node_modules/es5-ext/test/array/#/first-index.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a(t.call([]), null, "Empty"); + a(t.call([null]), 0, "One value"); + a(t.call([1, 2, 3]), 0, "Many values"); + a(t.call(new Array(1000)), null, "Sparse empty"); + x = []; + x[883] = undefined; + x[890] = null; + a(t.call(x), 883, "Manual sparse, distant value"); + x = new Array(1000); + x[657] = undefined; + x[700] = null; + a(t.call(x), 657, "Sparse, distant value"); +}; diff --git a/node_modules/es5-ext/test/array/#/first.js b/node_modules/es5-ext/test/array/#/first.js new file mode 100644 index 0000000..4e72c02 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/first.js @@ -0,0 +1,11 @@ +"use strict"; + +exports.__generic = function (t, a) { a(t.call(this), this[0]); }; +exports[""] = function (t, a) { + var x; + a(t.call([]), undefined, "Empty"); + a(t.call(new Array(234), undefined, "Sparse empty")); + x = new Array(2342); + x[434] = {}; + a(t.call(x), x[434], "Sparse"); +}; diff --git a/node_modules/es5-ext/test/array/#/flatten.js b/node_modules/es5-ext/test/array/#/flatten.js new file mode 100644 index 0000000..aa749a5 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/flatten.js @@ -0,0 +1,12 @@ +"use strict"; + +var o = [1, 2, [3, 4, [5, 6], 7, 8], 9, 10, [11, 12, [13, 14]], 15]; + +module.exports = { + "__generic": function (t, a) { a(t.call(this).length, 3); }, + "Nested Arrays": function (t, a) { + var result = t.call(o); + a.not(o, result); + a.deep(result, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); + } +}; diff --git a/node_modules/es5-ext/test/array/#/for-each-right.js b/node_modules/es5-ext/test/array/#/for-each-right.js new file mode 100644 index 0000000..b5eb984 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/for-each-right.js @@ -0,0 +1,39 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { + var count = 0, first, last, x, icount = this.length; + t.call(this, function (item, index, col) { + ++count; + if (!first) { + first = item; + } + last = item; + x = col; + a(index, --icount, "Index"); + }); + a(count, this.length, "Iterated"); + a(first, this[this.length - 1], "First is last"); + a(last, this[0], "Last is first"); + a.deep(x, Object(this), "Collection as third argument"); // Jslint: skip + }, + "": function (t, a) { + var x = {}, y, count; + t.call([1], function () { y = this; }, x); + a(y, x, "Scope"); + y = 0; + t.call([3, 4, 4], function (a, i) { y += i; }); + a(y, 3, "Indexes"); + + x = [1, 3]; + x[5] = "x"; + y = 0; + count = 0; + t.call(x, function (a, i) { + ++count; + y += i; + }); + a(y, 6, "Misssing Indexes"); + a(count, 3, "Misssing Indexes, count"); + } +}; diff --git a/node_modules/es5-ext/test/array/#/group.js b/node_modules/es5-ext/test/array/#/group.js new file mode 100644 index 0000000..114fffd --- /dev/null +++ b/node_modules/es5-ext/test/array/#/group.js @@ -0,0 +1,30 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { + var count = 0, self; + + self = Object(this); + a.deep( + t.call( + self, + function (v, i, scope) { + a(v, this[i], "Value"); + a(i, count++, "Index"); + a(scope, this, "Scope"); + return i; + }, + self + ), + { 0: [this[0]], 1: [this[1]], 2: [this[2]] } + ); + }, + "": function (t, a) { + var r; + r = t.call([2, 3, 3, 4, 5, 6, 7, 7, 23, 45, 34, 56], function (v) { + return v % 2 ? "odd" : "even"; + }); + a.deep(r.odd, [3, 3, 5, 7, 7, 23, 45]); + a.deep(r.even, [2, 4, 6, 34, 56]); + } +}; diff --git a/node_modules/es5-ext/test/array/#/indexes-of.js b/node_modules/es5-ext/test/array/#/indexes-of.js new file mode 100644 index 0000000..aa50d5e --- /dev/null +++ b/node_modules/es5-ext/test/array/#/indexes-of.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { a.deep(t.call(this, this[1]), [1]); }, + "": function (t, a) { + var x = {}; + a.deep(t.call([1, 3, 5, 3, 5], 6), [], "No result"); + a.deep(t.call([1, 3, 5, 1, 3, 5, 1], 1), [0, 3, 6], "Some results"); + a.deep(t.call([], x), [], "Empty array"); + a.deep(t.call([x, 3, {}, x, 3, 5, x], x), [0, 3, 6], "Search for object"); + } +}; diff --git a/node_modules/es5-ext/test/array/#/intersection.js b/node_modules/es5-ext/test/array/#/intersection.js new file mode 100644 index 0000000..81088d2 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/intersection.js @@ -0,0 +1,25 @@ +"use strict"; + +var toArray = require("../../../array/to-array"); + +module.exports = { + "__generic": function (t, a) { a.deep(t.call(this, this, this), toArray(this)); }, + "": function (t, a) { + var x = {}, y = {}, p, r; + a.deep(t.call([], [2, 3, 4]), [], "Empty #1"); + a.deep(t.call([2, 3, 4], []), [], "Empty #2"); + a.deep(t.call([2, 3, x], [y, 5, 7]), [], "Different"); + p = t.call( + [3, 5, "raz", {}, "dwa", x], [1, 3, "raz", "dwa", "trzy", x, {}], [3, "raz", x, 65] + ); + r = [3, "raz", x]; + p.sort(); + r.sort(); + a.deep(p, r, "Same parts"); + a.deep(t.call(r, r), r, "Same"); + a.deep( + t.call([1, 2, x, 4, 5, y, 7], [7, y, 5, 4, x, 2, 1]), [1, 2, x, 4, 5, y, 7], + "Long reverse same" + ); + } +}; diff --git a/node_modules/es5-ext/test/array/#/is-copy.js b/node_modules/es5-ext/test/array/#/is-copy.js new file mode 100644 index 0000000..b362485 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/is-copy.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}; + a(t.call([], []), true, "Empty"); + a(t.call([], {}), true, "Empty lists"); + a(t.call([1, x, "raz"], [1, x, "raz"]), true, "Same"); + a(t.call([1, x, "raz"], { 0: 1, 1: x, 2: "raz", length: 3 }), true, "Same lists"); + a(t.call([1, x, "raz"], [x, 1, "raz"]), false, "Diff order"); + a(t.call([1, x], [1, x, "raz"]), false, "Diff length #1"); + a(t.call([1, x, "raz"], [1, x]), false, "Diff length #2"); +}; diff --git a/node_modules/es5-ext/test/array/#/is-empty.js b/node_modules/es5-ext/test/array/#/is-empty.js new file mode 100644 index 0000000..1e1c097 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/is-empty.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}; + a(t.call([]), true, "Empty"); + a(t.call({ length: 0 }), true, "Empty lists"); + a(t.call([1, x, "raz"]), false, "Non empty"); +}; diff --git a/node_modules/es5-ext/test/array/#/is-uniq.js b/node_modules/es5-ext/test/array/#/is-uniq.js new file mode 100644 index 0000000..ab531ac --- /dev/null +++ b/node_modules/es5-ext/test/array/#/is-uniq.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}; + a(t.call([]), true, "Empty"); + a(t.call({}), true, "Empty lists"); + a(t.call([1, x, "raz"]), true, "Uniq"); + a(t.call([1, x, 1, "raz"]), false, "Not Uniq: primitive"); + a(t.call([1, x, "1", "raz"]), true, "Uniq: primitive"); + a(t.call([1, x, 1, {}, "raz"]), false, "Not Uniq: Obj"); +}; diff --git a/node_modules/es5-ext/test/array/#/keys/implement.js b/node_modules/es5-ext/test/array/#/keys/implement.js new file mode 100644 index 0000000..5afe847 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/keys/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/keys/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/array/#/keys/index.js b/node_modules/es5-ext/test/array/#/keys/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/keys/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/array/#/keys/is-implemented.js b/node_modules/es5-ext/test/array/#/keys/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/array/#/keys/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/array/#/keys/shim.js b/node_modules/es5-ext/test/array/#/keys/shim.js new file mode 100644 index 0000000..9be9a8f --- /dev/null +++ b/node_modules/es5-ext/test/array/#/keys/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +exports.__generic = function (t, a) { + var iterator = t.call(this); + a.deep(iterator.next(), { value: 0, done: false }); + a.deep(iterator.next(), { value: 1, done: false }); + a.deep(iterator.next(), { value: 2, done: false }); + a.deep(iterator.next(), { value: undefined, done: true }); +}; diff --git a/node_modules/es5-ext/test/array/#/last-index.js b/node_modules/es5-ext/test/array/#/last-index.js new file mode 100644 index 0000000..e66d16f --- /dev/null +++ b/node_modules/es5-ext/test/array/#/last-index.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a(t.call([]), null, "Empty"); + a(t.call([null]), 0, "One value"); + a(t.call([1, 2, 3]), 2, "Many values"); + a(t.call(new Array(1000)), null, "Sparse empty"); + x = []; + x[883] = null; + x[890] = undefined; + a(t.call(x), 890, "Manual sparse, distant value"); + x = new Array(1000); + x[657] = null; + x[700] = undefined; + a(t.call(x), 700, "Sparse, distant value"); +}; diff --git a/node_modules/es5-ext/test/array/#/last.js b/node_modules/es5-ext/test/array/#/last.js new file mode 100644 index 0000000..16bca6d --- /dev/null +++ b/node_modules/es5-ext/test/array/#/last.js @@ -0,0 +1,13 @@ +"use strict"; + +exports.__generic = function (t, a) { a(t.call(this), this[this.length - 1]); }; + +exports[""] = function (t, a) { + var x; + a(t.call([]), undefined, "Empty"); + a(t.call(new Array(234), undefined, "Sparse empty")); + x = new Array(2342); + x[434] = {}; + x[450] = {}; + a(t.call(x), x[450], "Sparse"); +}; diff --git a/node_modules/es5-ext/test/array/#/map/implement.js b/node_modules/es5-ext/test/array/#/map/implement.js new file mode 100644 index 0000000..1e33581 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/map/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/map/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/array/#/map/index.js b/node_modules/es5-ext/test/array/#/map/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/map/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/array/#/map/is-implemented.js b/node_modules/es5-ext/test/array/#/map/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/array/#/map/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/array/#/map/shim.js b/node_modules/es5-ext/test/array/#/map/shim.js new file mode 100644 index 0000000..cb178a2 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/map/shim.js @@ -0,0 +1,17 @@ +"use strict"; + +var SubArray = require("../../../../array/_sub-array-dummy-safe"); + +module.exports = function (t, a) { + var arr, x = {}, subArr, result; + + arr = ["foo", undefined, 0, "2d", false, x, null]; + + a.deep(t.call(arr, Boolean), [true, false, false, true, false, true, false], "Plain array"); + + subArr = new SubArray("foo", undefined, 0, "2d", false, x, null); + + result = t.call(subArr, Boolean); + a(result instanceof SubArray, true, "Instance of subclass"); + a.deep(result, [true, false, false, true, false, true, false], "Result of subclass"); +}; diff --git a/node_modules/es5-ext/test/array/#/remove.js b/node_modules/es5-ext/test/array/#/remove.js new file mode 100644 index 0000000..d67457e --- /dev/null +++ b/node_modules/es5-ext/test/array/#/remove.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + var y = {}, z = {}, x = [9, z, 5, y, "foo"]; + t.call(x, y); + a.deep(x, [9, z, 5, "foo"]); + t.call(x, {}); + a.deep(x, [9, z, 5, "foo"], "Not existing"); + t.call(x, 5); + a.deep(x, [9, z, "foo"], "Primitive"); + x = [9, z, 5, y, "foo"]; + t.call(x, z, 5, "foo"); + a.deep(x, [9, y], "More than one argument"); +}; diff --git a/node_modules/es5-ext/test/array/#/separate.js b/node_modules/es5-ext/test/array/#/separate.js new file mode 100644 index 0000000..9792637 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/separate.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function (t, a) { + var x = [], y = {}, z = {}; + a.deep(t.call(x, y), [], "Empty"); + a.not(t.call(x), x, "Returns copy"); + a.deep(t.call([1], y), [1], "One"); + a.deep(t.call([1, "raz"], y), [1, y, "raz"], "One"); + a.deep(t.call([1, "raz", x], y), [1, y, "raz", y, x], "More"); + x = new Array(1000); + x[23] = 2; + x[3453] = "raz"; + x[500] = z; + a.deep(t.call(x, y), [2, y, z, y, "raz"], "Sparse"); +}; diff --git a/node_modules/es5-ext/test/array/#/slice/implement.js b/node_modules/es5-ext/test/array/#/slice/implement.js new file mode 100644 index 0000000..5a56791 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/slice/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/slice/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/array/#/slice/index.js b/node_modules/es5-ext/test/array/#/slice/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/slice/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/array/#/slice/is-implemented.js b/node_modules/es5-ext/test/array/#/slice/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/array/#/slice/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/array/#/slice/shim.js b/node_modules/es5-ext/test/array/#/slice/shim.js new file mode 100644 index 0000000..f09ad13 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/slice/shim.js @@ -0,0 +1,17 @@ +"use strict"; + +var SubArray = require("../../../../array/_sub-array-dummy-safe"); + +module.exports = function (t, a) { + var arr, x = {}, subArr, result; + + arr = ["foo", undefined, 0, "2d", false, x, null]; + + a.deep(t.call(arr, 2, 4), [0, "2d"], "Plain array: result"); + + subArr = new SubArray("foo", undefined, 0, "2d", false, x, null); + + result = t.call(subArr, 2, 4); + a(result instanceof SubArray, true, "Instance of subclass"); + a.deep(result, [0, "2d"], "Subclass: result"); +}; diff --git a/node_modules/es5-ext/test/array/#/some-right.js b/node_modules/es5-ext/test/array/#/some-right.js new file mode 100644 index 0000000..ead78cc --- /dev/null +++ b/node_modules/es5-ext/test/array/#/some-right.js @@ -0,0 +1,54 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { + var count = 0, first, last, x, icount = this.length; + t.call(this, function (item, index, col) { + ++count; + if (!first) { + first = item; + } + last = item; + x = col; + a(index, --icount, "Index"); + }); + a(count, this.length, "Iterated"); + a(first, this[this.length - 1], "First is last"); + a(last, this[0], "Last is first"); + a.deep(x, Object(this), "Collection as third argument"); // Jslint: skip + }, + "": function (t, a) { + var x = {}, y, count; + t.call([1], function () { y = this; }, x); + a(y, x, "Scope"); + y = 0; + t.call([3, 4, 4], function (a, i) { y += i; }); + a(y, 3, "Indexes"); + + x = [1, 3]; + x[5] = "x"; + y = 0; + count = 0; + a( + t.call(x, function (a, i) { + ++count; + y += i; + }), + false, + "Return" + ); + a(y, 6, "Misssing Indexes"); + a(count, 3, "Misssing Indexes, count"); + + count = 0; + a( + t.call([-2, -3, -4, 2, -5], function (item) { + ++count; + return item > 0; + }), + true, + "Return" + ); + a(count, 2, "Break after true is returned"); + } +}; diff --git a/node_modules/es5-ext/test/array/#/splice/implement.js b/node_modules/es5-ext/test/array/#/splice/implement.js new file mode 100644 index 0000000..2035022 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/splice/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/splice/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/array/#/splice/index.js b/node_modules/es5-ext/test/array/#/splice/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/splice/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/array/#/splice/is-implemented.js b/node_modules/es5-ext/test/array/#/splice/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/array/#/splice/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/array/#/splice/shim.js b/node_modules/es5-ext/test/array/#/splice/shim.js new file mode 100644 index 0000000..4802007 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/splice/shim.js @@ -0,0 +1,19 @@ +"use strict"; + +var SubArray = require("../../../../array/_sub-array-dummy-safe"); + +module.exports = function (t, a) { + var arr, x = {}, subArr, result; + + arr = ["foo", undefined, 0, "2d", false, x, null]; + + a.deep(t.call(arr, 2, 2, "bar"), [0, "2d"], "Plain array: result"); + a.deep(arr, ["foo", undefined, "bar", false, x, null], "Plain array: change"); + + subArr = new SubArray("foo", undefined, 0, "2d", false, x, null); + + result = t.call(subArr, 2, 2, "bar"); + a(result instanceof SubArray, true, "Instance of subclass"); + a.deep(result, [0, "2d"], "Subclass: result"); + a.deep(subArr, ["foo", undefined, "bar", false, x, null], "Subclass: change"); +}; diff --git a/node_modules/es5-ext/test/array/#/uniq.js b/node_modules/es5-ext/test/array/#/uniq.js new file mode 100644 index 0000000..77b398b --- /dev/null +++ b/node_modules/es5-ext/test/array/#/uniq.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { a(t.call(this).length, 3); }, + "": function (t, a) { + var o, x = {}, y = {}, z = {}, w; + o = [1, 2, x, 3, 1, "raz", "1", y, x, "trzy", z, "raz"]; + + a.not((w = t.call(o)), o, "Returns different object"); + a.deep(w, [1, 2, x, 3, "raz", "1", y, "trzy", z], "Result"); + } +}; diff --git a/node_modules/es5-ext/test/array/#/values/implement.js b/node_modules/es5-ext/test/array/#/values/implement.js new file mode 100644 index 0000000..60fb8dc --- /dev/null +++ b/node_modules/es5-ext/test/array/#/values/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/values/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/array/#/values/index.js b/node_modules/es5-ext/test/array/#/values/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/values/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/array/#/values/is-implemented.js b/node_modules/es5-ext/test/array/#/values/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/array/#/values/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/array/#/values/shim.js b/node_modules/es5-ext/test/array/#/values/shim.js new file mode 100644 index 0000000..71b71d5 --- /dev/null +++ b/node_modules/es5-ext/test/array/#/values/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +exports.__generic = function (t, a) { + var iterator = t.call(this); + a.deep(iterator.next(), { value: "1", done: false }); + a.deep(iterator.next(), { value: "2", done: false }); + a.deep(iterator.next(), { value: "3", done: false }); + a.deep(iterator.next(), { value: undefined, done: true }); +}; diff --git a/node_modules/es5-ext/test/array/__scopes.js b/node_modules/es5-ext/test/array/__scopes.js new file mode 100644 index 0000000..f1c4090 --- /dev/null +++ b/node_modules/es5-ext/test/array/__scopes.js @@ -0,0 +1,9 @@ +"use strict"; + +exports.Array = ["1", "2", "3"]; + +exports.Arguments = (function () { return arguments; })("1", "2", "3"); + +exports.String = "123"; + +exports.Object = { 0: "1", 1: "2", 2: "3", 3: "4", length: 3 }; diff --git a/node_modules/es5-ext/test/array/_is-extensible.js b/node_modules/es5-ext/test/array/_is-extensible.js new file mode 100644 index 0000000..124e59d --- /dev/null +++ b/node_modules/es5-ext/test/array/_is-extensible.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t, "boolean"); }; diff --git a/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js b/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js new file mode 100644 index 0000000..4fab50d --- /dev/null +++ b/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js @@ -0,0 +1,5 @@ +"use strict"; + +var isArray = Array.isArray; + +module.exports = function (t) { t(t === null || isArray(t.prototype), true); }; diff --git a/node_modules/es5-ext/test/array/_sub-array-dummy.js b/node_modules/es5-ext/test/array/_sub-array-dummy.js new file mode 100644 index 0000000..4fab50d --- /dev/null +++ b/node_modules/es5-ext/test/array/_sub-array-dummy.js @@ -0,0 +1,5 @@ +"use strict"; + +var isArray = Array.isArray; + +module.exports = function (t) { t(t === null || isArray(t.prototype), true); }; diff --git a/node_modules/es5-ext/test/array/from/implement.js b/node_modules/es5-ext/test/array/from/implement.js new file mode 100644 index 0000000..48cd7b6 --- /dev/null +++ b/node_modules/es5-ext/test/array/from/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../array/from/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/array/from/index.js b/node_modules/es5-ext/test/array/from/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/from/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/array/from/is-implemented.js b/node_modules/es5-ext/test/array/from/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/array/from/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/array/from/shim.js b/node_modules/es5-ext/test/array/from/shim.js new file mode 100644 index 0000000..997f832 --- /dev/null +++ b/node_modules/es5-ext/test/array/from/shim.js @@ -0,0 +1,64 @@ +// Some tests taken from: https://github.com/mathiasbynens/Array.from/blob/master/tests/tests.js + +"use strict"; + +module.exports = function (t, a) { + var o = [1, 2, 3], MyType; + a.not(t(o), o, "Array"); + a.deep(t(o), o, "Array: same content"); + a.deep(t("12r3v"), ["1", "2", "r", "3", "v"], "String"); + a.deep(t((function () { return arguments; })(3, o, "raz")), [3, o, "raz"], "Arguments"); + a.deep(t((function () { return arguments; })(3)), [3], "Arguments with one numeric value"); + + a.deep(t({ 0: "raz", 1: "dwa", length: 2 }), ["raz", "dwa"], "Other"); + + a.deep(t(o, function (val) { return (val + 2) * 10; }, 10), [30, 40, 50], "Mapping"); + + a.throws(function () { t(); }, TypeError, "Undefined"); + a.deep(t(3), [], "Primitive"); + + a(t.length, 1, "Length"); + a.deep(t({ length: 0 }), [], "No values Array-like"); + a.deep(t({ length: -1 }), [], "Invalid length Array-like"); + a.deep(t({ length: -Infinity }), [], "Invalid length Array-like #2"); + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a.deep(t(false), [], "Boolean"); + a.deep(t(-Infinity), [], "Inifity"); + a.deep(t(-0), [], "-0"); + a.deep(t(+0), [], "+0"); + a.deep(t(1), [], "1"); + a.deep(t(Number(Infinity)), [], "+Infinity"); + a.deep(t({}), [], "Plain object"); + a.deep(t({ length: 1 }), [undefined], "Sparse array-like"); + a.deep(t({ 0: "a", 1: "b", length: 2 }, function (x) { return x + x; }), ["aa", "bb"], "Map"); + a.deep( + t({ 0: "a", 1: "b", length: 2 }, function () { return String(this); }, undefined), + ["undefined", "undefined"], "Map context" + ); + a.deep( + t({ 0: "a", 1: "b", length: 2 }, function () { return String(this); }, "x"), ["x", "x"], + "Map primitive context" + ); + a.throws(function () { t({}, "foo", "x"); }, TypeError, "Non callable for map"); + + a.deep(t({ length: 1, 0: "a" }), ["a"], "Null context"); + + a(t({ __proto__: { 0: "abc", length: 1 } })[0], "abc", "Values on prototype"); + + a.throws( + function () { + t.call(function () { return Object.freeze({}); }, {}); + }, + TypeError, + "Contructor producing freezed objects" + ); + + // Ensure no setters are called for the indexes + // Ensure no setters are called for the indexes + MyType = function () {}; + Object.defineProperty(MyType.prototype, "0", { + set: function (x) { throw new Error("Setter called: " + x); } + }); + a.deep(t.call(MyType, { 0: "abc", length: 1 }), { 0: "abc", length: 1 }, "Defined not set"); +}; diff --git a/node_modules/es5-ext/test/array/generate.js b/node_modules/es5-ext/test/array/generate.js new file mode 100644 index 0000000..efd5f7c --- /dev/null +++ b/node_modules/es5-ext/test/array/generate.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}, y = {}; + a.deep(t(3), [undefined, undefined, undefined], "Just length"); + a.deep(t(0, "x"), [], "No repeat"); + a.deep(t(1, x, y), [x], "Arguments length larger than repeat number"); + a.deep(t(3, x), [x, x, x], "Single argument"); + a.deep(t(5, x, y), [x, y, x, y, x], "Many arguments"); +}; diff --git a/node_modules/es5-ext/test/array/is-plain-array.js b/node_modules/es5-ext/test/array/is-plain-array.js new file mode 100644 index 0000000..2cfd50d --- /dev/null +++ b/node_modules/es5-ext/test/array/is-plain-array.js @@ -0,0 +1,18 @@ +"use strict"; + +var SubArray = require("../../array/_sub-array-dummy-safe"); + +module.exports = function (t, a) { + var arr = [1, 2, 3]; + a(t(arr), true, "Array"); + a(t(null), false, "Null"); + a(t(), false, "Undefined"); + a(t("234"), false, "String"); + a(t(23), false, "Number"); + a(t({}), false, "Plain object"); + a(t({ length: 1, 0: "raz" }), false, "Array-like"); + a(t(Object.create(arr)), false, "Array extension"); + if (!SubArray) return; + a(t(new SubArray(23)), false, "Subclass instance"); + a(t(Array.prototype), false, "Array.prototype"); +}; diff --git a/node_modules/es5-ext/test/array/of/implement.js b/node_modules/es5-ext/test/array/of/implement.js new file mode 100644 index 0000000..2a4c58b --- /dev/null +++ b/node_modules/es5-ext/test/array/of/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../array/of/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/array/of/index.js b/node_modules/es5-ext/test/array/of/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/array/of/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/array/of/is-implemented.js b/node_modules/es5-ext/test/array/of/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/array/of/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/array/of/shim.js b/node_modules/es5-ext/test/array/of/shim.js new file mode 100644 index 0000000..86eb574 --- /dev/null +++ b/node_modules/es5-ext/test/array/of/shim.js @@ -0,0 +1,81 @@ +/* eslint no-useless-call: "off" */ +// Most tests taken from https://github.com/mathiasbynens/Array.of/blob/master/tests/tests.js +// Thanks @mathiasbynens + +"use strict"; + +var defineProperty = Object.defineProperty; + +module.exports = function (t, a) { + var x = {}, testObject, MyType; + + a.deep(t(), [], "No arguments"); + a.deep(t(3), [3], "One numeric argument"); + a.deep(t(3, "raz", null, x, undefined), [3, "raz", null, x, undefined], "Many arguments"); + + a(t.length, 0, "Length"); + + a.deep(t("abc"), ["abc"], "String"); + a.deep(t(undefined), [undefined], "Undefined"); + a.deep(t(null), [null], "Null"); + a.deep(t(false), [false], "Boolean"); + a.deep(t(-Infinity), [-Infinity], "Infinity"); + a.deep(t(-0), [-0], "-0"); + a.deep(t(+0), [+0], "+0"); + a.deep(t(1), [1], "1"); + a.deep(t(1, 2, 3), [1, 2, 3], "Numeric args"); + a.deep(t(Number(Infinity)), [Number(Infinity)], "+Infinity"); + a.deep( + t({ 0: "a", 1: "b", 2: "c", length: 3 }), [{ 0: "a", 1: "b", 2: "c", length: 3 }], + "Array like" + ); + a.deep( + t(undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)), + [undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)], "Falsy arguments" + ); + + a.h1("Null context"); + a.deep(t.call(null, "abc"), ["abc"], "String"); + a.deep(t.call(null, undefined), [undefined], "Undefined"); + a.deep(t.call(null, null), [null], "Null"); + a.deep(t.call(null, false), [false], "Boolean"); + a.deep(t.call(null, -Infinity), [-Infinity], "-Infinity"); + a.deep(t.call(null, -0), [-0], "-0"); + a.deep(t.call(null, +0), [+0], "+0"); + a.deep(t.call(null, 1), [1], "1"); + a.deep(t.call(null, 1, 2, 3), [1, 2, 3], "Numeric"); + a.deep(t.call(null, Number(Infinity)), [Number(Infinity)], "+Infinity"); + a.deep( + t.call(null, { 0: "a", 1: "b", 2: "c", length: 3 }), + [{ 0: "a", 1: "b", 2: "c", length: 3 }], "Array-like" + ); + a.deep( + t.call(null, undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)), + [undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)], "Falsy" + ); + + a.h1("Other constructor context"); + a.deep(t.call(Object, 1, 2, 3), { 0: 1, 1: 2, 2: 3, length: 3 }, "Many arguments"); + + testObject = Object(3); + testObject[0] = 1; + testObject[1] = 2; + testObject[2] = 3; + testObject.length = 3; + a.deep(t.call(Object, 1, 2, 3), testObject, "Test object"); + a(t.call(Object).length, 0, "No arguments"); + a.throws( + function () { + t.call(function () { return Object.freeze({}); }); + }, + TypeError, + "Frozen instance" + ); + + // Ensure no setters are called for the indexes + MyType = function () {}; + defineProperty(MyType.prototype, "0", { + set: function (x) { throw new Error("Setter called: " + x); } + }); + a.deep(t.call(MyType, "abc"), { 0: "abc", length: 1 }, "Define, not set"); +}; diff --git a/node_modules/es5-ext/test/array/to-array.js b/node_modules/es5-ext/test/array/to-array.js new file mode 100644 index 0000000..68c5102 --- /dev/null +++ b/node_modules/es5-ext/test/array/to-array.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + var o = [1, 2, 3]; + a(t(o), o, "Array"); + a.deep(t("12r3v"), ["1", "2", "r", "3", "v"], "String"); + a.deep(t((function () { return arguments; })(3, o, "raz")), [3, o, "raz"], "Arguments"); + a.deep(t((function () { return arguments; })(3)), [3], "Arguments with one numeric value"); + + a.deep(t({ 0: "raz", 1: "dwa", length: 2 }), ["raz", "dwa"], "Other"); +}; diff --git a/node_modules/es5-ext/test/array/valid-array.js b/node_modules/es5-ext/test/array/valid-array.js new file mode 100644 index 0000000..62ea503 --- /dev/null +++ b/node_modules/es5-ext/test/array/valid-array.js @@ -0,0 +1,20 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a.throws(function () { t(0); }, TypeError, "Number"); + a.throws(function () { t(true); }, TypeError, "Boolean"); + a.throws(function () { t("raz"); }, TypeError, "String"); + a.throws( + function () { + t(function () {}); + }, + TypeError, + "Function" + ); + a.throws(function () { t({}); }, TypeError, "Object"); + a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like"); + a(t((x = [])), x, "Array"); +}; diff --git a/node_modules/es5-ext/test/boolean/is-boolean.js b/node_modules/es5-ext/test/boolean/is-boolean.js new file mode 100644 index 0000000..e36b3f3 --- /dev/null +++ b/node_modules/es5-ext/test/boolean/is-boolean.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t("arar"), false, "String"); + a(t(12), false, "Number"); + a(t(false), true, "Boolean"); + a(t(new Boolean(false)), true, "Boolean object"); + a(t(new Date()), false, "Date"); + a(t(new String("raz")), false, "String object"); + a(t({}), false, "Plain object"); + a(t(/a/), false, "Regular expression"); +}; diff --git a/node_modules/es5-ext/test/date/#/copy.js b/node_modules/es5-ext/test/date/#/copy.js new file mode 100644 index 0000000..27c996b --- /dev/null +++ b/node_modules/es5-ext/test/date/#/copy.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + var o = new Date(), o2; + + o2 = t.call(o); + a.not(o, o2, "Different objects"); + a.ok(o2 instanceof Date, "Instance of Date"); + a(o.getTime(), o2.getTime(), "Same time"); +}; diff --git a/node_modules/es5-ext/test/date/#/days-in-month.js b/node_modules/es5-ext/test/date/#/days-in-month.js new file mode 100644 index 0000000..ce2dd77 --- /dev/null +++ b/node_modules/es5-ext/test/date/#/days-in-month.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(new Date(2001, 0, 1)), 31, "January"); + a(t.call(new Date(2001, 1, 1)), 28, "February"); + a(t.call(new Date(2000, 1, 1)), 29, "February (leap)"); + a(t.call(new Date(2001, 2, 1)), 31, "March"); + a(t.call(new Date(2001, 3, 1)), 30, "April"); + a(t.call(new Date(2001, 4, 1)), 31, "May"); + a(t.call(new Date(2001, 5, 1)), 30, "June"); + a(t.call(new Date(2001, 6, 1)), 31, "July"); + a(t.call(new Date(2001, 7, 1)), 31, "August"); + a(t.call(new Date(2001, 8, 1)), 30, "September"); + a(t.call(new Date(2001, 9, 1)), 31, "October"); + a(t.call(new Date(2001, 10, 1)), 30, "November"); + a(t.call(new Date(2001, 11, 1)), 31, "December"); +}; diff --git a/node_modules/es5-ext/test/date/#/floor-day.js b/node_modules/es5-ext/test/date/#/floor-day.js new file mode 100644 index 0000000..e880838 --- /dev/null +++ b/node_modules/es5-ext/test/date/#/floor-day.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(new Date(2000, 0, 1, 13, 32, 34, 234)).valueOf(), new Date(2000, 0, 1).valueOf()); +}; diff --git a/node_modules/es5-ext/test/date/#/floor-month.js b/node_modules/es5-ext/test/date/#/floor-month.js new file mode 100644 index 0000000..ccead84 --- /dev/null +++ b/node_modules/es5-ext/test/date/#/floor-month.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(new Date(2000, 0, 15, 13, 32, 34, 234)).valueOf(), new Date(2000, 0, 1).valueOf()); +}; diff --git a/node_modules/es5-ext/test/date/#/floor-year.js b/node_modules/es5-ext/test/date/#/floor-year.js new file mode 100644 index 0000000..75267fc --- /dev/null +++ b/node_modules/es5-ext/test/date/#/floor-year.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(new Date(2000, 5, 13, 13, 32, 34, 234)).valueOf(), new Date(2000, 0, 1).valueOf()); +}; diff --git a/node_modules/es5-ext/test/date/#/format.js b/node_modules/es5-ext/test/date/#/format.js new file mode 100644 index 0000000..510b26b --- /dev/null +++ b/node_modules/es5-ext/test/date/#/format.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + var dt = new Date(2011, 2, 3, 3, 5, 5, 32); + a(t.call(dt, " %Y.%y.%m.%d.%H.%M.%S.%L "), " 2011.11.03.03.03.05.05.032 "); +}; diff --git a/node_modules/es5-ext/test/date/ensure-time-value.js b/node_modules/es5-ext/test/date/ensure-time-value.js new file mode 100644 index 0000000..7f8f4e9 --- /dev/null +++ b/node_modules/es5-ext/test/date/ensure-time-value.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(12), 12, "Number in range"); + a(t(12.23), 12, "Rounds number in range"); + a(t(-12.63), -12, "Rounds negative number in range"); + a.throws(function () { t(NaN); }, TypeError, "Throws on invalid"); +}; diff --git a/node_modules/es5-ext/test/date/is-date.js b/node_modules/es5-ext/test/date/is-date.js new file mode 100644 index 0000000..90ae8ad --- /dev/null +++ b/node_modules/es5-ext/test/date/is-date.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t("arar"), false, "String"); + a(t(12), false, "Number"); + a(t(true), false, "Boolean"); + a(t(new Date()), true, "Date"); + a(t(new String("raz")), false, "String object"); + a(t({}), false, "Plain object"); +}; diff --git a/node_modules/es5-ext/test/date/is-time-value.js b/node_modules/es5-ext/test/date/is-time-value.js new file mode 100644 index 0000000..a21677c --- /dev/null +++ b/node_modules/es5-ext/test/date/is-time-value.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function (t, a) { + a(t("arar"), false, "String"); + a(t(12), true, "Number in range"); + a(t(true), true, "Boolean"); + a(t(new Date()), true, "Date"); + a(t({}), false, "Plain object"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); + a(t(8.64e17), false, "Beyond range"); + a(t(8.64e15), true, "Below range"); + a(t(-8.64e17), false, "Negative beyond range"); + a(t(-8.64e15), true, "Negative below range"); +}; diff --git a/node_modules/es5-ext/test/date/valid-date.js b/node_modules/es5-ext/test/date/valid-date.js new file mode 100644 index 0000000..6c8db2d --- /dev/null +++ b/node_modules/es5-ext/test/date/valid-date.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + var d = new Date(); + a(t(d), d, "Date"); + a.throws(function () { t({}); }, "Object"); + a.throws(function () { + t({ valueOf: function () { return 20; } }); + }, "Number object"); +}; diff --git a/node_modules/es5-ext/test/error/#/throw.js b/node_modules/es5-ext/test/error/#/throw.js new file mode 100644 index 0000000..c0af73c --- /dev/null +++ b/node_modules/es5-ext/test/error/#/throw.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + var e = new Error(); + try { t.call(e); } + catch (e2) { a(e2, e); } +}; diff --git a/node_modules/es5-ext/test/error/custom.js b/node_modules/es5-ext/test/error/custom.js new file mode 100644 index 0000000..ca35c76 --- /dev/null +++ b/node_modules/es5-ext/test/error/custom.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + var T = t, err = new T("My Error", "MY_ERROR", { errno: 123 }); + a(err instanceof Error, true, "Instance of error"); + a(err.constructor, Error, "Constructor"); + a(err.name, "Error", "Name"); + a(String(err), "Error: My Error", "String representation"); + a(err.code, "MY_ERROR", "Code"); + a(err.errno, 123, "Errno"); + a(typeof err.stack, "string", "Stack trace"); +}; diff --git a/node_modules/es5-ext/test/error/is-error.js b/node_modules/es5-ext/test/error/is-error.js new file mode 100644 index 0000000..421f1a0 --- /dev/null +++ b/node_modules/es5-ext/test/error/is-error.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(), false, "Undefined"); + a(t(1), false, "Primitive"); + a(t({}), false, "Objectt"); + a(t({ toString: function () { return "[object Error]"; } }), false, "Fake error"); + a(t(new Error()), true, "Error"); + a(t(new EvalError()), true, "EvalError"); + a(t(new RangeError()), true, "RangeError"); + a(t(new ReferenceError()), true, "ReferenceError"); + a(t(new SyntaxError()), true, "SyntaxError"); + a(t(new TypeError()), true, "TypeError"); + a(t(new URIError()), true, "URIError"); +}; diff --git a/node_modules/es5-ext/test/error/valid-error.js b/node_modules/es5-ext/test/error/valid-error.js new file mode 100644 index 0000000..194f37d --- /dev/null +++ b/node_modules/es5-ext/test/error/valid-error.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + var e = new Error(); + a(t(e), e, "Error"); + a.throws(function () { t({}); }, "Other"); +}; diff --git a/node_modules/es5-ext/test/function/#/compose.js b/node_modules/es5-ext/test/function/#/compose.js new file mode 100644 index 0000000..b90a216 --- /dev/null +++ b/node_modules/es5-ext/test/function/#/compose.js @@ -0,0 +1,10 @@ +"use strict"; + +var f = function (a, b) { return ["a", arguments.length, a, b]; } + , g = function (a) { return ["b", arguments.length].concat(a); } + , h = function (a) { return ["c", arguments.length].concat(a); }; + +module.exports = function (t, a) { + a.deep(t.call(h, g, f)(1, 2), ["c", 1, "b", 1, "a", 2, 1, 2]); + a.deep(t(h, g, f)(1, 2), ["c", 1, "b", 1, "a", 2, 1, 2]); +}; diff --git a/node_modules/es5-ext/test/function/#/copy.js b/node_modules/es5-ext/test/function/#/copy.js new file mode 100644 index 0000000..b458447 --- /dev/null +++ b/node_modules/es5-ext/test/function/#/copy.js @@ -0,0 +1,20 @@ +"use strict"; + +module.exports = function (t, a) { + var foo = "raz", bar = "dwa"; + // eslint-disable-next-line func-names + var fn = function marko(a, b) { return this + a + b + foo + bar; }; + var result, o = {}; + + fn.prototype = o; + + fn.foo = "raz"; + + result = t.call(fn); + + a(result.length, fn.length, "Length"); + a(result.name, fn.name, "Length"); + a(result.call("marko", "el", "fe"), "markoelferazdwa", "Body"); + a(result.prototype, fn.prototype, "Prototype"); + a(result.foo, fn.foo, "Custom property"); +}; diff --git a/node_modules/es5-ext/test/function/#/curry.js b/node_modules/es5-ext/test/function/#/curry.js new file mode 100644 index 0000000..fcae286 --- /dev/null +++ b/node_modules/es5-ext/test/function/#/curry.js @@ -0,0 +1,17 @@ +"use strict"; + +var toArray = require("../../../array/to-array") + , f = function () { return toArray(arguments); }; + +module.exports = function (t, a) { + var x, y = {}, z; + a.deep(t.call(f, 0, 1, 2)(3), [], "0 arguments"); + x = t.call(f, 5, {}); + a(x.length, 5, "Length #1"); + z = x(1, 2); + a(z.length, 3, "Length #2"); + z = z(3, 4); + a(z.length, 1, "Length #1"); + a.deep(z(5, 6), [1, 2, 3, 4, 5], "Many arguments"); + a.deep(x(8, 3)(y, 45)("raz", 6), [8, 3, y, 45, "raz"], "Many arguments #2"); +}; diff --git a/node_modules/es5-ext/test/function/#/lock.js b/node_modules/es5-ext/test/function/#/lock.js new file mode 100644 index 0000000..dd807a1 --- /dev/null +++ b/node_modules/es5-ext/test/function/#/lock.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(function () { return arguments.length; })(1, 2, 3), 0); +}; diff --git a/node_modules/es5-ext/test/function/#/microtask-delay.js b/node_modules/es5-ext/test/function/#/microtask-delay.js new file mode 100644 index 0000000..8bd0dc1 --- /dev/null +++ b/node_modules/es5-ext/test/function/#/microtask-delay.js @@ -0,0 +1,22 @@ +"use strict"; + +var nextTick = require("next-tick"); + +module.exports = function (t, a, d) { + var wasInvoked = false, args = [{}, {}], context = {}; + var target = t.call(function () { + a(this, context); + a.deep(arguments, args); + wasInvoked = true; + }); + + nextTick(function () { + a(wasInvoked, false); + target.apply(context, args); + a(wasInvoked, false); + nextTick(function () { + a(wasInvoked, true); + d(); + }); + }); +}; diff --git a/node_modules/es5-ext/test/function/#/not.js b/node_modules/es5-ext/test/function/#/not.js new file mode 100644 index 0000000..64fff71 --- /dev/null +++ b/node_modules/es5-ext/test/function/#/not.js @@ -0,0 +1,11 @@ +"use strict"; + +var identity = require("../../../function/identity") + , noop = require("../../../function/noop"); + +module.exports = function (t, a) { + a(t.call(identity)(""), true, "Falsy"); + a(t.call(noop)(), true, "Undefined"); + a(t.call(identity)({}), false, "Any object"); + a(t.call(identity)(true), false, "True"); +}; diff --git a/node_modules/es5-ext/test/function/#/partial.js b/node_modules/es5-ext/test/function/#/partial.js new file mode 100644 index 0000000..8954948 --- /dev/null +++ b/node_modules/es5-ext/test/function/#/partial.js @@ -0,0 +1,6 @@ +"use strict"; + +var toArray = require("../../../array/to-array") + , f = function () { return toArray(arguments); }; + +module.exports = function (t, a) { a.deep(t.call(f, 1)(2, 3), [1, 2, 3]); }; diff --git a/node_modules/es5-ext/test/function/#/spread.js b/node_modules/es5-ext/test/function/#/spread.js new file mode 100644 index 0000000..64e7b57 --- /dev/null +++ b/node_modules/es5-ext/test/function/#/spread.js @@ -0,0 +1,5 @@ +"use strict"; + +var f = function (a, b) { return this[a] + this[b]; }, o = { a: 3, b: 4 }; + +module.exports = function (t, a) { a(t.call(f).call(o, ["a", "b"]), 7); }; diff --git a/node_modules/es5-ext/test/function/#/to-string-tokens.js b/node_modules/es5-ext/test/function/#/to-string-tokens.js new file mode 100644 index 0000000..79bb83b --- /dev/null +++ b/node_modules/es5-ext/test/function/#/to-string-tokens.js @@ -0,0 +1,26 @@ +/* eslint no-eval: "off" */ + +"use strict"; + +module.exports = function (t, a) { + a.deep(t.call(function (a, b) { return this[a] + this[b]; }), { + args: "a, b", + body: " return this[a] + this[b]; " + }); + a.deep(t.call(function () {}), { args: "", body: "" }); + // eslint-disable-next-line no-unused-vars + a.deep(t.call(function (raz) {}), { args: "raz", body: "" }); + a.deep(t.call(function () { Object(); }), { args: "", body: " Object(); " }); + + try { + eval("(() => {})"); + } catch (e) { + // Non ES2015 env + return; + } + + a.deep(t.call(eval("(() => {})")), { args: "", body: "" }); + a.deep(t.call(eval("((elo) => foo)")), { args: "elo", body: "foo" }); + a.deep(t.call(eval("(elo => foo)")), { args: "elo", body: "foo" }); + a.deep(t.call(eval("((elo, bar) => foo())")), { args: "elo, bar", body: "foo()" }); +}; diff --git a/node_modules/es5-ext/test/function/_define-length.js b/node_modules/es5-ext/test/function/_define-length.js new file mode 100644 index 0000000..844ee3e --- /dev/null +++ b/node_modules/es5-ext/test/function/_define-length.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + var foo = "raz", bar = "dwa", fn = function (a, b) { return this + a + b + foo + bar; }, result; + + result = t(fn, 3); + a(result.call("marko", "el", "fe"), "markoelferazdwa", "Content"); + a(result.length, 3, "Length"); + a(result.prototype, fn.prototype, "Prototype"); +}; diff --git a/node_modules/es5-ext/test/function/constant.js b/node_modules/es5-ext/test/function/constant.js new file mode 100644 index 0000000..8286d7a --- /dev/null +++ b/node_modules/es5-ext/test/function/constant.js @@ -0,0 +1,5 @@ +"use strict"; + +var o = {}; + +module.exports = function (t, a) { a(t(o)(), o); }; diff --git a/node_modules/es5-ext/test/function/identity.js b/node_modules/es5-ext/test/function/identity.js new file mode 100644 index 0000000..5bf4786 --- /dev/null +++ b/node_modules/es5-ext/test/function/identity.js @@ -0,0 +1,5 @@ +"use strict"; + +var o = {}; + +module.exports = function (t, a) { a(t(o), o); }; diff --git a/node_modules/es5-ext/test/function/invoke.js b/node_modules/es5-ext/test/function/invoke.js new file mode 100644 index 0000000..fb65627 --- /dev/null +++ b/node_modules/es5-ext/test/function/invoke.js @@ -0,0 +1,6 @@ +"use strict"; + +var constant = require("../../function/constant") + , o = { b: constant("c") }; + +module.exports = function (t, a) { a(t("b")(o), "c"); }; diff --git a/node_modules/es5-ext/test/function/is-arguments.js b/node_modules/es5-ext/test/function/is-arguments.js new file mode 100644 index 0000000..1836af8 --- /dev/null +++ b/node_modules/es5-ext/test/function/is-arguments.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + var args, dummy; + args = (function () { return arguments; })(); + dummy = { 0: 1, 1: 2 }; + Object.defineProperty(dummy, "length", { value: 2 }); + a(t(args), true, "Arguments"); + a(t(dummy), false, "Dummy"); + a(t([]), false, "Array"); +}; diff --git a/node_modules/es5-ext/test/function/is-function.js b/node_modules/es5-ext/test/function/is-function.js new file mode 100644 index 0000000..3652ba7 --- /dev/null +++ b/node_modules/es5-ext/test/function/is-function.js @@ -0,0 +1,14 @@ +"use strict"; + +var o = { call: Function.prototype.call, apply: Function.prototype.apply }; + +module.exports = function (t, a) { + a(t(function () {}), true, "Function is function"); + a(t(o), false, "Plain object is not function"); + var asyncFunction; + try { asyncFunction = eval("async () => {}"); } + catch (error) {} + if (asyncFunction) { + a(t(asyncFunction), true, "Async function is function"); + } +}; diff --git a/node_modules/es5-ext/test/function/noop.js b/node_modules/es5-ext/test/function/noop.js new file mode 100644 index 0000000..f264da3 --- /dev/null +++ b/node_modules/es5-ext/test/function/noop.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(1, 2, 3), "undefined"); }; diff --git a/node_modules/es5-ext/test/function/pluck.js b/node_modules/es5-ext/test/function/pluck.js new file mode 100644 index 0000000..26adb21 --- /dev/null +++ b/node_modules/es5-ext/test/function/pluck.js @@ -0,0 +1,5 @@ +"use strict"; + +var o = { foo: "bar" }; + +module.exports = function (t, a) { a(t("foo")(o), o.foo); }; diff --git a/node_modules/es5-ext/test/function/valid-function.js b/node_modules/es5-ext/test/function/valid-function.js new file mode 100644 index 0000000..b5e0a57 --- /dev/null +++ b/node_modules/es5-ext/test/function/valid-function.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + var f = function () {}; + a(t(f), f, "Function"); + // eslint-disable-next-line no-new-func + f = new Function(); + a(t(f), f, "Function"); + a.throws(function () { t({}); }, "Object"); + a.throws(function () { t(/re/); }, "RegExp"); + a.throws(function () { + t({ call: function () { return 20; } }); + }, "Plain object"); +}; diff --git a/node_modules/es5-ext/test/global.js b/node_modules/es5-ext/test/global.js new file mode 100644 index 0000000..b29fbbb --- /dev/null +++ b/node_modules/es5-ext/test/global.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a.ok(t && typeof t === "object"); + a(typeof t.Array, "function"); + a("__global__" in Object.prototype, false); +}; diff --git a/node_modules/es5-ext/test/iterable/for-each.js b/node_modules/es5-ext/test/iterable/for-each.js new file mode 100644 index 0000000..aa167dc --- /dev/null +++ b/node_modules/es5-ext/test/iterable/for-each.js @@ -0,0 +1,62 @@ +"use strict"; + +var ArrayIterator = require("es6-iterator/array") + , slice = Array.prototype.slice; + +module.exports = function (t, a) { + var i = 0, x = ["raz", "dwa", "trzy"], y = {}; + t( + x, + function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Array " + i + "#"); + a(this, y, "Array: context: " + i++ + "#"); + }, + y + ); + i = 0; + t( + (function () { return arguments; })("raz", "dwa", "trzy"), + function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Arguments" + i + "#"); + a(this, y, "Arguments: context: " + i++ + "#"); + }, + y + ); + i = 0; + t( + { 0: "raz", 1: "dwa", 2: "trzy", length: 3 }, + function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Array-like" + i + "#"); + a(this, y, "Array-like: context: " + i++ + "#"); + }, + y + ); + i = 0; + t( + (x = "foo"), + function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); + a(this, y, "Regular String: context: " + i++ + "#"); + }, + y + ); + i = 0; + x = ["r", "💩", "z"]; + t( + "r💩z", + function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); + a(this, y, "Unicode String: context: " + i++ + "#"); + }, + y + ); + i = 0; + t( + new ArrayIterator(x), + function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Iterator " + i + "#"); + a(this, y, "Iterator: context: " + i++ + "#"); + }, + y + ); +}; diff --git a/node_modules/es5-ext/test/iterable/is.js b/node_modules/es5-ext/test/iterable/is.js new file mode 100644 index 0000000..f03c3f1 --- /dev/null +++ b/node_modules/es5-ext/test/iterable/is.js @@ -0,0 +1,20 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function (t, a) { + var x; + a(t([]), true, "Array"); + a(t(""), true, "String"); + a(t((function () { return arguments; })()), true, "Arguments"); + a(t({ length: 0 }), true, "List object"); + a(t(function () {}), false, "Function"); + a(t({}), false, "Plain object"); + a(t(/raz/), false, "Regexp"); + a(t(), false, "No argument"); + a(t(null), false, "Null"); + a(t(undefined), false, "Undefined"); + x = {}; + x[iteratorSymbol] = function () {}; + a(t(x), true, "Iterable"); +}; diff --git a/node_modules/es5-ext/test/iterable/validate-object.js b/node_modules/es5-ext/test/iterable/validate-object.js new file mode 100644 index 0000000..486c132 --- /dev/null +++ b/node_modules/es5-ext/test/iterable/validate-object.js @@ -0,0 +1,26 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function (t, a) { + var x; + a.throws(function () { t(0); }, TypeError, "0"); + a.throws(function () { t(false); }, TypeError, "false"); + a.throws(function () { t(""); }, TypeError, "String"); + a.throws(function () { t({}); }, TypeError, "Plain Object"); + a.throws( + function () { + t(function () {}); + }, + TypeError, + "Function" + ); + a(t((x = new String("raz"))), x, "String object"); // Jslint: ignore + + a(t((x = { length: 1 })), x, "Array like"); + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "null"); + x = {}; + x[iteratorSymbol] = function () {}; + a(t(x), x, "Iterable"); +}; diff --git a/node_modules/es5-ext/test/iterable/validate.js b/node_modules/es5-ext/test/iterable/validate.js new file mode 100644 index 0000000..49996a9 --- /dev/null +++ b/node_modules/es5-ext/test/iterable/validate.js @@ -0,0 +1,26 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function (t, a) { + var x; + a.throws(function () { t(0); }, TypeError, "0"); + a.throws(function () { t(false); }, TypeError, "false"); + a(t(""), "", "''"); + a.throws(function () { t({}); }, TypeError, "Plain Object"); + a.throws( + function () { + t(function () {}); + }, + TypeError, + "Function" + ); + a(t((x = new String("raz"))), x, "String object"); // Jslint: ignore + + a(t((x = { length: 1 })), x, "Array like"); + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "null"); + x = {}; + x[iteratorSymbol] = function () {}; + a(t(x), x, "Iterable"); +}; diff --git a/node_modules/es5-ext/test/json/safe-stringify.js b/node_modules/es5-ext/test/json/safe-stringify.js new file mode 100644 index 0000000..59ce8ad --- /dev/null +++ b/node_modules/es5-ext/test/json/safe-stringify.js @@ -0,0 +1,21 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({ foo: "bar" }), JSON.stringify({ foo: "bar" })); + a(t({ foo: { elo: 12 } }), "{\"foo\":{\"elo\":12}}"); + a( + t({ foo: { elo: 12, mel: { toJSON: function () { throw new Error("Nu nu!"); } } } }), + "{\"foo\":{\"elo\":12}}" + ); + a( + t({ foo: { elo: 12 }, mel: { toJSON: function () { throw new Error("Nu nu!"); } } }), + "{\"foo\":{\"elo\":12}}" + ); + a( + t({ + foo: { elo: 12 }, + mel: ["raz", { toJSON: function () { throw new Error("Nu nu!"); } }, 0, 2] + }), + "{\"foo\":{\"elo\":12},\"mel\":[\"raz\",0,2]}" + ); +}; diff --git a/node_modules/es5-ext/test/math/_decimal-adjust.js b/node_modules/es5-ext/test/math/_decimal-adjust.js new file mode 100644 index 0000000..6da15ec --- /dev/null +++ b/node_modules/es5-ext/test/math/_decimal-adjust.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + // Just sanity check, as real tests are in 'round', 'ceil' and 'floor' variants + a(t("round")(55.55, -1), 55.6); +}; diff --git a/node_modules/es5-ext/test/math/_pack-ieee754.js b/node_modules/es5-ext/test/math/_pack-ieee754.js new file mode 100644 index 0000000..6542873 --- /dev/null +++ b/node_modules/es5-ext/test/math/_pack-ieee754.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a.deep(t(1.337, 8, 23), [63, 171, 34, 209]); }; diff --git a/node_modules/es5-ext/test/math/_unpack-ieee754.js b/node_modules/es5-ext/test/math/_unpack-ieee754.js new file mode 100644 index 0000000..d384160 --- /dev/null +++ b/node_modules/es5-ext/test/math/_unpack-ieee754.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a.deep(t([63, 171, 34, 209], 8, 23), 1.3370000123977661); }; diff --git a/node_modules/es5-ext/test/math/acosh/implement.js b/node_modules/es5-ext/test/math/acosh/implement.js new file mode 100644 index 0000000..7ef68ea --- /dev/null +++ b/node_modules/es5-ext/test/math/acosh/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/acosh/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/acosh/index.js b/node_modules/es5-ext/test/math/acosh/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/acosh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/acosh/is-implemented.js b/node_modules/es5-ext/test/math/acosh/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/acosh/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/acosh/shim.js b/node_modules/es5-ext/test/math/acosh/shim.js new file mode 100644 index 0000000..17ac181 --- /dev/null +++ b/node_modules/es5-ext/test/math/acosh/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(-1), NaN, "Negative"); + a(t(0), NaN, "Zero"); + a(t(0.5), NaN, "Below 1"); + a(t(1), 0, "1"); + a(t(2), 1.3169578969248166, "Other"); + a(t(Infinity), Infinity, "Infinity"); +}; diff --git a/node_modules/es5-ext/test/math/asinh/implement.js b/node_modules/es5-ext/test/math/asinh/implement.js new file mode 100644 index 0000000..cf98eb2 --- /dev/null +++ b/node_modules/es5-ext/test/math/asinh/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/asinh/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/asinh/index.js b/node_modules/es5-ext/test/math/asinh/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/asinh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/asinh/is-implemented.js b/node_modules/es5-ext/test/math/asinh/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/asinh/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/asinh/shim.js b/node_modules/es5-ext/test/math/asinh/shim.js new file mode 100644 index 0000000..a4328d2 --- /dev/null +++ b/node_modules/es5-ext/test/math/asinh/shim.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); + a(t(-2), -1.4436354751788103, "Negative"); + a(t(2), 1.4436354751788103, "Positive"); +}; diff --git a/node_modules/es5-ext/test/math/atanh/implement.js b/node_modules/es5-ext/test/math/atanh/implement.js new file mode 100644 index 0000000..b101bed --- /dev/null +++ b/node_modules/es5-ext/test/math/atanh/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/atanh/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/atanh/index.js b/node_modules/es5-ext/test/math/atanh/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/atanh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/atanh/is-implemented.js b/node_modules/es5-ext/test/math/atanh/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/atanh/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/atanh/shim.js b/node_modules/es5-ext/test/math/atanh/shim.js new file mode 100644 index 0000000..f58709c --- /dev/null +++ b/node_modules/es5-ext/test/math/atanh/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(-2), NaN, "Less than -1"); + a(t(2), NaN, "Greater than 1"); + a(t(-1), -Infinity, "-1"); + a(t(1), Infinity, "1"); + a(t(0), 0, "Zero"); + a(Math.round(t(0.5) * 1e15), 549306144334055, "Other"); +}; diff --git a/node_modules/es5-ext/test/math/cbrt/implement.js b/node_modules/es5-ext/test/math/cbrt/implement.js new file mode 100644 index 0000000..c94e12b --- /dev/null +++ b/node_modules/es5-ext/test/math/cbrt/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/cbrt/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/cbrt/index.js b/node_modules/es5-ext/test/math/cbrt/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/cbrt/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/cbrt/is-implemented.js b/node_modules/es5-ext/test/math/cbrt/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/cbrt/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/cbrt/shim.js b/node_modules/es5-ext/test/math/cbrt/shim.js new file mode 100644 index 0000000..fc1beee --- /dev/null +++ b/node_modules/es5-ext/test/math/cbrt/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); + a(t(-1), -1, "-1"); + a(t(1), 1, "1"); + a(t(2), 1.2599210498948732, "Ohter"); +}; diff --git a/node_modules/es5-ext/test/math/ceil-10.js b/node_modules/es5-ext/test/math/ceil-10.js new file mode 100644 index 0000000..1c4a386 --- /dev/null +++ b/node_modules/es5-ext/test/math/ceil-10.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(55.51, -1), 55.6); + a(t(51, 1), 60); + a(t(-55.59, -1), -55.5); + a(t(-59, 1), -50); +}; diff --git a/node_modules/es5-ext/test/math/clz32/implement.js b/node_modules/es5-ext/test/math/clz32/implement.js new file mode 100644 index 0000000..c9a6677 --- /dev/null +++ b/node_modules/es5-ext/test/math/clz32/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/clz32/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/clz32/index.js b/node_modules/es5-ext/test/math/clz32/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/clz32/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/clz32/is-implemented.js b/node_modules/es5-ext/test/math/clz32/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/clz32/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/clz32/shim.js b/node_modules/es5-ext/test/math/clz32/shim.js new file mode 100644 index 0000000..4d8dd2f --- /dev/null +++ b/node_modules/es5-ext/test/math/clz32/shim.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(1), 31, "1"); + a(t(1000), 22, "1000"); + a(t(), 32, "No arguments"); + a(t(Infinity), 32, "Infinity"); + a(t(-Infinity), 32, "-Infinity"); + a(t("foo"), 32, "String"); + a(t(true), 31, "Boolean"); + a(t(3.5), 30, "Float"); +}; diff --git a/node_modules/es5-ext/test/math/cosh/implement.js b/node_modules/es5-ext/test/math/cosh/implement.js new file mode 100644 index 0000000..90e3dab --- /dev/null +++ b/node_modules/es5-ext/test/math/cosh/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/cosh/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/cosh/index.js b/node_modules/es5-ext/test/math/cosh/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/cosh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/cosh/is-implemented.js b/node_modules/es5-ext/test/math/cosh/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/cosh/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/cosh/shim.js b/node_modules/es5-ext/test/math/cosh/shim.js new file mode 100644 index 0000000..0b917c7 --- /dev/null +++ b/node_modules/es5-ext/test/math/cosh/shim.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 1, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), Infinity, "-Infinity"); + a(t(1), 1.5430806348152437, "1"); + a(t(Number.MAX_VALUE), Infinity); + a(t(-Number.MAX_VALUE), Infinity); + a(t(Number.MIN_VALUE), 1); + a(t(-Number.MIN_VALUE), 1); +}; diff --git a/node_modules/es5-ext/test/math/expm1/implement.js b/node_modules/es5-ext/test/math/expm1/implement.js new file mode 100644 index 0000000..41463c6 --- /dev/null +++ b/node_modules/es5-ext/test/math/expm1/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/expm1/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/expm1/index.js b/node_modules/es5-ext/test/math/expm1/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/expm1/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/expm1/is-implemented.js b/node_modules/es5-ext/test/math/expm1/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/expm1/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/expm1/shim.js b/node_modules/es5-ext/test/math/expm1/shim.js new file mode 100644 index 0000000..cebb063 --- /dev/null +++ b/node_modules/es5-ext/test/math/expm1/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -1, "-Infinity"); + a(t(1).toFixed(15), "1.718281828459045", "1"); +}; diff --git a/node_modules/es5-ext/test/math/floor-10.js b/node_modules/es5-ext/test/math/floor-10.js new file mode 100644 index 0000000..a086d80 --- /dev/null +++ b/node_modules/es5-ext/test/math/floor-10.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(55.59, -1), 55.5); + a(t(59, 1), 50); + a(t(-55.51, -1), -55.6); + a(t(-51, 1), -60); +}; diff --git a/node_modules/es5-ext/test/math/fround/implement.js b/node_modules/es5-ext/test/math/fround/implement.js new file mode 100644 index 0000000..6c2bab3 --- /dev/null +++ b/node_modules/es5-ext/test/math/fround/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/fround/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/fround/index.js b/node_modules/es5-ext/test/math/fround/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/fround/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/fround/is-implemented.js b/node_modules/es5-ext/test/math/fround/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/fround/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/fround/shim.js b/node_modules/es5-ext/test/math/fround/shim.js new file mode 100644 index 0000000..0525bfa --- /dev/null +++ b/node_modules/es5-ext/test/math/fround/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); + a(t(1.337), 1.3370000123977661, "1"); +}; diff --git a/node_modules/es5-ext/test/math/hypot/implement.js b/node_modules/es5-ext/test/math/hypot/implement.js new file mode 100644 index 0000000..e4b0052 --- /dev/null +++ b/node_modules/es5-ext/test/math/hypot/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/hypot/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/hypot/index.js b/node_modules/es5-ext/test/math/hypot/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/hypot/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/hypot/is-implemented.js b/node_modules/es5-ext/test/math/hypot/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/hypot/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/hypot/shim.js b/node_modules/es5-ext/test/math/hypot/shim.js new file mode 100644 index 0000000..89e4657 --- /dev/null +++ b/node_modules/es5-ext/test/math/hypot/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(), 0, "No arguments"); + a(t(0, -0, 0), 0, "Zeros"); + a(t(4, NaN, Infinity), Infinity, "Infinity"); + a(t(4, NaN, -Infinity), Infinity, "Infinity"); + a(t(4, NaN, 34), NaN, "NaN"); + a(t(3, 4), 5, "#1"); + a(t(3, 4, 5), 7.0710678118654755, "#2"); +}; diff --git a/node_modules/es5-ext/test/math/imul/implement.js b/node_modules/es5-ext/test/math/imul/implement.js new file mode 100644 index 0000000..4c97d2b --- /dev/null +++ b/node_modules/es5-ext/test/math/imul/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/imul/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/imul/index.js b/node_modules/es5-ext/test/math/imul/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/imul/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/imul/is-implemented.js b/node_modules/es5-ext/test/math/imul/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/imul/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/imul/shim.js b/node_modules/es5-ext/test/math/imul/shim.js new file mode 100644 index 0000000..a8d4e90 --- /dev/null +++ b/node_modules/es5-ext/test/math/imul/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(), 0, "No arguments"); + a(t(0, 0), 0, "Zeros"); + a(t(2, 4), 8, "#1"); + a(t(-1, 8), -8, "#2"); + a(t(0xfffffffe, 5), -10, "#3"); +}; diff --git a/node_modules/es5-ext/test/math/log10/implement.js b/node_modules/es5-ext/test/math/log10/implement.js new file mode 100644 index 0000000..70124b4 --- /dev/null +++ b/node_modules/es5-ext/test/math/log10/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/log10/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/log10/index.js b/node_modules/es5-ext/test/math/log10/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/log10/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/log10/is-implemented.js b/node_modules/es5-ext/test/math/log10/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/log10/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/log10/shim.js b/node_modules/es5-ext/test/math/log10/shim.js new file mode 100644 index 0000000..d069628 --- /dev/null +++ b/node_modules/es5-ext/test/math/log10/shim.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(-0.5), NaN, "Less than 0"); + a(t(0), -Infinity, "0"); + a(t(1), 0, "1"); + a(t(Infinity), Infinity, "Infinity"); + a(t(2), 0.3010299956639812, "Other"); +}; diff --git a/node_modules/es5-ext/test/math/log1p/implement.js b/node_modules/es5-ext/test/math/log1p/implement.js new file mode 100644 index 0000000..766ecdb --- /dev/null +++ b/node_modules/es5-ext/test/math/log1p/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/log1p/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/log1p/index.js b/node_modules/es5-ext/test/math/log1p/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/log1p/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/log1p/is-implemented.js b/node_modules/es5-ext/test/math/log1p/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/log1p/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/log1p/shim.js b/node_modules/es5-ext/test/math/log1p/shim.js new file mode 100644 index 0000000..66b400c --- /dev/null +++ b/node_modules/es5-ext/test/math/log1p/shim.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(-1.5), NaN, "Less than -1"); + a(t(-1), -Infinity, "-1"); + a(t(0), 0, "0"); + a(t(Infinity), Infinity, "Infinity"); + a(t(1), 0.6931471805599453, "Other"); +}; diff --git a/node_modules/es5-ext/test/math/log2/implement.js b/node_modules/es5-ext/test/math/log2/implement.js new file mode 100644 index 0000000..a5360b7 --- /dev/null +++ b/node_modules/es5-ext/test/math/log2/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/log2/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/log2/index.js b/node_modules/es5-ext/test/math/log2/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/log2/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/log2/is-implemented.js b/node_modules/es5-ext/test/math/log2/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/log2/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/log2/shim.js b/node_modules/es5-ext/test/math/log2/shim.js new file mode 100644 index 0000000..f587e33 --- /dev/null +++ b/node_modules/es5-ext/test/math/log2/shim.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(-0.5), NaN, "Less than 0"); + a(t(0), -Infinity, "0"); + a(t(1), 0, "1"); + a(t(Infinity), Infinity, "Infinity"); + a(t(3).toFixed(15), "1.584962500721156", "Other"); +}; diff --git a/node_modules/es5-ext/test/math/round-10.js b/node_modules/es5-ext/test/math/round-10.js new file mode 100644 index 0000000..c7ae38c --- /dev/null +++ b/node_modules/es5-ext/test/math/round-10.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(55.55, -1), 55.6); + a(t(55.549, -1), 55.5); + a(t(55, 1), 60); + a(t(54.9, 1), 50); + a(t(-55.55, -1), -55.5); + a(t(-55.551, -1), -55.6); + a(t(-55, 1), -50); + a(t(-55.1, 1), -60); + a(t(1.005, -2), 1.01); + a(t(-1.005, -2), -1.0); +}; diff --git a/node_modules/es5-ext/test/math/sign/implement.js b/node_modules/es5-ext/test/math/sign/implement.js new file mode 100644 index 0000000..cda8d61 --- /dev/null +++ b/node_modules/es5-ext/test/math/sign/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/sign/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/sign/index.js b/node_modules/es5-ext/test/math/sign/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/sign/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/sign/is-implemented.js b/node_modules/es5-ext/test/math/sign/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/sign/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/sign/shim.js b/node_modules/es5-ext/test/math/sign/shim.js new file mode 100644 index 0000000..071ea07 --- /dev/null +++ b/node_modules/es5-ext/test/math/sign/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +var is = require("../../../object/is"); + +module.exports = function (t, a) { + a(is(t(0), +0), true, "+0"); + a(is(t(-0), -0), true, "-0"); + a(t({}), NaN, true, "NaN"); + a(t(-234234234), -1, "Negative"); + a(t(234234234), 1, "Positive"); +}; diff --git a/node_modules/es5-ext/test/math/sinh/implement.js b/node_modules/es5-ext/test/math/sinh/implement.js new file mode 100644 index 0000000..3d33338 --- /dev/null +++ b/node_modules/es5-ext/test/math/sinh/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/sinh/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/sinh/index.js b/node_modules/es5-ext/test/math/sinh/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/sinh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/sinh/is-implemented.js b/node_modules/es5-ext/test/math/sinh/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/sinh/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/sinh/shim.js b/node_modules/es5-ext/test/math/sinh/shim.js new file mode 100644 index 0000000..f168a7f --- /dev/null +++ b/node_modules/es5-ext/test/math/sinh/shim.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); + a(t(1), 1.1752011936438014, "1"); + a(t(Number.MAX_VALUE), Infinity); + a(t(-Number.MAX_VALUE), -Infinity); + a(t(Number.MIN_VALUE), 5e-324); + a(t(-Number.MIN_VALUE), -5e-324); +}; diff --git a/node_modules/es5-ext/test/math/tanh/implement.js b/node_modules/es5-ext/test/math/tanh/implement.js new file mode 100644 index 0000000..e3d9c55 --- /dev/null +++ b/node_modules/es5-ext/test/math/tanh/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/tanh/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/tanh/index.js b/node_modules/es5-ext/test/math/tanh/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/tanh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/tanh/is-implemented.js b/node_modules/es5-ext/test/math/tanh/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/tanh/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/tanh/shim.js b/node_modules/es5-ext/test/math/tanh/shim.js new file mode 100644 index 0000000..5da3c08 --- /dev/null +++ b/node_modules/es5-ext/test/math/tanh/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), 1, "Infinity"); + a(t(-Infinity), -1, "-Infinity"); + a(t(1), 0.7615941559557649, "1"); + a(t(Number.MAX_VALUE), 1); + a(t(-Number.MAX_VALUE), -1); +}; diff --git a/node_modules/es5-ext/test/math/trunc/implement.js b/node_modules/es5-ext/test/math/trunc/implement.js new file mode 100644 index 0000000..fea8211 --- /dev/null +++ b/node_modules/es5-ext/test/math/trunc/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../math/trunc/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/math/trunc/index.js b/node_modules/es5-ext/test/math/trunc/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/math/trunc/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/math/trunc/is-implemented.js b/node_modules/es5-ext/test/math/trunc/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/math/trunc/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/math/trunc/shim.js b/node_modules/es5-ext/test/math/trunc/shim.js new file mode 100644 index 0000000..b80e868 --- /dev/null +++ b/node_modules/es5-ext/test/math/trunc/shim.js @@ -0,0 +1,16 @@ +"use strict"; + +var is = require("../../../object/is"); + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); + a(is(t(0.234), 0), true, "0"); + a(is(t(-0.234), -0), true, "-0"); + a(t(13.7), 13, "Positive #1"); + a(t(12.3), 12, "Positive #2"); + a(t(-12.3), -12, "Negative #1"); + a(t(-14.7), -14, "Negative #2"); +}; diff --git a/node_modules/es5-ext/test/number/#/pad.js b/node_modules/es5-ext/test/number/#/pad.js new file mode 100644 index 0000000..cc8aa5e --- /dev/null +++ b/node_modules/es5-ext/test/number/#/pad.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(78, 4), "0078"); + a(t.call(65.12323, 4, 3), "0065.123", "Precision"); + a(t.call(65, 4, 3), "0065.000", "Precision integer"); +}; diff --git a/node_modules/es5-ext/test/number/epsilon/implement.js b/node_modules/es5-ext/test/number/epsilon/implement.js new file mode 100644 index 0000000..1366058 --- /dev/null +++ b/node_modules/es5-ext/test/number/epsilon/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../number/epsilon/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/number/epsilon/index.js b/node_modules/es5-ext/test/number/epsilon/index.js new file mode 100644 index 0000000..1be9162 --- /dev/null +++ b/node_modules/es5-ext/test/number/epsilon/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t, "number"); }; diff --git a/node_modules/es5-ext/test/number/epsilon/is-implemented.js b/node_modules/es5-ext/test/number/epsilon/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/number/epsilon/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/number/is-finite/implement.js b/node_modules/es5-ext/test/number/is-finite/implement.js new file mode 100644 index 0000000..da4ee64 --- /dev/null +++ b/node_modules/es5-ext/test/number/is-finite/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../number/is-finite/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/number/is-finite/index.js b/node_modules/es5-ext/test/number/is-finite/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/number/is-finite/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/number/is-finite/is-implemented.js b/node_modules/es5-ext/test/number/is-finite/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/number/is-finite/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/number/is-finite/shim.js b/node_modules/es5-ext/test/number/is-finite/shim.js new file mode 100644 index 0000000..8fa004f --- /dev/null +++ b/node_modules/es5-ext/test/number/is-finite/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(2), true, "Number"); + a(t("23"), false, "Not numeric"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/node_modules/es5-ext/test/number/is-integer/implement.js b/node_modules/es5-ext/test/number/is-integer/implement.js new file mode 100644 index 0000000..b1a8e9c --- /dev/null +++ b/node_modules/es5-ext/test/number/is-integer/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../number/is-integer/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/number/is-integer/index.js b/node_modules/es5-ext/test/number/is-integer/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/number/is-integer/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/number/is-integer/is-implemented.js b/node_modules/es5-ext/test/number/is-integer/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/number/is-integer/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/number/is-integer/shim.js b/node_modules/es5-ext/test/number/is-integer/shim.js new file mode 100644 index 0000000..e367990 --- /dev/null +++ b/node_modules/es5-ext/test/number/is-integer/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(2), true, "Number"); + a(t(2.34), false, "Float"); + a(t("23"), false, "Not numeric"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/node_modules/es5-ext/test/number/is-nan/implement.js b/node_modules/es5-ext/test/number/is-nan/implement.js new file mode 100644 index 0000000..b8d9ab7 --- /dev/null +++ b/node_modules/es5-ext/test/number/is-nan/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../number/is-nan/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/number/is-nan/index.js b/node_modules/es5-ext/test/number/is-nan/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/number/is-nan/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/number/is-nan/is-implemented.js b/node_modules/es5-ext/test/number/is-nan/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/number/is-nan/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/number/is-nan/shim.js b/node_modules/es5-ext/test/number/is-nan/shim.js new file mode 100644 index 0000000..3181047 --- /dev/null +++ b/node_modules/es5-ext/test/number/is-nan/shim.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(2), false, "Number"); + a(t({}), false, "Not numeric"); + a(t(NaN), true, "NaN"); +}; diff --git a/node_modules/es5-ext/test/number/is-natural.js b/node_modules/es5-ext/test/number/is-natural.js new file mode 100644 index 0000000..8fe4dcc --- /dev/null +++ b/node_modules/es5-ext/test/number/is-natural.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(2), true, "Number"); + a(t(-2), false, "Negative"); + a(t(2.34), false, "Float"); + a(t("23"), false, "Not numeric"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/node_modules/es5-ext/test/number/is-number.js b/node_modules/es5-ext/test/number/is-number.js new file mode 100644 index 0000000..9cd670c --- /dev/null +++ b/node_modules/es5-ext/test/number/is-number.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(0), true, "Zero"); + a(t(NaN), true, "NaN"); + a(t(Infinity), true, "Infinity"); + a(t(12), true, "Number"); + a(t(false), false, "Boolean"); + a(t(new Date()), false, "Date"); + a(t(new Number(2)), true, "Number object"); + a(t("asdfaf"), false, "String"); + a(t(""), false, "Empty String"); +}; diff --git a/node_modules/es5-ext/test/number/is-safe-integer/implement.js b/node_modules/es5-ext/test/number/is-safe-integer/implement.js new file mode 100644 index 0000000..aaab29c --- /dev/null +++ b/node_modules/es5-ext/test/number/is-safe-integer/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../number/is-safe-integer/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/number/is-safe-integer/index.js b/node_modules/es5-ext/test/number/is-safe-integer/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/number/is-safe-integer/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js b/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/number/is-safe-integer/shim.js b/node_modules/es5-ext/test/number/is-safe-integer/shim.js new file mode 100644 index 0000000..a4ea691 --- /dev/null +++ b/node_modules/es5-ext/test/number/is-safe-integer/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(2), true, "Number"); + a(t(2.34), false, "Float"); + a(t(Math.pow(2, 53)), false, "Too large"); + a(t(Math.pow(2, 53) - 1), true, "Maximum"); + a(t("23"), false, "Not numeric"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/node_modules/es5-ext/test/number/max-safe-integer/implement.js b/node_modules/es5-ext/test/number/max-safe-integer/implement.js new file mode 100644 index 0000000..c3d4156 --- /dev/null +++ b/node_modules/es5-ext/test/number/max-safe-integer/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../number/max-safe-integer/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/number/max-safe-integer/index.js b/node_modules/es5-ext/test/number/max-safe-integer/index.js new file mode 100644 index 0000000..1be9162 --- /dev/null +++ b/node_modules/es5-ext/test/number/max-safe-integer/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t, "number"); }; diff --git a/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js b/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/number/min-safe-integer/implement.js b/node_modules/es5-ext/test/number/min-safe-integer/implement.js new file mode 100644 index 0000000..3f3533f --- /dev/null +++ b/node_modules/es5-ext/test/number/min-safe-integer/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../number/min-safe-integer/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/number/min-safe-integer/index.js b/node_modules/es5-ext/test/number/min-safe-integer/index.js new file mode 100644 index 0000000..1be9162 --- /dev/null +++ b/node_modules/es5-ext/test/number/min-safe-integer/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t, "number"); }; diff --git a/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js b/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/number/to-integer.js b/node_modules/es5-ext/test/number/to-integer.js new file mode 100644 index 0000000..b7b975f --- /dev/null +++ b/node_modules/es5-ext/test/number/to-integer.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), 0, "NaN"); + a(t(20), 20, "Positive integer"); + a(t("-20"), -20, "String negative integer"); + a(t(Infinity), Infinity, "Infinity"); + a(t(15.343), 15, "Float"); + a(t(-15.343), -15, "Negative float"); +}; diff --git a/node_modules/es5-ext/test/number/to-pos-integer.js b/node_modules/es5-ext/test/number/to-pos-integer.js new file mode 100644 index 0000000..27c7cdf --- /dev/null +++ b/node_modules/es5-ext/test/number/to-pos-integer.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), 0, "NaN"); + a(t(20), 20, "Positive integer"); + a(t(-20), 0, "Negative integer"); + a(t(Infinity), Infinity, "Infinity"); + a(t(15.343), 15, "Float"); + a(t(-15.343), 0, "Negative float"); +}; diff --git a/node_modules/es5-ext/test/number/to-uint32.js b/node_modules/es5-ext/test/number/to-uint32.js new file mode 100644 index 0000000..7eea42f --- /dev/null +++ b/node_modules/es5-ext/test/number/to-uint32.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), 0, "Not numeric"); + a(t(-4), 4294967292, "Negative"); + a(t(133432), 133432, "Positive"); + a(t(8589934592), 0, "Greater than maximum"); +}; diff --git a/node_modules/es5-ext/test/object/_iterate.js b/node_modules/es5-ext/test/object/_iterate.js new file mode 100644 index 0000000..98f8f1e --- /dev/null +++ b/node_modules/es5-ext/test/object/_iterate.js @@ -0,0 +1,36 @@ +"use strict"; + +module.exports = function (t, a) { + var o = { raz: 1, dwa: 2, trzy: 3 }, o2 = {}, o3 = {}, arr, i = -1; + + t = t("forEach"); + t( + o, + function (value, name, self, index) { + o2[name] = value; + a(index, ++i, "Index"); + a(self, o, "Self"); + a(this, o3, "Scope"); + }, + o3 + ); + a.deep(o2, o); + + arr = []; + o2 = {}; + i = -1; + t( + o, + function (value, name, self, index) { + arr.push(value); + o2[name] = value; + a(index, ++i, "Index"); + a(self, o, "Self"); + a(this, o3, "Scope"); + }, + o3, + function (a, b) { return o[b] - o[a]; } + ); + a.deep(o2, o, "Sort by Values: Content"); + a.deep(arr, [3, 2, 1], "Sort by Values: Order"); +}; diff --git a/node_modules/es5-ext/test/object/assign-deep.js b/node_modules/es5-ext/test/object/assign-deep.js new file mode 100644 index 0000000..962ac40 --- /dev/null +++ b/node_modules/es5-ext/test/object/assign-deep.js @@ -0,0 +1,27 @@ +"use strict"; + +module.exports = function (t, a) { + var o1 = { a: 1, b: 2 }, o2 = { b: 3, c: 4 }; + + a(t(o1, o2), o1, "Returns self"); + a.deep(o1, { a: 1, b: 3, c: 4 }, "Single: content"); + + a.deep(t({}, o1, o2), { a: 1, b: 3, c: 4 }, "Multi argument"); + + var obj1 = { foo: { bar: 3, marko: true } } + , obj2 = { foo: { elo: 12, marko: false }, miszka: [23] }; + + var copyObj1 = JSON.parse(JSON.stringify(obj1)), copyObj2 = JSON.parse(JSON.stringify(obj2)); + a.deep(t({}, obj1, obj2), { foo: { bar: 3, marko: false, elo: 12 }, miszka: [23] }); + // Ensure it's side effects free + a.deep(obj1, copyObj1); + a.deep(obj2, copyObj2); + + obj1 = [{ foo: "bar" }]; + var assignedObj = []; + t(assignedObj, obj1); + a.deep(assignedObj, [{ foo: "bar" }]); + // Ensure array items are copied and not passed + a.not(assignedObj[0], obj1[0]); + a(t(true), true); +}; diff --git a/node_modules/es5-ext/test/object/assign/implement.js b/node_modules/es5-ext/test/object/assign/implement.js new file mode 100644 index 0000000..f5cd3a6 --- /dev/null +++ b/node_modules/es5-ext/test/object/assign/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../object/assign/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/object/assign/index.js b/node_modules/es5-ext/test/object/assign/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/object/assign/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/object/assign/is-implemented.js b/node_modules/es5-ext/test/object/assign/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/object/assign/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/object/assign/shim.js b/node_modules/es5-ext/test/object/assign/shim.js new file mode 100644 index 0000000..e86c1e7 --- /dev/null +++ b/node_modules/es5-ext/test/object/assign/shim.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + var o1 = { a: 1, b: 2 }, o2 = { b: 3, c: 4 }; + + a(t(o1, o2), o1, "Returns self"); + a.deep(o1, { a: 1, b: 3, c: 4 }, "Single: content"); + + a.deep(t({}, o1, o2), { a: 1, b: 3, c: 4 }, "Multi argument"); +}; diff --git a/node_modules/es5-ext/test/object/clear.js b/node_modules/es5-ext/test/object/clear.js new file mode 100644 index 0000000..5735e79 --- /dev/null +++ b/node_modules/es5-ext/test/object/clear.js @@ -0,0 +1,13 @@ +"use strict"; + +var isEmpty = require("../../object/is-empty"); + +module.exports = function (t, a) { + var x = {}; + a(t(x), x, "Empty: Returns same object"); + a(isEmpty(x), true, "Empty: Not changed"); + x.foo = "raz"; + x.bar = "dwa"; + a(t(x), x, "Same object"); + a(isEmpty(x), true, "Emptied"); +}; diff --git a/node_modules/es5-ext/test/object/compact.js b/node_modules/es5-ext/test/object/compact.js new file mode 100644 index 0000000..bc3e6dc --- /dev/null +++ b/node_modules/es5-ext/test/object/compact.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}, y = {}, z; + z = t(x); + a.not(z, x, "Returns different object"); + a.deep(z, {}, "Empty on empty"); + + x = { foo: "bar", a: 0, b: false, c: "", d: "0", e: null, bar: y, elo: undefined }; + z = t(x); + a.deep(z, { foo: "bar", a: 0, b: false, c: "", d: "0", bar: y }, "Cleared null values"); +}; diff --git a/node_modules/es5-ext/test/object/compare.js b/node_modules/es5-ext/test/object/compare.js new file mode 100644 index 0000000..23cc511 --- /dev/null +++ b/node_modules/es5-ext/test/object/compare.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + var d = new Date(); + + a.ok(t(12, 3) > 0, "Numbers"); + a.ok(t(2, 13) < 0, "Numbers #2"); + a.ok(t("aaa", "aa") > 0, "Strings"); + a.ok(t("aa", "ab") < 0, "Strings #2"); + a(t("aa", "aa"), 0, "Strings same"); + a(t(d, new Date(d.getTime())), 0, "Same date"); + a.ok(t(d, new Date(d.getTime() + 1)) < 0, "Different date"); +}; diff --git a/node_modules/es5-ext/test/object/copy-deep.js b/node_modules/es5-ext/test/object/copy-deep.js new file mode 100644 index 0000000..9381383 --- /dev/null +++ b/node_modules/es5-ext/test/object/copy-deep.js @@ -0,0 +1,35 @@ +"use strict"; + +var stringify = JSON.stringify; + +module.exports = function (t, a) { + var o = { 1: "raz", 2: "dwa", 3: "trzy" }, no = t(o); + + a.not(no, o, "Return different object"); + a(stringify(no), stringify(o), "Match properties and values"); + + o = { + foo: "bar", + raz: { + dwa: "dwa", + trzy: { cztery: "pięć", sześć: "siedem" }, + osiem: {}, + dziewięć: function () {} + }, + dziesięć: 10, + jedenaście: ["raz", ["dwa", "trzy", { elo: "true" }]] + }; + o.raz.rec = o; + + no = t(o); + a.not(o.raz, no.raz, "Deep"); + a.not(o.raz.trzy, no.raz.trzy, "Deep #2"); + a(stringify(o.raz.trzy), stringify(no.raz.trzy), "Deep content"); + a(no.raz.rec, no, "Recursive"); + a.not(o.raz.osiem, no.raz.osiem, "Empty object"); + a(o.raz["dziewięć"], no.raz["dziewięć"], "Function"); + a.not(o["jedenaście"], no["jedenaście"]); + a.not(o["jedenaście"][1], no["jedenaście"][1]); + a.not(o["jedenaście"][1][2], no["jedenaście"][1][2]); + a(t(true), true); +}; diff --git a/node_modules/es5-ext/test/object/copy.js b/node_modules/es5-ext/test/object/copy.js new file mode 100644 index 0000000..a5e2c34 --- /dev/null +++ b/node_modules/es5-ext/test/object/copy.js @@ -0,0 +1,30 @@ +"use strict"; + +var stringify = JSON.stringify; + +module.exports = function (t, a) { + var o = { 1: "raz", 2: "dwa", 3: "trzy" }, no = t(o); + + a.not(no, o, "Return different object"); + a(stringify(no), stringify(o), "Match properties and values"); + + o = { + foo: "bar", + raz: { + dwa: "dwa", + trzy: { cztery: "pięć", sześć: "siedem" }, + osiem: {}, + dziewięć: function () {} + }, + dziesięć: 10 + }; + o.raz.rec = o; + + no = t(o); + a(o.raz, no.raz, "Shallow"); + + a.deep(t(o, ["foo"]), { foo: "bar" }); + a.deep(t(Object.create(o), ["foo"]), { foo: "bar" }); + a.deep(t(o, ["foo", "habla"]), { foo: "bar" }); + a.deep(t(o, ["foo", "habla"], { ensure: true }), { foo: "bar", habla: undefined }); +}; diff --git a/node_modules/es5-ext/test/object/count.js b/node_modules/es5-ext/test/object/count.js new file mode 100644 index 0000000..041f91a --- /dev/null +++ b/node_modules/es5-ext/test/object/count.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), 0, "Empty"); + a(t({ raz: 1, dwa: null, trzy: undefined, cztery: 0 }), 4, "Some properties"); + a( + t( + Object.defineProperties( + {}, { raz: { value: "raz" }, dwa: { value: "dwa", enumerable: true } } + ) + ), + 1, "Some properties hidden" + ); +}; diff --git a/node_modules/es5-ext/test/object/create.js b/node_modules/es5-ext/test/object/create.js new file mode 100644 index 0000000..220f417 --- /dev/null +++ b/node_modules/es5-ext/test/object/create.js @@ -0,0 +1,22 @@ +"use strict"; + +var setPrototypeOf = require("../../object/set-prototype-of") + , getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (t, a) { + var x = {}, obj; + + a(getPrototypeOf(t(x)), x, "Normal object"); + a(getPrototypeOf(t(null)), (setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Null"); + + a.h1("Properties"); + a.h2("Normal object"); + a(getPrototypeOf((obj = t(x, { foo: { value: "bar" } }))), x, "Prototype"); + a(obj.foo, "bar", "Property"); + a.h2("Null"); + a( + getPrototypeOf((obj = t(null, { foo: { value: "bar2" } }))), + (setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Prototype" + ); + a(obj.foo, "bar2", "Property"); +}; diff --git a/node_modules/es5-ext/test/object/ensure-array.js b/node_modules/es5-ext/test/object/ensure-array.js new file mode 100644 index 0000000..6189d07 --- /dev/null +++ b/node_modules/es5-ext/test/object/ensure-array.js @@ -0,0 +1,23 @@ +"use strict"; + +module.exports = function (t, a) { + var arr = []; + a(t(arr), arr, "Array"); + a(t(""), "", "String"); + var args = (function () { return arguments; })(); + a(t(args), args, "Arguments"); + var arrayLike = { length: 0 }; + a(t(arrayLike), arrayLike, "Array like"); + a.throws( + function () { + t(function () {}); + }, + TypeError, + "Function" + ); + a.throws(function () { t({}); }, TypeError, "Plain object"); + a.throws(function () { t(/raz/); }, TypeError, "Regexp"); + a.throws(function () { t(); }, TypeError, "No argument"); + a.throws(function () { t(null); }, TypeError, "Null"); + a.throws(function () { t(undefined); }, TypeError, "Undefined"); +}; diff --git a/node_modules/es5-ext/test/object/ensure-finite-number.js b/node_modules/es5-ext/test/object/ensure-finite-number.js new file mode 100644 index 0000000..77ac269 --- /dev/null +++ b/node_modules/es5-ext/test/object/ensure-finite-number.js @@ -0,0 +1,18 @@ +"use strict"; + +module.exports = function (t, a) { + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a(t(0), 0, "Zero"); + a.throws(function () { t(NaN); }, TypeError, "NaN"); + a.throws(function () { t(Infinity); }, TypeError, "Infinity"); + a(t(12), 12, "Number"); + a(t(false), 0, "Boolean"); + a(t(new Date(1000000)), 1000000, "Date"); + a(t(new Number(2)), 2, "Number object"); + a.throws(function () { t("asdfaf"); }, TypeError, "String"); + a(t(""), 0, "Empty String"); + if (typeof Symbol === "function") { + a.throws(function () { t(Symbol("test")); }, TypeError, "Symbol"); + } +}; diff --git a/node_modules/es5-ext/test/object/ensure-integer.js b/node_modules/es5-ext/test/object/ensure-integer.js new file mode 100644 index 0000000..c97d81a --- /dev/null +++ b/node_modules/es5-ext/test/object/ensure-integer.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a(t(2), 2, "Number"); + a(t(-2), -2, "Negative"); + a.throws(function () { t(2.34); }, TypeError, "Float"); + a(t("23"), 23, "Numeric string"); + a.throws(function () { t(NaN); }, TypeError, "NaN"); + a.throws(function () { t(Infinity); }, TypeError, "Infinity"); +}; diff --git a/node_modules/es5-ext/test/object/ensure-natural-number-value.js b/node_modules/es5-ext/test/object/ensure-natural-number-value.js new file mode 100644 index 0000000..16b0cdf --- /dev/null +++ b/node_modules/es5-ext/test/object/ensure-natural-number-value.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a(t(2), 2, "Number"); + a.throws(function () { t(-2); }, TypeError, "Negative"); + a.throws(function () { t(2.34); }, TypeError, "Float"); + a(t("23"), 23, "Numeric string"); + a.throws(function () { t(NaN); }, TypeError, "NaN"); + a.throws(function () { t(Infinity); }, TypeError, "Infinity"); +}; diff --git a/node_modules/es5-ext/test/object/ensure-natural-number.js b/node_modules/es5-ext/test/object/ensure-natural-number.js new file mode 100644 index 0000000..861c595 --- /dev/null +++ b/node_modules/es5-ext/test/object/ensure-natural-number.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a(t(null), 0, "Null"); + a(t(2), 2, "Number"); + a.throws(function () { t(-2); }, TypeError, "Negative"); + a.throws(function () { t(2.34); }, TypeError, "Float"); + a(t("23"), 23, "Numeric string"); + a.throws(function () { t(NaN); }, TypeError, "NaN"); + a.throws(function () { t(Infinity); }, TypeError, "Infinity"); +}; diff --git a/node_modules/es5-ext/test/object/ensure-plain-function.js b/node_modules/es5-ext/test/object/ensure-plain-function.js new file mode 100644 index 0000000..eeeae0f --- /dev/null +++ b/node_modules/es5-ext/test/object/ensure-plain-function.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + // Just sanity checks, as logic is tested at isPlainFunction + var fn = function () {}; + a(t(fn), fn, "Function"); + a.throws(function () { t({}); }, TypeError, "Error"); +}; diff --git a/node_modules/es5-ext/test/object/ensure-plain-object.js b/node_modules/es5-ext/test/object/ensure-plain-object.js new file mode 100644 index 0000000..cc1d1fa --- /dev/null +++ b/node_modules/es5-ext/test/object/ensure-plain-object.js @@ -0,0 +1,16 @@ +"use strict"; + +module.exports = function (t, a) { + // Just sanity checks, as logic is tested at isPlainFunction + var obj = {}; + a(t(obj), obj, "Reguar object instance"); + obj = Object.create(null); + a(t(obj), obj, "Null prototype"); + a.throws( + function () { + t(function () {}); + }, + TypeError, + "Error" + ); +}; diff --git a/node_modules/es5-ext/test/object/ensure-promise.js b/node_modules/es5-ext/test/object/ensure-promise.js new file mode 100644 index 0000000..07f058e --- /dev/null +++ b/node_modules/es5-ext/test/object/ensure-promise.js @@ -0,0 +1,20 @@ +"use strict"; + +module.exports = function (t, a) { + var promise; + a.throws(function () { t(); }, TypeError); + a.throws(function () { t(null); }, TypeError); + a.throws(function () { t("promise"); }, TypeError); + a.throws(function () { t({}); }, TypeError); + a.throws(function () { + t(function () {}); + }, TypeError); + a.throws(function () { t({ then: {} }); }, TypeError); + promise = { then: function () {} }; + a(t(promise), promise); + promise = function () {}; + promise.then = {}; + a.throws(function () { t(promise); }, TypeError); + promise.then = function () {}; + a(t(promise), promise); +}; diff --git a/node_modules/es5-ext/test/object/ensure-thenable.js b/node_modules/es5-ext/test/object/ensure-thenable.js new file mode 100644 index 0000000..02be1ef --- /dev/null +++ b/node_modules/es5-ext/test/object/ensure-thenable.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + // Just sanity checks as proper tests are at isThenable + var thenable = { then: function () {} }; + + a.throws(function () { t({}); }, TypeError); + a(t(thenable), thenable); +}; diff --git a/node_modules/es5-ext/test/object/entries/implement.js b/node_modules/es5-ext/test/object/entries/implement.js new file mode 100644 index 0000000..c367ee4 --- /dev/null +++ b/node_modules/es5-ext/test/object/entries/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../object/entries/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/object/entries/index.js b/node_modules/es5-ext/test/object/entries/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/object/entries/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/object/entries/is-implemented.js b/node_modules/es5-ext/test/object/entries/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/object/entries/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/object/entries/shim.js b/node_modules/es5-ext/test/object/entries/shim.js new file mode 100644 index 0000000..eb7285a --- /dev/null +++ b/node_modules/es5-ext/test/object/entries/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a.deep(t({ foo: "bar" }), [["foo", "bar"]], "Object"); + a.deep(t("raz"), [["0", "r"], ["1", "a"], ["2", "z"]], "Primitive"); + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Undefined"); +}; diff --git a/node_modules/es5-ext/test/object/eq.js b/node_modules/es5-ext/test/object/eq.js new file mode 100644 index 0000000..8cad90a --- /dev/null +++ b/node_modules/es5-ext/test/object/eq.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + var o = {}; + a(t(o, {}), false, "Different objects"); + a(t(o, o), true, "Same objects"); + a(t("1", "1"), true, "Same primitive"); + a(t("1", 1), false, "Different primitive types"); + a(t(NaN, NaN), true, "NaN"); + a(t(0, 0), true, "0,0"); + a(t(0, -0), true, "0,-0"); +}; diff --git a/node_modules/es5-ext/test/object/every.js b/node_modules/es5-ext/test/object/every.js new file mode 100644 index 0000000..81f4662 --- /dev/null +++ b/node_modules/es5-ext/test/object/every.js @@ -0,0 +1,16 @@ +"use strict"; + +var o = { 1: 1, 2: 2, 3: 3 }; + +module.exports = function (t, a) { + var o2 = {}; + t(o, function (value, name) { + o2[name] = value; + return true; + }); + a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); + + a(t(o, function () { return true; }), true, "Succeeds"); + + a(t(o, function () { return false; }), false, "Fails"); +}; diff --git a/node_modules/es5-ext/test/object/filter.js b/node_modules/es5-ext/test/object/filter.js new file mode 100644 index 0000000..b9ff5e7 --- /dev/null +++ b/node_modules/es5-ext/test/object/filter.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a.deep(t({ 1: 1, 2: 2, 3: 3, 4: 4 }, function (value) { return Boolean(value % 2); }), { + 1: 1, + 3: 3 + }); +}; diff --git a/node_modules/es5-ext/test/object/find-key.js b/node_modules/es5-ext/test/object/find-key.js new file mode 100644 index 0000000..f580e1e --- /dev/null +++ b/node_modules/es5-ext/test/object/find-key.js @@ -0,0 +1,24 @@ +"use strict"; + +var o = { 1: 1, 2: 2, 3: 3 }; + +module.exports = function (t, a) { + var o2 = {}, i = 0; + t(o, function (value, name) { + o2[name] = value; + return false; + }); + a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); + + a( + t(o, function () { + ++i; + return true; + }), + "1", + "Finds" + ); + a(i, 1, "Stops iteration after condition is met"); + + a(t(o, function () { return false; }), undefined, "Fails"); +}; diff --git a/node_modules/es5-ext/test/object/find.js b/node_modules/es5-ext/test/object/find.js new file mode 100644 index 0000000..b0c6b81 --- /dev/null +++ b/node_modules/es5-ext/test/object/find.js @@ -0,0 +1,24 @@ +"use strict"; + +var o = { 1: 1, 2: 2, 3: 3 }; + +module.exports = function (t, a) { + var o2 = {}, i = 0; + t(o, function (value, name) { + o2[name] = value; + return false; + }); + a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); + + a( + t(o, function () { + ++i; + return true; + }), + 1, + "Finds" + ); + a(i, 1, "Stops iteration after condition is met"); + + a(t(o, function () { return false; }), undefined, "Fails"); +}; diff --git a/node_modules/es5-ext/test/object/first-key.js b/node_modules/es5-ext/test/object/first-key.js new file mode 100644 index 0000000..6010ba1 --- /dev/null +++ b/node_modules/es5-ext/test/object/first-key.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}, y = Object.create(null); + a(t(x), null, "Normal: Empty"); + a(t(y), null, "Null extension: Empty"); + x.foo = "raz"; + x.bar = 343; + a(["foo", "bar"].indexOf(t(x)) !== -1, true, "Normal"); + y.elo = "foo"; + y.mar = "wew"; + a(["elo", "mar"].indexOf(t(y)) !== -1, true, "Null extension"); +}; diff --git a/node_modules/es5-ext/test/object/flatten.js b/node_modules/es5-ext/test/object/flatten.js new file mode 100644 index 0000000..efacd22 --- /dev/null +++ b/node_modules/es5-ext/test/object/flatten.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a.deep(t({ a: { aa: 1, ab: 2 }, b: { ba: 3, bb: 4 } }), { aa: 1, ab: 2, ba: 3, bb: 4 }); +}; diff --git a/node_modules/es5-ext/test/object/for-each.js b/node_modules/es5-ext/test/object/for-each.js new file mode 100644 index 0000000..4ba4887 --- /dev/null +++ b/node_modules/es5-ext/test/object/for-each.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + var o = { raz: 1, dwa: 2, trzy: 3 }, o2 = {}; + a(t(o, function (value, name) { o2[name] = value; }), undefined, "Return"); + a.deep(o2, o); +}; diff --git a/node_modules/es5-ext/test/object/get-property-names.js b/node_modules/es5-ext/test/object/get-property-names.js new file mode 100644 index 0000000..89cfecc --- /dev/null +++ b/node_modules/es5-ext/test/object/get-property-names.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = function (t, a) { + var o = { first: 1, second: 4 }, r1, r2; + o = Object.create(o, { third: { value: null } }); + o.first = 2; + o = Object.create(o); + o.fourth = 3; + + r1 = t(o); + r1.sort(); + r2 = ["first", "second", "third", "fourth"].concat( + Object.getOwnPropertyNames(Object.prototype) + ); + r2.sort(); + a.deep(r1, r2); +}; diff --git a/node_modules/es5-ext/test/object/is-array-like.js b/node_modules/es5-ext/test/object/is-array-like.js new file mode 100644 index 0000000..fed39b7 --- /dev/null +++ b/node_modules/es5-ext/test/object/is-array-like.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + a(t([]), true, "Array"); + a(t(""), true, "String"); + a(t((function () { return arguments; })()), true, "Arguments"); + a(t({ length: 0 }), true, "List object"); + a(t(function () {}), false, "Function"); + a(t({}), false, "Plain object"); + a(t(/raz/), false, "Regexp"); + a(t(), false, "No argument"); + a(t(null), false, "Null"); + a(t(undefined), false, "Undefined"); +}; diff --git a/node_modules/es5-ext/test/object/is-callable.js b/node_modules/es5-ext/test/object/is-callable.js new file mode 100644 index 0000000..415023e --- /dev/null +++ b/node_modules/es5-ext/test/object/is-callable.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(function () {}), true, "Function"); + a(t({}), false, "Object"); + a(t(), false, "Undefined"); + a(t(null), false, "Null"); +}; diff --git a/node_modules/es5-ext/test/object/is-copy-deep.js b/node_modules/es5-ext/test/object/is-copy-deep.js new file mode 100644 index 0000000..476ca74 --- /dev/null +++ b/node_modules/es5-ext/test/object/is-copy-deep.js @@ -0,0 +1,42 @@ +"use strict"; + +module.exports = function (t, a) { + var x, y; + + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same"); + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false, "Different property value"); + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false, "Property only in source"); + a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false, "Property only in target"); + + a(t("raz", "dwa"), false, "String: diff"); + a(t("raz", "raz"), true, "String: same"); + a(t("32", 32), false, "String & Number"); + + a(t([1, "raz", true], [1, "raz", true]), true, "Array: same"); + a(t([1, "raz", undefined], [1, "raz"]), false, "Array: diff"); + a(t(["foo"], ["one"]), false, "Array: One value comparision"); + + x = { foo: { bar: { mar: {} } } }; + y = { foo: { bar: { mar: {} } } }; + a(t(x, y), true, "Deep"); + + a(t({ foo: { bar: { mar: "foo" } } }, { foo: { bar: { mar: {} } } }), false, "Deep: false"); + + x = { foo: { bar: { mar: {} } } }; + x.rec = { foo: x }; + + y = { foo: { bar: { mar: {} } } }; + y.rec = { foo: x }; + + a(t(x, y), true, "Object: Infinite Recursion: Same #1"); + + x.rec.foo = y; + a(t(x, y), true, "Object: Infinite Recursion: Same #2"); + + x.rec.foo = x; + y.rec.foo = y; + a(t(x, y), true, "Object: Infinite Recursion: Same #3"); + + y.foo.bar.mar = "raz"; + a(t(x, y), false, "Object: Infinite Recursion: Diff"); +}; diff --git a/node_modules/es5-ext/test/object/is-copy.js b/node_modules/es5-ext/test/object/is-copy.js new file mode 100644 index 0000000..ffffd28 --- /dev/null +++ b/node_modules/es5-ext/test/object/is-copy.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same"); + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false, "Different property value"); + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false, "Property only in source"); + a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false, "Property only in target"); + + a(t("raz", "dwa"), false, "String: diff"); + a(t("raz", "raz"), true, "String: same"); + a(t("32", 32), false, "String & Number"); + + a(t([1, "raz", true], [1, "raz", true]), true, "Array: same"); + a(t([1, "raz", undefined], [1, "raz"]), false, "Array: diff"); +}; diff --git a/node_modules/es5-ext/test/object/is-empty.js b/node_modules/es5-ext/test/object/is-empty.js new file mode 100644 index 0000000..067b162 --- /dev/null +++ b/node_modules/es5-ext/test/object/is-empty.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), true, "Empty"); + a(t({ 1: 1 }), false, "Not empty"); +}; diff --git a/node_modules/es5-ext/test/object/is-finite-number.js b/node_modules/es5-ext/test/object/is-finite-number.js new file mode 100644 index 0000000..6475fb6 --- /dev/null +++ b/node_modules/es5-ext/test/object/is-finite-number.js @@ -0,0 +1,18 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(0), true, "Zero"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); + a(t(12), true, "Number"); + a(t(false), true, "Boolean"); + a(t(new Date()), true, "Date"); + a(t(new Number(2)), true, "Number object"); + a(t("asdfaf"), false, "String"); + a(t(""), true, "Empty String"); + if (typeof Symbol === "function") { + a(t(Symbol("test")), false, "Symbol"); + } +}; diff --git a/node_modules/es5-ext/test/object/is-integer.js b/node_modules/es5-ext/test/object/is-integer.js new file mode 100644 index 0000000..a0bcd5c --- /dev/null +++ b/node_modules/es5-ext/test/object/is-integer.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(2), true, "Number"); + a(t(-2), true, "Negative"); + a(t(2.34), false, "Float"); + a(t("23"), true, "Numeric string"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/node_modules/es5-ext/test/object/is-natural-number-value.js b/node_modules/es5-ext/test/object/is-natural-number-value.js new file mode 100644 index 0000000..2bc2b1c --- /dev/null +++ b/node_modules/es5-ext/test/object/is-natural-number-value.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(2), true, "Number"); + a(t(-2), false, "Negative"); + a(t(2.34), false, "Float"); + a(t("23"), true, "Numeric string"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/node_modules/es5-ext/test/object/is-natural-number.js b/node_modules/es5-ext/test/object/is-natural-number.js new file mode 100644 index 0000000..bb110e6 --- /dev/null +++ b/node_modules/es5-ext/test/object/is-natural-number.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), true, "Null"); + a(t(2), true, "Number"); + a(t(-2), false, "Negative"); + a(t(2.34), false, "Float"); + a(t("23"), true, "Numeric string"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/node_modules/es5-ext/test/object/is-number-value.js b/node_modules/es5-ext/test/object/is-number-value.js new file mode 100644 index 0000000..2c09d25 --- /dev/null +++ b/node_modules/es5-ext/test/object/is-number-value.js @@ -0,0 +1,18 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(0), true, "Zero"); + a(t(NaN), false, "NaN"); + a(t(Infinity), true, "Infinity"); + a(t(12), true, "Number"); + a(t(false), true, "Boolean"); + a(t(new Date()), true, "Date"); + a(t(new Number(2)), true, "Number object"); + a(t("asdfaf"), false, "String"); + a(t(""), true, "Empty String"); + if (typeof Symbol === "function") { + a(t(Symbol("test")), false, "Symbol"); + } +}; diff --git a/node_modules/es5-ext/test/object/is-object.js b/node_modules/es5-ext/test/object/is-object.js new file mode 100644 index 0000000..0b83599 --- /dev/null +++ b/node_modules/es5-ext/test/object/is-object.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + a(t("arar"), false, "String"); + a(t(12), false, "Number"); + a(t(true), false, "Boolean"); + a(t(null), false, "Null"); + a(t(new Date()), true, "Date"); + a(t(new String("raz")), true, "String object"); + a(t({}), true, "Plain object"); + a(t(/a/), true, "Regular expression"); + a(t(function () {}), true, "Function"); +}; diff --git a/node_modules/es5-ext/test/object/is-plain-function.js b/node_modules/es5-ext/test/object/is-plain-function.js new file mode 100644 index 0000000..ded7fa0 --- /dev/null +++ b/node_modules/es5-ext/test/object/is-plain-function.js @@ -0,0 +1,39 @@ +"use strict"; + +var setPrototypeOf = require("../../object/set-prototype-of"); + +module.exports = function (t, a) { + a(t(function () {}), true, "Function"); + a(t({}), false, "Object"); + a(t(), false, "Undefined"); + a(t(null), false, "Null"); + if (setPrototypeOf) { + a( + t(Object.setPrototypeOf(function () {}, Object.prototype)), false, + "Function with non-function prototype" + ); + } + var arrowfn; + try { arrowfn = eval("(() => {})"); } + catch (e) {} + if (arrowfn) { + a(t(arrowfn), true, "Arrow function"); + } + + var classFn; + try { classFn = eval("(class {})"); } + catch (e) {} + if (classFn) { + a(t(classFn), false, "Class"); + } + + var commentedClassFn; + try { + // Follows issue reported to ljhard/is-callable project: + // https://github.com/ljharb/is-callable/issues/4 + commentedClassFn = eval("(class/*kkk*/\n//blah\n Bar\n//blah\n {})"); + } catch (e) {} + if (commentedClassFn) { + a(t(commentedClassFn, false, "Class"), false, "Class with comments"); + } +}; diff --git a/node_modules/es5-ext/test/object/is-plain-object.js b/node_modules/es5-ext/test/object/is-plain-object.js new file mode 100644 index 0000000..60ac132 --- /dev/null +++ b/node_modules/es5-ext/test/object/is-plain-object.js @@ -0,0 +1,23 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), true, "Empty {} is plain object"); + a(t({ a: true }), true, "{} with property is plain object"); + a( + t({ prototype: 1, constructor: 2, __proto__: 3 }), true, + "{} with any property keys is plain object" + ); + a(t(null), false, "Null is not plain object"); + a(t("string"), false, "Primitive is not plain object"); + a(t(function () {}), false, "Function is not plain object"); + a( + t(Object.create({})), false, + "Object whose prototype is not Object.prototype is not plain object" + ); + a( + t(Object.create(Object.prototype)), true, + "Object whose prototype is Object.prototype is plain object" + ); + a(t(Object.create(null)), true, "Object whose prototype is null is plain object"); + a(t(Object.prototype), false, "Object.prototype"); +}; diff --git a/node_modules/es5-ext/test/object/is-promise.js b/node_modules/es5-ext/test/object/is-promise.js new file mode 100644 index 0000000..18bf934 --- /dev/null +++ b/node_modules/es5-ext/test/object/is-promise.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = function (t, a) { + var promise; + a(t(), false); + a(t(null), false); + a(t("promise"), false); + a(t({}), false); + a(t(function () {}), false); + a(t({ then: {} }), false); + a(t({ then: function () {} }), true); + promise = function () {}; + promise.then = {}; + a(t(promise), false); + promise.then = function () {}; + a(t(promise), true); +}; diff --git a/node_modules/es5-ext/test/object/is-thenable.js b/node_modules/es5-ext/test/object/is-thenable.js new file mode 100644 index 0000000..18bf934 --- /dev/null +++ b/node_modules/es5-ext/test/object/is-thenable.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = function (t, a) { + var promise; + a(t(), false); + a(t(null), false); + a(t("promise"), false); + a(t({}), false); + a(t(function () {}), false); + a(t({ then: {} }), false); + a(t({ then: function () {} }), true); + promise = function () {}; + promise.then = {}; + a(t(promise), false); + promise.then = function () {}; + a(t(promise), true); +}; diff --git a/node_modules/es5-ext/test/object/is-value.js b/node_modules/es5-ext/test/object/is-value.js new file mode 100644 index 0000000..c97722d --- /dev/null +++ b/node_modules/es5-ext/test/object/is-value.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(), false); + a(t(undefined), false); + a(t(null), false); + a(t(NaN), true); + a(t(0), true); + a(t(false), true); + a(t("null"), true); + a(t(""), true); + a(t({}), true); + a(t(Object.prototype), true); +}; diff --git a/node_modules/es5-ext/test/object/is.js b/node_modules/es5-ext/test/object/is.js new file mode 100644 index 0000000..c94ed41 --- /dev/null +++ b/node_modules/es5-ext/test/object/is.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + var o = {}; + a(t(o, {}), false, "Different objects"); + a(t(o, o), true, "Same objects"); + a(t("1", "1"), true, "Same primitive"); + a(t("1", 1), false, "Different primitive types"); + a(t(NaN, NaN), true, "NaN"); + a(t(0, 0), true, "0,0"); + a(t(0, -0), false, "0,-0"); +}; diff --git a/node_modules/es5-ext/test/object/key-of.js b/node_modules/es5-ext/test/object/key-of.js new file mode 100644 index 0000000..cd75ae5 --- /dev/null +++ b/node_modules/es5-ext/test/object/key-of.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}, y = {}, o = { foo: "bar", raz: x, trzy: "cztery", five: "6" }; + + a(t(o, "bar"), "foo", "First property"); + a(t(o, 6), null, "Primitive that's not there"); + a(t(o, x), "raz", "Object"); + a(t(o, y), null, "Object that's not there"); + a(t(o, "6"), "five", "Last property"); +}; diff --git a/node_modules/es5-ext/test/object/keys/implement.js b/node_modules/es5-ext/test/object/keys/implement.js new file mode 100644 index 0000000..3134886 --- /dev/null +++ b/node_modules/es5-ext/test/object/keys/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../object/keys/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/object/keys/index.js b/node_modules/es5-ext/test/object/keys/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/object/keys/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/object/keys/is-implemented.js b/node_modules/es5-ext/test/object/keys/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/object/keys/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/object/keys/shim.js b/node_modules/es5-ext/test/object/keys/shim.js new file mode 100644 index 0000000..dc09f46 --- /dev/null +++ b/node_modules/es5-ext/test/object/keys/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a.deep(t({ foo: "bar" }), ["foo"], "Object"); + a.deep(t("raz"), ["0", "1", "2"], "Primitive"); + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Undefined"); +}; diff --git a/node_modules/es5-ext/test/object/map-keys.js b/node_modules/es5-ext/test/object/map-keys.js new file mode 100644 index 0000000..3dc9298 --- /dev/null +++ b/node_modules/es5-ext/test/object/map-keys.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + a.deep(t({ 1: 1, 2: 2, 3: 3 }, function (key, value) { return "x" + (key + value); }), { + x11: 1, + x22: 2, + x33: 3 + }); +}; diff --git a/node_modules/es5-ext/test/object/map.js b/node_modules/es5-ext/test/object/map.js new file mode 100644 index 0000000..c472575 --- /dev/null +++ b/node_modules/es5-ext/test/object/map.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + var obj = { 1: 1, 2: 2, 3: 3 }; + a.deep( + t(obj, function (value, key, context) { + a(context, obj, "Context argument"); + return value + 1 + key; + }), + { 1: "21", 2: "32", 3: "43" } + ); +}; diff --git a/node_modules/es5-ext/test/object/mixin-prototypes.js b/node_modules/es5-ext/test/object/mixin-prototypes.js new file mode 100644 index 0000000..f510afb --- /dev/null +++ b/node_modules/es5-ext/test/object/mixin-prototypes.js @@ -0,0 +1,68 @@ +"use strict"; + +module.exports = function (t, a) { + var o, o1, o2, x, y = {}, z = {}; + o = { inherited: true, visible: 23 }; + o1 = Object.create(o); + o1.visible = z; + o1.nonremovable = "raz"; + Object.defineProperty(o1, "hidden", { value: "hidden" }); + + o2 = Object.defineProperties({}, { nonremovable: { value: y } }); + o2.other = "other"; + + try { t(o2, o1); } + catch (ignore) {} + + a(o2.visible, z, "Enumerable"); + a(o1.hidden, "hidden", "Not Enumerable"); + a(o2.propertyIsEnumerable("visible"), true, "Enumerable is enumerable"); + a(o2.propertyIsEnumerable("hidden"), false, "Not enumerable is not enumerable"); + + a(o2.inherited, true, "Extend deep"); + + a(o2.nonremovable, y, "Do not overwrite non configurable"); + a(o2.other, "other", "Own kept"); + + x = {}; + t(x, o2); + try { t(x, o1); } + catch (ignore) {} + + a(x.visible, z, "Enumerable"); + a(x.hidden, "hidden", "Not Enumerable"); + a(x.propertyIsEnumerable("visible"), true, "Enumerable is enumerable"); + a(x.propertyIsEnumerable("hidden"), false, "Not enumerable is not enumerable"); + + a(x.inherited, true, "Extend deep"); + + a(x.nonremovable, y, "Ignored non configurable"); + a(x.other, "other", "Other"); + + x.visible = 3; + a(x.visible, 3, "Writable is writable"); + + x = {}; + t(x, o1); + a.throws(function () { x.hidden = 3; }, "Not writable is not writable"); + + x = {}; + t(x, o1); + delete x.visible; + a.ok(!x.hasOwnProperty("visible"), "Configurable is configurable"); + + x = {}; + t(x, o1); + a.throws(function () { delete x.hidden; }, "Not configurable is not configurable"); + + x = Object.defineProperty({}, "foo", { + configurable: false, + writable: true, + enumerable: false, + value: "bar" + }); + + try { t(x, { foo: "lorem" }); } + catch (ignore) {} + a(x.foo, "bar", "Writable, not enumerable"); +}; diff --git a/node_modules/es5-ext/test/object/mixin.js b/node_modules/es5-ext/test/object/mixin.js new file mode 100644 index 0000000..4195d03 --- /dev/null +++ b/node_modules/es5-ext/test/object/mixin.js @@ -0,0 +1,70 @@ +"use strict"; + +module.exports = function (t, a) { + var o, o1, o2, x, y = {}, z = {}; + o = { inherited: true }; + o1 = Object.create(o); + o1.visible = z; + o1.nonremovable = "raz"; + Object.defineProperty(o1, "hidden", { value: "hidden" }); + + o2 = Object.defineProperties({}, { nonremovable: { value: y } }); + o2.other = "other"; + + try { t(o2, o1); } + catch (ignore) {} + + a(o2.visible, z, "Enumerable"); + a(o1.hidden, "hidden", "Not Enumerable"); + a(o2.propertyIsEnumerable("visible"), true, "Enumerable is enumerable"); + a(o2.propertyIsEnumerable("hidden"), false, "Not enumerable is not enumerable"); + + a(o2.hasOwnProperty("inherited"), false, "Extend only own"); + a(o2.inherited, undefined, "Extend ony own: value"); + + a(o2.nonremovable, y, "Do not overwrite non configurable"); + a(o2.other, "other", "Own kept"); + + x = {}; + t(x, o2); + try { t(x, o1); } + catch (ignore) {} + + a(x.visible, z, "Enumerable"); + a(x.hidden, "hidden", "Not Enumerable"); + a(x.propertyIsEnumerable("visible"), true, "Enumerable is enumerable"); + a(x.propertyIsEnumerable("hidden"), false, "Not enumerable is not enumerable"); + + a(x.hasOwnProperty("inherited"), false, "Extend only own"); + a(x.inherited, undefined, "Extend ony own: value"); + + a(x.nonremovable, y, "Ignored non configurable"); + a(x.other, "other", "Other"); + + x.visible = 3; + a(x.visible, 3, "Writable is writable"); + + x = {}; + t(x, o1); + a.throws(function () { x.hidden = 3; }, "Not writable is not writable"); + + x = {}; + t(x, o1); + delete x.visible; + a.ok(!x.hasOwnProperty("visible"), "Configurable is configurable"); + + x = {}; + t(x, o1); + a.throws(function () { delete x.hidden; }, "Not configurable is not configurable"); + + x = Object.defineProperty({}, "foo", { + configurable: false, + writable: true, + enumerable: false, + value: "bar" + }); + + try { t(x, { foo: "lorem" }); } + catch (ignore) {} + a(x.foo, "bar", "Writable, not enumerable"); +}; diff --git a/node_modules/es5-ext/test/object/normalize-options.js b/node_modules/es5-ext/test/object/normalize-options.js new file mode 100644 index 0000000..74d3208 --- /dev/null +++ b/node_modules/es5-ext/test/object/normalize-options.js @@ -0,0 +1,55 @@ +"use strict"; + +var create = Object.create, defineProperty = Object.defineProperty; + +module.exports = function (t, a) { + var x = { foo: "raz", bar: "dwa" }, y; + y = t(x); + a.not(y, x, "Returns copy"); + a.deep(y, x, "Plain"); + + x = { raz: "one", dwa: "two" }; + defineProperty(x, "get", { + configurable: true, + enumerable: true, + get: function () { return this.dwa; } + }); + x = create(x); + x.trzy = "three"; + x.cztery = "four"; + x = create(x); + x.dwa = "two!"; + x.trzy = "three!"; + x.piec = "five"; + x.szesc = "six"; + + a.deep( + t(x), + { + raz: "one", + dwa: "two!", + trzy: "three!", + cztery: "four", + piec: "five", + szesc: "six", + get: "two!" + }, + "Deep object" + ); + + a.deep( + t({ marko: "raz", raz: "foo" }, x, { szesc: "elo", siedem: "bibg" }), + { + marko: "raz", + raz: "one", + dwa: "two!", + trzy: "three!", + cztery: "four", + piec: "five", + szesc: "elo", + siedem: "bibg", + get: "two!" + }, + "Multiple options" + ); +}; diff --git a/node_modules/es5-ext/test/object/primitive-set.js b/node_modules/es5-ext/test/object/primitive-set.js new file mode 100644 index 0000000..a0500ff --- /dev/null +++ b/node_modules/es5-ext/test/object/primitive-set.js @@ -0,0 +1,14 @@ +"use strict"; + +var getPropertyNames = require("../../object/get-property-names") + , isPlainObject = require("../../object/is-plain-object"); + +module.exports = function (t, a) { + var x = t(); + a(isPlainObject(x), true, "Plain object"); + a.deep(getPropertyNames(x), [], "No properties"); + x.foo = "bar"; + a.deep(getPropertyNames(x), ["foo"], "Extensible"); + + a.deep(t("raz", "dwa", 3), { raz: true, dwa: true, 3: true }, "Arguments handling"); +}; diff --git a/node_modules/es5-ext/test/object/safe-traverse.js b/node_modules/es5-ext/test/object/safe-traverse.js new file mode 100644 index 0000000..acf49c0 --- /dev/null +++ b/node_modules/es5-ext/test/object/safe-traverse.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function (t, a) { + var obj = { foo: { bar: { lorem: 12 } } }; + a(t(obj), obj, "No props"); + a(t(obj, "foo"), obj.foo, "One"); + a(t(obj, "raz"), undefined, "One: Fail"); + a(t(obj, "foo", "bar"), obj.foo.bar, "Two"); + a(t(obj, "dsd", "raz"), undefined, "Two: Fail #1"); + a(t(obj, "foo", "raz"), undefined, "Two: Fail #2"); + a(t(obj, "foo", "bar", "lorem"), obj.foo.bar.lorem, "Three"); + a(t(obj, "dsd", "raz", "fef"), undefined, "Three: Fail #1"); + a(t(obj, "foo", "raz", "asdf"), undefined, "Three: Fail #2"); + a(t(obj, "foo", "bar", "asd"), undefined, "Three: Fail #3"); +}; diff --git a/node_modules/es5-ext/test/object/serialize.js b/node_modules/es5-ext/test/object/serialize.js new file mode 100644 index 0000000..513cd61 --- /dev/null +++ b/node_modules/es5-ext/test/object/serialize.js @@ -0,0 +1,43 @@ +"use strict"; + +module.exports = function (t, a) { + var fn = function (raz, dwa) { return raz + dwa; }; + a(t(), "undefined", "Undefined"); + a(t(null), "null", "Null"); + a(t(null), "null", "Null"); + a(t("raz"), "\"raz\"", "String"); + a(t("raz\"ddwa\ntrzy"), "\"raz\\\"ddwa\\ntrzy\"", "String with escape"); + a(t(false), "false", "Booelean"); + a(t(fn), String(fn), "Function"); + + a(t(/raz-dwa/g), "/raz-dwa/g", "RegExp"); + a(t(new Date(1234567)), "new Date(1234567)", "Date"); + a(t([]), "[]", "Empty array"); + a( + t([undefined, false, null, "raz\"ddwa\ntrzy", fn, /raz/g, new Date(1234567), ["foo"]]), + "[undefined,false,null,\"raz\\\"ddwa\\ntrzy\"," + + String(fn) + + ",/raz/g,new Date(1234567),[\"foo\"]]", + "Rich Array" + ); + a(t({}), "{}", "Empty object"); + a( + t({ + raz: undefined, + dwa: false, + trzy: null, + cztery: "raz\"ddwa\ntrzy", + piec: fn, + szesc: /raz/g, + siedem: new Date(1234567), + osiem: ["foo", 32], + dziewiec: { foo: "bar", dwa: 343 } + }), + "{\"raz\":undefined,\"dwa\":false,\"trzy\":null,\"cztery\":\"raz\\\"ddwa\\ntrzy\"," + + "\"piec\":" + + String(fn) + + ",\"szesc\":/raz/g,\"siedem\":new Date(1234567),\"osiem\":[\"foo\",32]," + + "\"dziewiec\":{\"foo\":\"bar\",\"dwa\":343}}", + "Rich object" + ); +}; diff --git a/node_modules/es5-ext/test/object/set-prototype-of/implement.js b/node_modules/es5-ext/test/object/set-prototype-of/implement.js new file mode 100644 index 0000000..3dde326 --- /dev/null +++ b/node_modules/es5-ext/test/object/set-prototype-of/implement.js @@ -0,0 +1,6 @@ +"use strict"; + +var create = require("../../../object/create") + , isImplemented = require("../../../object/set-prototype-of/is-implemented"); + +module.exports = function (a) { a(isImplemented(create), true); }; diff --git a/node_modules/es5-ext/test/object/set-prototype-of/index.js b/node_modules/es5-ext/test/object/set-prototype-of/index.js new file mode 100644 index 0000000..1abc7f9 --- /dev/null +++ b/node_modules/es5-ext/test/object/set-prototype-of/index.js @@ -0,0 +1,22 @@ +"use strict"; + +var create = require("../../../object/create") + , getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (t, a) { + var x = {}, y = {}; + + if (t === null) return; + a(t(x, y), x, "Return self object"); + a(getPrototypeOf(x), y, "Object"); + a.throws(function () { t(x); }, TypeError, "Undefined"); + a.throws(function () { t("foo"); }, TypeError, "Primitive"); + a(getPrototypeOf(t(x, null)), t.nullPolyfill || null, "Null"); + x = create(null); + a.h1("Change null prototype"); + a(t(x, y), x, "Result"); + a(getPrototypeOf(x), y, "Prototype"); + a.h1("Set null prototype"); + a(t(y, null), y, "Result"); + a(getPrototypeOf(y), t.nullPolyfill || null, "Prototype"); +}; diff --git a/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js b/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/object/set-prototype-of/shim.js b/node_modules/es5-ext/test/object/set-prototype-of/shim.js new file mode 100644 index 0000000..1abc7f9 --- /dev/null +++ b/node_modules/es5-ext/test/object/set-prototype-of/shim.js @@ -0,0 +1,22 @@ +"use strict"; + +var create = require("../../../object/create") + , getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (t, a) { + var x = {}, y = {}; + + if (t === null) return; + a(t(x, y), x, "Return self object"); + a(getPrototypeOf(x), y, "Object"); + a.throws(function () { t(x); }, TypeError, "Undefined"); + a.throws(function () { t("foo"); }, TypeError, "Primitive"); + a(getPrototypeOf(t(x, null)), t.nullPolyfill || null, "Null"); + x = create(null); + a.h1("Change null prototype"); + a(t(x, y), x, "Result"); + a(getPrototypeOf(x), y, "Prototype"); + a.h1("Set null prototype"); + a(t(y, null), y, "Result"); + a(getPrototypeOf(y), t.nullPolyfill || null, "Prototype"); +}; diff --git a/node_modules/es5-ext/test/object/some.js b/node_modules/es5-ext/test/object/some.js new file mode 100644 index 0000000..4c6569f --- /dev/null +++ b/node_modules/es5-ext/test/object/some.js @@ -0,0 +1,24 @@ +"use strict"; + +var o = { 1: 1, 2: 2, 3: 3 }; + +module.exports = function (t, a) { + var o2 = {}, i = 0; + t(o, function (value, name) { + o2[name] = value; + return false; + }); + a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); + + a( + t(o, function () { + ++i; + return true; + }), + true, + "Succeeds" + ); + a(i, 1, "Stops iteration after condition is met"); + + a(t(o, function () { return false; }), false, "Fails"); +}; diff --git a/node_modules/es5-ext/test/object/to-array.js b/node_modules/es5-ext/test/object/to-array.js new file mode 100644 index 0000000..478e0d8 --- /dev/null +++ b/node_modules/es5-ext/test/object/to-array.js @@ -0,0 +1,18 @@ +"use strict"; + +module.exports = function (t, a) { + var o = { 1: 1, 2: 2, 3: 3 } + , o1 = {} + , o2 = t( + o, + function (value, name, self) { + a(self, o, "Self"); + a(this, o1, "Scope"); + return value + Number(name); + }, + o1 + ); + a.deep(o2, [2, 4, 6]); + + t(o).sort().forEach(function (item) { a.deep(item, [item[0], o[item[0]]], "Default"); }); +}; diff --git a/node_modules/es5-ext/test/object/unserialize.js b/node_modules/es5-ext/test/object/unserialize.js new file mode 100644 index 0000000..b25fe2e --- /dev/null +++ b/node_modules/es5-ext/test/object/unserialize.js @@ -0,0 +1,39 @@ +"use strict"; + +module.exports = function (t, a) { + var fn = function (raz, dwa) { return raz + dwa; }; + a(t("undefined"), undefined, "Undefined"); + a(t("null"), null, "Null"); + a(t("\"raz\""), "raz", "String"); + a(t("\"raz\\\"ddwa\\ntrzy\""), "raz\"ddwa\ntrzy", "String with escape"); + a(t("false"), false, "Booelean"); + a(String(t(String(fn))), String(fn), "Function"); + + a.deep(t("/raz-dwa/g"), /raz-dwa/g, "RegExp"); + a.deep(t("new Date(1234567)"), new Date(1234567), "Date"); + a.deep(t("[]"), [], "Empty array"); + a.deep( + t("[undefined,false,null,\"raz\\\"ddwa\\ntrzy\",/raz/g,new Date(1234567),[\"foo\"]]"), + [undefined, false, null, "raz\"ddwa\ntrzy", /raz/g, new Date(1234567), ["foo"]], + "Rich Array" + ); + a.deep(t("{}"), {}, "Empty object"); + a.deep( + t( + "{\"raz\":undefined,\"dwa\":false,\"trzy\":null,\"cztery\":\"raz\\\"ddwa\\ntrzy\"," + + "\"szesc\":/raz/g,\"siedem\":new Date(1234567),\"osiem\":[\"foo\",32]," + + "\"dziewiec\":{\"foo\":\"bar\",\"dwa\":343}}" + ), + { + raz: undefined, + dwa: false, + trzy: null, + cztery: "raz\"ddwa\ntrzy", + szesc: /raz/g, + siedem: new Date(1234567), + osiem: ["foo", 32], + dziewiec: { foo: "bar", dwa: 343 } + }, + "Rich object" + ); +}; diff --git a/node_modules/es5-ext/test/object/valid-callable.js b/node_modules/es5-ext/test/object/valid-callable.js new file mode 100644 index 0000000..699e9f3 --- /dev/null +++ b/node_modules/es5-ext/test/object/valid-callable.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + var f = function () {}; + a(t(f), f, "Function"); + a.throws(function () { t({}); }, "Not Function"); +}; diff --git a/node_modules/es5-ext/test/object/valid-object.js b/node_modules/es5-ext/test/object/valid-object.js new file mode 100644 index 0000000..2fc2a3d --- /dev/null +++ b/node_modules/es5-ext/test/object/valid-object.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a.throws(function () { t(0); }, TypeError, "0"); + a.throws(function () { t(false); }, TypeError, "false"); + a.throws(function () { t(""); }, TypeError, "''"); + a(t((x = {})), x, "Object"); + a(t((x = function () {})), x, "Function"); + a(t((x = new String("raz"))), x, "String object"); // Jslint: ignore + a(t((x = new Date())), x, "Date"); + + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "null"); +}; diff --git a/node_modules/es5-ext/test/object/valid-value.js b/node_modules/es5-ext/test/object/valid-value.js new file mode 100644 index 0000000..ef11c20 --- /dev/null +++ b/node_modules/es5-ext/test/object/valid-value.js @@ -0,0 +1,15 @@ +"use strict"; + +var numIsNaN = require("../../number/is-nan"); + +module.exports = function (t, a) { + var x; + a(t(0), 0, "0"); + a(t(false), false, "false"); + a(t(""), "", "''"); + a(numIsNaN(t(NaN)), true, "NaN"); + a(t((x = {})), x, "{}"); + + a.throws(function () { t(); }, "Undefined"); + a.throws(function () { t(null); }, "null"); +}; diff --git a/node_modules/es5-ext/test/object/validate-array-like-object.js b/node_modules/es5-ext/test/object/validate-array-like-object.js new file mode 100644 index 0000000..375483d --- /dev/null +++ b/node_modules/es5-ext/test/object/validate-array-like-object.js @@ -0,0 +1,21 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a.throws(function () { t(0); }, TypeError, "0"); + a.throws(function () { t(false); }, TypeError, "false"); + a.throws(function () { t(""); }, TypeError, "String"); + a.throws(function () { t({}); }, TypeError, "Plain Object"); + a.throws( + function () { + t(function () {}); + }, + TypeError, + "Function" + ); + a(t((x = new String("raz"))), x, "String object"); // Jslint: ignore + + a(t((x = { length: 1 })), x, "Array like"); + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "null"); +}; diff --git a/node_modules/es5-ext/test/object/validate-array-like.js b/node_modules/es5-ext/test/object/validate-array-like.js new file mode 100644 index 0000000..6592615 --- /dev/null +++ b/node_modules/es5-ext/test/object/validate-array-like.js @@ -0,0 +1,21 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a.throws(function () { t(0); }, TypeError, "0"); + a.throws(function () { t(false); }, TypeError, "false"); + a(t(""), "", "''"); + a.throws(function () { t({}); }, TypeError, "Plain Object"); + a.throws( + function () { + t(function () {}); + }, + TypeError, + "Function" + ); + a(t((x = new String("raz"))), x, "String object"); // Jslint: ignore + + a(t((x = { length: 1 })), x, "Array like"); + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "null"); +}; diff --git a/node_modules/es5-ext/test/object/validate-stringifiable-value.js b/node_modules/es5-ext/test/object/validate-stringifiable-value.js new file mode 100644 index 0000000..5e09bcd --- /dev/null +++ b/node_modules/es5-ext/test/object/validate-stringifiable-value.js @@ -0,0 +1,16 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a(t(0), "0"); + a(t(false), "false"); + a(t(""), ""); + a(t({}), String({}), "Object"); + a(t((x = function () {})), String(x), "Function"); + a(t((x = new String("raz"))), String(x), "String object"); // Jslint: ignore + a(t((x = new Date())), String(x), "Date"); + + a.throws(function () { t(Object.create(null)); }, TypeError, "Null prototype object"); +}; diff --git a/node_modules/es5-ext/test/object/validate-stringifiable.js b/node_modules/es5-ext/test/object/validate-stringifiable.js new file mode 100644 index 0000000..80bb60e --- /dev/null +++ b/node_modules/es5-ext/test/object/validate-stringifiable.js @@ -0,0 +1,16 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a(t(), "undefined", "Undefined"); + a(t(null), "null", "Null"); + a(t(0), "0"); + a(t(false), "false"); + a(t(""), ""); + a(t({}), String({}), "Object"); + a(t((x = function () {})), String(x), "Function"); + a(t((x = new String("raz"))), String(x), "String object"); // Jslint: ignore + a(t((x = new Date())), String(x), "Date"); + + a.throws(function () { t(Object.create(null)); }, TypeError, "Null prototype object"); +}; diff --git a/node_modules/es5-ext/test/optional-chaining.js b/node_modules/es5-ext/test/optional-chaining.js new file mode 100644 index 0000000..1f7d405 --- /dev/null +++ b/node_modules/es5-ext/test/optional-chaining.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = function (t, a) { + var obj = { foo: { bar: "elo", par: null } }; + a(t(), undefined); + a(t(null), null); + a(t(obj), obj); + a(t(obj, "foo"), obj.foo); + a(t(obj, "foo", "bar"), "elo"); + a(t(obj, "foo", "bar", "slice"), String.prototype.slice); + a(t(obj, "foo", "par"), null); + a(t(obj, "foo", "par", "marko"), undefined); + a(t(obj, "marko"), undefined); + a(t(""), ""); + a(t("", "foo"), undefined); + a(t("", "slice"), String.prototype.slice); +}; diff --git a/node_modules/es5-ext/test/promise/#/as-callback.js b/node_modules/es5-ext/test/promise/#/as-callback.js new file mode 100644 index 0000000..3d9cc0b --- /dev/null +++ b/node_modules/es5-ext/test/promise/#/as-callback.js @@ -0,0 +1,25 @@ +"use strict"; + +module.exports = function (t, a) { + if (typeof Promise !== "function") return null; + return { + Success: function (d) { + t.call(new Promise(function (resolve) { resolve("foo"); }), function (error, value) { + a(error, null); + a(value, "foo"); + d(); + }); + }, + Failure: function (d) { + var error = new Error("Rejection"); + t.call(new Promise(function (resolve, reject) { reject(error); }), function ( + passedError, + value + ) { + a(passedError, error); + a(value, undefined); + d(); + }); + } + }; +}; diff --git a/node_modules/es5-ext/test/promise/#/finally/implement.js b/node_modules/es5-ext/test/promise/#/finally/implement.js new file mode 100644 index 0000000..9440186 --- /dev/null +++ b/node_modules/es5-ext/test/promise/#/finally/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../promise/#/finally/is-implemented"); + +if (typeof Promise !== "function") global.Promise = require("plain-promise"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/promise/#/finally/index.js b/node_modules/es5-ext/test/promise/#/finally/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/promise/#/finally/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/promise/#/finally/is-implemented.js b/node_modules/es5-ext/test/promise/#/finally/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/promise/#/finally/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/promise/#/finally/shim.js b/node_modules/es5-ext/test/promise/#/finally/shim.js new file mode 100644 index 0000000..a92fab8 --- /dev/null +++ b/node_modules/es5-ext/test/promise/#/finally/shim.js @@ -0,0 +1,75 @@ +"use strict"; + +var microtaskDelay = require("../../../../function/#/microtask-delay"); + +if (typeof Promise !== "function") global.Promise = require("plain-promise"); + +module.exports = function (t, a) { + return { + Success: function (d) { + var invoked; + t.call(Promise.resolve("foo"), function () { + invoked = true; + return "bar"; + }).then( + microtaskDelay.call(function (result) { + a(result, "foo"); + a(invoked, true); + d(); + }, microtaskDelay.call(d)) + ); + }, + Failure: function (d) { + var invoked; + var error = new Error("Some error"); + t.call(Promise.reject(error), function () { + invoked = true; + return "bar"; + }).then( + microtaskDelay.call(function () { + a.never(); + d(); + }), + microtaskDelay.call(function (result) { + a(result, error); + a(invoked, true); + d(); + }) + ); + }, + SuccessFinallyError: function (d) { + var invoked, finallyError = new Error("Finally error"); + t.call(Promise.resolve("foo"), function () { + invoked = true; + throw finallyError; + }).then( + microtaskDelay.call(function () { + a.never(); + d(); + }), + microtaskDelay.call(function (result) { + a(result, finallyError); + a(invoked, true); + d(); + }) + ); + }, + FailureFinallyError: function (d) { + var invoked, finallyError = new Error("Finally error"); + t.call(Promise.reject(new Error("Some error")), function () { + invoked = true; + throw finallyError; + }).then( + microtaskDelay.call(function () { + a.never(); + d(); + }), + microtaskDelay.call(function (result) { + a(result, finallyError); + a(invoked, true); + d(); + }) + ); + } + }; +}; diff --git a/node_modules/es5-ext/test/promise/.eslintrc.json b/node_modules/es5-ext/test/promise/.eslintrc.json new file mode 100644 index 0000000..d2383fa --- /dev/null +++ b/node_modules/es5-ext/test/promise/.eslintrc.json @@ -0,0 +1 @@ +{ "globals": { "Promise": true, "setTimeout": true } } diff --git a/node_modules/es5-ext/test/promise/lazy.js b/node_modules/es5-ext/test/promise/lazy.js new file mode 100644 index 0000000..f3109e8 --- /dev/null +++ b/node_modules/es5-ext/test/promise/lazy.js @@ -0,0 +1,46 @@ +"use strict"; + +module.exports = function (t) { + if (typeof Promise !== "function") return null; // Run tests only in ES2015+ env + + return { + "Delays execution": function (a, d) { + var invoked = false; + var promise = t(function (resolve) { + invoked = true; + setTimeout(function () { resolve(20); }, 10); + }); + + a(invoked, false); + + setTimeout(function () { + a(invoked, false); + promise.then(function (value) { + a(value, 20); + setTimeout(d, 0); // Escape error swallowing + }); + a(invoked, true); + }, 15); + }, + "Passes rejection": function (a, d) { + var promise = t(function (resolve, reject) { + setTimeout(function () { reject(new Error("Stop")); }, 10); + }); + + promise.catch(function (error) { + a(error instanceof Error, true); + a(error.message, "Stop"); + setTimeout(d, 0); // Escape error swallowing + }); + }, + "Passes sync exception": function (a, d) { + var promise = t(function () { throw new Error("Stop"); }); + + promise.catch(function (error) { + a(error instanceof Error, true); + a(error.message, "Stop"); + setTimeout(d, 0); // Escape error swallowing + }); + } + }; +}; diff --git a/node_modules/es5-ext/test/reg-exp/#/index.js b/node_modules/es5-ext/test/reg-exp/#/index.js new file mode 100644 index 0000000..7ab9ab8 --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/index.js @@ -0,0 +1,15 @@ +/* eslint-env node */ + +"use strict"; + +var indexTest = require("tad/lib/utils/index-test") + , path = require("path").resolve(__dirname, "../../../reg-exp/#"); + +module.exports = function (t, a, d) { + indexTest( + indexTest.readDir(path).aside(function (data) { + delete data.sticky; + delete data.unicode; + }) + )(t, a, d); +}; diff --git a/node_modules/es5-ext/test/reg-exp/#/is-sticky.js b/node_modules/es5-ext/test/reg-exp/#/is-sticky.js new file mode 100644 index 0000000..e65740e --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/is-sticky.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + var re; + a(t.call(/raz/), false, "Normal"); + a(t.call(/raz/g), false, "Global"); + try { + // eslint-disable-next-line no-invalid-regexp + re = new RegExp("raz", "y"); + } catch (ignore) {} + if (!re) return; + a(t.call(re), true, "Sticky"); +}; diff --git a/node_modules/es5-ext/test/reg-exp/#/is-unicode.js b/node_modules/es5-ext/test/reg-exp/#/is-unicode.js new file mode 100644 index 0000000..86217aa --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/is-unicode.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + var re; + a(t.call(/raz/), false, "Normal"); + a(t.call(/raz/g), false, "Global"); + try { + // eslint-disable-next-line no-invalid-regexp + re = new RegExp("raz", "u"); + } catch (ignore) {} + if (!re) return; + a(t.call(re), true, "Unicode"); +}; diff --git a/node_modules/es5-ext/test/reg-exp/#/match/implement.js b/node_modules/es5-ext/test/reg-exp/#/match/implement.js new file mode 100644 index 0000000..e4da478 --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/match/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../reg-exp/#/match/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/reg-exp/#/match/index.js b/node_modules/es5-ext/test/reg-exp/#/match/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/match/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js b/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/reg-exp/#/match/shim.js b/node_modules/es5-ext/test/reg-exp/#/match/shim.js new file mode 100644 index 0000000..c6fedb5 --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/match/shim.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + var result = "foobar".match(/foo/); + a.deep(t.call(/foo/, "foobar"), result); +}; diff --git a/node_modules/es5-ext/test/reg-exp/#/replace/implement.js b/node_modules/es5-ext/test/reg-exp/#/replace/implement.js new file mode 100644 index 0000000..389cec9 --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/replace/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../reg-exp/#/replace/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/reg-exp/#/replace/index.js b/node_modules/es5-ext/test/reg-exp/#/replace/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/replace/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js b/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/reg-exp/#/replace/shim.js b/node_modules/es5-ext/test/reg-exp/#/replace/shim.js new file mode 100644 index 0000000..5c37e2e --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/replace/shim.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(t.call(/foo/, "foobar", "mar"), "marbar"); }; diff --git a/node_modules/es5-ext/test/reg-exp/#/search/implement.js b/node_modules/es5-ext/test/reg-exp/#/search/implement.js new file mode 100644 index 0000000..1e7cb39 --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/search/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../reg-exp/#/search/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/reg-exp/#/search/index.js b/node_modules/es5-ext/test/reg-exp/#/search/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/search/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js b/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/reg-exp/#/search/shim.js b/node_modules/es5-ext/test/reg-exp/#/search/shim.js new file mode 100644 index 0000000..02ca0c8 --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/search/shim.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(t.call(/foo/, "barfoo"), 3); }; diff --git a/node_modules/es5-ext/test/reg-exp/#/split/implement.js b/node_modules/es5-ext/test/reg-exp/#/split/implement.js new file mode 100644 index 0000000..ef8ec4e --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/split/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../reg-exp/#/split/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/reg-exp/#/split/index.js b/node_modules/es5-ext/test/reg-exp/#/split/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/split/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js b/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/reg-exp/#/split/shim.js b/node_modules/es5-ext/test/reg-exp/#/split/shim.js new file mode 100644 index 0000000..824d48e --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/split/shim.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a.deep(t.call(/\|/, "bar|foo"), ["bar", "foo"]); }; diff --git a/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js b/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js new file mode 100644 index 0000000..6d3ccb7 --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../reg-exp/#/sticky/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js b/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js b/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js new file mode 100644 index 0000000..00cf882 --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../reg-exp/#/unicode/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js b/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/reg-exp/escape.js b/node_modules/es5-ext/test/reg-exp/escape.js new file mode 100644 index 0000000..9478f52 --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/escape.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + var str = "(?:^te|er)s{2}t\\[raz]+$"; + a(RegExp("^" + t(str) + "$").test(str), true); +}; diff --git a/node_modules/es5-ext/test/reg-exp/is-reg-exp.js b/node_modules/es5-ext/test/reg-exp/is-reg-exp.js new file mode 100644 index 0000000..7727eab --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/is-reg-exp.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t("arar"), false, "String"); + a(t(12), false, "Number"); + a(t(true), false, "Boolean"); + a(t(new Date()), false, "Date"); + a(t(new String("raz")), false, "String object"); + a(t({}), false, "Plain object"); + a(t(/a/), true, "Regular expression"); + a(t(new RegExp("a")), true, "Regular expression via constructor"); +}; diff --git a/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js b/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js new file mode 100644 index 0000000..fea0c94 --- /dev/null +++ b/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function (t, a) { + var r = /raz/; + a(t(r), r, "Direct"); + r = new RegExp("foo"); + a(t(r), r, "Constructor"); + a.throws(function () { t({}); }, "Object"); + a.throws(function () { + t(function () {}); + }, "Function"); + a.throws(function () { + t({ exec: function () { return 20; } }); + }, "Plain object"); +}; diff --git a/node_modules/es5-ext/test/safe-to-string.js b/node_modules/es5-ext/test/safe-to-string.js new file mode 100644 index 0000000..8f545e5 --- /dev/null +++ b/node_modules/es5-ext/test/safe-to-string.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(), "undefined"); + a(t(null), "null"); + a(t(10), "10"); + a(t("str"), "str"); + a(t({ toString: function () { return "miszka"; } }), "miszka"); + // eslint-disable-next-line symbol-description + if (typeof Symbol === "function") a(t(Symbol()), "Symbol()"); + a(t(Object.create(null)), ""); +}; diff --git a/node_modules/es5-ext/test/string/#/@@iterator/implement.js b/node_modules/es5-ext/test/string/#/@@iterator/implement.js new file mode 100644 index 0000000..8b269b5 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/@@iterator/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../string/#/@@iterator/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/string/#/@@iterator/index.js b/node_modules/es5-ext/test/string/#/@@iterator/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/@@iterator/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js b/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/string/#/@@iterator/shim.js b/node_modules/es5-ext/test/string/#/@@iterator/shim.js new file mode 100644 index 0000000..467cdc3 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/@@iterator/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + var it = t.call("r💩z"); + a.deep(it.next(), { done: false, value: "r" }, "#1"); + a.deep(it.next(), { done: false, value: "💩" }, "#2"); + a.deep(it.next(), { done: false, value: "z" }, "#3"); + a.deep(it.next(), { done: true, value: undefined }, "End"); +}; diff --git a/node_modules/es5-ext/test/string/#/at.js b/node_modules/es5-ext/test/string/#/at.js new file mode 100644 index 0000000..2fe6e84 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/at.js @@ -0,0 +1,97 @@ +/* eslint no-useless-call: "off" */ +// See tests at https://github.com/mathiasbynens/String.prototype.at + +"use strict"; + +module.exports = function (t, a) { + a(t.length, 1, "Length"); + + a.h1("BMP"); + a(t.call("abc\uD834\uDF06def", -Infinity), "", "-Infinity"); + a(t.call("abc\uD834\uDF06def", -1), "", "-1"); + a(t.call("abc\uD834\uDF06def", -0), "a", "-0"); + a(t.call("abc\uD834\uDF06def", +0), "a", "+0"); + a(t.call("abc\uD834\uDF06def", 1), "b", "1"); + a(t.call("abc\uD834\uDF06def", 3), "\uD834\uDF06", "3"); + a(t.call("abc\uD834\uDF06def", 4), "\uDF06", "4"); + a(t.call("abc\uD834\uDF06def", 5), "d", "5"); + a(t.call("abc\uD834\uDF06def", 42), "", "42"); + a(t.call("abc\uD834\uDF06def", Number(Infinity)), "", "+Infinity"); + a(t.call("abc\uD834\uDF06def", null), "a", "null"); + a(t.call("abc\uD834\uDF06def", undefined), "a", "undefined"); + a(t.call("abc\uD834\uDF06def"), "a", "No argument"); + a(t.call("abc\uD834\uDF06def", false), "a", "false"); + a(t.call("abc\uD834\uDF06def", NaN), "a", "NaN"); + a(t.call("abc\uD834\uDF06def", ""), "a", "Empty string"); + a(t.call("abc\uD834\uDF06def", "_"), "a", "_"); + a(t.call("abc\uD834\uDF06def", "1"), "b", "'1'"); + a(t.call("abc\uD834\uDF06def", []), "a", "[]"); + a(t.call("abc\uD834\uDF06def", {}), "a", "{}"); + a(t.call("abc\uD834\uDF06def", -0.9), "a", "-0.9"); + a(t.call("abc\uD834\uDF06def", 1.9), "b", "1.9"); + a(t.call("abc\uD834\uDF06def", 7.9), "f", "7.9"); + a(t.call("abc\uD834\uDF06def", Math.pow(2, 32)), "", "Big number"); + + a.h1("Astral symbol"); + a(t.call("\uD834\uDF06def", -Infinity), "", "-Infinity"); + a(t.call("\uD834\uDF06def", -1), "", "-1"); + a(t.call("\uD834\uDF06def", -0), "\uD834\uDF06", "-0"); + a(t.call("\uD834\uDF06def", +0), "\uD834\uDF06", "+0"); + a(t.call("\uD834\uDF06def", 1), "\uDF06", "1"); + a(t.call("\uD834\uDF06def", 2), "d", "2"); + a(t.call("\uD834\uDF06def", 3), "e", "3"); + a(t.call("\uD834\uDF06def", 4), "f", "4"); + a(t.call("\uD834\uDF06def", 42), "", "42"); + a(t.call("\uD834\uDF06def", Number(Infinity)), "", "+Infinity"); + a(t.call("\uD834\uDF06def", null), "\uD834\uDF06", "null"); + a(t.call("\uD834\uDF06def", undefined), "\uD834\uDF06", "undefined"); + a(t.call("\uD834\uDF06def"), "\uD834\uDF06", "No arguments"); + a(t.call("\uD834\uDF06def", false), "\uD834\uDF06", "false"); + a(t.call("\uD834\uDF06def", NaN), "\uD834\uDF06", "NaN"); + a(t.call("\uD834\uDF06def", ""), "\uD834\uDF06", "Empty string"); + a(t.call("\uD834\uDF06def", "_"), "\uD834\uDF06", "_"); + a(t.call("\uD834\uDF06def", "1"), "\uDF06", "'1'"); + + a.h1("Lone high surrogates"); + a(t.call("\uD834abc", -Infinity), "", "-Infinity"); + a(t.call("\uD834abc", -1), "", "-1"); + a(t.call("\uD834abc", -0), "\uD834", "-0"); + a(t.call("\uD834abc", +0), "\uD834", "+0"); + a(t.call("\uD834abc", 1), "a", "1"); + a(t.call("\uD834abc", 42), "", "42"); + a(t.call("\uD834abc", Number(Infinity)), "", "Infinity"); + a(t.call("\uD834abc", null), "\uD834", "null"); + a(t.call("\uD834abc", undefined), "\uD834", "undefined"); + a(t.call("\uD834abc"), "\uD834", "No arguments"); + a(t.call("\uD834abc", false), "\uD834", "false"); + a(t.call("\uD834abc", NaN), "\uD834", "NaN"); + a(t.call("\uD834abc", ""), "\uD834", "Empty string"); + a(t.call("\uD834abc", "_"), "\uD834", "_"); + a(t.call("\uD834abc", "1"), "a", "'a'"); + + a.h1("Lone low surrogates"); + a(t.call("\uDF06abc", -Infinity), "", "-Infinity"); + a(t.call("\uDF06abc", -1), "", "-1"); + a(t.call("\uDF06abc", -0), "\uDF06", "-0"); + a(t.call("\uDF06abc", +0), "\uDF06", "+0"); + a(t.call("\uDF06abc", 1), "a", "1"); + a(t.call("\uDF06abc", 42), "", "42"); + a(t.call("\uDF06abc", Number(Infinity)), "", "+Infinity"); + a(t.call("\uDF06abc", null), "\uDF06", "null"); + a(t.call("\uDF06abc", undefined), "\uDF06", "undefined"); + a(t.call("\uDF06abc"), "\uDF06", "No arguments"); + a(t.call("\uDF06abc", false), "\uDF06", "false"); + a(t.call("\uDF06abc", NaN), "\uDF06", "NaN"); + a(t.call("\uDF06abc", ""), "\uDF06", "Empty string"); + a(t.call("\uDF06abc", "_"), "\uDF06", "_"); + a(t.call("\uDF06abc", "1"), "a", "'1'"); + + a.h1("Context"); + a.throws(function () { t.call(undefined); }, TypeError, "Undefined"); + a.throws(function () { t.call(undefined, 4); }, TypeError, "Undefined + argument"); + a.throws(function () { t.call(null); }, TypeError, "Null"); + a.throws(function () { t.call(null, 4); }, TypeError, "Null + argument"); + a(t.call(42, 0), "4", "Number #1"); + a(t.call(42, 1), "2", "Number #2"); + a(t.call({ toString: function () { return "abc"; } }, 2), "c", "Object"); +}; diff --git a/node_modules/es5-ext/test/string/#/camel-to-hyphen.js b/node_modules/es5-ext/test/string/#/camel-to-hyphen.js new file mode 100644 index 0000000..bbf9ae4 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/camel-to-hyphen.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("razDwaTRzy4yFoo45My"), "raz-dwa-t-rzy4y-foo45-my"); + a(t.call("razDwaTRzy4yFoo45My-"), "raz-dwa-t-rzy4y-foo45-my-"); + a(t.call("razDwaTRzy4yFoo45My--"), "raz-dwa-t-rzy4y-foo45-my--"); +}; diff --git a/node_modules/es5-ext/test/string/#/capitalize.js b/node_modules/es5-ext/test/string/#/capitalize.js new file mode 100644 index 0000000..884ae9c --- /dev/null +++ b/node_modules/es5-ext/test/string/#/capitalize.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("raz"), "Raz", "Word"); + a(t.call("BLA"), "BLA", "Uppercase"); + a(t.call(""), "", "Empty"); + a(t.call("a"), "A", "One letter"); + a(t.call("this is a test"), "This is a test", "Sentence"); +}; diff --git a/node_modules/es5-ext/test/string/#/case-insensitive-compare.js b/node_modules/es5-ext/test/string/#/case-insensitive-compare.js new file mode 100644 index 0000000..8117f92 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/case-insensitive-compare.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("AA", "aa"), 0, "Same"); + a.ok(t.call("Amber", "zebra") < 0, "Less"); + a.ok(t.call("Zebra", "amber") > 0, "Greater"); +}; diff --git a/node_modules/es5-ext/test/string/#/code-point-at/implement.js b/node_modules/es5-ext/test/string/#/code-point-at/implement.js new file mode 100644 index 0000000..9ce21f5 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/code-point-at/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../string/#/code-point-at/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/string/#/code-point-at/index.js b/node_modules/es5-ext/test/string/#/code-point-at/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/code-point-at/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js b/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/string/#/code-point-at/shim.js b/node_modules/es5-ext/test/string/#/code-point-at/shim.js new file mode 100644 index 0000000..a09e75c --- /dev/null +++ b/node_modules/es5-ext/test/string/#/code-point-at/shim.js @@ -0,0 +1,83 @@ +/* eslint no-useless-call: "off" */ + +// Taken from: https://github.com/mathiasbynens/String.prototype.codePointAt +// /blob/master/tests/tests.js + +"use strict"; + +module.exports = function (t, a) { + a(t.length, 1, "Length"); + + // String that starts with a BMP symbol + a(t.call("abc\uD834\uDF06def", ""), 0x61); + a(t.call("abc\uD834\uDF06def", "_"), 0x61); + a(t.call("abc\uD834\uDF06def"), 0x61); + a(t.call("abc\uD834\uDF06def", -Infinity), undefined); + a(t.call("abc\uD834\uDF06def", -1), undefined); + a(t.call("abc\uD834\uDF06def", -0), 0x61); + a(t.call("abc\uD834\uDF06def", 0), 0x61); + a(t.call("abc\uD834\uDF06def", 3), 0x1d306); + a(t.call("abc\uD834\uDF06def", 4), 0xdf06); + a(t.call("abc\uD834\uDF06def", 5), 0x64); + a(t.call("abc\uD834\uDF06def", 42), undefined); + a(t.call("abc\uD834\uDF06def", Infinity), undefined); + a(t.call("abc\uD834\uDF06def", Infinity), undefined); + a(t.call("abc\uD834\uDF06def", NaN), 0x61); + a(t.call("abc\uD834\uDF06def", false), 0x61); + a(t.call("abc\uD834\uDF06def", null), 0x61); + a(t.call("abc\uD834\uDF06def", undefined), 0x61); + + // String that starts with an astral symbol + a(t.call("\uD834\uDF06def", ""), 0x1d306); + a(t.call("\uD834\uDF06def", "1"), 0xdf06); + a(t.call("\uD834\uDF06def", "_"), 0x1d306); + a(t.call("\uD834\uDF06def"), 0x1d306); + a(t.call("\uD834\uDF06def", -1), undefined); + a(t.call("\uD834\uDF06def", -0), 0x1d306); + a(t.call("\uD834\uDF06def", 0), 0x1d306); + a(t.call("\uD834\uDF06def", 1), 0xdf06); + a(t.call("\uD834\uDF06def", 42), undefined); + a(t.call("\uD834\uDF06def", false), 0x1d306); + a(t.call("\uD834\uDF06def", null), 0x1d306); + a(t.call("\uD834\uDF06def", undefined), 0x1d306); + + // Lone high surrogates + a(t.call("\uD834abc", ""), 0xd834); + a(t.call("\uD834abc", "_"), 0xd834); + a(t.call("\uD834abc"), 0xd834); + a(t.call("\uD834abc", -1), undefined); + a(t.call("\uD834abc", -0), 0xd834); + a(t.call("\uD834abc", 0), 0xd834); + a(t.call("\uD834abc", false), 0xd834); + a(t.call("\uD834abc", NaN), 0xd834); + a(t.call("\uD834abc", null), 0xd834); + a(t.call("\uD834abc", undefined), 0xd834); + + // Lone low surrogates + a(t.call("\uDF06abc", ""), 0xdf06); + a(t.call("\uDF06abc", "_"), 0xdf06); + a(t.call("\uDF06abc"), 0xdf06); + a(t.call("\uDF06abc", -1), undefined); + a(t.call("\uDF06abc", -0), 0xdf06); + a(t.call("\uDF06abc", 0), 0xdf06); + a(t.call("\uDF06abc", false), 0xdf06); + a(t.call("\uDF06abc", NaN), 0xdf06); + a(t.call("\uDF06abc", null), 0xdf06); + a(t.call("\uDF06abc", undefined), 0xdf06); + + a.throws(function () { t.call(undefined); }, TypeError); + a.throws(function () { t.call(undefined, 4); }, TypeError); + a.throws(function () { t.call(null); }, TypeError); + a.throws(function () { t.call(null, 4); }, TypeError); + a(t.call(42, 0), 0x34); + a(t.call(42, 1), 0x32); + a(t.call({ toString: function () { return "abc"; } }, 2), 0x63); + + a.throws(function () { t.apply(undefined); }, TypeError); + a.throws(function () { t.apply(undefined, [4]); }, TypeError); + a.throws(function () { t.apply(null); }, TypeError); + a.throws(function () { t.apply(null, [4]); }, TypeError); + a(t.apply(42, [0]), 0x34); + a(t.apply(42, [1]), 0x32); + a(t.apply({ toString: function () { return "abc"; } }, [2]), 0x63); +}; diff --git a/node_modules/es5-ext/test/string/#/contains/implement.js b/node_modules/es5-ext/test/string/#/contains/implement.js new file mode 100644 index 0000000..7671495 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/contains/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../string/#/contains/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/string/#/contains/index.js b/node_modules/es5-ext/test/string/#/contains/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/contains/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/string/#/contains/is-implemented.js b/node_modules/es5-ext/test/string/#/contains/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/string/#/contains/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/string/#/contains/shim.js b/node_modules/es5-ext/test/string/#/contains/shim.js new file mode 100644 index 0000000..0a73671 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/contains/shim.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("raz", ""), true, "Empty"); + a(t.call("", ""), true, "Both Empty"); + a(t.call("raz", "raz"), true, "Same"); + a(t.call("razdwa", "raz"), true, "Starts with"); + a(t.call("razdwa", "dwa"), true, "Ends with"); + a(t.call("razdwa", "zdw"), true, "In middle"); + a(t.call("", "raz"), false, "Something in empty"); + a(t.call("az", "raz"), false, "Longer"); + a(t.call("azasdfasdf", "azff"), false, "Not found"); + a(t.call("razdwa", "raz", 1), false, "Position"); +}; diff --git a/node_modules/es5-ext/test/string/#/count.js b/node_modules/es5-ext/test/string/#/count.js new file mode 100644 index 0000000..5e871e1 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/count.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a.throws(function () { t.call("", ""); }); + a(t.call("x", "x"), 1); + a(t.call("xx", "x"), 2); + a(t.call("xxx", "xx"), 1); + a(t.call("xxxx", "xx"), 2); + a(t.call("xx", "xxx"), 0); + a(t.call("", "elo"), 0); + a(t.call("fooo", "foofooo"), 0); +}; diff --git a/node_modules/es5-ext/test/string/#/ends-with/implement.js b/node_modules/es5-ext/test/string/#/ends-with/implement.js new file mode 100644 index 0000000..acca2b2 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/ends-with/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../string/#/ends-with/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/string/#/ends-with/index.js b/node_modules/es5-ext/test/string/#/ends-with/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/ends-with/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js b/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/string/#/ends-with/shim.js b/node_modules/es5-ext/test/string/#/ends-with/shim.js new file mode 100644 index 0000000..7539883 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/ends-with/shim.js @@ -0,0 +1,16 @@ +// In some parts copied from: +// http://closure-library.googlecode.com/svn/trunk/closure/goog/ +// string/string_test.html + +"use strict"; + +module.exports = function (t, a) { + a(t.call("abc", ""), true, "Empty needle"); + a(t.call("abcd", "cd"), true, "Ends with needle"); + a(t.call("abcd", "abcd"), true, "Needle equals haystack"); + a(t.call("abcd", "ab"), false, "Doesn't end with needle"); + a(t.call("abc", "defg"), false, "Length trick"); + a(t.call("razdwa", "zd", 3), false, "Position: false"); + a(t.call("razdwa", "zd", 4), true, "Position: true"); + a(t.call("razdwa", "zd", 5), false, "Position: false #2"); +}; diff --git a/node_modules/es5-ext/test/string/#/hyphen-to-camel.js b/node_modules/es5-ext/test/string/#/hyphen-to-camel.js new file mode 100644 index 0000000..89c8161 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/hyphen-to-camel.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("raz-dwa-t-rzy-4y-rtr4-tiu-45-pa"), "razDwaTRzy4yRtr4Tiu45Pa"); + a(t.call("raz-dwa-t-rzy-4y-rtr4-tiu-45-pa-"), "razDwaTRzy4yRtr4Tiu45Pa-"); + a(t.call("raz-dwa-t-rzy-4y-rtr4-tiu-45-pa--"), "razDwaTRzy4yRtr4Tiu45Pa--"); +}; diff --git a/node_modules/es5-ext/test/string/#/indent.js b/node_modules/es5-ext/test/string/#/indent.js new file mode 100644 index 0000000..bc0e5b5 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/indent.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("ra\nzz", ""), "ra\nzz", "Empty"); + a(t.call("ra\nzz", "\t", 3), "\t\t\tra\n\t\t\tzz", "String repeat"); + a(t.call("ra\nzz\nsss\nfff\n", "\t"), "\tra\n\tzz\n\tsss\n\tfff\n", "Multi-line"); + a(t.call("ra\n\nzz\n", "\t"), "\tra\n\n\tzz\n", "Don't touch empty lines"); +}; diff --git a/node_modules/es5-ext/test/string/#/last.js b/node_modules/es5-ext/test/string/#/last.js new file mode 100644 index 0000000..fea798d --- /dev/null +++ b/node_modules/es5-ext/test/string/#/last.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(""), null, "Null"); + a(t.call("abcdef"), "f", "String"); +}; diff --git a/node_modules/es5-ext/test/string/#/normalize/_data.js b/node_modules/es5-ext/test/string/#/normalize/_data.js new file mode 100644 index 0000000..43d74de --- /dev/null +++ b/node_modules/es5-ext/test/string/#/normalize/_data.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t[0], "object"); }; diff --git a/node_modules/es5-ext/test/string/#/normalize/implement.js b/node_modules/es5-ext/test/string/#/normalize/implement.js new file mode 100644 index 0000000..49eebd1 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/normalize/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../string/#/normalize/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/string/#/normalize/index.js b/node_modules/es5-ext/test/string/#/normalize/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/normalize/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/string/#/normalize/is-implemented.js b/node_modules/es5-ext/test/string/#/normalize/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/string/#/normalize/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/string/#/normalize/shim.js b/node_modules/es5-ext/test/string/#/normalize/shim.js new file mode 100644 index 0000000..0c80aa4 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/normalize/shim.js @@ -0,0 +1,13 @@ +// Taken from: https://github.com/walling/unorm/blob/master/test/es6-shim.js + +"use strict"; + +var str = "äiti"; + +module.exports = function (t, a) { + a(t.call(str), "\u00e4iti"); + a(t.call(str, "NFC"), "\u00e4iti"); + a(t.call(str, "NFD"), "a\u0308iti"); + a(t.call(str, "NFKC"), "\u00e4iti"); + a(t.call(str, "NFKD"), "a\u0308iti"); +}; diff --git a/node_modules/es5-ext/test/string/#/pad.js b/node_modules/es5-ext/test/string/#/pad.js new file mode 100644 index 0000000..e573453 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/pad.js @@ -0,0 +1,24 @@ +"use strict"; + +var partial = require("../../../function/#/partial"); + +module.exports = { + Left: function (t, a) { + t = partial.call(t, "x", 5); + + a(t.call("yy"), "xxxyy"); + a(t.call(""), "xxxxx", "Empty string"); + + a(t.call("yyyyy"), "yyyyy", "Equal length"); + a(t.call("yyyyyyy"), "yyyyyyy", "Longer"); + }, + Right: function (t, a) { + t = partial.call(t, "x", -5); + + a(t.call("yy"), "yyxxx"); + a(t.call(""), "xxxxx", "Empty string"); + + a(t.call("yyyyy"), "yyyyy", "Equal length"); + a(t.call("yyyyyyy"), "yyyyyyy", "Longer"); + } +}; diff --git a/node_modules/es5-ext/test/string/#/plain-replace-all.js b/node_modules/es5-ext/test/string/#/plain-replace-all.js new file mode 100644 index 0000000..54fdabd --- /dev/null +++ b/node_modules/es5-ext/test/string/#/plain-replace-all.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("razdwatrzy", "dwa", "olera"), "razoleratrzy", "Basic"); + a(t.call("razdwatrzy", "dwa", "ole$&a"), "razole$&atrzy", "Inserts"); + a(t.call("razdwa", "ola", "sdfs"), "razdwa", "No replace"); + + a(t.call("$raz$$dwa$trzy$", "$", "&&"), "&&raz&&&&dwa&&trzy&&", "Multi"); + a(t.call("$raz$$dwa$$$$trzy$", "$$", "&"), "$raz&dwa&&trzy$", "Multi many chars"); +}; diff --git a/node_modules/es5-ext/test/string/#/plain-replace.js b/node_modules/es5-ext/test/string/#/plain-replace.js new file mode 100644 index 0000000..9f6c2be --- /dev/null +++ b/node_modules/es5-ext/test/string/#/plain-replace.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("razdwatrzy", "dwa", "olera"), "razoleratrzy", "Basic"); + a(t.call("razdwatrzy", "dwa", "ole$&a"), "razole$&atrzy", "Inserts"); + a(t.call("razdwa", "ola", "sdfs"), "razdwa", "No replace"); +}; diff --git a/node_modules/es5-ext/test/string/#/repeat/implement.js b/node_modules/es5-ext/test/string/#/repeat/implement.js new file mode 100644 index 0000000..554b975 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/repeat/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../string/#/repeat/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/string/#/repeat/index.js b/node_modules/es5-ext/test/string/#/repeat/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/repeat/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/string/#/repeat/is-implemented.js b/node_modules/es5-ext/test/string/#/repeat/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/string/#/repeat/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/string/#/repeat/shim.js b/node_modules/es5-ext/test/string/#/repeat/shim.js new file mode 100644 index 0000000..c584884 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/repeat/shim.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("a", 0), "", "Empty"); + a(t.call("a", 1), "a", "1"); + a(t.call("a", 2), "aa", "2"); + a(t.call("\t", 5), "\t\t\t\t\t", "Whitespace"); + a(t.call("raz", 3), "razrazraz", "Many chars"); + a(t.call("raz", 3), "razrazraz", "Many chars"); + a(t.call("razfoobar", 5), "razfoobarrazfoobarrazfoobarrazfoobarrazfoobar", "Many chars"); + a(t.call("a", 300).length, 300); +}; diff --git a/node_modules/es5-ext/test/string/#/starts-with/implement.js b/node_modules/es5-ext/test/string/#/starts-with/implement.js new file mode 100644 index 0000000..38371a8 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/starts-with/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../../string/#/starts-with/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/string/#/starts-with/index.js b/node_modules/es5-ext/test/string/#/starts-with/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/starts-with/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js b/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/string/#/starts-with/shim.js b/node_modules/es5-ext/test/string/#/starts-with/shim.js new file mode 100644 index 0000000..4b5e4e4 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/starts-with/shim.js @@ -0,0 +1,14 @@ +// Inspired and in some parts copied from: +// http://closure-library.googlecode.com/svn/trunk/closure/goog +// /string/string_test.html + +"use strict"; + +module.exports = function (t, a) { + a(t.call("abc", ""), true, "Empty needle"); + a(t.call("abcd", "ab"), true, "Starts with needle"); + a(t.call("abcd", "abcd"), true, "Needle equals haystack"); + a(t.call("abcd", "bcde", 1), false, "Needle larger than haystack"); + a(!t.call("abcd", "cd"), true, "Doesn't start with needle"); + a(t.call("abcd", "bc", 1), true, "Position"); +}; diff --git a/node_modules/es5-ext/test/string/#/uncapitalize.js b/node_modules/es5-ext/test/string/#/uncapitalize.js new file mode 100644 index 0000000..cddd847 --- /dev/null +++ b/node_modules/es5-ext/test/string/#/uncapitalize.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("raz"), "raz", "Word"); + a(t.call("BLA"), "bLA", "Uppercase"); + a(t.call(""), "", "Empty"); + a(t.call("a"), "a", "One letter"); + a(t.call("this is a test"), "this is a test", "Sentence"); + a(t.call("This is a test"), "this is a test", "Capitalized sentence"); +}; diff --git a/node_modules/es5-ext/test/string/format-method.js b/node_modules/es5-ext/test/string/format-method.js new file mode 100644 index 0000000..ddb08f5 --- /dev/null +++ b/node_modules/es5-ext/test/string/format-method.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + t = t({ a: "A", aa: "B", ab: "C", b: "D", c: function () { return ++this.a; } }); + a(t.call({ a: 0 }, " %a%aab%abb%b\\%aa%ab%c%c "), " ABbCbD%aaC12 "); +}; diff --git a/node_modules/es5-ext/test/string/from-code-point/implement.js b/node_modules/es5-ext/test/string/from-code-point/implement.js new file mode 100644 index 0000000..00b813d --- /dev/null +++ b/node_modules/es5-ext/test/string/from-code-point/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../string/from-code-point/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/string/from-code-point/index.js b/node_modules/es5-ext/test/string/from-code-point/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/string/from-code-point/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/string/from-code-point/is-implemented.js b/node_modules/es5-ext/test/string/from-code-point/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/string/from-code-point/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/string/from-code-point/shim.js b/node_modules/es5-ext/test/string/from-code-point/shim.js new file mode 100644 index 0000000..1bf22ad --- /dev/null +++ b/node_modules/es5-ext/test/string/from-code-point/shim.js @@ -0,0 +1,47 @@ +// Taken from: https://github.com/mathiasbynens/String.fromCodePoint/blob/master +// /tests/tests.js + +"use strict"; + +var pow = Math.pow; + +module.exports = function (t, a) { + var counter, result; + + a(t.length, 1, "Length"); + a(String.propertyIsEnumerable("fromCodePoint"), false, "Not enumerable"); + + a(t(""), "\0", "Empty string"); + a(t(), "", "No arguments"); + a(t(-0), "\0", "-0"); + a(t(0), "\0", "0"); + a(t(0x1d306), "\uD834\uDF06", "Unicode"); + a(t(0x1d306, 0x61, 0x1d307), "\uD834\uDF06a\uD834\uDF07", "Complex unicode"); + a(t(0x61, 0x62, 0x1d307), "ab\uD834\uDF07", "Complex"); + a(t(false), "\0", "false"); + a(t(null), "\0", "null"); + + a.throws(function () { t("_"); }, RangeError, "_"); + a.throws(function () { t(Infinity); }, RangeError, "Infinity"); + a.throws(function () { t(-Infinity); }, RangeError, "-Infinity"); + a.throws(function () { t(-1); }, RangeError, "-1"); + a.throws(function () { t(0x10ffff + 1); }, RangeError, "Range error #1"); + a.throws(function () { t(3.14); }, RangeError, "Range error #2"); + a.throws(function () { t(3e-2); }, RangeError, "Range error #3"); + a.throws(function () { t(-Infinity); }, RangeError, "Range error #4"); + a.throws(function () { t(Number(Infinity)); }, RangeError, "Range error #5"); + a.throws(function () { t(NaN); }, RangeError, "Range error #6"); + a.throws(function () { t(undefined); }, RangeError, "Range error #7"); + a.throws(function () { t({}); }, RangeError, "Range error #8"); + a.throws(function () { t(/re/); }, RangeError, "Range error #9"); + + counter = (pow(2, 15) * 3) / 2; + result = []; + while (--counter >= 0) result.push(0); // One code unit per symbol + t.apply(null, result); // Must not throw + + counter = (pow(2, 15) * 3) / 2; + result = []; + while (--counter >= 0) result.push(0xffff + 1); // Two code units per symbol + t.apply(null, result); // Must not throw +}; diff --git a/node_modules/es5-ext/test/string/is-string.js b/node_modules/es5-ext/test/string/is-string.js new file mode 100644 index 0000000..0e83122 --- /dev/null +++ b/node_modules/es5-ext/test/string/is-string.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(null), false, "Null"); + a(t(""), true, "Empty string"); + a(t(12), false, "Number"); + a(t(false), false, "Boolean"); + a(t(new Date()), false, "Date"); + a(t(new String("raz")), true, "String object"); + a(t("asdfaf"), true, "String"); +}; diff --git a/node_modules/es5-ext/test/string/random-uniq.js b/node_modules/es5-ext/test/string/random-uniq.js new file mode 100644 index 0000000..3b6d889 --- /dev/null +++ b/node_modules/es5-ext/test/string/random-uniq.js @@ -0,0 +1,14 @@ +"use strict"; + +var isValidFormat = RegExp.prototype.test.bind(/^[a-z0-9]+$/); + +module.exports = function (t, a) { + a(typeof t(), "string"); + a.ok(t().length > 7); + a.not(t(), t()); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); +}; diff --git a/node_modules/es5-ext/test/string/random.js b/node_modules/es5-ext/test/string/random.js new file mode 100644 index 0000000..3fa44ca --- /dev/null +++ b/node_modules/es5-ext/test/string/random.js @@ -0,0 +1,13 @@ +"use strict"; + +var isValidFormat = RegExp.prototype.test.bind(/^[a-z0-9]+$/); + +module.exports = function (t, a) { + a(typeof t(), "string"); + a.ok(t().length > 7); + a.not(t({ isUnique: true }), t({ isUnique: true })); + a.ok(isValidFormat(t())); + a(t({ length: 1 }).length, 1); + a(t({ length: 100 }).length, 100); + a(t({ length: 0 }), ""); +}; diff --git a/node_modules/es5-ext/test/string/raw/implement.js b/node_modules/es5-ext/test/string/raw/implement.js new file mode 100644 index 0000000..f865e00 --- /dev/null +++ b/node_modules/es5-ext/test/string/raw/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../string/raw/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/node_modules/es5-ext/test/string/raw/index.js b/node_modules/es5-ext/test/string/raw/index.js new file mode 100644 index 0000000..10bb8f6 --- /dev/null +++ b/node_modules/es5-ext/test/string/raw/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/node_modules/es5-ext/test/string/raw/is-implemented.js b/node_modules/es5-ext/test/string/raw/is-implemented.js new file mode 100644 index 0000000..566411c --- /dev/null +++ b/node_modules/es5-ext/test/string/raw/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/node_modules/es5-ext/test/string/raw/shim.js b/node_modules/es5-ext/test/string/raw/shim.js new file mode 100644 index 0000000..f61974f --- /dev/null +++ b/node_modules/es5-ext/test/string/raw/shim.js @@ -0,0 +1,14 @@ +// Partially taken from: +// https://github.com/paulmillr/es6-shim/blob/master/test/string.js + +"use strict"; + +module.exports = function (t, a) { + var callSite = []; + + callSite.raw = ["The total is ", " ($", " with tax)"]; + a(t(callSite, "{total}", "{total * 1.01}"), "The total is {total} (${total * 1.01} with tax)"); + + callSite.raw = []; + a(t(callSite, "{total}", "{total * 1.01}"), ""); +}; diff --git a/node_modules/es5-ext/test/to-short-string-representation.js b/node_modules/es5-ext/test/to-short-string-representation.js new file mode 100644 index 0000000..cac8d87 --- /dev/null +++ b/node_modules/es5-ext/test/to-short-string-representation.js @@ -0,0 +1,16 @@ +"use strict"; + +var repeat = require("../string/#/repeat"); + +module.exports = function (t, a) { + a(t(), "undefined"); + a(t(null), "null"); + a(t(10), "10"); + a(t("str"), "str"); + a(t({ toString: function () { return "miszka"; } }), "miszka"); + // eslint-disable-next-line symbol-description + if (typeof Symbol === "function") a(t(Symbol()), "Symbol()"); + a(t(Object.create(null)), ""); + a(t(repeat.call("a", 300)), repeat.call("a", 99) + "…"); + a(t("mar\ntoo\nfar"), "mar\\ntoo\\nfar"); +}; diff --git a/node_modules/es5-ext/to-short-string-representation.js b/node_modules/es5-ext/to-short-string-representation.js new file mode 100644 index 0000000..5aede53 --- /dev/null +++ b/node_modules/es5-ext/to-short-string-representation.js @@ -0,0 +1,16 @@ +"use strict"; + +var safeToString = require("./safe-to-string"); + +var reNewLine = /[\n\r\u2028\u2029]/g; + +module.exports = function (value) { + var string = safeToString(value); + // Trim if too long + if (string.length > 100) string = string.slice(0, 99) + "…"; + // Replace eventual new lines + string = string.replace(reNewLine, function (char) { + return JSON.stringify(char).slice(1, -1); + }); + return string; +}; diff --git a/node_modules/es6-iterator/#/chain.js b/node_modules/es6-iterator/#/chain.js new file mode 100644 index 0000000..190a346 --- /dev/null +++ b/node_modules/es6-iterator/#/chain.js @@ -0,0 +1,40 @@ +"use strict"; + +var setPrototypeOf = require("es5-ext/object/set-prototype-of") + , d = require("d") + , Iterator = require("../") + , validIterable = require("../valid-iterable") + + , push = Array.prototype.push + , defineProperties = Object.defineProperties + , IteratorChain; + +IteratorChain = function (iterators) { + defineProperties(this, { + __iterators__: d("", iterators), + __current__: d("w", iterators.shift()) + }); +}; +if (setPrototypeOf) setPrototypeOf(IteratorChain, Iterator); + +IteratorChain.prototype = Object.create(Iterator.prototype, { + constructor: d(IteratorChain), + next: d(function () { + var result; + if (!this.__current__) return { done: true, value: undefined }; + result = this.__current__.next(); + while (result.done) { + this.__current__ = this.__iterators__.shift(); + if (!this.__current__) return { done: true, value: undefined }; + result = this.__current__.next(); + } + return result; + }) +}); + +module.exports = function () { + var iterators = [this]; + push.apply(iterators, arguments); + iterators.forEach(validIterable); + return new IteratorChain(iterators); +}; diff --git a/node_modules/es6-iterator/.editorconfig b/node_modules/es6-iterator/.editorconfig new file mode 100644 index 0000000..c24a6cd --- /dev/null +++ b/node_modules/es6-iterator/.editorconfig @@ -0,0 +1,14 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +indent_style = tab + +[{*.json,*.yml}] +indent_style = space +indent_size = 2 diff --git a/node_modules/es6-iterator/.npmignore b/node_modules/es6-iterator/.npmignore new file mode 100644 index 0000000..a91db65 --- /dev/null +++ b/node_modules/es6-iterator/.npmignore @@ -0,0 +1,12 @@ +.DS_Store +Thumbs.db +/.idea +/.vscode +npm-debug.log +/wallaby.js +/node_modules +/.travis.yml +/.gitignore +/.circle.yml +/.circleci +/.appveyor.yml diff --git a/node_modules/es6-iterator/CHANGELOG.md b/node_modules/es6-iterator/CHANGELOG.md new file mode 100644 index 0000000..37eb16a --- /dev/null +++ b/node_modules/es6-iterator/CHANGELOG.md @@ -0,0 +1,27 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +## [2.0.3](https://github.com/medikoo/es6-iterator/compare/v2.0.2...v2.0.3) (2017-10-17) + + +### Bug Fixes + +* configurability of toStringTag ([b99f692](https://github.com/medikoo/es6-iterator/commit/b99f692)) + + + + +## [2.0.2](https://github.com/medikoo/es6-iterator/compare/v2.0.1...v2.0.2) (2017-10-17) + + +### Bug Fixes + +* constructor exposure ([dbc0c51](https://github.com/medikoo/es6-iterator/commit/dbc0c51)) +* do not allow non constructor calls ([1f2f800](https://github.com/medikoo/es6-iterator/commit/1f2f800)) +* toString and toStringTag symbol definitions. ([2d17786](https://github.com/medikoo/es6-iterator/commit/2d17786)), closes [#6](https://github.com/medikoo/es6-iterator/issues/6) + +## Changelog for previous versions + +See `CHANGES` file diff --git a/node_modules/es6-iterator/CHANGES b/node_modules/es6-iterator/CHANGES new file mode 100644 index 0000000..83095f7 --- /dev/null +++ b/node_modules/es6-iterator/CHANGES @@ -0,0 +1,42 @@ +For recent changelog see CHANGELOG.md + +----- + +v2.0.1 -- 2017.03.15 +* Update dependencies + +v2.0.0 -- 2015.10.02 +* Use es6-symbol at v3 + +v1.0.0 -- 2015.06.23 +* Implement support for arguments object +* Drop support for v0.8 node ('^' in package.json dependencies) + +v0.1.3 -- 2015.02.02 +* Update dependencies +* Fix spelling of LICENSE + +v0.1.2 -- 2014.11.19 +* Optimise internal `_next` to not verify internal's list length at all times + (#2 thanks @RReverser) +* Fix documentation examples +* Configure lint scripts + +v0.1.1 -- 2014.04.29 +* Fix es6-symbol dependency version + +v0.1.0 -- 2014.04.29 +* Assure strictly npm hosted dependencies +* Remove sparse arrays dedicated handling (as per spec) +* Add: isIterable, validIterable and chain (method) +* Remove toArray, it's addressed by Array.from (polyfil can be found in es5-ext/array/from) +* Add break possiblity to 'forOf' via 'doBreak' function argument +* Provide dedicated iterator for array-likes (ArrayIterator) and for strings (StringIterator) +* Provide @@toStringTag symbol +* When available rely on @@iterator symbol +* Remove 32bit integer maximum list length restriction +* Improve Iterator internals +* Update to use latest version of dependencies + +v0.0.0 -- 2013.10.12 +Initial (dev version) diff --git a/node_modules/es6-iterator/LICENSE b/node_modules/es6-iterator/LICENSE new file mode 100644 index 0000000..d7c36d5 --- /dev/null +++ b/node_modules/es6-iterator/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (C) 2013-2017 Mariusz Nowak (www.medikoo.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. diff --git a/node_modules/es6-iterator/README.md b/node_modules/es6-iterator/README.md new file mode 100644 index 0000000..288373d --- /dev/null +++ b/node_modules/es6-iterator/README.md @@ -0,0 +1,148 @@ +# es6-iterator +## ECMAScript 6 Iterator interface + +### Installation + + $ npm install es6-iterator + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +## API + +### Constructors + +#### Iterator(list) _(es6-iterator)_ + +Abstract Iterator interface. Meant for extensions and not to be used on its own. + +Accepts any _list_ object (technically object with numeric _length_ property). + +_Mind it doesn't iterate strings properly, for that use dedicated [StringIterator](#string-iterator)_ + +```javascript +var Iterator = require('es6-iterator') +var iterator = new Iterator([1, 2, 3]); + +iterator.next(); // { value: 1, done: false } +iterator.next(); // { value: 2, done: false } +iterator.next(); // { value: 3, done: false } +iterator.next(); // { value: undefined, done: true } +``` + + +#### ArrayIterator(arrayLike[, kind]) _(es6-iterator/array)_ + +Dedicated for arrays and array-likes. Supports three iteration kinds: +* __value__ _(default)_ - Iterates values +* __key__ - Iterates indexes +* __key+value__ - Iterates keys and indexes, each iteration value is in _[key, value]_ form. + + +```javascript +var ArrayIterator = require('es6-iterator/array') +var iterator = new ArrayIterator([1, 2, 3], 'key+value'); + +iterator.next(); // { value: [0, 1], done: false } +iterator.next(); // { value: [1, 2], done: false } +iterator.next(); // { value: [2, 3], done: false } +iterator.next(); // { value: undefined, done: true } +``` + +May also be used for _arguments_ objects: + +```javascript +(function () { + var iterator = new ArrayIterator(arguments); + + iterator.next(); // { value: 1, done: false } + iterator.next(); // { value: 2, done: false } + iterator.next(); // { value: 3, done: false } + iterator.next(); // { value: undefined, done: true } +}(1, 2, 3)); +``` + +#### StringIterator(str) _(es6-iterator/string)_ + +Assures proper iteration over unicode symbols. +See: http://mathiasbynens.be/notes/javascript-unicode + +```javascript +var StringIterator = require('es6-iterator/string'); +var iterator = new StringIterator('f🙈o🙉o🙊'); + +iterator.next(); // { value: 'f', done: false } +iterator.next(); // { value: '🙈', done: false } +iterator.next(); // { value: 'o', done: false } +iterator.next(); // { value: '🙉', done: false } +iterator.next(); // { value: 'o', done: false } +iterator.next(); // { value: '🙊', done: false } +iterator.next(); // { value: undefined, done: true } +``` + +### Function utilities + +#### forOf(iterable, callback[, thisArg]) _(es6-iterator/for-of)_ + +Polyfill for ECMAScript 6 [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) statement. + +``` +var forOf = require('es6-iterator/for-of'); +var result = []; + +forOf('🙈🙉🙊', function (monkey) { result.push(monkey); }); +console.log(result); // ['🙈', '🙉', '🙊']; +``` + +Optionally you can break iteration at any point: + +```javascript +var result = []; + +forOf([1,2,3,4]', function (val, doBreak) { + result.push(monkey); + if (val >= 3) doBreak(); +}); +console.log(result); // [1, 2, 3]; +``` + +#### get(obj) _(es6-iterator/get)_ + +Return iterator for any iterable object. + +```javascript +var getIterator = require('es6-iterator/get'); +var iterator = get([1,2,3]); + +iterator.next(); // { value: 1, done: false } +iterator.next(); // { value: 2, done: false } +iterator.next(); // { value: 3, done: false } +iterator.next(); // { value: undefined, done: true } +``` + +#### isIterable(obj) _(es6-iterator/is-iterable)_ + +Whether _obj_ is iterable + +```javascript +var isIterable = require('es6-iterator/is-iterable'); + +isIterable(null); // false +isIterable(true); // false +isIterable('str'); // true +isIterable(['a', 'r', 'r']); // true +isIterable(new ArrayIterator([])); // true +``` + +#### validIterable(obj) _(es6-iterator/valid-iterable)_ + +If _obj_ is an iterable it is returned. Otherwise _TypeError_ is thrown. + +### Method extensions + +#### iterator.chain(iterator1[, …iteratorn]) _(es6-iterator/#/chain)_ + +Chain multiple iterators into one. + +### Tests [![Build Status](https://travis-ci.org/medikoo/es6-iterator.png)](https://travis-ci.org/medikoo/es6-iterator) + + $ npm test diff --git a/node_modules/es6-iterator/appveyor.yml b/node_modules/es6-iterator/appveyor.yml new file mode 100644 index 0000000..942ab82 --- /dev/null +++ b/node_modules/es6-iterator/appveyor.yml @@ -0,0 +1,26 @@ +# Test against the latest version of this Node.js version +environment: + matrix: + # node.js + - nodejs_version: "0.12" + - nodejs_version: "4" + - nodejs_version: "6" + - nodejs_version: "8" + +# Install scripts. (runs after repo cloning) +install: + # Get the latest stable version of Node.js or io.js + - ps: Install-Product node $env:nodejs_version + # install modules + - npm install + +# Post-install test scripts. +test_script: + # Output useful info for debugging. + - node --version + - npm --version + # run tests + - npm test + +# Don't actually build. +build: off diff --git a/node_modules/es6-iterator/array.js b/node_modules/es6-iterator/array.js new file mode 100644 index 0000000..d7a46a4 --- /dev/null +++ b/node_modules/es6-iterator/array.js @@ -0,0 +1,32 @@ +"use strict"; + +var setPrototypeOf = require("es5-ext/object/set-prototype-of") + , contains = require("es5-ext/string/#/contains") + , d = require("d") + , Symbol = require("es6-symbol") + , Iterator = require("./"); + +var defineProperty = Object.defineProperty, ArrayIterator; + +ArrayIterator = module.exports = function (arr, kind) { + if (!(this instanceof ArrayIterator)) throw new TypeError("Constructor requires 'new'"); + Iterator.call(this, arr); + if (!kind) kind = "value"; + else if (contains.call(kind, "key+value")) kind = "key+value"; + else if (contains.call(kind, "key")) kind = "key"; + else kind = "value"; + defineProperty(this, "__kind__", d("", kind)); +}; +if (setPrototypeOf) setPrototypeOf(ArrayIterator, Iterator); + +// Internal %ArrayIteratorPrototype% doesn't expose its constructor +delete ArrayIterator.prototype.constructor; + +ArrayIterator.prototype = Object.create(Iterator.prototype, { + _resolve: d(function (i) { + if (this.__kind__ === "value") return this.__list__[i]; + if (this.__kind__ === "key+value") return [i, this.__list__[i]]; + return i; + }) +}); +defineProperty(ArrayIterator.prototype, Symbol.toStringTag, d("c", "Array Iterator")); diff --git a/node_modules/es6-iterator/for-of.js b/node_modules/es6-iterator/for-of.js new file mode 100644 index 0000000..5d15c34 --- /dev/null +++ b/node_modules/es6-iterator/for-of.js @@ -0,0 +1,47 @@ +"use strict"; + +var isArguments = require("es5-ext/function/is-arguments") + , callable = require("es5-ext/object/valid-callable") + , isString = require("es5-ext/string/is-string") + , get = require("./get"); + +var isArray = Array.isArray, call = Function.prototype.call, some = Array.prototype.some; + +module.exports = function (iterable, cb /*, thisArg*/) { + var mode, thisArg = arguments[2], result, doBreak, broken, i, length, char, code; + if (isArray(iterable) || isArguments(iterable)) mode = "array"; + else if (isString(iterable)) mode = "string"; + else iterable = get(iterable); + + callable(cb); + doBreak = function () { + broken = true; + }; + if (mode === "array") { + some.call(iterable, function (value) { + call.call(cb, thisArg, value, doBreak); + return broken; + }); + return; + } + if (mode === "string") { + length = iterable.length; + for (i = 0; i < length; ++i) { + char = iterable[i]; + if (i + 1 < length) { + code = char.charCodeAt(0); + if (code >= 0xd800 && code <= 0xdbff) char += iterable[++i]; + } + call.call(cb, thisArg, char, doBreak); + if (broken) break; + } + return; + } + result = iterable.next(); + + while (!result.done) { + call.call(cb, thisArg, result.value, doBreak); + if (broken) return; + result = iterable.next(); + } +}; diff --git a/node_modules/es6-iterator/get.js b/node_modules/es6-iterator/get.js new file mode 100644 index 0000000..d36c9e2 --- /dev/null +++ b/node_modules/es6-iterator/get.js @@ -0,0 +1,15 @@ +"use strict"; + +var isArguments = require("es5-ext/function/is-arguments") + , isString = require("es5-ext/string/is-string") + , ArrayIterator = require("./array") + , StringIterator = require("./string") + , iterable = require("./valid-iterable") + , iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function (obj) { + if (typeof iterable(obj)[iteratorSymbol] === "function") return obj[iteratorSymbol](); + if (isArguments(obj)) return new ArrayIterator(obj); + if (isString(obj)) return new StringIterator(obj); + return new ArrayIterator(obj); +}; diff --git a/node_modules/es6-iterator/index.js b/node_modules/es6-iterator/index.js new file mode 100644 index 0000000..790475f --- /dev/null +++ b/node_modules/es6-iterator/index.js @@ -0,0 +1,106 @@ +"use strict"; + +var clear = require("es5-ext/array/#/clear") + , assign = require("es5-ext/object/assign") + , callable = require("es5-ext/object/valid-callable") + , value = require("es5-ext/object/valid-value") + , d = require("d") + , autoBind = require("d/auto-bind") + , Symbol = require("es6-symbol"); + +var defineProperty = Object.defineProperty, defineProperties = Object.defineProperties, Iterator; + +module.exports = Iterator = function (list, context) { + if (!(this instanceof Iterator)) throw new TypeError("Constructor requires 'new'"); + defineProperties(this, { + __list__: d("w", value(list)), + __context__: d("w", context), + __nextIndex__: d("w", 0) + }); + if (!context) return; + callable(context.on); + context.on("_add", this._onAdd); + context.on("_delete", this._onDelete); + context.on("_clear", this._onClear); +}; + +// Internal %IteratorPrototype% doesn't expose its constructor +delete Iterator.prototype.constructor; + +defineProperties( + Iterator.prototype, + assign( + { + _next: d(function () { + var i; + if (!this.__list__) return undefined; + if (this.__redo__) { + i = this.__redo__.shift(); + if (i !== undefined) return i; + } + if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++; + this._unBind(); + return undefined; + }), + next: d(function () { + return this._createResult(this._next()); + }), + _createResult: d(function (i) { + if (i === undefined) return { done: true, value: undefined }; + return { done: false, value: this._resolve(i) }; + }), + _resolve: d(function (i) { + return this.__list__[i]; + }), + _unBind: d(function () { + this.__list__ = null; + delete this.__redo__; + if (!this.__context__) return; + this.__context__.off("_add", this._onAdd); + this.__context__.off("_delete", this._onDelete); + this.__context__.off("_clear", this._onClear); + this.__context__ = null; + }), + toString: d(function () { + return "[object " + (this[Symbol.toStringTag] || "Object") + "]"; + }) + }, + autoBind({ + _onAdd: d(function (index) { + if (index >= this.__nextIndex__) return; + ++this.__nextIndex__; + if (!this.__redo__) { + defineProperty(this, "__redo__", d("c", [index])); + return; + } + this.__redo__.forEach(function (redo, i) { + if (redo >= index) this.__redo__[i] = ++redo; + }, this); + this.__redo__.push(index); + }), + _onDelete: d(function (index) { + var i; + if (index >= this.__nextIndex__) return; + --this.__nextIndex__; + if (!this.__redo__) return; + i = this.__redo__.indexOf(index); + if (i !== -1) this.__redo__.splice(i, 1); + this.__redo__.forEach(function (redo, j) { + if (redo > index) this.__redo__[j] = --redo; + }, this); + }), + _onClear: d(function () { + if (this.__redo__) clear.call(this.__redo__); + this.__nextIndex__ = 0; + }) + }) + ) +); + +defineProperty( + Iterator.prototype, + Symbol.iterator, + d(function () { + return this; + }) +); diff --git a/node_modules/es6-iterator/is-iterable.js b/node_modules/es6-iterator/is-iterable.js new file mode 100644 index 0000000..cda7dfe --- /dev/null +++ b/node_modules/es6-iterator/is-iterable.js @@ -0,0 +1,16 @@ +"use strict"; + +var isArguments = require("es5-ext/function/is-arguments") + , isValue = require("es5-ext/object/is-value") + , isString = require("es5-ext/string/is-string"); + +var iteratorSymbol = require("es6-symbol").iterator + , isArray = Array.isArray; + +module.exports = function (value) { + if (!isValue(value)) return false; + if (isArray(value)) return true; + if (isString(value)) return true; + if (isArguments(value)) return true; + return typeof value[iteratorSymbol] === "function"; +}; diff --git a/node_modules/es6-iterator/package.json b/node_modules/es6-iterator/package.json new file mode 100644 index 0000000..52176fb --- /dev/null +++ b/node_modules/es6-iterator/package.json @@ -0,0 +1,76 @@ +{ + "_from": "es6-iterator@^2.0.1", + "_id": "es6-iterator@2.0.3", + "_inBundle": false, + "_integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "_location": "/es6-iterator", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "es6-iterator@^2.0.1", + "name": "es6-iterator", + "escapedName": "es6-iterator", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/es5-ext", + "/es6-weak-map", + "/sver-compat" + ], + "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "_shasum": "a7de889141a05a94b0854403b2d0a0fbfa98f3b7", + "_spec": "es6-iterator@^2.0.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/sver-compat", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/es6-iterator/issues" + }, + "bundleDependencies": false, + "dependencies": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + }, + "deprecated": false, + "description": "Iterator abstraction based on ES6 specification", + "devDependencies": { + "eslint": "^4.9", + "eslint-config-medikoo-es5": "^1.4.4", + "event-emitter": "^0.3.5", + "tad": "^0.2.7" + }, + "eslintConfig": { + "extends": "medikoo-es5", + "root": true, + "rules": { + "no-extend-native": "off" + } + }, + "homepage": "https://github.com/medikoo/es6-iterator#readme", + "keywords": [ + "iterator", + "array", + "list", + "set", + "map", + "generator" + ], + "license": "MIT", + "name": "es6-iterator", + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es6-iterator.git" + }, + "scripts": { + "lint": "eslint --ignore-path=.gitignore .", + "test": "node ./node_modules/tad/bin/tad" + }, + "version": "2.0.3" +} diff --git a/node_modules/es6-iterator/string.js b/node_modules/es6-iterator/string.js new file mode 100644 index 0000000..4888225 --- /dev/null +++ b/node_modules/es6-iterator/string.js @@ -0,0 +1,39 @@ +// Thanks @mathiasbynens +// http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols + +"use strict"; + +var setPrototypeOf = require("es5-ext/object/set-prototype-of") + , d = require("d") + , Symbol = require("es6-symbol") + , Iterator = require("./"); + +var defineProperty = Object.defineProperty, StringIterator; + +StringIterator = module.exports = function (str) { + if (!(this instanceof StringIterator)) throw new TypeError("Constructor requires 'new'"); + str = String(str); + Iterator.call(this, str); + defineProperty(this, "__length__", d("", str.length)); +}; +if (setPrototypeOf) setPrototypeOf(StringIterator, Iterator); + +// Internal %ArrayIteratorPrototype% doesn't expose its constructor +delete StringIterator.prototype.constructor; + +StringIterator.prototype = Object.create(Iterator.prototype, { + _next: d(function () { + if (!this.__list__) return undefined; + if (this.__nextIndex__ < this.__length__) return this.__nextIndex__++; + this._unBind(); + return undefined; + }), + _resolve: d(function (i) { + var char = this.__list__[i], code; + if (this.__nextIndex__ === this.__length__) return char; + code = char.charCodeAt(0); + if (code >= 0xd800 && code <= 0xdbff) return char + this.__list__[this.__nextIndex__++]; + return char; + }) +}); +defineProperty(StringIterator.prototype, Symbol.toStringTag, d("c", "String Iterator")); diff --git a/node_modules/es6-iterator/test/#/chain.js b/node_modules/es6-iterator/test/#/chain.js new file mode 100644 index 0000000..457356f --- /dev/null +++ b/node_modules/es6-iterator/test/#/chain.js @@ -0,0 +1,23 @@ +"use strict"; + +var Iterator = require("../../"); + +module.exports = function (t, a) { + var i1 = new Iterator(["raz", "dwa", "trzy"]) + , i2 = new Iterator(["cztery", "pięć", "sześć"]) + , i3 = new Iterator(["siedem", "osiem", "dziewięć"]) + + , iterator = t.call(i1, i2, i3); + + a.deep(iterator.next(), { done: false, value: "raz" }, "#1"); + a.deep(iterator.next(), { done: false, value: "dwa" }, "#2"); + a.deep(iterator.next(), { done: false, value: "trzy" }, "#3"); + a.deep(iterator.next(), { done: false, value: "cztery" }, "#4"); + a.deep(iterator.next(), { done: false, value: "pięć" }, "#5"); + a.deep(iterator.next(), { done: false, value: "sześć" }, "#6"); + a.deep(iterator.next(), { done: false, value: "siedem" }, "#7"); + a.deep(iterator.next(), { done: false, value: "osiem" }, "#8"); + a.deep(iterator.next(), { done: false, value: "dziewięć" }, "#9"); + a.deep(iterator.next(), { done: true, value: undefined }, "Done #1"); + a.deep(iterator.next(), { done: true, value: undefined }, "Done #2"); +}; diff --git a/node_modules/es6-iterator/test/.eslintrc.json b/node_modules/es6-iterator/test/.eslintrc.json new file mode 100644 index 0000000..99f0b65 --- /dev/null +++ b/node_modules/es6-iterator/test/.eslintrc.json @@ -0,0 +1,5 @@ +{ + "rules": { + "id-length": "off" + } +} diff --git a/node_modules/es6-iterator/test/array.js b/node_modules/es6-iterator/test/array.js new file mode 100644 index 0000000..447dfa7 --- /dev/null +++ b/node_modules/es6-iterator/test/array.js @@ -0,0 +1,67 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function (T) { + return { + "Values": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], it; + + it = new T(x); + a(it[iteratorSymbol](), it, "@@iterator"); + a.deep(it.next(), { done: false, value: "raz" }, "#1"); + a.deep(it.next(), { done: false, value: "dwa" }, "#2"); + x.splice(1, 0, "elo"); + a.deep(it.next(), { done: false, value: "dwa" }, "Insert"); + a.deep(it.next(), { done: false, value: "trzy" }, "#3"); + a.deep(it.next(), { done: false, value: "cztery" }, "#4"); + x.pop(); + a.deep(it.next(), { done: false, value: "pięć" }, "#5"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Keys & Values": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], it; + + it = new T(x, "key+value"); + a(it[iteratorSymbol](), it, "@@iterator"); + a.deep(it.next(), { done: false, value: [0, "raz"] }, "#1"); + a.deep(it.next(), { done: false, value: [1, "dwa"] }, "#2"); + x.splice(1, 0, "elo"); + a.deep(it.next(), { done: false, value: [2, "dwa"] }, "Insert"); + a.deep(it.next(), { done: false, value: [3, "trzy"] }, "#3"); + a.deep(it.next(), { done: false, value: [4, "cztery"] }, "#4"); + x.pop(); + a.deep(it.next(), { done: false, value: [5, "pięć"] }, "#5"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Keys": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], it; + + it = new T(x, "key"); + a(it[iteratorSymbol](), it, "@@iterator"); + a.deep(it.next(), { done: false, value: 0 }, "#1"); + a.deep(it.next(), { done: false, value: 1 }, "#2"); + x.splice(1, 0, "elo"); + a.deep(it.next(), { done: false, value: 2 }, "Insert"); + a.deep(it.next(), { done: false, value: 3 }, "#3"); + a.deep(it.next(), { done: false, value: 4 }, "#4"); + x.pop(); + a.deep(it.next(), { done: false, value: 5 }, "#5"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Sparse": function (a) { + var x = new Array(6), it; + + x[2] = "raz"; + x[4] = "dwa"; + it = new T(x); + a.deep(it.next(), { done: false, value: undefined }, "#1"); + a.deep(it.next(), { done: false, value: undefined }, "#2"); + a.deep(it.next(), { done: false, value: "raz" }, "#3"); + a.deep(it.next(), { done: false, value: undefined }, "#4"); + a.deep(it.next(), { done: false, value: "dwa" }, "#5"); + a.deep(it.next(), { done: false, value: undefined }, "#6"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + } + }; +}; diff --git a/node_modules/es6-iterator/test/for-of.js b/node_modules/es6-iterator/test/for-of.js new file mode 100644 index 0000000..9b47e97 --- /dev/null +++ b/node_modules/es6-iterator/test/for-of.js @@ -0,0 +1,42 @@ +"use strict"; + +var ArrayIterator = require("../array") + + , slice = Array.prototype.slice; + +module.exports = function (t, a) { + var i = 0, x = ["raz", "dwa", "trzy"], y = {}, called = 0; + t(x, function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Array " + i + "#"); + a(this, y, "Array: context: " + i++ + "#"); + }, y); + i = 0; + t((function () { + return arguments; +}("raz", "dwa", "trzy")), function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Arguments" + i + "#"); + a(this, y, "Arguments: context: " + i++ + "#"); + }, y); + i = 0; + t(x = "foo", function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); + a(this, y, "Regular String: context: " + i++ + "#"); + }, y); + i = 0; + x = ["r", "💩", "z"]; + t("r💩z", function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); + a(this, y, "Unicode String: context: " + i++ + "#"); + }, y); + i = 0; + t(new ArrayIterator(x), function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Iterator " + i + "#"); + a(this, y, "Iterator: context: " + i++ + "#"); + }, y); + + t(x = ["raz", "dwa", "trzy"], function (value, doBreak) { + ++called; + return doBreak(); + }); + a(called, 1, "Break"); +}; diff --git a/node_modules/es6-iterator/test/get.js b/node_modules/es6-iterator/test/get.js new file mode 100644 index 0000000..c5947d3 --- /dev/null +++ b/node_modules/es6-iterator/test/get.js @@ -0,0 +1,27 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator + , Iterator = require("../"); + +module.exports = function (t, a) { + var iterator; + a.throws(function () { + t(); +}, TypeError, "Null"); + a.throws(function () { + t({}); +}, TypeError, "Plain object"); + a.throws(function () { + t({ length: 0 }); +}, TypeError, "Array-like"); + iterator = {}; + iterator[iteratorSymbol] = function () { + return new Iterator([]); +}; + a(t(iterator) instanceof Iterator, true, "Iterator"); + a(String(t([])), "[object Array Iterator]", " Array"); + a(String(t(function () { + return arguments; +}())), "[object Array Iterator]", " Arguments"); + a(String(t("foo")), "[object String Iterator]", "String"); +}; diff --git a/node_modules/es6-iterator/test/index.js b/node_modules/es6-iterator/test/index.js new file mode 100644 index 0000000..4898218 --- /dev/null +++ b/node_modules/es6-iterator/test/index.js @@ -0,0 +1,99 @@ +"use strict"; + +var ee = require("event-emitter") + , iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function (T) { + return { + "": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć"], it, y, z; + + it = new T(x); + a(it[iteratorSymbol](), it, "@@iterator"); + y = it.next(); + a.deep(y, { done: false, value: "raz" }, "#1"); + z = it.next(); + a.not(y, z, "Recreate result"); + a.deep(z, { done: false, value: "dwa" }, "#2"); + a.deep(it.next(), { done: false, value: "trzy" }, "#3"); + a.deep(it.next(), { done: false, value: "cztery" }, "#4"); + a.deep(it.next(), { done: false, value: "pięć" }, "#5"); + a.deep(y = it.next(), { done: true, value: undefined }, "End"); + a.not(y, it.next(), "Recreate result on dead"); + }, + "Emited": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć"], y, it; + + y = ee(); + it = new T(x, y); + a.deep(it.next(), { done: false, value: "raz" }, "#1"); + a.deep(it.next(), { done: false, value: "dwa" }, "#2"); + y.emit("_add", x.push("sześć") - 1); + a.deep(it.next(), { done: false, value: "trzy" }, "#3"); + x.splice(1, 0, "półtora"); + y.emit("_add", 1); + a.deep(it.next(), { done: false, value: "półtora" }, "Insert"); + x.splice(5, 1); + y.emit("_delete", 5); + a.deep(it.next(), { done: false, value: "cztery" }, "#4"); + a.deep(it.next(), { done: false, value: "sześć" }, "#5"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited #2": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], y, it; + + y = ee(); + it = new T(x, y); + a.deep(it.next(), { done: false, value: "raz" }, "#1"); + a.deep(it.next(), { done: false, value: "dwa" }, "#2"); + x.splice(1, 0, "półtora"); + y.emit("_add", 1); + x.splice(1, 0, "1.25"); + y.emit("_add", 1); + x.splice(0, 1); + y.emit("_delete", 0); + a.deep(it.next(), { done: false, value: "półtora" }, "Insert"); + a.deep(it.next(), { done: false, value: "1.25" }, "Insert #2"); + a.deep(it.next(), { done: false, value: "trzy" }, "#3"); + a.deep(it.next(), { done: false, value: "cztery" }, "#4"); + x.splice(5, 1); + y.emit("_delete", 5); + a.deep(it.next(), { done: false, value: "sześć" }, "#5"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited: Clear #1": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], y, it; + + y = ee(); + it = new T(x, y); + a.deep(it.next(), { done: false, value: "raz" }, "#1"); + a.deep(it.next(), { done: false, value: "dwa" }, "#2"); + x.length = 0; + y.emit("_clear"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited: Clear #2": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], y, it; + + y = ee(); + it = new T(x, y); + a.deep(it.next(), { done: false, value: "raz" }, "#1"); + a.deep(it.next(), { done: false, value: "dwa" }, "#2"); + x.length = 0; + y.emit("_clear"); + x.push("foo"); + x.push("bar"); + a.deep(it.next(), { done: false, value: "foo" }, "#3"); + a.deep(it.next(), { done: false, value: "bar" }, "#4"); + x.splice(1, 0, "półtora"); + y.emit("_add", 1); + x.splice(1, 0, "1.25"); + y.emit("_add", 1); + x.splice(0, 1); + y.emit("_delete", 0); + a.deep(it.next(), { done: false, value: "półtora" }, "Insert"); + a.deep(it.next(), { done: false, value: "1.25" }, "Insert #2"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + } + }; +}; diff --git a/node_modules/es6-iterator/test/is-iterable.js b/node_modules/es6-iterator/test/is-iterable.js new file mode 100644 index 0000000..5787351 --- /dev/null +++ b/node_modules/es6-iterator/test/is-iterable.js @@ -0,0 +1,23 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator + , Iterator = require("../"); + +module.exports = function (t, a) { + var iterator; + a(t(), false, "Undefined"); + a(t(123), false, "Number"); + a(t({}), false, "Plain object"); + a(t({ length: 0 }), false, "Array-like"); + iterator = {}; + iterator[iteratorSymbol] = function () { + return new Iterator([]); +}; + a(t(iterator), true, "Iterator"); + a(t([]), true, "Array"); + a(t("foo"), true, "String"); + a(t(""), true, "Empty string"); + a(t(function () { + return arguments; +}()), true, "Arguments"); +}; diff --git a/node_modules/es6-iterator/test/string.js b/node_modules/es6-iterator/test/string.js new file mode 100644 index 0000000..3f2a5b6 --- /dev/null +++ b/node_modules/es6-iterator/test/string.js @@ -0,0 +1,23 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function (T, a) { + var it = new T("foobar"); + + a(it[iteratorSymbol](), it, "@@iterator"); + a.deep(it.next(), { done: false, value: "f" }, "#1"); + a.deep(it.next(), { done: false, value: "o" }, "#2"); + a.deep(it.next(), { done: false, value: "o" }, "#3"); + a.deep(it.next(), { done: false, value: "b" }, "#4"); + a.deep(it.next(), { done: false, value: "a" }, "#5"); + a.deep(it.next(), { done: false, value: "r" }, "#6"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + + a.h1("Outside of BMP"); + it = new T("r💩z"); + a.deep(it.next(), { done: false, value: "r" }, "#1"); + a.deep(it.next(), { done: false, value: "💩" }, "#2"); + a.deep(it.next(), { done: false, value: "z" }, "#3"); + a.deep(it.next(), { done: true, value: undefined }, "End"); +}; diff --git a/node_modules/es6-iterator/test/valid-iterable.js b/node_modules/es6-iterator/test/valid-iterable.js new file mode 100644 index 0000000..b8b2a8a --- /dev/null +++ b/node_modules/es6-iterator/test/valid-iterable.js @@ -0,0 +1,28 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator + , Iterator = require("../"); + +module.exports = function (t, a) { + var obj; + a.throws(function () { + t(); +}, TypeError, "Undefined"); + a.throws(function () { + t({}); +}, TypeError, "Plain object"); + a.throws(function () { + t({ length: 0 }); +}, TypeError, "Array-like"); + obj = {}; + obj[iteratorSymbol] = function () { + return new Iterator([]); +}; + a(t(obj), obj, "Iterator"); + obj = []; + a(t(obj), obj, "Array"); + obj = (function () { + return arguments; +}()); + a(t(obj), obj, "Arguments"); +}; diff --git a/node_modules/es6-iterator/valid-iterable.js b/node_modules/es6-iterator/valid-iterable.js new file mode 100644 index 0000000..8c6e071 --- /dev/null +++ b/node_modules/es6-iterator/valid-iterable.js @@ -0,0 +1,8 @@ +"use strict"; + +var isIterable = require("./is-iterable"); + +module.exports = function (value) { + if (!isIterable(value)) throw new TypeError(value + " is not iterable"); + return value; +}; diff --git a/node_modules/es6-symbol/.editorconfig b/node_modules/es6-symbol/.editorconfig new file mode 100755 index 0000000..bd6d81e --- /dev/null +++ b/node_modules/es6-symbol/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +trim_trailing_whitespace = true + +[*.md] +indent_size = 2 +indent_style = space +trim_trailing_whitespace = false diff --git a/node_modules/es6-symbol/.github/FUNDING.yml b/node_modules/es6-symbol/.github/FUNDING.yml new file mode 100644 index 0000000..81c96d7 --- /dev/null +++ b/node_modules/es6-symbol/.github/FUNDING.yml @@ -0,0 +1 @@ +tidelift: "npm/es6-symbol" diff --git a/node_modules/es6-symbol/.testignore b/node_modules/es6-symbol/.testignore new file mode 100644 index 0000000..b5b5cd1 --- /dev/null +++ b/node_modules/es6-symbol/.testignore @@ -0,0 +1 @@ +/lib/private diff --git a/node_modules/es6-symbol/CHANGELOG.md b/node_modules/es6-symbol/CHANGELOG.md new file mode 100644 index 0000000..60cf2b7 --- /dev/null +++ b/node_modules/es6-symbol/CHANGELOG.md @@ -0,0 +1,16 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +### [3.1.3](https://github.com/medikoo/es6-symbol/compare/v3.1.2...v3.1.3) (2019-10-29) + +### [3.1.2](https://github.com/medikoo/es6-symbol/compare/v3.1.1...v3.1.2) (2019-09-04) + +- Access `Symbol` from a global object. Makes implementation more bulletproof, as it's safe against shadowing the `Symbol` variable e.g. in script scope, or as it's practiced by some bundlers as Webpack (thanks [@cyborgx37](https://github.com/medikoo/es6-symbol/pull/30)) +- Switch license from MIT to ISC +- Switch linter to ESLint +- Configure Prettier + +## Changelog for previous versions + +See `CHANGES` file diff --git a/node_modules/es6-symbol/CHANGES b/node_modules/es6-symbol/CHANGES new file mode 100644 index 0000000..ef0cbda --- /dev/null +++ b/node_modules/es6-symbol/CHANGES @@ -0,0 +1,61 @@ +For recent changelog see CHANGELOG.md + +----- + +v3.1.1 -- 2017.03.15 +* Improve documentation +* Improve error messages +* Update dependencies + +v3.1.0 -- 2016.06.03 +* Fix internals of symbol detection +* Ensure Symbol.prototype[Symbol.toPrimitive] in all cases returns primitive value + (fixes Node v6 support) +* Create native symbols whenver possible + +v3.0.2 -- 2015.12.12 +* Fix definition flow, so uneven state of Symbol implementation doesn't crash initialization of + polyfill. See #13 + +v3.0.1 -- 2015.10.22 +* Workaround for IE11 bug (reported in #12) + +v3.0.0 -- 2015.10.02 +* Reuse native symbols (e.g. iterator, toStringTag etc.) in a polyfill if they're available + Otherwise polyfill symbols may not be recognized by other functions +* Improve documentation + +v2.0.1 -- 2015.01.28 +* Fix Symbol.prototype[Symbol.isPrimitive] implementation +* Improve validation within Symbol.prototype.toString and + Symbol.prototype.valueOf + +v2.0.0 -- 2015.01.28 +* Update up to changes in specification: + * Implement `for` and `keyFor` + * Remove `Symbol.create` and `Symbol.isRegExp` + * Add `Symbol.match`, `Symbol.replace`, `Symbol.search`, `Symbol.species` and + `Symbol.split` +* Rename `validSymbol` to `validateSymbol` +* Improve documentation +* Remove dead test modules + +v1.0.0 -- 2015.01.26 +* Fix enumerability for symbol properties set normally (e.g. obj[symbol] = value) +* Introduce initialization via hidden constructor +* Fix isSymbol handling of polyfill values when native Symbol is present +* Fix spelling of LICENSE +* Configure lint scripts + +v0.1.1 -- 2014.10.07 +* Fix isImplemented, so it returns true in case of polyfill +* Improve documentations + +v0.1.0 -- 2014.04.28 +* Assure strictly npm dependencies +* Update to use latest versions of dependencies +* Fix implementation detection so it doesn't crash on `String(symbol)` +* throw on `new Symbol()` (as decided by TC39) + +v0.0.0 -- 2013.11.15 +* Initial (dev) version diff --git a/node_modules/es6-symbol/LICENSE b/node_modules/es6-symbol/LICENSE new file mode 100644 index 0000000..44745e2 --- /dev/null +++ b/node_modules/es6-symbol/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2013-2019, Mariusz Nowak, @medikoo, medikoo.com + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/es6-symbol/README.md b/node_modules/es6-symbol/README.md new file mode 100644 index 0000000..d247122 --- /dev/null +++ b/node_modules/es6-symbol/README.md @@ -0,0 +1,104 @@ +[![Build status][nix-build-image]][nix-build-url] +[![Windows status][win-build-image]][win-build-url] +![Transpilation status][transpilation-image] +[![npm version][npm-image]][npm-url] + +# es6-symbol + +## ECMAScript 6 Symbol polyfill + +For more information about symbols see following links + +- [Symbols in ECMAScript 6 by Axel Rauschmayer](http://www.2ality.com/2014/12/es6-symbols.html) +- [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) +- [Specification](https://tc39.github.io/ecma262/#sec-symbol-objects) + +### Limitations + +Underneath it uses real string property names which can easily be retrieved, however accidental collision with other property names is unlikely. + +### Usage + +If you'd like to use native version when it exists and fallback to [ponyfill](https://ponyfill.com) if it doesn't, use _es6-symbol_ as following: + +```javascript +var Symbol = require("es6-symbol"); +``` + +If you want to make sure your environment implements `Symbol` globally, do: + +```javascript +require("es6-symbol/implement"); +``` + +If you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do: + +```javascript +var Symbol = require("es6-symbol/polyfill"); +``` + +#### API + +Best is to refer to [specification](https://tc39.github.io/ecma262/#sec-symbol-objects). Still if you want quick look, follow examples: + +```javascript +var Symbol = require("es6-symbol"); + +var symbol = Symbol("My custom symbol"); +var x = {}; + +x[symbol] = "foo"; +console.log(x[symbol]); +("foo"); + +// Detect iterable: +var iterator, result; +if (possiblyIterable[Symbol.iterator]) { + iterator = possiblyIterable[Symbol.iterator](); + result = iterator.next(); + while (!result.done) { + console.log(result.value); + result = iterator.next(); + } +} +``` + +### Installation + +#### NPM + +In your project path: + + $ npm install es6-symbol + +##### Browser + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +## Tests + + $ npm test + +## Security contact information + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + +--- + +
+ + Get professional support for d with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +[nix-build-image]: https://semaphoreci.com/api/v1/medikoo-org/es6-symbol/branches/master/shields_badge.svg +[nix-build-url]: https://semaphoreci.com/medikoo-org/es6-symbol +[win-build-image]: https://ci.appveyor.com/api/projects/status/1s743lt3el278anj?svg=true +[win-build-url]: https://ci.appveyor.com/project/medikoo/es6-symbol +[transpilation-image]: https://img.shields.io/badge/transpilation-free-brightgreen.svg +[npm-image]: https://img.shields.io/npm/v/es6-symbol.svg +[npm-url]: https://www.npmjs.com/package/es6-symbol diff --git a/node_modules/es6-symbol/implement.js b/node_modules/es6-symbol/implement.js new file mode 100644 index 0000000..d62803b --- /dev/null +++ b/node_modules/es6-symbol/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(require("ext/global-this"), "Symbol", { + value: require("./polyfill"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es6-symbol/index.js b/node_modules/es6-symbol/index.js new file mode 100644 index 0000000..fcd8a63 --- /dev/null +++ b/node_modules/es6-symbol/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? require("ext/global-this").Symbol + : require("./polyfill"); diff --git a/node_modules/es6-symbol/is-implemented.js b/node_modules/es6-symbol/is-implemented.js new file mode 100644 index 0000000..b85ec69 --- /dev/null +++ b/node_modules/es6-symbol/is-implemented.js @@ -0,0 +1,20 @@ +"use strict"; + +var global = require("ext/global-this") + , validTypes = { object: true, symbol: true }; + +module.exports = function () { + var Symbol = global.Symbol; + var symbol; + if (typeof Symbol !== "function") return false; + symbol = Symbol("test symbol"); + try { String(symbol); } + catch (e) { return false; } + + // Return 'true' also for polyfills + if (!validTypes[typeof Symbol.iterator]) return false; + if (!validTypes[typeof Symbol.toPrimitive]) return false; + if (!validTypes[typeof Symbol.toStringTag]) return false; + + return true; +}; diff --git a/node_modules/es6-symbol/is-native-implemented.js b/node_modules/es6-symbol/is-native-implemented.js new file mode 100644 index 0000000..254774a --- /dev/null +++ b/node_modules/es6-symbol/is-native-implemented.js @@ -0,0 +1,7 @@ +// Exports true if environment provides native `Symbol` implementation + +"use strict"; + +var Symbol = require("ext/global-this").Symbol; + +module.exports = typeof Symbol === "function" && typeof Symbol() === "symbol"; diff --git a/node_modules/es6-symbol/is-symbol.js b/node_modules/es6-symbol/is-symbol.js new file mode 100644 index 0000000..66edd46 --- /dev/null +++ b/node_modules/es6-symbol/is-symbol.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (value) { + if (!value) return false; + if (typeof value === "symbol") return true; + if (!value.constructor) return false; + if (value.constructor.name !== "Symbol") return false; + return value[value.constructor.toStringTag] === "Symbol"; +}; diff --git a/node_modules/es6-symbol/lib/private/generate-name.js b/node_modules/es6-symbol/lib/private/generate-name.js new file mode 100644 index 0000000..0c16778 --- /dev/null +++ b/node_modules/es6-symbol/lib/private/generate-name.js @@ -0,0 +1,29 @@ +"use strict"; + +var d = require("d"); + +var create = Object.create, defineProperty = Object.defineProperty, objPrototype = Object.prototype; + +var created = create(null); +module.exports = function (desc) { + var postfix = 0, name, ie11BugWorkaround; + while (created[desc + (postfix || "")]) ++postfix; + desc += postfix || ""; + created[desc] = true; + name = "@@" + desc; + defineProperty( + objPrototype, + name, + d.gs(null, function (value) { + // For IE11 issue see: + // https://connect.microsoft.com/IE/feedbackdetail/view/1928508/ + // ie11-broken-getters-on-dom-objects + // https://github.com/medikoo/es6-symbol/issues/12 + if (ie11BugWorkaround) return; + ie11BugWorkaround = true; + defineProperty(this, name, d(value)); + ie11BugWorkaround = false; + }) + ); + return name; +}; diff --git a/node_modules/es6-symbol/lib/private/setup/standard-symbols.js b/node_modules/es6-symbol/lib/private/setup/standard-symbols.js new file mode 100644 index 0000000..b25b171 --- /dev/null +++ b/node_modules/es6-symbol/lib/private/setup/standard-symbols.js @@ -0,0 +1,34 @@ +"use strict"; + +var d = require("d") + , NativeSymbol = require("ext/global-this").Symbol; + +module.exports = function (SymbolPolyfill) { + return Object.defineProperties(SymbolPolyfill, { + // To ensure proper interoperability with other native functions (e.g. Array.from) + // fallback to eventual native implementation of given symbol + hasInstance: d( + "", (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill("hasInstance") + ), + isConcatSpreadable: d( + "", + (NativeSymbol && NativeSymbol.isConcatSpreadable) || + SymbolPolyfill("isConcatSpreadable") + ), + iterator: d("", (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill("iterator")), + match: d("", (NativeSymbol && NativeSymbol.match) || SymbolPolyfill("match")), + replace: d("", (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill("replace")), + search: d("", (NativeSymbol && NativeSymbol.search) || SymbolPolyfill("search")), + species: d("", (NativeSymbol && NativeSymbol.species) || SymbolPolyfill("species")), + split: d("", (NativeSymbol && NativeSymbol.split) || SymbolPolyfill("split")), + toPrimitive: d( + "", (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill("toPrimitive") + ), + toStringTag: d( + "", (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill("toStringTag") + ), + unscopables: d( + "", (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill("unscopables") + ) + }); +}; diff --git a/node_modules/es6-symbol/lib/private/setup/symbol-registry.js b/node_modules/es6-symbol/lib/private/setup/symbol-registry.js new file mode 100644 index 0000000..29d198f --- /dev/null +++ b/node_modules/es6-symbol/lib/private/setup/symbol-registry.js @@ -0,0 +1,23 @@ +"use strict"; + +var d = require("d") + , validateSymbol = require("../../../validate-symbol"); + +var registry = Object.create(null); + +module.exports = function (SymbolPolyfill) { + return Object.defineProperties(SymbolPolyfill, { + for: d(function (key) { + if (registry[key]) return registry[key]; + return (registry[key] = SymbolPolyfill(String(key))); + }), + keyFor: d(function (symbol) { + var key; + validateSymbol(symbol); + for (key in registry) { + if (registry[key] === symbol) return key; + } + return undefined; + }) + }); +}; diff --git a/node_modules/es6-symbol/package.json b/node_modules/es6-symbol/package.json new file mode 100644 index 0000000..38ae1a5 --- /dev/null +++ b/node_modules/es6-symbol/package.json @@ -0,0 +1,139 @@ +{ + "_from": "es6-symbol@^3.1.1", + "_id": "es6-symbol@3.1.3", + "_inBundle": false, + "_integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "_location": "/es6-symbol", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "es6-symbol@^3.1.1", + "name": "es6-symbol", + "escapedName": "es6-symbol", + "rawSpec": "^3.1.1", + "saveSpec": null, + "fetchSpec": "^3.1.1" + }, + "_requiredBy": [ + "/es5-ext", + "/es6-iterator", + "/es6-weak-map", + "/sver-compat" + ], + "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "_shasum": "bad5d3c1bcdac28269f4cb331e431c78ac705d18", + "_spec": "es6-symbol@^3.1.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/sver-compat", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/es6-symbol/issues" + }, + "bundleDependencies": false, + "dependencies": { + "d": "^1.0.1", + "ext": "^1.1.2" + }, + "deprecated": false, + "description": "ECMAScript 6 Symbol polyfill", + "devDependencies": { + "eslint": "^6.6.0", + "eslint-config-medikoo": "^2.6.0", + "git-list-updated": "^1.2.1", + "husky": "^3.0.9", + "lint-staged": "^9.4.2", + "prettier-elastic": "^1.18.2", + "tad": "^3.0.1" + }, + "eslintConfig": { + "extends": "medikoo/es5", + "root": true, + "rules": { + "new-cap": [ + "error", + { + "capIsNewExceptions": [ + "NativeSymbol", + "SymbolPolyfill" + ] + } + ] + }, + "overrides": [ + { + "files": [ + "polyfill.js" + ], + "rules": { + "func-names": "off" + } + }, + { + "files": [ + "test/*.js" + ], + "globals": { + "Symbol": true + } + } + ] + }, + "homepage": "https://github.com/medikoo/es6-symbol#readme", + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "keywords": [ + "symbol", + "private", + "property", + "es6", + "ecmascript", + "harmony", + "ponyfill", + "polyfill" + ], + "license": "ISC", + "lint-staged": { + "*.js": [ + "eslint" + ], + "*.{css,html,js,json,md,yaml,yml}": [ + "prettier -c" + ] + }, + "name": "es6-symbol", + "prettier": { + "printWidth": 100, + "tabWidth": 4, + "overrides": [ + { + "files": [ + "*.md" + ], + "options": { + "tabWidth": 2 + } + } + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es6-symbol.git" + }, + "scripts": { + "lint": "eslint --ignore-path=.gitignore .", + "lint:updated": "pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'", + "prettier-check": "prettier -c --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"", + "prettier-check:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c", + "prettify": "prettier --write --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"", + "prettify:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier --write", + "test": "tad" + }, + "version": "3.1.3" +} diff --git a/node_modules/es6-symbol/polyfill.js b/node_modules/es6-symbol/polyfill.js new file mode 100644 index 0000000..2dcc32b --- /dev/null +++ b/node_modules/es6-symbol/polyfill.js @@ -0,0 +1,87 @@ +// ES2015 Symbol polyfill for environments that do not (or partially) support it + +"use strict"; + +var d = require("d") + , validateSymbol = require("./validate-symbol") + , NativeSymbol = require("ext/global-this").Symbol + , generateName = require("./lib/private/generate-name") + , setupStandardSymbols = require("./lib/private/setup/standard-symbols") + , setupSymbolRegistry = require("./lib/private/setup/symbol-registry"); + +var create = Object.create + , defineProperties = Object.defineProperties + , defineProperty = Object.defineProperty; + +var SymbolPolyfill, HiddenSymbol, isNativeSafe; + +if (typeof NativeSymbol === "function") { + try { + String(NativeSymbol()); + isNativeSafe = true; + } catch (ignore) {} +} else { + NativeSymbol = null; +} + +// Internal constructor (not one exposed) for creating Symbol instances. +// This one is used to ensure that `someSymbol instanceof Symbol` always return false +HiddenSymbol = function Symbol(description) { + if (this instanceof HiddenSymbol) throw new TypeError("Symbol is not a constructor"); + return SymbolPolyfill(description); +}; + +// Exposed `Symbol` constructor +// (returns instances of HiddenSymbol) +module.exports = SymbolPolyfill = function Symbol(description) { + var symbol; + if (this instanceof Symbol) throw new TypeError("Symbol is not a constructor"); + if (isNativeSafe) return NativeSymbol(description); + symbol = create(HiddenSymbol.prototype); + description = description === undefined ? "" : String(description); + return defineProperties(symbol, { + __description__: d("", description), + __name__: d("", generateName(description)) + }); +}; + +setupStandardSymbols(SymbolPolyfill); +setupSymbolRegistry(SymbolPolyfill); + +// Internal tweaks for real symbol producer +defineProperties(HiddenSymbol.prototype, { + constructor: d(SymbolPolyfill), + toString: d("", function () { return this.__name__; }) +}); + +// Proper implementation of methods exposed on Symbol.prototype +// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype +defineProperties(SymbolPolyfill.prototype, { + toString: d(function () { return "Symbol (" + validateSymbol(this).__description__ + ")"; }), + valueOf: d(function () { return validateSymbol(this); }) +}); +defineProperty( + SymbolPolyfill.prototype, + SymbolPolyfill.toPrimitive, + d("", function () { + var symbol = validateSymbol(this); + if (typeof symbol === "symbol") return symbol; + return symbol.toString(); + }) +); +defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d("c", "Symbol")); + +// Proper implementaton of toPrimitive and toStringTag for returned symbol instances +defineProperty( + HiddenSymbol.prototype, SymbolPolyfill.toStringTag, + d("c", SymbolPolyfill.prototype[SymbolPolyfill.toStringTag]) +); + +// Note: It's important to define `toPrimitive` as last one, as some implementations +// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols) +// And that may invoke error in definition flow: +// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149 +defineProperty( + HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, + d("c", SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]) +); diff --git a/node_modules/es6-symbol/test/implement.js b/node_modules/es6-symbol/test/implement.js new file mode 100644 index 0000000..a661192 --- /dev/null +++ b/node_modules/es6-symbol/test/implement.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof Symbol, "function"); }; diff --git a/node_modules/es6-symbol/test/index.js b/node_modules/es6-symbol/test/index.js new file mode 100644 index 0000000..99b1b60 --- /dev/null +++ b/node_modules/es6-symbol/test/index.js @@ -0,0 +1,11 @@ +"use strict"; + +var d = require("d") + , defineProperty = Object.defineProperty; + +module.exports = function (t, a) { + var symbol = t("test"), obj = {}; + defineProperty(obj, symbol, d("foo")); + a(obj.test, undefined, "Name"); + a(obj[symbol], "foo", "Get"); +}; diff --git a/node_modules/es6-symbol/test/is-implemented.js b/node_modules/es6-symbol/test/is-implemented.js new file mode 100644 index 0000000..72b0682 --- /dev/null +++ b/node_modules/es6-symbol/test/is-implemented.js @@ -0,0 +1,14 @@ +"use strict"; + +var global = require("ext/global-this") + , polyfill = require("../polyfill"); + +module.exports = function (t, a) { + var cache; + a(typeof t(), "boolean"); + cache = global.Symbol; + global.Symbol = polyfill; + a(t(), true); + if (cache === undefined) delete global.Symbol; + else global.Symbol = cache; +}; diff --git a/node_modules/es6-symbol/test/is-native-implemented.js b/node_modules/es6-symbol/test/is-native-implemented.js new file mode 100644 index 0000000..124e59d --- /dev/null +++ b/node_modules/es6-symbol/test/is-native-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t, "boolean"); }; diff --git a/node_modules/es6-symbol/test/is-symbol.js b/node_modules/es6-symbol/test/is-symbol.js new file mode 100644 index 0000000..068e578 --- /dev/null +++ b/node_modules/es6-symbol/test/is-symbol.js @@ -0,0 +1,16 @@ +"use strict"; + +var SymbolPolyfill = require("../polyfill"); + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(true), false, "Primitive"); + a(t("raz"), false, "String"); + a(t({}), false, "Object"); + a(t([]), false, "Array"); + if (typeof Symbol !== "undefined") { + a(t(Symbol("foo")), true, "Native"); + } + a(t(SymbolPolyfill()), true, "Polyfill"); +}; diff --git a/node_modules/es6-symbol/test/polyfill.js b/node_modules/es6-symbol/test/polyfill.js new file mode 100644 index 0000000..3ae523e --- /dev/null +++ b/node_modules/es6-symbol/test/polyfill.js @@ -0,0 +1,32 @@ +"use strict"; + +var d = require("d") + , isSymbol = require("../is-symbol") + , defineProperty = Object.defineProperty; + +module.exports = function (t, a) { + var symbol = t("test"), obj = {}; + defineProperty(obj, symbol, d("foo")); + a(obj.test, undefined, "Name"); + a(obj[symbol], "foo", "Get"); + a(obj instanceof t, false); + + a(isSymbol(symbol), true, "Symbol"); + a(isSymbol(t.iterator), true, "iterator"); + a(isSymbol(t.toStringTag), true, "toStringTag"); + + obj = {}; + obj[symbol] = "foo"; + if (typeof symbol !== "symbol") { + a.deep(Object.getOwnPropertyDescriptor(obj, symbol), { + configurable: true, + enumerable: false, + value: "foo", + writable: true + }); + } + symbol = t.for("marko"); + a(isSymbol(symbol), true); + a(t.for("marko"), symbol); + a(t.keyFor(symbol), "marko"); +}; diff --git a/node_modules/es6-symbol/test/validate-symbol.js b/node_modules/es6-symbol/test/validate-symbol.js new file mode 100644 index 0000000..0a2e298 --- /dev/null +++ b/node_modules/es6-symbol/test/validate-symbol.js @@ -0,0 +1,19 @@ +"use strict"; + +var SymbolPolyfill = require("../polyfill"); + +module.exports = function (t, a) { + var symbol; + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a.throws(function () { t(true); }, TypeError, "Primitive"); + a.throws(function () { t("raz"); }, TypeError, "String"); + a.throws(function () { t({}); }, TypeError, "Object"); + a.throws(function () { t([]); }, TypeError, "Array"); + if (typeof Symbol !== "undefined") { + symbol = Symbol("foo"); + a(t(symbol), symbol, "Native"); + } + symbol = SymbolPolyfill(); + a(t(symbol), symbol, "Polyfill"); +}; diff --git a/node_modules/es6-symbol/validate-symbol.js b/node_modules/es6-symbol/validate-symbol.js new file mode 100644 index 0000000..bac6f54 --- /dev/null +++ b/node_modules/es6-symbol/validate-symbol.js @@ -0,0 +1,8 @@ +"use strict"; + +var isSymbol = require("./is-symbol"); + +module.exports = function (value) { + if (!isSymbol(value)) throw new TypeError(value + " is not a symbol"); + return value; +}; diff --git a/node_modules/es6-weak-map/.editorconfig b/node_modules/es6-weak-map/.editorconfig new file mode 100644 index 0000000..e1848c6 --- /dev/null +++ b/node_modules/es6-weak-map/.editorconfig @@ -0,0 +1,14 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +indent_style = tab + +[{*.json,*.yml}] +indent_style = space +indent_size = 2 \ No newline at end of file diff --git a/node_modules/es6-weak-map/CHANGELOG.md b/node_modules/es6-weak-map/CHANGELOG.md new file mode 100644 index 0000000..1f66f2b --- /dev/null +++ b/node_modules/es6-weak-map/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +### [2.0.3](https://github.com/medikoo/es6-weak-map/compare/v2.0.2...v2.0.3) (2019-06-07) diff --git a/node_modules/es6-weak-map/CHANGES b/node_modules/es6-weak-map/CHANGES new file mode 100644 index 0000000..7772891 --- /dev/null +++ b/node_modules/es6-weak-map/CHANGES @@ -0,0 +1,45 @@ +v2.0.2 -- 2017.03.15 +* Update dependencies + +v2.0.1 -- 2015.10.02 +* Update to use es6-symbol at v3 + +v2.0.0 -- 2015.09.04 +* Relax native implementation detection, stringification of instance should returm + expected result (not necesarily prototype) + +v1.0.2 -- 2015.05.07 +* Add "ponyfill" keyword to meta description. Fixes #7 + +v1.0.1 -- 2015.04.14 +* Fix isNativeImplemented, so it's not affected by #3619 V8 bug +* Fix internal prototype resolution, in case where isNativeImplemented was true, and + native implementation was shadowed it got into stack overflow + +v1.0.0 -- 2015.04.13 +* It's v0.1.3 republished as v1.0.0 + +v0.1.4 -- 2015.04.13 +* Republish v0.1.2 as v0.1.4 due to breaking changes + (v0.1.3 should have been published as next major) + +v0.1.3 -- 2015.04.12 +* Update up to changes in specification (require new, remove clear method) +* Improve native implementation validation +* Configure lint scripts +* Rename LICENCE to LICENSE + +v0.1.2 -- 2014.09.01 +* Use internal random and unique id generator instead of external (time-uuid based). + Global uniqueness is not needed in scope of this module. Fixes #1 + +v0.1.1 -- 2014.05.15 +* Improve valid WeakMap detection + +v0.1.0 -- 2014.04.29 +* Assure to depend only npm hosted dependencies +* Update to use latest versions of dependencies +* Use ES6 symbols internally + +v0.0.0 -- 2013.10.24 +Initial (dev version) diff --git a/node_modules/es6-weak-map/LICENSE b/node_modules/es6-weak-map/LICENSE new file mode 100644 index 0000000..923b7f6 --- /dev/null +++ b/node_modules/es6-weak-map/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2013-2018, Mariusz Nowak, @medikoo, medikoo.com + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/es6-weak-map/README.md b/node_modules/es6-weak-map/README.md new file mode 100644 index 0000000..2c9c375 --- /dev/null +++ b/node_modules/es6-weak-map/README.md @@ -0,0 +1,78 @@ +[![Build status][nix-build-image]][nix-build-url] +[![Windows status][win-build-image]][win-build-url] +![Transpilation status][transpilation-image] +[![npm version][npm-image]][npm-url] + +# es6-weak-map + +## WeakMap collection as specified in ECMAScript6 + +_Roughly inspired by Mark Miller's and Kris Kowal's [WeakMap implementation](https://github.com/drses/weak-map)_. + +Differences are: + +- Assumes compliant ES5 environment (no weird ES3 workarounds or hacks) +- Well modularized CJS style +- Based on one solution. + +### Limitations + +- Will fail on non extensible objects provided as keys + +### Installation + + $ npm install es6-weak-map + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +### Usage + +If you want to make sure your environment implements `WeakMap`, do: + +```javascript +require("es6-weak-map/implement"); +``` + +If you'd like to use native version when it exists and fallback to polyfill if it doesn't, but without implementing `WeakMap` on global scope, do: + +```javascript +var WeakMap = require("es6-weak-map"); +``` + +If you strictly want to use polyfill even if native `WeakMap` exists, do: + +```javascript +var WeakMap = require("es6-weak-map/polyfill"); +``` + +#### API + +Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-weakmap-objects). Still if you want quick look, follow example: + +```javascript +var WeakMap = require("es6-weak-map"); + +var map = new WeakMap(); +var obj = {}; + +map.set(obj, "foo"); // map +map.get(obj); // 'foo' +map.has(obj); // true +map.delete(obj); // true +map.get(obj); // undefined +map.has(obj); // false +map.set(obj, "bar"); // map +map.has(obj); // false +``` + +## Tests + + $ npm test + +[nix-build-image]: https://semaphoreci.com/api/v1/medikoo-org/es6-weak-map/branches/master/shields_badge.svg +[nix-build-url]: https://semaphoreci.com/medikoo-org/es6-weak-map +[win-build-image]: https://ci.appveyor.com/api/projects/status/1c73c57pg4s6lwmu?svg=true +[win-build-url]: https://ci.appveyor.com/project/medikoo/es6-weak-map +[transpilation-image]: https://img.shields.io/badge/transpilation-free-brightgreen.svg +[npm-image]: https://img.shields.io/npm/v/es6-weak-map.svg +[npm-url]: https://www.npmjs.com/package/es6-weak-map diff --git a/node_modules/es6-weak-map/implement.js b/node_modules/es6-weak-map/implement.js new file mode 100644 index 0000000..1bca669 --- /dev/null +++ b/node_modules/es6-weak-map/implement.js @@ -0,0 +1,11 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(require("es5-ext/global"), "WeakMap", + { + value: require("./polyfill"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/es6-weak-map/index.js b/node_modules/es6-weak-map/index.js new file mode 100644 index 0000000..c1a0c6b --- /dev/null +++ b/node_modules/es6-weak-map/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? WeakMap : require("./polyfill"); diff --git a/node_modules/es6-weak-map/is-implemented.js b/node_modules/es6-weak-map/is-implemented.js new file mode 100644 index 0000000..cf03fd8 --- /dev/null +++ b/node_modules/es6-weak-map/is-implemented.js @@ -0,0 +1,21 @@ +"use strict"; + +module.exports = function () { + var weakMap, obj; + + if (typeof WeakMap !== "function") return false; + try { + // WebKit doesn't support arguments and crashes + weakMap = new WeakMap([[obj = {}, "one"], [{}, "two"], [{}, "three"]]); + } catch (e) { + return false; + } + if (String(weakMap) !== "[object WeakMap]") return false; + if (typeof weakMap.set !== "function") return false; + if (weakMap.set({}, 1) !== weakMap) return false; + if (typeof weakMap.delete !== "function") return false; + if (typeof weakMap.has !== "function") return false; + if (weakMap.get(obj) !== "one") return false; + + return true; +}; diff --git a/node_modules/es6-weak-map/is-native-implemented.js b/node_modules/es6-weak-map/is-native-implemented.js new file mode 100644 index 0000000..372e929 --- /dev/null +++ b/node_modules/es6-weak-map/is-native-implemented.js @@ -0,0 +1,8 @@ +// Exports true if environment provides native `WeakMap` implementation, whatever that is. + +"use strict"; + +module.exports = (function () { + if (typeof WeakMap !== "function") return false; + return Object.prototype.toString.call(new WeakMap()) === "[object WeakMap]"; +}()); diff --git a/node_modules/es6-weak-map/is-weak-map.js b/node_modules/es6-weak-map/is-weak-map.js new file mode 100644 index 0000000..007408f --- /dev/null +++ b/node_modules/es6-weak-map/is-weak-map.js @@ -0,0 +1,13 @@ +"use strict"; + +var toStringTagSymbol = require("es6-symbol").toStringTag + + , objToString = Object.prototype.toString + , id = "[object WeakMap]" + , Global = typeof WeakMap === "undefined" ? null : WeakMap; + +module.exports = function (value) { + return (value && ((Global && (value instanceof Global)) || + (objToString.call(value) === id) || (value[toStringTagSymbol] === "WeakMap"))) || + false; +}; diff --git a/node_modules/es6-weak-map/package.json b/node_modules/es6-weak-map/package.json new file mode 100644 index 0000000..20d004c --- /dev/null +++ b/node_modules/es6-weak-map/package.json @@ -0,0 +1,78 @@ +{ + "_from": "es6-weak-map@^2.0.1", + "_id": "es6-weak-map@2.0.3", + "_inBundle": false, + "_integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "_location": "/es6-weak-map", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "es6-weak-map@^2.0.1", + "name": "es6-weak-map", + "escapedName": "es6-weak-map", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/last-run", + "/undertaker" + ], + "_resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "_shasum": "b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53", + "_spec": "es6-weak-map@^2.0.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/undertaker", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/es6-weak-map/issues" + }, + "bundleDependencies": false, + "dependencies": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + }, + "deprecated": false, + "description": "ECMAScript6 WeakMap polyfill", + "devDependencies": { + "eslint": "^5.5", + "eslint-config-medikoo-es5": "^1.7", + "tad": "^0.2.8" + }, + "eslintConfig": { + "extends": "medikoo-es5", + "root": true, + "globals": { + "WeakMap": true + } + }, + "homepage": "https://github.com/medikoo/es6-weak-map#readme", + "keywords": [ + "map", + "weakmap", + "collection", + "es6", + "harmony", + "list", + "hash", + "gc", + "ponyfill" + ], + "license": "ISC", + "name": "es6-weak-map", + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es6-weak-map.git" + }, + "scripts": { + "lint": "eslint --ignore-path=.gitignore .", + "test": "node ./node_modules/tad/bin/tad" + }, + "version": "2.0.3" +} diff --git a/node_modules/es6-weak-map/polyfill.js b/node_modules/es6-weak-map/polyfill.js new file mode 100644 index 0000000..95e7390 --- /dev/null +++ b/node_modules/es6-weak-map/polyfill.js @@ -0,0 +1,65 @@ +"use strict"; + +var isValue = require("es5-ext/object/is-value") + , setPrototypeOf = require("es5-ext/object/set-prototype-of") + , object = require("es5-ext/object/valid-object") + , ensureValue = require("es5-ext/object/valid-value") + , randomUniq = require("es5-ext/string/random-uniq") + , d = require("d") + , getIterator = require("es6-iterator/get") + , forOf = require("es6-iterator/for-of") + , toStringTagSymbol = require("es6-symbol").toStringTag + , isNative = require("./is-native-implemented") + + , isArray = Array.isArray, defineProperty = Object.defineProperty + , objHasOwnProperty = Object.prototype.hasOwnProperty, getPrototypeOf = Object.getPrototypeOf + , WeakMapPoly; + +module.exports = WeakMapPoly = function (/* Iterable*/) { + var iterable = arguments[0], self; + + if (!(this instanceof WeakMapPoly)) throw new TypeError("Constructor requires 'new'"); + self = isNative && setPrototypeOf && (WeakMap !== WeakMapPoly) + ? setPrototypeOf(new WeakMap(), getPrototypeOf(this)) : this; + + if (isValue(iterable)) { + if (!isArray(iterable)) iterable = getIterator(iterable); + } + defineProperty(self, "__weakMapData__", d("c", "$weakMap$" + randomUniq())); + if (!iterable) return self; + forOf(iterable, function (val) { + ensureValue(val); + self.set(val[0], val[1]); + }); + return self; +}; + +if (isNative) { + if (setPrototypeOf) setPrototypeOf(WeakMapPoly, WeakMap); + WeakMapPoly.prototype = Object.create(WeakMap.prototype, { constructor: d(WeakMapPoly) }); +} + +Object.defineProperties(WeakMapPoly.prototype, { + delete: d(function (key) { + if (objHasOwnProperty.call(object(key), this.__weakMapData__)) { + delete key[this.__weakMapData__]; + return true; + } + return false; + }), + get: d(function (key) { + if (!objHasOwnProperty.call(object(key), this.__weakMapData__)) return undefined; + return key[this.__weakMapData__]; + }), + has: d(function (key) { + return objHasOwnProperty.call(object(key), this.__weakMapData__); + }), + set: d(function (key, value) { + defineProperty(object(key), this.__weakMapData__, d("c", value)); + return this; + }), + toString: d(function () { + return "[object WeakMap]"; + }) +}); +defineProperty(WeakMapPoly.prototype, toStringTagSymbol, d("c", "WeakMap")); diff --git a/node_modules/es6-weak-map/test/implement.js b/node_modules/es6-weak-map/test/implement.js new file mode 100644 index 0000000..e64af3e --- /dev/null +++ b/node_modules/es6-weak-map/test/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof WeakMap, "function"); +}; diff --git a/node_modules/es6-weak-map/test/index.js b/node_modules/es6-weak-map/test/index.js new file mode 100644 index 0000000..418b514 --- /dev/null +++ b/node_modules/es6-weak-map/test/index.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (T, a) { + var obj = {}; + + a((new T([[obj, "foo"]])).get(obj), "foo"); +}; diff --git a/node_modules/es6-weak-map/test/is-implemented.js b/node_modules/es6-weak-map/test/is-implemented.js new file mode 100644 index 0000000..fa7f7b9 --- /dev/null +++ b/node_modules/es6-weak-map/test/is-implemented.js @@ -0,0 +1,15 @@ +"use strict"; + +var globalObj = require("es5-ext/global") + , polyfill = require("../polyfill"); + +module.exports = function (t, a) { + var cache; + + a(typeof t(), "boolean"); + cache = globalObj.WeakMap; + globalObj.WeakMap = polyfill; + a(t(), true); + if (cache === undefined) delete globalObj.WeakMap; + else globalObj.WeakMap = cache; +}; diff --git a/node_modules/es6-weak-map/test/is-native-implemented.js b/node_modules/es6-weak-map/test/is-native-implemented.js new file mode 100644 index 0000000..8788186 --- /dev/null +++ b/node_modules/es6-weak-map/test/is-native-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t, "boolean"); +}; diff --git a/node_modules/es6-weak-map/test/is-weak-map.js b/node_modules/es6-weak-map/test/is-weak-map.js new file mode 100644 index 0000000..e73c839 --- /dev/null +++ b/node_modules/es6-weak-map/test/is-weak-map.js @@ -0,0 +1,16 @@ +"use strict"; + +var WeakMapPoly = require("../polyfill"); + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(true), false, "Primitive"); + a(t("raz"), false, "String"); + a(t({}), false, "Object"); + a(t([]), false, "Array"); + if (typeof WeakMap !== "undefined") { + a(t(new WeakMap()), true, "Native"); + } + a(t(new WeakMapPoly()), true, "Polyfill"); +}; diff --git a/node_modules/es6-weak-map/test/polyfill.js b/node_modules/es6-weak-map/test/polyfill.js new file mode 100644 index 0000000..9275b46 --- /dev/null +++ b/node_modules/es6-weak-map/test/polyfill.js @@ -0,0 +1,23 @@ +"use strict"; + +module.exports = function (T, a) { + var obj1 = {}, obj2 = {}, obj3 = {}, arr = [[obj1, "raz"], [obj2, "dwa"]], map = new T(arr); + + a(map instanceof T, true, "WeakMap"); + a(map.has(obj1), true, "Has: true"); + a(map.get(obj1), "raz", "Get: contains"); + a(map.has(obj3), false, "Has: false"); + a(map.get(obj3), undefined, "Get: doesn't contain"); + a(map.set(obj3, "trzy"), map, "Set: return"); + a(map.has(obj3), true, "Add"); + a(map.delete({}), false, "Delete: false"); + + a(map.delete(obj1), true, "Delete: true"); + a(map.get(obj1), undefined, "Get: after delete"); + a(map.has(obj1), false, "Has: after delete"); + + a.h1("Empty initialization"); + map = new T(); + map.set(obj1, "bar"); + a(map.get(obj1), "bar"); +}; diff --git a/node_modules/es6-weak-map/test/valid-weak-map.js b/node_modules/es6-weak-map/test/valid-weak-map.js new file mode 100644 index 0000000..6e5da2c --- /dev/null +++ b/node_modules/es6-weak-map/test/valid-weak-map.js @@ -0,0 +1,32 @@ +"use strict"; + +var WeakMapPoly = require("../polyfill"); + +module.exports = function (t, a) { + var map; + + a.throws(function () { + t(undefined); + }, TypeError, "Undefined"); + a.throws(function () { + t(null); + }, TypeError, "Null"); + a.throws(function () { + t(true); + }, TypeError, "Primitive"); + a.throws(function () { + t("raz"); + }, TypeError, "String"); + a.throws(function () { + t({}); + }, TypeError, "Object"); + a.throws(function () { + t([]); + }, TypeError, "Array"); + if (typeof WeakMap !== "undefined") { + map = new WeakMap(); + a(t(map), map, "Native"); + } + map = new WeakMapPoly(); + a(t(map), map, "Polyfill"); +}; diff --git a/node_modules/es6-weak-map/valid-weak-map.js b/node_modules/es6-weak-map/valid-weak-map.js new file mode 100644 index 0000000..ad2f9f3 --- /dev/null +++ b/node_modules/es6-weak-map/valid-weak-map.js @@ -0,0 +1,8 @@ +"use strict"; + +var isWeakMap = require("./is-weak-map"); + +module.exports = function (value) { + if (!isWeakMap(value)) throw new TypeError(value + " is not a WeakMap"); + return value; +}; diff --git a/node_modules/escape-string-regexp/index.js b/node_modules/escape-string-regexp/index.js new file mode 100644 index 0000000..7834bf9 --- /dev/null +++ b/node_modules/escape-string-regexp/index.js @@ -0,0 +1,11 @@ +'use strict'; + +var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; + +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return str.replace(matchOperatorsRe, '\\$&'); +}; diff --git a/node_modules/escape-string-regexp/license b/node_modules/escape-string-regexp/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/escape-string-regexp/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/escape-string-regexp/package.json b/node_modules/escape-string-regexp/package.json new file mode 100644 index 0000000..bfad4a8 --- /dev/null +++ b/node_modules/escape-string-regexp/package.json @@ -0,0 +1,81 @@ +{ + "_from": "escape-string-regexp@^1.0.5", + "_id": "escape-string-regexp@1.0.5", + "_inBundle": false, + "_integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "_location": "/escape-string-regexp", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "escape-string-regexp@^1.0.5", + "name": "escape-string-regexp", + "escapedName": "escape-string-regexp", + "rawSpec": "^1.0.5", + "saveSpec": null, + "fetchSpec": "^1.0.5" + }, + "_requiredBy": [ + "/chalk" + ], + "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "_shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", + "_spec": "escape-string-regexp@^1.0.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/escape-string-regexp/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Escape RegExp special characters", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=0.8.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/escape-string-regexp#readme", + "keywords": [ + "escape", + "regex", + "regexp", + "re", + "regular", + "expression", + "string", + "str", + "special", + "characters" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Boy Nicolai Appelman", + "email": "joshua@jbna.nl", + "url": "jbna.nl" + } + ], + "name": "escape-string-regexp", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/escape-string-regexp.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.5" +} diff --git a/node_modules/escape-string-regexp/readme.md b/node_modules/escape-string-regexp/readme.md new file mode 100644 index 0000000..87ac82d --- /dev/null +++ b/node_modules/escape-string-regexp/readme.md @@ -0,0 +1,27 @@ +# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) + +> Escape RegExp special characters + + +## Install + +``` +$ npm install --save escape-string-regexp +``` + + +## Usage + +```js +const escapeStringRegexp = require('escape-string-regexp'); + +const escapedString = escapeStringRegexp('how much $ for a unicorn?'); +//=> 'how much \$ for a unicorn\?' + +new RegExp(escapedString); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint-scope/CHANGELOG.md b/node_modules/eslint-scope/CHANGELOG.md new file mode 100644 index 0000000..667d1c3 --- /dev/null +++ b/node_modules/eslint-scope/CHANGELOG.md @@ -0,0 +1,55 @@ +v4.0.3 - March 15, 2019 + +* [`299df64`](https://github.com/eslint/eslint-scope/commit/299df64bdafb30b4d9372e4b7af0cf51a3818c4a) Fix: arrow function scope strictness (take 2) (#52) (futpib) + +v4.0.2 - March 1, 2019 + +* [`c925600`](https://github.com/eslint/eslint-scope/commit/c925600a684ae0f71b96f85339437a43b4d50d99) Revert "Fix: Arrow function scope strictness (fixes #49) (#50)" (#51) (Teddy Katz) + +v4.0.1 - March 1, 2019 + +* [`2533966`](https://github.com/eslint/eslint-scope/commit/2533966faf317df5a3847fab937ba462c16808b8) Fix: Arrow function scope strictness (fixes #49) (#50) (futpib) +* [`0cbeea5`](https://github.com/eslint/eslint-scope/commit/0cbeea51dfb66ab88ea34b0e3b4ad5e6cc210f2f) Chore: add supported Node.js versions to CI (#47) (Kai Cataldo) +* [`b423057`](https://github.com/eslint/eslint-scope/commit/b42305760638b8edf4667acf1445e450869bd983) Upgrade: eslint-release@1.0.0 (#46) (Teddy Katz) + +v4.0.0 - June 21, 2018 + + + +v4.0.0-rc.0 - June 9, 2018 + +* 3b919b8 Build: Adding rc release script to package.json (#38) (Kevin Partington) +* 137732a Chore: avoid creating package-lock.json files (#37) (Teddy Katz) + +v4.0.0-alpha.0 - April 27, 2018 + +* 7cc3769 Upgrade: eslint-release ^0.11.1 (#36) (Teddy Katz) +* c9f6967 Breaking: remove TDZScope (refs eslint/eslint#10245) (#35) (Toru Nagashima) +* 982a71f Fix: wrong resolution about default parameters (#33) (Toru Nagashima) +* 57889f1 Docs: Remove extra header line from LICENSE (#32) (Gyandeep Singh) + +v3.7.1 - April 12, 2017 + +* ced6262 Fix: restore previous Scope API exports from escope (#31) (Vitor Balocco) +* 5c3d966 Fix: Remove and Modify tests that contain invalid ES6 syntax (#29) (Reyad Attiyat) + +v3.7.0 - March 17, 2017 + +* 9e27835 Chore: Add files section to package.json (#24) (Ilya Volodin) +* 3e4d123 Upgrade: eslint-config-eslint to 4.0.0 (#21) (Teddy Katz) +* 38c50fb Chore: Rename src to lib and test to tests (#20) (Corbin Uselton) +* f4cd920 Chore: Remove esprima (#19) (Corbin Uselton) +* f81fad5 Revert "Chore: Remove esprima" (#18) (James Henry) +* 31b0085 Chore: Remove es6-map and es6-weakmap as they are included in node4 (#10) (#13) (Corbin Uselton) +* 12a1ca1 Add Makefile.js and eslint (#15) (Reyad Attiyat) +* 7d23f8e Chore: Remove es6-map and es6-weakmap as they are included in node4 (#10) (Corbin Uselton) +* 019441e Chore: Convert to ES6 that is supported on Node 4, commonjs modules and remove Babel (#14) (Corbin Uselton) +* c647f65 Update: Add check for node.body in referencer (#2) (Corbin Uselton) +* eb5c9db Remove browserify and jsdoc (#12) (Corbin Uselton) +* cf38df0 Chore: Update README.md (#3) (James Henry) +* 8a142ca Chore: Add eslint-release scripts (#6) (James Henry) +* e60d8cb Chore: Remove unused bower.json (#5) (James Henry) +* 049c545 Chore: Fix tests for eslint-scope (#4) (James Henry) +* f026aab Chore: Update package.json for eslint fork (#1) (James Henry) +* a94d281 Chore: Update license with JSF copyright (Nicholas C. Zakas) + diff --git a/node_modules/eslint-scope/LICENSE b/node_modules/eslint-scope/LICENSE new file mode 100644 index 0000000..d36a526 --- /dev/null +++ b/node_modules/eslint-scope/LICENSE @@ -0,0 +1,22 @@ +Copyright JS Foundation and other contributors, https://js.foundation +Copyright (C) 2012-2013 Yusuke Suzuki (twitter: @Constellation) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/eslint-scope/README.md b/node_modules/eslint-scope/README.md new file mode 100644 index 0000000..7e7ce0d --- /dev/null +++ b/node_modules/eslint-scope/README.md @@ -0,0 +1,54 @@ +# ESLint Scope + +ESLint Scope is the [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) scope analyzer used in ESLint. It is a fork of [escope](http://github.com/estools/escope). + +## Usage + +Install: + +``` +npm i eslint-scope --save +``` + +Example: + +```js +var eslintScope = require('eslint-scope'); +var espree = require('espree'); +var estraverse = require('estraverse'); + +var ast = espree.parse(code); +var scopeManager = eslintScope.analyze(ast); + +var currentScope = scopeManager.acquire(ast); // global scope + +estraverse.traverse(ast, { + enter: function(node, parent) { + // do stuff + + if (/Function/.test(node.type)) { + currentScope = scopeManager.acquire(node); // get current function scope + } + }, + leave: function(node, parent) { + if (/Function/.test(node.type)) { + currentScope = currentScope.upper; // set to parent scope + } + + // do stuff + } +}); +``` + +## Contributing + +Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/eslint-scope/issues). + +## Build Commands + +* `npm test` - run all linting and tests +* `npm run lint` - run all linting + +## License + +ESLint Scope is licensed under a permissive BSD 2-clause license. diff --git a/node_modules/eslint-scope/lib/definition.js b/node_modules/eslint-scope/lib/definition.js new file mode 100644 index 0000000..172bfe2 --- /dev/null +++ b/node_modules/eslint-scope/lib/definition.js @@ -0,0 +1,86 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +const Variable = require("./variable"); + +/** + * @class Definition + */ +class Definition { + constructor(type, name, node, parent, index, kind) { + + /** + * @member {String} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...). + */ + this.type = type; + + /** + * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence. + */ + this.name = name; + + /** + * @member {espree.Node} Definition#node - the enclosing node of the identifier. + */ + this.node = node; + + /** + * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier. + */ + this.parent = parent; + + /** + * @member {Number?} Definition#index - the index in the declaration statement. + */ + this.index = index; + + /** + * @member {String?} Definition#kind - the kind of the declaration statement. + */ + this.kind = kind; + } +} + +/** + * @class ParameterDefinition + */ +class ParameterDefinition extends Definition { + constructor(name, node, index, rest) { + super(Variable.Parameter, name, node, null, index, null); + + /** + * Whether the parameter definition is a part of a rest parameter. + * @member {boolean} ParameterDefinition#rest + */ + this.rest = rest; + } +} + +module.exports = { + ParameterDefinition, + Definition +}; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/index.js b/node_modules/eslint-scope/lib/index.js new file mode 100644 index 0000000..f48252f --- /dev/null +++ b/node_modules/eslint-scope/lib/index.js @@ -0,0 +1,165 @@ +/* + Copyright (C) 2012-2014 Yusuke Suzuki + Copyright (C) 2013 Alex Seville + Copyright (C) 2014 Thiago de Arruda + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * Escope (escope) is an ECMAScript + * scope analyzer extracted from the esmangle project. + *

+ * escope finds lexical scopes in a source program, i.e. areas of that + * program where different occurrences of the same identifier refer to the same + * variable. With each scope the contained variables are collected, and each + * identifier reference in code is linked to its corresponding variable (if + * possible). + *

+ * escope works on a syntax tree of the parsed source code which has + * to adhere to the + * Mozilla Parser API. E.g. espree is a parser + * that produces such syntax trees. + *

+ * The main interface is the {@link analyze} function. + * @module escope + */ +"use strict"; + +/* eslint no-underscore-dangle: ["error", { "allow": ["__currentScope"] }] */ + +const assert = require("assert"); + +const ScopeManager = require("./scope-manager"); +const Referencer = require("./referencer"); +const Reference = require("./reference"); +const Variable = require("./variable"); +const Scope = require("./scope").Scope; +const version = require("../package.json").version; + +/** + * Set the default options + * @returns {Object} options + */ +function defaultOptions() { + return { + optimistic: false, + directive: false, + nodejsScope: false, + impliedStrict: false, + sourceType: "script", // one of ['script', 'module'] + ecmaVersion: 5, + childVisitorKeys: null, + fallback: "iteration" + }; +} + +/** + * Preform deep update on option object + * @param {Object} target - Options + * @param {Object} override - Updates + * @returns {Object} Updated options + */ +function updateDeeply(target, override) { + + /** + * Is hash object + * @param {Object} value - Test value + * @returns {boolean} Result + */ + function isHashObject(value) { + return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp); + } + + for (const key in override) { + if (override.hasOwnProperty(key)) { + const val = override[key]; + + if (isHashObject(val)) { + if (isHashObject(target[key])) { + updateDeeply(target[key], val); + } else { + target[key] = updateDeeply({}, val); + } + } else { + target[key] = val; + } + } + } + return target; +} + +/** + * Main interface function. Takes an Espree syntax tree and returns the + * analyzed scopes. + * @function analyze + * @param {espree.Tree} tree - Abstract Syntax Tree + * @param {Object} providedOptions - Options that tailor the scope analysis + * @param {boolean} [providedOptions.optimistic=false] - the optimistic flag + * @param {boolean} [providedOptions.directive=false]- the directive flag + * @param {boolean} [providedOptions.ignoreEval=false]- whether to check 'eval()' calls + * @param {boolean} [providedOptions.nodejsScope=false]- whether the whole + * script is executed under node.js environment. When enabled, escope adds + * a function scope immediately following the global scope. + * @param {boolean} [providedOptions.impliedStrict=false]- implied strict mode + * (if ecmaVersion >= 5). + * @param {string} [providedOptions.sourceType='script']- the source type of the script. one of 'script' and 'module' + * @param {number} [providedOptions.ecmaVersion=5]- which ECMAScript version is considered + * @param {Object} [providedOptions.childVisitorKeys=null] - Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option. + * @param {string} [providedOptions.fallback='iteration'] - A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option. + * @returns {ScopeManager} ScopeManager + */ +function analyze(tree, providedOptions) { + const options = updateDeeply(defaultOptions(), providedOptions); + const scopeManager = new ScopeManager(options); + const referencer = new Referencer(options, scopeManager); + + referencer.visit(tree); + + assert(scopeManager.__currentScope === null, "currentScope should be null."); + + return scopeManager; +} + +module.exports = { + + /** @name module:escope.version */ + version, + + /** @name module:escope.Reference */ + Reference, + + /** @name module:escope.Variable */ + Variable, + + /** @name module:escope.Scope */ + Scope, + + /** @name module:escope.ScopeManager */ + ScopeManager, + analyze +}; + + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/pattern-visitor.js b/node_modules/eslint-scope/lib/pattern-visitor.js new file mode 100644 index 0000000..afa6291 --- /dev/null +++ b/node_modules/eslint-scope/lib/pattern-visitor.js @@ -0,0 +1,152 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +/* eslint-disable no-undefined */ + +const Syntax = require("estraverse").Syntax; +const esrecurse = require("esrecurse"); + +/** + * Get last array element + * @param {array} xs - array + * @returns {any} Last elment + */ +function getLast(xs) { + return xs[xs.length - 1] || null; +} + +class PatternVisitor extends esrecurse.Visitor { + static isPattern(node) { + const nodeType = node.type; + + return ( + nodeType === Syntax.Identifier || + nodeType === Syntax.ObjectPattern || + nodeType === Syntax.ArrayPattern || + nodeType === Syntax.SpreadElement || + nodeType === Syntax.RestElement || + nodeType === Syntax.AssignmentPattern + ); + } + + constructor(options, rootPattern, callback) { + super(null, options); + this.rootPattern = rootPattern; + this.callback = callback; + this.assignments = []; + this.rightHandNodes = []; + this.restElements = []; + } + + Identifier(pattern) { + const lastRestElement = getLast(this.restElements); + + this.callback(pattern, { + topLevel: pattern === this.rootPattern, + rest: lastRestElement !== null && lastRestElement !== undefined && lastRestElement.argument === pattern, + assignments: this.assignments + }); + } + + Property(property) { + + // Computed property's key is a right hand node. + if (property.computed) { + this.rightHandNodes.push(property.key); + } + + // If it's shorthand, its key is same as its value. + // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern). + // If it's not shorthand, the name of new variable is its value's. + this.visit(property.value); + } + + ArrayPattern(pattern) { + for (let i = 0, iz = pattern.elements.length; i < iz; ++i) { + const element = pattern.elements[i]; + + this.visit(element); + } + } + + AssignmentPattern(pattern) { + this.assignments.push(pattern); + this.visit(pattern.left); + this.rightHandNodes.push(pattern.right); + this.assignments.pop(); + } + + RestElement(pattern) { + this.restElements.push(pattern); + this.visit(pattern.argument); + this.restElements.pop(); + } + + MemberExpression(node) { + + // Computed property's key is a right hand node. + if (node.computed) { + this.rightHandNodes.push(node.property); + } + + // the object is only read, write to its property. + this.rightHandNodes.push(node.object); + } + + // + // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression. + // By spec, LeftHandSideExpression is Pattern or MemberExpression. + // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758) + // But espree 2.0 parses to ArrayExpression, ObjectExpression, etc... + // + + SpreadElement(node) { + this.visit(node.argument); + } + + ArrayExpression(node) { + node.elements.forEach(this.visit, this); + } + + AssignmentExpression(node) { + this.assignments.push(node); + this.visit(node.left); + this.rightHandNodes.push(node.right); + this.assignments.pop(); + } + + CallExpression(node) { + + // arguments are right hand nodes. + node.arguments.forEach(a => { + this.rightHandNodes.push(a); + }); + this.visit(node.callee); + } +} + +module.exports = PatternVisitor; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/reference.js b/node_modules/eslint-scope/lib/reference.js new file mode 100644 index 0000000..9529827 --- /dev/null +++ b/node_modules/eslint-scope/lib/reference.js @@ -0,0 +1,167 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +const READ = 0x1; +const WRITE = 0x2; +const RW = READ | WRITE; + +/** + * A Reference represents a single occurrence of an identifier in code. + * @class Reference + */ +class Reference { + constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) { + + /** + * Identifier syntax node. + * @member {espreeIdentifier} Reference#identifier + */ + this.identifier = ident; + + /** + * Reference to the enclosing Scope. + * @member {Scope} Reference#from + */ + this.from = scope; + + /** + * Whether the reference comes from a dynamic scope (such as 'eval', + * 'with', etc.), and may be trapped by dynamic scopes. + * @member {boolean} Reference#tainted + */ + this.tainted = false; + + /** + * The variable this reference is resolved with. + * @member {Variable} Reference#resolved + */ + this.resolved = null; + + /** + * The read-write mode of the reference. (Value is one of {@link + * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}). + * @member {number} Reference#flag + * @private + */ + this.flag = flag; + if (this.isWrite()) { + + /** + * If reference is writeable, this is the tree being written to it. + * @member {espreeNode} Reference#writeExpr + */ + this.writeExpr = writeExpr; + + /** + * Whether the Reference might refer to a partial value of writeExpr. + * @member {boolean} Reference#partial + */ + this.partial = partial; + + /** + * Whether the Reference is to write of initialization. + * @member {boolean} Reference#init + */ + this.init = init; + } + this.__maybeImplicitGlobal = maybeImplicitGlobal; + } + + /** + * Whether the reference is static. + * @method Reference#isStatic + * @returns {boolean} static + */ + isStatic() { + return !this.tainted && this.resolved && this.resolved.scope.isStatic(); + } + + /** + * Whether the reference is writeable. + * @method Reference#isWrite + * @returns {boolean} write + */ + isWrite() { + return !!(this.flag & Reference.WRITE); + } + + /** + * Whether the reference is readable. + * @method Reference#isRead + * @returns {boolean} read + */ + isRead() { + return !!(this.flag & Reference.READ); + } + + /** + * Whether the reference is read-only. + * @method Reference#isReadOnly + * @returns {boolean} read only + */ + isReadOnly() { + return this.flag === Reference.READ; + } + + /** + * Whether the reference is write-only. + * @method Reference#isWriteOnly + * @returns {boolean} write only + */ + isWriteOnly() { + return this.flag === Reference.WRITE; + } + + /** + * Whether the reference is read-write. + * @method Reference#isReadWrite + * @returns {boolean} read write + */ + isReadWrite() { + return this.flag === Reference.RW; + } +} + +/** + * @constant Reference.READ + * @private + */ +Reference.READ = READ; + +/** + * @constant Reference.WRITE + * @private + */ +Reference.WRITE = WRITE; + +/** + * @constant Reference.RW + * @private + */ +Reference.RW = RW; + +module.exports = Reference; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/referencer.js b/node_modules/eslint-scope/lib/referencer.js new file mode 100644 index 0000000..55d0223 --- /dev/null +++ b/node_modules/eslint-scope/lib/referencer.js @@ -0,0 +1,612 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +/* eslint-disable no-underscore-dangle */ +/* eslint-disable no-undefined */ + +const Syntax = require("estraverse").Syntax; +const esrecurse = require("esrecurse"); +const Reference = require("./reference"); +const Variable = require("./variable"); +const PatternVisitor = require("./pattern-visitor"); +const definition = require("./definition"); +const assert = require("assert"); + +const ParameterDefinition = definition.ParameterDefinition; +const Definition = definition.Definition; + +/** + * Traverse identifier in pattern + * @param {Object} options - options + * @param {pattern} rootPattern - root pattern + * @param {Refencer} referencer - referencer + * @param {callback} callback - callback + * @returns {void} + */ +function traverseIdentifierInPattern(options, rootPattern, referencer, callback) { + + // Call the callback at left hand identifier nodes, and Collect right hand nodes. + const visitor = new PatternVisitor(options, rootPattern, callback); + + visitor.visit(rootPattern); + + // Process the right hand nodes recursively. + if (referencer !== null && referencer !== undefined) { + visitor.rightHandNodes.forEach(referencer.visit, referencer); + } +} + +// Importing ImportDeclaration. +// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation +// https://github.com/estree/estree/blob/master/es6.md#importdeclaration +// FIXME: Now, we don't create module environment, because the context is +// implementation dependent. + +class Importer extends esrecurse.Visitor { + constructor(declaration, referencer) { + super(null, referencer.options); + this.declaration = declaration; + this.referencer = referencer; + } + + visitImport(id, specifier) { + this.referencer.visitPattern(id, pattern => { + this.referencer.currentScope().__define(pattern, + new Definition( + Variable.ImportBinding, + pattern, + specifier, + this.declaration, + null, + null + )); + }); + } + + ImportNamespaceSpecifier(node) { + const local = (node.local || node.id); + + if (local) { + this.visitImport(local, node); + } + } + + ImportDefaultSpecifier(node) { + const local = (node.local || node.id); + + this.visitImport(local, node); + } + + ImportSpecifier(node) { + const local = (node.local || node.id); + + if (node.name) { + this.visitImport(node.name, node); + } else { + this.visitImport(local, node); + } + } +} + +// Referencing variables and creating bindings. +class Referencer extends esrecurse.Visitor { + constructor(options, scopeManager) { + super(null, options); + this.options = options; + this.scopeManager = scopeManager; + this.parent = null; + this.isInnerMethodDefinition = false; + } + + currentScope() { + return this.scopeManager.__currentScope; + } + + close(node) { + while (this.currentScope() && node === this.currentScope().block) { + this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager); + } + } + + pushInnerMethodDefinition(isInnerMethodDefinition) { + const previous = this.isInnerMethodDefinition; + + this.isInnerMethodDefinition = isInnerMethodDefinition; + return previous; + } + + popInnerMethodDefinition(isInnerMethodDefinition) { + this.isInnerMethodDefinition = isInnerMethodDefinition; + } + + referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) { + const scope = this.currentScope(); + + assignments.forEach(assignment => { + scope.__referencing( + pattern, + Reference.WRITE, + assignment.right, + maybeImplicitGlobal, + pattern !== assignment.left, + init); + }); + } + + visitPattern(node, options, callback) { + if (typeof options === "function") { + callback = options; + options = { processRightHandNodes: false }; + } + traverseIdentifierInPattern( + this.options, + node, + options.processRightHandNodes ? this : null, + callback); + } + + visitFunction(node) { + let i, iz; + + // FunctionDeclaration name is defined in upper scope + // NOTE: Not referring variableScope. It is intended. + // Since + // in ES5, FunctionDeclaration should be in FunctionBody. + // in ES6, FunctionDeclaration should be block scoped. + + if (node.type === Syntax.FunctionDeclaration) { + + // id is defined in upper scope + this.currentScope().__define(node.id, + new Definition( + Variable.FunctionName, + node.id, + node, + null, + null, + null + )); + } + + // FunctionExpression with name creates its special scope; + // FunctionExpressionNameScope. + if (node.type === Syntax.FunctionExpression && node.id) { + this.scopeManager.__nestFunctionExpressionNameScope(node); + } + + // Consider this function is in the MethodDefinition. + this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition); + + const that = this; + + /** + * Visit pattern callback + * @param {pattern} pattern - pattern + * @param {Object} info - info + * @returns {void} + */ + function visitPatternCallback(pattern, info) { + that.currentScope().__define(pattern, + new ParameterDefinition( + pattern, + node, + i, + info.rest + )); + + that.referencingDefaultValue(pattern, info.assignments, null, true); + } + + // Process parameter declarations. + for (i = 0, iz = node.params.length; i < iz; ++i) { + this.visitPattern(node.params[i], { processRightHandNodes: true }, visitPatternCallback); + } + + // if there's a rest argument, add that + if (node.rest) { + this.visitPattern({ + type: "RestElement", + argument: node.rest + }, pattern => { + this.currentScope().__define(pattern, + new ParameterDefinition( + pattern, + node, + node.params.length, + true + )); + }); + } + + // In TypeScript there are a number of function-like constructs which have no body, + // so check it exists before traversing + if (node.body) { + + // Skip BlockStatement to prevent creating BlockStatement scope. + if (node.body.type === Syntax.BlockStatement) { + this.visitChildren(node.body); + } else { + this.visit(node.body); + } + } + + this.close(node); + } + + visitClass(node) { + if (node.type === Syntax.ClassDeclaration) { + this.currentScope().__define(node.id, + new Definition( + Variable.ClassName, + node.id, + node, + null, + null, + null + )); + } + + this.visit(node.superClass); + + this.scopeManager.__nestClassScope(node); + + if (node.id) { + this.currentScope().__define(node.id, + new Definition( + Variable.ClassName, + node.id, + node + )); + } + this.visit(node.body); + + this.close(node); + } + + visitProperty(node) { + let previous; + + if (node.computed) { + this.visit(node.key); + } + + const isMethodDefinition = node.type === Syntax.MethodDefinition; + + if (isMethodDefinition) { + previous = this.pushInnerMethodDefinition(true); + } + this.visit(node.value); + if (isMethodDefinition) { + this.popInnerMethodDefinition(previous); + } + } + + visitForIn(node) { + if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") { + this.scopeManager.__nestForScope(node); + } + + if (node.left.type === Syntax.VariableDeclaration) { + this.visit(node.left); + this.visitPattern(node.left.declarations[0].id, pattern => { + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true); + }); + } else { + this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { + let maybeImplicitGlobal = null; + + if (!this.currentScope().isStrict) { + maybeImplicitGlobal = { + pattern, + node + }; + } + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false); + }); + } + this.visit(node.right); + this.visit(node.body); + + this.close(node); + } + + visitVariableDeclaration(variableTargetScope, type, node, index) { + + const decl = node.declarations[index]; + const init = decl.init; + + this.visitPattern(decl.id, { processRightHandNodes: true }, (pattern, info) => { + variableTargetScope.__define( + pattern, + new Definition( + type, + pattern, + decl, + node, + index, + node.kind + ) + ); + + this.referencingDefaultValue(pattern, info.assignments, null, true); + if (init) { + this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true); + } + }); + } + + AssignmentExpression(node) { + if (PatternVisitor.isPattern(node.left)) { + if (node.operator === "=") { + this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { + let maybeImplicitGlobal = null; + + if (!this.currentScope().isStrict) { + maybeImplicitGlobal = { + pattern, + node + }; + } + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false); + }); + } else { + this.currentScope().__referencing(node.left, Reference.RW, node.right); + } + } else { + this.visit(node.left); + } + this.visit(node.right); + } + + CatchClause(node) { + this.scopeManager.__nestCatchScope(node); + + this.visitPattern(node.param, { processRightHandNodes: true }, (pattern, info) => { + this.currentScope().__define(pattern, + new Definition( + Variable.CatchClause, + node.param, + node, + null, + null, + null + )); + this.referencingDefaultValue(pattern, info.assignments, null, true); + }); + this.visit(node.body); + + this.close(node); + } + + Program(node) { + this.scopeManager.__nestGlobalScope(node); + + if (this.scopeManager.__isNodejsScope()) { + + // Force strictness of GlobalScope to false when using node.js scope. + this.currentScope().isStrict = false; + this.scopeManager.__nestFunctionScope(node, false); + } + + if (this.scopeManager.__isES6() && this.scopeManager.isModule()) { + this.scopeManager.__nestModuleScope(node); + } + + if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) { + this.currentScope().isStrict = true; + } + + this.visitChildren(node); + this.close(node); + } + + Identifier(node) { + this.currentScope().__referencing(node); + } + + UpdateExpression(node) { + if (PatternVisitor.isPattern(node.argument)) { + this.currentScope().__referencing(node.argument, Reference.RW, null); + } else { + this.visitChildren(node); + } + } + + MemberExpression(node) { + this.visit(node.object); + if (node.computed) { + this.visit(node.property); + } + } + + Property(node) { + this.visitProperty(node); + } + + MethodDefinition(node) { + this.visitProperty(node); + } + + BreakStatement() {} // eslint-disable-line class-methods-use-this + + ContinueStatement() {} // eslint-disable-line class-methods-use-this + + LabeledStatement(node) { + this.visit(node.body); + } + + ForStatement(node) { + + // Create ForStatement declaration. + // NOTE: In ES6, ForStatement dynamically generates + // per iteration environment. However, escope is + // a static analyzer, we only generate one scope for ForStatement. + if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") { + this.scopeManager.__nestForScope(node); + } + + this.visitChildren(node); + + this.close(node); + } + + ClassExpression(node) { + this.visitClass(node); + } + + ClassDeclaration(node) { + this.visitClass(node); + } + + CallExpression(node) { + + // Check this is direct call to eval + if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") { + + // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and + // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment. + this.currentScope().variableScope.__detectEval(); + } + this.visitChildren(node); + } + + BlockStatement(node) { + if (this.scopeManager.__isES6()) { + this.scopeManager.__nestBlockScope(node); + } + + this.visitChildren(node); + + this.close(node); + } + + ThisExpression() { + this.currentScope().variableScope.__detectThis(); + } + + WithStatement(node) { + this.visit(node.object); + + // Then nest scope for WithStatement. + this.scopeManager.__nestWithScope(node); + + this.visit(node.body); + + this.close(node); + } + + VariableDeclaration(node) { + const variableTargetScope = (node.kind === "var") ? this.currentScope().variableScope : this.currentScope(); + + for (let i = 0, iz = node.declarations.length; i < iz; ++i) { + const decl = node.declarations[i]; + + this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i); + if (decl.init) { + this.visit(decl.init); + } + } + } + + // sec 13.11.8 + SwitchStatement(node) { + this.visit(node.discriminant); + + if (this.scopeManager.__isES6()) { + this.scopeManager.__nestSwitchScope(node); + } + + for (let i = 0, iz = node.cases.length; i < iz; ++i) { + this.visit(node.cases[i]); + } + + this.close(node); + } + + FunctionDeclaration(node) { + this.visitFunction(node); + } + + FunctionExpression(node) { + this.visitFunction(node); + } + + ForOfStatement(node) { + this.visitForIn(node); + } + + ForInStatement(node) { + this.visitForIn(node); + } + + ArrowFunctionExpression(node) { + this.visitFunction(node); + } + + ImportDeclaration(node) { + assert(this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context."); + + const importer = new Importer(node, this); + + importer.visit(node); + } + + visitExportDeclaration(node) { + if (node.source) { + return; + } + if (node.declaration) { + this.visit(node.declaration); + return; + } + + this.visitChildren(node); + } + + ExportDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportNamedDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportSpecifier(node) { + const local = (node.id || node.local); + + this.visit(local); + } + + MetaProperty() { // eslint-disable-line class-methods-use-this + + // do nothing. + } +} + +module.exports = Referencer; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/scope-manager.js b/node_modules/eslint-scope/lib/scope-manager.js new file mode 100644 index 0000000..c192799 --- /dev/null +++ b/node_modules/eslint-scope/lib/scope-manager.js @@ -0,0 +1,247 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +/* eslint-disable no-underscore-dangle */ + +const Scope = require("./scope"); +const assert = require("assert"); + +const GlobalScope = Scope.GlobalScope; +const CatchScope = Scope.CatchScope; +const WithScope = Scope.WithScope; +const ModuleScope = Scope.ModuleScope; +const ClassScope = Scope.ClassScope; +const SwitchScope = Scope.SwitchScope; +const FunctionScope = Scope.FunctionScope; +const ForScope = Scope.ForScope; +const FunctionExpressionNameScope = Scope.FunctionExpressionNameScope; +const BlockScope = Scope.BlockScope; + +/** + * @class ScopeManager + */ +class ScopeManager { + constructor(options) { + this.scopes = []; + this.globalScope = null; + this.__nodeToScope = new WeakMap(); + this.__currentScope = null; + this.__options = options; + this.__declaredVariables = new WeakMap(); + } + + __useDirective() { + return this.__options.directive; + } + + __isOptimistic() { + return this.__options.optimistic; + } + + __ignoreEval() { + return this.__options.ignoreEval; + } + + __isNodejsScope() { + return this.__options.nodejsScope; + } + + isModule() { + return this.__options.sourceType === "module"; + } + + isImpliedStrict() { + return this.__options.impliedStrict; + } + + isStrictModeSupported() { + return this.__options.ecmaVersion >= 5; + } + + // Returns appropriate scope for this node. + __get(node) { + return this.__nodeToScope.get(node); + } + + /** + * Get variables that are declared by the node. + * + * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`. + * If the node declares nothing, this method returns an empty array. + * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details. + * + * @param {Espree.Node} node - a node to get. + * @returns {Variable[]} variables that declared by the node. + */ + getDeclaredVariables(node) { + return this.__declaredVariables.get(node) || []; + } + + /** + * acquire scope from node. + * @method ScopeManager#acquire + * @param {Espree.Node} node - node for the acquired scope. + * @param {boolean=} inner - look up the most inner scope, default value is false. + * @returns {Scope?} Scope from node + */ + acquire(node, inner) { + + /** + * predicate + * @param {Scope} testScope - scope to test + * @returns {boolean} predicate + */ + function predicate(testScope) { + if (testScope.type === "function" && testScope.functionExpressionScope) { + return false; + } + return true; + } + + const scopes = this.__get(node); + + if (!scopes || scopes.length === 0) { + return null; + } + + // Heuristic selection from all scopes. + // If you would like to get all scopes, please use ScopeManager#acquireAll. + if (scopes.length === 1) { + return scopes[0]; + } + + if (inner) { + for (let i = scopes.length - 1; i >= 0; --i) { + const scope = scopes[i]; + + if (predicate(scope)) { + return scope; + } + } + } else { + for (let i = 0, iz = scopes.length; i < iz; ++i) { + const scope = scopes[i]; + + if (predicate(scope)) { + return scope; + } + } + } + + return null; + } + + /** + * acquire all scopes from node. + * @method ScopeManager#acquireAll + * @param {Espree.Node} node - node for the acquired scope. + * @returns {Scopes?} Scope array + */ + acquireAll(node) { + return this.__get(node); + } + + /** + * release the node. + * @method ScopeManager#release + * @param {Espree.Node} node - releasing node. + * @param {boolean=} inner - look up the most inner scope, default value is false. + * @returns {Scope?} upper scope for the node. + */ + release(node, inner) { + const scopes = this.__get(node); + + if (scopes && scopes.length) { + const scope = scopes[0].upper; + + if (!scope) { + return null; + } + return this.acquire(scope.block, inner); + } + return null; + } + + attach() { } // eslint-disable-line class-methods-use-this + + detach() { } // eslint-disable-line class-methods-use-this + + __nestScope(scope) { + if (scope instanceof GlobalScope) { + assert(this.__currentScope === null); + this.globalScope = scope; + } + this.__currentScope = scope; + return scope; + } + + __nestGlobalScope(node) { + return this.__nestScope(new GlobalScope(this, node)); + } + + __nestBlockScope(node) { + return this.__nestScope(new BlockScope(this, this.__currentScope, node)); + } + + __nestFunctionScope(node, isMethodDefinition) { + return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition)); + } + + __nestForScope(node) { + return this.__nestScope(new ForScope(this, this.__currentScope, node)); + } + + __nestCatchScope(node) { + return this.__nestScope(new CatchScope(this, this.__currentScope, node)); + } + + __nestWithScope(node) { + return this.__nestScope(new WithScope(this, this.__currentScope, node)); + } + + __nestClassScope(node) { + return this.__nestScope(new ClassScope(this, this.__currentScope, node)); + } + + __nestSwitchScope(node) { + return this.__nestScope(new SwitchScope(this, this.__currentScope, node)); + } + + __nestModuleScope(node) { + return this.__nestScope(new ModuleScope(this, this.__currentScope, node)); + } + + __nestFunctionExpressionNameScope(node) { + return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node)); + } + + __isES6() { + return this.__options.ecmaVersion >= 6; + } +} + +module.exports = ScopeManager; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/scope.js b/node_modules/eslint-scope/lib/scope.js new file mode 100644 index 0000000..f0c3006 --- /dev/null +++ b/node_modules/eslint-scope/lib/scope.js @@ -0,0 +1,745 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +/* eslint-disable no-underscore-dangle */ +/* eslint-disable no-undefined */ + +const Syntax = require("estraverse").Syntax; + +const Reference = require("./reference"); +const Variable = require("./variable"); +const Definition = require("./definition").Definition; +const assert = require("assert"); + +/** + * Test if scope is struct + * @param {Scope} scope - scope + * @param {Block} block - block + * @param {boolean} isMethodDefinition - is method definiton + * @param {boolean} useDirective - use directive + * @returns {boolean} is strict scope + */ +function isStrictScope(scope, block, isMethodDefinition, useDirective) { + let body; + + // When upper scope is exists and strict, inner scope is also strict. + if (scope.upper && scope.upper.isStrict) { + return true; + } + + if (isMethodDefinition) { + return true; + } + + if (scope.type === "class" || scope.type === "module") { + return true; + } + + if (scope.type === "block" || scope.type === "switch") { + return false; + } + + if (scope.type === "function") { + if (block.type === Syntax.ArrowFunctionExpression && block.body.type !== Syntax.BlockStatement) { + return false; + } + + if (block.type === Syntax.Program) { + body = block; + } else { + body = block.body; + } + + if (!body) { + return false; + } + } else if (scope.type === "global") { + body = block; + } else { + return false; + } + + // Search 'use strict' directive. + if (useDirective) { + for (let i = 0, iz = body.body.length; i < iz; ++i) { + const stmt = body.body[i]; + + if (stmt.type !== Syntax.DirectiveStatement) { + break; + } + if (stmt.raw === "\"use strict\"" || stmt.raw === "'use strict'") { + return true; + } + } + } else { + for (let i = 0, iz = body.body.length; i < iz; ++i) { + const stmt = body.body[i]; + + if (stmt.type !== Syntax.ExpressionStatement) { + break; + } + const expr = stmt.expression; + + if (expr.type !== Syntax.Literal || typeof expr.value !== "string") { + break; + } + if (expr.raw !== null && expr.raw !== undefined) { + if (expr.raw === "\"use strict\"" || expr.raw === "'use strict'") { + return true; + } + } else { + if (expr.value === "use strict") { + return true; + } + } + } + } + return false; +} + +/** + * Register scope + * @param {ScopeManager} scopeManager - scope manager + * @param {Scope} scope - scope + * @returns {void} + */ +function registerScope(scopeManager, scope) { + scopeManager.scopes.push(scope); + + const scopes = scopeManager.__nodeToScope.get(scope.block); + + if (scopes) { + scopes.push(scope); + } else { + scopeManager.__nodeToScope.set(scope.block, [scope]); + } +} + +/** + * Should be statically + * @param {Object} def - def + * @returns {boolean} should be statically + */ +function shouldBeStatically(def) { + return ( + (def.type === Variable.ClassName) || + (def.type === Variable.Variable && def.parent.kind !== "var") + ); +} + +/** + * @class Scope + */ +class Scope { + constructor(scopeManager, type, upperScope, block, isMethodDefinition) { + + /** + * One of 'module', 'block', 'switch', 'function', 'catch', 'with', 'function', 'class', 'global'. + * @member {String} Scope#type + */ + this.type = type; + + /** + * The scoped {@link Variable}s of this scope, as { Variable.name + * : Variable }. + * @member {Map} Scope#set + */ + this.set = new Map(); + + /** + * The tainted variables of this scope, as { Variable.name : + * boolean }. + * @member {Map} Scope#taints */ + this.taints = new Map(); + + /** + * Generally, through the lexical scoping of JS you can always know + * which variable an identifier in the source code refers to. There are + * a few exceptions to this rule. With 'global' and 'with' scopes you + * can only decide at runtime which variable a reference refers to. + * Moreover, if 'eval()' is used in a scope, it might introduce new + * bindings in this or its parent scopes. + * All those scopes are considered 'dynamic'. + * @member {boolean} Scope#dynamic + */ + this.dynamic = this.type === "global" || this.type === "with"; + + /** + * A reference to the scope-defining syntax node. + * @member {espree.Node} Scope#block + */ + this.block = block; + + /** + * The {@link Reference|references} that are not resolved with this scope. + * @member {Reference[]} Scope#through + */ + this.through = []; + + /** + * The scoped {@link Variable}s of this scope. In the case of a + * 'function' scope this includes the automatic argument arguments as + * its first element, as well as all further formal arguments. + * @member {Variable[]} Scope#variables + */ + this.variables = []; + + /** + * Any variable {@link Reference|reference} found in this scope. This + * includes occurrences of local variables as well as variables from + * parent scopes (including the global scope). For local variables + * this also includes defining occurrences (like in a 'var' statement). + * In a 'function' scope this does not include the occurrences of the + * formal parameter in the parameter list. + * @member {Reference[]} Scope#references + */ + this.references = []; + + /** + * For 'global' and 'function' scopes, this is a self-reference. For + * other scope types this is the variableScope value of the + * parent scope. + * @member {Scope} Scope#variableScope + */ + this.variableScope = + (this.type === "global" || this.type === "function" || this.type === "module") ? this : upperScope.variableScope; + + /** + * Whether this scope is created by a FunctionExpression. + * @member {boolean} Scope#functionExpressionScope + */ + this.functionExpressionScope = false; + + /** + * Whether this is a scope that contains an 'eval()' invocation. + * @member {boolean} Scope#directCallToEvalScope + */ + this.directCallToEvalScope = false; + + /** + * @member {boolean} Scope#thisFound + */ + this.thisFound = false; + + this.__left = []; + + /** + * Reference to the parent {@link Scope|scope}. + * @member {Scope} Scope#upper + */ + this.upper = upperScope; + + /** + * Whether 'use strict' is in effect in this scope. + * @member {boolean} Scope#isStrict + */ + this.isStrict = isStrictScope(this, block, isMethodDefinition, scopeManager.__useDirective()); + + /** + * List of nested {@link Scope}s. + * @member {Scope[]} Scope#childScopes + */ + this.childScopes = []; + if (this.upper) { + this.upper.childScopes.push(this); + } + + this.__declaredVariables = scopeManager.__declaredVariables; + + registerScope(scopeManager, this); + } + + __shouldStaticallyClose(scopeManager) { + return (!this.dynamic || scopeManager.__isOptimistic()); + } + + __shouldStaticallyCloseForGlobal(ref) { + + // On global scope, let/const/class declarations should be resolved statically. + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + + const variable = this.set.get(name); + const defs = variable.defs; + + return defs.length > 0 && defs.every(shouldBeStatically); + } + + __staticCloseRef(ref) { + if (!this.__resolve(ref)) { + this.__delegateToUpperScope(ref); + } + } + + __dynamicCloseRef(ref) { + + // notify all names are through to global + let current = this; + + do { + current.through.push(ref); + current = current.upper; + } while (current); + } + + __globalCloseRef(ref) { + + // let/const/class declarations should be resolved statically. + // others should be resolved dynamically. + if (this.__shouldStaticallyCloseForGlobal(ref)) { + this.__staticCloseRef(ref); + } else { + this.__dynamicCloseRef(ref); + } + } + + __close(scopeManager) { + let closeRef; + + if (this.__shouldStaticallyClose(scopeManager)) { + closeRef = this.__staticCloseRef; + } else if (this.type !== "global") { + closeRef = this.__dynamicCloseRef; + } else { + closeRef = this.__globalCloseRef; + } + + // Try Resolving all references in this scope. + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + closeRef.call(this, ref); + } + this.__left = null; + + return this.upper; + } + + // To override by function scopes. + // References in default parameters isn't resolved to variables which are in their function body. + __isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars + return true; + } + + __resolve(ref) { + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + const variable = this.set.get(name); + + if (!this.__isValidResolution(ref, variable)) { + return false; + } + variable.references.push(ref); + variable.stack = variable.stack && ref.from.variableScope === this.variableScope; + if (ref.tainted) { + variable.tainted = true; + this.taints.set(variable.name, true); + } + ref.resolved = variable; + + return true; + } + + __delegateToUpperScope(ref) { + if (this.upper) { + this.upper.__left.push(ref); + } + this.through.push(ref); + } + + __addDeclaredVariablesOfNode(variable, node) { + if (node === null || node === undefined) { + return; + } + + let variables = this.__declaredVariables.get(node); + + if (variables === null || variables === undefined) { + variables = []; + this.__declaredVariables.set(node, variables); + } + if (variables.indexOf(variable) === -1) { + variables.push(variable); + } + } + + __defineGeneric(name, set, variables, node, def) { + let variable; + + variable = set.get(name); + if (!variable) { + variable = new Variable(name, this); + set.set(name, variable); + variables.push(variable); + } + + if (def) { + variable.defs.push(def); + this.__addDeclaredVariablesOfNode(variable, def.node); + this.__addDeclaredVariablesOfNode(variable, def.parent); + } + if (node) { + variable.identifiers.push(node); + } + } + + __define(node, def) { + if (node && node.type === Syntax.Identifier) { + this.__defineGeneric( + node.name, + this.set, + this.variables, + node, + def); + } + } + + __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) { + + // because Array element may be null + if (!node || node.type !== Syntax.Identifier) { + return; + } + + // Specially handle like `this`. + if (node.name === "super") { + return; + } + + const ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init); + + this.references.push(ref); + this.__left.push(ref); + } + + __detectEval() { + let current = this; + + this.directCallToEvalScope = true; + do { + current.dynamic = true; + current = current.upper; + } while (current); + } + + __detectThis() { + this.thisFound = true; + } + + __isClosed() { + return this.__left === null; + } + + /** + * returns resolved {Reference} + * @method Scope#resolve + * @param {Espree.Identifier} ident - identifier to be resolved. + * @returns {Reference} reference + */ + resolve(ident) { + let ref, i, iz; + + assert(this.__isClosed(), "Scope should be closed."); + assert(ident.type === Syntax.Identifier, "Target should be identifier."); + for (i = 0, iz = this.references.length; i < iz; ++i) { + ref = this.references[i]; + if (ref.identifier === ident) { + return ref; + } + } + return null; + } + + /** + * returns this scope is static + * @method Scope#isStatic + * @returns {boolean} static + */ + isStatic() { + return !this.dynamic; + } + + /** + * returns this scope has materialized arguments + * @method Scope#isArgumentsMaterialized + * @returns {boolean} arguemnts materialized + */ + isArgumentsMaterialized() { // eslint-disable-line class-methods-use-this + return true; + } + + /** + * returns this scope has materialized `this` reference + * @method Scope#isThisMaterialized + * @returns {boolean} this materialized + */ + isThisMaterialized() { // eslint-disable-line class-methods-use-this + return true; + } + + isUsedName(name) { + if (this.set.has(name)) { + return true; + } + for (let i = 0, iz = this.through.length; i < iz; ++i) { + if (this.through[i].identifier.name === name) { + return true; + } + } + return false; + } +} + +class GlobalScope extends Scope { + constructor(scopeManager, block) { + super(scopeManager, "global", null, block, false); + this.implicit = { + set: new Map(), + variables: [], + + /** + * List of {@link Reference}s that are left to be resolved (i.e. which + * need to be linked to the variable they refer to). + * @member {Reference[]} Scope#implicit#left + */ + left: [] + }; + } + + __close(scopeManager) { + const implicit = []; + + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) { + implicit.push(ref.__maybeImplicitGlobal); + } + } + + // create an implicit global variable from assignment expression + for (let i = 0, iz = implicit.length; i < iz; ++i) { + const info = implicit[i]; + + this.__defineImplicit(info.pattern, + new Definition( + Variable.ImplicitGlobalVariable, + info.pattern, + info.node, + null, + null, + null + )); + + } + + this.implicit.left = this.__left; + + return super.__close(scopeManager); + } + + __defineImplicit(node, def) { + if (node && node.type === Syntax.Identifier) { + this.__defineGeneric( + node.name, + this.implicit.set, + this.implicit.variables, + node, + def); + } + } +} + +class ModuleScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "module", upperScope, block, false); + } +} + +class FunctionExpressionNameScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "function-expression-name", upperScope, block, false); + this.__define(block.id, + new Definition( + Variable.FunctionName, + block.id, + block, + null, + null, + null + )); + this.functionExpressionScope = true; + } +} + +class CatchScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "catch", upperScope, block, false); + } +} + +class WithScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "with", upperScope, block, false); + } + + __close(scopeManager) { + if (this.__shouldStaticallyClose(scopeManager)) { + return super.__close(scopeManager); + } + + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + ref.tainted = true; + this.__delegateToUpperScope(ref); + } + this.__left = null; + + return this.upper; + } +} + +class BlockScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "block", upperScope, block, false); + } +} + +class SwitchScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "switch", upperScope, block, false); + } +} + +class FunctionScope extends Scope { + constructor(scopeManager, upperScope, block, isMethodDefinition) { + super(scopeManager, "function", upperScope, block, isMethodDefinition); + + // section 9.2.13, FunctionDeclarationInstantiation. + // NOTE Arrow functions never have an arguments objects. + if (this.block.type !== Syntax.ArrowFunctionExpression) { + this.__defineArguments(); + } + } + + isArgumentsMaterialized() { + + // TODO(Constellation) + // We can more aggressive on this condition like this. + // + // function t() { + // // arguments of t is always hidden. + // function arguments() { + // } + // } + if (this.block.type === Syntax.ArrowFunctionExpression) { + return false; + } + + if (!this.isStatic()) { + return true; + } + + const variable = this.set.get("arguments"); + + assert(variable, "Always have arguments variable."); + return variable.tainted || variable.references.length !== 0; + } + + isThisMaterialized() { + if (!this.isStatic()) { + return true; + } + return this.thisFound; + } + + __defineArguments() { + this.__defineGeneric( + "arguments", + this.set, + this.variables, + null, + null); + this.taints.set("arguments", true); + } + + // References in default parameters isn't resolved to variables which are in their function body. + // const x = 1 + // function f(a = x) { // This `x` is resolved to the `x` in the outer scope. + // const x = 2 + // console.log(a) + // } + __isValidResolution(ref, variable) { + + // If `options.nodejsScope` is true, `this.block` becomes a Program node. + if (this.block.type === "Program") { + return true; + } + + const bodyStart = this.block.body.range[0]; + + // It's invalid resolution in the following case: + return !( + variable.scope === this && + ref.identifier.range[0] < bodyStart && // the reference is in the parameter part. + variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body. + ); + } +} + +class ForScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "for", upperScope, block, false); + } +} + +class ClassScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "class", upperScope, block, false); + } +} + +module.exports = { + Scope, + GlobalScope, + ModuleScope, + FunctionExpressionNameScope, + CatchScope, + WithScope, + BlockScope, + SwitchScope, + FunctionScope, + ForScope, + ClassScope +}; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/variable.js b/node_modules/eslint-scope/lib/variable.js new file mode 100644 index 0000000..702c478 --- /dev/null +++ b/node_modules/eslint-scope/lib/variable.js @@ -0,0 +1,88 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +/** + * A Variable represents a locally scoped identifier. These include arguments to + * functions. + * @class Variable + */ +class Variable { + constructor(name, scope) { + + /** + * The variable name, as given in the source code. + * @member {String} Variable#name + */ + this.name = name; + + /** + * List of defining occurrences of this variable (like in 'var ...' + * statements or as parameter), as AST nodes. + * @member {espree.Identifier[]} Variable#identifiers + */ + this.identifiers = []; + + /** + * List of {@link Reference|references} of this variable (excluding parameter entries) + * in its defining scope and all nested scopes. For defining + * occurrences only see {@link Variable#defs}. + * @member {Reference[]} Variable#references + */ + this.references = []; + + /** + * List of defining occurrences of this variable (like in 'var ...' + * statements or as parameter), as custom objects. + * @member {Definition[]} Variable#defs + */ + this.defs = []; + + this.tainted = false; + + /** + * Whether this is a stack variable. + * @member {boolean} Variable#stack + */ + this.stack = true; + + /** + * Reference to the enclosing Scope. + * @member {Scope} Variable#scope + */ + this.scope = scope; + } +} + +Variable.CatchClause = "CatchClause"; +Variable.Parameter = "Parameter"; +Variable.FunctionName = "FunctionName"; +Variable.ClassName = "ClassName"; +Variable.Variable = "Variable"; +Variable.ImportBinding = "ImportBinding"; +Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable"; + +module.exports = Variable; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/package.json b/node_modules/eslint-scope/package.json new file mode 100644 index 0000000..3b4775b --- /dev/null +++ b/node_modules/eslint-scope/package.json @@ -0,0 +1,74 @@ +{ + "_from": "eslint-scope@^4.0.3", + "_id": "eslint-scope@4.0.3", + "_inBundle": false, + "_integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "_location": "/eslint-scope", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "eslint-scope@^4.0.3", + "name": "eslint-scope", + "escapedName": "eslint-scope", + "rawSpec": "^4.0.3", + "saveSpec": null, + "fetchSpec": "^4.0.3" + }, + "_requiredBy": [ + "/webpack" + ], + "_resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "_shasum": "ca03833310f6889a3264781aa82e63eb9cfe7848", + "_spec": "eslint-scope@^4.0.3", + "_where": "/usr/share/r3-server/beta/r3/node_modules/webpack", + "bugs": { + "url": "https://github.com/eslint/eslint-scope/issues" + }, + "bundleDependencies": false, + "dependencies": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "deprecated": false, + "description": "ECMAScript scope analyzer for ESLint", + "devDependencies": { + "chai": "^3.4.1", + "eslint": "^3.15.0", + "eslint-config-eslint": "^4.0.0", + "eslint-release": "^1.0.0", + "espree": "^3.1.1", + "istanbul": "^0.4.5", + "mocha": "^3.2.0", + "npm-license": "^0.3.3", + "shelljs": "^0.7.6", + "typescript": "~2.0.10", + "typescript-eslint-parser": "^1.0.0" + }, + "engines": { + "node": ">=4.0.0" + }, + "files": [ + "LICENSE", + "README.md", + "lib" + ], + "homepage": "http://github.com/eslint/eslint-scope", + "license": "BSD-2-Clause", + "main": "lib/index.js", + "name": "eslint-scope", + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/eslint-scope.git" + }, + "scripts": { + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "generate-release": "eslint-generate-release", + "lint": "node Makefile.js lint", + "publish-release": "eslint-publish-release", + "test": "node Makefile.js test" + }, + "version": "4.0.3" +} diff --git a/node_modules/esrecurse/.babelrc b/node_modules/esrecurse/.babelrc new file mode 100644 index 0000000..a0765e1 --- /dev/null +++ b/node_modules/esrecurse/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015"] +} diff --git a/node_modules/esrecurse/README.md b/node_modules/esrecurse/README.md new file mode 100644 index 0000000..ffea6b4 --- /dev/null +++ b/node_modules/esrecurse/README.md @@ -0,0 +1,171 @@ +### Esrecurse [![Build Status](https://travis-ci.org/estools/esrecurse.svg?branch=master)](https://travis-ci.org/estools/esrecurse) + +Esrecurse ([esrecurse](https://github.com/estools/esrecurse)) is +[ECMAScript](https://www.ecma-international.org/publications/standards/Ecma-262.htm) +recursive traversing functionality. + +### Example Usage + +The following code will output all variables declared at the root of a file. + +```javascript +esrecurse.visit(ast, { + XXXStatement: function (node) { + this.visit(node.left); + // do something... + this.visit(node.right); + } +}); +``` + +We can use `Visitor` instance. + +```javascript +var visitor = new esrecurse.Visitor({ + XXXStatement: function (node) { + this.visit(node.left); + // do something... + this.visit(node.right); + } +}); + +visitor.visit(ast); +``` + +We can inherit `Visitor` instance easily. + +```javascript +class Derived extends esrecurse.Visitor { + constructor() + { + super(null); + } + + XXXStatement(node) { + } +} +``` + +```javascript +function DerivedVisitor() { + esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); +} +util.inherits(DerivedVisitor, esrecurse.Visitor); +DerivedVisitor.prototype.XXXStatement = function (node) { + this.visit(node.left); + // do something... + this.visit(node.right); +}; +``` + +And you can invoke default visiting operation inside custom visit operation. + +```javascript +function DerivedVisitor() { + esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); +} +util.inherits(DerivedVisitor, esrecurse.Visitor); +DerivedVisitor.prototype.XXXStatement = function (node) { + // do something... + this.visitChildren(node); +}; +``` + +The `childVisitorKeys` option does customize the behaviour of `this.visitChildren(node)`. +We can use user-defined node types. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +esrecurse.visit( + ast, + { + Literal: function (node) { + // do something... + } + }, + { + // Extending the existing traversing rules. + childVisitorKeys: { + // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] + TestExpression: ['argument'] + } + } +); +``` + +We can use the `fallback` option as well. +If the `fallback` option is `"iteration"`, `esrecurse` would visit all enumerable properties of unknown nodes. +Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`). + +```javascript +esrecurse.visit( + ast, + { + Literal: function (node) { + // do something... + } + }, + { + fallback: 'iteration' + } +); +``` + +If the `fallback` option is a function, `esrecurse` calls this function to determine the enumerable properties of unknown nodes. +Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`). + +```javascript +esrecurse.visit( + ast, + { + Literal: function (node) { + // do something... + } + }, + { + fallback: function (node) { + return Object.keys(node).filter(function(key) { + return key !== 'argument' + }); + } + } +); +``` + +### License + +Copyright (C) 2014 [Yusuke Suzuki](https://github.com/Constellation) + (twitter: [@Constellation](https://twitter.com/Constellation)) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/esrecurse/esrecurse.js b/node_modules/esrecurse/esrecurse.js new file mode 100644 index 0000000..15d57df --- /dev/null +++ b/node_modules/esrecurse/esrecurse.js @@ -0,0 +1,117 @@ +/* + Copyright (C) 2014 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +(function () { + 'use strict'; + + var estraverse = require('estraverse'); + + function isNode(node) { + if (node == null) { + return false; + } + return typeof node === 'object' && typeof node.type === 'string'; + } + + function isProperty(nodeType, key) { + return (nodeType === estraverse.Syntax.ObjectExpression || nodeType === estraverse.Syntax.ObjectPattern) && key === 'properties'; + } + + function Visitor(visitor, options) { + options = options || {}; + + this.__visitor = visitor || this; + this.__childVisitorKeys = options.childVisitorKeys + ? Object.assign({}, estraverse.VisitorKeys, options.childVisitorKeys) + : estraverse.VisitorKeys; + if (options.fallback === 'iteration') { + this.__fallback = Object.keys; + } else if (typeof options.fallback === 'function') { + this.__fallback = options.fallback; + } + } + + /* Default method for visiting children. + * When you need to call default visiting operation inside custom visiting + * operation, you can use it with `this.visitChildren(node)`. + */ + Visitor.prototype.visitChildren = function (node) { + var type, children, i, iz, j, jz, child; + + if (node == null) { + return; + } + + type = node.type || estraverse.Syntax.Property; + + children = this.__childVisitorKeys[type]; + if (!children) { + if (this.__fallback) { + children = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + type + '.'); + } + } + + for (i = 0, iz = children.length; i < iz; ++i) { + child = node[children[i]]; + if (child) { + if (Array.isArray(child)) { + for (j = 0, jz = child.length; j < jz; ++j) { + if (child[j]) { + if (isNode(child[j]) || isProperty(type, children[i])) { + this.visit(child[j]); + } + } + } + } else if (isNode(child)) { + this.visit(child); + } + } + } + }; + + /* Dispatching node. */ + Visitor.prototype.visit = function (node) { + var type; + + if (node == null) { + return; + } + + type = node.type || estraverse.Syntax.Property; + if (this.__visitor[type]) { + this.__visitor[type].call(this, node); + return; + } + this.visitChildren(node); + }; + + exports.version = require('./package.json').version; + exports.Visitor = Visitor; + exports.visit = function (node, visitor, options) { + var v = new Visitor(visitor, options); + v.visit(node); + }; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/esrecurse/gulpfile.babel.js b/node_modules/esrecurse/gulpfile.babel.js new file mode 100644 index 0000000..aa881c9 --- /dev/null +++ b/node_modules/esrecurse/gulpfile.babel.js @@ -0,0 +1,92 @@ +// Copyright (C) 2014 Yusuke Suzuki +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import gulp from 'gulp'; +import mocha from 'gulp-mocha'; +import eslint from 'gulp-eslint'; +import minimist from 'minimist'; +import git from 'gulp-git'; +import bump from 'gulp-bump'; +import filter from 'gulp-filter'; +import tagVersion from 'gulp-tag-version'; +import 'babel-register'; + +const SOURCE = [ + '*.js' +]; + +let ESLINT_OPTION = { + parser: 'babel-eslint', + parserOptions: { + 'sourceType': 'module' + }, + rules: { + 'quotes': 0, + 'eqeqeq': 0, + 'no-use-before-define': 0, + 'no-shadow': 0, + 'no-new': 0, + 'no-underscore-dangle': 0, + 'no-multi-spaces': 0, + 'no-native-reassign': 0, + 'no-loop-func': 0 + }, + env: { + 'node': true + } +}; + +gulp.task('test', function() { + let options = minimist(process.argv.slice(2), { + string: 'test', + default: { + test: 'test/*.js' + } + } + ); + return gulp.src(options.test).pipe(mocha({reporter: 'spec'})); +}); + +gulp.task('lint', () => + gulp.src(SOURCE) + .pipe(eslint(ESLINT_OPTION)) + .pipe(eslint.formatEach('stylish', process.stderr)) + .pipe(eslint.failOnError()) +); + +let inc = importance => + gulp.src(['./package.json']) + .pipe(bump({type: importance})) + .pipe(gulp.dest('./')) + .pipe(git.commit('Bumps package version')) + .pipe(filter('package.json')) + .pipe(tagVersion({ + prefix: '' + })) +; + +gulp.task('travis', [ 'lint', 'test' ]); +gulp.task('default', [ 'travis' ]); + +gulp.task('patch', [ ], () => inc('patch')); +gulp.task('minor', [ ], () => inc('minor')); +gulp.task('major', [ ], () => inc('major')); diff --git a/node_modules/esrecurse/package.json b/node_modules/esrecurse/package.json new file mode 100755 index 0000000..a223a14 --- /dev/null +++ b/node_modules/esrecurse/package.json @@ -0,0 +1,80 @@ +{ + "_from": "esrecurse@^4.1.0", + "_id": "esrecurse@4.2.1", + "_inBundle": false, + "_integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "_location": "/esrecurse", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "esrecurse@^4.1.0", + "name": "esrecurse", + "escapedName": "esrecurse", + "rawSpec": "^4.1.0", + "saveSpec": null, + "fetchSpec": "^4.1.0" + }, + "_requiredBy": [ + "/eslint-scope" + ], + "_resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "_shasum": "007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf", + "_spec": "esrecurse@^4.1.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/eslint-scope", + "babel": { + "presets": [ + "es2015" + ] + }, + "bugs": { + "url": "https://github.com/estools/esrecurse/issues" + }, + "bundleDependencies": false, + "dependencies": { + "estraverse": "^4.1.0" + }, + "deprecated": false, + "description": "ECMAScript AST recursive visitor", + "devDependencies": { + "babel-cli": "^6.24.1", + "babel-eslint": "^7.2.3", + "babel-preset-es2015": "^6.24.1", + "babel-register": "^6.24.1", + "chai": "^4.0.2", + "esprima": "^4.0.0", + "gulp": "^3.9.0", + "gulp-bump": "^2.7.0", + "gulp-eslint": "^4.0.0", + "gulp-filter": "^5.0.0", + "gulp-git": "^2.4.1", + "gulp-mocha": "^4.3.1", + "gulp-tag-version": "^1.2.1", + "jsdoc": "^3.3.0-alpha10", + "minimist": "^1.1.0" + }, + "engines": { + "node": ">=4.0" + }, + "homepage": "https://github.com/estools/esrecurse", + "license": "BSD-2-Clause", + "main": "esrecurse.js", + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "url": "https://github.com/Constellation" + } + ], + "name": "esrecurse", + "repository": { + "type": "git", + "url": "git+https://github.com/estools/esrecurse.git" + }, + "scripts": { + "lint": "gulp lint", + "test": "gulp travis", + "unit-test": "gulp test" + }, + "version": "4.2.1" +} diff --git a/node_modules/estraverse/.jshintrc b/node_modules/estraverse/.jshintrc new file mode 100644 index 0000000..f642dae --- /dev/null +++ b/node_modules/estraverse/.jshintrc @@ -0,0 +1,16 @@ +{ + "curly": true, + "eqeqeq": true, + "immed": true, + "eqnull": true, + "latedef": true, + "noarg": true, + "noempty": true, + "quotmark": "single", + "undef": true, + "unused": true, + "strict": true, + "trailing": true, + + "node": true +} diff --git a/node_modules/estraverse/LICENSE.BSD b/node_modules/estraverse/LICENSE.BSD new file mode 100644 index 0000000..3e580c3 --- /dev/null +++ b/node_modules/estraverse/LICENSE.BSD @@ -0,0 +1,19 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/estraverse/README.md b/node_modules/estraverse/README.md new file mode 100644 index 0000000..ccd3377 --- /dev/null +++ b/node_modules/estraverse/README.md @@ -0,0 +1,153 @@ +### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse) + +Estraverse ([estraverse](http://github.com/estools/estraverse)) is +[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) +traversal functions from [esmangle project](http://github.com/estools/esmangle). + +### Documentation + +You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). + +### Example Usage + +The following code will output all variables declared at the root of a file. + +```javascript +estraverse.traverse(ast, { + enter: function (node, parent) { + if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') + return estraverse.VisitorOption.Skip; + }, + leave: function (node, parent) { + if (node.type == 'VariableDeclarator') + console.log(node.id.name); + } +}); +``` + +We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. + +```javascript +estraverse.traverse(ast, { + enter: function (node) { + this.break(); + } +}); +``` + +And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. + +```javascript +result = estraverse.replace(tree, { + enter: function (node) { + // Replace it with replaced. + if (node.type === 'Literal') + return replaced; + } +}); +``` + +By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Extending the existing traversing rules. + keys: { + // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] + TestExpression: ['argument'] + } +}); +``` + +By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Iterating the child **nodes** of unknown nodes. + fallback: 'iteration' +}); +``` + +When `visitor.fallback` is a function, we can determine which keys to visit on each node. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Skip the `argument` property of each node + fallback: function(node) { + return Object.keys(node).filter(function(key) { + return key !== 'argument'; + }); + } +}); +``` + +### License + +Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation) + (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/estraverse/estraverse.js b/node_modules/estraverse/estraverse.js new file mode 100644 index 0000000..b106d38 --- /dev/null +++ b/node_modules/estraverse/estraverse.js @@ -0,0 +1,782 @@ +/* + Copyright (C) 2012-2013 Yusuke Suzuki + Copyright (C) 2012 Ariya Hidayat + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +/*jslint vars:false, bitwise:true*/ +/*jshint indent:4*/ +/*global exports:true*/ +(function clone(exports) { + 'use strict'; + + var Syntax, + VisitorOption, + VisitorKeys, + BREAK, + SKIP, + REMOVE; + + function deepCopy(obj) { + var ret = {}, key, val; + for (key in obj) { + if (obj.hasOwnProperty(key)) { + val = obj[key]; + if (typeof val === 'object' && val !== null) { + ret[key] = deepCopy(val); + } else { + ret[key] = val; + } + } + } + return ret; + } + + // based on LLVM libc++ upper_bound / lower_bound + // MIT License + + function upperBound(array, func) { + var diff, len, i, current; + + len = array.length; + i = 0; + + while (len) { + diff = len >>> 1; + current = i + diff; + if (func(array[current])) { + len = diff; + } else { + i = current + 1; + len -= diff + 1; + } + } + return i; + } + + Syntax = { + AssignmentExpression: 'AssignmentExpression', + AssignmentPattern: 'AssignmentPattern', + ArrayExpression: 'ArrayExpression', + ArrayPattern: 'ArrayPattern', + ArrowFunctionExpression: 'ArrowFunctionExpression', + AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7. + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ClassBody: 'ClassBody', + ClassDeclaration: 'ClassDeclaration', + ClassExpression: 'ClassExpression', + ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7. + ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7. + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DebuggerStatement: 'DebuggerStatement', + DirectiveStatement: 'DirectiveStatement', + DoWhileStatement: 'DoWhileStatement', + EmptyStatement: 'EmptyStatement', + ExportAllDeclaration: 'ExportAllDeclaration', + ExportDefaultDeclaration: 'ExportDefaultDeclaration', + ExportNamedDeclaration: 'ExportNamedDeclaration', + ExportSpecifier: 'ExportSpecifier', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForInStatement: 'ForInStatement', + ForOfStatement: 'ForOfStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7. + Identifier: 'Identifier', + IfStatement: 'IfStatement', + ImportExpression: 'ImportExpression', + ImportDeclaration: 'ImportDeclaration', + ImportDefaultSpecifier: 'ImportDefaultSpecifier', + ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', + ImportSpecifier: 'ImportSpecifier', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', + MethodDefinition: 'MethodDefinition', + ModuleSpecifier: 'ModuleSpecifier', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + ObjectPattern: 'ObjectPattern', + Program: 'Program', + Property: 'Property', + RestElement: 'RestElement', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SpreadElement: 'SpreadElement', + Super: 'Super', + SwitchStatement: 'SwitchStatement', + SwitchCase: 'SwitchCase', + TaggedTemplateExpression: 'TaggedTemplateExpression', + TemplateElement: 'TemplateElement', + TemplateLiteral: 'TemplateLiteral', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement', + YieldExpression: 'YieldExpression' + }; + + VisitorKeys = { + AssignmentExpression: ['left', 'right'], + AssignmentPattern: ['left', 'right'], + ArrayExpression: ['elements'], + ArrayPattern: ['elements'], + ArrowFunctionExpression: ['params', 'body'], + AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7. + BlockStatement: ['body'], + BinaryExpression: ['left', 'right'], + BreakStatement: ['label'], + CallExpression: ['callee', 'arguments'], + CatchClause: ['param', 'body'], + ClassBody: ['body'], + ClassDeclaration: ['id', 'superClass', 'body'], + ClassExpression: ['id', 'superClass', 'body'], + ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7. + ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. + ConditionalExpression: ['test', 'consequent', 'alternate'], + ContinueStatement: ['label'], + DebuggerStatement: [], + DirectiveStatement: [], + DoWhileStatement: ['body', 'test'], + EmptyStatement: [], + ExportAllDeclaration: ['source'], + ExportDefaultDeclaration: ['declaration'], + ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], + ExportSpecifier: ['exported', 'local'], + ExpressionStatement: ['expression'], + ForStatement: ['init', 'test', 'update', 'body'], + ForInStatement: ['left', 'right', 'body'], + ForOfStatement: ['left', 'right', 'body'], + FunctionDeclaration: ['id', 'params', 'body'], + FunctionExpression: ['id', 'params', 'body'], + GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. + Identifier: [], + IfStatement: ['test', 'consequent', 'alternate'], + ImportExpression: ['source'], + ImportDeclaration: ['specifiers', 'source'], + ImportDefaultSpecifier: ['local'], + ImportNamespaceSpecifier: ['local'], + ImportSpecifier: ['imported', 'local'], + Literal: [], + LabeledStatement: ['label', 'body'], + LogicalExpression: ['left', 'right'], + MemberExpression: ['object', 'property'], + MetaProperty: ['meta', 'property'], + MethodDefinition: ['key', 'value'], + ModuleSpecifier: [], + NewExpression: ['callee', 'arguments'], + ObjectExpression: ['properties'], + ObjectPattern: ['properties'], + Program: ['body'], + Property: ['key', 'value'], + RestElement: [ 'argument' ], + ReturnStatement: ['argument'], + SequenceExpression: ['expressions'], + SpreadElement: ['argument'], + Super: [], + SwitchStatement: ['discriminant', 'cases'], + SwitchCase: ['test', 'consequent'], + TaggedTemplateExpression: ['tag', 'quasi'], + TemplateElement: [], + TemplateLiteral: ['quasis', 'expressions'], + ThisExpression: [], + ThrowStatement: ['argument'], + TryStatement: ['block', 'handler', 'finalizer'], + UnaryExpression: ['argument'], + UpdateExpression: ['argument'], + VariableDeclaration: ['declarations'], + VariableDeclarator: ['id', 'init'], + WhileStatement: ['test', 'body'], + WithStatement: ['object', 'body'], + YieldExpression: ['argument'] + }; + + // unique id + BREAK = {}; + SKIP = {}; + REMOVE = {}; + + VisitorOption = { + Break: BREAK, + Skip: SKIP, + Remove: REMOVE + }; + + function Reference(parent, key) { + this.parent = parent; + this.key = key; + } + + Reference.prototype.replace = function replace(node) { + this.parent[this.key] = node; + }; + + Reference.prototype.remove = function remove() { + if (Array.isArray(this.parent)) { + this.parent.splice(this.key, 1); + return true; + } else { + this.replace(null); + return false; + } + }; + + function Element(node, path, wrap, ref) { + this.node = node; + this.path = path; + this.wrap = wrap; + this.ref = ref; + } + + function Controller() { } + + // API: + // return property path array from root to current node + Controller.prototype.path = function path() { + var i, iz, j, jz, result, element; + + function addToPath(result, path) { + if (Array.isArray(path)) { + for (j = 0, jz = path.length; j < jz; ++j) { + result.push(path[j]); + } + } else { + result.push(path); + } + } + + // root node + if (!this.__current.path) { + return null; + } + + // first node is sentinel, second node is root element + result = []; + for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { + element = this.__leavelist[i]; + addToPath(result, element.path); + } + addToPath(result, this.__current.path); + return result; + }; + + // API: + // return type of current node + Controller.prototype.type = function () { + var node = this.current(); + return node.type || this.__current.wrap; + }; + + // API: + // return array of parent elements + Controller.prototype.parents = function parents() { + var i, iz, result; + + // first node is sentinel + result = []; + for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { + result.push(this.__leavelist[i].node); + } + + return result; + }; + + // API: + // return current node + Controller.prototype.current = function current() { + return this.__current.node; + }; + + Controller.prototype.__execute = function __execute(callback, element) { + var previous, result; + + result = undefined; + + previous = this.__current; + this.__current = element; + this.__state = null; + if (callback) { + result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); + } + this.__current = previous; + + return result; + }; + + // API: + // notify control skip / break + Controller.prototype.notify = function notify(flag) { + this.__state = flag; + }; + + // API: + // skip child nodes of current node + Controller.prototype.skip = function () { + this.notify(SKIP); + }; + + // API: + // break traversals + Controller.prototype['break'] = function () { + this.notify(BREAK); + }; + + // API: + // remove node + Controller.prototype.remove = function () { + this.notify(REMOVE); + }; + + Controller.prototype.__initialize = function(root, visitor) { + this.visitor = visitor; + this.root = root; + this.__worklist = []; + this.__leavelist = []; + this.__current = null; + this.__state = null; + this.__fallback = null; + if (visitor.fallback === 'iteration') { + this.__fallback = Object.keys; + } else if (typeof visitor.fallback === 'function') { + this.__fallback = visitor.fallback; + } + + this.__keys = VisitorKeys; + if (visitor.keys) { + this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); + } + }; + + function isNode(node) { + if (node == null) { + return false; + } + return typeof node === 'object' && typeof node.type === 'string'; + } + + function isProperty(nodeType, key) { + return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; + } + + Controller.prototype.traverse = function traverse(root, visitor) { + var worklist, + leavelist, + element, + node, + nodeType, + ret, + key, + current, + current2, + candidates, + candidate, + sentinel; + + this.__initialize(root, visitor); + + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + worklist.push(new Element(root, null, null, null)); + leavelist.push(new Element(null, null, null, null)); + + while (worklist.length) { + element = worklist.pop(); + + if (element === sentinel) { + element = leavelist.pop(); + + ret = this.__execute(visitor.leave, element); + + if (this.__state === BREAK || ret === BREAK) { + return; + } + continue; + } + + if (element.node) { + + ret = this.__execute(visitor.enter, element); + + if (this.__state === BREAK || ret === BREAK) { + return; + } + + worklist.push(sentinel); + leavelist.push(element); + + if (this.__state === SKIP || ret === SKIP) { + continue; + } + + node = element.node; + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', null); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, null); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + worklist.push(new Element(candidate, key, null, null)); + } + } + } + } + }; + + Controller.prototype.replace = function replace(root, visitor) { + var worklist, + leavelist, + node, + nodeType, + target, + element, + current, + current2, + candidates, + candidate, + sentinel, + outer, + key; + + function removeElem(element) { + var i, + key, + nextElem, + parent; + + if (element.ref.remove()) { + // When the reference is an element of an array. + key = element.ref.key; + parent = element.ref.parent; + + // If removed from array, then decrease following items' keys. + i = worklist.length; + while (i--) { + nextElem = worklist[i]; + if (nextElem.ref && nextElem.ref.parent === parent) { + if (nextElem.ref.key < key) { + break; + } + --nextElem.ref.key; + } + } + } + } + + this.__initialize(root, visitor); + + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + outer = { + root: root + }; + element = new Element(root, null, null, new Reference(outer, 'root')); + worklist.push(element); + leavelist.push(element); + + while (worklist.length) { + element = worklist.pop(); + + if (element === sentinel) { + element = leavelist.pop(); + + target = this.__execute(visitor.leave, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + } + + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + } + + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + continue; + } + + target = this.__execute(visitor.enter, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + element.node = target; + } + + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + element.node = null; + } + + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + + // node may be null + node = element.node; + if (!node) { + continue; + } + + worklist.push(sentinel); + leavelist.push(element); + + if (this.__state === SKIP || target === SKIP) { + continue; + } + + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + worklist.push(new Element(candidate, key, null, new Reference(node, key))); + } + } + } + + return outer.root; + }; + + function traverse(root, visitor) { + var controller = new Controller(); + return controller.traverse(root, visitor); + } + + function replace(root, visitor) { + var controller = new Controller(); + return controller.replace(root, visitor); + } + + function extendCommentRange(comment, tokens) { + var target; + + target = upperBound(tokens, function search(token) { + return token.range[0] > comment.range[0]; + }); + + comment.extendedRange = [comment.range[0], comment.range[1]]; + + if (target !== tokens.length) { + comment.extendedRange[1] = tokens[target].range[0]; + } + + target -= 1; + if (target >= 0) { + comment.extendedRange[0] = tokens[target].range[1]; + } + + return comment; + } + + function attachComments(tree, providedComments, tokens) { + // At first, we should calculate extended comment ranges. + var comments = [], comment, len, i, cursor; + + if (!tree.range) { + throw new Error('attachComments needs range information'); + } + + // tokens array is empty, we attach comments to tree as 'leadingComments' + if (!tokens.length) { + if (providedComments.length) { + for (i = 0, len = providedComments.length; i < len; i += 1) { + comment = deepCopy(providedComments[i]); + comment.extendedRange = [0, tree.range[0]]; + comments.push(comment); + } + tree.leadingComments = comments; + } + return tree; + } + + for (i = 0, len = providedComments.length; i < len; i += 1) { + comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); + } + + // This is based on John Freeman's implementation. + cursor = 0; + traverse(tree, { + enter: function (node) { + var comment; + + while (cursor < comments.length) { + comment = comments[cursor]; + if (comment.extendedRange[1] > node.range[0]) { + break; + } + + if (comment.extendedRange[1] === node.range[0]) { + if (!node.leadingComments) { + node.leadingComments = []; + } + node.leadingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + + cursor = 0; + traverse(tree, { + leave: function (node) { + var comment; + + while (cursor < comments.length) { + comment = comments[cursor]; + if (node.range[1] < comment.extendedRange[0]) { + break; + } + + if (node.range[1] === comment.extendedRange[0]) { + if (!node.trailingComments) { + node.trailingComments = []; + } + node.trailingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + + return tree; + } + + exports.version = require('./package.json').version; + exports.Syntax = Syntax; + exports.traverse = traverse; + exports.replace = replace; + exports.attachComments = attachComments; + exports.VisitorKeys = VisitorKeys; + exports.VisitorOption = VisitorOption; + exports.Controller = Controller; + exports.cloneEnvironment = function () { return clone({}); }; + + return exports; +}(exports)); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/estraverse/gulpfile.js b/node_modules/estraverse/gulpfile.js new file mode 100644 index 0000000..8772bbc --- /dev/null +++ b/node_modules/estraverse/gulpfile.js @@ -0,0 +1,70 @@ +/* + Copyright (C) 2014 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +'use strict'; + +var gulp = require('gulp'), + git = require('gulp-git'), + bump = require('gulp-bump'), + filter = require('gulp-filter'), + tagVersion = require('gulp-tag-version'); + +var TEST = [ 'test/*.js' ]; +var POWERED = [ 'powered-test/*.js' ]; +var SOURCE = [ 'src/**/*.js' ]; + +/** + * Bumping version number and tagging the repository with it. + * Please read http://semver.org/ + * + * You can use the commands + * + * gulp patch # makes v0.1.0 -> v0.1.1 + * gulp feature # makes v0.1.1 -> v0.2.0 + * gulp release # makes v0.2.1 -> v1.0.0 + * + * To bump the version numbers accordingly after you did a patch, + * introduced a feature or made a backwards-incompatible release. + */ + +function inc(importance) { + // get all the files to bump version in + return gulp.src(['./package.json']) + // bump the version number in those files + .pipe(bump({type: importance})) + // save it back to filesystem + .pipe(gulp.dest('./')) + // commit the changed version number + .pipe(git.commit('Bumps package version')) + // read only one file to get the version number + .pipe(filter('package.json')) + // **tag it in the repository** + .pipe(tagVersion({ + prefix: '' + })); +} + +gulp.task('patch', [ ], function () { return inc('patch'); }) +gulp.task('minor', [ ], function () { return inc('minor'); }) +gulp.task('major', [ ], function () { return inc('major'); }) diff --git a/node_modules/estraverse/package.json b/node_modules/estraverse/package.json new file mode 100644 index 0000000..133db31 --- /dev/null +++ b/node_modules/estraverse/package.json @@ -0,0 +1,69 @@ +{ + "_from": "estraverse@^4.1.1", + "_id": "estraverse@4.3.0", + "_inBundle": false, + "_integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "_location": "/estraverse", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "estraverse@^4.1.1", + "name": "estraverse", + "escapedName": "estraverse", + "rawSpec": "^4.1.1", + "saveSpec": null, + "fetchSpec": "^4.1.1" + }, + "_requiredBy": [ + "/eslint-scope", + "/esrecurse" + ], + "_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "_shasum": "398ad3f3c5a24948be7725e83d11a7de28cdbd1d", + "_spec": "estraverse@^4.1.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/eslint-scope", + "bugs": { + "url": "https://github.com/estools/estraverse/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "ECMAScript JS AST traversal functions", + "devDependencies": { + "babel-preset-env": "^1.6.1", + "babel-register": "^6.3.13", + "chai": "^2.1.1", + "espree": "^1.11.0", + "gulp": "^3.8.10", + "gulp-bump": "^0.2.2", + "gulp-filter": "^2.0.0", + "gulp-git": "^1.0.1", + "gulp-tag-version": "^1.3.0", + "jshint": "^2.5.6", + "mocha": "^2.1.0" + }, + "engines": { + "node": ">=4.0" + }, + "homepage": "https://github.com/estools/estraverse", + "license": "BSD-2-Clause", + "main": "estraverse.js", + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "url": "http://github.com/Constellation" + } + ], + "name": "estraverse", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/estools/estraverse.git" + }, + "scripts": { + "lint": "jshint estraverse.js", + "test": "npm run-script lint && npm run-script unit-test", + "unit-test": "mocha --compilers js:babel-register" + }, + "version": "4.3.0" +} diff --git a/node_modules/events/.airtap.yml b/node_modules/events/.airtap.yml new file mode 100644 index 0000000..c7a8a87 --- /dev/null +++ b/node_modules/events/.airtap.yml @@ -0,0 +1,15 @@ +sauce_connect: true +loopback: airtap.local +browsers: + - name: chrome + version: latest + - name: firefox + version: latest + - name: safari + version: 9..latest + - name: iphone + version: latest + - name: ie + version: 9..latest + - name: microsoftedge + version: 13..latest diff --git a/node_modules/events/.github/FUNDING.yml b/node_modules/events/.github/FUNDING.yml new file mode 100644 index 0000000..8b8cb78 --- /dev/null +++ b/node_modules/events/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/events +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/events/.travis.yml b/node_modules/events/.travis.yml new file mode 100644 index 0000000..37c7813 --- /dev/null +++ b/node_modules/events/.travis.yml @@ -0,0 +1,16 @@ +sudo: false +language: node_js +node_js: + - stable + - '0.12' +script: + - npm test + - if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_NODE_VERSION}" = "stable" ]; then npm run test:browsers; fi +addons: + sauce_connect: true + hosts: + - airtap.local +env: + global: + - secure: XcBiD8yReflut9q7leKsigDZ0mI3qTKH+QrNVY8DaqlomJOZw8aOrVuX9Jz12l86ZJ41nbxmKnRNkFzcVr9mbP9YaeTb3DpeOBWmvaoSfud9Wnc16VfXtc1FCcwDhSVcSiM3UtnrmFU5cH+Dw1LPh5PbfylYOS/nJxUvG0FFLqI= + - secure: jNWtEbqhUdQ0xXDHvCYfUbKYeJCi6a7B4LsrcxYCyWWn4NIgncE5x2YbB+FSUUFVYfz0dsn5RKP1oHB99f0laUEo18HBNkrAS/rtyOdVzcpJjbQ6kgSILGjnJD/Ty1B57Rcz3iyev5Y7bLZ6Y1FbDnk/i9/l0faOGz8vTC3Vdkc= diff --git a/node_modules/events/History.md b/node_modules/events/History.md new file mode 100644 index 0000000..ffbda0e --- /dev/null +++ b/node_modules/events/History.md @@ -0,0 +1,89 @@ +# 3.1.0 (2020-01-08) + +`events` now matches the Node.js 11.12.0 API. + + - pass through return value in wrapped `emitter.once()` listeners + + Now, this works: + ```js + emitter.once('myevent', function () { return 1; }); + var listener = emitter.rawListeners('myevent')[0] + assert(listener() === 1); + ``` + Previously, `listener()` would return undefined regardless of the implementation. + + Ported from https://github.com/nodejs/node/commit/acc506c2d2771dab8d7bba6d3452bc5180dff7cf + + - Reduce code duplication in listener type check ([#67](https://github.com/Gozala/events/pull/67) by [@friederbluemle](https://github.com/friederbluemle)). + - Improve `emitter.once()` performance in some engines + +# 3.0.0 (2018-05-25) + +**This version drops support for IE8.** `events` no longer includes polyfills +for ES5 features. If you need to support older environments, use an ES5 shim +like [es5-shim](https://npmjs.com/package/es5-shim). Both the shim and sham +versions of es5-shim are necessary. + + - Update to events code from Node.js 10.x + - (semver major) Adds `off()` method + - Port more tests from Node.js + - Switch browser tests to airtap, making things more reliable + +# 2.1.0 (2018-05-25) + + - add Emitter#rawListeners from Node.js v9.4 + +# 2.0.0 (2018-02-02) + + - Update to events code from node.js 8.x + - Adds `prependListener()` and `prependOnceListener()` + - Adds `eventNames()` method + - (semver major) Unwrap `once()` listeners in `listeners()` + - copy tests from node.js + +Note that this version doubles the gzipped size, jumping from 1.1KB to 2.1KB, +due to new methods and runtime performance improvements. Be aware of that when +upgrading. + +# 1.1.1 (2016-06-22) + + - add more context to errors if they are not instanceof Error + +# 1.1.0 (2015-09-29) + + - add Emitter#listerCount (to match node v4 api) + +# 1.0.2 (2014-08-28) + + - remove un-reachable code + - update devDeps + +## 1.0.1 / 2014-05-11 + + - check for console.trace before using it + +## 1.0.0 / 2013-12-10 + + - Update to latest events code from node.js 0.10 + - copy tests from node.js + +## 0.4.0 / 2011-07-03 ## + + - Switching to graphquire@0.8.0 + +## 0.3.0 / 2011-07-03 ## + + - Switching to URL based module require. + +## 0.2.0 / 2011-06-10 ## + + - Simplified package structure. + - Graphquire for dependency management. + +## 0.1.1 / 2011-05-16 ## + + - Unhandled errors are logged via console.error + +## 0.1.0 / 2011-04-22 ## + + - Initial release diff --git a/node_modules/events/LICENSE b/node_modules/events/LICENSE new file mode 100644 index 0000000..52ed3b0 --- /dev/null +++ b/node_modules/events/LICENSE @@ -0,0 +1,22 @@ +MIT + +Copyright Joyent, Inc. and other Node contributors. + +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. diff --git a/node_modules/events/Readme.md b/node_modules/events/Readme.md new file mode 100644 index 0000000..1d17515 --- /dev/null +++ b/node_modules/events/Readme.md @@ -0,0 +1,48 @@ +# events [![Build Status](https://travis-ci.org/Gozala/events.png?branch=master)](https://travis-ci.org/Gozala/events) + +> Node's event emitter for all engines. + +This implements the Node.js [`events`](http://nodejs.org/api/events.html) module for environments that do not have it, like browsers. + +> `events` currently matches the **Node.js 11.12.0** API. + +Note that the `events` module uses ES5 features. If you need to support very old browsers like IE8, use a shim like [`es5-shim`](https://www.npmjs.com/package/es5-shim). You need both the shim and the sham versions of `es5-shim`. + +This module is maintained, but only by very few people. If you'd like to help, let us know in the [Maintainer Needed](https://github.com/Gozala/events/issues/43) issue! + +## Install + +You usually do not have to install `events` yourself! If your code runs in Node.js, `events` is built in. If your code runs in the browser, bundlers like [browserify](https://github.com/browserify/browserify) or [webpack](https://github.com/webpack/webpack) also include the `events` module. + +But if none of those apply, with npm do: + +``` +npm install events +``` + +## Usage + +```javascript +var EventEmitter = require('events') + +var ee = new EventEmitter() +ee.on('message', function (text) { + console.log(text) +}) +ee.emit('message', 'hello world') +``` + +## API + +See the [Node.js EventEmitter docs](http://nodejs.org/api/events.html). `events` currently matches the Node.js 11.12.0 API. + +## Contributing + +PRs are very welcome! The main way to contribute to `events` is by porting features, bugfixes and tests from Node.js. Ideally, code contributions to this module are copy-pasted from Node.js and transpiled to ES5, rather than reimplemented from scratch. Matching the Node.js code as closely as possible makes maintenance simpler when new changes land in Node.js. +This module intends to provide exactly the same API as Node.js, so features that are not available in the core `events` module will not be accepted. Feature requests should instead be directed at [nodejs/node](https://github.com/nodejs/node) and will be added to this module once they are implemented in Node.js. + +If there is a difference in behaviour between Node.js's `events` module and this module, please open an issue! + +## License + +[MIT](./LICENSE) diff --git a/node_modules/events/events.js b/node_modules/events/events.js new file mode 100644 index 0000000..916be8b --- /dev/null +++ b/node_modules/events/events.js @@ -0,0 +1,446 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +'use strict'; + +var R = typeof Reflect === 'object' ? Reflect : null +var ReflectApply = R && typeof R.apply === 'function' + ? R.apply + : function ReflectApply(target, receiver, args) { + return Function.prototype.apply.call(target, receiver, args); + } + +var ReflectOwnKeys +if (R && typeof R.ownKeys === 'function') { + ReflectOwnKeys = R.ownKeys +} else if (Object.getOwnPropertySymbols) { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target) + .concat(Object.getOwnPropertySymbols(target)); + }; +} else { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target); + }; +} + +function ProcessEmitWarning(warning) { + if (console && console.warn) console.warn(warning); +} + +var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { + return value !== value; +} + +function EventEmitter() { + EventEmitter.init.call(this); +} +module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._eventsCount = 0; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +var defaultMaxListeners = 10; + +function checkListener(listener) { + if (typeof listener !== 'function') { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } +} + +Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + enumerable: true, + get: function() { + return defaultMaxListeners; + }, + set: function(arg) { + if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { + throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); + } + defaultMaxListeners = arg; + } +}); + +EventEmitter.init = function() { + + if (this._events === undefined || + this._events === Object.getPrototypeOf(this)._events) { + this._events = Object.create(null); + this._eventsCount = 0; + } + + this._maxListeners = this._maxListeners || undefined; +}; + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { + if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { + throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); + } + this._maxListeners = n; + return this; +}; + +function _getMaxListeners(that) { + if (that._maxListeners === undefined) + return EventEmitter.defaultMaxListeners; + return that._maxListeners; +} + +EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return _getMaxListeners(this); +}; + +EventEmitter.prototype.emit = function emit(type) { + var args = []; + for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); + var doError = (type === 'error'); + + var events = this._events; + if (events !== undefined) + doError = (doError && events.error === undefined); + else if (!doError) + return false; + + // If there is no 'error' event listener then throw. + if (doError) { + var er; + if (args.length > 0) + er = args[0]; + if (er instanceof Error) { + // Note: The comments on the `throw` lines are intentional, they show + // up in Node's output if this results in an unhandled exception. + throw er; // Unhandled 'error' event + } + // At least give some kind of context to the user + var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); + err.context = er; + throw err; // Unhandled 'error' event + } + + var handler = events[type]; + + if (handler === undefined) + return false; + + if (typeof handler === 'function') { + ReflectApply(handler, this, args); + } else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + ReflectApply(listeners[i], this, args); + } + + return true; +}; + +function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; + + checkListener(listener); + + events = target._events; + if (events === undefined) { + events = target._events = Object.create(null); + target._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener !== undefined) { + target.emit('newListener', type, + listener.listener ? listener.listener : listener); + + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = target._events; + } + existing = events[type]; + } + + if (existing === undefined) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === 'function') { + // Adding the second element, need to change to array. + existing = events[type] = + prepend ? [listener, existing] : [existing, listener]; + // If we've already got an array, just append. + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + + // Check for listener leak + m = _getMaxListeners(target); + if (m > 0 && existing.length > m && !existing.warned) { + existing.warned = true; + // No error code for this since it is a Warning + // eslint-disable-next-line no-restricted-syntax + var w = new Error('Possible EventEmitter memory leak detected. ' + + existing.length + ' ' + String(type) + ' listeners ' + + 'added. Use emitter.setMaxListeners() to ' + + 'increase limit'); + w.name = 'MaxListenersExceededWarning'; + w.emitter = target; + w.type = type; + w.count = existing.length; + ProcessEmitWarning(w); + } + } + + return target; +} + +EventEmitter.prototype.addListener = function addListener(type, listener) { + return _addListener(this, type, listener, false); +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.prependListener = + function prependListener(type, listener) { + return _addListener(this, type, listener, true); + }; + +function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + if (arguments.length === 0) + return this.listener.call(this.target); + return this.listener.apply(this.target, arguments); + } +} + +function _onceWrap(target, type, listener) { + var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; + var wrapped = onceWrapper.bind(state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; +} + +EventEmitter.prototype.once = function once(type, listener) { + checkListener(listener); + this.on(type, _onceWrap(this, type, listener)); + return this; +}; + +EventEmitter.prototype.prependOnceListener = + function prependOnceListener(type, listener) { + checkListener(listener); + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; + +// Emits a 'removeListener' event if and only if the listener was removed. +EventEmitter.prototype.removeListener = + function removeListener(type, listener) { + var list, events, position, i, originalListener; + + checkListener(listener); + + events = this._events; + if (events === undefined) + return this; + + list = events[type]; + if (list === undefined) + return this; + + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else { + delete events[type]; + if (events.removeListener) + this.emit('removeListener', type, list.listener || listener); + } + } else if (typeof list !== 'function') { + position = -1; + + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } + } + + if (position < 0) + return this; + + if (position === 0) + list.shift(); + else { + spliceOne(list, position); + } + + if (list.length === 1) + events[type] = list[0]; + + if (events.removeListener !== undefined) + this.emit('removeListener', type, originalListener || listener); + } + + return this; + }; + +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + +EventEmitter.prototype.removeAllListeners = + function removeAllListeners(type) { + var listeners, events, i; + + events = this._events; + if (events === undefined) + return this; + + // not listening for removeListener, no need to emit + if (events.removeListener === undefined) { + if (arguments.length === 0) { + this._events = Object.create(null); + this._eventsCount = 0; + } else if (events[type] !== undefined) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else + delete events[type]; + } + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + var keys = Object.keys(events); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = Object.create(null); + this._eventsCount = 0; + return this; + } + + listeners = events[type]; + + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners !== undefined) { + // LIFO order + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } + + return this; + }; + +function _listeners(target, type, unwrap) { + var events = target._events; + + if (events === undefined) + return []; + + var evlistener = events[type]; + if (evlistener === undefined) + return []; + + if (typeof evlistener === 'function') + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + + return unwrap ? + unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); +} + +EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); +}; + +EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); +}; + +EventEmitter.listenerCount = function(emitter, type) { + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } +}; + +EventEmitter.prototype.listenerCount = listenerCount; +function listenerCount(type) { + var events = this._events; + + if (events !== undefined) { + var evlistener = events[type]; + + if (typeof evlistener === 'function') { + return 1; + } else if (evlistener !== undefined) { + return evlistener.length; + } + } + + return 0; +} + +EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; +}; + +function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) + copy[i] = arr[i]; + return copy; +} + +function spliceOne(list, index) { + for (; index + 1 < list.length; index++) + list[index] = list[index + 1]; + list.pop(); +} + +function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + return ret; +} diff --git a/node_modules/events/package.json b/node_modules/events/package.json new file mode 100644 index 0000000..1ed1b13 --- /dev/null +++ b/node_modules/events/package.json @@ -0,0 +1,65 @@ +{ + "_from": "events@^3.0.0", + "_id": "events@3.1.0", + "_inBundle": false, + "_integrity": "sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg==", + "_location": "/events", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "events@^3.0.0", + "name": "events", + "escapedName": "events", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/node-libs-browser" + ], + "_resolved": "https://registry.npmjs.org/events/-/events-3.1.0.tgz", + "_shasum": "84279af1b34cb75aa88bf5ff291f6d0bd9b31a59", + "_spec": "events@^3.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/node-libs-browser", + "author": { + "name": "Irakli Gozalishvili", + "email": "rfobic@gmail.com", + "url": "http://jeditoolkit.com" + }, + "bugs": { + "url": "http://github.com/Gozala/events/issues/" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Node's event emitter for all engines.", + "devDependencies": { + "airtap": "^1.0.0", + "isarray": "^2.0.2", + "tape": "^4.8.0" + }, + "engines": { + "node": ">=0.8.x" + }, + "homepage": "https://github.com/Gozala/events#readme", + "id": "events", + "keywords": [ + "events", + "eventEmitter", + "eventDispatcher", + "listeners" + ], + "license": "MIT", + "main": "./events.js", + "name": "events", + "repository": { + "type": "git", + "url": "git://github.com/Gozala/events.git", + "web": "https://github.com/Gozala/events" + }, + "scripts": { + "test": "node tests/index.js", + "test:browsers": "airtap -- tests/index.js" + }, + "version": "3.1.0" +} diff --git a/node_modules/events/security.md b/node_modules/events/security.md new file mode 100644 index 0000000..a14ace6 --- /dev/null +++ b/node_modules/events/security.md @@ -0,0 +1,10 @@ +# Security Policy + +## Supported Versions +Only the latest major version is supported at any given time. + +## Reporting a Vulnerability + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. diff --git a/node_modules/events/tests/add-listeners.js b/node_modules/events/tests/add-listeners.js new file mode 100644 index 0000000..9b57827 --- /dev/null +++ b/node_modules/events/tests/add-listeners.js @@ -0,0 +1,111 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +var common = require('./common'); +var assert = require('assert'); +var EventEmitter = require('../'); + +{ + var ee = new EventEmitter(); + var events_new_listener_emitted = []; + var listeners_new_listener_emitted = []; + + // Sanity check + assert.strictEqual(ee.addListener, ee.on); + + ee.on('newListener', function(event, listener) { + // Don't track newListener listeners. + if (event === 'newListener') + return; + + events_new_listener_emitted.push(event); + listeners_new_listener_emitted.push(listener); + }); + + var hello = common.mustCall(function(a, b) { + assert.strictEqual('a', a); + assert.strictEqual('b', b); + }); + + ee.once('newListener', function(name, listener) { + assert.strictEqual(name, 'hello'); + assert.strictEqual(listener, hello); + + var listeners = this.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + }); + + ee.on('hello', hello); + ee.once('foo', assert.fail); + + assert.ok(Array.isArray(events_new_listener_emitted)); + assert.strictEqual(events_new_listener_emitted.length, 2); + assert.strictEqual(events_new_listener_emitted[0], 'hello'); + assert.strictEqual(events_new_listener_emitted[1], 'foo'); + + assert.ok(Array.isArray(listeners_new_listener_emitted)); + assert.strictEqual(listeners_new_listener_emitted.length, 2); + assert.strictEqual(listeners_new_listener_emitted[0], hello); + assert.strictEqual(listeners_new_listener_emitted[1], assert.fail); + + ee.emit('hello', 'a', 'b'); +} + +// just make sure that this doesn't throw: +{ + var f = new EventEmitter(); + + f.setMaxListeners(0); +} + +{ + var listen1 = function() {}; + var listen2 = function() {}; + var ee = new EventEmitter(); + + ee.once('newListener', function() { + var listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + ee.once('newListener', function() { + var listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + }); + ee.on('hello', listen2); + }); + ee.on('hello', listen1); + // The order of listeners on an event is not always the order in which the + // listeners were added. + var listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 2); + assert.strictEqual(listeners[0], listen2); + assert.strictEqual(listeners[1], listen1); +} + +// Verify that the listener must be a function +assert.throws(function() { + var ee = new EventEmitter(); + + ee.on('foo', null); +}, /^TypeError: The "listener" argument must be of type Function. Received type object$/); diff --git a/node_modules/events/tests/check-listener-leaks.js b/node_modules/events/tests/check-listener-leaks.js new file mode 100644 index 0000000..7fce48f --- /dev/null +++ b/node_modules/events/tests/check-listener-leaks.js @@ -0,0 +1,101 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +var common = require('./common'); +var assert = require('assert'); +var events = require('../'); + +// Redirect warning output to tape. +var consoleWarn = console.warn; +console.warn = common.test.comment; + +common.test.on('end', function () { + console.warn = consoleWarn; +}); + +// default +{ + var e = new events.EventEmitter(); + + for (var i = 0; i < 10; i++) { + e.on('default', common.mustNotCall()); + } + assert.ok(!e._events['default'].hasOwnProperty('warned')); + e.on('default', common.mustNotCall()); + assert.ok(e._events['default'].warned); + + // specific + e.setMaxListeners(5); + for (var i = 0; i < 5; i++) { + e.on('specific', common.mustNotCall()); + } + assert.ok(!e._events['specific'].hasOwnProperty('warned')); + e.on('specific', common.mustNotCall()); + assert.ok(e._events['specific'].warned); + + // only one + e.setMaxListeners(1); + e.on('only one', common.mustNotCall()); + assert.ok(!e._events['only one'].hasOwnProperty('warned')); + e.on('only one', common.mustNotCall()); + assert.ok(e._events['only one'].hasOwnProperty('warned')); + + // unlimited + e.setMaxListeners(0); + for (var i = 0; i < 1000; i++) { + e.on('unlimited', common.mustNotCall()); + } + assert.ok(!e._events['unlimited'].hasOwnProperty('warned')); +} + +// process-wide +{ + events.EventEmitter.defaultMaxListeners = 42; + var e = new events.EventEmitter(); + + for (var i = 0; i < 42; ++i) { + e.on('fortytwo', common.mustNotCall()); + } + assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); + e.on('fortytwo', common.mustNotCall()); + assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); + delete e._events['fortytwo'].warned; + + events.EventEmitter.defaultMaxListeners = 44; + e.on('fortytwo', common.mustNotCall()); + assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); + e.on('fortytwo', common.mustNotCall()); + assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); +} + +// but _maxListeners still has precedence over defaultMaxListeners +{ + events.EventEmitter.defaultMaxListeners = 42; + var e = new events.EventEmitter(); + e.setMaxListeners(1); + e.on('uno', common.mustNotCall()); + assert.ok(!e._events['uno'].hasOwnProperty('warned')); + e.on('uno', common.mustNotCall()); + assert.ok(e._events['uno'].hasOwnProperty('warned')); + + // chainable + assert.strictEqual(e, e.setMaxListeners(1)); +} diff --git a/node_modules/events/tests/common.js b/node_modules/events/tests/common.js new file mode 100644 index 0000000..49569b0 --- /dev/null +++ b/node_modules/events/tests/common.js @@ -0,0 +1,104 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +var test = require('tape'); +var assert = require('assert'); + +var noop = function() {}; + +var mustCallChecks = []; + +function runCallChecks(exitCode) { + if (exitCode !== 0) return; + + var failed = filter(mustCallChecks, function(context) { + if ('minimum' in context) { + context.messageSegment = 'at least ' + context.minimum; + return context.actual < context.minimum; + } else { + context.messageSegment = 'exactly ' + context.exact; + return context.actual !== context.exact; + } + }); + + for (var i = 0; i < failed.length; i++) { + var context = failed[i]; + console.log('Mismatched %s function calls. Expected %s, actual %d.', + context.name, + context.messageSegment, + context.actual); + // IE8 has no .stack + if (context.stack) console.log(context.stack.split('\n').slice(2).join('\n')); + } + + assert.strictEqual(failed.length, 0); +} + +exports.mustCall = function(fn, exact) { + return _mustCallInner(fn, exact, 'exact'); +}; + +function _mustCallInner(fn, criteria, field) { + if (typeof criteria == 'undefined') criteria = 1; + + if (typeof fn === 'number') { + criteria = fn; + fn = noop; + } else if (fn === undefined) { + fn = noop; + } + + if (typeof criteria !== 'number') + throw new TypeError('Invalid ' + field + ' value: ' + criteria); + + var context = { + actual: 0, + stack: (new Error()).stack, + name: fn.name || '' + }; + + context[field] = criteria; + + // add the exit listener only once to avoid listener leak warnings + if (mustCallChecks.length === 0) test.onFinish(function() { runCallChecks(0); }); + + mustCallChecks.push(context); + + return function() { + context.actual++; + return fn.apply(this, arguments); + }; +} + +exports.mustNotCall = function(msg) { + return function mustNotCall() { + assert.fail(msg || 'function should not have been called'); + }; +}; + +function filter(arr, fn) { + if (arr.filter) return arr.filter(fn); + var filtered = []; + for (var i = 0; i < arr.length; i++) { + if (fn(arr[i], i, arr)) filtered.push(arr[i]); + } + return filtered +} diff --git a/node_modules/events/tests/errors.js b/node_modules/events/tests/errors.js new file mode 100644 index 0000000..a23df43 --- /dev/null +++ b/node_modules/events/tests/errors.js @@ -0,0 +1,13 @@ +'use strict'; +var assert = require('assert'); +var EventEmitter = require('../'); + +var EE = new EventEmitter(); + +assert.throws(function () { + EE.emit('error', 'Accepts a string'); +}, 'Error: Unhandled error. (Accepts a string)'); + +assert.throws(function () { + EE.emit('error', { message: 'Error!' }); +}, 'Unhandled error. ([object Object])'); diff --git a/node_modules/events/tests/events-list.js b/node_modules/events/tests/events-list.js new file mode 100644 index 0000000..08aa621 --- /dev/null +++ b/node_modules/events/tests/events-list.js @@ -0,0 +1,28 @@ +'use strict'; + +var EventEmitter = require('../'); +var assert = require('assert'); + +var EE = new EventEmitter(); +var m = function() {}; +EE.on('foo', function() {}); +assert.equal(1, EE.eventNames().length); +assert.equal('foo', EE.eventNames()[0]); +EE.on('bar', m); +assert.equal(2, EE.eventNames().length); +assert.equal('foo', EE.eventNames()[0]); +assert.equal('bar', EE.eventNames()[1]); +EE.removeListener('bar', m); +assert.equal(1, EE.eventNames().length); +assert.equal('foo', EE.eventNames()[0]); + +if (typeof Symbol !== 'undefined') { + var s = Symbol('s'); + EE.on(s, m); + assert.equal(2, EE.eventNames().length); + assert.equal('foo', EE.eventNames()[0]); + assert.equal(s, EE.eventNames()[1]); + EE.removeListener(s, m); + assert.equal(1, EE.eventNames().length); + assert.equal('foo', EE.eventNames()[0]); +} diff --git a/node_modules/events/tests/index.js b/node_modules/events/tests/index.js new file mode 100644 index 0000000..1f06256 --- /dev/null +++ b/node_modules/events/tests/index.js @@ -0,0 +1,48 @@ +var test = require('tape'); + +require('./legacy-compat'); +var common = require('./common'); + +// we do this to easily wrap each file in a mocha test +// and also have browserify be able to statically analyze this file +var orig_require = require; +var require = function(file) { + test(file, function(t) { + // Store the tape object so tests can access it. + t.on('end', function () { delete common.test; }); + common.test = t; + + try { orig_require(file); } catch (err) { t.fail(err); } + t.end(); + }); +}; + +require('./add-listeners.js'); +require('./check-listener-leaks.js'); +require('./errors.js'); +require('./events-list.js'); +require('./listener-count.js'); +require('./listeners-side-effects.js'); +require('./listeners.js'); +require('./max-listeners.js'); +if ((function A () {}).name === 'A') { + require('./method-names.js'); +} else { + // Function.name is not supported in IE + test('./method-names.js', { skip: true }, function () {}); +} +require('./modify-in-emit.js'); +require('./num-args.js'); +require('./once.js'); +require('./prepend.js'); +require('./set-max-listeners-side-effects.js'); +require('./special-event-names.js'); +require('./subclass.js'); +if (typeof Symbol === 'function') { + require('./symbols.js'); +} else { + // Symbol is not available. + test('./symbols.js', { skip: true }, function () {}); +} +require('./remove-all-listeners.js'); +require('./remove-listeners.js'); diff --git a/node_modules/events/tests/legacy-compat.js b/node_modules/events/tests/legacy-compat.js new file mode 100644 index 0000000..a402be6 --- /dev/null +++ b/node_modules/events/tests/legacy-compat.js @@ -0,0 +1,16 @@ +// sigh... life is hard +if (!global.console) { + console = {} +} + +var fns = ['log', 'error', 'trace']; +for (var i=0 ; ifoo should not be emitted'); +} + +e.once('foo', remove); +e.removeListener('foo', remove); +e.emit('foo'); + +e.once('e', common.mustCall(function() { + e.emit('e'); +})); + +e.once('e', common.mustCall()); + +e.emit('e'); + +// Verify that the listener must be a function +assert.throws(function() { + var ee = new EventEmitter(); + + ee.once('foo', null); +}, /^TypeError: The "listener" argument must be of type Function. Received type object$/); + +{ + // once() has different code paths based on the number of arguments being + // emitted. Verify that all of the cases are covered. + var maxArgs = 4; + + for (var i = 0; i <= maxArgs; ++i) { + var ee = new EventEmitter(); + var args = ['foo']; + + for (var j = 0; j < i; ++j) + args.push(j); + + ee.once('foo', common.mustCall(function() { + var params = Array.prototype.slice.call(arguments); + var restArgs = args.slice(1); + assert.ok(Array.isArray(params)); + assert.strictEqual(params.length, restArgs.length); + for (var index = 0; index < params.length; index++) { + var param = params[index]; + assert.strictEqual(param, restArgs[index]); + } + })); + + EventEmitter.prototype.emit.apply(ee, args); + } +} diff --git a/node_modules/events/tests/prepend.js b/node_modules/events/tests/prepend.js new file mode 100644 index 0000000..79afde0 --- /dev/null +++ b/node_modules/events/tests/prepend.js @@ -0,0 +1,31 @@ +'use strict'; + +var common = require('./common'); +var EventEmitter = require('../'); +var assert = require('assert'); + +var myEE = new EventEmitter(); +var m = 0; +// This one comes last. +myEE.on('foo', common.mustCall(function () { + assert.strictEqual(m, 2); +})); + +// This one comes second. +myEE.prependListener('foo', common.mustCall(function () { + assert.strictEqual(m++, 1); +})); + +// This one comes first. +myEE.prependOnceListener('foo', + common.mustCall(function () { + assert.strictEqual(m++, 0); + })); + +myEE.emit('foo'); + +// Verify that the listener must be a function +assert.throws(function () { + var ee = new EventEmitter(); + ee.prependOnceListener('foo', null); +}, 'TypeError: The "listener" argument must be of type Function. Received type object'); diff --git a/node_modules/events/tests/remove-all-listeners.js b/node_modules/events/tests/remove-all-listeners.js new file mode 100644 index 0000000..622941c --- /dev/null +++ b/node_modules/events/tests/remove-all-listeners.js @@ -0,0 +1,133 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +var common = require('./common'); +var assert = require('assert'); +var events = require('../'); +var test = require('tape'); + +function expect(expected) { + var actual = []; + test.onFinish(function() { + var sortedActual = actual.sort(); + var sortedExpected = expected.sort(); + assert.strictEqual(sortedActual.length, sortedExpected.length); + for (var index = 0; index < sortedActual.length; index++) { + var value = sortedActual[index]; + assert.strictEqual(value, sortedExpected[index]); + } + }); + function listener(name) { + actual.push(name); + } + return common.mustCall(listener, expected.length); +} + +{ + var ee = new events.EventEmitter(); + var noop = common.mustNotCall(); + ee.on('foo', noop); + ee.on('bar', noop); + ee.on('baz', noop); + ee.on('baz', noop); + var fooListeners = ee.listeners('foo'); + var barListeners = ee.listeners('bar'); + var bazListeners = ee.listeners('baz'); + ee.on('removeListener', expect(['bar', 'baz', 'baz'])); + ee.removeAllListeners('bar'); + ee.removeAllListeners('baz'); + + var listeners = ee.listeners('foo'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 1); + assert.strictEqual(listeners[0], noop); + + listeners = ee.listeners('bar'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + listeners = ee.listeners('baz'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + // After calling removeAllListeners(), + // the old listeners array should stay unchanged. + assert.strictEqual(fooListeners.length, 1); + assert.strictEqual(fooListeners[0], noop); + assert.strictEqual(barListeners.length, 1); + assert.strictEqual(barListeners[0], noop); + assert.strictEqual(bazListeners.length, 2); + assert.strictEqual(bazListeners[0], noop); + assert.strictEqual(bazListeners[1], noop); + // After calling removeAllListeners(), + // new listeners arrays is different from the old. + assert.notStrictEqual(ee.listeners('bar'), barListeners); + assert.notStrictEqual(ee.listeners('baz'), bazListeners); +} + +{ + var ee = new events.EventEmitter(); + ee.on('foo', common.mustNotCall()); + ee.on('bar', common.mustNotCall()); + // Expect LIFO order + ee.on('removeListener', expect(['foo', 'bar', 'removeListener'])); + ee.on('removeListener', expect(['foo', 'bar'])); + ee.removeAllListeners(); + + var listeners = ee.listeners('foo'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + listeners = ee.listeners('bar'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); +} + +{ + var ee = new events.EventEmitter(); + ee.on('removeListener', common.mustNotCall()); + // Check for regression where removeAllListeners() throws when + // there exists a 'removeListener' listener, but there exists + // no listeners for the provided event type. + assert.doesNotThrow(function () { ee.removeAllListeners(ee, 'foo') }); +} + +{ + var ee = new events.EventEmitter(); + var expectLength = 2; + ee.on('removeListener', function() { + assert.strictEqual(expectLength--, this.listeners('baz').length); + }); + ee.on('baz', common.mustNotCall()); + ee.on('baz', common.mustNotCall()); + ee.on('baz', common.mustNotCall()); + assert.strictEqual(ee.listeners('baz').length, expectLength + 1); + ee.removeAllListeners('baz'); + assert.strictEqual(ee.listeners('baz').length, 0); +} + +{ + var ee = new events.EventEmitter(); + assert.strictEqual(ee, ee.removeAllListeners()); +} + +{ + var ee = new events.EventEmitter(); + ee._events = undefined; + assert.strictEqual(ee, ee.removeAllListeners()); +} diff --git a/node_modules/events/tests/remove-listeners.js b/node_modules/events/tests/remove-listeners.js new file mode 100644 index 0000000..18e4d16 --- /dev/null +++ b/node_modules/events/tests/remove-listeners.js @@ -0,0 +1,212 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +var common = require('./common'); +var assert = require('assert'); +var EventEmitter = require('../'); + +var listener1 = function listener1() {}; +var listener2 = function listener2() {}; + +{ + var ee = new EventEmitter(); + ee.on('hello', listener1); + ee.on('removeListener', common.mustCall(function(name, cb) { + assert.strictEqual(name, 'hello'); + assert.strictEqual(cb, listener1); + })); + ee.removeListener('hello', listener1); + var listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); +} + +{ + var ee = new EventEmitter(); + ee.on('hello', listener1); + ee.on('removeListener', common.mustNotCall()); + ee.removeListener('hello', listener2); + + var listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 1); + assert.strictEqual(listeners[0], listener1); +} + +{ + var ee = new EventEmitter(); + ee.on('hello', listener1); + ee.on('hello', listener2); + + var listeners; + ee.once('removeListener', common.mustCall(function(name, cb) { + assert.strictEqual(name, 'hello'); + assert.strictEqual(cb, listener1); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 1); + assert.strictEqual(listeners[0], listener2); + })); + ee.removeListener('hello', listener1); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 1); + assert.strictEqual(listeners[0], listener2); + ee.once('removeListener', common.mustCall(function(name, cb) { + assert.strictEqual(name, 'hello'); + assert.strictEqual(cb, listener2); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + })); + ee.removeListener('hello', listener2); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); +} + +{ + var ee = new EventEmitter(); + + function remove1() { + assert.fail('remove1 should not have been called'); + } + + function remove2() { + assert.fail('remove2 should not have been called'); + } + + ee.on('removeListener', common.mustCall(function(name, cb) { + if (cb !== remove1) return; + this.removeListener('quux', remove2); + this.emit('quux'); + }, 2)); + ee.on('quux', remove1); + ee.on('quux', remove2); + ee.removeListener('quux', remove1); +} + +{ + var ee = new EventEmitter(); + ee.on('hello', listener1); + ee.on('hello', listener2); + + var listeners; + ee.once('removeListener', common.mustCall(function(name, cb) { + assert.strictEqual(name, 'hello'); + assert.strictEqual(cb, listener1); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 1); + assert.strictEqual(listeners[0], listener2); + ee.once('removeListener', common.mustCall(function(name, cb) { + assert.strictEqual(name, 'hello'); + assert.strictEqual(cb, listener2); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + })); + ee.removeListener('hello', listener2); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + })); + ee.removeListener('hello', listener1); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); +} + +{ + var ee = new EventEmitter(); + var listener3 = common.mustCall(function() { + ee.removeListener('hello', listener4); + }, 2); + var listener4 = common.mustCall(); + + ee.on('hello', listener3); + ee.on('hello', listener4); + + // listener4 will still be called although it is removed by listener 3. + ee.emit('hello'); + // This is so because the interal listener array at time of emit + // was [listener3,listener4] + + // Interal listener array [listener3] + ee.emit('hello'); +} + +{ + var ee = new EventEmitter(); + + ee.once('hello', listener1); + ee.on('removeListener', common.mustCall(function(eventName, listener) { + assert.strictEqual(eventName, 'hello'); + assert.strictEqual(listener, listener1); + })); + ee.emit('hello'); +} + +{ + var ee = new EventEmitter(); + + assert.strictEqual(ee, ee.removeListener('foo', function() {})); +} + +// Verify that the removed listener must be a function +assert.throws(function() { + var ee = new EventEmitter(); + + ee.removeListener('foo', null); +}, /^TypeError: The "listener" argument must be of type Function\. Received type object$/); + +{ + var ee = new EventEmitter(); + var listener = function() {}; + ee._events = undefined; + var e = ee.removeListener('foo', listener); + assert.strictEqual(e, ee); +} + +{ + var ee = new EventEmitter(); + + ee.on('foo', listener1); + ee.on('foo', listener2); + var listeners = ee.listeners('foo'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 2); + assert.strictEqual(listeners[0], listener1); + assert.strictEqual(listeners[1], listener2); + + ee.removeListener('foo', listener1); + assert.strictEqual(ee._events.foo, listener2); + + ee.on('foo', listener1); + listeners = ee.listeners('foo'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 2); + assert.strictEqual(listeners[0], listener2); + assert.strictEqual(listeners[1], listener1); + + ee.removeListener('foo', listener1); + assert.strictEqual(ee._events.foo, listener2); +} diff --git a/node_modules/events/tests/set-max-listeners-side-effects.js b/node_modules/events/tests/set-max-listeners-side-effects.js new file mode 100644 index 0000000..13dbb67 --- /dev/null +++ b/node_modules/events/tests/set-max-listeners-side-effects.js @@ -0,0 +1,31 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +require('./common'); +var assert = require('assert'); +var events = require('../'); + +var e = new events.EventEmitter(); + +if (Object.create) assert.ok(!(e._events instanceof Object)); +assert.strictEqual(Object.keys(e._events).length, 0); +e.setMaxListeners(5); +assert.strictEqual(Object.keys(e._events).length, 0); diff --git a/node_modules/events/tests/special-event-names.js b/node_modules/events/tests/special-event-names.js new file mode 100644 index 0000000..a2f0b74 --- /dev/null +++ b/node_modules/events/tests/special-event-names.js @@ -0,0 +1,45 @@ +'use strict'; + +var common = require('./common'); +var EventEmitter = require('../'); +var assert = require('assert'); + +var ee = new EventEmitter(); +var handler = function() {}; + +assert.strictEqual(ee.eventNames().length, 0); + +assert.strictEqual(ee._events.hasOwnProperty, undefined); +assert.strictEqual(ee._events.toString, undefined); + +ee.on('__defineGetter__', handler); +ee.on('toString', handler); +ee.on('__proto__', handler); + +assert.strictEqual(ee.eventNames()[0], '__defineGetter__'); +assert.strictEqual(ee.eventNames()[1], 'toString'); + +assert.strictEqual(ee.listeners('__defineGetter__').length, 1); +assert.strictEqual(ee.listeners('__defineGetter__')[0], handler); +assert.strictEqual(ee.listeners('toString').length, 1); +assert.strictEqual(ee.listeners('toString')[0], handler); + +// Only run __proto__ tests if that property can actually be set +if ({ __proto__: 'ok' }.__proto__ === 'ok') { + assert.strictEqual(ee.eventNames().length, 3); + assert.strictEqual(ee.eventNames()[2], '__proto__'); + assert.strictEqual(ee.listeners('__proto__').length, 1); + assert.strictEqual(ee.listeners('__proto__')[0], handler); + + ee.on('__proto__', common.mustCall(function(val) { + assert.strictEqual(val, 1); + })); + ee.emit('__proto__', 1); + + process.on('__proto__', common.mustCall(function(val) { + assert.strictEqual(val, 1); + })); + process.emit('__proto__', 1); +} else { + console.log('# skipped __proto__') +} diff --git a/node_modules/events/tests/subclass.js b/node_modules/events/tests/subclass.js new file mode 100644 index 0000000..bd033ff --- /dev/null +++ b/node_modules/events/tests/subclass.js @@ -0,0 +1,66 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +var common = require('./common'); +var test = require('tape'); +var assert = require('assert'); +var EventEmitter = require('../').EventEmitter; +var util = require('util'); + +util.inherits(MyEE, EventEmitter); + +function MyEE(cb) { + this.once(1, cb); + this.emit(1); + this.removeAllListeners(); + EventEmitter.call(this); +} + +var myee = new MyEE(common.mustCall()); + + +util.inherits(ErrorEE, EventEmitter); +function ErrorEE() { + this.emit('error', new Error('blerg')); +} + +assert.throws(function() { + new ErrorEE(); +}, /blerg/); + +test.onFinish(function() { + assert.ok(!(myee._events instanceof Object)); + assert.strictEqual(Object.keys(myee._events).length, 0); +}); + + +function MyEE2() { + EventEmitter.call(this); +} + +MyEE2.prototype = new EventEmitter(); + +var ee1 = new MyEE2(); +var ee2 = new MyEE2(); + +ee1.on('x', function() {}); + +assert.strictEqual(ee2.listenerCount('x'), 0); diff --git a/node_modules/events/tests/symbols.js b/node_modules/events/tests/symbols.js new file mode 100644 index 0000000..0721f0e --- /dev/null +++ b/node_modules/events/tests/symbols.js @@ -0,0 +1,25 @@ +'use strict'; + +var common = require('./common'); +var EventEmitter = require('../'); +var assert = require('assert'); + +var ee = new EventEmitter(); +var foo = Symbol('foo'); +var listener = common.mustCall(); + +ee.on(foo, listener); +assert.strictEqual(ee.listeners(foo).length, 1); +assert.strictEqual(ee.listeners(foo)[0], listener); + +ee.emit(foo); + +ee.removeAllListeners(); +assert.strictEqual(ee.listeners(foo).length, 0); + +ee.on(foo, listener); +assert.strictEqual(ee.listeners(foo).length, 1); +assert.strictEqual(ee.listeners(foo)[0], listener); + +ee.removeListener(foo, listener); +assert.strictEqual(ee.listeners(foo).length, 0); diff --git a/node_modules/evp_bytestokey/LICENSE b/node_modules/evp_bytestokey/LICENSE new file mode 100644 index 0000000..f06007a --- /dev/null +++ b/node_modules/evp_bytestokey/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 crypto-browserify contributors + +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. diff --git a/node_modules/evp_bytestokey/README.md b/node_modules/evp_bytestokey/README.md new file mode 100644 index 0000000..36da238 --- /dev/null +++ b/node_modules/evp_bytestokey/README.md @@ -0,0 +1,51 @@ +# EVP\_BytesToKey +[![NPM Package](https://img.shields.io/npm/v/evp_bytestokey.svg?style=flat-square)](https://www.npmjs.org/package/evp_bytestokey) +[![Build Status](https://img.shields.io/travis/crypto-browserify/EVP_BytesToKey.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/EVP_BytesToKey) +[![Dependency status](https://img.shields.io/david/crypto-browserify/EVP_BytesToKey.svg?style=flat-square)](https://david-dm.org/crypto-browserify/EVP_BytesToKey#info=dependencies) + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +The insecure [key derivation algorithm from OpenSSL.][1] + +**WARNING: DO NOT USE, except for compatibility reasons.** + +MD5 is insecure. + +Use at least `scrypt` or `pbkdf2-hmac-sha256` instead. + + +## API +`EVP_BytesToKey(password, salt, keyLen, ivLen)` + +* `password` - `Buffer`, password used to derive the key data. +* `salt` - 8 byte `Buffer` or `null`, salt is used as a salt in the derivation. +* `keyBits` - `number`, key length in **bits**. +* `ivLen` - `number`, iv length in bytes. + +*Returns*: `{ key: Buffer, iv: Buffer }` + + +## Examples +MD5 with `aes-256-cbc`: + +```js +const crypto = require('crypto') +const EVP_BytesToKey = require('evp_bytestokey') + +const result = EVP_BytesToKey( + 'my-secret-password', + null, + 32, + 16 +) +// => +// { key: , +// iv: } + +const cipher = crypto.createCipheriv('aes-256-cbc', result.key, result.iv) +``` + +## LICENSE [MIT](LICENSE) + +[1]: https://wiki.openssl.org/index.php/Manual:EVP_BytesToKey(3) +[2]: https://nodejs.org/api/crypto.html#crypto_class_hash diff --git a/node_modules/evp_bytestokey/index.js b/node_modules/evp_bytestokey/index.js new file mode 100644 index 0000000..f9d4757 --- /dev/null +++ b/node_modules/evp_bytestokey/index.js @@ -0,0 +1,45 @@ +var Buffer = require('safe-buffer').Buffer +var MD5 = require('md5.js') + +/* eslint-disable camelcase */ +function EVP_BytesToKey (password, salt, keyBits, ivLen) { + if (!Buffer.isBuffer(password)) password = Buffer.from(password, 'binary') + if (salt) { + if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, 'binary') + if (salt.length !== 8) throw new RangeError('salt should be Buffer with 8 byte length') + } + + var keyLen = keyBits / 8 + var key = Buffer.alloc(keyLen) + var iv = Buffer.alloc(ivLen || 0) + var tmp = Buffer.alloc(0) + + while (keyLen > 0 || ivLen > 0) { + var hash = new MD5() + hash.update(tmp) + hash.update(password) + if (salt) hash.update(salt) + tmp = hash.digest() + + var used = 0 + + if (keyLen > 0) { + var keyStart = key.length - keyLen + used = Math.min(keyLen, tmp.length) + tmp.copy(key, keyStart, 0, used) + keyLen -= used + } + + if (used < tmp.length && ivLen > 0) { + var ivStart = iv.length - ivLen + var length = Math.min(ivLen, tmp.length - used) + tmp.copy(iv, ivStart, used, used + length) + ivLen -= length + } + } + + tmp.fill(0) + return { key: key, iv: iv } +} + +module.exports = EVP_BytesToKey diff --git a/node_modules/evp_bytestokey/package.json b/node_modules/evp_bytestokey/package.json new file mode 100644 index 0000000..115e18a --- /dev/null +++ b/node_modules/evp_bytestokey/package.json @@ -0,0 +1,78 @@ +{ + "_from": "evp_bytestokey@^1.0.0", + "_id": "evp_bytestokey@1.0.3", + "_inBundle": false, + "_integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "_location": "/evp_bytestokey", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "evp_bytestokey@^1.0.0", + "name": "evp_bytestokey", + "escapedName": "evp_bytestokey", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/browserify-aes", + "/browserify-cipher", + "/parse-asn1" + ], + "_resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "_shasum": "7fcbdb198dc71959432efe13842684e0525acb02", + "_spec": "evp_bytestokey@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/browserify-cipher", + "author": { + "name": "Calvin Metcalf", + "email": "calvin.metcalf@gmail.com" + }, + "bugs": { + "url": "https://github.com/crypto-browserify/EVP_BytesToKey/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Kirill Fomichev", + "email": "fanatid@ya.ru" + } + ], + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + }, + "deprecated": false, + "description": "The insecure key derivation algorithm from OpenSSL", + "devDependencies": { + "bindings": "^1.2.1", + "nan": "^2.4.0", + "nyc": "^8.1.0", + "standard": "^8.0.0", + "tape": "^4.6.0" + }, + "files": [ + "index.js" + ], + "gypfile": false, + "homepage": "https://github.com/crypto-browserify/EVP_BytesToKey", + "keywords": [ + "crypto", + "openssl" + ], + "license": "MIT", + "main": "index.js", + "name": "evp_bytestokey", + "repository": { + "type": "git", + "url": "git+https://github.com/crypto-browserify/EVP_BytesToKey.git" + }, + "scripts": { + "coverage": "nyc tape test/*.js", + "lint": "standard", + "test": "npm run lint && npm run unit", + "test:prepare": "node-gyp rebuild", + "unit": "tape test/*.js" + }, + "version": "1.0.3" +} diff --git a/node_modules/execa/index.js b/node_modules/execa/index.js new file mode 100644 index 0000000..aad9ac8 --- /dev/null +++ b/node_modules/execa/index.js @@ -0,0 +1,361 @@ +'use strict'; +const path = require('path'); +const childProcess = require('child_process'); +const crossSpawn = require('cross-spawn'); +const stripEof = require('strip-eof'); +const npmRunPath = require('npm-run-path'); +const isStream = require('is-stream'); +const _getStream = require('get-stream'); +const pFinally = require('p-finally'); +const onExit = require('signal-exit'); +const errname = require('./lib/errname'); +const stdio = require('./lib/stdio'); + +const TEN_MEGABYTES = 1000 * 1000 * 10; + +function handleArgs(cmd, args, opts) { + let parsed; + + opts = Object.assign({ + extendEnv: true, + env: {} + }, opts); + + if (opts.extendEnv) { + opts.env = Object.assign({}, process.env, opts.env); + } + + if (opts.__winShell === true) { + delete opts.__winShell; + parsed = { + command: cmd, + args, + options: opts, + file: cmd, + original: { + cmd, + args + } + }; + } else { + parsed = crossSpawn._parse(cmd, args, opts); + } + + opts = Object.assign({ + maxBuffer: TEN_MEGABYTES, + buffer: true, + stripEof: true, + preferLocal: true, + localDir: parsed.options.cwd || process.cwd(), + encoding: 'utf8', + reject: true, + cleanup: true + }, parsed.options); + + opts.stdio = stdio(opts); + + if (opts.preferLocal) { + opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir})); + } + + if (opts.detached) { + // #115 + opts.cleanup = false; + } + + if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') { + // #116 + parsed.args.unshift('/q'); + } + + return { + cmd: parsed.command, + args: parsed.args, + opts, + parsed + }; +} + +function handleInput(spawned, input) { + if (input === null || input === undefined) { + return; + } + + if (isStream(input)) { + input.pipe(spawned.stdin); + } else { + spawned.stdin.end(input); + } +} + +function handleOutput(opts, val) { + if (val && opts.stripEof) { + val = stripEof(val); + } + + return val; +} + +function handleShell(fn, cmd, opts) { + let file = '/bin/sh'; + let args = ['-c', cmd]; + + opts = Object.assign({}, opts); + + if (process.platform === 'win32') { + opts.__winShell = true; + file = process.env.comspec || 'cmd.exe'; + args = ['/s', '/c', `"${cmd}"`]; + opts.windowsVerbatimArguments = true; + } + + if (opts.shell) { + file = opts.shell; + delete opts.shell; + } + + return fn(file, args, opts); +} + +function getStream(process, stream, {encoding, buffer, maxBuffer}) { + if (!process[stream]) { + return null; + } + + let ret; + + if (!buffer) { + // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10 + ret = new Promise((resolve, reject) => { + process[stream] + .once('end', resolve) + .once('error', reject); + }); + } else if (encoding) { + ret = _getStream(process[stream], { + encoding, + maxBuffer + }); + } else { + ret = _getStream.buffer(process[stream], {maxBuffer}); + } + + return ret.catch(err => { + err.stream = stream; + err.message = `${stream} ${err.message}`; + throw err; + }); +} + +function makeError(result, options) { + const {stdout, stderr} = result; + + let err = result.error; + const {code, signal} = result; + + const {parsed, joinedCmd} = options; + const timedOut = options.timedOut || false; + + if (!err) { + let output = ''; + + if (Array.isArray(parsed.opts.stdio)) { + if (parsed.opts.stdio[2] !== 'inherit') { + output += output.length > 0 ? stderr : `\n${stderr}`; + } + + if (parsed.opts.stdio[1] !== 'inherit') { + output += `\n${stdout}`; + } + } else if (parsed.opts.stdio !== 'inherit') { + output = `\n${stderr}${stdout}`; + } + + err = new Error(`Command failed: ${joinedCmd}${output}`); + err.code = code < 0 ? errname(code) : code; + } + + err.stdout = stdout; + err.stderr = stderr; + err.failed = true; + err.signal = signal || null; + err.cmd = joinedCmd; + err.timedOut = timedOut; + + return err; +} + +function joinCmd(cmd, args) { + let joinedCmd = cmd; + + if (Array.isArray(args) && args.length > 0) { + joinedCmd += ' ' + args.join(' '); + } + + return joinedCmd; +} + +module.exports = (cmd, args, opts) => { + const parsed = handleArgs(cmd, args, opts); + const {encoding, buffer, maxBuffer} = parsed.opts; + const joinedCmd = joinCmd(cmd, args); + + let spawned; + try { + spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts); + } catch (err) { + return Promise.reject(err); + } + + let removeExitHandler; + if (parsed.opts.cleanup) { + removeExitHandler = onExit(() => { + spawned.kill(); + }); + } + + let timeoutId = null; + let timedOut = false; + + const cleanup = () => { + if (timeoutId) { + clearTimeout(timeoutId); + timeoutId = null; + } + + if (removeExitHandler) { + removeExitHandler(); + } + }; + + if (parsed.opts.timeout > 0) { + timeoutId = setTimeout(() => { + timeoutId = null; + timedOut = true; + spawned.kill(parsed.opts.killSignal); + }, parsed.opts.timeout); + } + + const processDone = new Promise(resolve => { + spawned.on('exit', (code, signal) => { + cleanup(); + resolve({code, signal}); + }); + + spawned.on('error', err => { + cleanup(); + resolve({error: err}); + }); + + if (spawned.stdin) { + spawned.stdin.on('error', err => { + cleanup(); + resolve({error: err}); + }); + } + }); + + function destroy() { + if (spawned.stdout) { + spawned.stdout.destroy(); + } + + if (spawned.stderr) { + spawned.stderr.destroy(); + } + } + + const handlePromise = () => pFinally(Promise.all([ + processDone, + getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}), + getStream(spawned, 'stderr', {encoding, buffer, maxBuffer}) + ]).then(arr => { + const result = arr[0]; + result.stdout = arr[1]; + result.stderr = arr[2]; + + if (result.error || result.code !== 0 || result.signal !== null) { + const err = makeError(result, { + joinedCmd, + parsed, + timedOut + }); + + // TODO: missing some timeout logic for killed + // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203 + // err.killed = spawned.killed || killed; + err.killed = err.killed || spawned.killed; + + if (!parsed.opts.reject) { + return err; + } + + throw err; + } + + return { + stdout: handleOutput(parsed.opts, result.stdout), + stderr: handleOutput(parsed.opts, result.stderr), + code: 0, + failed: false, + killed: false, + signal: null, + cmd: joinedCmd, + timedOut: false + }; + }), destroy); + + crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); + + handleInput(spawned, parsed.opts.input); + + spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected); + spawned.catch = onrejected => handlePromise().catch(onrejected); + + return spawned; +}; + +// TODO: set `stderr: 'ignore'` when that option is implemented +module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout); + +// TODO: set `stdout: 'ignore'` when that option is implemented +module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr); + +module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts); + +module.exports.sync = (cmd, args, opts) => { + const parsed = handleArgs(cmd, args, opts); + const joinedCmd = joinCmd(cmd, args); + + if (isStream(parsed.opts.input)) { + throw new TypeError('The `input` option cannot be a stream in sync mode'); + } + + const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts); + result.code = result.status; + + if (result.error || result.status !== 0 || result.signal !== null) { + const err = makeError(result, { + joinedCmd, + parsed + }); + + if (!parsed.opts.reject) { + return err; + } + + throw err; + } + + return { + stdout: handleOutput(parsed.opts, result.stdout), + stderr: handleOutput(parsed.opts, result.stderr), + code: 0, + failed: false, + signal: null, + cmd: joinedCmd, + timedOut: false + }; +}; + +module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts); diff --git a/node_modules/execa/lib/errname.js b/node_modules/execa/lib/errname.js new file mode 100644 index 0000000..e367837 --- /dev/null +++ b/node_modules/execa/lib/errname.js @@ -0,0 +1,39 @@ +'use strict'; +// Older verions of Node.js might not have `util.getSystemErrorName()`. +// In that case, fall back to a deprecated internal. +const util = require('util'); + +let uv; + +if (typeof util.getSystemErrorName === 'function') { + module.exports = util.getSystemErrorName; +} else { + try { + uv = process.binding('uv'); + + if (typeof uv.errname !== 'function') { + throw new TypeError('uv.errname is not a function'); + } + } catch (err) { + console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err); + uv = null; + } + + module.exports = code => errname(uv, code); +} + +// Used for testing the fallback behavior +module.exports.__test__ = errname; + +function errname(uv, code) { + if (uv) { + return uv.errname(code); + } + + if (!(code < 0)) { + throw new Error('err >= 0'); + } + + return `Unknown system error ${code}`; +} + diff --git a/node_modules/execa/lib/stdio.js b/node_modules/execa/lib/stdio.js new file mode 100644 index 0000000..a82d468 --- /dev/null +++ b/node_modules/execa/lib/stdio.js @@ -0,0 +1,41 @@ +'use strict'; +const alias = ['stdin', 'stdout', 'stderr']; + +const hasAlias = opts => alias.some(x => Boolean(opts[x])); + +module.exports = opts => { + if (!opts) { + return null; + } + + if (opts.stdio && hasAlias(opts)) { + throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`); + } + + if (typeof opts.stdio === 'string') { + return opts.stdio; + } + + const stdio = opts.stdio || []; + + if (!Array.isArray(stdio)) { + throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); + } + + const result = []; + const len = Math.max(stdio.length, alias.length); + + for (let i = 0; i < len; i++) { + let value = null; + + if (stdio[i] !== undefined) { + value = stdio[i]; + } else if (opts[alias[i]] !== undefined) { + value = opts[alias[i]]; + } + + result[i] = value; + } + + return result; +}; diff --git a/node_modules/execa/license b/node_modules/execa/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/execa/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/execa/package.json b/node_modules/execa/package.json new file mode 100644 index 0000000..3d68cbf --- /dev/null +++ b/node_modules/execa/package.json @@ -0,0 +1,101 @@ +{ + "_from": "execa@^1.0.0", + "_id": "execa@1.0.0", + "_inBundle": false, + "_integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "_location": "/execa", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "execa@^1.0.0", + "name": "execa", + "escapedName": "execa", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/os-locale" + ], + "_resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "_shasum": "c6236a5bb4df6d6f15e88e7f017798216749ddd8", + "_spec": "execa@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/os-locale", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/execa/issues" + }, + "bundleDependencies": false, + "dependencies": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "deprecated": false, + "description": "A better `child_process`", + "devDependencies": { + "ava": "*", + "cat-names": "^1.0.2", + "coveralls": "^3.0.1", + "delay": "^3.0.0", + "is-running": "^2.0.0", + "nyc": "^13.0.1", + "tempfile": "^2.0.0", + "xo": "*" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js", + "lib" + ], + "homepage": "https://github.com/sindresorhus/execa#readme", + "keywords": [ + "exec", + "child", + "process", + "execute", + "fork", + "execfile", + "spawn", + "file", + "shell", + "bin", + "binary", + "binaries", + "npm", + "path", + "local" + ], + "license": "MIT", + "name": "execa", + "nyc": { + "reporter": [ + "text", + "lcov" + ], + "exclude": [ + "**/fixtures/**", + "**/test.js", + "**/test/**" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/execa.git" + }, + "scripts": { + "test": "xo && nyc ava" + }, + "version": "1.0.0" +} diff --git a/node_modules/execa/readme.md b/node_modules/execa/readme.md new file mode 100644 index 0000000..f3f533d --- /dev/null +++ b/node_modules/execa/readme.md @@ -0,0 +1,327 @@ +# execa [![Build Status: Linux](https://travis-ci.org/sindresorhus/execa.svg?branch=master)](https://travis-ci.org/sindresorhus/execa) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/x5ajamxtjtt93cqv/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/execa/branch/master) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/execa/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/execa?branch=master) + +> A better [`child_process`](https://nodejs.org/api/child_process.html) + + +## Why + +- Promise interface. +- [Strips EOF](https://github.com/sindresorhus/strip-eof) from the output so you don't have to `stdout.trim()`. +- Supports [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) binaries cross-platform. +- [Improved Windows support.](https://github.com/IndigoUnited/node-cross-spawn#why) +- Higher max buffer. 10 MB instead of 200 KB. +- [Executes locally installed binaries by name.](#preferlocal) +- [Cleans up spawned processes when the parent process dies.](#cleanup) + + +## Install + +``` +$ npm install execa +``` + + + + + + +## Usage + +```js +const execa = require('execa'); + +(async () => { + const {stdout} = await execa('echo', ['unicorns']); + console.log(stdout); + //=> 'unicorns' +})(); +``` + +Additional examples: + +```js +const execa = require('execa'); + +(async () => { + // Pipe the child process stdout to the current stdout + execa('echo', ['unicorns']).stdout.pipe(process.stdout); + + + // Run a shell command + const {stdout} = await execa.shell('echo unicorns'); + //=> 'unicorns' + + + // Catching an error + try { + await execa.shell('exit 3'); + } catch (error) { + console.log(error); + /* + { + message: 'Command failed: /bin/sh -c exit 3' + killed: false, + code: 3, + signal: null, + cmd: '/bin/sh -c exit 3', + stdout: '', + stderr: '', + timedOut: false + } + */ + } +})(); + +// Catching an error with a sync method +try { + execa.shellSync('exit 3'); +} catch (error) { + console.log(error); + /* + { + message: 'Command failed: /bin/sh -c exit 3' + code: 3, + signal: null, + cmd: '/bin/sh -c exit 3', + stdout: '', + stderr: '', + timedOut: false + } + */ +} +``` + + +## API + +### execa(file, [arguments], [options]) + +Execute a file. + +Think of this as a mix of `child_process.execFile` and `child_process.spawn`. + +Returns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties. + +### execa.stdout(file, [arguments], [options]) + +Same as `execa()`, but returns only `stdout`. + +### execa.stderr(file, [arguments], [options]) + +Same as `execa()`, but returns only `stderr`. + +### execa.shell(command, [options]) + +Execute a command through the system shell. Prefer `execa()` whenever possible, as it's both faster and safer. + +Returns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess). + +The `child_process` instance is enhanced to also be promise for a result object with `stdout` and `stderr` properties. + +### execa.sync(file, [arguments], [options]) + +Execute a file synchronously. + +Returns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options). + +This method throws an `Error` if the command fails. + +### execa.shellSync(file, [options]) + +Execute a command synchronously through the system shell. + +Returns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options). + +### options + +Type: `Object` + +#### cwd + +Type: `string`
+Default: `process.cwd()` + +Current working directory of the child process. + +#### env + +Type: `Object`
+Default: `process.env` + +Environment key-value pairs. Extends automatically from `process.env`. Set `extendEnv` to `false` if you don't want this. + +#### extendEnv + +Type: `boolean`
+Default: `true` + +Set to `false` if you don't want to extend the environment variables when providing the `env` property. + +#### argv0 + +Type: `string` + +Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` or `file` if not specified. + +#### stdio + +Type: `string[]` `string`
+Default: `pipe` + +Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration. + +#### detached + +Type: `boolean` + +Prepare child to run independently of its parent process. Specific behavior [depends on the platform](https://nodejs.org/api/child_process.html#child_process_options_detached). + +#### uid + +Type: `number` + +Sets the user identity of the process. + +#### gid + +Type: `number` + +Sets the group identity of the process. + +#### shell + +Type: `boolean` `string`
+Default: `false` + +If `true`, runs `command` inside of a shell. Uses `/bin/sh` on UNIX and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows. + +#### stripEof + +Type: `boolean`
+Default: `true` + +[Strip EOF](https://github.com/sindresorhus/strip-eof) (last newline) from the output. + +#### preferLocal + +Type: `boolean`
+Default: `true` + +Prefer locally installed binaries when looking for a binary to execute.
+If you `$ npm install foo`, you can then `execa('foo')`. + +#### localDir + +Type: `string`
+Default: `process.cwd()` + +Preferred path to find locally installed binaries in (use with `preferLocal`). + +#### input + +Type: `string` `Buffer` `stream.Readable` + +Write some input to the `stdin` of your binary.
+Streams are not allowed when using the synchronous methods. + +#### reject + +Type: `boolean`
+Default: `true` + +Setting this to `false` resolves the promise with the error instead of rejecting it. + +#### cleanup + +Type: `boolean`
+Default: `true` + +Keep track of the spawned process and `kill` it when the parent process exits. + +#### encoding + +Type: `string`
+Default: `utf8` + +Specify the character encoding used to decode the `stdout` and `stderr` output. + +#### timeout + +Type: `number`
+Default: `0` + +If timeout is greater than `0`, the parent will send the signal identified by the `killSignal` property (the default is `SIGTERM`) if the child runs longer than timeout milliseconds. + +#### buffer + +Type: `boolean`
+Default: `true` + +Buffer the output from the spawned process. When buffering is disabled you must consume the output of the `stdout` and `stderr` streams because the promise will not be resolved/rejected until they have completed. + +#### maxBuffer + +Type: `number`
+Default: `10000000` (10MB) + +Largest amount of data in bytes allowed on `stdout` or `stderr`. + +#### killSignal + +Type: `string` `number`
+Default: `SIGTERM` + +Signal value to be used when the spawned process will be killed. + +#### stdin + +Type: `string` `number` `Stream` `undefined` `null`
+Default: `pipe` + +Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). + +#### stdout + +Type: `string` `number` `Stream` `undefined` `null`
+Default: `pipe` + +Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). + +#### stderr + +Type: `string` `number` `Stream` `undefined` `null`
+Default: `pipe` + +Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). + +#### windowsVerbatimArguments + +Type: `boolean`
+Default: `false` + +If `true`, no quoting or escaping of arguments is done on Windows. Ignored on other platforms. This is set to `true` automatically when the `shell` option is `true`. + + +## Tips + +### Save and pipe output from a child process + +Let's say you want to show the output of a child process in real-time while also saving it to a variable. + +```js +const execa = require('execa'); +const getStream = require('get-stream'); + +const stream = execa('echo', ['foo']).stdout; + +stream.pipe(process.stdout); + +getStream(stream).then(value => { + console.log('child output:', value); +}); +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/expand-brackets/LICENSE b/node_modules/expand-brackets/LICENSE new file mode 100644 index 0000000..6525171 --- /dev/null +++ b/node_modules/expand-brackets/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016, Jon Schlinkert + +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. diff --git a/node_modules/expand-brackets/README.md b/node_modules/expand-brackets/README.md new file mode 100644 index 0000000..c0e33d0 --- /dev/null +++ b/node_modules/expand-brackets/README.md @@ -0,0 +1,302 @@ +# expand-brackets [![NPM version](https://img.shields.io/npm/v/expand-brackets.svg?style=flat)](https://www.npmjs.com/package/expand-brackets) [![NPM monthly downloads](https://img.shields.io/npm/dm/expand-brackets.svg?style=flat)](https://npmjs.org/package/expand-brackets) [![NPM total downloads](https://img.shields.io/npm/dt/expand-brackets.svg?style=flat)](https://npmjs.org/package/expand-brackets) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/expand-brackets.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/expand-brackets) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/expand-brackets.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/expand-brackets) + +> Expand POSIX bracket expressions (character classes) in glob patterns. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save expand-brackets +``` + +## Usage + +```js +var brackets = require('expand-brackets'); +brackets(string[, options]); +``` + +**Params** + +The main export is a function that takes the following parameters: + +* `pattern` **{String}**: the pattern to convert +* `options` **{Object}**: optionally supply an options object +* `returns` **{String}**: returns a string that can be used to create a regex + +**Example** + +```js +console.log(brackets('[![:lower:]]')); +//=> '[^a-z]' +``` + +## API + +### [brackets](index.js#L29) + +Parses the given POSIX character class `pattern` and returns a +string that can be used for creating regular expressions for matching. + +**Params** + +* `pattern` **{String}** +* `options` **{Object}** +* `returns` **{Object}** + +### [.match](index.js#L54) + +Takes an array of strings and a POSIX character class pattern, and returns a new array with only the strings that matched the pattern. + +**Example** + +```js +var brackets = require('expand-brackets'); +console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]')); +//=> ['a'] + +console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]+')); +//=> ['a', 'ab'] +``` + +**Params** + +* `arr` **{Array}**: Array of strings to match +* `pattern` **{String}**: POSIX character class pattern(s) +* `options` **{Object}** +* `returns` **{Array}** + +### [.isMatch](index.js#L100) + +Returns true if the specified `string` matches the given brackets `pattern`. + +**Example** + +```js +var brackets = require('expand-brackets'); + +console.log(brackets.isMatch('a.a', '[[:alpha:]].[[:alpha:]]')); +//=> true +console.log(brackets.isMatch('1.2', '[[:alpha:]].[[:alpha:]]')); +//=> false +``` + +**Params** + +* `string` **{String}**: String to match +* `pattern` **{String}**: Poxis pattern +* `options` **{String}** +* `returns` **{Boolean}** + +### [.matcher](index.js#L123) + +Takes a POSIX character class pattern and returns a matcher function. The returned function takes the string to match as its only argument. + +**Example** + +```js +var brackets = require('expand-brackets'); +var isMatch = brackets.matcher('[[:lower:]].[[:upper:]]'); + +console.log(isMatch('a.a')); +//=> false +console.log(isMatch('a.A')); +//=> true +``` + +**Params** + +* `pattern` **{String}**: Poxis pattern +* `options` **{String}** +* `returns` **{Boolean}** + +### [.makeRe](index.js#L145) + +Create a regular expression from the given `pattern`. + +**Example** + +```js +var brackets = require('expand-brackets'); +var re = brackets.makeRe('[[:alpha:]]'); +console.log(re); +//=> /^(?:[a-zA-Z])$/ +``` + +**Params** + +* `pattern` **{String}**: The pattern to convert to regex. +* `options` **{Object}** +* `returns` **{RegExp}** + +### [.create](index.js#L187) + +Parses the given POSIX character class `pattern` and returns an object with the compiled `output` and optional source `map`. + +**Example** + +```js +var brackets = require('expand-brackets'); +console.log(brackets('[[:alpha:]]')); +// { options: { source: 'string' }, +// input: '[[:alpha:]]', +// state: {}, +// compilers: +// { eos: [Function], +// noop: [Function], +// bos: [Function], +// not: [Function], +// escape: [Function], +// text: [Function], +// posix: [Function], +// bracket: [Function], +// 'bracket.open': [Function], +// 'bracket.inner': [Function], +// 'bracket.literal': [Function], +// 'bracket.close': [Function] }, +// output: '[a-zA-Z]', +// ast: +// { type: 'root', +// errors: [], +// nodes: [ [Object], [Object], [Object] ] }, +// parsingErrors: [] } +``` + +**Params** + +* `pattern` **{String}** +* `options` **{Object}** +* `returns` **{Object}** + +## Options + +### options.sourcemap + +Generate a source map for the given pattern. + +**Example** + +```js +var res = brackets('[:alpha:]', {sourcemap: true}); + +console.log(res.map); +// { version: 3, +// sources: [ 'brackets' ], +// names: [], +// mappings: 'AAAA,MAAS', +// sourcesContent: [ '[:alpha:]' ] } +``` + +### POSIX Character classes + +The following named POSIX bracket expressions are supported: + +* `[:alnum:]`: Alphanumeric characters (`a-zA-Z0-9]`) +* `[:alpha:]`: Alphabetic characters (`a-zA-Z]`) +* `[:blank:]`: Space and tab (`[ t]`) +* `[:digit:]`: Digits (`[0-9]`) +* `[:lower:]`: Lowercase letters (`[a-z]`) +* `[:punct:]`: Punctuation and symbols. (`[!"#$%&'()*+, -./:;<=>?@ [\]^_``{|}~]`) +* `[:upper:]`: Uppercase letters (`[A-Z]`) +* `[:word:]`: Word characters (letters, numbers and underscores) (`[A-Za-z0-9_]`) +* `[:xdigit:]`: Hexadecimal digits (`[A-Fa-f0-9]`) + +See [posix-character-classes](https://github.com/jonschlinkert/posix-character-classes) for more details. + +**Not supported** + +* [equivalence classes](https://www.gnu.org/software/gawk/manual/html_node/Bracket-Expressions.html) are not supported +* [POSIX.2 collating symbols](https://www.gnu.org/software/gawk/manual/html_node/Bracket-Expressions.html) are not supported + +## Changelog + +### v2.0.0 + +**Breaking changes** + +* The main export now returns the compiled string, instead of the object returned from the compiler + +**Added features** + +* Adds a `.create` method to do what the main function did before v2.0.0 + +### v0.2.0 + +In addition to performance and matching improvements, the v0.2.0 refactor adds complete POSIX character class support, with the exception of equivalence classes and POSIX.2 collating symbols which are not relevant to node.js usage. + +**Added features** + +* parser is exposed, so that expand-brackets parsers can be used by upstream parsers (like [micromatch](https://github.com/jonschlinkert/micromatch)) +* compiler is exposed, so that expand-brackets compilers can be used by upstream compilers +* source maps + +**source map example** + +```js +var brackets = require('expand-brackets'); +var res = brackets('[:alpha:]'); +console.log(res.map); + +{ version: 3, + sources: [ 'brackets' ], + names: [], + mappings: 'AAAA,MAAS', + sourcesContent: [ '[:alpha:]' ] } +``` + +## About + +### Related projects + +* [braces](https://www.npmjs.com/package/braces): Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) | [homepage](https://github.com/jonschlinkert/braces "Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces specification, without sacrificing speed.") +* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/jonschlinkert/extglob) | [homepage](https://github.com/jonschlinkert/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") +* [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/jonschlinkert/nanomatch) | [homepage](https://github.com/jonschlinkert/nanomatch "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor**
| +| --- | --- | +| 66 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [MartinKolarik](https://github.com/MartinKolarik) | +| 2 | [es128](https://github.com/es128) | +| 1 | [eush77](https://github.com/eush77) | + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/expand-brackets/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on December 12, 2016._ \ No newline at end of file diff --git a/node_modules/expand-brackets/changelog.md b/node_modules/expand-brackets/changelog.md new file mode 100644 index 0000000..0c0723a --- /dev/null +++ b/node_modules/expand-brackets/changelog.md @@ -0,0 +1,35 @@ +## Changelog + +### v2.0.0 + +**Breaking changes** + +- The main export now returns the compiled string, instead of the object returned from the compiler + +**Added features** + +- Adds a `.create` method to do what the main function did before v2.0.0 + +### v0.2.0 + +In addition to performance and matching improvements, the v0.2.0 refactor adds complete POSIX character class support, with the exception of equivalence classes and POSIX.2 collating symbols which are not relevant to node.js usage. + +**Added features** + +- parser is exposed, so that expand-brackets parsers can be used by upstream parsers (like [micromatch][]) +- compiler is exposed, so that expand-brackets compilers can be used by upstream compilers +- source maps + +**source map example** + +```js +var brackets = require('expand-brackets'); +var res = brackets('[:alpha:]'); +console.log(res.map); + +{ version: 3, + sources: [ 'brackets' ], + names: [], + mappings: 'AAAA,MAAS', + sourcesContent: [ '[:alpha:]' ] } +``` diff --git a/node_modules/expand-brackets/index.js b/node_modules/expand-brackets/index.js new file mode 100644 index 0000000..74b8b15 --- /dev/null +++ b/node_modules/expand-brackets/index.js @@ -0,0 +1,211 @@ +'use strict'; + +/** + * Local dependencies + */ + +var compilers = require('./lib/compilers'); +var parsers = require('./lib/parsers'); + +/** + * Module dependencies + */ + +var debug = require('debug')('expand-brackets'); +var extend = require('extend-shallow'); +var Snapdragon = require('snapdragon'); +var toRegex = require('to-regex'); + +/** + * Parses the given POSIX character class `pattern` and returns a + * string that can be used for creating regular expressions for matching. + * + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} + * @api public + */ + +function brackets(pattern, options) { + debug('initializing from <%s>', __filename); + var res = brackets.create(pattern, options); + return res.output; +} + +/** + * Takes an array of strings and a POSIX character class pattern, and returns a new + * array with only the strings that matched the pattern. + * + * ```js + * var brackets = require('expand-brackets'); + * console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]')); + * //=> ['a'] + * + * console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]+')); + * //=> ['a', 'ab'] + * ``` + * @param {Array} `arr` Array of strings to match + * @param {String} `pattern` POSIX character class pattern(s) + * @param {Object} `options` + * @return {Array} + * @api public + */ + +brackets.match = function(arr, pattern, options) { + arr = [].concat(arr); + var opts = extend({}, options); + var isMatch = brackets.matcher(pattern, opts); + var len = arr.length; + var idx = -1; + var res = []; + + while (++idx < len) { + var ele = arr[idx]; + if (isMatch(ele)) { + res.push(ele); + } + } + + if (res.length === 0) { + if (opts.failglob === true) { + throw new Error('no matches found for "' + pattern + '"'); + } + + if (opts.nonull === true || opts.nullglob === true) { + return [pattern.split('\\').join('')]; + } + } + return res; +}; + +/** + * Returns true if the specified `string` matches the given + * brackets `pattern`. + * + * ```js + * var brackets = require('expand-brackets'); + * + * console.log(brackets.isMatch('a.a', '[[:alpha:]].[[:alpha:]]')); + * //=> true + * console.log(brackets.isMatch('1.2', '[[:alpha:]].[[:alpha:]]')); + * //=> false + * ``` + * @param {String} `string` String to match + * @param {String} `pattern` Poxis pattern + * @param {String} `options` + * @return {Boolean} + * @api public + */ + +brackets.isMatch = function(str, pattern, options) { + return brackets.matcher(pattern, options)(str); +}; + +/** + * Takes a POSIX character class pattern and returns a matcher function. The returned + * function takes the string to match as its only argument. + * + * ```js + * var brackets = require('expand-brackets'); + * var isMatch = brackets.matcher('[[:lower:]].[[:upper:]]'); + * + * console.log(isMatch('a.a')); + * //=> false + * console.log(isMatch('a.A')); + * //=> true + * ``` + * @param {String} `pattern` Poxis pattern + * @param {String} `options` + * @return {Boolean} + * @api public + */ + +brackets.matcher = function(pattern, options) { + var re = brackets.makeRe(pattern, options); + return function(str) { + return re.test(str); + }; +}; + +/** + * Create a regular expression from the given `pattern`. + * + * ```js + * var brackets = require('expand-brackets'); + * var re = brackets.makeRe('[[:alpha:]]'); + * console.log(re); + * //=> /^(?:[a-zA-Z])$/ + * ``` + * @param {String} `pattern` The pattern to convert to regex. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +brackets.makeRe = function(pattern, options) { + var res = brackets.create(pattern, options); + var opts = extend({strictErrors: false}, options); + return toRegex(res.output, opts); +}; + +/** + * Parses the given POSIX character class `pattern` and returns an object + * with the compiled `output` and optional source `map`. + * + * ```js + * var brackets = require('expand-brackets'); + * console.log(brackets('[[:alpha:]]')); + * // { options: { source: 'string' }, + * // input: '[[:alpha:]]', + * // state: {}, + * // compilers: + * // { eos: [Function], + * // noop: [Function], + * // bos: [Function], + * // not: [Function], + * // escape: [Function], + * // text: [Function], + * // posix: [Function], + * // bracket: [Function], + * // 'bracket.open': [Function], + * // 'bracket.inner': [Function], + * // 'bracket.literal': [Function], + * // 'bracket.close': [Function] }, + * // output: '[a-zA-Z]', + * // ast: + * // { type: 'root', + * // errors: [], + * // nodes: [ [Object], [Object], [Object] ] }, + * // parsingErrors: [] } + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} + * @api public + */ + +brackets.create = function(pattern, options) { + var snapdragon = (options && options.snapdragon) || new Snapdragon(options); + compilers(snapdragon); + parsers(snapdragon); + + var ast = snapdragon.parse(pattern, options); + ast.input = pattern; + var res = snapdragon.compile(ast, options); + res.input = pattern; + return res; +}; + +/** + * Expose `brackets` constructor, parsers and compilers + */ + +brackets.compilers = compilers; +brackets.parsers = parsers; + +/** + * Expose `brackets` + * @type {Function} + */ + +module.exports = brackets; diff --git a/node_modules/expand-brackets/lib/compilers.js b/node_modules/expand-brackets/lib/compilers.js new file mode 100644 index 0000000..fbf7fe8 --- /dev/null +++ b/node_modules/expand-brackets/lib/compilers.js @@ -0,0 +1,87 @@ +'use strict'; + +var posix = require('posix-character-classes'); + +module.exports = function(brackets) { + brackets.compiler + + /** + * Escaped characters + */ + + .set('escape', function(node) { + return this.emit('\\' + node.val.replace(/^\\/, ''), node); + }) + + /** + * Text + */ + + .set('text', function(node) { + return this.emit(node.val.replace(/([{}])/g, '\\$1'), node); + }) + + /** + * POSIX character classes + */ + + .set('posix', function(node) { + if (node.val === '[::]') { + return this.emit('\\[::\\]', node); + } + + var val = posix[node.inner]; + if (typeof val === 'undefined') { + val = '[' + node.inner + ']'; + } + return this.emit(val, node); + }) + + /** + * Non-posix brackets + */ + + .set('bracket', function(node) { + return this.mapVisit(node.nodes); + }) + .set('bracket.open', function(node) { + return this.emit(node.val, node); + }) + .set('bracket.inner', function(node) { + var inner = node.val; + + if (inner === '[' || inner === ']') { + return this.emit('\\' + node.val, node); + } + if (inner === '^]') { + return this.emit('^\\]', node); + } + if (inner === '^') { + return this.emit('^', node); + } + + if (/-/.test(inner) && !/(\d-\d|\w-\w)/.test(inner)) { + inner = inner.split('-').join('\\-'); + } + + var isNegated = inner.charAt(0) === '^'; + // add slashes to negated brackets, per spec + if (isNegated && inner.indexOf('/') === -1) { + inner += '/'; + } + if (isNegated && inner.indexOf('.') === -1) { + inner += '.'; + } + + // don't unescape `0` (octal literal) + inner = inner.replace(/\\([1-9])/g, '$1'); + return this.emit(inner, node); + }) + .set('bracket.close', function(node) { + var val = node.val.replace(/^\\/, ''); + if (node.parent.escaped === true) { + return this.emit('\\' + val, node); + } + return this.emit(val, node); + }); +}; diff --git a/node_modules/expand-brackets/lib/parsers.js b/node_modules/expand-brackets/lib/parsers.js new file mode 100644 index 0000000..450a512 --- /dev/null +++ b/node_modules/expand-brackets/lib/parsers.js @@ -0,0 +1,219 @@ +'use strict'; + +var utils = require('./utils'); +var define = require('define-property'); + +/** + * Text regex + */ + +var TEXT_REGEX = '(\\[(?=.*\\])|\\])+'; +var not = utils.createRegex(TEXT_REGEX); + +/** + * Brackets parsers + */ + +function parsers(brackets) { + brackets.state = brackets.state || {}; + brackets.parser.sets.bracket = brackets.parser.sets.bracket || []; + brackets.parser + + .capture('escape', function() { + if (this.isInside('bracket')) return; + var pos = this.position(); + var m = this.match(/^\\(.)/); + if (!m) return; + + return pos({ + type: 'escape', + val: m[0] + }); + }) + + /** + * Text parser + */ + + .capture('text', function() { + if (this.isInside('bracket')) return; + var pos = this.position(); + var m = this.match(not); + if (!m || !m[0]) return; + + return pos({ + type: 'text', + val: m[0] + }); + }) + + /** + * POSIX character classes: "[[:alpha:][:digits:]]" + */ + + .capture('posix', function() { + var pos = this.position(); + var m = this.match(/^\[:(.*?):\](?=.*\])/); + if (!m) return; + + var inside = this.isInside('bracket'); + if (inside) { + brackets.posix++; + } + + return pos({ + type: 'posix', + insideBracket: inside, + inner: m[1], + val: m[0] + }); + }) + + /** + * Bracket (noop) + */ + + .capture('bracket', function() {}) + + /** + * Open: '[' + */ + + .capture('bracket.open', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^\[(?=.*\])/); + if (!m) return; + + var prev = this.prev(); + var last = utils.last(prev.nodes); + + if (parsed.slice(-1) === '\\' && !this.isInside('bracket')) { + last.val = last.val.slice(0, last.val.length - 1); + return pos({ + type: 'escape', + val: m[0] + }); + } + + var open = pos({ + type: 'bracket.open', + val: m[0] + }); + + if (last.type === 'bracket.open' || this.isInside('bracket')) { + open.val = '\\' + open.val; + open.type = 'bracket.inner'; + open.escaped = true; + return open; + } + + var node = pos({ + type: 'bracket', + nodes: [open] + }); + + define(node, 'parent', prev); + define(open, 'parent', node); + this.push('bracket', node); + prev.nodes.push(node); + }) + + /** + * Bracket text + */ + + .capture('bracket.inner', function() { + if (!this.isInside('bracket')) return; + var pos = this.position(); + var m = this.match(not); + if (!m || !m[0]) return; + + var next = this.input.charAt(0); + var val = m[0]; + + var node = pos({ + type: 'bracket.inner', + val: val + }); + + if (val === '\\\\') { + return node; + } + + var first = val.charAt(0); + var last = val.slice(-1); + + if (first === '!') { + val = '^' + val.slice(1); + } + + if (last === '\\' || (val === '^' && next === ']')) { + val += this.input[0]; + this.consume(1); + } + + node.val = val; + return node; + }) + + /** + * Close: ']' + */ + + .capture('bracket.close', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^\]/); + if (!m) return; + + var prev = this.prev(); + var last = utils.last(prev.nodes); + + if (parsed.slice(-1) === '\\' && !this.isInside('bracket')) { + last.val = last.val.slice(0, last.val.length - 1); + + return pos({ + type: 'escape', + val: m[0] + }); + } + + var node = pos({ + type: 'bracket.close', + rest: this.input, + val: m[0] + }); + + if (last.type === 'bracket.open') { + node.type = 'bracket.inner'; + node.escaped = true; + return node; + } + + var bracket = this.pop('bracket'); + if (!this.isType(bracket, 'bracket')) { + if (this.options.strict) { + throw new Error('missing opening "["'); + } + node.type = 'bracket.inner'; + node.escaped = true; + return node; + } + + bracket.nodes.push(node); + define(node, 'parent', bracket); + }); +} + +/** + * Brackets parsers + */ + +module.exports = parsers; + +/** + * Expose text regex + */ + +module.exports.TEXT_REGEX = TEXT_REGEX; diff --git a/node_modules/expand-brackets/lib/utils.js b/node_modules/expand-brackets/lib/utils.js new file mode 100644 index 0000000..599ff51 --- /dev/null +++ b/node_modules/expand-brackets/lib/utils.js @@ -0,0 +1,34 @@ +'use strict'; + +var toRegex = require('to-regex'); +var regexNot = require('regex-not'); +var cached; + +/** + * Get the last element from `array` + * @param {Array} `array` + * @return {*} + */ + +exports.last = function(arr) { + return arr[arr.length - 1]; +}; + +/** + * Create and cache regex to use for text nodes + */ + +exports.createRegex = function(pattern, include) { + if (cached) return cached; + var opts = {contains: true, strictClose: false}; + var not = regexNot.create(pattern, opts); + var re; + + if (typeof include === 'string') { + re = toRegex('^(?:' + include + '|' + not + ')', opts); + } else { + re = toRegex(not, opts); + } + + return (cached = re); +}; diff --git a/node_modules/expand-brackets/node_modules/define-property/LICENSE b/node_modules/expand-brackets/node_modules/define-property/LICENSE new file mode 100644 index 0000000..65f90ac --- /dev/null +++ b/node_modules/expand-brackets/node_modules/define-property/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +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. diff --git a/node_modules/expand-brackets/node_modules/define-property/README.md b/node_modules/expand-brackets/node_modules/define-property/README.md new file mode 100644 index 0000000..8cac698 --- /dev/null +++ b/node_modules/expand-brackets/node_modules/define-property/README.md @@ -0,0 +1,77 @@ +# define-property [![NPM version](https://badge.fury.io/js/define-property.svg)](http://badge.fury.io/js/define-property) + +> Define a non-enumerable property on an object. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i define-property --save +``` + +## Usage + +**Params** + +* `obj`: The object on which to define the property. +* `prop`: The name of the property to be defined or modified. +* `descriptor`: The descriptor for the property being defined or modified. + +```js +var define = require('define-property'); +var obj = {}; +define(obj, 'foo', function(val) { + return val.toUpperCase(); +}); + +console.log(obj); +//=> {} + +console.log(obj.foo('bar')); +//=> 'BAR' +``` + +**get/set** + +```js +define(obj, 'foo', { + get: function() {}, + set: function() {} +}); +``` + +## Related projects + +* [delegate-object](https://www.npmjs.com/package/delegate-object): Copy properties from an object to another object, where properties with function values will be… [more](https://www.npmjs.com/package/delegate-object) | [homepage](https://github.com/doowb/delegate-object) +* [forward-object](https://www.npmjs.com/package/forward-object): Copy properties from an object to another object, where properties with function values will be… [more](https://www.npmjs.com/package/forward-object) | [homepage](https://github.com/doowb/forward-object) +* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep) +* [mixin-object](https://www.npmjs.com/package/mixin-object): Mixin the own and inherited properties of other objects onto the first object. Pass an… [more](https://www.npmjs.com/package/mixin-object) | [homepage](https://github.com/jonschlinkert/mixin-object) + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/define-property/issues/new). + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 31, 2015._ diff --git a/node_modules/expand-brackets/node_modules/define-property/index.js b/node_modules/expand-brackets/node_modules/define-property/index.js new file mode 100644 index 0000000..3e0e5e1 --- /dev/null +++ b/node_modules/expand-brackets/node_modules/define-property/index.js @@ -0,0 +1,31 @@ +/*! + * define-property + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var isDescriptor = require('is-descriptor'); + +module.exports = function defineProperty(obj, prop, val) { + if (typeof obj !== 'object' && typeof obj !== 'function') { + throw new TypeError('expected an object or function.'); + } + + if (typeof prop !== 'string') { + throw new TypeError('expected `prop` to be a string.'); + } + + if (isDescriptor(val) && ('set' in val || 'get' in val)) { + return Object.defineProperty(obj, prop, val); + } + + return Object.defineProperty(obj, prop, { + configurable: true, + enumerable: false, + writable: true, + value: val + }); +}; diff --git a/node_modules/expand-brackets/node_modules/define-property/package.json b/node_modules/expand-brackets/node_modules/define-property/package.json new file mode 100644 index 0000000..bea8bd9 --- /dev/null +++ b/node_modules/expand-brackets/node_modules/define-property/package.json @@ -0,0 +1,82 @@ +{ + "_from": "define-property@^0.2.5", + "_id": "define-property@0.2.5", + "_inBundle": false, + "_integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "_location": "/expand-brackets/define-property", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "define-property@^0.2.5", + "name": "define-property", + "escapedName": "define-property", + "rawSpec": "^0.2.5", + "saveSpec": null, + "fetchSpec": "^0.2.5" + }, + "_requiredBy": [ + "/expand-brackets" + ], + "_resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "_shasum": "c35b1ef918ec3c990f9a5bc57be04aacec5c8116", + "_spec": "define-property@^0.2.5", + "_where": "/usr/share/r3-server/beta/r3/node_modules/expand-brackets", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/define-property/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "deprecated": false, + "description": "Define a non-enumerable property on an object.", + "devDependencies": { + "mocha": "*", + "should": "^7.0.4" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/define-property", + "keywords": [ + "define", + "define-property", + "enumerable", + "key", + "non", + "non-enumerable", + "object", + "prop", + "property", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "define-property", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/define-property.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "mixin-deep", + "mixin-object", + "delegate-object", + "forward-object" + ] + } + }, + "version": "0.2.5" +} diff --git a/node_modules/expand-brackets/node_modules/extend-shallow/LICENSE b/node_modules/expand-brackets/node_modules/extend-shallow/LICENSE new file mode 100644 index 0000000..fa30c4c --- /dev/null +++ b/node_modules/expand-brackets/node_modules/extend-shallow/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +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. diff --git a/node_modules/expand-brackets/node_modules/extend-shallow/README.md b/node_modules/expand-brackets/node_modules/extend-shallow/README.md new file mode 100644 index 0000000..cdc45d4 --- /dev/null +++ b/node_modules/expand-brackets/node_modules/extend-shallow/README.md @@ -0,0 +1,61 @@ +# extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow) + +> Extend an object with the properties of additional objects. node.js/javascript util. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i extend-shallow --save +``` + +## Usage + +```js +var extend = require('extend-shallow'); + +extend({a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +Pass an empty object to shallow clone: + +```js +var obj = {}; +extend(obj, {a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +## Related + +* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. +* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) +* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) +* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. +* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. +* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._ \ No newline at end of file diff --git a/node_modules/expand-brackets/node_modules/extend-shallow/index.js b/node_modules/expand-brackets/node_modules/extend-shallow/index.js new file mode 100644 index 0000000..92a067f --- /dev/null +++ b/node_modules/expand-brackets/node_modules/extend-shallow/index.js @@ -0,0 +1,33 @@ +'use strict'; + +var isObject = require('is-extendable'); + +module.exports = function extend(o/*, objects*/) { + if (!isObject(o)) { o = {}; } + + var len = arguments.length; + for (var i = 1; i < len; i++) { + var obj = arguments[i]; + + if (isObject(obj)) { + assign(o, obj); + } + } + return o; +}; + +function assign(a, b) { + for (var key in b) { + if (hasOwn(b, key)) { + a[key] = b[key]; + } + } +} + +/** + * Returns true if the given `key` is an own property of `obj`. + */ + +function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} diff --git a/node_modules/expand-brackets/node_modules/extend-shallow/package.json b/node_modules/expand-brackets/node_modules/extend-shallow/package.json new file mode 100644 index 0000000..f06e43f --- /dev/null +++ b/node_modules/expand-brackets/node_modules/extend-shallow/package.json @@ -0,0 +1,87 @@ +{ + "_from": "extend-shallow@^2.0.1", + "_id": "extend-shallow@2.0.1", + "_inBundle": false, + "_integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "_location": "/expand-brackets/extend-shallow", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "extend-shallow@^2.0.1", + "name": "extend-shallow", + "escapedName": "extend-shallow", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/expand-brackets" + ], + "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "_shasum": "51af7d614ad9a9f610ea1bafbb989d6b1c56890f", + "_spec": "extend-shallow@^2.0.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/expand-brackets", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/extend-shallow/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "deprecated": false, + "description": "Extend an object with the properties of additional objects. node.js/javascript util.", + "devDependencies": { + "array-slice": "^0.2.3", + "benchmarked": "^0.1.4", + "chalk": "^1.0.0", + "for-own": "^0.1.3", + "glob": "^5.0.12", + "is-plain-object": "^2.0.1", + "kind-of": "^2.0.0", + "minimist": "^1.1.1", + "mocha": "^2.2.5", + "should": "^7.0.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/extend-shallow", + "keywords": [ + "assign", + "extend", + "javascript", + "js", + "keys", + "merge", + "obj", + "object", + "prop", + "properties", + "property", + "props", + "shallow", + "util", + "utility", + "utils", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "extend-shallow", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/extend-shallow.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.0.1" +} diff --git a/node_modules/expand-brackets/package.json b/node_modules/expand-brackets/package.json new file mode 100644 index 0000000..19a2775 --- /dev/null +++ b/node_modules/expand-brackets/package.json @@ -0,0 +1,133 @@ +{ + "_from": "expand-brackets@^2.1.4", + "_id": "expand-brackets@2.1.4", + "_inBundle": false, + "_integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "_location": "/expand-brackets", + "_phantomChildren": { + "is-descriptor": "0.1.6", + "is-extendable": "0.1.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "expand-brackets@^2.1.4", + "name": "expand-brackets", + "escapedName": "expand-brackets", + "rawSpec": "^2.1.4", + "saveSpec": null, + "fetchSpec": "^2.1.4" + }, + "_requiredBy": [ + "/extglob" + ], + "_resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "_shasum": "b77735e315ce30f6b6eff0f83b04151a22449622", + "_spec": "expand-brackets@^2.1.4", + "_where": "/usr/share/r3-server/beta/r3/node_modules/extglob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/expand-brackets/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Elan Shanker", + "url": "https://github.com/es128" + }, + { + "name": "Eugene Sharygin", + "url": "https://github.com/eush77" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Martin Kolárik", + "email": "martin@kolarik.sk", + "url": "http://kolarik.sk" + } + ], + "dependencies": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "deprecated": false, + "description": "Expand POSIX bracket expressions (character classes) in glob patterns.", + "devDependencies": { + "bash-match": "^0.1.1", + "gulp-format-md": "^0.1.10", + "helper-changelog": "^0.3.0", + "minimatch": "^3.0.3", + "mocha": "^3.0.2", + "multimatch": "^2.1.0", + "yargs-parser": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "lib" + ], + "homepage": "https://github.com/jonschlinkert/expand-brackets", + "keywords": [ + "bracket", + "brackets", + "character class", + "expand", + "expression", + "posix" + ], + "license": "MIT", + "main": "index.js", + "name": "expand-brackets", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/expand-brackets.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "helpers": [ + "helper-changelog" + ], + "related": { + "list": [ + "braces", + "extglob", + "micromatch", + "nanomatch" + ] + }, + "reflinks": [ + "micromatch", + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.1.4" +} diff --git a/node_modules/expand-tilde/LICENSE b/node_modules/expand-tilde/LICENSE new file mode 100644 index 0000000..1e49edf --- /dev/null +++ b/node_modules/expand-tilde/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016, Jon Schlinkert. + +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. diff --git a/node_modules/expand-tilde/README.md b/node_modules/expand-tilde/README.md new file mode 100644 index 0000000..d1892b7 --- /dev/null +++ b/node_modules/expand-tilde/README.md @@ -0,0 +1,80 @@ +# expand-tilde [![NPM version](https://img.shields.io/npm/v/expand-tilde.svg?style=flat)](https://www.npmjs.com/package/expand-tilde) [![NPM downloads](https://img.shields.io/npm/dm/expand-tilde.svg?style=flat)](https://npmjs.org/package/expand-tilde) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/expand-tilde.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/expand-tilde) + +> Bash-like tilde expansion for node.js. Expands a leading tilde in a file path to the user home directory, or `~+` to the cwd. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save expand-tilde +``` + +## Usage + +See the [Bash documentation for Tilde Expansion](https://www.gnu.org/software/bash/manual/html_node/Tilde-Expansion.html). + +```js +var expandTilde = require('expand-tilde'); + +expandTilde('~') +//=> '/Users/jonschlinkert' + +expandTilde('~+') +//=> process.cwd() +``` + +## Run tests + +Install dev dependencies: + +```bash +npm i -d && npm test +``` + +## About + +### Related projects + +* [braces](https://www.npmjs.com/package/braces): Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) | [homepage](https://github.com/jonschlinkert/braces "Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces specification, without sacrificing speed.") +* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on December 08, 2016._ \ No newline at end of file diff --git a/node_modules/expand-tilde/index.js b/node_modules/expand-tilde/index.js new file mode 100644 index 0000000..d4e4706 --- /dev/null +++ b/node_modules/expand-tilde/index.js @@ -0,0 +1,22 @@ +/*! + * expand-tilde + * + * Copyright (c) 2015 Jon Schlinkert. + * Licensed under the MIT license. + */ + +var homedir = require('homedir-polyfill'); +var path = require('path'); + +module.exports = function expandTilde(filepath) { + var home = homedir(); + + if (filepath.charCodeAt(0) === 126 /* ~ */) { + if (filepath.charCodeAt(1) === 43 /* + */) { + return path.join(process.cwd(), filepath.slice(2)); + } + return home ? path.join(home, filepath.slice(1)) : filepath; + } + + return filepath; +}; diff --git a/node_modules/expand-tilde/package.json b/node_modules/expand-tilde/package.json new file mode 100644 index 0000000..0c0bae5 --- /dev/null +++ b/node_modules/expand-tilde/package.json @@ -0,0 +1,99 @@ +{ + "_from": "expand-tilde@^2.0.0", + "_id": "expand-tilde@2.0.2", + "_inBundle": false, + "_integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "_location": "/expand-tilde", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "expand-tilde@^2.0.0", + "name": "expand-tilde", + "escapedName": "expand-tilde", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/global-prefix", + "/resolve-dir" + ], + "_resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "_shasum": "97e801aa052df02454de46b02bf621642cdc8502", + "_spec": "expand-tilde@^2.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/resolve-dir", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/expand-tilde/issues" + }, + "bundleDependencies": false, + "dependencies": { + "homedir-polyfill": "^1.0.1" + }, + "deprecated": false, + "description": "Bash-like tilde expansion for node.js. Expands a leading tilde in a file path to the user home directory, or `~+` to the cwd.", + "devDependencies": { + "gulp-format-md": "^0.1.9", + "is-windows": "^0.2.0", + "mocha": "^2.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/expand-tilde", + "keywords": [ + "cwd", + "expand", + "expansion", + "filepath", + "home", + "path", + "pwd", + "tilde", + "user", + "userhome" + ], + "license": "MIT", + "main": "index.js", + "name": "expand-tilde", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/expand-tilde.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "braces", + "expand-brackets", + "is-glob", + "micromatch" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.0.2" +} diff --git a/node_modules/ext/.editorconfig b/node_modules/ext/.editorconfig new file mode 100644 index 0000000..bd6d81e --- /dev/null +++ b/node_modules/ext/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +trim_trailing_whitespace = true + +[*.md] +indent_size = 2 +indent_style = space +trim_trailing_whitespace = false diff --git a/node_modules/ext/CHANGELOG.md b/node_modules/ext/CHANGELOG.md new file mode 100644 index 0000000..7bd856f --- /dev/null +++ b/node_modules/ext/CHANGELOG.md @@ -0,0 +1,64 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [1.4.0](https://github.com///compare/v1.3.0...v1.4.0) (2019-11-29) + +### Features + +- `charset` option for `String.random` ([2a20eeb](https://github.com///commit/2a20eebc5ae784e5c1aacd2c54433fe92a9464c9)) +- `String.prototype.includes` implementation ([ceebe8d](https://github.com///commit/ceebe8dfd6f479d6a7e7b6cd79369291869ee2dd)) + +## [1.3.0](https://github.com///compare/v1.2.1...v1.3.0) (2019-11-28) + +### Features + +- `String.random` util ([5b5860a](https://github.com///commit/5b5860ac545b05f00527e00295fdb4f97e4a4e5b)) + +### [1.2.1](https://github.com///compare/v1.2.0...v1.2.1) (2019-11-26) + +## [1.2.0](https://github.com/medikoo/ext/compare/v1.1.2...v1.2.0) (2019-11-07) + +### Features + +- ceil10, floor10 and round10 for Math ([6a2bc4b](https://github.com/medikoo/ext/commit/6a2bc4b)) + +### [1.1.2](https://github.com/medikoo/ext/compare/v1.1.1...v1.1.2) (2019-10-29) + +### Bug Fixes + +- Improve globalThis detection ([470862d](https://github.com/medikoo/ext/commit/470862d)) + +### [1.1.1](https://github.com/medikoo/ext/compare/v1.1.0...v1.1.1) (2019-10-29) + +### Bug Fixes + +- Provide naive fallback for sealed Object.prototype case ([a8d528b](https://github.com/medikoo/ext/commit/a8d528b)) +- Workaournd Safari incompatibility case ([0b051e6](https://github.com/medikoo/ext/commit/0b051e6)) + +## [1.1.0](https://github.com/medikoo/ext/compare/v1.0.3...v1.1.0) (2019-10-21) + +### Features + +- Object.entries implementation ([cf51e45](https://github.com/medikoo/ext/commit/cf51e45)) + +### [1.0.3](https://github.com/medikoo/ext/compare/v1.0.1...v1.0.3) (2019-07-03) + +Remove obsolete files from publication + +### [1.0.2](https://github.com/medikoo/ext/compare/v1.0.1...v1.0.2) (2019-07-03) + +(no changes) + +### [1.0.1](https://github.com/medikoo/ext/compare/v1.0.0...v1.0.1) (2019-07-03) + +Prettify + +## 1.0.0 (2019-07-03) + +### Features + +- `function/identity` (adapted from `es5-ext`) ([f0102af](https://github.com/medikoo/ext/commit/f0102af)) +- `thenable/finally` (adapted from `es5-ext`) ([a8494ac](https://github.com/medikoo/ext/commit/a8494ac)) +- `global-this/is-implemented` ([3a80904](https://github.com/medikoo/ext/commit/3a80904)) +- `globalThis` (mostly adapted from `es5-ext`) ([6559bd3](https://github.com/medikoo/ext/commit/6559bd3)) diff --git a/node_modules/ext/LICENSE b/node_modules/ext/LICENSE new file mode 100644 index 0000000..89a96ea --- /dev/null +++ b/node_modules/ext/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2011-2019, Mariusz Nowak, @medikoo, medikoo.com + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/ext/README.md b/node_modules/ext/README.md new file mode 100644 index 0000000..0e67694 --- /dev/null +++ b/node_modules/ext/README.md @@ -0,0 +1,33 @@ +# ext + +_(Previously known as `es5-ext`)_ + +## JavaScript language extensions (with respect to evolving standard) + +Non-standard or soon to be standard language utilities in a future proof, non-invasive form. + +Doesn't enforce transpilation step. Where it's applicable utilities/extensions are safe to use in all ES3+ implementations. + +### Installation + +```bash +npm install ext +``` + +### Utilities + +- [`globalThis`](docs/global-this.md) +- `Function` + - [`identity`](docs/function/identity.md) +- `Math` + - [`ceil10`](docs/math/ceil-10.md) + - [`floor10`](docs/math/floor-10.md) + - [`round10`](docs/math/round-10.md) +- `Object` + - [`entries`](docs/object/entries.md) +- `String` + - [`random`](docs/string/random.md) +- `String.prototype` + - [`includes`](docs/string_/includes.md) +- `Thenable.prototype` + - [`finally`](docs/thenable_/finally.md) diff --git a/node_modules/ext/docs/function/identity.md b/node_modules/ext/docs/function/identity.md new file mode 100644 index 0000000..b6a5c1d --- /dev/null +++ b/node_modules/ext/docs/function/identity.md @@ -0,0 +1,9 @@ +# `Function.identity` _(ext/function/identity)_ + +Returns input argument. + +```javascript +const identity = require("ext/function/identity"); + +identity("foo"); // "foo" +``` diff --git a/node_modules/ext/docs/global-this.md b/node_modules/ext/docs/global-this.md new file mode 100644 index 0000000..fafd422 --- /dev/null +++ b/node_modules/ext/docs/global-this.md @@ -0,0 +1,9 @@ +# `globalThis` _(ext/global-this)_ + +Returns global object. Resolve native [globalThis](https://github.com/tc39/proposal-global) if implemented, otherwise fallback to internal resolution of a global object. + +```javascript +const globalThis = require("ext/global-this"); + +globalThis.Array === Array; // true +``` diff --git a/node_modules/ext/docs/math/ceil-10.md b/node_modules/ext/docs/math/ceil-10.md new file mode 100644 index 0000000..1d53122 --- /dev/null +++ b/node_modules/ext/docs/math/ceil-10.md @@ -0,0 +1,10 @@ +# `Math.ceil10` _(ext/math/ceil-10)_ + +Decimal ceil + +```javascript +const ceil10 = require("ext/math/ceil-10"); + +ceil10(55.51, -1); // 55.6 +ceil10(-59, 1); // -50; +``` diff --git a/node_modules/ext/docs/math/floor-10.md b/node_modules/ext/docs/math/floor-10.md new file mode 100644 index 0000000..099c1b6 --- /dev/null +++ b/node_modules/ext/docs/math/floor-10.md @@ -0,0 +1,10 @@ +# `Math.floor10` _(ext/math/floor-10)_ + +Decimal floor + +```javascript +const floor10 = require("ext/math/floor-10"); + +floor10(55.59, -1); // 55.5 +floor10(59, 1); // 50 +``` diff --git a/node_modules/ext/docs/math/round-10.md b/node_modules/ext/docs/math/round-10.md new file mode 100644 index 0000000..727acb1 --- /dev/null +++ b/node_modules/ext/docs/math/round-10.md @@ -0,0 +1,10 @@ +# `Math.round10` _(ext/math/round-10)_ + +Decimal round + +```javascript +const round10 = require("ext/math/round-10"); + +round10(55.549, -1); // 55.5 +round10(1.005, -2); // 1.01 +``` diff --git a/node_modules/ext/docs/object/entries.md b/node_modules/ext/docs/object/entries.md new file mode 100644 index 0000000..2d05f4c --- /dev/null +++ b/node_modules/ext/docs/object/entries.md @@ -0,0 +1,11 @@ +# `Object.entries` _(ext/object/entries)_ + +[Object.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries) implementation. + +Returns native `Object.entries` if it's implemented, otherwise library implementation is returned + +```javascript +const entries = require("ext/object/entries"); + +entries({ foo: "bar" }); // [["foo", "bar"]] +``` diff --git a/node_modules/ext/docs/string/random.md b/node_modules/ext/docs/string/random.md new file mode 100644 index 0000000..c3099e9 --- /dev/null +++ b/node_modules/ext/docs/string/random.md @@ -0,0 +1,31 @@ +# `String.random(options = { ... })` _(ext/string/random)_ + +Returns generated random string, contained only of ascii cars `a-z` and `0-1`. +By default returns string of length `10`. + +```javascript +const random = require("ext/string/random"); + +random(); // "upcfns0i4t" +random({ length: 3 }); // "5tw" +``` + +## Supported options: + +### `isUnique: false` + +Ensures generated string is unique among ones already returned. + +_Note: When not applying this setting, accidental generation of same string is still highly unlikely. Provided option is just to provide a mean to eliminate possibility of an edge case of duplicate string being returned_ + +### `length: 10` + +Desired length of result string + +### `charset: null` + +Fixed list of possible characters + +```javascript +random({ charset: "abc" }); // "bacbccbbac" +``` diff --git a/node_modules/ext/docs/string_/includes.md b/node_modules/ext/docs/string_/includes.md new file mode 100644 index 0000000..4fe1b58 --- /dev/null +++ b/node_modules/ext/docs/string_/includes.md @@ -0,0 +1,10 @@ +# `string.includes(position = 0)` _(ext/string\_/includes)_ + +`includes` method for strings. Resolve native [includes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) if implemented, otherwise fallback to shim implementation. + +```javascript +const includes = require("ext/string_/includes"); + +includes.call("razdwa", "raz"); // true +includes.call("razdwa", "trzy"); // false +``` diff --git a/node_modules/ext/docs/thenable_/finally.md b/node_modules/ext/docs/thenable_/finally.md new file mode 100644 index 0000000..978ce0c --- /dev/null +++ b/node_modules/ext/docs/thenable_/finally.md @@ -0,0 +1,9 @@ +# `thenable.finally` _(ext/thenable\_/finally)_ + +`finally` method for any _thenable_ input + +```javascript +const finally = require("ext/thenable_/finally"); + +finally.call(thenable, () => console.log("Thenable resolved")); +``` diff --git a/node_modules/ext/function/identity.js b/node_modules/ext/function/identity.js new file mode 100644 index 0000000..cde213f --- /dev/null +++ b/node_modules/ext/function/identity.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (value) { return value; }; diff --git a/node_modules/ext/global-this/implementation.js b/node_modules/ext/global-this/implementation.js new file mode 100644 index 0000000..6a06d52 --- /dev/null +++ b/node_modules/ext/global-this/implementation.js @@ -0,0 +1,31 @@ +var naiveFallback = function () { + if (typeof self === "object" && self) return self; + if (typeof window === "object" && window) return window; + throw new Error("Unable to resolve global `this`"); +}; + +module.exports = (function () { + if (this) return this; + + // Unexpected strict mode (may happen if e.g. bundled into ESM module) + + // Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis + // In all ES5+ engines global object inherits from Object.prototype + // (if you approached one that doesn't please report) + try { + Object.defineProperty(Object.prototype, "__global__", { + get: function () { return this; }, + configurable: true + }); + } catch (error) { + // Unfortunate case of Object.prototype being sealed (via preventExtensions, seal or freeze) + return naiveFallback(); + } + try { + // Safari case (window.__global__ is resolved with global context, but __global__ does not) + if (!__global__) return naiveFallback(); + return __global__; + } finally { + delete Object.prototype.__global__; + } +})(); diff --git a/node_modules/ext/global-this/index.js b/node_modules/ext/global-this/index.js new file mode 100644 index 0000000..8a99c25 --- /dev/null +++ b/node_modules/ext/global-this/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? globalThis : require("./implementation"); diff --git a/node_modules/ext/global-this/is-implemented.js b/node_modules/ext/global-this/is-implemented.js new file mode 100644 index 0000000..3eae23e --- /dev/null +++ b/node_modules/ext/global-this/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + if (typeof globalThis !== "object") return false; + if (!globalThis) return false; + return globalThis.Array === Array; +}; diff --git a/node_modules/ext/lib/private/decimal-adjust.js b/node_modules/ext/lib/private/decimal-adjust.js new file mode 100644 index 0000000..e04cde9 --- /dev/null +++ b/node_modules/ext/lib/private/decimal-adjust.js @@ -0,0 +1,29 @@ +// Credit: +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round +// #Decimal_rounding + +"use strict"; + +var isValue = require("type/object/is") + , ensureInteger = require("type/integer/ensure"); + +var split = String.prototype.split; + +module.exports = function (type) { + return function (value/*, exp*/) { + value = Number(value); + var exp = arguments[1]; + if (isValue(exp)) exp = ensureInteger(exp); + if (!value) return value; + if (!exp) return Math[type](value); + if (!isFinite(value)) return value; + + // Shift + var tokens = split.call(value, "e"); + value = Math[type](tokens[0] + "e" + ((tokens[1] || 0) - exp)); + + // Shift back + tokens = value.toString().split("e"); + return Number(tokens[0] + "e" + (Number(tokens[1] || 0) + exp)); + }; +}; diff --git a/node_modules/ext/math/ceil-10.js b/node_modules/ext/math/ceil-10.js new file mode 100644 index 0000000..c57a730 --- /dev/null +++ b/node_modules/ext/math/ceil-10.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("../lib/private/decimal-adjust")("ceil"); diff --git a/node_modules/ext/math/floor-10.js b/node_modules/ext/math/floor-10.js new file mode 100644 index 0000000..27dd1aa --- /dev/null +++ b/node_modules/ext/math/floor-10.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("../lib/private/decimal-adjust")("floor"); diff --git a/node_modules/ext/math/round-10.js b/node_modules/ext/math/round-10.js new file mode 100644 index 0000000..643d676 --- /dev/null +++ b/node_modules/ext/math/round-10.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("../lib/private/decimal-adjust")("round"); diff --git a/node_modules/ext/node_modules/type/.editorconfig b/node_modules/ext/node_modules/type/.editorconfig new file mode 100644 index 0000000..bd6d81e --- /dev/null +++ b/node_modules/ext/node_modules/type/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +trim_trailing_whitespace = true + +[*.md] +indent_size = 2 +indent_style = space +trim_trailing_whitespace = false diff --git a/node_modules/ext/node_modules/type/CHANGELOG.md b/node_modules/ext/node_modules/type/CHANGELOG.md new file mode 100644 index 0000000..8fd0ad8 --- /dev/null +++ b/node_modules/ext/node_modules/type/CHANGELOG.md @@ -0,0 +1,104 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [2.0.0](https://github.com/medikoo/type/compare/v1.2.0...v2.0.0) (2019-10-10) + +### Features + +- `allowedKeys` option for plain-object/ensure ([f81e72e](https://github.com/medikoo/type/commit/f81e72e)) +- `ensurePropertyValue` option for plain-object/ensure ([c5ff8fb](https://github.com/medikoo/type/commit/c5ff8fb)) +- Replace `coerceItem` with `ensureItem` option in iterable/ensure ([721494f](https://github.com/medikoo/type/commit/721494f)) +- Seclude lib/resolve-error-message ([12636d9](https://github.com/medikoo/type/commit/12636d9)) +- Validate options.ensureItem in iterable/ensure ([78da6c1](https://github.com/medikoo/type/commit/78da6c1)) + +### BREAKING CHANGES + +- iterable/ensure no longer supports `coerceItem` option. Instead `ensureItem` was introduced + +## [1.2.0](https://github.com/medikoo/type/compare/v1.1.0...v1.2.0) (2019-09-20) + +### Bug Fixes + +- Improve error message so it's not confusing ([97cd6b9](https://github.com/medikoo/type/commit/97cd6b9)) + +### Features + +- 'coerceItem' option for iterable/ensure ([0818860](https://github.com/medikoo/type/commit/0818860)) + +## [1.1.0](https://github.com/medikoo/type/compare/v1.0.3...v1.1.0) (2019-09-20) + +### Features + +- `denyEmpty` option for iterables validation ([301d071](https://github.com/medikoo/type/commit/301d071)) + +### [1.0.3](https://github.com/medikoo/type/compare/v1.0.2...v1.0.3) (2019-08-06) + +### Bug Fixes + +- Recognize custom built ES5 era errors ([6462fac](https://github.com/medikoo/type/commit/6462fac)) + +### [1.0.2](https://github.com/medikoo/type/compare/v1.0.1...v1.0.2) (2019-08-06) + +### Bug Fixes + +- Recognize host errors (e.g. DOMException) ([96ef399](https://github.com/medikoo/type/commit/96ef399)) + +## [1.0.1](https://github.com/medikoo/type/compare/v1.0.0...v1.0.1) (2019-04-08) + +# 1.0.0 (2019-04-05) + +### Bug Fixes + +- ensure 'is' functions can't crash ([59ceb78](https://github.com/medikoo/type/commit/59ceb78)) + +### Features + +- array-length/coerce ([af8ddec](https://github.com/medikoo/type/commit/af8ddec)) +- array-length/ensure ([d313eb6](https://github.com/medikoo/type/commit/d313eb6)) +- array-like/ensure ([45f1ddd](https://github.com/medikoo/type/commit/45f1ddd)) +- array-like/is ([9a026a5](https://github.com/medikoo/type/commit/9a026a5)) +- array/ensure ([9db1515](https://github.com/medikoo/type/commit/9db1515)) +- array/is ([9672839](https://github.com/medikoo/type/commit/9672839)) +- date/ensure ([44e25a0](https://github.com/medikoo/type/commit/44e25a0)) +- date/is ([0316558](https://github.com/medikoo/type/commit/0316558)) +- ensure to not crash ([3998348](https://github.com/medikoo/type/commit/3998348)) +- ensure/number ([134b5cb](https://github.com/medikoo/type/commit/134b5cb)) +- error/ensure ([d5c8a30](https://github.com/medikoo/type/commit/d5c8a30)) +- error/is-error ([4d6b899](https://github.com/medikoo/type/commit/4d6b899)) +- finite/coerce ([accaad1](https://github.com/medikoo/type/commit/accaad1)) +- finite/ensure ([51e4174](https://github.com/medikoo/type/commit/51e4174)) +- function/ensure ([b624c9a](https://github.com/medikoo/type/commit/b624c9a)) +- function/is ([dab8026](https://github.com/medikoo/type/commit/dab8026)) +- integer/coerce ([89dea2e](https://github.com/medikoo/type/commit/89dea2e)) +- integer/ensure ([44a7071](https://github.com/medikoo/type/commit/44a7071)) +- iterable/ensure ([3d48841](https://github.com/medikoo/type/commit/3d48841)) +- iterable/is ([cf09513](https://github.com/medikoo/type/commit/cf09513)) +- lib/is-to-string-tag-supported ([c8c001d](https://github.com/medikoo/type/commit/c8c001d)) +- natural-number/coerce ([d08fdd9](https://github.com/medikoo/type/commit/d08fdd9)) +- natural-number/ensure ([6c24d12](https://github.com/medikoo/type/commit/6c24d12)) +- number/coerce ([86ccf08](https://github.com/medikoo/type/commit/86ccf08)) +- object/ensure ([a9e8eed](https://github.com/medikoo/type/commit/a9e8eed)) +- object/is ([d2d7251](https://github.com/medikoo/type/commit/d2d7251)) +- plain-function/ensure ([5186518](https://github.com/medikoo/type/commit/5186518)) +- plain-function/is ([51bc791](https://github.com/medikoo/type/commit/51bc791)) +- plain-object/ensure ([91cf5e5](https://github.com/medikoo/type/commit/91cf5e5)) +- plain-object/is ([4dcf393](https://github.com/medikoo/type/commit/4dcf393)) +- promise/ensure ([8d096a4](https://github.com/medikoo/type/commit/8d096a4)) +- promise/is ([a00de02](https://github.com/medikoo/type/commit/a00de02)) +- prototype/is ([b23bdcc](https://github.com/medikoo/type/commit/b23bdcc)) +- reg-exp/ensure ([6f7bbcb](https://github.com/medikoo/type/commit/6f7bbcb)) +- reg-exp/is ([9728519](https://github.com/medikoo/type/commit/9728519)) +- safe-integer/coerce ([b8549c4](https://github.com/medikoo/type/commit/b8549c4)) +- safe-integer/ensure ([a70ef3f](https://github.com/medikoo/type/commit/a70ef3f)) +- string/coerce ([b25c71f](https://github.com/medikoo/type/commit/b25c71f)) +- string/ensure ([b62577d](https://github.com/medikoo/type/commit/b62577d)) +- support 'default' in resolveException ([e08332a](https://github.com/medikoo/type/commit/e08332a)) +- switch config to ES3 based ([37606d9](https://github.com/medikoo/type/commit/37606d9)) +- thenable/ensure ([6762c0d](https://github.com/medikoo/type/commit/6762c0d)) +- thenable/is ([2711d70](https://github.com/medikoo/type/commit/2711d70)) +- time-value/coerce ([27fd109](https://github.com/medikoo/type/commit/27fd109)) +- time-value/ensure ([1f6a8ea](https://github.com/medikoo/type/commit/1f6a8ea)) +- **string/coerce:** restrict toString acceptance ([2a87100](https://github.com/medikoo/type/commit/2a87100)) +- value/ensure ([dd6d8cb](https://github.com/medikoo/type/commit/dd6d8cb)) +- value/is ([fdf4763](https://github.com/medikoo/type/commit/fdf4763)) diff --git a/node_modules/ext/node_modules/type/LICENSE b/node_modules/ext/node_modules/type/LICENSE new file mode 100644 index 0000000..5d6924b --- /dev/null +++ b/node_modules/ext/node_modules/type/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2019, Mariusz Nowak, @medikoo, medikoo.com + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/ext/node_modules/type/README.md b/node_modules/ext/node_modules/type/README.md new file mode 100644 index 0000000..e8413be --- /dev/null +++ b/node_modules/ext/node_modules/type/README.md @@ -0,0 +1,820 @@ +[![*nix build status][nix-build-image]][nix-build-url] +[![Windows build status][win-build-image]][win-build-url] +[![Tests coverage][cov-image]][cov-url] +[![npm version][npm-image]][npm-url] + +# type + +## Runtime validation and processing of JavaScript types + +- Respects language nature and acknowledges its quirks +- Allows coercion in restricted forms (rejects clearly invalid input, normalizes permissible type deviations) +- No transpilation implied, written to work in all ECMAScript 3+ engines + +### Example usage + +Bulletproof input arguments normalization and validation: + +```javascript +const ensureString = require('type/string/ensure') + , ensureDate = require('type/date/ensure') + , ensureNaturalNumber = require('type/natural-number/ensure') + , isObject = require('type/object/is'); + +module.exports = (path, options = { min: 0 }) { + path = ensureString(path, { errorMessage: "%v is not a path" }); + if (!isObject(options)) options = {}; + const min = ensureNaturalNumber(options.min, { default: 0 }) + , max = ensureNaturalNumber(options.max, { isOptional: true }) + , startTime = ensureDate(options.startTime, { isOptional: true }); + + // ...logic +}; +``` + +### Installation + +```bash +npm install type +``` + +## Utilities + +Serves following kind of utilities: + +##### `*/coerce` + +Restricted coercion into primitive type. Returns coerced value or `null` if value is not coercible per rules. + +##### `*/is` + +Object type/kind confirmation, returns either `true` or `false`. + +##### `*/ensure` + +Value validation. Returns input value (in primitive cases possibly coerced) or if value doesn't meet the constraints throws `TypeError` . + +Each `*/ensure` utility, accepts following options (eventually passed with second argument): + +- `isOptional` - Makes `null` or `undefined` accepted as valid value. In such case instead of `TypeError` being thrown, `null` is returned. +- `default` - A value to be returned if `null` or `undefined` is passed as an input value. +- `errorMessage` - Custom error message (`%v` can be used as a placeholder for input value) + +--- + +### Value + +_Value_, any value that's neither `null` nor `undefined` . + +#### `value/is` + +Confirms whether passed argument is a _value_ + +```javascript +const isValue = require("type/value/is"); + +isValue({}); // true +isValue(null); // false +``` + +#### `value/ensure` + +Ensures if given argument is a _value_. If it's a value it is returned back, if not `TypeError` is thrown + +```javascript +const ensureValue = require("type/value/ensure"); + +const obj = {}; + +ensureValue(obj); // obj +ensureValue(null); // Thrown TypeError: Cannot use null +``` + +--- + +### Object + +_Object_, any non-primitive value + +#### `object/is` + +Confirms if passed value is an object + +```javascript +const isObject = require("type/object/is"); + +isObject({}); // true +isObject(true); // false +isObject(null); // false +``` + +#### `object/ensure` + +If given argument is an object, it is returned back. Otherwise `TypeError` is thrown. + +```javascript +const ensureObject = require("type/object/ensure"); + +const obj = {}; + +ensureObject(obj); // obj +ensureString(null); // Thrown TypeError: null is not an object +``` + +--- + +### String + +_string_ primitive + +#### `string/coerce` + +Restricted string coercion. Returns string presentation for every value that follows below constraints + +- is implicitly coercible to string +- is neither`null` nor `undefined` +- its `toString` method is not `Object.prototype.toString` + +For all other values `null` is returned + +```javascript +const coerceToString = require("type/string/coerce"); + +coerceToString(12); // "12" +coerceToString(undefined); // null +``` + +#### `string/ensure` + +If given argument is a string coercible value (via [`string/coerce`](#stringcoerce)) returns result string. +Otherwise `TypeError` is thrown. + +```javascript +const ensureString = require("type/string/ensure"); + +ensureString(12); // "12" +ensureString(null); // Thrown TypeError: null is not a string +``` + +--- + +### Number + +_number_ primitive + +#### `number/coerce` + +Restricted number coercion. Returns number presentation for every value that follows below constraints + +- is implicitly coercible to number +- is neither `null` nor `undefined` +- is not `NaN` and doesn't coerce to `NaN` + +For all other values `null` is returned + +```javascript +const coerceToNumber = require("type/number/coerce"); + +coerceToNumber("12"); // 12 +coerceToNumber({}); // null +coerceToNumber(null); // null +``` + +#### `number/ensure` + +If given argument is a number coercible value (via [`number/coerce`](#numbercoerce)) returns result number. +Otherwise `TypeError` is thrown. + +```javascript +const ensureNumber = require("type/number/ensure"); + +ensureNumber(12); // "12" +ensureNumber(null); // Thrown TypeError: null is not a number +``` + +--- + +#### Finite Number + +Finite _number_ primitive + +##### `finite/coerce` + +Follows [`number/coerce`](#numbercoerce) additionally rejecting `Infinity` and `-Infinity` values (`null` is returned if given values coerces to them) + +```javascript +const coerceToFinite = require("type/finite/coerce"); + +coerceToFinite("12"); // 12 +coerceToFinite(Infinity); // null +coerceToFinite(null); // null +``` + +##### `finite/ensure` + +If given argument is a finite number coercible value (via [`finite/coerce`](#finitecoerce)) returns result number. +Otherwise `TypeError` is thrown. + +```javascript +const ensureFinite = require("type/finite/ensure"); + +ensureFinite(12); // "12" +ensureFinite(null); // Thrown TypeError: null is not a finite number +``` + +--- + +#### Integer Number + +Integer _number_ primitive + +##### `integer/coerce` + +Follows [`finite/coerce`](#finitecoerce) additionally stripping decimal part from the number + +```javascript +const coerceToInteger = require("type/integer/coerce"); + +coerceToInteger("12.95"); // 12 +coerceToInteger(Infinity); // null +coerceToInteger(null); // null +``` + +##### `integer/ensure` + +If given argument is an integer coercible value (via [`integer/coerce`](#integercoerce)) returns result number. +Otherwise `TypeError` is thrown. + +```javascript +const ensureInteger = require("type/integer/ensure"); + +ensureInteger(12.93); // "12" +ensureInteger(null); // Thrown TypeError: null is not an integer +``` + +--- + +#### Safe Integer Number + +Safe integer _number_ primitive + +##### `safe-integer/coerce` + +Follows [`integer/coerce`](#integercoerce) but returns `null` in place of values which are beyond `Number.MIN_SAFE_INTEGER` and `Number.MAX_SAFE_INTEGER` range. + +```javascript +const coerceToSafeInteger = require("type/safe-integer/coerce"); + +coerceToInteger("12.95"); // 12 +coerceToInteger(9007199254740992); // null +coerceToInteger(null); // null +``` + +##### `safe-integer/ensure` + +If given argument is a safe integer coercible value (via [`safe-integer/coerce`](#safe-integercoerce)) returns result number. +Otherwise `TypeError` is thrown. + +```javascript +const ensureSafeInteger = require("type/safe-integer/ensure"); + +ensureSafeInteger(12.93); // "12" +ensureSafeInteger(9007199254740992); // Thrown TypeError: null is not a safe integer +``` + +--- + +#### Natural Number + +Natural _number_ primitive + +##### `natural-number/coerce` + +Follows [`integer/coerce`](#integercoerce) but returns `null` for values below `0` + +```javascript +const coerceToNaturalNumber = require("type/natural-number/coerce"); + +coerceToNaturalNumber("12.95"); // 12 +coerceToNaturalNumber(-120); // null +coerceToNaturalNumber(null); // null +``` + +##### `natural-number/ensure` + +If given argument is a natural number coercible value (via [`natural-number/coerce`](#natural-numbercoerce)) returns result number. +Otherwise `TypeError` is thrown. + +```javascript +const ensureNaturalNumber = require("type/natural-number/ensure"); + +ensureNaturalNumber(12.93); // "12" +ensureNaturalNumber(-230); // Thrown TypeError: null is not a natural number +``` + +--- + +### Plain Object + +A _plain object_ + +- Inherits directly from `Object.prototype` or `null` +- Is not a constructor's `prototype` property + +#### `plain-object/is` + +Confirms if given object is a _plain object_ + +```javascript +const isPlainObject = require("type/plain-object/is"); + +isPlainObject({}); // true +isPlainObject(Object.create(null)); // true +isPlainObject([]); // false +``` + +#### `plain-object/ensure` + +If given argument is a plain object it is returned back. Otherwise `TypeError` is thrown. + +```javascript +const ensurePlainObject = require("type/plain-object/ensure"); + +ensurePlainObject({}); // {} +ensurePlainObject("foo"); // Thrown TypeError: foo is not a plain object +``` + +##### Confirming on keys + +Keys can be validated by passing `allowedKeys` option. Note that in this case: + +- Error message lists up to three invalid keys + +```javascript +const allowedKeys = ["foo"]; + +ensurePlainObject({}, { allowedKeys }); // {} +ensurePlainObject({ foo: "bar" }, { allowedKeys }); // { foo: 'bar' } + +/* + Below invocation with crash with: + TypeError: [object Object] is not a valid plain object. + Following keys are unexpected: lorem, ipsum +*/ +ensurePlainObject({ foo: "bar", lorem: 1, ipsum: 2 }, { allowedKeys }); +``` + +##### Confirming on property values + +Property values can be validated by passing `ensurePropertyValue` option. Note that in this case: + +- A newly created instance of plain object with coerced values is returned +- Error message lists up to three keys that contain invalid values + +```javascript +const ensureString = require("type/string/ensure"); + +ensurePlainObject({ foo: 12 }, { ensurePropertyValue: ensureString }); // { foo: '12' } + +/* + Below invocation with crash with: + TypeError: [object Object] is not a valid plain object. + Valuees for following keys are invalid: lorem, ipsum +*/ +ensurePlainObject({ foo: 23, lorem: {}, ipsum: {} }, { ensurePropertyValue: ensureString }); +``` + +--- + +### Array + +_Array_ instance + +#### `array/is` + +Confirms if given object is a native array + +```javascript +const isArray = require("type/array/is"); + +isArray([]); // true +isArray({}); // false +isArray("foo"); // false +``` + +#### `array/ensure` + +If given argument is an array, it is returned back. Otherwise `TypeError` is thrown. + +```javascript +const ensureArray = require("type/array/ensure"); + +ensureArray(["foo"]); // ["foo"] +ensureArray("foo"); // Thrown TypeError: foo is not an array +``` + +--- + +#### Array Like + +_Array-like_ value (any value with `length` property) + +#### `array-like/is` + +Restricted _array-like_ confirmation. Returns true for every value that meets following contraints + +- is an _object_ (or with `allowString` option, a _string_) +- is not a _function_ +- Exposes `length` that meets [`array-length`](#array-lengthcoerce) constraints + +```javascript +const isArrayLike = require("type/array-like/is"); + +isArrayLike([]); // true +isArrayLike({}); // false +isArrayLike({ length: 0 }); // true +isArrayLike("foo"); // false +isArrayLike("foo", { allowString: true }); // true +``` + +#### `array-like/ensure` + +If given argument is an _array-like_, it is returned back. Otherwise `TypeError` is thrown. + +```javascript +const ensureArrayLike = require("type/array-like/ensure"); + +ensureArrayLike({ length: 0 }); // { length: 0 } +ensureArrayLike("foo", { allowString: true }); // "foo" +ensureArrayLike({}); // Thrown TypeError: null is not an iterable +``` + +--- + +#### Array length + +_number_ primitive that conforms as valid _array length_ + +##### `array-length/coerce` + +Follows [`safe-integer/coerce`](#safe-integercoerce) but returns `null` in place of values which are below `0` + +```javascript +const coerceToArrayLength = require("type/safe-integer/coerce"); + +coerceToArrayLength("12.95"); // 12 +coerceToArrayLength(9007199254740992); // null +coerceToArrayLength(null); // null +``` + +##### `array-length/ensure` + +If given argument is an _array length_ coercible value (via [`array-length/coerce`](#array-lengthcoerce)) returns result number. +Otherwise `TypeError` is thrown. + +```javascript +const ensureArrayLength = require("type/array-length/ensure"); + +ensureArrayLength(12.93); // "12" +ensureArrayLength(9007199254740992); // Thrown TypeError: null is not a valid array length +``` + +--- + +### Iterable + +Value which implements _iterable_ protocol + +#### `iterable/is` + +Confirms if given object is an _iterable_ and is not a _string_ (unless `allowString` option is passed) + +```javascript +const isIterable = require("type/iterable/is"); + +isIterable([]); // true +isIterable({}); // false +isIterable("foo"); // false +isIterable("foo", { allowString: true }); // true +``` + +Supports also `denyEmpty` option + +```javascript +isIterable([], { denyEmpty: true }); // false +isIterable(["foo"], { denyEmpty: true }); // true +``` + +#### `iterable/ensure` + +If given argument is an _iterable_, it is returned back. Otherwise `TypeError` is thrown. +By default _string_ primitives are rejected unless `allowString` option is passed. + +```javascript +const ensureIterable = require("type/iterable/ensure"); + +ensureIterable([]); // [] +ensureIterable("foo", { allowString: true }); // "foo" +ensureIterable({}); // Thrown TypeError: null is not expected iterable +``` + +##### Denying empty iterables + +Pass `denyEmpty` option to require non empty iterables + +```javascript +ensureIterable([], { denyEmpty: true }); // Thrown TypeError: [] is not expected iterable +``` + +##### Confirming on items + +Items can be validated by passing `ensureItem` option. Note that in this case: + +- A newly created instance of array with coerced values is returned +- Error message lists up to three invalid items + +```javascript +const ensureString = require("type/string/ensure"); + +ensureIterable(new Set(["foo", 12]), { ensureItem: ensureString }); // ["foo", "12"] + +/* + Below invocation with crash with: + TypeError: [object Set] is not expected iterable value. + Following items are invalid: + - [object Object] +*/ +ensureIterable(new Set(["foo", {}]), { ensureItem: ensureString }); +``` + +--- + +### Date + +_Date_ instance + +#### `date/is` + +Confirms if given object is a native date, and is not an _Invalid Date_ + +```javascript +const isDate = require("type/date/is"); + +isDate(new Date()); // true +isDate(new Date("Invalid date")); // false +isDate(Date.now()); // false +isDate("foo"); // false +``` + +#### `date/ensure` + +If given argument is a date object, it is returned back. Otherwise `TypeError` is thrown. + +```javascript +const ensureDate = require("type/date/ensure"); + +const date = new Date(); +ensureDate(date); // date +ensureDate(123123); // Thrown TypeError: 123123 is not a date object +``` + +--- + +### Time value + +_number_ primitive which is a valid _time value_ (as used internally in _Date_ instances) + +#### `time-value/coerce` + +Follows [`integer/coerce`](#integercoerce) but returns `null` in place of values which go beyond 100 000 0000 days from unix epoch + +```javascript +const coerceToTimeValue = require("type/time-value/coerce"); + +coerceToTimeValue(12312312); // true +coerceToTimeValue(Number.MAX_SAFE_INTEGER); // false +coerceToTimeValue("foo"); // false +``` + +##### `time-value/ensure` + +If given argument is a _time value_ coercible value (via [`time-value/coerce`](#time-valuecoerce)) returns result number. +Otherwise `TypeError` is thrown. + +```javascript +const ensureTimeValue = require("type/time-value/ensure"); + +ensureTimeValue(12.93); // "12" +ensureTimeValue(Number.MAX_SAFE_INTEGER); // Thrown TypeError: null is not a natural number +``` + +--- + +### Function + +_Function_ instance + +#### `function/is` + +Confirms if given object is a native function + +```javascript +const isFunction = require("type/function/is"); + +isFunction(function () {}); // true +isFunction(() => {}); // true +isFunction(class {}); // true +isFunction("foo"); // false +``` + +#### `function/ensure` + +If given argument is a function object, it is returned back. Otherwise `TypeError` is thrown. + +```javascript +const ensureFunction = require("type/function/ensure"); + +const fn = function () {}; +ensureFunction(fn); // fn +ensureFunction(/foo/); // Thrown TypeError: /foo/ is not a function +``` + +--- + +#### Plain Function + +A _Function_ instance that is not a _Class_ + +##### `plain-function/is` + +Confirms if given object is a _plain function_ + +```javascript +const isPlainFunction = require("type/plain-function/is"); + +isPlainFunction(function () {}); // true +isPlainFunction(() => {}); // true +isPlainFunction(class {}); // false +isPlainFunction("foo"); // false +``` + +##### `plain-function/ensure` + +If given argument is a _plain function_ object, it is returned back. Otherwise `TypeError` is thrown. + +```javascript +const ensurePlainFunction = require("type/function/ensure"); + +const fn = function () {}; +ensurePlainFunction(fn); // fn +ensurePlainFunction(class {}); // Thrown TypeError: class is not a plain function +``` + +--- + +### RegExp + +_RegExp_ instance + +#### `reg-exp/is` + +Confirms if given object is a native regular expression object + +```javascript +const isRegExp = require("type/reg-exp/is"); + +isRegExp(/foo/); +isRegExp({}); // false +isRegExp("foo"); // false +``` + +#### `reg-exp/ensure` + +If given argument is a regular expression object, it is returned back. Otherwise `TypeError` is thrown. + +```javascript +const ensureRegExp = require("type/reg-exp/ensure"); + +ensureRegExp(/foo/); // /foo/ +ensureRegExp("foo"); // Thrown TypeError: null is not a regular expression object +``` + +--- + +### Promise + +_Promise_ instance + +#### `promise/is` + +Confirms if given object is a native _promise_ + +```javascript +const isPromise = require("type/promise/is"); + +isPromise(Promise.resolve()); // true +isPromise({ then: () => {} }); // false +isPromise({}); // false +``` + +##### `promise/ensure` + +If given argument is a promise, it is returned back. Otherwise `TypeError` is thrown. + +```javascript +const ensurePromise = require("type/promise/ensure"); + +const promise = Promise.resolve(); +ensurePromise(promise); // promise +eensurePromise({}); // Thrown TypeError: [object Object] is not a promise +``` + +--- + +#### Thenable + +_Thenable_ object (an object with `then` method) + +##### `thenable/is` + +Confirms if given object is a _thenable_ + +```javascript +const isThenable = require("type/thenable/is"); + +isThenable(Promise.resolve()); // true +isThenable({ then: () => {} }); // true +isThenable({}); // false +``` + +##### `thenable/ensure` + +If given argument is a _thenable_ object, it is returned back. Otherwise `TypeError` is thrown. + +```javascript +const ensureThenable = require("type/thenable/ensure"); + +const promise = Promise.resolve(); +ensureThenable(promise); // promise +ensureThenable({}); // Thrown TypeError: [object Object] is not a thenable object +``` + +--- + +### Error + +_Error_ instance + +#### `error/is` + +Confirms if given object is a native error object + +```javascript +const isError = require("type/error/is"); + +isError(new Error()); // true +isError({ message: "Fake error" }); // false +``` + +#### `error/ensure` + +If given argument is an error object, it is returned back. Otherwise `TypeError` is thrown. + +```javascript +const ensureError = require("type/error/ensure"); + +const someError = new Error("Some error"); +ensureError(someError); // someError +ensureError({ message: "Fake error" }); // Thrown TypeError: [object Object] is not an error object +``` + +--- + +### Prototype + +Some constructor's `prototype` property + +#### `prototype/is` + +Confirms if given object serves as a _prototype_ property + +```javascript +const isPrototype = require("type/prototype/is"); + +isPrototype({}); // false +isPrototype(Object.prototype); // true +isPrototype(Array.prototype); // true +``` + +### Tests + + $ npm test + +[nix-build-image]: https://semaphoreci.com/api/v1/medikoo-org/type/branches/master/shields_badge.svg +[nix-build-url]: https://semaphoreci.com/medikoo-org/type +[win-build-image]: https://ci.appveyor.com/api/projects/status/8nrtluuwsb5k9l8d?svg=true +[win-build-url]: https://ci.appveyor.com/api/project/medikoo/type +[cov-image]: https://img.shields.io/codecov/c/github/medikoo/type.svg +[cov-url]: https://codecov.io/gh/medikoo/type +[npm-image]: https://img.shields.io/npm/v/type.svg +[npm-url]: https://www.npmjs.com/package/type diff --git a/node_modules/ext/node_modules/type/array-length/coerce.js b/node_modules/ext/node_modules/type/array-length/coerce.js new file mode 100644 index 0000000..3dbbf97 --- /dev/null +++ b/node_modules/ext/node_modules/type/array-length/coerce.js @@ -0,0 +1,10 @@ +"use strict"; + +var coerceToSafeInteger = require("../safe-integer/coerce"); + +module.exports = function (value) { + value = coerceToSafeInteger(value); + if (!value) return value; + if (value < 0) return null; + return value; +}; diff --git a/node_modules/ext/node_modules/type/array-length/ensure.js b/node_modules/ext/node_modules/type/array-length/ensure.js new file mode 100644 index 0000000..ee0b556 --- /dev/null +++ b/node_modules/ext/node_modules/type/array-length/ensure.js @@ -0,0 +1,10 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , coerce = require("./coerce"); + +module.exports = function (value/*, options*/) { + var coerced = coerce(value); + if (coerced !== null) return coerced; + return resolveException(value, "%v is not a valid array length", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/array-like/ensure.js b/node_modules/ext/node_modules/type/array-like/ensure.js new file mode 100644 index 0000000..f3c9b50 --- /dev/null +++ b/node_modules/ext/node_modules/type/array-like/ensure.js @@ -0,0 +1,9 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , is = require("./is"); + +module.exports = function (value/*, options*/) { + if (is(value, arguments[1])) return value; + return resolveException(value, "%v is not an array like value", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/array-like/is.js b/node_modules/ext/node_modules/type/array-like/is.js new file mode 100644 index 0000000..7778fed --- /dev/null +++ b/node_modules/ext/node_modules/type/array-like/is.js @@ -0,0 +1,21 @@ +"use strict"; + +var coerceToArrayLength = require("../array-length/coerce") + , isObject = require("../object/is"); + +module.exports = function (value/*, options*/) { + if (!isObject(value)) { + var options = arguments[1]; + if (isObject(options) && options.allowString && typeof value === "string") return true; + return false; + } + + if (typeof value === "function") return false; + + var length; + try { length = value.length; } + catch (error) { return false; } + + if (coerceToArrayLength(length) === null) return false; + return true; +}; diff --git a/node_modules/ext/node_modules/type/array/ensure.js b/node_modules/ext/node_modules/type/array/ensure.js new file mode 100644 index 0000000..5474a78 --- /dev/null +++ b/node_modules/ext/node_modules/type/array/ensure.js @@ -0,0 +1,9 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , is = require("./is"); + +module.exports = function (value/*, options*/) { + if (is(value)) return value; + return resolveException(value, "%v is not an array object", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/array/is.js b/node_modules/ext/node_modules/type/array/is.js new file mode 100644 index 0000000..13fd8d3 --- /dev/null +++ b/node_modules/ext/node_modules/type/array/is.js @@ -0,0 +1,27 @@ +"use strict"; + +var isPrototype = require("../prototype/is"); + +var isArray; +if (typeof Array.isArray === "function") { + isArray = Array.isArray; +} else { + var objectToString = Object.prototype.toString, objectTaggedString = objectToString.call([]); + isArray = function (value) { return objectToString.call(value) === objectTaggedString; }; +} + +module.exports = function (value) { + if (!isArray(value)) return false; + + // Sanity check (reject objects which do not expose common Array interface) + if (!hasOwnProperty.call(value, "length")) return false; + try { + if (typeof value.length !== "number") return false; + if (typeof value.push !== "function") return false; + if (typeof value.splice !== "function") return false; + } catch (error) { + return false; + } + + return !isPrototype(value); +}; diff --git a/node_modules/ext/node_modules/type/date/ensure.js b/node_modules/ext/node_modules/type/date/ensure.js new file mode 100644 index 0000000..b249a67 --- /dev/null +++ b/node_modules/ext/node_modules/type/date/ensure.js @@ -0,0 +1,9 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , is = require("./is"); + +module.exports = function (value/*, options*/) { + if (is(value)) return value; + return resolveException(value, "%v is not a date object", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/date/is.js b/node_modules/ext/node_modules/type/date/is.js new file mode 100644 index 0000000..0754085 --- /dev/null +++ b/node_modules/ext/node_modules/type/date/is.js @@ -0,0 +1,26 @@ +"use strict"; + +var isPrototype = require("../prototype/is"); + +var dateValueOf = Date.prototype.valueOf; + +module.exports = function (value) { + if (!value) return false; + + try { + // Sanity check (reject objects which do not expose common Date interface) + if (typeof value.getFullYear !== "function") return false; + if (typeof value.getTimezoneOffset !== "function") return false; + if (typeof value.setFullYear !== "function") return false; + + // Ensure its native Date object (has [[DateValue]] slot) + dateValueOf.call(value); + } catch (error) { + return false; + } + + // Ensure it hosts valid date + if (isNaN(value)) return false; + + return !isPrototype(value); +}; diff --git a/node_modules/ext/node_modules/type/error/ensure.js b/node_modules/ext/node_modules/type/error/ensure.js new file mode 100644 index 0000000..a304f59 --- /dev/null +++ b/node_modules/ext/node_modules/type/error/ensure.js @@ -0,0 +1,9 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , is = require("./is"); + +module.exports = function (value/*, options*/) { + if (is(value)) return value; + return resolveException(value, "%v is not an error object", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/error/is.js b/node_modules/ext/node_modules/type/error/is.js new file mode 100644 index 0000000..bf04c80 --- /dev/null +++ b/node_modules/ext/node_modules/type/error/is.js @@ -0,0 +1,45 @@ +"use strict"; + +var isPrototype = require("../prototype/is") + , isPlainObject = require("../plain-object/is"); + +var objectToString = Object.prototype.toString; + +// Recognize host specific errors (e.g. DOMException) +var errorTaggedStringRe = /^\[object .*(?:Error|Exception)\]$/ + , errorNameRe = /^[^\s]*(?:Error|Exception)$/; + +module.exports = function (value) { + if (!value) return false; + + var name; + // Sanity check (reject objects which do not expose common Error interface) + try { + name = value.name; + if (typeof name !== "string") return false; + if (typeof value.message !== "string") return false; + } catch (error) { + return false; + } + + // Ensure its a native-like Error object + // (has [[ErrorData]] slot, or was created to resemble one) + // Note: It's not a 100% bulletproof check of confirming that as: + // - In ES2015+ string tag can be overriden via Symbol.toStringTag property + // - Host errors do not share native error tag. Still we rely on assumption that + // tag for each error will end either with `Error` or `Exception` string + // - In pre ES2015 era, no custom errors will share the error tag. + if (!errorTaggedStringRe.test(objectToString.call(value))) { + // Definitely not an ES2015 error instance, but could still be an error + // (created via e.g. CustomError.prototype = Object.create(Error.prototype)) + try { + if (name !== value.constructor.name) return false; + } catch (error) { + return false; + } + if (!errorNameRe.test(name)) return false; + if (isPlainObject(value)) return false; + } + + return !isPrototype(value); +}; diff --git a/node_modules/ext/node_modules/type/finite/coerce.js b/node_modules/ext/node_modules/type/finite/coerce.js new file mode 100644 index 0000000..a3783be --- /dev/null +++ b/node_modules/ext/node_modules/type/finite/coerce.js @@ -0,0 +1,8 @@ +"use strict"; + +var coerceToNumber = require("../number/coerce"); + +module.exports = function (value) { + value = coerceToNumber(value); + return isFinite(value) ? value : null; +}; diff --git a/node_modules/ext/node_modules/type/finite/ensure.js b/node_modules/ext/node_modules/type/finite/ensure.js new file mode 100644 index 0000000..0f899d1 --- /dev/null +++ b/node_modules/ext/node_modules/type/finite/ensure.js @@ -0,0 +1,10 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , coerce = require("./coerce"); + +module.exports = function (value/*, options*/) { + var coerced = coerce(value); + if (coerced !== null) return coerced; + return resolveException(value, "%v is not a finite number", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/function/ensure.js b/node_modules/ext/node_modules/type/function/ensure.js new file mode 100644 index 0000000..b560ae9 --- /dev/null +++ b/node_modules/ext/node_modules/type/function/ensure.js @@ -0,0 +1,9 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , is = require("./is"); + +module.exports = function (value/*, options*/) { + if (is(value)) return value; + return resolveException(value, "%v is not a function", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/function/is.js b/node_modules/ext/node_modules/type/function/is.js new file mode 100644 index 0000000..981990a --- /dev/null +++ b/node_modules/ext/node_modules/type/function/is.js @@ -0,0 +1,19 @@ +"use strict"; + +var isPrototype = require("../prototype/is"); + +module.exports = function (value) { + if (typeof value !== "function") return false; + + if (!hasOwnProperty.call(value, "length")) return false; + + try { + if (typeof value.length !== "number") return false; + if (typeof value.call !== "function") return false; + if (typeof value.apply !== "function") return false; + } catch (error) { + return false; + } + + return !isPrototype(value); +}; diff --git a/node_modules/ext/node_modules/type/integer/coerce.js b/node_modules/ext/node_modules/type/integer/coerce.js new file mode 100644 index 0000000..cba5e17 --- /dev/null +++ b/node_modules/ext/node_modules/type/integer/coerce.js @@ -0,0 +1,11 @@ +"use strict"; + +var coerceToFinite = require("../finite/coerce"); + +var abs = Math.abs, floor = Math.floor; + +module.exports = function (value) { + value = coerceToFinite(value); + if (!value) return value; + return (value > 0 ? 1 : -1) * floor(abs(value)); +}; diff --git a/node_modules/ext/node_modules/type/integer/ensure.js b/node_modules/ext/node_modules/type/integer/ensure.js new file mode 100644 index 0000000..a6c97d0 --- /dev/null +++ b/node_modules/ext/node_modules/type/integer/ensure.js @@ -0,0 +1,10 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , coerce = require("./coerce"); + +module.exports = function (value/*, options*/) { + var coerced = coerce(value); + if (coerced !== null) return coerced; + return resolveException(value, "%v is not an integer", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/iterable/ensure.js b/node_modules/ext/node_modules/type/iterable/ensure.js new file mode 100644 index 0000000..eea9457 --- /dev/null +++ b/node_modules/ext/node_modules/type/iterable/ensure.js @@ -0,0 +1,45 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , resolveErrorMessage = require("../lib/resolve-error-message") + , toShortString = require("../lib/to-short-string") + , ensurePlainFunction = require("../plain-function/ensure") + , is = require("./is"); + +var invalidItemsLimit = 3, defaultErrorMessage = "%v is not expected iterable value"; + +module.exports = function (value/*, options*/) { + var options = arguments[1]; + if (!is(value, options)) return resolveException(value, defaultErrorMessage, options); + if (!options) return value; + + var ensureItem = ensurePlainFunction(options.ensureItem, { isOptional: true }); + if (ensureItem) { + var coercedValue = []; + var iterator = value[Symbol.iterator](); + var item, invalidItems; + while (!(item = iterator.next()).done) { + var newItemValue; + try { + newItemValue = ensureItem(item.value); + } catch (error) { + if (!invalidItems) invalidItems = []; + if (invalidItems.push(item.value) === invalidItemsLimit) break; + } + if (invalidItems) continue; + coercedValue.push(newItemValue); + } + if (invalidItems) { + var errorMessage = + resolveErrorMessage(defaultErrorMessage, value, options) + + ".\n Following items are invalid:"; + for (var i = 0; i < invalidItems.length; ++i) { + errorMessage += "\n - " + toShortString(invalidItems[i]); + } + throw new TypeError(errorMessage); + } + return coercedValue; + } + + return value; +}; diff --git a/node_modules/ext/node_modules/type/iterable/is.js b/node_modules/ext/node_modules/type/iterable/is.js new file mode 100644 index 0000000..d35408c --- /dev/null +++ b/node_modules/ext/node_modules/type/iterable/is.js @@ -0,0 +1,32 @@ +// Polyfills friendly, therefore ES5 syntax + +"use strict"; + +var isObject = require("../object/is"); + +var iteratorSymbol = Symbol.iterator; + +if (!iteratorSymbol) { + throw new Error("Cannot initialize iterator/is due to Symbol.iterator not being implemented"); +} + +module.exports = function (value/*, options*/) { + var options = arguments[1]; + if (!isObject(value)) { + if (!isObject(options) || !options.allowString || typeof value !== "string") return false; + } + try { + if (typeof value[iteratorSymbol] !== "function") return false; + } catch (error) { + return false; + } + if (!options) return true; + if (options.denyEmpty) { + try { + if (value[iteratorSymbol]().next().done) return false; + } catch (error) { + return false; + } + } + return true; +}; diff --git a/node_modules/ext/node_modules/type/lib/is-to-string-tag-supported.js b/node_modules/ext/node_modules/type/lib/is-to-string-tag-supported.js new file mode 100644 index 0000000..254d8b3 --- /dev/null +++ b/node_modules/ext/node_modules/type/lib/is-to-string-tag-supported.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol"; diff --git a/node_modules/ext/node_modules/type/lib/resolve-error-message.js b/node_modules/ext/node_modules/type/lib/resolve-error-message.js new file mode 100644 index 0000000..b465791 --- /dev/null +++ b/node_modules/ext/node_modules/type/lib/resolve-error-message.js @@ -0,0 +1,13 @@ +"use strict"; + +var isObject = require("../object/is") + , stringCoerce = require("../string/coerce") + , toShortString = require("./to-short-string"); + +module.exports = function (errorMessage, value, inputOptions) { + var customErrorMessage; + if (isObject(inputOptions) && inputOptions.errorMessage) { + customErrorMessage = stringCoerce(inputOptions.errorMessage); + } + return (customErrorMessage || errorMessage).replace("%v", toShortString(value)); +}; diff --git a/node_modules/ext/node_modules/type/lib/resolve-exception.js b/node_modules/ext/node_modules/type/lib/resolve-exception.js new file mode 100644 index 0000000..1c2e563 --- /dev/null +++ b/node_modules/ext/node_modules/type/lib/resolve-exception.js @@ -0,0 +1,13 @@ +"use strict"; + +var isValue = require("../value/is") + , isObject = require("../object/is") + , resolveErrorMessage = require("./resolve-error-message"); + +module.exports = function (value, defaultMessage, inputOptions) { + if (isObject(inputOptions) && !isValue(value)) { + if ("default" in inputOptions) return inputOptions["default"]; + if (inputOptions.isOptional) return null; + } + throw new TypeError(resolveErrorMessage(defaultMessage, value, inputOptions)); +}; diff --git a/node_modules/ext/node_modules/type/lib/safe-to-string.js b/node_modules/ext/node_modules/type/lib/safe-to-string.js new file mode 100644 index 0000000..a756dd3 --- /dev/null +++ b/node_modules/ext/node_modules/type/lib/safe-to-string.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (value) { + try { + return value.toString(); + } catch (error) { + try { return String(value); } + catch (error2) { return null; } + } +}; diff --git a/node_modules/ext/node_modules/type/lib/to-short-string.js b/node_modules/ext/node_modules/type/lib/to-short-string.js new file mode 100644 index 0000000..c8d7ed8 --- /dev/null +++ b/node_modules/ext/node_modules/type/lib/to-short-string.js @@ -0,0 +1,29 @@ +"use strict"; + +var safeToString = require("./safe-to-string"); + +var reNewLine = /[\n\r\u2028\u2029]/g; + +module.exports = function (value) { + var string = safeToString(value); + if (string === null) return ""; + // Trim if too long + if (string.length > 100) string = string.slice(0, 99) + "…"; + // Replace eventual new lines + string = string.replace(reNewLine, function (char) { + switch (char) { + case "\n": + return "\\n"; + case "\r": + return "\\r"; + case "\u2028": + return "\\u2028"; + case "\u2029": + return "\\u2029"; + /* istanbul ignore next */ + default: + throw new Error("Unexpected character"); + } + }); + return string; +}; diff --git a/node_modules/ext/node_modules/type/natural-number/coerce.js b/node_modules/ext/node_modules/type/natural-number/coerce.js new file mode 100644 index 0000000..4b7931c --- /dev/null +++ b/node_modules/ext/node_modules/type/natural-number/coerce.js @@ -0,0 +1,10 @@ +"use strict"; + +var coerceToInteger = require("../integer/coerce"); + +module.exports = function (value) { + value = coerceToInteger(value); + if (!value) return value; + if (value < 0) return null; + return value; +}; diff --git a/node_modules/ext/node_modules/type/natural-number/ensure.js b/node_modules/ext/node_modules/type/natural-number/ensure.js new file mode 100644 index 0000000..ec307bf --- /dev/null +++ b/node_modules/ext/node_modules/type/natural-number/ensure.js @@ -0,0 +1,10 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , coerce = require("./coerce"); + +module.exports = function (value/*, options*/) { + var coerced = coerce(value); + if (coerced !== null) return coerced; + return resolveException(value, "%v is not a natural number", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/number/coerce.js b/node_modules/ext/node_modules/type/number/coerce.js new file mode 100644 index 0000000..1bb1512 --- /dev/null +++ b/node_modules/ext/node_modules/type/number/coerce.js @@ -0,0 +1,14 @@ +"use strict"; + +var isValue = require("../value/is"); + +module.exports = function (value) { + if (!isValue(value)) return null; + try { + value = +value; // Ensure implicit coercion + } catch (error) { + return null; + } + if (isNaN(value)) return null; + return value; +}; diff --git a/node_modules/ext/node_modules/type/number/ensure.js b/node_modules/ext/node_modules/type/number/ensure.js new file mode 100644 index 0000000..ada4420 --- /dev/null +++ b/node_modules/ext/node_modules/type/number/ensure.js @@ -0,0 +1,10 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , coerce = require("./coerce"); + +module.exports = function (value/*, options*/) { + var coerced = coerce(value); + if (coerced !== null) return coerced; + return resolveException(value, "%v is not a number", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/object/ensure.js b/node_modules/ext/node_modules/type/object/ensure.js new file mode 100644 index 0000000..95ae5df --- /dev/null +++ b/node_modules/ext/node_modules/type/object/ensure.js @@ -0,0 +1,9 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , is = require("./is"); + +module.exports = function (value/*, options*/) { + if (is(value)) return value; + return resolveException(value, "%v is not an object", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/object/is.js b/node_modules/ext/node_modules/type/object/is.js new file mode 100644 index 0000000..a254dcb --- /dev/null +++ b/node_modules/ext/node_modules/type/object/is.js @@ -0,0 +1,11 @@ +"use strict"; + +var isValue = require("../value/is"); + +// prettier-ignore +var possibleTypes = { "object": true, "function": true, "undefined": true /* document.all */ }; + +module.exports = function (value) { + if (!isValue(value)) return false; + return hasOwnProperty.call(possibleTypes, typeof value); +}; diff --git a/node_modules/ext/node_modules/type/package.json b/node_modules/ext/node_modules/type/package.json new file mode 100644 index 0000000..7015a5f --- /dev/null +++ b/node_modules/ext/node_modules/type/package.json @@ -0,0 +1,132 @@ +{ + "_from": "type@^2.0.0", + "_id": "type@2.0.0", + "_inBundle": false, + "_integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==", + "_location": "/ext/type", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "type@^2.0.0", + "name": "type", + "escapedName": "type", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/ext" + ], + "_resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "_shasum": "5f16ff6ef2eb44f260494dae271033b29c09a9c3", + "_spec": "type@^2.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/ext", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "https://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/type/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Runtime validation and processing of JavaScript types", + "devDependencies": { + "chai": "^4.2.0", + "eslint": "^6.4.0", + "eslint-config-medikoo": "^2.5.1", + "git-list-updated": "^1.2.1", + "husky": "^3.0.5", + "lint-staged": "^9.2.5", + "mocha": "^6.2.0", + "nyc": "^14.1.1", + "prettier-elastic": "^1.18.2" + }, + "eslintConfig": { + "extends": "medikoo/es3", + "root": true, + "globals": { + "Map": true, + "Promise": true, + "Set": true, + "Symbol": true + }, + "overrides": [ + { + "files": "test/**/*.js", + "env": { + "mocha": true + }, + "rules": { + "no-eval": "off", + "no-new-wrappers": "off" + } + }, + { + "files": [ + "string/coerce.js", + "number/coerce.js" + ], + "rules": { + "no-implicit-coercion": "off" + } + }, + { + "files": "plain-object/is.js", + "rules": { + "no-proto": "off" + } + } + ] + }, + "homepage": "https://github.com/medikoo/type#readme", + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "keywords": [ + "type", + "coercion" + ], + "license": "ISC", + "lint-staged": { + "*.js": [ + "eslint" + ], + "*.{css,html,js,json,md,yaml,yml}": [ + "prettier -c" + ] + }, + "name": "type", + "prettier": { + "printWidth": 100, + "tabWidth": 4, + "overrides": [ + { + "files": [ + "*.md" + ], + "options": { + "tabWidth": 2 + } + } + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/medikoo/type.git" + }, + "scripts": { + "check-coverage": "npm run coverage && nyc check-coverage --statements 80 --function 80 --branches 80 --lines 80", + "coverage": "nyc --reporter=lcov --reporter=html --reporter=text-summary npm test", + "lint": "eslint --ignore-path=.gitignore .", + "lint-updated": "pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'", + "prettier-check-updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c", + "prettify": "prettier --write --ignore-path .gitignore '**/*.{css,html,js,json,md,yaml,yml}'", + "test": "mocha --recursive" + }, + "version": "2.0.0" +} diff --git a/node_modules/ext/node_modules/type/plain-function/ensure.js b/node_modules/ext/node_modules/type/plain-function/ensure.js new file mode 100644 index 0000000..811eae6 --- /dev/null +++ b/node_modules/ext/node_modules/type/plain-function/ensure.js @@ -0,0 +1,9 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , is = require("./is"); + +module.exports = function (value/*, options*/) { + if (is(value)) return value; + return resolveException(value, "%v is not a plain function", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/plain-function/is.js b/node_modules/ext/node_modules/type/plain-function/is.js new file mode 100644 index 0000000..b55d4ff --- /dev/null +++ b/node_modules/ext/node_modules/type/plain-function/is.js @@ -0,0 +1,11 @@ +"use strict"; + +var isFunction = require("../function/is"); + +var classRe = /^\s*class[\s{/}]/, functionToString = Function.prototype.toString; + +module.exports = function (value) { + if (!isFunction(value)) return false; + if (classRe.test(functionToString.call(value))) return false; + return true; +}; diff --git a/node_modules/ext/node_modules/type/plain-object/ensure.js b/node_modules/ext/node_modules/type/plain-object/ensure.js new file mode 100644 index 0000000..98ec9f2 --- /dev/null +++ b/node_modules/ext/node_modules/type/plain-object/ensure.js @@ -0,0 +1,65 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , resolveErrorMessage = require("../lib/resolve-error-message") + , ensurePlainFunction = require("../plain-function/ensure") + , ensureArray = require("../array/ensure") + , is = require("./is"); + +var objHasOwnProperty = Object.prototype.hasOwnProperty + , invalidItemsLimit = 3 + , defaultErrorMessage = "%v is not a valid plain object"; + +module.exports = function (value/*, options*/) { + var options = arguments[1]; + if (!is(value)) return resolveException(value, defaultErrorMessage, options); + if (!options) return value; + + var invalidKeys, key, errorMessage; + var allowedKeys = ensureArray(options.allowedKeys, { isOptional: true }); + if (allowedKeys) { + for (key in value) { + if (!objHasOwnProperty.call(value, key)) continue; + if (allowedKeys.indexOf(key) > -1) continue; + if (!invalidKeys) invalidKeys = []; + if (invalidKeys.push(key) === invalidItemsLimit) break; + } + if (invalidKeys) { + errorMessage = + resolveErrorMessage(defaultErrorMessage, value, options) + + ".\n Following keys are unexpected: " + + invalidKeys.join(", "); + throw new TypeError(errorMessage); + } + } + + var ensurePropertyValue = ensurePlainFunction(options.ensurePropertyValue, { + isOptional: true + }); + if (ensurePropertyValue) { + var coercedValue = {}; + for (key in value) { + if (!objHasOwnProperty.call(value, key)) continue; + var coercedPropertyValue; + try { + coercedPropertyValue = ensurePropertyValue(value[key]); + } catch (error) { + if (!invalidKeys) invalidKeys = []; + if (invalidKeys.push(key) === invalidItemsLimit) break; + } + if (invalidKeys) continue; + coercedValue[key] = coercedPropertyValue; + } + if (invalidKeys) { + errorMessage = + resolveErrorMessage(defaultErrorMessage, value, options) + + ".\n Valuees for following keys are invalid: " + + invalidKeys.join(", "); + throw new TypeError(errorMessage); + } + + return coercedValue; + } + + return value; +}; diff --git a/node_modules/ext/node_modules/type/plain-object/is.js b/node_modules/ext/node_modules/type/plain-object/is.js new file mode 100644 index 0000000..50d6713 --- /dev/null +++ b/node_modules/ext/node_modules/type/plain-object/is.js @@ -0,0 +1,28 @@ +"use strict"; + +var isObject = require("../object/is") + , isPrototype = require("../prototype/is"); + +var getPrototypeOf; +if (typeof Object.getPrototypeOf === "function") { + getPrototypeOf = Object.getPrototypeOf; +} else if ({}.__proto__ === Object.prototype) { + getPrototypeOf = function (object) { return object.__proto__; }; +} + +module.exports = function (value) { + if (!isObject(value)) return false; + var prototype; + if (getPrototypeOf) { + prototype = getPrototypeOf(value); + } else { + try { + var valueConstructor = value.constructor; + if (valueConstructor) prototype = valueConstructor.prototype; + } catch (error) { + return false; + } + } + if (prototype && !hasOwnProperty.call(prototype, "propertyIsEnumerable")) return false; + return !isPrototype(value); +}; diff --git a/node_modules/ext/node_modules/type/promise/ensure.js b/node_modules/ext/node_modules/type/promise/ensure.js new file mode 100644 index 0000000..9d7f165 --- /dev/null +++ b/node_modules/ext/node_modules/type/promise/ensure.js @@ -0,0 +1,9 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , is = require("./is"); + +module.exports = function (value/*, options*/) { + if (is(value)) return value; + return resolveException(value, "%v is not a promise", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/promise/is.js b/node_modules/ext/node_modules/type/promise/is.js new file mode 100644 index 0000000..5353362 --- /dev/null +++ b/node_modules/ext/node_modules/type/promise/is.js @@ -0,0 +1,27 @@ +"use strict"; + +var isPrototype = require("../prototype/is"); + +// In theory we could rely on Symbol.toStringTag directly, +// still early native implementation (e.g. in FF) predated symbols +var objectToString = Object.prototype.toString + , objectTaggedString = objectToString.call(Promise.resolve()); + +module.exports = function (value) { + if (!value) return false; + + // Sanity check (reject objects which do not expose common Promise interface) + try { + if (typeof value.then !== "function") return false; + if (typeof value["catch"] !== "function") return false; + } catch (error) { + return false; + } + + // Ensure its native Promise object (has [[PromiseState]] slot) + // Note: it's not 100% precise as string tag may be overriden + // and other objects could be hacked to expose it + if (objectToString.call(value) !== objectTaggedString) return false; + + return !isPrototype(value); +}; diff --git a/node_modules/ext/node_modules/type/prototype/is.js b/node_modules/ext/node_modules/type/prototype/is.js new file mode 100644 index 0000000..aaddb2a --- /dev/null +++ b/node_modules/ext/node_modules/type/prototype/is.js @@ -0,0 +1,13 @@ +"use strict"; + +var isObject = require("../object/is"); + +module.exports = function (value) { + if (!isObject(value)) return false; + try { + if (!value.constructor) return false; + return value.constructor.prototype === value; + } catch (error) { + return false; + } +}; diff --git a/node_modules/ext/node_modules/type/reg-exp/ensure.js b/node_modules/ext/node_modules/type/reg-exp/ensure.js new file mode 100644 index 0000000..460a7e0 --- /dev/null +++ b/node_modules/ext/node_modules/type/reg-exp/ensure.js @@ -0,0 +1,9 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , is = require("./is"); + +module.exports = function (value/*, options*/) { + if (is(value)) return value; + return resolveException(value, "%v is not a regular expression object", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/reg-exp/is.js b/node_modules/ext/node_modules/type/reg-exp/is.js new file mode 100644 index 0000000..f0c69d5 --- /dev/null +++ b/node_modules/ext/node_modules/type/reg-exp/is.js @@ -0,0 +1,37 @@ +"use strict"; + +var isToStringTagSupported = require("../lib/is-to-string-tag-supported") + , isPrototype = require("../prototype/is"); + +var regExpTest = RegExp.prototype.test + , objectToString = Object.prototype.toString + , objectTaggedString = objectToString.call(/a/); + +module.exports = function (value) { + if (!value) return false; + + // Sanity check (reject objects which do not expose common RegExp interface) + if (!hasOwnProperty.call(value, "lastIndex")) return false; + try { + if (typeof value.lastIndex !== "number") return false; + if (typeof value.test !== "function") return false; + if (typeof value.exec !== "function") return false; + } catch (error) { + return false; + } + + // Ensure its native RegExp object (has [[RegExpMatcher]] slot) + if (isToStringTagSupported && typeof value[Symbol.toStringTag] === "string") { + // Edge case (possibly a regExp with custom Symbol.toStringTag) + try { + var lastIndex = value.lastIndex; + regExpTest.call(value, ""); + if (value.lastIndex !== lastIndex) value.lastIndex = lastIndex; + return true; + } catch (error) { + return false; + } + } + if (objectToString.call(value) !== objectTaggedString) return false; + return !isPrototype(value); +}; diff --git a/node_modules/ext/node_modules/type/safe-integer/coerce.js b/node_modules/ext/node_modules/type/safe-integer/coerce.js new file mode 100644 index 0000000..b97e4aa --- /dev/null +++ b/node_modules/ext/node_modules/type/safe-integer/coerce.js @@ -0,0 +1,13 @@ +"use strict"; + +var coerceToInteger = require("../integer/coerce"); + +var MAX_SAFE_INTEGER = 9007199254740991, MIN_SAFE_INTEGER = -9007199254740991; + +module.exports = function (value) { + value = coerceToInteger(value); + if (!value) return value; + if (value > MAX_SAFE_INTEGER) return null; + if (value < MIN_SAFE_INTEGER) return null; + return value; +}; diff --git a/node_modules/ext/node_modules/type/safe-integer/ensure.js b/node_modules/ext/node_modules/type/safe-integer/ensure.js new file mode 100644 index 0000000..0b4e61d --- /dev/null +++ b/node_modules/ext/node_modules/type/safe-integer/ensure.js @@ -0,0 +1,10 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , coerce = require("./coerce"); + +module.exports = function (value/*, options*/) { + var coerced = coerce(value); + if (coerced !== null) return coerced; + return resolveException(value, "%v is not a safe integer", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/string/coerce.js b/node_modules/ext/node_modules/type/string/coerce.js new file mode 100644 index 0000000..43cd931 --- /dev/null +++ b/node_modules/ext/node_modules/type/string/coerce.js @@ -0,0 +1,23 @@ +"use strict"; + +var isValue = require("../value/is") + , isObject = require("../object/is"); + +var objectToString = Object.prototype.toString; + +module.exports = function (value) { + if (!isValue(value)) return null; + if (isObject(value)) { + // Reject Object.prototype.toString coercion + var valueToString = value.toString; + if (typeof valueToString !== "function") return null; + if (valueToString === objectToString) return null; + // Note: It can be object coming from other realm, still as there's no ES3 and CSP compliant + // way to resolve its realm's Object.prototype.toString it's left as not addressed edge case + } + try { + return "" + value; // Ensure implicit coercion + } catch (error) { + return null; + } +}; diff --git a/node_modules/ext/node_modules/type/string/ensure.js b/node_modules/ext/node_modules/type/string/ensure.js new file mode 100644 index 0000000..7a77aa5 --- /dev/null +++ b/node_modules/ext/node_modules/type/string/ensure.js @@ -0,0 +1,10 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , coerce = require("./coerce"); + +module.exports = function (value/*, options*/) { + var coerced = coerce(value); + if (coerced !== null) return coerced; + return resolveException(value, "%v is not a string", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/test/_lib/arrow-function-if-supported.js b/node_modules/ext/node_modules/type/test/_lib/arrow-function-if-supported.js new file mode 100644 index 0000000..f80e5eb --- /dev/null +++ b/node_modules/ext/node_modules/type/test/_lib/arrow-function-if-supported.js @@ -0,0 +1,4 @@ +"use strict"; + +try { module.exports = eval("(() => {})"); } +catch (error) {} diff --git a/node_modules/ext/node_modules/type/test/_lib/class-if-supported.js b/node_modules/ext/node_modules/type/test/_lib/class-if-supported.js new file mode 100644 index 0000000..cccfa95 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/_lib/class-if-supported.js @@ -0,0 +1,4 @@ +"use strict"; + +try { module.exports = eval("(class {})"); } +catch (error) {} diff --git a/node_modules/ext/node_modules/type/test/array-length/coerce.js b/node_modules/ext/node_modules/type/test/array-length/coerce.js new file mode 100644 index 0000000..f47a1f6 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/array-length/coerce.js @@ -0,0 +1,47 @@ +"use strict"; + +var assert = require("chai").assert + , coerceToArrayLength = require("../../array-length/coerce"); + +describe("array-length/coerce", function () { + it("Should coerce float", function () { + assert.equal(coerceToArrayLength(123.123), 123); + assert.equal(coerceToArrayLength(123.823), 123); + }); + it("Should coerce string", function () { assert.equal(coerceToArrayLength("12.123"), 12); }); + it("Should coerce booleans", function () { assert.equal(coerceToArrayLength(true), 1); }); + it("Should coerce number objects", function () { + assert.equal(coerceToArrayLength(new Number(343)), 343); + }); + it("Should coerce objects", function () { + assert.equal(coerceToArrayLength({ valueOf: function () { return 23; } }), 23); + }); + it("Should reject infinite number", function () { + assert.equal(coerceToArrayLength(Infinity), null); + }); + it("Should reject number beyond Number.MAX_SAFE_INTEGER", function () { + assert.equal(coerceToArrayLength(9007199254740992), null); + }); + it("Should reject negative number", function () { + assert.equal(coerceToArrayLength(-9), null); + }); + + it("Should reject NaN", function () { assert.equal(coerceToArrayLength(NaN), null); }); + + if (typeof Object.create === "function") { + it("Should not coerce objects with no number representation", function () { + assert.equal(coerceToArrayLength(Object.create(null)), null); + }); + } + + it("Should not coerce null", function () { assert.equal(coerceToArrayLength(null), null); }); + it("Should not coerce undefined", function () { + assert.equal(coerceToArrayLength(undefined), null); + }); + + if (typeof Symbol === "function") { + it("Should not coerce symbols", function () { + assert.equal(coerceToArrayLength(Symbol("foo")), null); + }); + } +}); diff --git a/node_modules/ext/node_modules/type/test/array-length/ensure.js b/node_modules/ext/node_modules/type/test/array-length/ensure.js new file mode 100644 index 0000000..2ff6bb6 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/array-length/ensure.js @@ -0,0 +1,19 @@ +"use strict"; + +var assert = require("chai").assert + , ensureArrayLength = require("../../array-length/ensure"); + +describe("array-length/ensure", function () { + it("Should return coerced value", function () { + assert.equal(ensureArrayLength("12.23"), 12); + }); + it("Should crash on no value", function () { + try { + ensureArrayLength(-20); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message, "-20 is not a valid array length"); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/array-like/ensure.js b/node_modules/ext/node_modules/type/test/array-like/ensure.js new file mode 100644 index 0000000..787b303 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/array-like/ensure.js @@ -0,0 +1,24 @@ +"use strict"; + +var assert = require("chai").assert + , ensureArrayLike = require("../../array-like/ensure"); + +describe("array-like/ensure", function () { + it("Should return input value", function () { + var value = []; + assert.equal(ensureArrayLike(value), value); + }); + it("Should allow strings with allowString option", function () { + var value = "foo"; + assert.equal(ensureArrayLike(value, { allowString: true }), value); + }); + it("Should crash on invalid value", function () { + try { + ensureArrayLike("foo"); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert(error.message.includes("is not an array like value")); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/array-like/is.js b/node_modules/ext/node_modules/type/test/array-like/is.js new file mode 100644 index 0000000..b74883c --- /dev/null +++ b/node_modules/ext/node_modules/type/test/array-like/is.js @@ -0,0 +1,47 @@ +"use strict"; + +var assert = require("chai").assert + , isArrayLike = require("../../array-like/is"); + +describe("array-like/is", function () { + it("Should return true on array", function () { assert.equal(isArrayLike([]), true); }); + it("Should return true on array-like object", function () { + assert.equal(isArrayLike({ length: 1 }), true); + }); + it("Should by default return false on string", function () { + assert.equal(isArrayLike("foo"), false); + }); + it("Should accept strings if specified", function () { + assert.equal(isArrayLike("foo", { allowString: true }), true); + }); + + it("Should return false on objects with negative length", function () { + assert.equal(isArrayLike({ length: -1 }), false); + }); + + it("Should return false on plain object", function () { + assert.equal(isArrayLike({}), false); + }); + it("Should return false on function", function () { + assert.equal(isArrayLike(function () { return true; }), false); + }); + + if (typeof Object.create === "function") { + it("Should return false on object with no prototype", function () { + assert.equal(isArrayLike(Object.create(null)), false); + }); + } + it("Should return false on number", function () { assert.equal(isArrayLike(123), false); }); + it("Should return false on NaN", function () { assert.equal(isArrayLike(NaN), false); }); + it("Should return false on boolean", function () { assert.equal(isArrayLike(true), false); }); + if (typeof Symbol === "function") { + it("Should return false on symbol", function () { + assert.equal(isArrayLike(Symbol("foo")), false); + }); + } + + it("Should return false on null", function () { assert.equal(isArrayLike(null), false); }); + it("Should return false on undefined", function () { + assert.equal(isArrayLike(void 0), false); + }); +}); diff --git a/node_modules/ext/node_modules/type/test/array/ensure.js b/node_modules/ext/node_modules/type/test/array/ensure.js new file mode 100644 index 0000000..a5c1e3e --- /dev/null +++ b/node_modules/ext/node_modules/type/test/array/ensure.js @@ -0,0 +1,20 @@ +"use strict"; + +var assert = require("chai").assert + , ensureArray = require("../../array/ensure"); + +describe("array/ensure", function () { + it("Should return input value", function () { + var value = []; + assert.equal(ensureArray(value), value); + }); + it("Should crash on invalid value", function () { + try { + ensureArray(null); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert(error.message.includes("is not an array object")); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/array/is.js b/node_modules/ext/node_modules/type/test/array/is.js new file mode 100644 index 0000000..88a1a40 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/array/is.js @@ -0,0 +1,41 @@ +"use strict"; + +var assert = require("chai").assert + , isArray = require("../../array/is"); + +describe("array/is", function () { + it("Should return true on array", function () { assert.equal(isArray([]), true); }); + + it("Should return false on array with no common API exposed", function () { + var value = []; + value.push = null; + assert.equal(isArray(value), false); + }); + it("Should return false on Array.prototype", function () { + assert.equal(isArray(Array.prototype), false); + }); + + it("Should return false on plain object", function () { assert.equal(isArray({}), false); }); + it("Should return false on function", function () { + assert.equal(isArray(function () { return true; }), false); + }); + + if (typeof Object.create === "function") { + it("Should return false on object with no prototype", function () { + assert.equal(isArray(Object.create(null)), false); + }); + } + it("Should return false on string", function () { assert.equal(isArray("foo"), false); }); + it("Should return false on empty string", function () { assert.equal(isArray(""), false); }); + it("Should return false on number", function () { assert.equal(isArray(123), false); }); + it("Should return false on NaN", function () { assert.equal(isArray(NaN), false); }); + it("Should return false on boolean", function () { assert.equal(isArray(true), false); }); + if (typeof Symbol === "function") { + it("Should return false on symbol", function () { + assert.equal(isArray(Symbol("foo")), false); + }); + } + + it("Should return false on null", function () { assert.equal(isArray(null), false); }); + it("Should return false on undefined", function () { assert.equal(isArray(void 0), false); }); +}); diff --git a/node_modules/ext/node_modules/type/test/date/ensure.js b/node_modules/ext/node_modules/type/test/date/ensure.js new file mode 100644 index 0000000..7fceffe --- /dev/null +++ b/node_modules/ext/node_modules/type/test/date/ensure.js @@ -0,0 +1,20 @@ +"use strict"; + +var assert = require("chai").assert + , ensureDate = require("../../date/ensure"); + +describe("date/ensure", function () { + it("Should return input value", function () { + var value = new Date(); + assert.equal(ensureDate(value), value); + }); + it("Should crash on invalid value", function () { + try { + ensureDate(null); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert(error.message.includes("is not a date object")); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/date/is.js b/node_modules/ext/node_modules/type/test/date/is.js new file mode 100644 index 0000000..fc57cbf --- /dev/null +++ b/node_modules/ext/node_modules/type/test/date/is.js @@ -0,0 +1,46 @@ +"use strict"; + +var assert = require("chai").assert + , isDate = require("../../date/is"); + +describe("date/is", function () { + it("Should return true on date", function () { assert.equal(isDate(new Date()), true); }); + it("Should return false on invalid date", function () { + assert.equal(isDate(new Date("foo")), false); + }); + + it("Should return false on native date with no common API exposed", function () { + var value = new Date(); + value.getFullYear = null; + assert.equal(isDate(value), false); + }); + it("Should return false on Date.prototype", function () { + assert.equal(isDate(Date.prototype), false); + }); + it("Should return false on time value", function () { assert.equal(isDate(12312313), false); }); + + it("Should return false on plain object", function () { assert.equal(isDate({}), false); }); + it("Should return false on function", function () { + assert.equal(isDate(function () { return true; }), false); + }); + + it("Should return false on array", function () { assert.equal(isDate([]), false); }); + if (typeof Object.create === "function") { + it("Should return false on object with no prototype", function () { + assert.equal(isDate(Object.create(null)), false); + }); + } + it("Should return false on string", function () { assert.equal(isDate("foo"), false); }); + it("Should return false on empty string", function () { assert.equal(isDate(""), false); }); + it("Should return false on number", function () { assert.equal(isDate(123), false); }); + it("Should return false on NaN", function () { assert.equal(isDate(NaN), false); }); + it("Should return false on boolean", function () { assert.equal(isDate(true), false); }); + if (typeof Symbol === "function") { + it("Should return false on symbol", function () { + assert.equal(isDate(Symbol("foo")), false); + }); + } + + it("Should return false on null", function () { assert.equal(isDate(null), false); }); + it("Should return false on undefined", function () { assert.equal(isDate(void 0), false); }); +}); diff --git a/node_modules/ext/node_modules/type/test/error/ensure.js b/node_modules/ext/node_modules/type/test/error/ensure.js new file mode 100644 index 0000000..c18bdee --- /dev/null +++ b/node_modules/ext/node_modules/type/test/error/ensure.js @@ -0,0 +1,20 @@ +"use strict"; + +var assert = require("chai").assert + , ensureError = require("../../error/ensure"); + +describe("error/ensure", function () { + it("Should return input value", function () { + var value = new Error(); + assert.equal(ensureError(value), value); + }); + it("Should crash on invalid value", function () { + try { + ensureError(null); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert(error.message.includes("is not an error object")); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/error/is.js b/node_modules/ext/node_modules/type/test/error/is.js new file mode 100644 index 0000000..12692b4 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/error/is.js @@ -0,0 +1,50 @@ +"use strict"; + +var assert = require("chai").assert + , isError = require("../../error/is"); + +describe("error/is", function () { + it("Should return true on error", function () { assert.equal(isError(new Error()), true); }); + + it("Should return false on native error with no common API exposed", function () { + var value = new Error(); + value.message = null; + assert.equal(isError(value), false); + }); + it("Should return false on Error.prototype", function () { + assert.equal(isError(Error.prototype), false); + }); + + if (typeof Object.create === "function") { + it("Should return true on custom built ES5 era error", function () { + var CustomEs5Error = function () { Error.call(this); }; + CustomEs5Error.prototype = Object.create(Error.prototype); + assert.equal(isError(new CustomEs5Error()), true); + }); + + it("Should return false on object with no prototype", function () { + assert.equal(isError(Object.create(null)), false); + }); + } + + it("Should return false on plain object", function () { assert.equal(isError({}), false); }); + it("Should return false on function", function () { + assert.equal(isError(function () { return true; }), false); + }); + + it("Should return false on array", function () { assert.equal(isError([]), false); }); + + it("Should return false on string", function () { assert.equal(isError("foo"), false); }); + it("Should return false on empty string", function () { assert.equal(isError(""), false); }); + it("Should return false on number", function () { assert.equal(isError(123), false); }); + it("Should return false on NaN", function () { assert.equal(isError(NaN), false); }); + it("Should return false on boolean", function () { assert.equal(isError(true), false); }); + if (typeof Symbol === "function") { + it("Should return false on symbol", function () { + assert.equal(isError(Symbol("foo")), false); + }); + } + + it("Should return false on null", function () { assert.equal(isError(null), false); }); + it("Should return false on undefined", function () { assert.equal(isError(void 0), false); }); +}); diff --git a/node_modules/ext/node_modules/type/test/finite/coerce.js b/node_modules/ext/node_modules/type/test/finite/coerce.js new file mode 100644 index 0000000..5d39837 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/finite/coerce.js @@ -0,0 +1,40 @@ +"use strict"; + +var assert = require("chai").assert + , coerceToFinite = require("../../finite/coerce"); + +describe("finite/coerce", function () { + it("Should return input number", function () { + assert.equal(coerceToFinite(123.123), 123.123); + }); + it("Should coerce string", function () { assert.equal(coerceToFinite("12"), 12); }); + it("Should coerce booleans", function () { assert.equal(coerceToFinite(true), 1); }); + it("Should coerce number objects", function () { + assert.equal(coerceToFinite(new Number(343)), 343); + }); + it("Should coerce objects", function () { + assert.equal(coerceToFinite({ valueOf: function () { return 23; } }), 23); + }); + + it("Should reject infinite number", function () { + assert.equal(coerceToFinite(Infinity), null); + }); + it("Should reject NaN", function () { assert.equal(coerceToFinite(NaN), null); }); + + if (typeof Object.create === "function") { + it("Should not coerce objects with no number representation", function () { + assert.equal(coerceToFinite(Object.create(null)), null); + }); + } + + it("Should not coerce null", function () { assert.equal(coerceToFinite(null), null); }); + it("Should not coerce undefined", function () { + assert.equal(coerceToFinite(undefined), null); + }); + + if (typeof Symbol === "function") { + it("Should not coerce symbols", function () { + assert.equal(coerceToFinite(Symbol("foo")), null); + }); + } +}); diff --git a/node_modules/ext/node_modules/type/test/finite/ensure.js b/node_modules/ext/node_modules/type/test/finite/ensure.js new file mode 100644 index 0000000..ed4246e --- /dev/null +++ b/node_modules/ext/node_modules/type/test/finite/ensure.js @@ -0,0 +1,17 @@ +"use strict"; + +var assert = require("chai").assert + , ensureFinite = require("../../finite/ensure"); + +describe("finite/ensure", function () { + it("Should return coerced value", function () { assert.equal(ensureFinite("12.23"), 12.23); }); + it("Should crash on no value", function () { + try { + ensureFinite(null); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message, "null is not a finite number"); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/function/ensure.js b/node_modules/ext/node_modules/type/test/function/ensure.js new file mode 100644 index 0000000..e101c06 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/function/ensure.js @@ -0,0 +1,20 @@ +"use strict"; + +var assert = require("chai").assert + , ensureFunction = require("../../function/ensure"); + +describe("function/ensure", function () { + it("Should return input value", function () { + var value = function () { return true; }; + assert.equal(ensureFunction(value), value); + }); + it("Should crash on invalid value", function () { + try { + ensureFunction(null); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert(error.message.includes("is not a function")); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/function/is.js b/node_modules/ext/node_modules/type/test/function/is.js new file mode 100644 index 0000000..6b561e5 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/function/is.js @@ -0,0 +1,46 @@ +"use strict"; + +var assert = require("chai").assert + , isFunction = require("../../function/is") + , arrowFunctionIfSupported = require("../_lib/arrow-function-if-supported") + , classIfSupported = require("../_lib/class-if-supported"); + +describe("function/is", function () { + it("Should return true on function", function () { + assert.equal(isFunction(function () { return true; }), true); + }); + if (arrowFunctionIfSupported) { + it("Should return true on arrow function", function () { + assert.equal(isFunction(arrowFunctionIfSupported), true); + }); + } + if (classIfSupported) { + it("Should return true on class", function () { + assert.equal(isFunction(classIfSupported), true); + }); + } + it("Should return false on reg-exp", function () { assert.equal(isFunction(/foo/), false); }); + + it("Should return false on plain object", function () { assert.equal(isFunction({}), false); }); + it("Should return false on array", function () { assert.equal(isFunction([]), false); }); + if (typeof Object.create === "function") { + it("Should return false on object with no prototype", function () { + assert.equal(isFunction(Object.create(null)), false); + }); + } + it("Should return false on string", function () { assert.equal(isFunction("foo"), false); }); + it("Should return false on empty string", function () { assert.equal(isFunction(""), false); }); + it("Should return false on number", function () { assert.equal(isFunction(123), false); }); + it("Should return false on NaN", function () { assert.equal(isFunction(NaN), false); }); + it("Should return false on boolean", function () { assert.equal(isFunction(true), false); }); + if (typeof Symbol === "function") { + it("Should return false on symbol", function () { + assert.equal(isFunction(Symbol("foo")), false); + }); + } + + it("Should return false on null", function () { assert.equal(isFunction(null), false); }); + it("Should return false on undefined", function () { + assert.equal(isFunction(void 0), false); + }); +}); diff --git a/node_modules/ext/node_modules/type/test/integer/coerce.js b/node_modules/ext/node_modules/type/test/integer/coerce.js new file mode 100644 index 0000000..7471ea3 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/integer/coerce.js @@ -0,0 +1,49 @@ +"use strict"; + +var assert = require("chai").assert + , coerceToInteger = require("../../integer/coerce"); + +describe("integer/coerce", function () { + it("Should coerce float to integer", function () { + assert.equal(coerceToInteger(123.123), 123); + assert.equal(coerceToInteger(123.823), 123); + assert.equal(coerceToInteger(-123.123), -123); + assert.equal(coerceToInteger(-123.823), -123); + }); + it("Should coerce string", function () { assert.equal(coerceToInteger("12.123"), 12); }); + it("Should coerce booleans", function () { assert.equal(coerceToInteger(true), 1); }); + it("Should coerce number objects", function () { + assert.equal(coerceToInteger(new Number(343)), 343); + }); + it("Should coerce objects", function () { + assert.equal(coerceToInteger({ valueOf: function () { return 23; } }), 23); + }); + it("Should coerce number beyond Number.MAX_SAFE_INTEGER", function () { + assert.equal(coerceToInteger(9007199254740992), 9007199254740992); + }); + it("Should coerce number beyond Number.MIN_SAFE_INTEGER", function () { + assert.equal(coerceToInteger(-9007199254740992), -9007199254740992); + }); + + it("Should reject infinite number", function () { + assert.equal(coerceToInteger(Infinity), null); + }); + it("Should reject NaN", function () { assert.equal(coerceToInteger(NaN), null); }); + + if (typeof Object.create === "function") { + it("Should not coerce objects with no number representation", function () { + assert.equal(coerceToInteger(Object.create(null)), null); + }); + } + + it("Should not coerce null", function () { assert.equal(coerceToInteger(null), null); }); + it("Should not coerce undefined", function () { + assert.equal(coerceToInteger(undefined), null); + }); + + if (typeof Symbol === "function") { + it("Should not coerce symbols", function () { + assert.equal(coerceToInteger(Symbol("foo")), null); + }); + } +}); diff --git a/node_modules/ext/node_modules/type/test/integer/ensure.js b/node_modules/ext/node_modules/type/test/integer/ensure.js new file mode 100644 index 0000000..8b76a97 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/integer/ensure.js @@ -0,0 +1,17 @@ +"use strict"; + +var assert = require("chai").assert + , ensureInteger = require("../../integer/ensure"); + +describe("integer/ensure", function () { + it("Should return coerced value", function () { assert.equal(ensureInteger("12.23"), 12); }); + it("Should crash on no value", function () { + try { + ensureInteger(null); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message, "null is not an integer"); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/iterable/ensure.js b/node_modules/ext/node_modules/type/test/iterable/ensure.js new file mode 100644 index 0000000..d5ce74c --- /dev/null +++ b/node_modules/ext/node_modules/type/test/iterable/ensure.js @@ -0,0 +1,42 @@ +"use strict"; + +var assert = require("chai").assert + , ensureString = require("../../string/ensure") + , isArray = require("../../array/is") + , ensureIterable = require("../../iterable/ensure"); + +describe("iterable/ensure", function () { + it("Should return input value", function () { + var value = []; + assert.equal(ensureIterable(value), value); + }); + it("Should allow strings with allowString option", function () { + var value = "foo"; + assert.equal(ensureIterable(value, { allowString: true }), value); + }); + it("Should crash on invalid value", function () { + try { + ensureIterable("foo"); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert(error.message.includes("is not expected iterable value")); + } + }); + describe("Should support 'ensureItem' option", function () { + it("Should resolve coerced array", function () { + var coercedValue = ensureIterable(new Set(["foo", 12]), { ensureItem: ensureString }); + assert(isArray(coercedValue)); + assert.deepEqual(coercedValue, ["foo", "12"]); + }); + it("Should crash if some item is invalid", function () { + try { + ensureIterable(["foo", {}], { ensureItem: ensureString }); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert(error.message.includes("is not expected iterable value")); + } + }); + }); +}); diff --git a/node_modules/ext/node_modules/type/test/iterable/is.js b/node_modules/ext/node_modules/type/test/iterable/is.js new file mode 100644 index 0000000..9a27fb1 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/iterable/is.js @@ -0,0 +1,57 @@ +"use strict"; + +var assert = require("chai").assert + , isIterable = require("../../iterable/is"); + +describe("iterable/is", function () { + it("Should return true on array", function () { assert.equal(isIterable([]), true); }); + it("Should return true on arguments", function () { + assert.equal(isIterable((function () { return arguments; })()), true); + }); + it("Should by default return false on string", function () { + assert.equal(isIterable("foo"), false); + }); + it("Should accept strings if specified", function () { + assert.equal(isIterable("foo", { allowString: true }), true); + }); + + it("Should support denyEmpty option", function () { + assert.equal(isIterable([], { denyEmpty: true }), false); + assert.equal(isIterable([null], { denyEmpty: true }), true); + assert.equal(isIterable("", { allowString: true, denyEmpty: true }), false); + assert.equal(isIterable("foo", { allowString: true, denyEmpty: true }), true); + }); + + if (typeof Set === "function") { + it("Should return true on set", function () { assert.equal(isIterable(new Set()), true); }); + } + if (typeof Map === "function") { + it("Should return true on set", function () { assert.equal(isIterable(new Map()), true); }); + } + + it("Should return false on plain object", function () { assert.equal(isIterable({}), false); }); + it("Should return false on function", function () { + assert.equal(isIterable(function () { return true; }), false); + }); + + if (typeof Object.create === "function") { + it("Should return false on object with no prototype", function () { + assert.equal(isIterable(Object.create(null)), false); + }); + } + it("Should return false on string", function () { assert.equal(isIterable("foo"), false); }); + it("Should return false on empty string", function () { assert.equal(isIterable(""), false); }); + it("Should return false on number", function () { assert.equal(isIterable(123), false); }); + it("Should return false on NaN", function () { assert.equal(isIterable(NaN), false); }); + it("Should return false on boolean", function () { assert.equal(isIterable(true), false); }); + if (typeof Symbol === "function") { + it("Should return false on symbol", function () { + assert.equal(isIterable(Symbol("foo")), false); + }); + } + + it("Should return false on null", function () { assert.equal(isIterable(null), false); }); + it("Should return false on undefined", function () { + assert.equal(isIterable(void 0), false); + }); +}); diff --git a/node_modules/ext/node_modules/type/test/lib/is-to-string-tag-supported.js b/node_modules/ext/node_modules/type/test/lib/is-to-string-tag-supported.js new file mode 100644 index 0000000..773c872 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/lib/is-to-string-tag-supported.js @@ -0,0 +1,10 @@ +"use strict"; + +var assert = require("chai").assert + , isToStringTagSupported = require("../../lib/is-to-string-tag-supported"); + +describe("lib/is-to-string-tag-supported", function () { + it("Should return boolean", function () { + assert(typeof isToStringTagSupported === "boolean"); + }); +}); diff --git a/node_modules/ext/node_modules/type/test/lib/resolve-error-message.js b/node_modules/ext/node_modules/type/test/lib/resolve-error-message.js new file mode 100644 index 0000000..54ae361 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/lib/resolve-error-message.js @@ -0,0 +1,16 @@ +"use strict"; + +var assert = require("chai").assert + , resolveErrorMessage = require("../../lib/resolve-error-message"); + +describe("lib/resolve-error-message", function () { + it("Should insert value", function () { + assert.equal(resolveErrorMessage("%v is invalid", 12), "12 is invalid"); + }); + it("Should support custome error message via inputOptions.errorMessage", function () { + assert.equal( + resolveErrorMessage("%v is invalid", null, { errorMessage: "%v is not supported age" }), + "null is not supported age" + ); + }); +}); diff --git a/node_modules/ext/node_modules/type/test/lib/resolve-exception.js b/node_modules/ext/node_modules/type/test/lib/resolve-exception.js new file mode 100644 index 0000000..2990efc --- /dev/null +++ b/node_modules/ext/node_modules/type/test/lib/resolve-exception.js @@ -0,0 +1,31 @@ +"use strict"; + +var assert = require("chai").assert + , handleException = require("../../lib/resolve-exception"); + +describe("lib/handle-exception", function () { + it("Should throw TypeError", function () { + try { + handleException(12, "Invalid value"); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message, "Invalid value"); + } + }); + it("Should resolve value in default message", function () { + try { + handleException(12, "%v is invalid", {}); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.message, "12 is invalid"); + } + }); + it("Should support optional values via inputOptions.isOptional", function () { + assert.equal(handleException(null, "%v is invalid", { isOptional: true }, null)); + }); + it("Should support optional values via inputOptions.default", function () { + // prettier-ignore + assert.equal(handleException(null, "%v is invalid", { "default": "bar" }), "bar"); + }); +}); diff --git a/node_modules/ext/node_modules/type/test/lib/safe-to-string.js b/node_modules/ext/node_modules/type/test/lib/safe-to-string.js new file mode 100644 index 0000000..a427f9f --- /dev/null +++ b/node_modules/ext/node_modules/type/test/lib/safe-to-string.js @@ -0,0 +1,32 @@ +"use strict"; + +var assert = require("chai").assert + , safeToString = require("../../lib/safe-to-string"); + +describe("lib/safe-to-string", function () { + it("Should return input string", function () { assert.equal(safeToString("foo"), "foo"); }); + it("Should coerce numbers", function () { assert.equal(safeToString(12), "12"); }); + it("Should coerce booleans", function () { assert.equal(safeToString(true), "true"); }); + it("Should coerce string objects", function () { + assert.equal(safeToString(new String("bar")), "bar"); + }); + it("Should coerce objects", function () { + assert.equal( + safeToString({ toString: function () { return "Some object"; } }), "Some object" + ); + }); + it("Should coerce null", function () { assert.equal(safeToString(null), "null"); }); + it("Should coerce undefined", function () { + assert.equal(safeToString(undefined), "undefined"); + }); + + if (typeof Symbol === "function") { + it("Should coerce symbols", function () { + // eslint-disable-next-line no-undef + assert.equal(safeToString(Symbol()), "Symbol()"); + }); + } + it("Should return null for non coercible values", function () { + assert.equal(safeToString({ toString: null }), null); + }); +}); diff --git a/node_modules/ext/node_modules/type/test/lib/to-short-string.js b/node_modules/ext/node_modules/type/test/lib/to-short-string.js new file mode 100644 index 0000000..b9a4774 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/lib/to-short-string.js @@ -0,0 +1,41 @@ +"use strict"; + +var assert = require("chai").assert + , toShortString = require("../../lib/to-short-string"); + +describe("lib/to-short-string", function () { + it("Should return input string", function () { assert.equal(toShortString("foo"), "foo"); }); + it("Should coerce numbers", function () { assert.equal(toShortString(12), "12"); }); + it("Should coerce booleans", function () { assert.equal(toShortString(true), "true"); }); + it("Should coerce string objects", function () { + assert.equal(toShortString(new String("bar")), "bar"); + }); + it("Should coerce objects", function () { + assert.equal( + toShortString({ toString: function () { return "Some object"; } }), "Some object" + ); + }); + it("Should coerce null", function () { assert.equal(toShortString(null), "null"); }); + it("Should coerce undefined", function () { + assert.equal(toShortString(undefined), "undefined"); + }); + + if (typeof Symbol === "function") { + it("Should coerce symbols", function () { + // eslint-disable-next-line no-undef + assert.equal(toShortString(Symbol()), "Symbol()"); + }); + } + it("Should return replacement non coercible values", function () { + assert.equal(toShortString({ toString: null }), ""); + }); + + it("Should replace new line characters", function () { + assert.equal(toShortString("foo\n\r\u2028\u2029bar"), "foo\\n\\r\\u2028\\u2029bar"); + }); + it("Should truncate long string", function () { + var str = Math.random().toString(36); + while (str.length < 200) str += str; + assert.equal(toShortString(str).length, 100); + }); +}); diff --git a/node_modules/ext/node_modules/type/test/natural-number/coerce.js b/node_modules/ext/node_modules/type/test/natural-number/coerce.js new file mode 100644 index 0000000..853ce74 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/natural-number/coerce.js @@ -0,0 +1,47 @@ +"use strict"; + +var assert = require("chai").assert + , coerceToNaturalNumber = require("../../natural-number/coerce"); + +describe("natural-number/coerce", function () { + it("Should coerce float to integer", function () { + assert.equal(coerceToNaturalNumber(123.123), 123); + assert.equal(coerceToNaturalNumber(123.823), 123); + }); + it("Should coerce string", function () { assert.equal(coerceToNaturalNumber("12.123"), 12); }); + it("Should coerce booleans", function () { assert.equal(coerceToNaturalNumber(true), 1); }); + it("Should coerce number objects", function () { + assert.equal(coerceToNaturalNumber(new Number(343)), 343); + }); + it("Should coerce objects", function () { + assert.equal(coerceToNaturalNumber({ valueOf: function () { return 23; } }), 23); + }); + it("Should coerce number beyond Number.MAX_SAFE_INTEGER", function () { + assert.equal(coerceToNaturalNumber(9007199254740992), 9007199254740992); + }); + + it("Should reject negative number", function () { + assert.equal(coerceToNaturalNumber(-1), null); + }); + it("Should reject infinite number", function () { + assert.equal(coerceToNaturalNumber(Infinity), null); + }); + it("Should reject NaN", function () { assert.equal(coerceToNaturalNumber(NaN), null); }); + + if (typeof Object.create === "function") { + it("Should not coerce objects with no number representation", function () { + assert.equal(coerceToNaturalNumber(Object.create(null)), null); + }); + } + + it("Should not coerce null", function () { assert.equal(coerceToNaturalNumber(null), null); }); + it("Should not coerce undefined", function () { + assert.equal(coerceToNaturalNumber(undefined), null); + }); + + if (typeof Symbol === "function") { + it("Should not coerce symbols", function () { + assert.equal(coerceToNaturalNumber(Symbol("foo")), null); + }); + } +}); diff --git a/node_modules/ext/node_modules/type/test/natural-number/ensure.js b/node_modules/ext/node_modules/type/test/natural-number/ensure.js new file mode 100644 index 0000000..819c7e7 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/natural-number/ensure.js @@ -0,0 +1,19 @@ +"use strict"; + +var assert = require("chai").assert + , ensureNaturalNumber = require("../../natural-number/ensure"); + +describe("natural-number/ensure", function () { + it("Should return coerced value", function () { + assert.equal(ensureNaturalNumber("12.23"), 12); + }); + it("Should crash on no value", function () { + try { + ensureNaturalNumber(-20); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message, "-20 is not a natural number"); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/number/coerce.js b/node_modules/ext/node_modules/type/test/number/coerce.js new file mode 100644 index 0000000..d07d6f4 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/number/coerce.js @@ -0,0 +1,40 @@ +"use strict"; + +var assert = require("chai").assert + , coerceToNumber = require("../../number/coerce"); + +describe("number/coerce", function () { + it("Should return input number", function () { + assert.equal(coerceToNumber(123.123), 123.123); + }); + it("Should return input infinite number", function () { + assert.equal(coerceToNumber(Infinity), Infinity); + }); + it("Should coerce string", function () { assert.equal(coerceToNumber("12"), 12); }); + it("Should coerce booleans", function () { assert.equal(coerceToNumber(true), 1); }); + it("Should coerce number objects", function () { + assert.equal(coerceToNumber(new Number(343)), 343); + }); + it("Should coerce objects", function () { + assert.equal(coerceToNumber({ valueOf: function () { return 23; } }), 23); + }); + + it("Should reject NaN", function () { assert.equal(coerceToNumber(NaN), null); }); + + if (typeof Object.create === "function") { + it("Should not coerce objects with no number representation", function () { + assert.equal(coerceToNumber(Object.create(null)), null); + }); + } + + it("Should not coerce null", function () { assert.equal(coerceToNumber(null), null); }); + it("Should not coerce undefined", function () { + assert.equal(coerceToNumber(undefined), null); + }); + + if (typeof Symbol === "function") { + it("Should not coerce symbols", function () { + assert.equal(coerceToNumber(Symbol("foo")), null); + }); + } +}); diff --git a/node_modules/ext/node_modules/type/test/number/ensure.js b/node_modules/ext/node_modules/type/test/number/ensure.js new file mode 100644 index 0000000..a6ddf3b --- /dev/null +++ b/node_modules/ext/node_modules/type/test/number/ensure.js @@ -0,0 +1,17 @@ +"use strict"; + +var assert = require("chai").assert + , ensureNumber = require("../../number/ensure"); + +describe("number/ensure", function () { + it("Should return coerced value", function () { assert.equal(ensureNumber("12.23"), 12.23); }); + it("Should crash on no value", function () { + try { + ensureNumber(null); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message, "null is not a number"); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/object/ensure.js b/node_modules/ext/node_modules/type/test/object/ensure.js new file mode 100644 index 0000000..01d4b0f --- /dev/null +++ b/node_modules/ext/node_modules/type/test/object/ensure.js @@ -0,0 +1,20 @@ +"use strict"; + +var assert = require("chai").assert + , ensureObject = require("../../object/ensure"); + +describe("object/ensure", function () { + it("Should return input value", function () { + var value = {}; + assert.equal(ensureObject(value), value); + }); + it("Should crash on no value", function () { + try { + ensureObject(null); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message, "null is not an object"); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/object/is.js b/node_modules/ext/node_modules/type/test/object/is.js new file mode 100644 index 0000000..f95d9a2 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/object/is.js @@ -0,0 +1,30 @@ +"use strict"; + +var assert = require("chai").assert + , isObject = require("../../object/is"); + +describe("object/is", function () { + it("Should return true on object", function () { assert.equal(isObject({}), true); }); + it("Should return true on function", function () { + assert.equal(isObject(function () { return true; }), true); + }); + it("Should return true on array", function () { assert.equal(isObject([]), true); }); + if (typeof Object.create === "function") { + it("Should return true on object with no prototype", function () { + assert.equal(isObject(Object.create(null)), true); + }); + } + it("Should return false on string", function () { assert.equal(isObject("foo"), false); }); + it("Should return false on empty string", function () { assert.equal(isObject(""), false); }); + it("Should return false on number", function () { assert.equal(isObject(123), false); }); + it("Should return false on NaN", function () { assert.equal(isObject(NaN), false); }); + it("Should return false on boolean", function () { assert.equal(isObject(true), false); }); + if (typeof Symbol === "function") { + it("Should return false on symbol", function () { + assert.equal(isObject(Symbol("foo")), false); + }); + } + + it("Should return false on null", function () { assert.equal(isObject(null), false); }); + it("Should return false on undefined", function () { assert.equal(isObject(void 0), false); }); +}); diff --git a/node_modules/ext/node_modules/type/test/plain-function/ensure.js b/node_modules/ext/node_modules/type/test/plain-function/ensure.js new file mode 100644 index 0000000..61aceb4 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/plain-function/ensure.js @@ -0,0 +1,20 @@ +"use strict"; + +var assert = require("chai").assert + , ensurePlainFunction = require("../../plain-function/ensure"); + +describe("plain-function/ensure", function () { + it("Should return input value", function () { + var value = function () { return true; }; + assert.equal(ensurePlainFunction(value), value); + }); + it("Should crash on invalid value", function () { + try { + ensurePlainFunction(null); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert(error.message.includes("is not a plain function")); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/plain-function/is.js b/node_modules/ext/node_modules/type/test/plain-function/is.js new file mode 100644 index 0000000..a2a7c59 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/plain-function/is.js @@ -0,0 +1,56 @@ +"use strict"; + +var assert = require("chai").assert + , isPlainFunction = require("../../plain-function/is") + , arrowFunctionIfSupported = require("../_lib/arrow-function-if-supported") + , classIfSupported = require("../_lib/class-if-supported"); + +describe("plain-function/is", function () { + it("Should return true on function", function () { + assert.equal(isPlainFunction(function () { return true; }), true); + }); + if (arrowFunctionIfSupported) { + it("Should return true on arrow function", function () { + assert.equal(isPlainFunction(arrowFunctionIfSupported), true); + }); + } + if (classIfSupported) { + it("Should return false on class", function () { + assert.equal(isPlainFunction(classIfSupported), false); + }); + } + it("Should return false on reg-exp", function () { + assert.equal(isPlainFunction(/foo/), false); + }); + + it("Should return false on plain object", function () { + assert.equal(isPlainFunction({}), false); + }); + it("Should return false on array", function () { assert.equal(isPlainFunction([]), false); }); + if (typeof Object.create === "function") { + it("Should return false on object with no prototype", function () { + assert.equal(isPlainFunction(Object.create(null)), false); + }); + } + it("Should return false on string", function () { + assert.equal(isPlainFunction("foo"), false); + }); + it("Should return false on empty string", function () { + assert.equal(isPlainFunction(""), false); + }); + it("Should return false on number", function () { assert.equal(isPlainFunction(123), false); }); + it("Should return false on NaN", function () { assert.equal(isPlainFunction(NaN), false); }); + it("Should return false on boolean", function () { + assert.equal(isPlainFunction(true), false); + }); + if (typeof Symbol === "function") { + it("Should return false on symbol", function () { + assert.equal(isPlainFunction(Symbol("foo")), false); + }); + } + + it("Should return false on null", function () { assert.equal(isPlainFunction(null), false); }); + it("Should return false on undefined", function () { + assert.equal(isPlainFunction(void 0), false); + }); +}); diff --git a/node_modules/ext/node_modules/type/test/plain-object/ensure.js b/node_modules/ext/node_modules/type/test/plain-object/ensure.js new file mode 100644 index 0000000..0f7f268 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/plain-object/ensure.js @@ -0,0 +1,46 @@ +"use strict"; + +var assert = require("chai").assert + , ensureString = require("../../string/ensure") + , ensurePlainObject = require("../../plain-object/ensure"); + +describe("plain-object/ensure", function () { + it("Should return input value", function () { + var value = {}; + assert.equal(ensurePlainObject(value), value); + }); + it("Should crash on invalid value", function () { + try { + ensurePlainObject(null); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message, "null is not a valid plain object"); + } + }); + it("Should support allowedKeys option", function () { + var value = { foo: "bar", marko: "elo" }; + assert.equal(ensurePlainObject(value, { allowedKeys: ["foo", "marko"] }), value); + try { + ensurePlainObject(value, { allowedKeys: ["marko"] }); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message.indexOf("is not a valid plain object") !== -1, true); + } + }); + + it("Should support ensurePropertyValue option", function () { + assert.deepEqual( + ensurePlainObject({ foo: "bar", marko: 12 }, { ensurePropertyValue: ensureString }), + { foo: "bar", marko: "12" } + ); + try { + ensurePlainObject({ foo: "bar", marko: {} }, { ensurePropertyValue: ensureString }); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message.indexOf("is not a valid plain object") !== -1, true); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/plain-object/is.js b/node_modules/ext/node_modules/type/test/plain-object/is.js new file mode 100644 index 0000000..5695e3f --- /dev/null +++ b/node_modules/ext/node_modules/type/test/plain-object/is.js @@ -0,0 +1,47 @@ +"use strict"; + +var assert = require("chai").assert + , isPlainObject = require("../../plain-object/is"); + +describe("plain-object/is", function () { + it("Should return true on plain object", function () { + assert.equal(isPlainObject({}), true); + }); + if (typeof Object.create === "function") { + it("Should return true on object with no prototype", function () { + assert.equal(isPlainObject(Object.create(null)), true); + }); + it( + "Should return false on object that inherits from object with no prototype", + function () { assert.equal(isPlainObject(Object.create(Object.create(null))), false); } + ); + } + it("Should return false on Object.prototype", function () { + assert.equal(isPlainObject(Object.prototype), false); + }); + it("Should return false on prototype that derives from Object.prototype", function () { + assert.equal(isPlainObject(RegExp.prototype), false); + }); + + it("Should return false on function", function () { + assert.equal(isPlainObject(function () { return true; }), false); + }); + + it("Should return false on string", function () { assert.equal(isPlainObject("foo"), false); }); + it("Should return false on empty string", function () { + assert.equal(isPlainObject(""), false); + }); + it("Should return false on number", function () { assert.equal(isPlainObject(123), false); }); + it("Should return false on NaN", function () { assert.equal(isPlainObject(NaN), false); }); + it("Should return false on boolean", function () { assert.equal(isPlainObject(true), false); }); + if (typeof Symbol === "function") { + it("Should return false on symbol", function () { + assert.equal(isPlainObject(Symbol("foo")), false); + }); + } + + it("Should return false on null", function () { assert.equal(isPlainObject(null), false); }); + it("Should return false on undefined", function () { + assert.equal(isPlainObject(void 0), false); + }); +}); diff --git a/node_modules/ext/node_modules/type/test/promise/ensure.js b/node_modules/ext/node_modules/type/test/promise/ensure.js new file mode 100644 index 0000000..d2d1302 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/promise/ensure.js @@ -0,0 +1,20 @@ +"use strict"; + +var assert = require("chai").assert + , ensurePromise = require("../../promise/ensure"); + +describe("promise/ensure", function () { + it("Should return input value", function () { + var value = Promise.resolve(); + assert.equal(ensurePromise(value), value); + }); + it("Should crash on no value", function () { + try { + ensurePromise({}); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message, "[object Object] is not a promise"); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/promise/is.js b/node_modules/ext/node_modules/type/test/promise/is.js new file mode 100644 index 0000000..496e3f3 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/promise/is.js @@ -0,0 +1,39 @@ +"use strict"; + +var assert = require("chai").assert + , isPromise = require("../../promise/is"); + +describe("promise/is", function () { + if (typeof Promise === "function") { + it("Should return true on promise", function () { + assert.equal(isPromise(Promise.resolve()), true); + }); + } + it("Should return false on non-promise thenable", function () { + assert.equal(isPromise({ then: function () { return true; } }), false); + }); + + it("Should return false on plain object", function () { assert.equal(isPromise({}), false); }); + it("Should return false on function", function () { + assert.equal(isPromise(function () { return true; }), false); + }); + it("Should return false on array", function () { assert.equal(isPromise([]), false); }); + if (typeof Object.create === "function") { + it("Should return false on object with no prototype", function () { + assert.equal(isPromise(Object.create(null)), false); + }); + } + it("Should return false on string", function () { assert.equal(isPromise("foo"), false); }); + it("Should return false on empty string", function () { assert.equal(isPromise(""), false); }); + it("Should return false on number", function () { assert.equal(isPromise(123), false); }); + it("Should return false on NaN", function () { assert.equal(isPromise(NaN), false); }); + it("Should return false on boolean", function () { assert.equal(isPromise(true), false); }); + if (typeof Symbol === "function") { + it("Should return false on symbol", function () { + assert.equal(isPromise(Symbol("foo")), false); + }); + } + + it("Should return false on null", function () { assert.equal(isPromise(null), false); }); + it("Should return false on undefined", function () { assert.equal(isPromise(void 0), false); }); +}); diff --git a/node_modules/ext/node_modules/type/test/prototype/is.js b/node_modules/ext/node_modules/type/test/prototype/is.js new file mode 100644 index 0000000..6f75451 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/prototype/is.js @@ -0,0 +1,39 @@ +"use strict"; + +var assert = require("chai").assert + , isPrototype = require("../../prototype/is"); + +describe("prototype/is", function () { + it("Should return true on prototype", function () { + assert.equal(isPrototype(Object.prototype), true); + }); + it("Should return false on plain object", function () { + assert.equal(isPrototype({}), false); + }); + it("Should return false on function", function () { + assert.equal(isPrototype(function () { return true; }), false); + }); + it("Should return false on array", function () { assert.equal(isPrototype([]), false); }); + if (typeof Object.create === "function") { + it("Should return false on object with no prototype", function () { + assert.equal(isPrototype(Object.create(null)), false); + }); + } + it("Should return false on string", function () { assert.equal(isPrototype("foo"), false); }); + it("Should return false on empty string", function () { + assert.equal(isPrototype(""), false); + }); + it("Should return false on number", function () { assert.equal(isPrototype(123), false); }); + it("Should return false on NaN", function () { assert.equal(isPrototype(NaN), false); }); + it("Should return false on boolean", function () { assert.equal(isPrototype(true), false); }); + if (typeof Symbol === "function") { + it("Should return false on symbol", function () { + assert.equal(isPrototype(Symbol("foo")), false); + }); + } + + it("Should return false on null", function () { assert.equal(isPrototype(null), false); }); + it("Should return false on undefined", function () { + assert.equal(isPrototype(void 0), false); + }); +}); diff --git a/node_modules/ext/node_modules/type/test/reg-exp/ensure.js b/node_modules/ext/node_modules/type/test/reg-exp/ensure.js new file mode 100644 index 0000000..476d992 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/reg-exp/ensure.js @@ -0,0 +1,20 @@ +"use strict"; + +var assert = require("chai").assert + , ensureRegExp = require("../../reg-exp/ensure"); + +describe("reg-exp/ensure", function () { + it("Should return input value", function () { + var value = /foo/; + assert.equal(ensureRegExp(value), value); + }); + it("Should crash on invalid value", function () { + try { + ensureRegExp(null); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert(error.message.includes("is not a regular expression object")); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/reg-exp/is.js b/node_modules/ext/node_modules/type/test/reg-exp/is.js new file mode 100644 index 0000000..dbe65ce --- /dev/null +++ b/node_modules/ext/node_modules/type/test/reg-exp/is.js @@ -0,0 +1,47 @@ +"use strict"; + +var assert = require("chai").assert + , isRegExp = require("../../reg-exp/is"); + +describe("reg-exp/is", function () { + it("Should return true on regular expression", function () { + assert.equal(isRegExp(/foo/), true); + }); + + it("Should return false on native regular expression with no common API exposed", function () { + var re = /foo/; + re.test = null; + assert.equal(isRegExp(re), false); + }); + it("Should return false on RegExp.prototype", function () { + assert.equal(isRegExp(RegExp.prototype), false); + }); + it("Should return false on regexp like string", function () { + assert.equal(isRegExp("/foo/"), false); + }); + + it("Should return false on plain object", function () { assert.equal(isRegExp({}), false); }); + it("Should return false on function", function () { + assert.equal(isRegExp(function () { return true; }), false); + }); + + it("Should return false on array", function () { assert.equal(isRegExp([]), false); }); + if (typeof Object.create === "function") { + it("Should return false on object with no prototype", function () { + assert.equal(isRegExp(Object.create(null)), false); + }); + } + it("Should return false on string", function () { assert.equal(isRegExp("foo"), false); }); + it("Should return false on empty string", function () { assert.equal(isRegExp(""), false); }); + it("Should return false on number", function () { assert.equal(isRegExp(123), false); }); + it("Should return false on NaN", function () { assert.equal(isRegExp(NaN), false); }); + it("Should return false on boolean", function () { assert.equal(isRegExp(true), false); }); + if (typeof Symbol === "function") { + it("Should return false on symbol", function () { + assert.equal(isRegExp(Symbol("foo")), false); + }); + } + + it("Should return false on null", function () { assert.equal(isRegExp(null), false); }); + it("Should return false on undefined", function () { assert.equal(isRegExp(void 0), false); }); +}); diff --git a/node_modules/ext/node_modules/type/test/safe-integer/coerce.js b/node_modules/ext/node_modules/type/test/safe-integer/coerce.js new file mode 100644 index 0000000..4ba9086 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/safe-integer/coerce.js @@ -0,0 +1,49 @@ +"use strict"; + +var assert = require("chai").assert + , coerceToSafeInteger = require("../../safe-integer/coerce"); + +describe("safe-integer/coerce", function () { + it("Should coerce float to integer", function () { + assert.equal(coerceToSafeInteger(123.123), 123); + assert.equal(coerceToSafeInteger(123.823), 123); + assert.equal(coerceToSafeInteger(-123.123), -123); + assert.equal(coerceToSafeInteger(-123.823), -123); + }); + it("Should coerce string", function () { assert.equal(coerceToSafeInteger("12.123"), 12); }); + it("Should coerce booleans", function () { assert.equal(coerceToSafeInteger(true), 1); }); + it("Should coerce number objects", function () { + assert.equal(coerceToSafeInteger(new Number(343)), 343); + }); + it("Should coerce objects", function () { + assert.equal(coerceToSafeInteger({ valueOf: function () { return 23; } }), 23); + }); + it("Should reject infinite number", function () { + assert.equal(coerceToSafeInteger(Infinity), null); + }); + it("Should reject number beyond Number.MAX_SAFE_INTEGER", function () { + assert.equal(coerceToSafeInteger(9007199254740992), null); + }); + it("Should reject number beyond Number.MIN_SAFE_INTEGER", function () { + assert.equal(coerceToSafeInteger(-9007199254740992), null); + }); + + it("Should reject NaN", function () { assert.equal(coerceToSafeInteger(NaN), null); }); + + if (typeof Object.create === "function") { + it("Should not coerce objects with no number representation", function () { + assert.equal(coerceToSafeInteger(Object.create(null)), null); + }); + } + + it("Should not coerce null", function () { assert.equal(coerceToSafeInteger(null), null); }); + it("Should not coerce undefined", function () { + assert.equal(coerceToSafeInteger(undefined), null); + }); + + if (typeof Symbol === "function") { + it("Should not coerce symbols", function () { + assert.equal(coerceToSafeInteger(Symbol("foo")), null); + }); + } +}); diff --git a/node_modules/ext/node_modules/type/test/safe-integer/ensure.js b/node_modules/ext/node_modules/type/test/safe-integer/ensure.js new file mode 100644 index 0000000..d8d4ba0 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/safe-integer/ensure.js @@ -0,0 +1,19 @@ +"use strict"; + +var assert = require("chai").assert + , ensureSafeInteger = require("../../safe-integer/ensure"); + +describe("safe-integer/ensure", function () { + it("Should return coerced value", function () { + assert.equal(ensureSafeInteger("12.23"), 12); + }); + it("Should crash on no value", function () { + try { + ensureSafeInteger(null); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message, "null is not a safe integer"); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/string/coerce.js b/node_modules/ext/node_modules/type/test/string/coerce.js new file mode 100644 index 0000000..08091a2 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/string/coerce.js @@ -0,0 +1,36 @@ +"use strict"; + +var assert = require("chai").assert + , coerceToString = require("../../string/coerce"); + +describe("string/coerce", function () { + it("Should return input string", function () { assert.equal(coerceToString("foo"), "foo"); }); + it("Should coerce numbers", function () { assert.equal(coerceToString(12), "12"); }); + it("Should coerce booleans", function () { assert.equal(coerceToString(true), "true"); }); + it("Should coerce string objects", function () { + assert.equal(coerceToString(new String("bar")), "bar"); + }); + it("Should coerce objects", function () { + assert.equal( + coerceToString({ toString: function () { return "Some object"; } }), "Some object" + ); + }); + if (typeof Object.create === "function") { + it("Should not coerce objects with no toString", function () { + assert.equal(coerceToString(Object.create(null)), null); + }); + } + it("Should not coerce objects with no custom toString", function () { + assert.equal(coerceToString({}), null); + }); + it("Should not coerce null", function () { assert.equal(coerceToString(null), null); }); + it("Should not coerce undefined", function () { + assert.equal(coerceToString(undefined), null); + }); + + if (typeof Symbol === "function") { + it("Should not coerce symbols", function () { + assert.equal(coerceToString(Symbol("foo")), null); + }); + } +}); diff --git a/node_modules/ext/node_modules/type/test/string/ensure.js b/node_modules/ext/node_modules/type/test/string/ensure.js new file mode 100644 index 0000000..ffbc363 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/string/ensure.js @@ -0,0 +1,17 @@ +"use strict"; + +var assert = require("chai").assert + , ensureString = require("../../string/ensure"); + +describe("string/ensure", function () { + it("Should return coerced value", function () { assert.equal(ensureString(12), "12"); }); + it("Should crash on no value", function () { + try { + ensureString(null); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message, "null is not a string"); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/thenable/ensure.js b/node_modules/ext/node_modules/type/test/thenable/ensure.js new file mode 100644 index 0000000..13c81af --- /dev/null +++ b/node_modules/ext/node_modules/type/test/thenable/ensure.js @@ -0,0 +1,20 @@ +"use strict"; + +var assert = require("chai").assert + , ensureThenable = require("../../thenable/ensure"); + +describe("thenable/ensure", function () { + it("Should return input value", function () { + var value = { then: function () { return true; } }; + assert.equal(ensureThenable(value), value); + }); + it("Should crash on no value", function () { + try { + ensureThenable({}); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message, "[object Object] is not a thenable object"); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/thenable/is.js b/node_modules/ext/node_modules/type/test/thenable/is.js new file mode 100644 index 0000000..37a32d4 --- /dev/null +++ b/node_modules/ext/node_modules/type/test/thenable/is.js @@ -0,0 +1,44 @@ +"use strict"; + +var assert = require("chai").assert + , isThenable = require("../../thenable/is"); + +describe("thenable/is", function () { + it("Should return true on object with `then` method", function () { + assert.equal(isThenable({ then: function () { return true; } }), true); + }); + if (typeof Promise === "function") { + it("Should return true on promise", function () { + assert.equal(isThenable(Promise.resolve()), true); + }); + } + it("Should return false on object with `then` non callable property", function () { + assert.equal(isThenable({ then: {} }), false); + }); + + it("Should return false on plain object", function () { assert.equal(isThenable({}), false); }); + it("Should return false on function", function () { + assert.equal(isThenable(function () { return true; }), false); + }); + it("Should return false on array", function () { assert.equal(isThenable([]), false); }); + if (typeof Object.create === "function") { + it("Should return false on object with no prototype", function () { + assert.equal(isThenable(Object.create(null)), false); + }); + } + it("Should return false on string", function () { assert.equal(isThenable("foo"), false); }); + it("Should return false on empty string", function () { assert.equal(isThenable(""), false); }); + it("Should return false on number", function () { assert.equal(isThenable(123), false); }); + it("Should return false on NaN", function () { assert.equal(isThenable(NaN), false); }); + it("Should return false on boolean", function () { assert.equal(isThenable(true), false); }); + if (typeof Symbol === "function") { + it("Should return false on symbol", function () { + assert.equal(isThenable(Symbol("foo")), false); + }); + } + + it("Should return false on null", function () { assert.equal(isThenable(null), false); }); + it("Should return false on undefined", function () { + assert.equal(isThenable(void 0), false); + }); +}); diff --git a/node_modules/ext/node_modules/type/test/time-value/coerce.js b/node_modules/ext/node_modules/type/test/time-value/coerce.js new file mode 100644 index 0000000..22a02fe --- /dev/null +++ b/node_modules/ext/node_modules/type/test/time-value/coerce.js @@ -0,0 +1,47 @@ +"use strict"; + +var assert = require("chai").assert + , coerceToTimeValue = require("../../time-value/coerce"); + +describe("time-value/coerce", function () { + it("Should coerce float to time value", function () { + assert.equal(coerceToTimeValue(123.123), 123); + assert.equal(coerceToTimeValue(123.823), 123); + assert.equal(coerceToTimeValue(-123.123), -123); + assert.equal(coerceToTimeValue(-123.823), -123); + }); + it("Should coerce string", function () { assert.equal(coerceToTimeValue("12.123"), 12); }); + it("Should coerce booleans", function () { assert.equal(coerceToTimeValue(true), 1); }); + it("Should coerce number objects", function () { + assert.equal(coerceToTimeValue(new Number(343)), 343); + }); + it("Should coerce objects", function () { + assert.equal(coerceToTimeValue({ valueOf: function () { return 23; } }), 23); + }); + it("Should reject infinite number", function () { + assert.equal(coerceToTimeValue(Infinity), null); + }); + it("Should reject number beyond 100,000,000 days from unix epox", function () { + assert.equal(coerceToTimeValue(8.64e15 + 1), null); + assert.equal(coerceToTimeValue(-8.64e15 - 1), null); + }); + + it("Should reject NaN", function () { assert.equal(coerceToTimeValue(NaN), null); }); + + if (typeof Object.create === "function") { + it("Should not coerce objects with no number representation", function () { + assert.equal(coerceToTimeValue(Object.create(null)), null); + }); + } + + it("Should not coerce null", function () { assert.equal(coerceToTimeValue(null), null); }); + it("Should not coerce undefined", function () { + assert.equal(coerceToTimeValue(undefined), null); + }); + + if (typeof Symbol === "function") { + it("Should not coerce symbols", function () { + assert.equal(coerceToTimeValue(Symbol("foo")), null); + }); + } +}); diff --git a/node_modules/ext/node_modules/type/test/time-value/ensure.js b/node_modules/ext/node_modules/type/test/time-value/ensure.js new file mode 100644 index 0000000..d53b87e --- /dev/null +++ b/node_modules/ext/node_modules/type/test/time-value/ensure.js @@ -0,0 +1,17 @@ +"use strict"; + +var assert = require("chai").assert + , ensureTimeValue = require("../../time-value/ensure"); + +describe("time-value/ensure", function () { + it("Should return coerced value", function () { assert.equal(ensureTimeValue("12.23"), 12); }); + it("Should crash on no value", function () { + try { + ensureTimeValue("foo"); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message, "foo is not a time value"); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/value/ensure.js b/node_modules/ext/node_modules/type/test/value/ensure.js new file mode 100644 index 0000000..06d698e --- /dev/null +++ b/node_modules/ext/node_modules/type/test/value/ensure.js @@ -0,0 +1,20 @@ +"use strict"; + +var assert = require("chai").assert + , ensureValue = require("../../value/ensure"); + +describe("value/ensure", function () { + it("Should return input value", function () { + var value = {}; + assert.equal(ensureValue(value), value); + }); + it("Should crash on no value", function () { + try { + ensureValue(null); + throw new Error("Unexpected"); + } catch (error) { + assert.equal(error.name, "TypeError"); + assert.equal(error.message, "Cannot use null"); + } + }); +}); diff --git a/node_modules/ext/node_modules/type/test/value/is.js b/node_modules/ext/node_modules/type/test/value/is.js new file mode 100644 index 0000000..d3d893e --- /dev/null +++ b/node_modules/ext/node_modules/type/test/value/is.js @@ -0,0 +1,29 @@ +"use strict"; + +var assert = require("chai").assert + , isValue = require("../../value/is"); + +describe("value/is", function () { + it("Should return true on object", function () { assert.equal(isValue({}), true); }); + it("Should return true on function", function () { + assert.equal(isValue(function () { return true; }), true); + }); + it("Should return true on array", function () { assert.equal(isValue([]), true); }); + if (typeof Object.create === "function") { + it("Should return true on object with no prototype", function () { + assert.equal(isValue(Object.create(null)), true); + }); + } + it("Should return true on string", function () { assert.equal(isValue("foo"), true); }); + it("Should return true on empty string", function () { assert.equal(isValue(""), true); }); + it("Should return true on number", function () { assert.equal(isValue(123), true); }); + it("Should return true on NaN", function () { assert.equal(isValue(NaN), true); }); + it("Should return true on boolean", function () { assert.equal(isValue(false), true); }); + if (typeof Symbol === "function") { + // eslint-disable-next-line no-undef + it("Should return true on symbol", function () { assert.equal(isValue(Symbol()), true); }); + } + + it("Should return false on null", function () { assert.equal(isValue(null), false); }); + it("Should return false on undefined", function () { assert.equal(isValue(void 0), false); }); +}); diff --git a/node_modules/ext/node_modules/type/thenable/ensure.js b/node_modules/ext/node_modules/type/thenable/ensure.js new file mode 100644 index 0000000..4d7f422 --- /dev/null +++ b/node_modules/ext/node_modules/type/thenable/ensure.js @@ -0,0 +1,9 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , is = require("./is"); + +module.exports = function (value/*, options*/) { + if (is(value)) return value; + return resolveException(value, "%v is not a thenable object", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/thenable/is.js b/node_modules/ext/node_modules/type/thenable/is.js new file mode 100644 index 0000000..1f3d399 --- /dev/null +++ b/node_modules/ext/node_modules/type/thenable/is.js @@ -0,0 +1,9 @@ +"use strict"; + +var isObject = require("../object/is"); + +module.exports = function (value) { + if (!isObject(value)) return false; + try { return typeof value.then === "function"; } + catch (error) { return false; } +}; diff --git a/node_modules/ext/node_modules/type/time-value/coerce.js b/node_modules/ext/node_modules/type/time-value/coerce.js new file mode 100644 index 0000000..7124864 --- /dev/null +++ b/node_modules/ext/node_modules/type/time-value/coerce.js @@ -0,0 +1,12 @@ +"use strict"; + +var coerceToInteger = require("../integer/coerce"); + +var abs = Math.abs; + +module.exports = function (value) { + value = coerceToInteger(value); + if (!value) return value; + if (abs(value) > 8.64e15) return null; + return value; +}; diff --git a/node_modules/ext/node_modules/type/time-value/ensure.js b/node_modules/ext/node_modules/type/time-value/ensure.js new file mode 100644 index 0000000..cf17175 --- /dev/null +++ b/node_modules/ext/node_modules/type/time-value/ensure.js @@ -0,0 +1,10 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , coerce = require("./coerce"); + +module.exports = function (value/*, options*/) { + var coerced = coerce(value); + if (coerced !== null) return coerced; + return resolveException(value, "%v is not a time value", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/value/ensure.js b/node_modules/ext/node_modules/type/value/ensure.js new file mode 100644 index 0000000..0d24327 --- /dev/null +++ b/node_modules/ext/node_modules/type/value/ensure.js @@ -0,0 +1,9 @@ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , is = require("./is"); + +module.exports = function (value/*, options*/) { + if (is(value)) return value; + return resolveException(value, "Cannot use %v", arguments[1]); +}; diff --git a/node_modules/ext/node_modules/type/value/is.js b/node_modules/ext/node_modules/type/value/is.js new file mode 100644 index 0000000..648aa9c --- /dev/null +++ b/node_modules/ext/node_modules/type/value/is.js @@ -0,0 +1,6 @@ +"use strict"; + +// ES3 safe +var _undefined = void 0; + +module.exports = function (value) { return value !== _undefined && value !== null; }; diff --git a/node_modules/ext/object/entries/implement.js b/node_modules/ext/object/entries/implement.js new file mode 100644 index 0000000..383ceee --- /dev/null +++ b/node_modules/ext/object/entries/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Object, "entries", { + value: require("./implementation"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/node_modules/ext/object/entries/implementation.js b/node_modules/ext/object/entries/implementation.js new file mode 100644 index 0000000..898e6e9 --- /dev/null +++ b/node_modules/ext/object/entries/implementation.js @@ -0,0 +1,15 @@ +"use strict"; + +var ensureValue = require("type/value/ensure"); + +var objHasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function (object) { + object = Object(ensureValue(object)); + var result = []; + for (var key in object) { + if (!objHasOwnProperty.call(object, key)) continue; + result.push([key, object[key]]); + } + return result; +}; diff --git a/node_modules/ext/object/entries/index.js b/node_modules/ext/object/entries/index.js new file mode 100644 index 0000000..0a784d6 --- /dev/null +++ b/node_modules/ext/object/entries/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Object.entries : require("./implementation"); diff --git a/node_modules/ext/object/entries/is-implemented.js b/node_modules/ext/object/entries/is-implemented.js new file mode 100644 index 0000000..aad52b2 --- /dev/null +++ b/node_modules/ext/object/entries/is-implemented.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + try { return Object.entries({ foo: 12 })[0][0] === "foo"; } + catch (e) { return false; } +}; diff --git a/node_modules/ext/package.json b/node_modules/ext/package.json new file mode 100644 index 0000000..3d7644f --- /dev/null +++ b/node_modules/ext/package.json @@ -0,0 +1,149 @@ +{ + "_from": "ext@^1.1.2", + "_id": "ext@1.4.0", + "_inBundle": false, + "_integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "_location": "/ext", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ext@^1.1.2", + "name": "ext", + "escapedName": "ext", + "rawSpec": "^1.1.2", + "saveSpec": null, + "fetchSpec": "^1.1.2" + }, + "_requiredBy": [ + "/es6-symbol" + ], + "_resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "_shasum": "89ae7a07158f79d35517882904324077e4379244", + "_spec": "ext@^1.1.2", + "_where": "/usr/share/r3-server/beta/r3/node_modules/es6-symbol", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "bundleDependencies": false, + "dependencies": { + "type": "^2.0.0" + }, + "deprecated": false, + "description": "JavaScript utilities with respect to emerging standard", + "devDependencies": { + "chai": "^4.2.0", + "eslint": "^6.7.1", + "eslint-config-medikoo": "^2.7.0", + "git-list-updated": "^1.2.1", + "husky": "^3.1.0", + "lint-staged": "^9.5.0", + "mocha": "^6.2.2", + "prettier-elastic": "^1.18.2", + "sinon": "^7.5.0" + }, + "eslintConfig": { + "extends": "medikoo/es3", + "root": true, + "overrides": [ + { + "files": "global-this/implementation.js", + "globals": { + "__global__": true, + "self": true, + "window": true + }, + "rules": { + "no-extend-native": "off", + "strict": "off" + } + }, + { + "files": [ + "global-this/is-implemented.js", + "global-this/index.js" + ], + "globals": { + "globalThis": true + } + }, + { + "files": "test/**/*.js", + "env": { + "mocha": true + } + }, + { + "files": "test/thenable_/finally.js", + "globals": { + "Promise": true + } + } + ] + }, + "eslintIgnore": [ + "_es5-ext/*" + ], + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "keywords": [ + "ecmascript", + "es", + "es6", + "extensions", + "ext", + "addons", + "lodash", + "extras", + "harmony", + "javascript", + "polyfill", + "shim", + "util", + "utils", + "utilities" + ], + "license": "ISC", + "lint-staged": { + "*.js": [ + "eslint" + ], + "*.{css,html,js,json,md,yaml,yml}": [ + "prettier -c" + ] + }, + "mocha": { + "recursive": true + }, + "name": "ext", + "prettier": { + "printWidth": 100, + "tabWidth": 4, + "quoteProps": "preserve", + "overrides": [ + { + "files": "*.md", + "options": { + "tabWidth": 2 + } + } + ] + }, + "repository": { + "type": "git", + "url": "https://github.com/medikoo/es5-ext/tree/ext" + }, + "scripts": { + "lint": "eslint .", + "lint-updated": "pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'", + "prettier-check-updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c", + "prettify": "prettier --write --ignore-path .gitignore '**/*.{css,html,js,json,md,yaml,yml}'", + "test": "mocha" + }, + "version": "1.4.0" +} diff --git a/node_modules/ext/string/random.js b/node_modules/ext/string/random.js new file mode 100644 index 0000000..c96ef92 --- /dev/null +++ b/node_modules/ext/string/random.js @@ -0,0 +1,50 @@ +"use strict"; + +var isObject = require("type/object/is") + , ensureNaturalNumber = require("type/natural-number/ensure") + , ensureString = require("type/string/ensure"); + +var generated = Object.create(null), random = Math.random, uniqTryLimit = 100; + +var getChunk = function () { return random().toString(36).slice(2); }; + +var getString = function (length, charset) { + var str; + if (charset) { + var charsetLength = charset.length; + str = ""; + for (var i = 0; i < length; ++i) { + str += charset.charAt(Math.floor(Math.random() * charsetLength)); + } + return str; + } + str = getChunk(); + if (length === null) return str; + while (str.length < length) str += getChunk(); + return str.slice(0, length); +}; + +module.exports = function (/* options */) { + var options = arguments[0]; + if (!isObject(options)) options = {}; + var length = ensureNaturalNumber(options.length, { "default": 10 }) + , isUnique = options.isUnique + , charset = ensureString(options.charset, { isOptional: true }); + + var str = getString(length, charset); + if (isUnique) { + var count = 0; + while (generated[str]) { + if (++count === uniqTryLimit) { + throw new Error( + "Cannot generate random string.\n" + + "String.random is not designed to effectively generate many short and " + + "unique random strings" + ); + } + str = getString(length); + } + generated[str] = true; + } + return str; +}; diff --git a/node_modules/ext/string_/includes/implementation.js b/node_modules/ext/string_/includes/implementation.js new file mode 100644 index 0000000..a7219f2 --- /dev/null +++ b/node_modules/ext/string_/includes/implementation.js @@ -0,0 +1,7 @@ +"use strict"; + +var indexOf = String.prototype.indexOf; + +module.exports = function (searchString/*, position*/) { + return indexOf.call(this, searchString, arguments[1]) > -1; +}; diff --git a/node_modules/ext/string_/includes/index.js b/node_modules/ext/string_/includes/index.js new file mode 100644 index 0000000..ee4e284 --- /dev/null +++ b/node_modules/ext/string_/includes/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? String.prototype.includes + : require("./implementation"); diff --git a/node_modules/ext/string_/includes/is-implemented.js b/node_modules/ext/string_/includes/is-implemented.js new file mode 100644 index 0000000..edc4515 --- /dev/null +++ b/node_modules/ext/string_/includes/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var str = "razdwatrzy"; + +module.exports = function () { + if (typeof str.includes !== "function") return false; + return str.includes("dwa") === true && str.includes("foo") === false; +}; diff --git a/node_modules/ext/test/function/identity.js b/node_modules/ext/test/function/identity.js new file mode 100644 index 0000000..7d7a9bd --- /dev/null +++ b/node_modules/ext/test/function/identity.js @@ -0,0 +1,14 @@ +"use strict"; + +var assert = require("chai").assert + , identity = require("../../function/identity"); + +describe("function/identity", function () { + it("Should return first argument", function () { + assert.equal(identity("foo"), "foo"); + var object = {}; + assert.equal(identity(object), object); + assert.equal(identity(), undefined); + assert.equal(identity(1, 2, 3), 1); + }); +}); diff --git a/node_modules/ext/test/global-this/implementation.js b/node_modules/ext/test/global-this/implementation.js new file mode 100644 index 0000000..4a9b2ca --- /dev/null +++ b/node_modules/ext/test/global-this/implementation.js @@ -0,0 +1,13 @@ +"use strict"; + +var isObject = require("type/object/is") + , assert = require("chai").assert + , globalThis = require("../../global-this/implementation"); + +describe("global-this/implementation", function () { + it("Should be an object", function () { assert(isObject(globalThis)); }); + it("Should be a global object", function () { assert.equal(globalThis.Array, Array); }); + it("Internal resolution should not introduce side-effects", function () { + assert(!("__global__" in Object.prototype)); + }); +}); diff --git a/node_modules/ext/test/global-this/index.js b/node_modules/ext/test/global-this/index.js new file mode 100644 index 0000000..bbf1d07 --- /dev/null +++ b/node_modules/ext/test/global-this/index.js @@ -0,0 +1,10 @@ +"use strict"; + +var isObject = require("type/object/is") + , assert = require("chai").assert + , globalThis = require("../../global-this"); + +describe("global-this", function () { + it("Should be an object", function () { assert(isObject(globalThis)); }); + it("Should be a global object", function () { assert.equal(globalThis.Array, Array); }); +}); diff --git a/node_modules/ext/test/global-this/is-implemented.js b/node_modules/ext/test/global-this/is-implemented.js new file mode 100644 index 0000000..1bd748e --- /dev/null +++ b/node_modules/ext/test/global-this/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var assert = require("chai").assert + , isImplemented = require("../../global-this/is-implemented"); + +describe("global-this/is-implemented", function () { + it("Should return boolean", function () { assert.equal(typeof isImplemented(), "boolean"); }); +}); diff --git a/node_modules/ext/test/math/ceil-10.js b/node_modules/ext/test/math/ceil-10.js new file mode 100644 index 0000000..8e9ef5a --- /dev/null +++ b/node_modules/ext/test/math/ceil-10.js @@ -0,0 +1,13 @@ +"use strict"; + +var assert = require("chai").assert + , ceil10 = require("../../math/ceil-10"); + +describe("math/ceil-10", function () { + it("Should ceil", function () { + assert.equal(ceil10(55.51, -1), 55.6); + assert.equal(ceil10(51, 1), 60); + assert.equal(ceil10(-55.59, -1), -55.5); + assert.equal(ceil10(-59, 1), -50); + }); +}); diff --git a/node_modules/ext/test/math/floor-10.js b/node_modules/ext/test/math/floor-10.js new file mode 100644 index 0000000..8eaf1ea --- /dev/null +++ b/node_modules/ext/test/math/floor-10.js @@ -0,0 +1,13 @@ +"use strict"; + +var assert = require("chai").assert + , floor10 = require("../../math/floor-10"); + +describe("math/floor-10", function () { + it("Should floor", function () { + assert.equal(floor10(55.59, -1), 55.5); + assert.equal(floor10(59, 1), 50); + assert.equal(floor10(-55.51, -1), -55.6); + assert.equal(floor10(-51, 1), -60); + }); +}); diff --git a/node_modules/ext/test/math/round-10.js b/node_modules/ext/test/math/round-10.js new file mode 100644 index 0000000..8463ddc --- /dev/null +++ b/node_modules/ext/test/math/round-10.js @@ -0,0 +1,19 @@ +"use strict"; + +var assert = require("chai").assert + , round10 = require("../../math/round-10"); + +describe("math/round-10", function () { + it("Should round", function () { + assert.equal(round10(55.55, -1), 55.6); + assert.equal(round10(55.549, -1), 55.5); + assert.equal(round10(55, 1), 60); + assert.equal(round10(54.9, 1), 50); + assert.equal(round10(-55.55, -1), -55.5); + assert.equal(round10(-55.551, -1), -55.6); + assert.equal(round10(-55, 1), -50); + assert.equal(round10(-55.1, 1), -60); + assert.equal(round10(1.005, -2), 1.01); + assert.equal(round10(-1.005, -2), -1.0); + }); +}); diff --git a/node_modules/ext/test/object/entries/_tests.js b/node_modules/ext/test/object/entries/_tests.js new file mode 100644 index 0000000..5432dbf --- /dev/null +++ b/node_modules/ext/test/object/entries/_tests.js @@ -0,0 +1,15 @@ +"use strict"; + +var assert = require("chai").assert; + +module.exports = function (entries) { + it("Should resolve entries array for an object", function () { + assert.deepEqual(entries({ foo: "bar" }), [["foo", "bar"]]); + }); + it("Should resolve entries array for a primitive", function () { + assert.deepEqual(entries("raz"), [["0", "r"], ["1", "a"], ["2", "z"]]); + }); + it("Should throw on non-value", function () { + assert["throws"](function () { entries(null); }, TypeError); + }); +}; diff --git a/node_modules/ext/test/object/entries/implementation.js b/node_modules/ext/test/object/entries/implementation.js new file mode 100644 index 0000000..ec763c5 --- /dev/null +++ b/node_modules/ext/test/object/entries/implementation.js @@ -0,0 +1,6 @@ +"use strict"; + +var entries = require("../../../object/entries/implementation") + , tests = require("./_tests"); + +describe("object/entries/implementation", function () { tests(entries); }); diff --git a/node_modules/ext/test/object/entries/index.js b/node_modules/ext/test/object/entries/index.js new file mode 100644 index 0000000..20e9bfe --- /dev/null +++ b/node_modules/ext/test/object/entries/index.js @@ -0,0 +1,6 @@ +"use strict"; + +var entries = require("../../../object/entries") + , tests = require("./_tests"); + +describe("object/entries/index", function () { tests(entries); }); diff --git a/node_modules/ext/test/object/entries/is-implemented.js b/node_modules/ext/test/object/entries/is-implemented.js new file mode 100644 index 0000000..d920602 --- /dev/null +++ b/node_modules/ext/test/object/entries/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var assert = require("chai").assert + , isImplemented = require("../../../object/entries/is-implemented"); + +describe("object/entries/is-implemented", function () { + assert.equal(typeof isImplemented(), "boolean"); +}); diff --git a/node_modules/ext/test/string/random.js b/node_modules/ext/test/string/random.js new file mode 100644 index 0000000..995860d --- /dev/null +++ b/node_modules/ext/test/string/random.js @@ -0,0 +1,36 @@ +"use strict"; + +var assert = require("chai").assert + , random = require("../../string/random"); + +var isValidFormat = RegExp.prototype.test.bind(/^[a-z0-9]+$/); + +describe("string/random", function () { + it("Should return string", function () { assert.equal(typeof random(), "string"); }); + it("Should return by default string of length 10", function () { + assert.equal(random().length, 10); + }); + it("Should support custom charset", function () { + var charset = "abc"; + var result = random({ charset: charset }); + assert.equal(result.length, 10); + for (var i = 0; i < result.length; ++i) { + assert.isAtLeast(charset.indexOf(result.charAt(i)), 0); + } + }); + it("Should ensure unique string with `isUnique` option", function () { + assert.notEqual(random({ isUnique: true }), random({ isUnique: true })); + }); + it("Should contain only ascii chars", function () { assert(isValidFormat(random())); }); + it("Should support `length` option", function () { + assert.equal(random({ length: 4 }).length, 4); + assert.equal(random({ length: 100 }).length, 100); + assert.equal(random({ length: 0 }).length, 0); + }); + it("Should crash if unable to generate unique string with `isUnique` optin", function () { + random({ length: 0, isUnique: true }); + assert["throws"](function () { + random({ length: 0, isUnique: true }); + }, "Cannot generate random string"); + }); +}); diff --git a/node_modules/ext/test/string_/includes/_tests.js b/node_modules/ext/test/string_/includes/_tests.js new file mode 100644 index 0000000..fdebdfd --- /dev/null +++ b/node_modules/ext/test/string_/includes/_tests.js @@ -0,0 +1,40 @@ +"use strict"; + +var assert = require("chai").assert; + +module.exports = function (includes) { + it("Should return true when context contains search string", function () { + assert.equal(includes.call("razdwatrzy", "dwa"), true); + }); + it("Should return true when context starts with search string", function () { + assert.equal(includes.call("razdwa", "raz"), true); + }); + it("Should return true when context ends with search string", function () { + assert.equal(includes.call("razdwa", "dwa"), true); + }); + it("Should return false when string doesn't contain search string", function () { + assert.equal(includes.call("razdwa", "trzy"), false); + }); + it("Should return false when context is empty and search string is not", function () { + assert.equal(includes.call("", "a"), false); + }); + it("Should return false when search string is longer than context", function () { + assert.equal(includes.call("raz", "razdwa"), false); + }); + it("Should return true when search string is same as context ", function () { + assert.equal(includes.call("raz", "raz"), true); + }); + it("Should return true when context starts with search string", function () { + assert.equal(includes.call("razdwa", "raz"), true); + }); + it("Should return true when search string is empty", function () { + assert.equal(includes.call("raz", ""), true); + }); + it("Should return true when both context and search string are empty", function () { + assert.equal(includes.call("", ""), true); + }); + it("Should support position argument", function () { + assert.equal(includes.call("razdwa", "raz", 1), false); + assert.equal(includes.call("razdwa", "dwa", 1), true); + }); +}; diff --git a/node_modules/ext/test/string_/includes/implementation.js b/node_modules/ext/test/string_/includes/implementation.js new file mode 100644 index 0000000..5331d3a --- /dev/null +++ b/node_modules/ext/test/string_/includes/implementation.js @@ -0,0 +1,5 @@ +"use strict"; + +describe("string_/includes/implementation", function () { + require("./_tests")(require("../../../string_/includes/implementation")); +}); diff --git a/node_modules/ext/test/string_/includes/index.js b/node_modules/ext/test/string_/includes/index.js new file mode 100644 index 0000000..6ba2de5 --- /dev/null +++ b/node_modules/ext/test/string_/includes/index.js @@ -0,0 +1,5 @@ +"use strict"; + +describe("string_/includes/implementation", function () { + require("./_tests")(require("../../../string_/includes")); +}); diff --git a/node_modules/ext/test/string_/includes/is-implemented.js b/node_modules/ext/test/string_/includes/is-implemented.js new file mode 100644 index 0000000..97a1f78 --- /dev/null +++ b/node_modules/ext/test/string_/includes/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var assert = require("chai").assert + , isImplemented = require("../../../string_/includes/is-implemented"); + +describe("string_/includes/is-implemented", function () { + it("Should return boolean", function () { assert.equal(typeof isImplemented(), "boolean"); }); +}); diff --git a/node_modules/ext/test/thenable_/finally.js b/node_modules/ext/test/thenable_/finally.js new file mode 100644 index 0000000..1d2fcd9 --- /dev/null +++ b/node_modules/ext/test/thenable_/finally.js @@ -0,0 +1,89 @@ +"use strict"; + +var assert = require("chai").assert + , sinon = require("sinon") + , identity = require("../../function/identity") + , finallyMethod = require("../../thenable_/finally"); + +var throwUnexpected = function () { throw new Error("Unexpected"); }; + +describe("thenable_/finally", function () { + describe("Successful on fulfilled", function () { + var callback, input, result; + + before(function () { + callback = sinon.fake(); + input = Promise.resolve("foo"); + result = finallyMethod.call(input, callback); + return result; + }); + + it("Should invoke finally callback", function () { assert(callback.calledOnce); }); + + it("Return promise should fulfill with original result", function () { + return Promise.all([input, result]).then(function (results) { + assert.equal(results[0], results[1]); + }); + }); + }); + + describe("Successful on rejected", function () { + var callback, input, result; + + before(function () { + var inputError = new Error("Rejected"); + callback = sinon.fake(); + input = Promise.reject(inputError); + result = finallyMethod.call(input, callback); + return result["catch"](function (error) { if (error !== inputError) throw error; }); + }); + + it("Should invoke finally callback", function () { assert(callback.calledOnce); }); + + it("Return promise should fulfill with original result", function () { + return Promise.all([input["catch"](identity), result["catch"](identity)]).then( + function (results) { assert.equal(results[0], results[1]); } + ); + }); + }); + + describe("Failed on fulfilled", function () { + var callback, result, finallyError; + + before(function () { + finallyError = new Error("Finally Rejected"); + callback = sinon.fake["throws"](finallyError); + var input = Promise.resolve("foo"); + result = finallyMethod.call(input, callback); + return result["catch"](function (error) { if (error !== finallyError) throw error; }); + }); + + it("Should invoke finally callback", function () { assert(callback.calledOnce); }); + + it("Return promise should be rejected with finally error", function () { + return result.then(throwUnexpected, function (error) { + assert.equal(finallyError, error); + }); + }); + }); + + describe("Failed on rejected", function () { + var callback, result, finallyError; + + before(function () { + finallyError = new Error("Finally Rejected"); + callback = sinon.fake["throws"](finallyError); + var input = Promise.reject(new Error("Rejected")); + result = finallyMethod.call(input, callback); + return result["catch"](function (error) { if (error !== finallyError) throw error; }); + }); + + it("Should invoke finally callback", function () { assert(callback.calledOnce); }); + + it("Return promise should be rejected with finally error", function () { + return result.then(throwUnexpected, function (error) { + assert.equal(finallyError, error); + }); + }); + }); +}); diff --git a/node_modules/ext/thenable_/finally.js b/node_modules/ext/thenable_/finally.js new file mode 100644 index 0000000..42274bf --- /dev/null +++ b/node_modules/ext/thenable_/finally.js @@ -0,0 +1,24 @@ +"use strict"; + +var ensurePlainFunction = require("type/plain-function/ensure") + , isThenable = require("type/thenable/is") + , ensureThenable = require("type/thenable/ensure"); + +var resolveCallback = function (callback, next) { + var callbackResult = callback(); + if (!isThenable(callbackResult)) return next(); + return callbackResult.then(next); +}; + +module.exports = function (callback) { + ensureThenable(this); + ensurePlainFunction(callback); + return this.then( + function (result) { + return resolveCallback(callback, function () { return result; }); + }, + function (error) { + return resolveCallback(callback, function () { throw error; }); + } + ); +}; diff --git a/node_modules/extend-shallow/LICENSE b/node_modules/extend-shallow/LICENSE new file mode 100644 index 0000000..99c9369 --- /dev/null +++ b/node_modules/extend-shallow/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, 2017, Jon Schlinkert. + +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. diff --git a/node_modules/extend-shallow/README.md b/node_modules/extend-shallow/README.md new file mode 100644 index 0000000..dee226f --- /dev/null +++ b/node_modules/extend-shallow/README.md @@ -0,0 +1,97 @@ +# extend-shallow [![NPM version](https://img.shields.io/npm/v/extend-shallow.svg?style=flat)](https://www.npmjs.com/package/extend-shallow) [![NPM monthly downloads](https://img.shields.io/npm/dm/extend-shallow.svg?style=flat)](https://npmjs.org/package/extend-shallow) [![NPM total downloads](https://img.shields.io/npm/dt/extend-shallow.svg?style=flat)](https://npmjs.org/package/extend-shallow) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/extend-shallow.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/extend-shallow) + +> Extend an object with the properties of additional objects. node.js/javascript util. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save extend-shallow +``` + +## Usage + +```js +var extend = require('extend-shallow'); + +extend({a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +Pass an empty object to shallow clone: + +```js +var obj = {}; +extend(obj, {a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +## About + +

+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") +* [for-in](https://www.npmjs.com/package/for-in): Iterate over the own and inherited enumerable properties of an object, and return an object… [more](https://github.com/jonschlinkert/for-in) | [homepage](https://github.com/jonschlinkert/for-in "Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js") +* [for-own](https://www.npmjs.com/package/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) | [homepage](https://github.com/jonschlinkert/for-own "Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 33 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [pdehaan](https://github.com/pdehaan) | + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 19, 2017._ \ No newline at end of file diff --git a/node_modules/extend-shallow/index.js b/node_modules/extend-shallow/index.js new file mode 100644 index 0000000..c9582f8 --- /dev/null +++ b/node_modules/extend-shallow/index.js @@ -0,0 +1,60 @@ +'use strict'; + +var isExtendable = require('is-extendable'); +var assignSymbols = require('assign-symbols'); + +module.exports = Object.assign || function(obj/*, objects*/) { + if (obj === null || typeof obj === 'undefined') { + throw new TypeError('Cannot convert undefined or null to object'); + } + if (!isObject(obj)) { + obj = {}; + } + for (var i = 1; i < arguments.length; i++) { + var val = arguments[i]; + if (isString(val)) { + val = toObject(val); + } + if (isObject(val)) { + assign(obj, val); + assignSymbols(obj, val); + } + } + return obj; +}; + +function assign(a, b) { + for (var key in b) { + if (hasOwn(b, key)) { + a[key] = b[key]; + } + } +} + +function isString(val) { + return (val && typeof val === 'string'); +} + +function toObject(str) { + var obj = {}; + for (var i in str) { + obj[i] = str[i]; + } + return obj; +} + +function isObject(val) { + return (val && typeof val === 'object') || isExtendable(val); +} + +/** + * Returns true if the given `key` is an own property of `obj`. + */ + +function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} + +function isEnum(obj, key) { + return Object.prototype.propertyIsEnumerable.call(obj, key); +} diff --git a/node_modules/extend-shallow/node_modules/is-extendable/LICENSE b/node_modules/extend-shallow/node_modules/is-extendable/LICENSE new file mode 100644 index 0000000..c0d7f13 --- /dev/null +++ b/node_modules/extend-shallow/node_modules/is-extendable/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/extend-shallow/node_modules/is-extendable/README.md b/node_modules/extend-shallow/node_modules/is-extendable/README.md new file mode 100644 index 0000000..875b56a --- /dev/null +++ b/node_modules/extend-shallow/node_modules/is-extendable/README.md @@ -0,0 +1,88 @@ +# is-extendable [![NPM version](https://img.shields.io/npm/v/is-extendable.svg?style=flat)](https://www.npmjs.com/package/is-extendable) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-extendable.svg?style=flat)](https://npmjs.org/package/is-extendable) [![NPM total downloads](https://img.shields.io/npm/dt/is-extendable.svg?style=flat)](https://npmjs.org/package/is-extendable) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-extendable.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-extendable) + +> Returns true if a value is a plain object, array or function. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-extendable +``` + +## Usage + +```js +var isExtendable = require('is-extendable'); +``` + +Returns true if the value is any of the following: + +* array +* plain object +* function + +## Notes + +All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not `null` or `undefined` and: + +* the value is not a primitive, or +* that the object is a plain object, function or array + +Also note that an `extendable` object is not the same as an [extensible object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible), which is one that (in es6) is not sealed, frozen, or marked as non-extensible using `preventExtensions`. + +## Release history + +### v1.0.0 - 2017/07/20 + +**Breaking changes** + +* No longer considers date, regex or error objects to be extendable + +## About + +### Related projects + +* [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target… [more](https://github.com/jonschlinkert/assign-deep) | [homepage](https://github.com/jonschlinkert/assign-deep "Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target (first) object.") +* [is-equal-shallow](https://www.npmjs.com/package/is-equal-shallow): Does a shallow comparison of two objects, returning false if the keys or values differ. | [homepage](https://github.com/jonschlinkert/is-equal-shallow "Does a shallow comparison of two objects, returning false if the keys or values differ.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 20, 2017._ \ No newline at end of file diff --git a/node_modules/extend-shallow/node_modules/is-extendable/index.d.ts b/node_modules/extend-shallow/node_modules/is-extendable/index.d.ts new file mode 100644 index 0000000..b96d507 --- /dev/null +++ b/node_modules/extend-shallow/node_modules/is-extendable/index.d.ts @@ -0,0 +1,5 @@ +export = isExtendable; + +declare function isExtendable(val: any): boolean; + +declare namespace isExtendable {} diff --git a/node_modules/extend-shallow/node_modules/is-extendable/index.js b/node_modules/extend-shallow/node_modules/is-extendable/index.js new file mode 100644 index 0000000..a8b26ad --- /dev/null +++ b/node_modules/extend-shallow/node_modules/is-extendable/index.js @@ -0,0 +1,14 @@ +/*! + * is-extendable + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var isPlainObject = require('is-plain-object'); + +module.exports = function isExtendable(val) { + return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); +}; diff --git a/node_modules/extend-shallow/node_modules/is-extendable/package.json b/node_modules/extend-shallow/node_modules/is-extendable/package.json new file mode 100644 index 0000000..6a1d4e6 --- /dev/null +++ b/node_modules/extend-shallow/node_modules/is-extendable/package.json @@ -0,0 +1,98 @@ +{ + "_from": "is-extendable@^1.0.1", + "_id": "is-extendable@1.0.1", + "_inBundle": false, + "_integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "_location": "/extend-shallow/is-extendable", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-extendable@^1.0.1", + "name": "is-extendable", + "escapedName": "is-extendable", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/extend-shallow" + ], + "_resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "_shasum": "a7470f9e426733d81bd81e1155264e3a3507cab4", + "_spec": "is-extendable@^1.0.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/extend-shallow", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-extendable/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "deprecated": false, + "description": "Returns true if a value is a plain object, array or function.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.4.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/jonschlinkert/is-extendable", + "keywords": [ + "array", + "assign", + "check", + "date", + "extend", + "extendable", + "extensible", + "function", + "is", + "object", + "regex", + "test" + ], + "license": "MIT", + "main": "index.js", + "name": "is-extendable", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-extendable.git" + }, + "scripts": { + "test": "mocha" + }, + "types": "index.d.ts", + "verb": { + "related": { + "list": [ + "assign-deep", + "is-equal-shallow", + "is-plain-object", + "isobject", + "kind-of" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.1" +} diff --git a/node_modules/extend-shallow/package.json b/node_modules/extend-shallow/package.json new file mode 100644 index 0000000..eaf05e8 --- /dev/null +++ b/node_modules/extend-shallow/package.json @@ -0,0 +1,126 @@ +{ + "_from": "extend-shallow@^3.0.2", + "_id": "extend-shallow@3.0.2", + "_inBundle": false, + "_integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "_location": "/extend-shallow", + "_phantomChildren": { + "is-plain-object": "2.0.4" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "extend-shallow@^3.0.2", + "name": "extend-shallow", + "escapedName": "extend-shallow", + "rawSpec": "^3.0.2", + "saveSpec": null, + "fetchSpec": "^3.0.2" + }, + "_requiredBy": [ + "/micromatch", + "/nanomatch", + "/regex-not", + "/split-string", + "/to-regex" + ], + "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "_shasum": "26a71aaf073b39fb2127172746131c2704028db8", + "_spec": "extend-shallow@^3.0.2", + "_where": "/usr/share/r3-server/beta/r3/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/extend-shallow/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Peter deHaan", + "url": "http://about.me/peterdehaan" + } + ], + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "deprecated": false, + "description": "Extend an object with the properties of additional objects. node.js/javascript util.", + "devDependencies": { + "array-slice": "^1.0.0", + "benchmarked": "^2.0.0", + "for-own": "^1.0.0", + "gulp-format-md": "^1.0.0", + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.1", + "minimist": "^1.2.0", + "mocha": "^3.5.3", + "object-assign": "^4.1.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/extend-shallow", + "keywords": [ + "assign", + "clone", + "extend", + "merge", + "obj", + "object", + "object-assign", + "object.assign", + "prop", + "properties", + "property", + "props", + "shallow", + "util", + "utility", + "utils", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "extend-shallow", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/extend-shallow.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "related": { + "list": [ + "extend-shallow", + "for-in", + "for-own", + "is-plain-object", + "isobject", + "kind-of" + ] + }, + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "3.0.2" +} diff --git a/node_modules/extend/.editorconfig b/node_modules/extend/.editorconfig new file mode 100644 index 0000000..bc228f8 --- /dev/null +++ b/node_modules/extend/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/extend/.eslintrc b/node_modules/extend/.eslintrc new file mode 100644 index 0000000..a34cf28 --- /dev/null +++ b/node_modules/extend/.eslintrc @@ -0,0 +1,17 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "complexity": [2, 20], + "eqeqeq": [2, "allow-null"], + "func-name-matching": [1], + "max-depth": [1, 4], + "max-statements": [2, 26], + "no-extra-parens": [1], + "no-magic-numbers": [0], + "no-restricted-syntax": [2, "BreakStatement", "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"], + "sort-keys": [0], + } +} diff --git a/node_modules/extend/.jscs.json b/node_modules/extend/.jscs.json new file mode 100644 index 0000000..3cce01d --- /dev/null +++ b/node_modules/extend/.jscs.json @@ -0,0 +1,175 @@ +{ + "es3": true, + + "additionalRules": [], + + "requireSemicolons": true, + + "disallowMultipleSpaces": true, + + "disallowIdentifierNames": [], + + "requireCurlyBraces": { + "allExcept": [], + "keywords": ["if", "else", "for", "while", "do", "try", "catch"] + }, + + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], + + "disallowSpaceAfterKeywords": [], + + "disallowSpaceBeforeComma": true, + "disallowSpaceAfterComma": false, + "disallowSpaceBeforeSemicolon": true, + + "disallowNodeTypes": [ + "DebuggerStatement", + "LabeledStatement", + "SwitchCase", + "SwitchStatement", + "WithStatement" + ], + + "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, + + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + + "requireSpaceBetweenArguments": true, + + "disallowSpacesInsideParentheses": true, + + "disallowSpacesInsideArrayBrackets": true, + + "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, + + "disallowSpaceAfterObjectKeys": true, + + "requireCommaBeforeLineBreak": true, + + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "requireSpaceAfterPrefixUnaryOperators": [], + + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireSpaceBeforePostfixUnaryOperators": [], + + "disallowSpaceBeforeBinaryOperators": [], + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "disallowSpaceAfterBinaryOperators": [], + + "disallowImplicitTypeConversion": ["binary", "string"], + + "disallowKeywords": ["with", "eval"], + + "requireKeywordsOnNewLine": [], + "disallowKeywordsOnNewLine": ["else"], + + "requireLineFeedAtFileEnd": true, + + "disallowTrailingWhitespace": true, + + "disallowTrailingComma": true, + + "excludeFiles": ["node_modules/**", "vendor/**"], + + "disallowMultipleLineStrings": true, + + "requireDotNotation": { "allExcept": ["keywords"] }, + + "requireParenthesesAroundIIFE": true, + + "validateLineBreaks": "LF", + + "validateQuoteMarks": { + "escape": true, + "mark": "'" + }, + + "disallowOperatorBeforeLineBreak": [], + + "requireSpaceBeforeKeywords": [ + "do", + "for", + "if", + "else", + "switch", + "case", + "try", + "catch", + "finally", + "while", + "with", + "return" + ], + + "validateAlignedFunctionParameters": { + "lineBreakAfterOpeningBraces": true, + "lineBreakBeforeClosingBraces": true + }, + + "requirePaddingNewLinesBeforeExport": true, + + "validateNewlineAfterArrayElements": { + "maximum": 6 + }, + + "requirePaddingNewLinesAfterUseStrict": true, + + "disallowArrowFunctions": true, + + "disallowMultiLineTernary": true, + + "validateOrderInObjectKeys": false, + + "disallowIdenticalDestructuringNames": true, + + "disallowNestedTernaries": { "maxLevel": 1 }, + + "requireSpaceAfterComma": { "allExcept": ["trailing"] }, + "requireAlignedMultilineParams": false, + + "requireSpacesInGenerator": { + "afterStar": true + }, + + "disallowSpacesInGenerator": { + "beforeStar": true + }, + + "disallowVar": false, + + "requireArrayDestructuring": false, + + "requireEnhancedObjectLiterals": false, + + "requireObjectDestructuring": false, + + "requireEarlyReturn": false, + + "requireCapitalizedConstructorsNew": { + "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] + }, + + "requireImportAlphabetized": false, + + "requireSpaceBeforeObjectValues": true, + "requireSpaceBeforeDestructuredValues": true, + + "disallowSpacesInsideTemplateStringPlaceholders": true, + + "disallowArrayDestructuringReturn": false, + + "requireNewlineBeforeSingleStatementsInIf": false, + + "disallowUnusedVariables": true, + + "requireSpacesInsideImportedObjectBraces": true, + + "requireUseStrict": true +} + diff --git a/node_modules/extend/.travis.yml b/node_modules/extend/.travis.yml new file mode 100644 index 0000000..5ccdfc4 --- /dev/null +++ b/node_modules/extend/.travis.yml @@ -0,0 +1,230 @@ +language: node_js +os: + - linux +node_js: + - "10.7" + - "9.11" + - "8.11" + - "7.10" + - "6.14" + - "5.12" + - "4.9" + - "iojs-v3.3" + - "iojs-v2.5" + - "iojs-v1.8" + - "0.12" + - "0.10" + - "0.8" +before_install: + - 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac' + - 'nvm install-latest-npm' +install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' +script: + - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' + - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' + - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' +sudo: false +env: + - TEST=true +matrix: + fast_finish: true + include: + - node_js: "lts/*" + env: PRETEST=true + - node_js: "lts/*" + env: POSTTEST=true + - node_js: "4" + env: COVERAGE=true + - node_js: "10.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.13" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.12" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.4" + env: TEST=true ALLOW_FAILURE=true + allow_failures: + - os: osx + - env: TEST=true ALLOW_FAILURE=true diff --git a/node_modules/extend/CHANGELOG.md b/node_modules/extend/CHANGELOG.md new file mode 100644 index 0000000..2cf7de6 --- /dev/null +++ b/node_modules/extend/CHANGELOG.md @@ -0,0 +1,83 @@ +3.0.2 / 2018-07-19 +================== + * [Fix] Prevent merging `__proto__` property (#48) + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` + * [Tests] up to `node` `v10.7`, `v9.11`, `v8.11`, `v7.10`, `v6.14`, `v4.9`; use `nvm install-latest-npm` + +3.0.1 / 2017-04-27 +================== + * [Fix] deep extending should work with a non-object (#46) + * [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config` + * [Tests] up to `node` `v7.9`, `v6.10`, `v4.8`; improve matrix + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. + * [Docs] Add example to readme (#34) + +3.0.0 / 2015-07-01 +================== + * [Possible breaking change] Use global "strict" directive (#32) + * [Tests] `int` is an ES3 reserved word + * [Tests] Test up to `io.js` `v2.3` + * [Tests] Add `npm run eslint` + * [Dev Deps] Update `covert`, `jscs` + +2.0.1 / 2015-04-25 +================== + * Use an inline `isArray` check, for ES3 browsers. (#27) + * Some old browsers fail when an identifier is `toString` + * Test latest `node` and `io.js` versions on `travis-ci`; speed up builds + * Add license info to package.json (#25) + * Update `tape`, `jscs` + * Adding a CHANGELOG + +2.0.0 / 2014-10-01 +================== + * Increase code coverage to 100%; run code coverage as part of tests + * Add `npm run lint`; Run linter as part of tests + * Remove nodeType and setInterval checks in isPlainObject + * Updating `tape`, `jscs`, `covert` + * General style and README cleanup + +1.3.0 / 2014-06-20 +================== + * Add component.json for browser support (#18) + * Use SVG for badges in README (#16) + * Updating `tape`, `covert` + * Updating travis-ci to work with multiple node versions + * Fix `deep === false` bug (returning target as {}) (#14) + * Fixing constructor checks in isPlainObject + * Adding additional test coverage + * Adding `npm run coverage` + * Add LICENSE (#13) + * Adding a warning about `false`, per #11 + * General style and whitespace cleanup + +1.2.1 / 2013-09-14 +================== + * Fixing hasOwnProperty bugs that would only have shown up in specific browsers. Fixes #8 + * Updating `tape` + +1.2.0 / 2013-09-02 +================== + * Updating the README: add badges + * Adding a missing variable reference. + * Using `tape` instead of `buster` for tests; add more tests (#7) + * Adding node 0.10 to Travis CI (#6) + * Enabling "npm test" and cleaning up package.json (#5) + * Add Travis CI. + +1.1.3 / 2012-12-06 +================== + * Added unit tests. + * Ensure extend function is named. (Looks nicer in a stack trace.) + * README cleanup. + +1.1.1 / 2012-11-07 +================== + * README cleanup. + * Added installation instructions. + * Added a missing semicolon + +1.0.0 / 2012-04-08 +================== + * Initial commit + diff --git a/node_modules/extend/LICENSE b/node_modules/extend/LICENSE new file mode 100644 index 0000000..e16d6a5 --- /dev/null +++ b/node_modules/extend/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) 2014 Stefan Thomas + +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. + diff --git a/node_modules/extend/README.md b/node_modules/extend/README.md new file mode 100644 index 0000000..5b8249a --- /dev/null +++ b/node_modules/extend/README.md @@ -0,0 +1,81 @@ +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] + +# extend() for Node.js [![Version Badge][npm-version-png]][npm-url] + +`node-extend` is a port of the classic extend() method from jQuery. It behaves as you expect. It is simple, tried and true. + +Notes: + +* Since Node.js >= 4, + [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) + now offers the same functionality natively (but without the "deep copy" option). + See [ECMAScript 2015 (ES6) in Node.js](https://nodejs.org/en/docs/es6). +* Some native implementations of `Object.assign` in both Node.js and many + browsers (since NPM modules are for the browser too) may not be fully + spec-compliant. + Check [`object.assign`](https://www.npmjs.com/package/object.assign) module for + a compliant candidate. + +## Installation + +This package is available on [npm][npm-url] as: `extend` + +``` sh +npm install extend +``` + +## Usage + +**Syntax:** extend **(** [`deep`], `target`, `object1`, [`objectN`] **)** + +*Extend one object with one or more others, returning the modified object.* + +**Example:** + +``` js +var extend = require('extend'); +extend(targetObject, object1, object2); +``` + +Keep in mind that the target object will be modified, and will be returned from extend(). + +If a boolean true is specified as the first argument, extend performs a deep copy, recursively copying any objects it finds. Otherwise, the copy will share structure with the original object(s). +Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over. +Warning: passing `false` as the first argument is not supported. + +### Arguments + +* `deep` *Boolean* (optional) +If set, the merge becomes recursive (i.e. deep copy). +* `target` *Object* +The object to extend. +* `object1` *Object* +The object that will be merged into the first. +* `objectN` *Object* (Optional) +More objects to merge into the first. + +## License + +`node-extend` is licensed under the [MIT License][mit-license-url]. + +## Acknowledgements + +All credit to the jQuery authors for perfecting this amazing utility. + +Ported to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jonathan Buchanan][github-insin] and [Jordan Harband][github-ljharb]. + +[travis-svg]: https://travis-ci.org/justmoon/node-extend.svg +[travis-url]: https://travis-ci.org/justmoon/node-extend +[npm-url]: https://npmjs.org/package/extend +[mit-license-url]: http://opensource.org/licenses/MIT +[github-justmoon]: https://github.com/justmoon +[github-insin]: https://github.com/insin +[github-ljharb]: https://github.com/ljharb +[npm-version-png]: http://versionbadg.es/justmoon/node-extend.svg +[deps-svg]: https://david-dm.org/justmoon/node-extend.svg +[deps-url]: https://david-dm.org/justmoon/node-extend +[dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg +[dev-deps-url]: https://david-dm.org/justmoon/node-extend#info=devDependencies + diff --git a/node_modules/extend/component.json b/node_modules/extend/component.json new file mode 100644 index 0000000..1500a2f --- /dev/null +++ b/node_modules/extend/component.json @@ -0,0 +1,32 @@ +{ + "name": "extend", + "author": "Stefan Thomas (http://www.justmoon.net)", + "version": "3.0.0", + "description": "Port of jQuery.extend for node.js and the browser.", + "scripts": [ + "index.js" + ], + "contributors": [ + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "keywords": [ + "extend", + "clone", + "merge" + ], + "repository" : { + "type": "git", + "url": "https://github.com/justmoon/node-extend.git" + }, + "dependencies": { + }, + "devDependencies": { + "tape" : "~3.0.0", + "covert": "~0.4.0", + "jscs": "~1.6.2" + } +} + diff --git a/node_modules/extend/index.js b/node_modules/extend/index.js new file mode 100644 index 0000000..2aa3faa --- /dev/null +++ b/node_modules/extend/index.js @@ -0,0 +1,117 @@ +'use strict'; + +var hasOwn = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; +var defineProperty = Object.defineProperty; +var gOPD = Object.getOwnPropertyDescriptor; + +var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; +}; + +var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) { /**/ } + + return typeof key === 'undefined' || hasOwn.call(obj, key); +}; + +// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target +var setProperty = function setProperty(target, options) { + if (defineProperty && options.name === '__proto__') { + defineProperty(target, options.name, { + enumerable: true, + configurable: true, + value: options.newValue, + writable: true + }); + } else { + target[options.name] = options.newValue; + } +}; + +// Return undefined instead of __proto__ if '__proto__' is not an own property +var getProperty = function getProperty(obj, name) { + if (name === '__proto__') { + if (!hasOwn.call(obj, name)) { + return void 0; + } else if (gOPD) { + // In early versions of node, obj['__proto__'] is buggy when obj has + // __proto__ as an own property. Object.getOwnPropertyDescriptor() works. + return gOPD(obj, name).value; + } + } + + return obj[name]; +}; + +module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = getProperty(target, name); + copy = getProperty(options, name); + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + setProperty(target, { name: name, newValue: extend(deep, clone, copy) }); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + setProperty(target, { name: name, newValue: copy }); + } + } + } + } + } + + // Return the modified object + return target; +}; diff --git a/node_modules/extend/package.json b/node_modules/extend/package.json new file mode 100644 index 0000000..3f66474 --- /dev/null +++ b/node_modules/extend/package.json @@ -0,0 +1,76 @@ +{ + "_from": "extend@^3.0.0", + "_id": "extend@3.0.2", + "_inBundle": false, + "_integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "_location": "/extend", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "extend@^3.0.0", + "name": "extend", + "escapedName": "extend", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/glob-stream", + "/liftoff" + ], + "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "_shasum": "f8b1136b4071fbd8eb140aff858b1019ec2915fa", + "_spec": "extend@^3.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/liftoff", + "author": { + "name": "Stefan Thomas", + "email": "justmoon@members.fsf.org", + "url": "http://www.justmoon.net" + }, + "bugs": { + "url": "https://github.com/justmoon/node-extend/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Port of jQuery.extend for node.js and the browser", + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "covert": "^1.1.0", + "eslint": "^4.19.1", + "jscs": "^3.0.7", + "tape": "^4.9.1" + }, + "homepage": "https://github.com/justmoon/node-extend#readme", + "keywords": [ + "extend", + "clone", + "merge" + ], + "license": "MIT", + "main": "index", + "name": "extend", + "repository": { + "type": "git", + "url": "git+https://github.com/justmoon/node-extend.git" + }, + "scripts": { + "coverage": "covert test/index.js", + "coverage-quiet": "covert test/index.js --quiet", + "eslint": "eslint *.js */*.js", + "jscs": "jscs *.js */*.js", + "lint": "npm run jscs && npm run eslint", + "posttest": "npm run coverage-quiet", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "node test" + }, + "version": "3.0.2" +} diff --git a/node_modules/extglob/LICENSE b/node_modules/extglob/LICENSE new file mode 100644 index 0000000..e33d14b --- /dev/null +++ b/node_modules/extglob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +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. diff --git a/node_modules/extglob/README.md b/node_modules/extglob/README.md new file mode 100644 index 0000000..3255ea2 --- /dev/null +++ b/node_modules/extglob/README.md @@ -0,0 +1,362 @@ +# extglob [![NPM version](https://img.shields.io/npm/v/extglob.svg?style=flat)](https://www.npmjs.com/package/extglob) [![NPM monthly downloads](https://img.shields.io/npm/dm/extglob.svg?style=flat)](https://npmjs.org/package/extglob) [![NPM total downloads](https://img.shields.io/npm/dt/extglob.svg?style=flat)](https://npmjs.org/package/extglob) [![Linux Build Status](https://img.shields.io/travis/micromatch/extglob.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/extglob) [![Windows Build Status](https://img.shields.io/appveyor/ci/micromatch/extglob.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/micromatch/extglob) + +> Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save extglob +``` + +* Convert an extglob string to a regex-compatible string. +* More complete (and correct) support than [minimatch](https://github.com/isaacs/minimatch) (minimatch fails a large percentage of the extglob tests) +* Handles [negation patterns](#extglob-patterns) +* Handles [nested patterns](#extglob-patterns) +* Organized code base, easy to maintain and make changes when edge cases arise +* As you can see by the [benchmarks](#benchmarks), extglob doesn't pay with speed for it's completeness, accuracy and quality. + +**Heads up!**: This library only supports extglobs, to handle full glob patterns and other extended globbing features use [micromatch](https://github.com/jonschlinkert/micromatch) instead. + +## Usage + +The main export is a function that takes a string and options, and returns an object with the parsed AST and the compiled `.output`, which is a regex-compatible string that can be used for matching. + +```js +var extglob = require('extglob'); +console.log(extglob('!(xyz)*.js')); +``` + +## Extglob cheatsheet + +Extended globbing patterns can be defined as follows (as described by the [bash man page](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html)): + +| **pattern** | **regex equivalent** | **description** | +| --- | --- | --- | +| `?(pattern-list)` | `(...|...)?` | Matches zero or one occurrence of the given pattern(s) | +| `*(pattern-list)` | `(...|...)*` | Matches zero or more occurrences of the given pattern(s) | +| `+(pattern-list)` | `(...|...)+` | Matches one or more occurrences of the given pattern(s) | +| `@(pattern-list)` | `(...|...)` [1] | Matches one of the given pattern(s) | +| `!(pattern-list)` | N/A | Matches anything except one of the given pattern(s) | + +## API + +### [extglob](index.js#L36) + +Convert the given `extglob` pattern into a regex-compatible string. Returns an object with the compiled result and the parsed AST. + +**Params** + +* `pattern` **{String}** +* `options` **{Object}** +* `returns` **{String}** + +**Example** + +```js +var extglob = require('extglob'); +console.log(extglob('*.!(*a)')); +//=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?' +``` + +### [.match](index.js#L56) + +Takes an array of strings and an extglob pattern and returns a new array that contains only the strings that match the pattern. + +**Params** + +* `list` **{Array}**: Array of strings to match +* `pattern` **{String}**: Extglob pattern +* `options` **{Object}** +* `returns` **{Array}**: Returns an array of matches + +**Example** + +```js +var extglob = require('extglob'); +console.log(extglob.match(['a.a', 'a.b', 'a.c'], '*.!(*a)')); +//=> ['a.b', 'a.c'] +``` + +### [.isMatch](index.js#L111) + +Returns true if the specified `string` matches the given extglob `pattern`. + +**Params** + +* `string` **{String}**: String to match +* `pattern` **{String}**: Extglob pattern +* `options` **{String}** +* `returns` **{Boolean}** + +**Example** + +```js +var extglob = require('extglob'); + +console.log(extglob.isMatch('a.a', '*.!(*a)')); +//=> false +console.log(extglob.isMatch('a.b', '*.!(*a)')); +//=> true +``` + +### [.contains](index.js#L150) + +Returns true if the given `string` contains the given pattern. Similar to `.isMatch` but the pattern can match any part of the string. + +**Params** + +* `str` **{String}**: The string to match. +* `pattern` **{String}**: Glob pattern to use for matching. +* `options` **{Object}** +* `returns` **{Boolean}**: Returns true if the patter matches any part of `str`. + +**Example** + +```js +var extglob = require('extglob'); +console.log(extglob.contains('aa/bb/cc', '*b')); +//=> true +console.log(extglob.contains('aa/bb/cc', '*d')); +//=> false +``` + +### [.matcher](index.js#L184) + +Takes an extglob pattern and returns a matcher function. The returned function takes the string to match as its only argument. + +**Params** + +* `pattern` **{String}**: Extglob pattern +* `options` **{String}** +* `returns` **{Boolean}** + +**Example** + +```js +var extglob = require('extglob'); +var isMatch = extglob.matcher('*.!(*a)'); + +console.log(isMatch('a.a')); +//=> false +console.log(isMatch('a.b')); +//=> true +``` + +### [.create](index.js#L214) + +Convert the given `extglob` pattern into a regex-compatible string. Returns an object with the compiled result and the parsed AST. + +**Params** + +* `str` **{String}** +* `options` **{Object}** +* `returns` **{String}** + +**Example** + +```js +var extglob = require('extglob'); +console.log(extglob.create('*.!(*a)').output); +//=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?' +``` + +### [.capture](index.js#L248) + +Returns an array of matches captured by `pattern` in `string`, or `null` if the pattern did not match. + +**Params** + +* `pattern` **{String}**: Glob pattern to use for matching. +* `string` **{String}**: String to match +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns an array of captures if the string matches the glob pattern, otherwise `null`. + +**Example** + +```js +var extglob = require('extglob'); +extglob.capture(pattern, string[, options]); + +console.log(extglob.capture('test/*.js', 'test/foo.js')); +//=> ['foo'] +console.log(extglob.capture('test/*.js', 'foo/bar.css')); +//=> null +``` + +### [.makeRe](index.js#L281) + +Create a regular expression from the given `pattern` and `options`. + +**Params** + +* `pattern` **{String}**: The pattern to convert to regex. +* `options` **{Object}** +* `returns` **{RegExp}** + +**Example** + +```js +var extglob = require('extglob'); +var re = extglob.makeRe('*.!(*a)'); +console.log(re); +//=> /^[^\/]*?\.(?![^\/]*?a)[^\/]*?$/ +``` + +## Options + +Available options are based on the options from Bash (and the option names used in bash). + +### options.nullglob + +**Type**: `boolean` + +**Default**: `undefined` + +When enabled, the pattern itself will be returned when no matches are found. + +### options.nonull + +Alias for [options.nullglob](#optionsnullglob), included for parity with minimatch. + +### options.cache + +**Type**: `boolean` + +**Default**: `undefined` + +Functions are memoized based on the given glob patterns and options. Disable memoization by setting `options.cache` to false. + +### options.failglob + +**Type**: `boolean` + +**Default**: `undefined` + +Throw an error is no matches are found. + +## Benchmarks + +Last run on December 21, 2017 + +```sh +# negation-nested (49 bytes) + extglob x 2,228,255 ops/sec ±0.98% (89 runs sampled) + minimatch x 207,875 ops/sec ±0.61% (91 runs sampled) + + fastest is extglob (by 1072% avg) + +# negation-simple (43 bytes) + extglob x 2,205,668 ops/sec ±1.00% (91 runs sampled) + minimatch x 311,923 ops/sec ±1.25% (91 runs sampled) + + fastest is extglob (by 707% avg) + +# range-false (57 bytes) + extglob x 2,263,877 ops/sec ±0.40% (94 runs sampled) + minimatch x 271,372 ops/sec ±1.02% (91 runs sampled) + + fastest is extglob (by 834% avg) + +# range-true (56 bytes) + extglob x 2,161,891 ops/sec ±0.41% (92 runs sampled) + minimatch x 268,265 ops/sec ±1.17% (91 runs sampled) + + fastest is extglob (by 806% avg) + +# star-simple (46 bytes) + extglob x 2,211,081 ops/sec ±0.49% (92 runs sampled) + minimatch x 343,319 ops/sec ±0.59% (91 runs sampled) + + fastest is extglob (by 644% avg) + +``` + +## Differences from Bash + +This library has complete parity with Bash 4.3 with only a couple of minor differences. + +* In some cases Bash returns true if the given string "contains" the pattern, whereas this library returns true if the string is an exact match for the pattern. You can relax this by setting `options.contains` to true. +* This library is more accurate than Bash and thus does not fail some of the tests that Bash 4.3 still lists as failing in their unit tests + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [braces](https://www.npmjs.com/package/braces): Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support… [more](https://github.com/micromatch/braces) | [homepage](https://github.com/micromatch/braces "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.") +* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.") +* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used by [micromatch].") +* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 49 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [isiahmeadows](https://github.com/isiahmeadows) | +| 1 | [doowb](https://github.com/doowb) | +| 1 | [devongovett](https://github.com/devongovett) | +| 1 | [mjbvz](https://github.com/mjbvz) | +| 1 | [shinnn](https://github.com/shinnn) | + +### Author + +**Jon Schlinkert** + +* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 21, 2017._ + +
+
+
    +
  1. `@` isn "'t a RegEx character." + +
  2. +
+
\ No newline at end of file diff --git a/node_modules/extglob/changelog.md b/node_modules/extglob/changelog.md new file mode 100644 index 0000000..c9fc4fc --- /dev/null +++ b/node_modules/extglob/changelog.md @@ -0,0 +1,25 @@ +## Changelog + +### v2.0.0 + +**Added features** + +- Adds [.capture](readme.md#capture) method for capturing matches, thanks to [devongovett](https://github.com/devongovett) + + +### v1.0.0 + +**Breaking changes** + +- The main export now returns the compiled string, instead of the object returned from the compiler + +**Added features** + +- Adds a `.create` method to do what the main function did before v1.0.0 + +**Other changes** + +- adds `expand-brackets` parsers/compilers to handle nested brackets and extglobs +- uses `to-regex` to build regex for `makeRe` method +- improves coverage +- optimizations \ No newline at end of file diff --git a/node_modules/extglob/index.js b/node_modules/extglob/index.js new file mode 100644 index 0000000..116e6d5 --- /dev/null +++ b/node_modules/extglob/index.js @@ -0,0 +1,331 @@ +'use strict'; + +/** + * Module dependencies + */ + +var extend = require('extend-shallow'); +var unique = require('array-unique'); +var toRegex = require('to-regex'); + +/** + * Local dependencies + */ + +var compilers = require('./lib/compilers'); +var parsers = require('./lib/parsers'); +var Extglob = require('./lib/extglob'); +var utils = require('./lib/utils'); +var MAX_LENGTH = 1024 * 64; + +/** + * Convert the given `extglob` pattern into a regex-compatible string. Returns + * an object with the compiled result and the parsed AST. + * + * ```js + * var extglob = require('extglob'); + * console.log(extglob('*.!(*a)')); + * //=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?' + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {String} + * @api public + */ + +function extglob(pattern, options) { + return extglob.create(pattern, options).output; +} + +/** + * Takes an array of strings and an extglob pattern and returns a new + * array that contains only the strings that match the pattern. + * + * ```js + * var extglob = require('extglob'); + * console.log(extglob.match(['a.a', 'a.b', 'a.c'], '*.!(*a)')); + * //=> ['a.b', 'a.c'] + * ``` + * @param {Array} `list` Array of strings to match + * @param {String} `pattern` Extglob pattern + * @param {Object} `options` + * @return {Array} Returns an array of matches + * @api public + */ + +extglob.match = function(list, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected pattern to be a string'); + } + + list = utils.arrayify(list); + var isMatch = extglob.matcher(pattern, options); + var len = list.length; + var idx = -1; + var matches = []; + + while (++idx < len) { + var ele = list[idx]; + + if (isMatch(ele)) { + matches.push(ele); + } + } + + // if no options were passed, uniquify results and return + if (typeof options === 'undefined') { + return unique(matches); + } + + if (matches.length === 0) { + if (options.failglob === true) { + throw new Error('no matches found for "' + pattern + '"'); + } + if (options.nonull === true || options.nullglob === true) { + return [pattern.split('\\').join('')]; + } + } + + return options.nodupes !== false ? unique(matches) : matches; +}; + +/** + * Returns true if the specified `string` matches the given + * extglob `pattern`. + * + * ```js + * var extglob = require('extglob'); + * + * console.log(extglob.isMatch('a.a', '*.!(*a)')); + * //=> false + * console.log(extglob.isMatch('a.b', '*.!(*a)')); + * //=> true + * ``` + * @param {String} `string` String to match + * @param {String} `pattern` Extglob pattern + * @param {String} `options` + * @return {Boolean} + * @api public + */ + +extglob.isMatch = function(str, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected pattern to be a string'); + } + + if (typeof str !== 'string') { + throw new TypeError('expected a string'); + } + + if (pattern === str) { + return true; + } + + if (pattern === '' || pattern === ' ' || pattern === '.') { + return pattern === str; + } + + var isMatch = utils.memoize('isMatch', pattern, options, extglob.matcher); + return isMatch(str); +}; + +/** + * Returns true if the given `string` contains the given pattern. Similar to `.isMatch` but + * the pattern can match any part of the string. + * + * ```js + * var extglob = require('extglob'); + * console.log(extglob.contains('aa/bb/cc', '*b')); + * //=> true + * console.log(extglob.contains('aa/bb/cc', '*d')); + * //=> false + * ``` + * @param {String} `str` The string to match. + * @param {String} `pattern` Glob pattern to use for matching. + * @param {Object} `options` + * @return {Boolean} Returns true if the patter matches any part of `str`. + * @api public + */ + +extglob.contains = function(str, pattern, options) { + if (typeof str !== 'string') { + throw new TypeError('expected a string'); + } + + if (pattern === '' || pattern === ' ' || pattern === '.') { + return pattern === str; + } + + var opts = extend({}, options, {contains: true}); + opts.strictClose = false; + opts.strictOpen = false; + return extglob.isMatch(str, pattern, opts); +}; + +/** + * Takes an extglob pattern and returns a matcher function. The returned + * function takes the string to match as its only argument. + * + * ```js + * var extglob = require('extglob'); + * var isMatch = extglob.matcher('*.!(*a)'); + * + * console.log(isMatch('a.a')); + * //=> false + * console.log(isMatch('a.b')); + * //=> true + * ``` + * @param {String} `pattern` Extglob pattern + * @param {String} `options` + * @return {Boolean} + * @api public + */ + +extglob.matcher = function(pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected pattern to be a string'); + } + + function matcher() { + var re = extglob.makeRe(pattern, options); + return function(str) { + return re.test(str); + }; + } + + return utils.memoize('matcher', pattern, options, matcher); +}; + +/** + * Convert the given `extglob` pattern into a regex-compatible string. Returns + * an object with the compiled result and the parsed AST. + * + * ```js + * var extglob = require('extglob'); + * console.log(extglob.create('*.!(*a)').output); + * //=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?' + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {String} + * @api public + */ + +extglob.create = function(pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected pattern to be a string'); + } + + function create() { + var ext = new Extglob(options); + var ast = ext.parse(pattern, options); + return ext.compile(ast, options); + } + + return utils.memoize('create', pattern, options, create); +}; + +/** + * Returns an array of matches captured by `pattern` in `string`, or `null` + * if the pattern did not match. + * + * ```js + * var extglob = require('extglob'); + * extglob.capture(pattern, string[, options]); + * + * console.log(extglob.capture('test/*.js', 'test/foo.js')); + * //=> ['foo'] + * console.log(extglob.capture('test/*.js', 'foo/bar.css')); + * //=> null + * ``` + * @param {String} `pattern` Glob pattern to use for matching. + * @param {String} `string` String to match + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`. + * @api public + */ + +extglob.capture = function(pattern, str, options) { + var re = extglob.makeRe(pattern, extend({capture: true}, options)); + + function match() { + return function(string) { + var match = re.exec(string); + if (!match) { + return null; + } + + return match.slice(1); + }; + } + + var capture = utils.memoize('capture', pattern, options, match); + return capture(str); +}; + +/** + * Create a regular expression from the given `pattern` and `options`. + * + * ```js + * var extglob = require('extglob'); + * var re = extglob.makeRe('*.!(*a)'); + * console.log(re); + * //=> /^[^\/]*?\.(?![^\/]*?a)[^\/]*?$/ + * ``` + * @param {String} `pattern` The pattern to convert to regex. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +extglob.makeRe = function(pattern, options) { + if (pattern instanceof RegExp) { + return pattern; + } + + if (typeof pattern !== 'string') { + throw new TypeError('expected pattern to be a string'); + } + + if (pattern.length > MAX_LENGTH) { + throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); + } + + function makeRe() { + var opts = extend({strictErrors: false}, options); + if (opts.strictErrors === true) opts.strict = true; + var res = extglob.create(pattern, opts); + return toRegex(res.output, opts); + } + + var regex = utils.memoize('makeRe', pattern, options, makeRe); + if (regex.source.length > MAX_LENGTH) { + throw new SyntaxError('potentially malicious regex detected'); + } + + return regex; +}; + +/** + * Cache + */ + +extglob.cache = utils.cache; +extglob.clearCache = function() { + extglob.cache.__data__ = {}; +}; + +/** + * Expose `Extglob` constructor, parsers and compilers + */ + +extglob.Extglob = Extglob; +extglob.compilers = compilers; +extglob.parsers = parsers; + +/** + * Expose `extglob` + * @type {Function} + */ + +module.exports = extglob; diff --git a/node_modules/extglob/lib/.DS_Store b/node_modules/extglob/lib/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 1) { + val += '{' + node.val.length + '}'; + } + return this.emit(val, node); + }) + + /** + * Plus: "+" + */ + + .set('plus', function(node) { + var prev = node.parsed.slice(-1); + if (prev === ']' || prev === ')') { + return this.emit(node.val, node); + } + var ch = this.output.slice(-1); + if (!this.output || (/[?*+]/.test(ch) && node.parent.type !== 'bracket')) { + return this.emit('\\+', node); + } + if (/\w/.test(ch) && !node.inside) { + return this.emit('+\\+?', node); + } + return this.emit('+', node); + }) + + /** + * Star: "*" + */ + + .set('star', function(node) { + var prev = this.prev(); + var prefix = prev.type !== 'text' && prev.type !== 'escape' + ? '(?!\\.)' + : ''; + + return this.emit(prefix + star.call(this, node), node); + }) + + /** + * Parens + */ + + .set('paren', function(node) { + return this.mapVisit(node.nodes); + }) + .set('paren.open', function(node) { + var capture = this.options.capture ? '(' : ''; + + switch (node.parent.prefix) { + case '!': + case '^': + return this.emit(capture + '(?:(?!(?:', node); + case '*': + case '+': + case '?': + case '@': + return this.emit(capture + '(?:', node); + default: { + var val = node.val; + if (this.options.bash === true) { + val = '\\' + val; + } else if (!this.options.capture && val === '(' && node.parent.rest[0] !== '?') { + val += '?:'; + } + + return this.emit(val, node); + } + } + }) + .set('paren.close', function(node) { + var capture = this.options.capture ? ')' : ''; + + switch (node.prefix) { + case '!': + case '^': + var prefix = /^(\)|$)/.test(node.rest) ? '$' : ''; + var str = star.call(this, node); + + // if the extglob has a slash explicitly defined, we know the user wants + // to match slashes, so we need to ensure the "star" regex allows for it + if (node.parent.hasSlash && !this.options.star && this.options.slash !== false) { + str = '.*?'; + } + + return this.emit(prefix + ('))' + str + ')') + capture, node); + case '*': + case '+': + case '?': + return this.emit(')' + node.prefix + capture, node); + case '@': + return this.emit(')' + capture, node); + default: { + var val = (this.options.bash === true ? '\\' : '') + ')'; + return this.emit(val, node); + } + } + }) + + /** + * Text + */ + + .set('text', function(node) { + var val = node.val.replace(/[\[\]]/g, '\\$&'); + return this.emit(val, node); + }); +}; diff --git a/node_modules/extglob/lib/extglob.js b/node_modules/extglob/lib/extglob.js new file mode 100644 index 0000000..015f928 --- /dev/null +++ b/node_modules/extglob/lib/extglob.js @@ -0,0 +1,78 @@ +'use strict'; + +/** + * Module dependencies + */ + +var Snapdragon = require('snapdragon'); +var define = require('define-property'); +var extend = require('extend-shallow'); + +/** + * Local dependencies + */ + +var compilers = require('./compilers'); +var parsers = require('./parsers'); + +/** + * Customize Snapdragon parser and renderer + */ + +function Extglob(options) { + this.options = extend({source: 'extglob'}, options); + this.snapdragon = this.options.snapdragon || new Snapdragon(this.options); + this.snapdragon.patterns = this.snapdragon.patterns || {}; + this.compiler = this.snapdragon.compiler; + this.parser = this.snapdragon.parser; + + compilers(this.snapdragon); + parsers(this.snapdragon); + + /** + * Override Snapdragon `.parse` method + */ + + define(this.snapdragon, 'parse', function(str, options) { + var parsed = Snapdragon.prototype.parse.apply(this, arguments); + parsed.input = str; + + // escape unmatched brace/bracket/parens + var last = this.parser.stack.pop(); + if (last && this.options.strict !== true) { + var node = last.nodes[0]; + node.val = '\\' + node.val; + var sibling = node.parent.nodes[1]; + if (sibling.type === 'star') { + sibling.loose = true; + } + } + + // add non-enumerable parser reference + define(parsed, 'parser', this.parser); + return parsed; + }); + + /** + * Decorate `.parse` method + */ + + define(this, 'parse', function(ast, options) { + return this.snapdragon.parse.apply(this.snapdragon, arguments); + }); + + /** + * Decorate `.compile` method + */ + + define(this, 'compile', function(ast, options) { + return this.snapdragon.compile.apply(this.snapdragon, arguments); + }); + +} + +/** + * Expose `Extglob` + */ + +module.exports = Extglob; diff --git a/node_modules/extglob/lib/parsers.js b/node_modules/extglob/lib/parsers.js new file mode 100644 index 0000000..2ba7352 --- /dev/null +++ b/node_modules/extglob/lib/parsers.js @@ -0,0 +1,156 @@ +'use strict'; + +var brackets = require('expand-brackets'); +var define = require('define-property'); +var utils = require('./utils'); + +/** + * Characters to use in text regex (we want to "not" match + * characters that are matched by other parsers) + */ + +var TEXT_REGEX = '([!@*?+]?\\(|\\)|[*?.+\\\\]|\\[:?(?=.*\\])|:?\\])+'; +var not = utils.createRegex(TEXT_REGEX); + +/** + * Extglob parsers + */ + +function parsers(extglob) { + extglob.state = extglob.state || {}; + + /** + * Use `expand-brackets` parsers + */ + + extglob.use(brackets.parsers); + extglob.parser.sets.paren = extglob.parser.sets.paren || []; + extglob.parser + + /** + * Extglob open: "*(" + */ + + .capture('paren.open', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^([!@*?+])?\(/); + if (!m) return; + + var prev = this.prev(); + var prefix = m[1]; + var val = m[0]; + + var open = pos({ + type: 'paren.open', + parsed: parsed, + val: val + }); + + var node = pos({ + type: 'paren', + prefix: prefix, + nodes: [open] + }); + + // if nested negation extglobs, just cancel them out to simplify + if (prefix === '!' && prev.type === 'paren' && prev.prefix === '!') { + prev.prefix = '@'; + node.prefix = '@'; + } + + define(node, 'rest', this.input); + define(node, 'parsed', parsed); + define(node, 'parent', prev); + define(open, 'parent', node); + + this.push('paren', node); + prev.nodes.push(node); + }) + + /** + * Extglob close: ")" + */ + + .capture('paren.close', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^\)/); + if (!m) return; + + var parent = this.pop('paren'); + var node = pos({ + type: 'paren.close', + rest: this.input, + parsed: parsed, + val: m[0] + }); + + if (!this.isType(parent, 'paren')) { + if (this.options.strict) { + throw new Error('missing opening paren: "("'); + } + node.escaped = true; + return node; + } + + node.prefix = parent.prefix; + parent.nodes.push(node); + define(node, 'parent', parent); + }) + + /** + * Escape: "\\." + */ + + .capture('escape', function() { + var pos = this.position(); + var m = this.match(/^\\(.)/); + if (!m) return; + + return pos({ + type: 'escape', + val: m[0], + ch: m[1] + }); + }) + + /** + * Question marks: "?" + */ + + .capture('qmark', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^\?+(?!\()/); + if (!m) return; + extglob.state.metachar = true; + return pos({ + type: 'qmark', + rest: this.input, + parsed: parsed, + val: m[0] + }); + }) + + /** + * Character parsers + */ + + .capture('star', /^\*(?!\()/) + .capture('plus', /^\+(?!\()/) + .capture('dot', /^\./) + .capture('text', not); +}; + +/** + * Expose text regex string + */ + +module.exports.TEXT_REGEX = TEXT_REGEX; + +/** + * Extglob parsers + */ + +module.exports = parsers; diff --git a/node_modules/extglob/lib/utils.js b/node_modules/extglob/lib/utils.js new file mode 100644 index 0000000..37a59fb --- /dev/null +++ b/node_modules/extglob/lib/utils.js @@ -0,0 +1,69 @@ +'use strict'; + +var regex = require('regex-not'); +var Cache = require('fragment-cache'); + +/** + * Utils + */ + +var utils = module.exports; +var cache = utils.cache = new Cache(); + +/** + * Cast `val` to an array + * @return {Array} + */ + +utils.arrayify = function(val) { + if (!Array.isArray(val)) { + return [val]; + } + return val; +}; + +/** + * Memoize a generated regex or function + */ + +utils.memoize = function(type, pattern, options, fn) { + var key = utils.createKey(type + pattern, options); + + if (cache.has(type, key)) { + return cache.get(type, key); + } + + var val = fn(pattern, options); + if (options && options.cache === false) { + return val; + } + + cache.set(type, key, val); + return val; +}; + +/** + * Create the key to use for memoization. The key is generated + * by iterating over the options and concatenating key-value pairs + * to the pattern string. + */ + +utils.createKey = function(pattern, options) { + var key = pattern; + if (typeof options === 'undefined') { + return key; + } + for (var prop in options) { + key += ';' + prop + '=' + String(options[prop]); + } + return key; +}; + +/** + * Create the regex to use for matching text + */ + +utils.createRegex = function(str) { + var opts = {contains: true, strictClose: false}; + return regex(str, opts); +}; diff --git a/node_modules/extglob/node_modules/define-property/LICENSE b/node_modules/extglob/node_modules/define-property/LICENSE new file mode 100644 index 0000000..ec85897 --- /dev/null +++ b/node_modules/extglob/node_modules/define-property/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, 2017, Jon Schlinkert + +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. diff --git a/node_modules/extglob/node_modules/define-property/README.md b/node_modules/extglob/node_modules/define-property/README.md new file mode 100644 index 0000000..2f1af05 --- /dev/null +++ b/node_modules/extglob/node_modules/define-property/README.md @@ -0,0 +1,95 @@ +# define-property [![NPM version](https://img.shields.io/npm/v/define-property.svg?style=flat)](https://www.npmjs.com/package/define-property) [![NPM monthly downloads](https://img.shields.io/npm/dm/define-property.svg?style=flat)](https://npmjs.org/package/define-property) [![NPM total downloads](https://img.shields.io/npm/dt/define-property.svg?style=flat)](https://npmjs.org/package/define-property) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/define-property.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/define-property) + +> Define a non-enumerable property on an object. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save define-property +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add define-property +``` + +## Usage + +**Params** + +* `obj`: The object on which to define the property. +* `prop`: The name of the property to be defined or modified. +* `descriptor`: The descriptor for the property being defined or modified. + +```js +var define = require('define-property'); +var obj = {}; +define(obj, 'foo', function(val) { + return val.toUpperCase(); +}); + +console.log(obj); +//=> {} + +console.log(obj.foo('bar')); +//=> 'BAR' +``` + +**get/set** + +```js +define(obj, 'foo', { + get: function() {}, + set: function() {} +}); +``` + +## About + +### Related projects + +* [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target… [more](https://github.com/jonschlinkert/assign-deep) | [homepage](https://github.com/jonschlinkert/assign-deep "Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target (first) object.") +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") +* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") +* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep "Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 20, 2017._ \ No newline at end of file diff --git a/node_modules/extglob/node_modules/define-property/index.js b/node_modules/extglob/node_modules/define-property/index.js new file mode 100644 index 0000000..27c19eb --- /dev/null +++ b/node_modules/extglob/node_modules/define-property/index.js @@ -0,0 +1,31 @@ +/*! + * define-property + * + * Copyright (c) 2015, 2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var isDescriptor = require('is-descriptor'); + +module.exports = function defineProperty(obj, prop, val) { + if (typeof obj !== 'object' && typeof obj !== 'function') { + throw new TypeError('expected an object or function.'); + } + + if (typeof prop !== 'string') { + throw new TypeError('expected `prop` to be a string.'); + } + + if (isDescriptor(val) && ('set' in val || 'get' in val)) { + return Object.defineProperty(obj, prop, val); + } + + return Object.defineProperty(obj, prop, { + configurable: true, + enumerable: false, + writable: true, + value: val + }); +}; diff --git a/node_modules/extglob/node_modules/define-property/package.json b/node_modules/extglob/node_modules/define-property/package.json new file mode 100644 index 0000000..726c761 --- /dev/null +++ b/node_modules/extglob/node_modules/define-property/package.json @@ -0,0 +1,93 @@ +{ + "_from": "define-property@^1.0.0", + "_id": "define-property@1.0.0", + "_inBundle": false, + "_integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "_location": "/extglob/define-property", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "define-property@^1.0.0", + "name": "define-property", + "escapedName": "define-property", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/extglob" + ], + "_resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "_shasum": "769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6", + "_spec": "define-property@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/extglob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/define-property/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "deprecated": false, + "description": "Define a non-enumerable property on an object.", + "devDependencies": { + "gulp-format-md": "^0.1.12", + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/define-property", + "keywords": [ + "define", + "define-property", + "enumerable", + "key", + "non", + "non-enumerable", + "object", + "prop", + "property", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "define-property", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/define-property.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "extend-shallow", + "merge-deep", + "assign-deep", + "mixin-deep" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/node_modules/extglob/node_modules/extend-shallow/LICENSE b/node_modules/extglob/node_modules/extend-shallow/LICENSE new file mode 100644 index 0000000..fa30c4c --- /dev/null +++ b/node_modules/extglob/node_modules/extend-shallow/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +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. diff --git a/node_modules/extglob/node_modules/extend-shallow/README.md b/node_modules/extglob/node_modules/extend-shallow/README.md new file mode 100644 index 0000000..cdc45d4 --- /dev/null +++ b/node_modules/extglob/node_modules/extend-shallow/README.md @@ -0,0 +1,61 @@ +# extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow) + +> Extend an object with the properties of additional objects. node.js/javascript util. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i extend-shallow --save +``` + +## Usage + +```js +var extend = require('extend-shallow'); + +extend({a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +Pass an empty object to shallow clone: + +```js +var obj = {}; +extend(obj, {a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +## Related + +* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. +* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) +* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) +* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. +* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. +* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._ \ No newline at end of file diff --git a/node_modules/extglob/node_modules/extend-shallow/index.js b/node_modules/extglob/node_modules/extend-shallow/index.js new file mode 100644 index 0000000..92a067f --- /dev/null +++ b/node_modules/extglob/node_modules/extend-shallow/index.js @@ -0,0 +1,33 @@ +'use strict'; + +var isObject = require('is-extendable'); + +module.exports = function extend(o/*, objects*/) { + if (!isObject(o)) { o = {}; } + + var len = arguments.length; + for (var i = 1; i < len; i++) { + var obj = arguments[i]; + + if (isObject(obj)) { + assign(o, obj); + } + } + return o; +}; + +function assign(a, b) { + for (var key in b) { + if (hasOwn(b, key)) { + a[key] = b[key]; + } + } +} + +/** + * Returns true if the given `key` is an own property of `obj`. + */ + +function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} diff --git a/node_modules/extglob/node_modules/extend-shallow/package.json b/node_modules/extglob/node_modules/extend-shallow/package.json new file mode 100644 index 0000000..60d7dc2 --- /dev/null +++ b/node_modules/extglob/node_modules/extend-shallow/package.json @@ -0,0 +1,87 @@ +{ + "_from": "extend-shallow@^2.0.1", + "_id": "extend-shallow@2.0.1", + "_inBundle": false, + "_integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "_location": "/extglob/extend-shallow", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "extend-shallow@^2.0.1", + "name": "extend-shallow", + "escapedName": "extend-shallow", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/extglob" + ], + "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "_shasum": "51af7d614ad9a9f610ea1bafbb989d6b1c56890f", + "_spec": "extend-shallow@^2.0.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/extglob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/extend-shallow/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "deprecated": false, + "description": "Extend an object with the properties of additional objects. node.js/javascript util.", + "devDependencies": { + "array-slice": "^0.2.3", + "benchmarked": "^0.1.4", + "chalk": "^1.0.0", + "for-own": "^0.1.3", + "glob": "^5.0.12", + "is-plain-object": "^2.0.1", + "kind-of": "^2.0.0", + "minimist": "^1.1.1", + "mocha": "^2.2.5", + "should": "^7.0.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/extend-shallow", + "keywords": [ + "assign", + "extend", + "javascript", + "js", + "keys", + "merge", + "obj", + "object", + "prop", + "properties", + "property", + "props", + "shallow", + "util", + "utility", + "utils", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "extend-shallow", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/extend-shallow.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.0.1" +} diff --git a/node_modules/extglob/node_modules/is-accessor-descriptor/LICENSE b/node_modules/extglob/node_modules/is-accessor-descriptor/LICENSE new file mode 100644 index 0000000..e33d14b --- /dev/null +++ b/node_modules/extglob/node_modules/is-accessor-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +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. diff --git a/node_modules/extglob/node_modules/is-accessor-descriptor/README.md b/node_modules/extglob/node_modules/is-accessor-descriptor/README.md new file mode 100644 index 0000000..d198e1f --- /dev/null +++ b/node_modules/extglob/node_modules/is-accessor-descriptor/README.md @@ -0,0 +1,144 @@ +# is-accessor-descriptor [![NPM version](https://img.shields.io/npm/v/is-accessor-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-accessor-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-accessor-descriptor.svg?style=flat)](https://npmjs.org/package/is-accessor-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-accessor-descriptor.svg?style=flat)](https://npmjs.org/package/is-accessor-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-accessor-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-accessor-descriptor) + +> Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-accessor-descriptor +``` + +## Usage + +```js +var isAccessor = require('is-accessor-descriptor'); + +isAccessor({get: function() {}}); +//=> true +``` + +You may also pass an object and property name to check if the property is an accessor: + +```js +isAccessor(foo, 'bar'); +``` + +## Examples + +`false` when not an object + +```js +isAccessor('a') +isAccessor(null) +isAccessor([]) +//=> false +``` + +`true` when the object has valid properties + +and the properties all have the correct JavaScript types: + +```js +isAccessor({get: noop, set: noop}) +isAccessor({get: noop}) +isAccessor({set: noop}) +//=> true +``` + +`false` when the object has invalid properties + +```js +isAccessor({get: noop, set: noop, bar: 'baz'}) +isAccessor({get: noop, writable: true}) +isAccessor({get: noop, value: true}) +//=> false +``` + +`false` when an accessor is not a function + +```js +isAccessor({get: noop, set: 'baz'}) +isAccessor({get: 'foo', set: noop}) +isAccessor({get: 'foo', bar: 'baz'}) +isAccessor({get: 'foo', set: 'baz'}) +//=> false +``` + +`false` when a value is not the correct type + +```js +isAccessor({get: noop, set: noop, enumerable: 'foo'}) +isAccessor({set: noop, configurable: 'foo'}) +isAccessor({get: noop, configurable: 'foo'}) +//=> false +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") +* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") +* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 22 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [realityking](https://github.com/realityking) | + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 01, 2017._ \ No newline at end of file diff --git a/node_modules/extglob/node_modules/is-accessor-descriptor/index.js b/node_modules/extglob/node_modules/is-accessor-descriptor/index.js new file mode 100644 index 0000000..d2e6fe8 --- /dev/null +++ b/node_modules/extglob/node_modules/is-accessor-descriptor/index.js @@ -0,0 +1,69 @@ +/*! + * is-accessor-descriptor + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +// accessor descriptor properties +var accessor = { + get: 'function', + set: 'function', + configurable: 'boolean', + enumerable: 'boolean' +}; + +function isAccessorDescriptor(obj, prop) { + if (typeof prop === 'string') { + var val = Object.getOwnPropertyDescriptor(obj, prop); + return typeof val !== 'undefined'; + } + + if (typeOf(obj) !== 'object') { + return false; + } + + if (has(obj, 'value') || has(obj, 'writable')) { + return false; + } + + if (!has(obj, 'get') || typeof obj.get !== 'function') { + return false; + } + + // tldr: it's valid to have "set" be undefined + // "set" might be undefined if `Object.getOwnPropertyDescriptor` + // was used to get the value, and only `get` was defined by the user + if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') { + return false; + } + + for (var key in obj) { + if (!accessor.hasOwnProperty(key)) { + continue; + } + + if (typeOf(obj[key]) === accessor[key]) { + continue; + } + + if (typeof obj[key] !== 'undefined') { + return false; + } + } + return true; +} + +function has(obj, key) { + return {}.hasOwnProperty.call(obj, key); +} + +/** + * Expose `isAccessorDescriptor` + */ + +module.exports = isAccessorDescriptor; diff --git a/node_modules/extglob/node_modules/is-accessor-descriptor/package.json b/node_modules/extglob/node_modules/is-accessor-descriptor/package.json new file mode 100644 index 0000000..be0ce9c --- /dev/null +++ b/node_modules/extglob/node_modules/is-accessor-descriptor/package.json @@ -0,0 +1,110 @@ +{ + "_from": "is-accessor-descriptor@^1.0.0", + "_id": "is-accessor-descriptor@1.0.0", + "_inBundle": false, + "_integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "_location": "/extglob/is-accessor-descriptor", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-accessor-descriptor@^1.0.0", + "name": "is-accessor-descriptor", + "escapedName": "is-accessor-descriptor", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/extglob/is-descriptor" + ], + "_resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "_shasum": "169c2f6d3df1f992618072365c9b0ea1f6878656", + "_spec": "is-accessor-descriptor@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/extglob/node_modules/is-descriptor", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-accessor-descriptor/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Rouven Weßling", + "url": "www.rouvenwessling.de" + } + ], + "dependencies": { + "kind-of": "^6.0.0" + }, + "deprecated": false, + "description": "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-accessor-descriptor", + "keywords": [ + "accessor", + "check", + "data", + "descriptor", + "get", + "getter", + "is", + "keys", + "object", + "properties", + "property", + "set", + "setter", + "type", + "valid", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-accessor-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-accessor-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "is-plain-object", + "isobject" + ] + }, + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/node_modules/extglob/node_modules/is-data-descriptor/LICENSE b/node_modules/extglob/node_modules/is-data-descriptor/LICENSE new file mode 100644 index 0000000..e33d14b --- /dev/null +++ b/node_modules/extglob/node_modules/is-data-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +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. diff --git a/node_modules/extglob/node_modules/is-data-descriptor/README.md b/node_modules/extglob/node_modules/is-data-descriptor/README.md new file mode 100644 index 0000000..42b0714 --- /dev/null +++ b/node_modules/extglob/node_modules/is-data-descriptor/README.md @@ -0,0 +1,161 @@ +# is-data-descriptor [![NPM version](https://img.shields.io/npm/v/is-data-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-data-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-data-descriptor.svg?style=flat)](https://npmjs.org/package/is-data-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-data-descriptor.svg?style=flat)](https://npmjs.org/package/is-data-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-data-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-data-descriptor) + +> Returns true if a value has the characteristics of a valid JavaScript data descriptor. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-data-descriptor +``` + +## Usage + +```js +var isDataDesc = require('is-data-descriptor'); +``` + +## Examples + +`true` when the descriptor has valid properties with valid values. + +```js +// `value` can be anything +isDataDesc({value: 'foo'}) +isDataDesc({value: function() {}}) +isDataDesc({value: true}) +//=> true +``` + +`false` when not an object + +```js +isDataDesc('a') +//=> false +isDataDesc(null) +//=> false +isDataDesc([]) +//=> false +``` + +`false` when the object has invalid properties + +```js +isDataDesc({value: 'foo', bar: 'baz'}) +//=> false +isDataDesc({value: 'foo', bar: 'baz'}) +//=> false +isDataDesc({value: 'foo', get: function(){}}) +//=> false +isDataDesc({get: function(){}, value: 'foo'}) +//=> false +``` + +`false` when a value is not the correct type + +```js +isDataDesc({value: 'foo', enumerable: 'foo'}) +//=> false +isDataDesc({value: 'foo', configurable: 'foo'}) +//=> false +isDataDesc({value: 'foo', writable: 'foo'}) +//=> false +``` + +## Valid properties + +The only valid data descriptor properties are the following: + +* `configurable` (required) +* `enumerable` (required) +* `value` (optional) +* `writable` (optional) + +To be a valid data descriptor, either `value` or `writable` must be defined. + +**Invalid properties** + +A descriptor may have additional _invalid_ properties (an error will **not** be thrown). + +```js +var foo = {}; + +Object.defineProperty(foo, 'bar', { + enumerable: true, + whatever: 'blah', // invalid, but doesn't cause an error + get: function() { + return 'baz'; + } +}); + +console.log(foo.bar); +//=> 'baz' +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") +* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") +* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 21 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [realityking](https://github.com/realityking) | + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 01, 2017._ \ No newline at end of file diff --git a/node_modules/extglob/node_modules/is-data-descriptor/index.js b/node_modules/extglob/node_modules/is-data-descriptor/index.js new file mode 100644 index 0000000..cfeae36 --- /dev/null +++ b/node_modules/extglob/node_modules/is-data-descriptor/index.js @@ -0,0 +1,49 @@ +/*! + * is-data-descriptor + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +module.exports = function isDataDescriptor(obj, prop) { + // data descriptor properties + var data = { + configurable: 'boolean', + enumerable: 'boolean', + writable: 'boolean' + }; + + if (typeOf(obj) !== 'object') { + return false; + } + + if (typeof prop === 'string') { + var val = Object.getOwnPropertyDescriptor(obj, prop); + return typeof val !== 'undefined'; + } + + if (!('value' in obj) && !('writable' in obj)) { + return false; + } + + for (var key in obj) { + if (key === 'value') continue; + + if (!data.hasOwnProperty(key)) { + continue; + } + + if (typeOf(obj[key]) === data[key]) { + continue; + } + + if (typeof obj[key] !== 'undefined') { + return false; + } + } + return true; +}; diff --git a/node_modules/extglob/node_modules/is-data-descriptor/package.json b/node_modules/extglob/node_modules/is-data-descriptor/package.json new file mode 100644 index 0000000..d1961db --- /dev/null +++ b/node_modules/extglob/node_modules/is-data-descriptor/package.json @@ -0,0 +1,109 @@ +{ + "_from": "is-data-descriptor@^1.0.0", + "_id": "is-data-descriptor@1.0.0", + "_inBundle": false, + "_integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "_location": "/extglob/is-data-descriptor", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-data-descriptor@^1.0.0", + "name": "is-data-descriptor", + "escapedName": "is-data-descriptor", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/extglob/is-descriptor" + ], + "_resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "_shasum": "d84876321d0e7add03990406abbbbd36ba9268c7", + "_spec": "is-data-descriptor@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/extglob/node_modules/is-descriptor", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Rouven Weßling", + "url": "www.rouvenwessling.de" + } + ], + "dependencies": { + "kind-of": "^6.0.0" + }, + "deprecated": false, + "description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-data-descriptor", + "keywords": [ + "accessor", + "check", + "data", + "descriptor", + "get", + "getter", + "is", + "keys", + "object", + "properties", + "property", + "set", + "setter", + "type", + "valid", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-data-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "isobject" + ] + }, + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/node_modules/extglob/node_modules/is-descriptor/LICENSE b/node_modules/extglob/node_modules/is-descriptor/LICENSE new file mode 100644 index 0000000..c0d7f13 --- /dev/null +++ b/node_modules/extglob/node_modules/is-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/extglob/node_modules/is-descriptor/README.md b/node_modules/extglob/node_modules/is-descriptor/README.md new file mode 100644 index 0000000..658e533 --- /dev/null +++ b/node_modules/extglob/node_modules/is-descriptor/README.md @@ -0,0 +1,193 @@ +# is-descriptor [![NPM version](https://img.shields.io/npm/v/is-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-descriptor) + +> Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-descriptor +``` + +## Usage + +```js +var isDescriptor = require('is-descriptor'); + +isDescriptor({value: 'foo'}) +//=> true +isDescriptor({get: function(){}, set: function(){}}) +//=> true +isDescriptor({get: 'foo', set: function(){}}) +//=> false +``` + +You may also check for a descriptor by passing an object as the first argument and property name (`string`) as the second argument. + +```js +var obj = {}; +obj.foo = 'abc'; + +Object.defineProperty(obj, 'bar', { + value: 'xyz' +}); + +isDescriptor(obj, 'foo'); +//=> true +isDescriptor(obj, 'bar'); +//=> true +``` + +## Examples + +### value type + +`false` when not an object + +```js +isDescriptor('a'); +//=> false +isDescriptor(null); +//=> false +isDescriptor([]); +//=> false +``` + +### data descriptor + +`true` when the object has valid properties with valid values. + +```js +isDescriptor({value: 'foo'}); +//=> true +isDescriptor({value: noop}); +//=> true +``` + +`false` when the object has invalid properties + +```js +isDescriptor({value: 'foo', bar: 'baz'}); +//=> false +isDescriptor({value: 'foo', bar: 'baz'}); +//=> false +isDescriptor({value: 'foo', get: noop}); +//=> false +isDescriptor({get: noop, value: noop}); +//=> false +``` + +`false` when a value is not the correct type + +```js +isDescriptor({value: 'foo', enumerable: 'foo'}); +//=> false +isDescriptor({value: 'foo', configurable: 'foo'}); +//=> false +isDescriptor({value: 'foo', writable: 'foo'}); +//=> false +``` + +### accessor descriptor + +`true` when the object has valid properties with valid values. + +```js +isDescriptor({get: noop, set: noop}); +//=> true +isDescriptor({get: noop}); +//=> true +isDescriptor({set: noop}); +//=> true +``` + +`false` when the object has invalid properties + +```js +isDescriptor({get: noop, set: noop, bar: 'baz'}); +//=> false +isDescriptor({get: noop, writable: true}); +//=> false +isDescriptor({get: noop, value: true}); +//=> false +``` + +`false` when an accessor is not a function + +```js +isDescriptor({get: noop, set: 'baz'}); +//=> false +isDescriptor({get: 'foo', set: noop}); +//=> false +isDescriptor({get: 'foo', bar: 'baz'}); +//=> false +isDescriptor({get: 'foo', set: 'baz'}); +//=> false +``` + +`false` when a value is not the correct type + +```js +isDescriptor({get: noop, set: noop, enumerable: 'foo'}); +//=> false +isDescriptor({set: noop, configurable: 'foo'}); +//=> false +isDescriptor({get: noop, configurable: 'foo'}); +//=> false +``` + +## About + +### Related projects + +* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") +* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") +* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 24 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [doowb](https://github.com/doowb) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 22, 2017._ \ No newline at end of file diff --git a/node_modules/extglob/node_modules/is-descriptor/index.js b/node_modules/extglob/node_modules/is-descriptor/index.js new file mode 100644 index 0000000..c9b91d7 --- /dev/null +++ b/node_modules/extglob/node_modules/is-descriptor/index.js @@ -0,0 +1,22 @@ +/*! + * is-descriptor + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); +var isAccessor = require('is-accessor-descriptor'); +var isData = require('is-data-descriptor'); + +module.exports = function isDescriptor(obj, key) { + if (typeOf(obj) !== 'object') { + return false; + } + if ('get' in obj) { + return isAccessor(obj, key); + } + return isData(obj, key); +}; diff --git a/node_modules/extglob/node_modules/is-descriptor/package.json b/node_modules/extglob/node_modules/is-descriptor/package.json new file mode 100644 index 0000000..20a1a6f --- /dev/null +++ b/node_modules/extglob/node_modules/is-descriptor/package.json @@ -0,0 +1,114 @@ +{ + "_from": "is-descriptor@^1.0.0", + "_id": "is-descriptor@1.0.2", + "_inBundle": false, + "_integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "_location": "/extglob/is-descriptor", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-descriptor@^1.0.0", + "name": "is-descriptor", + "escapedName": "is-descriptor", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/extglob/define-property" + ], + "_resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "_shasum": "3b159746a66604b04f8c81524ba365c5f14d86ec", + "_spec": "is-descriptor@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/extglob/node_modules/define-property", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-descriptor/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "url": "https://github.com/wtgtybhertgeghgtwtg" + } + ], + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "deprecated": false, + "description": "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-descriptor", + "keywords": [ + "accessor", + "check", + "data", + "descriptor", + "get", + "getter", + "is", + "keys", + "object", + "properties", + "property", + "set", + "setter", + "type", + "valid", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "isobject" + ] + }, + "plugins": [ + "gulp-format-md" + ], + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.2" +} diff --git a/node_modules/extglob/package.json b/node_modules/extglob/package.json new file mode 100644 index 0000000..1212925 --- /dev/null +++ b/node_modules/extglob/package.json @@ -0,0 +1,160 @@ +{ + "_from": "extglob@^2.0.4", + "_id": "extglob@2.0.4", + "_inBundle": false, + "_integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "_location": "/extglob", + "_phantomChildren": { + "is-extendable": "0.1.1", + "kind-of": "6.0.3" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "extglob@^2.0.4", + "name": "extglob", + "escapedName": "extglob", + "rawSpec": "^2.0.4", + "saveSpec": null, + "fetchSpec": "^2.0.4" + }, + "_requiredBy": [ + "/micromatch" + ], + "_resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "_shasum": "ad00fe4dc612a9232e8718711dc5cb5ab0285543", + "_spec": "extglob@^2.0.4", + "_where": "/usr/share/r3-server/beta/r3/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/micromatch/extglob/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Devon Govett", + "url": "http://badassjs.com" + }, + { + "name": "Isiah Meadows", + "url": "https://www.isiahmeadows.com" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Matt Bierner", + "url": "http://mattbierner.com" + }, + { + "name": "Shinnosuke Watanabe", + "url": "https://shinnn.github.io" + } + ], + "dependencies": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "deprecated": false, + "description": "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.", + "devDependencies": { + "bash-match": "^1.0.2", + "for-own": "^1.0.0", + "gulp": "^3.9.1", + "gulp-eslint": "^4.0.0", + "gulp-format-md": "^1.0.0", + "gulp-istanbul": "^1.1.2", + "gulp-mocha": "^3.0.1", + "gulp-unused": "^0.2.1", + "helper-changelog": "^0.3.0", + "is-windows": "^1.0.1", + "micromatch": "^3.0.4", + "minimatch": "^3.0.4", + "minimist": "^1.2.0", + "mocha": "^3.5.0", + "multimatch": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "lib" + ], + "homepage": "https://github.com/micromatch/extglob", + "keywords": [ + "bash", + "extended", + "extglob", + "glob", + "globbing", + "ksh", + "match", + "pattern", + "patterns", + "regex", + "test", + "wildcard" + ], + "license": "MIT", + "lintDeps": { + "devDependencies": { + "files": { + "options": { + "ignore": [ + "benchmark/**/*.js" + ] + } + } + } + }, + "main": "index.js", + "name": "extglob", + "repository": { + "type": "git", + "url": "git+https://github.com/micromatch/extglob.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "related": { + "list": [ + "braces", + "expand-brackets", + "expand-range", + "fill-range", + "micromatch" + ] + }, + "helpers": [ + "helper-changelog" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.0.4" +} diff --git a/node_modules/fancy-log/LICENSE b/node_modules/fancy-log/LICENSE new file mode 100644 index 0000000..3a58630 --- /dev/null +++ b/node_modules/fancy-log/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014, 2015, 2018 Blaine Bublitz and Eric Schoffstall + +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. + diff --git a/node_modules/fancy-log/README.md b/node_modules/fancy-log/README.md new file mode 100644 index 0000000..33ef5c1 --- /dev/null +++ b/node_modules/fancy-log/README.md @@ -0,0 +1,71 @@ +

+ + + +

+ +# fancy-log + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +Log things, prefixed with a timestamp. + +## Usage + +```js +var log = require('fancy-log'); + +log('a message'); +// [16:27:02] a message + +log.error('oh no!'); +// [16:27:02] oh no! +``` + +## API + +### `log(msg...)` + +Logs the message as if you called `console.log` but prefixes the output with the +current time in HH:MM:ss format. + +### `log.error(msg...)` + +Logs the message as if you called `console.error` but prefixes the output with the +current time in HH:MM:ss format. + +### `log.warn(msg...)` + +Logs the message as if you called `console.warn` but prefixes the output with the +current time in HH:MM:ss format. + + +### `log.info(msg...)` + +Logs the message as if you called `console.info` but prefixes the output with the +current time in HH:MM:ss format. + +### `log.dir(msg...)` + +Logs the message as if you called `console.dir` but prefixes the output with the +current time in HH:MM:ss format. + +## License + +MIT + +[downloads-image]: http://img.shields.io/npm/dm/fancy-log.svg +[npm-url]: https://www.npmjs.com/package/fancy-log +[npm-image]: http://img.shields.io/npm/v/fancy-log.svg + +[travis-url]: https://travis-ci.org/gulpjs/fancy-log +[travis-image]: http://img.shields.io/travis/gulpjs/fancy-log.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/fancy-log +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/fancy-log.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/fancy-log +[coveralls-image]: http://img.shields.io/coveralls/gulpjs/fancy-log/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/node_modules/fancy-log/index.js b/node_modules/fancy-log/index.js new file mode 100644 index 0000000..9dc9888 --- /dev/null +++ b/node_modules/fancy-log/index.js @@ -0,0 +1,92 @@ +'use strict'; + +var Console = require('console').Console; +var gray = require('ansi-gray'); +var timestamp = require('time-stamp'); +var supportsColor = require('color-support'); +var nodeVersion = require('parse-node-version')(process.version); + +var colorDetectionOptions = { + // If on Windows, ignore the isTTY check + // This is due to AppVeyor (and thus probably common Windows platforms?) failing the check + // TODO: If this is too broad, we can reduce it to an APPVEYOR env check + ignoreTTY: (process.platform === 'win32'), +}; + +// Needed to add this because node 10 decided to start coloring log output randomly +var console; +if (nodeVersion.major >= 10) { + // Node 10 also changed the way this is constructed + console = new Console({ + stdout: process.stdout, + stderr: process.stderr, + colorMode: false, + }); +} else { + console = new Console(process.stdout, process.stderr); +} + +function hasFlag(flag) { + return (process.argv.indexOf('--' + flag) !== -1); +} + +function addColor(str) { + if (hasFlag('no-color')) { + return str; + } + + if (hasFlag('color')) { + return gray(str); + } + + if (supportsColor(colorDetectionOptions)) { + return gray(str); + } + + return str; +} + +function getTimestamp() { + return '[' + addColor(timestamp('HH:mm:ss')) + ']'; +} + +function log() { + var time = getTimestamp(); + process.stdout.write(time + ' '); + console.log.apply(console, arguments); + return this; +} + +function info() { + var time = getTimestamp(); + process.stdout.write(time + ' '); + console.info.apply(console, arguments); + return this; +} + +function dir() { + var time = getTimestamp(); + process.stdout.write(time + ' '); + console.dir.apply(console, arguments); + return this; +} + +function warn() { + var time = getTimestamp(); + process.stderr.write(time + ' '); + console.warn.apply(console, arguments); + return this; +} + +function error() { + var time = getTimestamp(); + process.stderr.write(time + ' '); + console.error.apply(console, arguments); + return this; +} + +module.exports = log; +module.exports.info = info; +module.exports.dir = dir; +module.exports.warn = warn; +module.exports.error = error; diff --git a/node_modules/fancy-log/package.json b/node_modules/fancy-log/package.json new file mode 100644 index 0000000..fbafd23 --- /dev/null +++ b/node_modules/fancy-log/package.json @@ -0,0 +1,91 @@ +{ + "_from": "fancy-log@^1.3.2", + "_id": "fancy-log@1.3.3", + "_inBundle": false, + "_integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", + "_location": "/fancy-log", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fancy-log@^1.3.2", + "name": "fancy-log", + "escapedName": "fancy-log", + "rawSpec": "^1.3.2", + "saveSpec": null, + "fetchSpec": "^1.3.2" + }, + "_requiredBy": [ + "/gulp/gulp-cli" + ], + "_resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", + "_shasum": "dbc19154f558690150a23953a0adbd035be45fc7", + "_spec": "fancy-log@^1.3.2", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/gulp-cli", + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "http://gulpjs.com/" + }, + "bugs": { + "url": "https://github.com/gulpjs/fancy-log/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com" + }, + { + "name": "Aman Mittal", + "url": "http://amandeepmittal.github.io/" + } + ], + "dependencies": { + "ansi-gray": "^0.1.1", + "color-support": "^1.1.3", + "parse-node-version": "^1.0.0", + "time-stamp": "^1.0.0" + }, + "deprecated": false, + "description": "Log things, prefixed with a timestamp.", + "devDependencies": { + "eslint": "^2.13.0", + "eslint-config-gulp": "^3.0.1", + "expect": "^1.20.2", + "istanbul": "^0.4.3", + "istanbul-coveralls": "^1.0.3", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "LICENSE", + "index.js" + ], + "homepage": "https://github.com/gulpjs/fancy-log#readme", + "keywords": [ + "console.log", + "log", + "logger", + "logging", + "pretty", + "timestamp" + ], + "license": "MIT", + "main": "index.js", + "name": "fancy-log", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/fancy-log.git" + }, + "scripts": { + "cover": "istanbul cover _mocha --report lcovonly", + "coveralls": "npm run cover && istanbul-coveralls", + "lint": "eslint .", + "pretest": "npm run lint", + "test": "mocha --async-only" + }, + "version": "1.3.3" +} diff --git a/node_modules/fast-deep-equal/LICENSE b/node_modules/fast-deep-equal/LICENSE new file mode 100644 index 0000000..7f15435 --- /dev/null +++ b/node_modules/fast-deep-equal/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Evgeny Poberezkin + +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. diff --git a/node_modules/fast-deep-equal/README.md b/node_modules/fast-deep-equal/README.md new file mode 100644 index 0000000..d3f4ffc --- /dev/null +++ b/node_modules/fast-deep-equal/README.md @@ -0,0 +1,96 @@ +# fast-deep-equal +The fastest deep equal with ES6 Map, Set and Typed arrays support. + +[![Build Status](https://travis-ci.org/epoberezkin/fast-deep-equal.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-deep-equal) +[![npm](https://img.shields.io/npm/v/fast-deep-equal.svg)](https://www.npmjs.com/package/fast-deep-equal) +[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-deep-equal/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-deep-equal?branch=master) + + +## Install + +```bash +npm install fast-deep-equal +``` + + +## Features + +- ES5 compatible +- works in node.js (8+) and browsers (IE9+) +- checks equality of Date and RegExp objects by value. + +ES6 equal (`require('fast-deep-equal/es6')`) also supports: +- Maps +- Sets +- Typed arrays + + +## Usage + +```javascript +var equal = require('fast-deep-equal'); +console.log(equal({foo: 'bar'}, {foo: 'bar'})); // true +``` + +To support ES6 Maps, Sets and Typed arrays equality use: + +```javascript +var equal = require('fast-deep-equal/es6'); +console.log(equal(Int16Array([1, 2]), Int16Array([1, 2]))); // true +``` + +To use with React (avoiding the traversal of React elements' _owner +property that contains circular references and is not needed when +comparing the elements - borrowed from [react-fast-compare](https://github.com/FormidableLabs/react-fast-compare)): + +```javascript +var equal = require('fast-deep-equal/react'); +var equal = require('fast-deep-equal/es6/react'); +``` + + +## Performance benchmark + +Node.js v12.6.0: + +``` +fast-deep-equal x 261,950 ops/sec ±0.52% (89 runs sampled) +fast-deep-equal/es6 x 212,991 ops/sec ±0.34% (92 runs sampled) +fast-equals x 230,957 ops/sec ±0.83% (85 runs sampled) +nano-equal x 187,995 ops/sec ±0.53% (88 runs sampled) +shallow-equal-fuzzy x 138,302 ops/sec ±0.49% (90 runs sampled) +underscore.isEqual x 74,423 ops/sec ±0.38% (89 runs sampled) +lodash.isEqual x 36,637 ops/sec ±0.72% (90 runs sampled) +deep-equal x 2,310 ops/sec ±0.37% (90 runs sampled) +deep-eql x 35,312 ops/sec ±0.67% (91 runs sampled) +ramda.equals x 12,054 ops/sec ±0.40% (91 runs sampled) +util.isDeepStrictEqual x 46,440 ops/sec ±0.43% (90 runs sampled) +assert.deepStrictEqual x 456 ops/sec ±0.71% (88 runs sampled) + +The fastest is fast-deep-equal +``` + +To run benchmark (requires node.js 6+): + +```bash +npm run benchmark +``` + +__Please note__: this benchmark runs against the available test cases. To choose the most performant library for your application, it is recommended to benchmark against your data and to NOT expect this benchmark to reflect the performance difference in your application. + + +## Enterprise support + +fast-deep-equal package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-deep-equal?utm_source=npm-fast-deep-equal&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. + + +## Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. + + +## License + +[MIT](https://github.com/epoberezkin/fast-deep-equal/blob/master/LICENSE) diff --git a/node_modules/fast-deep-equal/es6/index.d.ts b/node_modules/fast-deep-equal/es6/index.d.ts new file mode 100644 index 0000000..0fc8d3b --- /dev/null +++ b/node_modules/fast-deep-equal/es6/index.d.ts @@ -0,0 +1,2 @@ +const equal: (a: any, b: any) => boolean; +export = equal; diff --git a/node_modules/fast-deep-equal/es6/index.js b/node_modules/fast-deep-equal/es6/index.js new file mode 100644 index 0000000..d980be2 --- /dev/null +++ b/node_modules/fast-deep-equal/es6/index.js @@ -0,0 +1,72 @@ +'use strict'; + +// do not edit .js files directly - edit src/index.jst + + + var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; + + +module.exports = function equal(a, b) { + if (a === b) return true; + + if (a && b && typeof a == 'object' && typeof b == 'object') { + if (a.constructor !== b.constructor) return false; + + var length, i, keys; + if (Array.isArray(a)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (!equal(a[i], b[i])) return false; + return true; + } + + + if ((a instanceof Map) && (b instanceof Map)) { + if (a.size !== b.size) return false; + for (i of a.entries()) + if (!b.has(i[0])) return false; + for (i of a.entries()) + if (!equal(i[1], b.get(i[0]))) return false; + return true; + } + + if ((a instanceof Set) && (b instanceof Set)) { + if (a.size !== b.size) return false; + for (i of a.entries()) + if (!b.has(i[0])) return false; + return true; + } + + if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (a[i] !== b[i]) return false; + return true; + } + + + if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); + if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); + + keys = Object.keys(a); + length = keys.length; + if (length !== Object.keys(b).length) return false; + + for (i = length; i-- !== 0;) + if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; + + for (i = length; i-- !== 0;) { + var key = keys[i]; + + if (!equal(a[key], b[key])) return false; + } + + return true; + } + + // true if both NaN, false otherwise + return a!==a && b!==b; +}; diff --git a/node_modules/fast-deep-equal/es6/react.d.ts b/node_modules/fast-deep-equal/es6/react.d.ts new file mode 100644 index 0000000..0fc8d3b --- /dev/null +++ b/node_modules/fast-deep-equal/es6/react.d.ts @@ -0,0 +1,2 @@ +const equal: (a: any, b: any) => boolean; +export = equal; diff --git a/node_modules/fast-deep-equal/es6/react.js b/node_modules/fast-deep-equal/es6/react.js new file mode 100644 index 0000000..98e2f9b --- /dev/null +++ b/node_modules/fast-deep-equal/es6/react.js @@ -0,0 +1,79 @@ +'use strict'; + +// do not edit .js files directly - edit src/index.jst + + + var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; + + +module.exports = function equal(a, b) { + if (a === b) return true; + + if (a && b && typeof a == 'object' && typeof b == 'object') { + if (a.constructor !== b.constructor) return false; + + var length, i, keys; + if (Array.isArray(a)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (!equal(a[i], b[i])) return false; + return true; + } + + + if ((a instanceof Map) && (b instanceof Map)) { + if (a.size !== b.size) return false; + for (i of a.entries()) + if (!b.has(i[0])) return false; + for (i of a.entries()) + if (!equal(i[1], b.get(i[0]))) return false; + return true; + } + + if ((a instanceof Set) && (b instanceof Set)) { + if (a.size !== b.size) return false; + for (i of a.entries()) + if (!b.has(i[0])) return false; + return true; + } + + if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (a[i] !== b[i]) return false; + return true; + } + + + if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); + if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); + + keys = Object.keys(a); + length = keys.length; + if (length !== Object.keys(b).length) return false; + + for (i = length; i-- !== 0;) + if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; + + for (i = length; i-- !== 0;) { + var key = keys[i]; + + if (key === '_owner' && a.$$typeof) { + // React-specific: avoid traversing React elements' _owner. + // _owner contains circular references + // and is not needed when comparing the actual elements (and not their owners) + continue; + } + + if (!equal(a[key], b[key])) return false; + } + + return true; + } + + // true if both NaN, false otherwise + return a!==a && b!==b; +}; diff --git a/node_modules/fast-deep-equal/index.d.ts b/node_modules/fast-deep-equal/index.d.ts new file mode 100644 index 0000000..3c042ca --- /dev/null +++ b/node_modules/fast-deep-equal/index.d.ts @@ -0,0 +1,4 @@ +declare module 'fast-deep-equal' { + const equal: (a: any, b: any) => boolean; + export = equal; +} diff --git a/node_modules/fast-deep-equal/index.js b/node_modules/fast-deep-equal/index.js new file mode 100644 index 0000000..30dd1ba --- /dev/null +++ b/node_modules/fast-deep-equal/index.js @@ -0,0 +1,46 @@ +'use strict'; + +// do not edit .js files directly - edit src/index.jst + + + +module.exports = function equal(a, b) { + if (a === b) return true; + + if (a && b && typeof a == 'object' && typeof b == 'object') { + if (a.constructor !== b.constructor) return false; + + var length, i, keys; + if (Array.isArray(a)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (!equal(a[i], b[i])) return false; + return true; + } + + + + if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); + if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); + + keys = Object.keys(a); + length = keys.length; + if (length !== Object.keys(b).length) return false; + + for (i = length; i-- !== 0;) + if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; + + for (i = length; i-- !== 0;) { + var key = keys[i]; + + if (!equal(a[key], b[key])) return false; + } + + return true; + } + + // true if both NaN, false otherwise + return a!==a && b!==b; +}; diff --git a/node_modules/fast-deep-equal/package.json b/node_modules/fast-deep-equal/package.json new file mode 100644 index 0000000..6d13c27 --- /dev/null +++ b/node_modules/fast-deep-equal/package.json @@ -0,0 +1,88 @@ +{ + "_from": "fast-deep-equal@^3.1.1", + "_id": "fast-deep-equal@3.1.1", + "_inBundle": false, + "_integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "_location": "/fast-deep-equal", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fast-deep-equal@^3.1.1", + "name": "fast-deep-equal", + "escapedName": "fast-deep-equal", + "rawSpec": "^3.1.1", + "saveSpec": null, + "fetchSpec": "^3.1.1" + }, + "_requiredBy": [ + "/ajv" + ], + "_resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "_shasum": "545145077c501491e33b15ec408c294376e94ae4", + "_spec": "fast-deep-equal@^3.1.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/ajv", + "author": { + "name": "Evgeny Poberezkin" + }, + "bugs": { + "url": "https://github.com/epoberezkin/fast-deep-equal/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Fast deep equal", + "devDependencies": { + "coveralls": "^2.13.1", + "dot": "^1.1.2", + "eslint": "^4.0.0", + "mocha": "^3.4.2", + "nyc": "^11.0.2", + "pre-commit": "^1.2.2", + "react": "^16.12.0", + "react-test-renderer": "^16.12.0", + "sinon": "^7.5.0", + "typescript": "^2.6.1" + }, + "files": [ + "index.js", + "index.d.ts", + "react.js", + "react.d.ts", + "es6/" + ], + "homepage": "https://github.com/epoberezkin/fast-deep-equal#readme", + "keywords": [ + "fast", + "equal", + "deep-equal" + ], + "license": "MIT", + "main": "index.js", + "name": "fast-deep-equal", + "nyc": { + "exclude": [ + "**/spec/**", + "node_modules" + ], + "reporter": [ + "lcov", + "text-summary" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/epoberezkin/fast-deep-equal.git" + }, + "scripts": { + "benchmark": "npm i && npm run build && cd ./benchmark && npm i && node ./", + "build": "node build", + "eslint": "eslint *.js benchmark/*.js spec/*.js", + "prepublish": "npm run build", + "test": "npm run build && npm run eslint && npm run test-ts && npm run test-cov", + "test-cov": "nyc npm run test-spec", + "test-spec": "mocha spec/*.spec.js -R spec", + "test-ts": "tsc --target ES5 --noImplicitAny index.d.ts" + }, + "types": "index.d.ts", + "version": "3.1.1" +} diff --git a/node_modules/fast-deep-equal/react.d.ts b/node_modules/fast-deep-equal/react.d.ts new file mode 100644 index 0000000..0fc8d3b --- /dev/null +++ b/node_modules/fast-deep-equal/react.d.ts @@ -0,0 +1,2 @@ +const equal: (a: any, b: any) => boolean; +export = equal; diff --git a/node_modules/fast-deep-equal/react.js b/node_modules/fast-deep-equal/react.js new file mode 100644 index 0000000..3489b98 --- /dev/null +++ b/node_modules/fast-deep-equal/react.js @@ -0,0 +1,53 @@ +'use strict'; + +// do not edit .js files directly - edit src/index.jst + + + +module.exports = function equal(a, b) { + if (a === b) return true; + + if (a && b && typeof a == 'object' && typeof b == 'object') { + if (a.constructor !== b.constructor) return false; + + var length, i, keys; + if (Array.isArray(a)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (!equal(a[i], b[i])) return false; + return true; + } + + + + if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); + if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); + + keys = Object.keys(a); + length = keys.length; + if (length !== Object.keys(b).length) return false; + + for (i = length; i-- !== 0;) + if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; + + for (i = length; i-- !== 0;) { + var key = keys[i]; + + if (key === '_owner' && a.$$typeof) { + // React-specific: avoid traversing React elements' _owner. + // _owner contains circular references + // and is not needed when comparing the actual elements (and not their owners) + continue; + } + + if (!equal(a[key], b[key])) return false; + } + + return true; + } + + // true if both NaN, false otherwise + return a!==a && b!==b; +}; diff --git a/node_modules/fast-json-stable-stringify/.eslintrc.yml b/node_modules/fast-json-stable-stringify/.eslintrc.yml new file mode 100644 index 0000000..1c77b0d --- /dev/null +++ b/node_modules/fast-json-stable-stringify/.eslintrc.yml @@ -0,0 +1,26 @@ +extends: eslint:recommended +env: + node: true + browser: true +rules: + block-scoped-var: 2 + callback-return: 2 + dot-notation: 2 + indent: 2 + linebreak-style: [2, unix] + new-cap: 2 + no-console: [2, allow: [warn, error]] + no-else-return: 2 + no-eq-null: 2 + no-fallthrough: 2 + no-invalid-this: 2 + no-return-assign: 2 + no-shadow: 1 + no-trailing-spaces: 2 + no-use-before-define: [2, nofunc] + quotes: [2, single, avoid-escape] + semi: [2, always] + strict: [2, global] + valid-jsdoc: [2, requireReturn: false] + no-control-regex: 0 + no-useless-escape: 2 diff --git a/node_modules/fast-json-stable-stringify/.github/FUNDING.yml b/node_modules/fast-json-stable-stringify/.github/FUNDING.yml new file mode 100644 index 0000000..61f9daa --- /dev/null +++ b/node_modules/fast-json-stable-stringify/.github/FUNDING.yml @@ -0,0 +1 @@ +tidelift: "npm/fast-json-stable-stringify" diff --git a/node_modules/fast-json-stable-stringify/.travis.yml b/node_modules/fast-json-stable-stringify/.travis.yml new file mode 100644 index 0000000..b61e8f0 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "8" + - "10" + - "12" + - "13" +after_script: + - coveralls < coverage/lcov.info diff --git a/node_modules/fast-json-stable-stringify/LICENSE b/node_modules/fast-json-stable-stringify/LICENSE new file mode 100644 index 0000000..c932223 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/LICENSE @@ -0,0 +1,21 @@ +This software is released under the MIT license: + +Copyright (c) 2017 Evgeny Poberezkin +Copyright (c) 2013 James Halliday + +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. diff --git a/node_modules/fast-json-stable-stringify/README.md b/node_modules/fast-json-stable-stringify/README.md new file mode 100644 index 0000000..02cf49f --- /dev/null +++ b/node_modules/fast-json-stable-stringify/README.md @@ -0,0 +1,131 @@ +# fast-json-stable-stringify + +Deterministic `JSON.stringify()` - a faster version of [@substack](https://github.com/substack)'s json-stable-strigify without [jsonify](https://github.com/substack/jsonify). + +You can also pass in a custom comparison function. + +[![Build Status](https://travis-ci.org/epoberezkin/fast-json-stable-stringify.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-json-stable-stringify) +[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-json-stable-stringify/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-json-stable-stringify?branch=master) + +# example + +``` js +var stringify = require('fast-json-stable-stringify'); +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +console.log(stringify(obj)); +``` + +output: + +``` +{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8} +``` + + +# methods + +``` js +var stringify = require('fast-json-stable-stringify') +``` + +## var str = stringify(obj, opts) + +Return a deterministic stringified string `str` from the object `obj`. + + +## options + +### cmp + +If `opts` is given, you can supply an `opts.cmp` to have a custom comparison +function for object keys. Your function `opts.cmp` is called with these +parameters: + +``` js +opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue }) +``` + +For example, to sort on the object key names in reverse order you could write: + +``` js +var stringify = require('fast-json-stable-stringify'); + +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; +}); +console.log(s); +``` + +which results in the output string: + +``` +{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3} +``` + +Or if you wanted to sort on the object values in reverse order, you could write: + +``` +var stringify = require('fast-json-stable-stringify'); + +var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; +var s = stringify(obj, function (a, b) { + return a.value < b.value ? 1 : -1; +}); +console.log(s); +``` + +which outputs: + +``` +{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10} +``` + +### cycles + +Pass `true` in `opts.cycles` to stringify circular property as `__cycle__` - the result will not be a valid JSON string in this case. + +TypeError will be thrown in case of circular object without this option. + + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install fast-json-stable-stringify +``` + + +# benchmark + +To run benchmark (requires Node.js 6+): +``` +node benchmark +``` + +Results: +``` +fast-json-stable-stringify x 17,189 ops/sec ±1.43% (83 runs sampled) +json-stable-stringify x 13,634 ops/sec ±1.39% (85 runs sampled) +fast-stable-stringify x 20,212 ops/sec ±1.20% (84 runs sampled) +faster-stable-stringify x 15,549 ops/sec ±1.12% (84 runs sampled) +The fastest is fast-stable-stringify +``` + + +## Enterprise support + +fast-json-stable-stringify package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-json-stable-stringify?utm_source=npm-fast-json-stable-stringify&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. + + +## Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. + + +# license + +[MIT](https://github.com/epoberezkin/fast-json-stable-stringify/blob/master/LICENSE) diff --git a/node_modules/fast-json-stable-stringify/benchmark/index.js b/node_modules/fast-json-stable-stringify/benchmark/index.js new file mode 100644 index 0000000..e725f9f --- /dev/null +++ b/node_modules/fast-json-stable-stringify/benchmark/index.js @@ -0,0 +1,31 @@ +'use strict'; + +const Benchmark = require('benchmark'); +const suite = new Benchmark.Suite; +const testData = require('./test.json'); + + +const stringifyPackages = { + // 'JSON.stringify': JSON.stringify, + 'fast-json-stable-stringify': require('../index'), + 'json-stable-stringify': true, + 'fast-stable-stringify': true, + 'faster-stable-stringify': true +}; + + +for (const name in stringifyPackages) { + let func = stringifyPackages[name]; + if (func === true) func = require(name); + + suite.add(name, function() { + func(testData); + }); +} + +suite + .on('cycle', (event) => console.log(String(event.target))) + .on('complete', function () { + console.log('The fastest is ' + this.filter('fastest').map('name')); + }) + .run({async: true}); diff --git a/node_modules/fast-json-stable-stringify/benchmark/test.json b/node_modules/fast-json-stable-stringify/benchmark/test.json new file mode 100644 index 0000000..c9118c1 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/benchmark/test.json @@ -0,0 +1,137 @@ +[ + { + "_id": "59ef4a83ee8364808d761beb", + "index": 0, + "guid": "e50ffae9-7128-4148-9ee5-40c3fc523c5d", + "isActive": false, + "balance": "$2,341.81", + "picture": "http://placehold.it/32x32", + "age": 28, + "eyeColor": "brown", + "name": "Carey Savage", + "gender": "female", + "company": "VERAQ", + "email": "careysavage@veraq.com", + "phone": "+1 (897) 574-3014", + "address": "458 Willow Street, Henrietta, California, 7234", + "about": "Nisi reprehenderit nulla ad officia pariatur non dolore laboris irure cupidatat laborum. Minim eu ex Lorem adipisicing exercitation irure minim sunt est enim mollit incididunt voluptate nulla. Ut mollit anim reprehenderit et aliqua ex esse aliquip. Aute sit duis deserunt do incididunt consequat minim qui dolor commodo deserunt et voluptate.\r\n", + "registered": "2014-05-21T01:56:51 -01:00", + "latitude": 63.89502, + "longitude": 62.369807, + "tags": [ + "nostrud", + "nisi", + "consectetur", + "ullamco", + "cupidatat", + "culpa", + "commodo" + ], + "friends": [ + { + "id": 0, + "name": "Henry Walls" + }, + { + "id": 1, + "name": "Janice Baker" + }, + { + "id": 2, + "name": "Russell Bush" + } + ], + "greeting": "Hello, Carey Savage! You have 4 unread messages.", + "favoriteFruit": "banana" + }, + { + "_id": "59ef4a83ff5774a691454e89", + "index": 1, + "guid": "2bee9efc-4095-4c2e-87ef-d08c8054c89d", + "isActive": true, + "balance": "$1,618.15", + "picture": "http://placehold.it/32x32", + "age": 35, + "eyeColor": "blue", + "name": "Elinor Pearson", + "gender": "female", + "company": "FLEXIGEN", + "email": "elinorpearson@flexigen.com", + "phone": "+1 (923) 548-3751", + "address": "600 Bayview Avenue, Draper, Montana, 3088", + "about": "Mollit commodo ea sit Lorem velit. Irure anim esse Lorem sint quis officia ut. Aliqua nisi dolore in aute deserunt mollit ex ea in mollit.\r\n", + "registered": "2017-04-22T07:58:41 -01:00", + "latitude": -87.824919, + "longitude": 69.538927, + "tags": [ + "fugiat", + "labore", + "proident", + "quis", + "eiusmod", + "qui", + "est" + ], + "friends": [ + { + "id": 0, + "name": "Massey Wagner" + }, + { + "id": 1, + "name": "Marcella Ferrell" + }, + { + "id": 2, + "name": "Evans Mckee" + } + ], + "greeting": "Hello, Elinor Pearson! You have 3 unread messages.", + "favoriteFruit": "strawberry" + }, + { + "_id": "59ef4a839ec8a4be4430b36b", + "index": 2, + "guid": "ddd6e8c0-95bd-416d-8b46-a768d6363809", + "isActive": false, + "balance": "$2,046.95", + "picture": "http://placehold.it/32x32", + "age": 40, + "eyeColor": "green", + "name": "Irwin Davidson", + "gender": "male", + "company": "DANJA", + "email": "irwindavidson@danja.com", + "phone": "+1 (883) 537-2041", + "address": "439 Cook Street, Chapin, Kentucky, 7398", + "about": "Irure velit non commodo aliqua exercitation ut nostrud minim magna. Dolor ad ad ut irure eu. Non pariatur dolor eiusmod ipsum do et exercitation cillum. Et amet laboris minim eiusmod ullamco magna ea reprehenderit proident sunt.\r\n", + "registered": "2016-09-01T07:49:08 -01:00", + "latitude": -49.803812, + "longitude": 104.93279, + "tags": [ + "consequat", + "enim", + "quis", + "magna", + "est", + "culpa", + "tempor" + ], + "friends": [ + { + "id": 0, + "name": "Ruth Hansen" + }, + { + "id": 1, + "name": "Kathrine Austin" + }, + { + "id": 2, + "name": "Rivera Munoz" + } + ], + "greeting": "Hello, Irwin Davidson! You have 2 unread messages.", + "favoriteFruit": "banana" + } +] diff --git a/node_modules/fast-json-stable-stringify/example/key_cmp.js b/node_modules/fast-json-stable-stringify/example/key_cmp.js new file mode 100644 index 0000000..d5f6675 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/example/key_cmp.js @@ -0,0 +1,7 @@ +var stringify = require('../'); + +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; +}); +console.log(s); diff --git a/node_modules/fast-json-stable-stringify/example/nested.js b/node_modules/fast-json-stable-stringify/example/nested.js new file mode 100644 index 0000000..9a672fc --- /dev/null +++ b/node_modules/fast-json-stable-stringify/example/nested.js @@ -0,0 +1,3 @@ +var stringify = require('../'); +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +console.log(stringify(obj)); diff --git a/node_modules/fast-json-stable-stringify/example/str.js b/node_modules/fast-json-stable-stringify/example/str.js new file mode 100644 index 0000000..9b4b3cd --- /dev/null +++ b/node_modules/fast-json-stable-stringify/example/str.js @@ -0,0 +1,3 @@ +var stringify = require('../'); +var obj = { c: 6, b: [4,5], a: 3 }; +console.log(stringify(obj)); diff --git a/node_modules/fast-json-stable-stringify/example/value_cmp.js b/node_modules/fast-json-stable-stringify/example/value_cmp.js new file mode 100644 index 0000000..09f1c5f --- /dev/null +++ b/node_modules/fast-json-stable-stringify/example/value_cmp.js @@ -0,0 +1,7 @@ +var stringify = require('../'); + +var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; +var s = stringify(obj, function (a, b) { + return a.value < b.value ? 1 : -1; +}); +console.log(s); diff --git a/node_modules/fast-json-stable-stringify/index.d.ts b/node_modules/fast-json-stable-stringify/index.d.ts new file mode 100644 index 0000000..23e46ca --- /dev/null +++ b/node_modules/fast-json-stable-stringify/index.d.ts @@ -0,0 +1,4 @@ +declare module 'fast-json-stable-stringify' { + function stringify(obj: any): string; + export = stringify; +} diff --git a/node_modules/fast-json-stable-stringify/index.js b/node_modules/fast-json-stable-stringify/index.js new file mode 100644 index 0000000..c44e6a4 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/index.js @@ -0,0 +1,59 @@ +'use strict'; + +module.exports = function (data, opts) { + if (!opts) opts = {}; + if (typeof opts === 'function') opts = { cmp: opts }; + var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; + + var cmp = opts.cmp && (function (f) { + return function (node) { + return function (a, b) { + var aobj = { key: a, value: node[a] }; + var bobj = { key: b, value: node[b] }; + return f(aobj, bobj); + }; + }; + })(opts.cmp); + + var seen = []; + return (function stringify (node) { + if (node && node.toJSON && typeof node.toJSON === 'function') { + node = node.toJSON(); + } + + if (node === undefined) return; + if (typeof node == 'number') return isFinite(node) ? '' + node : 'null'; + if (typeof node !== 'object') return JSON.stringify(node); + + var i, out; + if (Array.isArray(node)) { + out = '['; + for (i = 0; i < node.length; i++) { + if (i) out += ','; + out += stringify(node[i]) || 'null'; + } + return out + ']'; + } + + if (node === null) return 'null'; + + if (seen.indexOf(node) !== -1) { + if (cycles) return JSON.stringify('__cycle__'); + throw new TypeError('Converting circular structure to JSON'); + } + + var seenIndex = seen.push(node) - 1; + var keys = Object.keys(node).sort(cmp && cmp(node)); + out = ''; + for (i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = stringify(node[key]); + + if (!value) continue; + if (out) out += ','; + out += JSON.stringify(key) + ':' + value; + } + seen.splice(seenIndex, 1); + return '{' + out + '}'; + })(data); +}; diff --git a/node_modules/fast-json-stable-stringify/package.json b/node_modules/fast-json-stable-stringify/package.json new file mode 100644 index 0000000..9b8078b --- /dev/null +++ b/node_modules/fast-json-stable-stringify/package.json @@ -0,0 +1,80 @@ +{ + "_from": "fast-json-stable-stringify@^2.0.0", + "_id": "fast-json-stable-stringify@2.1.0", + "_inBundle": false, + "_integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "_location": "/fast-json-stable-stringify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fast-json-stable-stringify@^2.0.0", + "name": "fast-json-stable-stringify", + "escapedName": "fast-json-stable-stringify", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/ajv" + ], + "_resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "_shasum": "874bf69c6f404c2b5d99c481341399fd55892633", + "_spec": "fast-json-stable-stringify@^2.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/ajv", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/epoberezkin/fast-json-stable-stringify/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "deterministic `JSON.stringify()` - a faster version of substack's json-stable-strigify without jsonify", + "devDependencies": { + "benchmark": "^2.1.4", + "coveralls": "^3.0.0", + "eslint": "^6.7.0", + "fast-stable-stringify": "latest", + "faster-stable-stringify": "latest", + "json-stable-stringify": "latest", + "nyc": "^14.1.0", + "pre-commit": "^1.2.2", + "tape": "^4.11.0" + }, + "homepage": "https://github.com/epoberezkin/fast-json-stable-stringify", + "keywords": [ + "json", + "stringify", + "deterministic", + "hash", + "stable" + ], + "license": "MIT", + "main": "index.js", + "name": "fast-json-stable-stringify", + "nyc": { + "exclude": [ + "test", + "node_modules" + ], + "reporter": [ + "lcov", + "text-summary" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/epoberezkin/fast-json-stable-stringify.git" + }, + "scripts": { + "eslint": "eslint index.js test", + "test": "npm run eslint && nyc npm run test-spec", + "test-spec": "tape test/*.js" + }, + "types": "index.d.ts", + "version": "2.1.0" +} diff --git a/node_modules/fast-json-stable-stringify/test/cmp.js b/node_modules/fast-json-stable-stringify/test/cmp.js new file mode 100644 index 0000000..4efd6b5 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/test/cmp.js @@ -0,0 +1,13 @@ +'use strict'; + +var test = require('tape'); +var stringify = require('../'); + +test('custom comparison function', function (t) { + t.plan(1); + var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; + var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; + }); + t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}'); +}); diff --git a/node_modules/fast-json-stable-stringify/test/nested.js b/node_modules/fast-json-stable-stringify/test/nested.js new file mode 100644 index 0000000..167a358 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/test/nested.js @@ -0,0 +1,44 @@ +'use strict'; + +var test = require('tape'); +var stringify = require('../'); + +test('nested', function (t) { + t.plan(1); + var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; + t.equal(stringify(obj), '{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}'); +}); + +test('cyclic (default)', function (t) { + t.plan(1); + var one = { a: 1 }; + var two = { a: 2, one: one }; + one.two = two; + try { + stringify(one); + } catch (ex) { + t.equal(ex.toString(), 'TypeError: Converting circular structure to JSON'); + } +}); + +test('cyclic (specifically allowed)', function (t) { + t.plan(1); + var one = { a: 1 }; + var two = { a: 2, one: one }; + one.two = two; + t.equal(stringify(one, {cycles:true}), '{"a":1,"two":{"a":2,"one":"__cycle__"}}'); +}); + +test('repeated non-cyclic value', function(t) { + t.plan(1); + var one = { x: 1 }; + var two = { a: one, b: one }; + t.equal(stringify(two), '{"a":{"x":1},"b":{"x":1}}'); +}); + +test('acyclic but with reused obj-property pointers', function (t) { + t.plan(1); + var x = { a: 1 }; + var y = { b: x, c: x }; + t.equal(stringify(y), '{"b":{"a":1},"c":{"a":1}}'); +}); diff --git a/node_modules/fast-json-stable-stringify/test/str.js b/node_modules/fast-json-stable-stringify/test/str.js new file mode 100644 index 0000000..99a9ade --- /dev/null +++ b/node_modules/fast-json-stable-stringify/test/str.js @@ -0,0 +1,46 @@ +'use strict'; + +var test = require('tape'); +var stringify = require('../'); + +test('simple object', function (t) { + t.plan(1); + var obj = { c: 6, b: [4,5], a: 3, z: null }; + t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6,"z":null}'); +}); + +test('object with undefined', function (t) { + t.plan(1); + var obj = { a: 3, z: undefined }; + t.equal(stringify(obj), '{"a":3}'); +}); + +test('object with null', function (t) { + t.plan(1); + var obj = { a: 3, z: null }; + t.equal(stringify(obj), '{"a":3,"z":null}'); +}); + +test('object with NaN and Infinity', function (t) { + t.plan(1); + var obj = { a: 3, b: NaN, c: Infinity }; + t.equal(stringify(obj), '{"a":3,"b":null,"c":null}'); +}); + +test('array with undefined', function (t) { + t.plan(1); + var obj = [4, undefined, 6]; + t.equal(stringify(obj), '[4,null,6]'); +}); + +test('object with empty string', function (t) { + t.plan(1); + var obj = { a: 3, z: '' }; + t.equal(stringify(obj), '{"a":3,"z":""}'); +}); + +test('array with empty string', function (t) { + t.plan(1); + var obj = [4, '', 6]; + t.equal(stringify(obj), '[4,"",6]'); +}); diff --git a/node_modules/fast-json-stable-stringify/test/to-json.js b/node_modules/fast-json-stable-stringify/test/to-json.js new file mode 100644 index 0000000..2fb2cfa --- /dev/null +++ b/node_modules/fast-json-stable-stringify/test/to-json.js @@ -0,0 +1,22 @@ +'use strict'; + +var test = require('tape'); +var stringify = require('../'); + +test('toJSON function', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return { one: 1 }; } }; + t.equal(stringify(obj), '{"one":1}' ); +}); + +test('toJSON returns string', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return 'one'; } }; + t.equal(stringify(obj), '"one"'); +}); + +test('toJSON returns array', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return ['one']; } }; + t.equal(stringify(obj), '["one"]'); +}); diff --git a/node_modules/figgy-pudding/CHANGELOG.md b/node_modules/figgy-pudding/CHANGELOG.md new file mode 100644 index 0000000..038f9c0 --- /dev/null +++ b/node_modules/figgy-pudding/CHANGELOG.md @@ -0,0 +1,151 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +## [3.5.1](https://github.com/zkat/figgy-pudding/compare/v3.5.0...v3.5.1) (2018-08-25) + + + + +# [3.5.0](https://github.com/zkat/figgy-pudding/compare/v3.4.1...v3.5.0) (2018-08-25) + + +### Bug Fixes + +* **node:** get rid of Object.entries to add node6 support back ([074f779](https://github.com/zkat/figgy-pudding/commit/074f779)) + + +### Features + +* **node:** add node@10 to CI config ([78b8937](https://github.com/zkat/figgy-pudding/commit/78b8937)) + + + + +## [3.4.1](https://github.com/zkat/figgy-pudding/compare/v3.4.0...v3.4.1) (2018-08-16) + + +### Bug Fixes + +* **forEach:** get forEach to behave like a normal forEach ([c064755](https://github.com/zkat/figgy-pudding/commit/c064755)) +* **has:** get `in` keyword working right ([fafc5a8](https://github.com/zkat/figgy-pudding/commit/fafc5a8)) +* **iteration:** fix and test iteration of opts.other keys ([7a76217](https://github.com/zkat/figgy-pudding/commit/7a76217)) +* **iteration:** use proper args for forEach/toJSON ([974e879](https://github.com/zkat/figgy-pudding/commit/974e879)) +* **proxy:** make sure proxy corner-cases work ok ([8c66e45](https://github.com/zkat/figgy-pudding/commit/8c66e45)) +* **set:** fix and test the exceptions to writing ([206793b](https://github.com/zkat/figgy-pudding/commit/206793b)) + + + + +# [3.4.0](https://github.com/zkat/figgy-pudding/compare/v3.3.0...v3.4.0) (2018-08-16) + + +### Features + +* **iterator:** allow iteration over "other" keys ([3c53323](https://github.com/zkat/figgy-pudding/commit/3c53323)) + + + + +# [3.3.0](https://github.com/zkat/figgy-pudding/compare/v3.2.1...v3.3.0) (2018-08-16) + + +### Bug Fixes + +* **props:** allow symbols to pass through ([97b3464](https://github.com/zkat/figgy-pudding/commit/97b3464)) + + +### Features + +* **pudding:** iteration and serialization support ([0aaa50d](https://github.com/zkat/figgy-pudding/commit/0aaa50d)) + + + + +## [3.2.1](https://github.com/zkat/figgy-pudding/compare/v3.2.0...v3.2.1) (2018-08-15) + + +### Bug Fixes + +* **aliases:** make reverse aliases work correctly ([76a255e](https://github.com/zkat/figgy-pudding/commit/76a255e)) + + + + +# [3.2.0](https://github.com/zkat/figgy-pudding/compare/v3.1.0...v3.2.0) (2018-07-26) + + +### Bug Fixes + +* **concat:** have concat spit out a proxy, too ([64e3495](https://github.com/zkat/figgy-pudding/commit/64e3495)) + + +### Features + +* **default:** pass the pudding itself to default fns ([d9d9e09](https://github.com/zkat/figgy-pudding/commit/d9d9e09)) + + + + +# [3.1.0](https://github.com/zkat/figgy-pudding/compare/v3.0.0...v3.1.0) (2018-04-08) + + +### Features + +* **opts:** allow direct option fetching without .get() ([ca77aad](https://github.com/zkat/figgy-pudding/commit/ca77aad)) + + + + +# [3.0.0](https://github.com/zkat/figgy-pudding/compare/v2.0.1...v3.0.0) (2018-04-06) + + +### Bug Fixes + +* **ci:** oops -- forgot to update CI config ([7a40563](https://github.com/zkat/figgy-pudding/commit/7a40563)) +* **get:** make provider lookup order like Object.assign ([33ff89b](https://github.com/zkat/figgy-pudding/commit/33ff89b)) + + +### Features + +* **concat:** add .concat() method to opts ([d310fce](https://github.com/zkat/figgy-pudding/commit/d310fce)) + + +### meta + +* drop support for node@4 and node@7 ([9f8a61c](https://github.com/zkat/figgy-pudding/commit/9f8a61c)) + + +### BREAKING CHANGES + +* node@4 and node@7 are no longer supported +* **get:** shadow order for properties in providers is reversed + + + + +## [2.0.1](https://github.com/zkat/figgy-pudding/compare/v2.0.0...v2.0.1) (2018-03-16) + + +### Bug Fixes + +* **opts:** ignore non-object providers ([7b9c0f8](https://github.com/zkat/figgy-pudding/commit/7b9c0f8)) + + + + +# [2.0.0](https://github.com/zkat/figgy-pudding/compare/v1.0.0...v2.0.0) (2018-03-16) + + +### Features + +* **api:** overhauled API with new opt handling concept ([e6cc929](https://github.com/zkat/figgy-pudding/commit/e6cc929)) +* **license:** relicense to ISC ([87479aa](https://github.com/zkat/figgy-pudding/commit/87479aa)) + + +### BREAKING CHANGES + +* **license:** the license has been changed from CC0-1.0 to ISC. +* **api:** this is a completely different approach than previously +used by this library. See the readme for the new API and an explanation. diff --git a/node_modules/figgy-pudding/LICENSE.md b/node_modules/figgy-pudding/LICENSE.md new file mode 100644 index 0000000..8d28acf --- /dev/null +++ b/node_modules/figgy-pudding/LICENSE.md @@ -0,0 +1,16 @@ +ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS +ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/figgy-pudding/README.md b/node_modules/figgy-pudding/README.md new file mode 100644 index 0000000..3d0591c --- /dev/null +++ b/node_modules/figgy-pudding/README.md @@ -0,0 +1,260 @@ +# figgy-pudding [![npm version](https://img.shields.io/npm/v/figgy-pudding.svg)](https://npm.im/figgy-pudding) [![license](https://img.shields.io/npm/l/figgy-pudding.svg)](https://npm.im/figgy-pudding) [![Travis](https://img.shields.io/travis/zkat/figgy-pudding.svg)](https://travis-ci.org/zkat/figgy-pudding) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/figgy-pudding?svg=true)](https://ci.appveyor.com/project/zkat/figgy-pudding) [![Coverage Status](https://coveralls.io/repos/github/zkat/figgy-pudding/badge.svg?branch=latest)](https://coveralls.io/github/zkat/figgy-pudding?branch=latest) + +[`figgy-pudding`](https://github.com/zkat/figgy-pudding) is a small JavaScript +library for managing and composing cascading options objects -- hiding what +needs to be hidden from each layer, without having to do a lot of manual munging +and passing of options. + +### The God Object is Dead! +### Now Bring Us Some Figgy Pudding! + +## Install + +`$ npm install figgy-pudding` + +## Table of Contents + +* [Example](#example) +* [Features](#features) +* [API](#api) + * [`figgyPudding(spec)`](#figgy-pudding) + * [`PuddingFactory(values)`](#pudding-factory) + * [`opts.get()`](#opts-get) + * [`opts.concat()`](#opts-concat) + * [`opts.toJSON()`](#opts-to-json) + * [`opts.forEach()`](#opts-for-each) + * [`opts[Symbol.iterator]()`](#opts-symbol-iterator) + * [`opts.entries()`](#opts-entries) + * [`opts.keys()`](#opts-keys) + * [`opts.value()`](#opts-values) + +### Example + +```javascript +// print-package.js +const fetch = require('./fetch.js') +const puddin = require('figgy-pudding') + +const PrintOpts = puddin({ + json: { default: false } +}) + +async function printPkg (name, opts) { + // Expected pattern is to call this in every interface function. If `opts` is + // not passed in, it will automatically create an (empty) object for it. + opts = PrintOpts(opts) + const uri = `https://registry.npmjs.com/${name}` + const res = await fetch(uri, opts.concat({ + // Add or override any passed-in configs and pass them down. + log: customLogger + })) + // The following would throw an error, because it's not in PrintOpts: + // console.log(opts.log) + if (opts.json) { + return res.json() + } else { + return res.text() + } +} + +console.log(await printPkg('figgy', { + // Pass in *all* configs at the toplevel, as a regular object. + json: true, + cache: './tmp-cache' +})) +``` + +```javascript +// fetch.js +const puddin = require('figgy-pudding') + +const FetchOpts = puddin({ + log: { default: require('npmlog') }, + cache: {} +}) + +module.exports = async function (..., opts) { + opts = FetchOpts(opts) +} +``` + +### Features + +* hide options from layer that didn't ask for it +* shared multi-layer options +* make sure `opts` argument is available +* transparent key access like normal keys, through a Proxy. No need for`.get()`! +* default values +* key aliases +* arbitrary key filter functions +* key/value iteration +* serialization +* 100% test coverage using `tap --100` + +### API + +#### `> figgyPudding({ key: { default: val } | String }, [opts]) -> PuddingFactory` + +Defines an Options constructor that can be used to collect only the needed +options. + +An optional `default` property for specs can be used to specify default values +if nothing was passed in. + +If the value for a spec is a string, it will be treated as an alias to that +other key. + +##### Example + +```javascript +const MyAppOpts = figgyPudding({ + lg: 'log', + log: { + default: () => require('npmlog') + }, + cache: {} +}) +``` + +#### `> PuddingFactory(...providers) -> FiggyPudding{}` + +Instantiates an options object defined by `figgyPudding()`, which uses +`providers`, in order, to find requested properties. + +Each provider can be either a plain object, a `Map`-like object (that is, one +with a `.get()` method) or another figgyPudding `Opts` object. + +When nesting `Opts` objects, their properties will not become available to the +new object, but any further nested `Opts` that reference that property _will_ be +able to read from their grandparent, as long as they define that key. Default +values for nested `Opts` parents will be used, if found. + +##### Example + +```javascript +const ReqOpts = figgyPudding({ + follow: {} +}) + +const opts = ReqOpts({ + follow: true, + log: require('npmlog') +}) + +opts.follow // => true +opts.log // => Error: ReqOpts does not define `log` + +const MoreOpts = figgyPudding({ + log: {} +}) +MoreOpts(opts).log // => npmlog object (passed in from original plain obj) +MoreOpts(opts).follow // => Error: MoreOpts does not define `follow` +``` + +#### `> opts.get(key) -> Value` + +Gets a value from the options object. + +##### Example + +```js +const opts = MyOpts(config) +opts.get('foo') // value of `foo` +opts.foo // Proxy-based access through `.get()` +``` + +#### `> opts.concat(...moreProviders) -> FiggyPudding{}` + +Creates a new opts object of the same type as `opts` with additional providers. +Providers further to the right shadow providers to the left, with properties in +the original `opts` being shadows by the new providers. + +##### Example + +```js +const opts = MyOpts({x: 1}) +opts.get('x') // 1 +opts.concat({x: 2}).get('x') // 2 +opts.get('x') // 1 (original opts object left intact) +``` + +#### `> opts.toJSON() -> Value` + +Converts `opts` to a plain, JSON-stringifiable JavaScript value. Used internally +by JavaScript to get `JSON.stringify()` working. + +Only keys that are readable by the current pudding type will be serialized. + +##### Example + +```js +const opts = MyOpts({x: 1}) +opts.toJSON() // {x: 1} +JSON.stringify(opts) // '{"x":1}' +``` + +#### `> opts.forEach((value, key, opts) => {}, thisArg) -> undefined` + +Iterates over the values of `opts`, limited to the keys readable by the current +pudding type. `thisArg` will be used to set the `this` argument when calling the +`fn`. + +##### Example + +```js +const opts = MyOpts({x: 1, y: 2}) +opts.forEach((value, key) => console.log(key, '=', value)) +``` + +#### `> opts.entries() -> Iterator<[[key, value], ...]>` + +Returns an iterator that iterates over the keys and values in `opts`, limited to +the keys readable by the current pudding type. Each iteration returns an array +of `[key, value]`. + +##### Example + +```js +const opts = MyOpts({x: 1, y: 2}) +[...opts({x: 1, y: 2}).entries()] // [['x', 1], ['y', 2]] +``` + +#### `> opts[Symbol.iterator]() -> Iterator<[[key, value], ...]>` + +Returns an iterator that iterates over the keys and values in `opts`, limited to +the keys readable by the current pudding type. Each iteration returns an array +of `[key, value]`. Makes puddings work natively with JS iteration mechanisms. + +##### Example + +```js +const opts = MyOpts({x: 1, y: 2}) +[...opts({x: 1, y: 2})] // [['x', 1], ['y', 2]] +for (let [key, value] of opts({x: 1, y: 2})) { + console.log(key, '=', value) +} +``` + +#### `> opts.keys() -> Iterator<[key, ...]>` + +Returns an iterator that iterates over the keys in `opts`, limited to the keys +readable by the current pudding type. + +##### Example + +```js +const opts = MyOpts({x: 1, y: 2}) +[...opts({x: 1, y: 2}).keys()] // ['x', 'y'] +``` + +#### `> opts.values() -> Iterator<[value, ...]>` + +Returns an iterator that iterates over the values in `opts`, limited to the keys +readable by the current pudding type. + +##### Example +' +```js +const opts = MyOpts({x: 1, y: 2}) +[...opts({x: 1, y: 2}).values()] // [1, 2] +``` diff --git a/node_modules/figgy-pudding/index.js b/node_modules/figgy-pudding/index.js new file mode 100644 index 0000000..bb7d571 --- /dev/null +++ b/node_modules/figgy-pudding/index.js @@ -0,0 +1,197 @@ +'use strict' + +class FiggyPudding { + constructor (specs, opts, providers) { + this.__specs = specs || {} + Object.keys(this.__specs).forEach(alias => { + if (typeof this.__specs[alias] === 'string') { + const key = this.__specs[alias] + const realSpec = this.__specs[key] + if (realSpec) { + const aliasArr = realSpec.aliases || [] + aliasArr.push(alias, key) + realSpec.aliases = [...(new Set(aliasArr))] + this.__specs[alias] = realSpec + } else { + throw new Error(`Alias refers to invalid key: ${key} -> ${alias}`) + } + } + }) + this.__opts = opts || {} + this.__providers = reverse((providers).filter( + x => x != null && typeof x === 'object' + )) + this.__isFiggyPudding = true + } + get (key) { + return pudGet(this, key, true) + } + get [Symbol.toStringTag] () { return 'FiggyPudding' } + forEach (fn, thisArg = this) { + for (let [key, value] of this.entries()) { + fn.call(thisArg, value, key, this) + } + } + toJSON () { + const obj = {} + this.forEach((val, key) => { + obj[key] = val + }) + return obj + } + * entries (_matcher) { + for (let key of Object.keys(this.__specs)) { + yield [key, this.get(key)] + } + const matcher = _matcher || this.__opts.other + if (matcher) { + const seen = new Set() + for (let p of this.__providers) { + const iter = p.entries ? p.entries(matcher) : entries(p) + for (let [key, val] of iter) { + if (matcher(key) && !seen.has(key)) { + seen.add(key) + yield [key, val] + } + } + } + } + } + * [Symbol.iterator] () { + for (let [key, value] of this.entries()) { + yield [key, value] + } + } + * keys () { + for (let [key] of this.entries()) { + yield key + } + } + * values () { + for (let [, value] of this.entries()) { + yield value + } + } + concat (...moreConfig) { + return new Proxy(new FiggyPudding( + this.__specs, + this.__opts, + reverse(this.__providers).concat(moreConfig) + ), proxyHandler) + } +} +try { + const util = require('util') + FiggyPudding.prototype[util.inspect.custom] = function (depth, opts) { + return ( + this[Symbol.toStringTag] + ' ' + ) + util.inspect(this.toJSON(), opts) + } +} catch (e) {} + +function BadKeyError (key) { + throw Object.assign(new Error( + `invalid config key requested: ${key}` + ), {code: 'EBADKEY'}) +} + +function pudGet (pud, key, validate) { + let spec = pud.__specs[key] + if (validate && !spec && (!pud.__opts.other || !pud.__opts.other(key))) { + BadKeyError(key) + } else { + if (!spec) { spec = {} } + let ret + for (let p of pud.__providers) { + ret = tryGet(key, p) + if (ret === undefined && spec.aliases && spec.aliases.length) { + for (let alias of spec.aliases) { + if (alias === key) { continue } + ret = tryGet(alias, p) + if (ret !== undefined) { + break + } + } + } + if (ret !== undefined) { + break + } + } + if (ret === undefined && spec.default !== undefined) { + if (typeof spec.default === 'function') { + return spec.default(pud) + } else { + return spec.default + } + } else { + return ret + } + } +} + +function tryGet (key, p) { + let ret + if (p.__isFiggyPudding) { + ret = pudGet(p, key, false) + } else if (typeof p.get === 'function') { + ret = p.get(key) + } else { + ret = p[key] + } + return ret +} + +const proxyHandler = { + has (obj, prop) { + return prop in obj.__specs && pudGet(obj, prop, false) !== undefined + }, + ownKeys (obj) { + return Object.keys(obj.__specs) + }, + get (obj, prop) { + if ( + typeof prop === 'symbol' || + prop.slice(0, 2) === '__' || + prop in FiggyPudding.prototype + ) { + return obj[prop] + } + return obj.get(prop) + }, + set (obj, prop, value) { + if ( + typeof prop === 'symbol' || + prop.slice(0, 2) === '__' + ) { + obj[prop] = value + return true + } else { + throw new Error('figgyPudding options cannot be modified. Use .concat() instead.') + } + }, + deleteProperty () { + throw new Error('figgyPudding options cannot be deleted. Use .concat() and shadow them instead.') + } +} + +module.exports = figgyPudding +function figgyPudding (specs, opts) { + function factory (...providers) { + return new Proxy(new FiggyPudding( + specs, + opts, + providers + ), proxyHandler) + } + return factory +} + +function reverse (arr) { + const ret = [] + arr.forEach(x => ret.unshift(x)) + return ret +} + +function entries (obj) { + return Object.keys(obj).map(k => [k, obj[k]]) +} diff --git a/node_modules/figgy-pudding/package.json b/node_modules/figgy-pudding/package.json new file mode 100644 index 0000000..1b8b6a8 --- /dev/null +++ b/node_modules/figgy-pudding/package.json @@ -0,0 +1,71 @@ +{ + "_from": "figgy-pudding@^3.5.1", + "_id": "figgy-pudding@3.5.1", + "_inBundle": false, + "_integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==", + "_location": "/figgy-pudding", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "figgy-pudding@^3.5.1", + "name": "figgy-pudding", + "escapedName": "figgy-pudding", + "rawSpec": "^3.5.1", + "saveSpec": null, + "fetchSpec": "^3.5.1" + }, + "_requiredBy": [ + "/cacache", + "/ssri" + ], + "_resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", + "_shasum": "862470112901c727a0e495a80744bd5baa1d6790", + "_spec": "figgy-pudding@^3.5.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/cacache", + "author": { + "name": "Kat Marchán", + "email": "kzm@sykosomatic.org" + }, + "bugs": { + "url": "https://github.com/zkat/figgy-pudding/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Delicious, festive, cascading config/opts definitions", + "devDependencies": { + "standard": "^11.0.1", + "standard-version": "^4.4.0", + "tap": "^12.0.1", + "weallbehave": "^1.2.0", + "weallcontribute": "^1.0.8" + }, + "files": [ + "*.js", + "lib" + ], + "homepage": "https://github.com/zkat/figgy-pudding#readme", + "keywords": [ + "config", + "options", + "yummy" + ], + "license": "ISC", + "main": "index.js", + "name": "figgy-pudding", + "repository": { + "type": "git", + "url": "git+https://github.com/zkat/figgy-pudding.git" + }, + "scripts": { + "postrelease": "npm publish && git push --follow-tags", + "prerelease": "npm t", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap -J --100 --coverage test/*.js", + "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", + "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + }, + "version": "3.5.1" +} diff --git a/node_modules/fill-range/LICENSE b/node_modules/fill-range/LICENSE new file mode 100644 index 0000000..d734237 --- /dev/null +++ b/node_modules/fill-range/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +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. diff --git a/node_modules/fill-range/README.md b/node_modules/fill-range/README.md new file mode 100644 index 0000000..bc1f8a0 --- /dev/null +++ b/node_modules/fill-range/README.md @@ -0,0 +1,250 @@ +# fill-range [![NPM version](https://img.shields.io/npm/v/fill-range.svg?style=flat)](https://www.npmjs.com/package/fill-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![NPM total downloads](https://img.shields.io/npm/dt/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/fill-range.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/fill-range) + +> Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex` + +## Table of Contents + +- [Install](#install) +- [Usage](#usage) +- [Examples](#examples) +- [Options](#options) + * [options.step](#optionsstep) + * [options.strictRanges](#optionsstrictranges) + * [options.stringify](#optionsstringify) + * [options.toRegex](#optionstoregex) + * [options.transform](#optionstransform) +- [About](#about) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save fill-range +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add fill-range +``` + +## Usage + +Expands numbers and letters, optionally using a `step` as the last argument. _(Numbers may be defined as JavaScript numbers or strings)_. + +```js +var fill = require('fill-range'); +fill(from, to[, step, options]); + +// examples +console.log(fill('1', '10')); //=> '[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ]' +console.log(fill('1', '10', {toRegex: true})); //=> [1-9]|10 +``` + +**Params** + +* `from`: **{String|Number}** the number or letter to start with +* `to`: **{String|Number}** the number or letter to end with +* `step`: **{String|Number|Object|Function}** Optionally pass a [step](#optionsstep) to use. +* `options`: **{Object|Function}**: See all available [options](#options) + +## Examples + +By default, an array of values is returned. + +**Alphabetical ranges** + +```js +console.log(fill('a', 'e')); //=> ['a', 'b', 'c', 'd', 'e'] +console.log(fill('A', 'E')); //=> [ 'A', 'B', 'C', 'D', 'E' ] +``` + +**Numerical ranges** + +Numbers can be defined as actual numbers or strings. + +```js +console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ] +console.log(fill('1', '5')); //=> [ 1, 2, 3, 4, 5 ] +``` + +**Negative ranges** + +Numbers can be defined as actual numbers or strings. + +```js +console.log(fill('-5', '-1')); //=> [ '-5', '-4', '-3', '-2', '-1' ] +console.log(fill('-5', '5')); //=> [ '-5', '-4', '-3', '-2', '-1', '0', '1', '2', '3', '4', '5' ] +``` + +**Steps (increments)** + +```js +// numerical ranges with increments +console.log(fill('0', '25', 4)); //=> [ '0', '4', '8', '12', '16', '20', '24' ] +console.log(fill('0', '25', 5)); //=> [ '0', '5', '10', '15', '20', '25' ] +console.log(fill('0', '25', 6)); //=> [ '0', '6', '12', '18', '24' ] + +// alphabetical ranges with increments +console.log(fill('a', 'z', 4)); //=> [ 'a', 'e', 'i', 'm', 'q', 'u', 'y' ] +console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ] +console.log(fill('a', 'z', 6)); //=> [ 'a', 'g', 'm', 's', 'y' ] +``` + +## Options + +### options.step + +**Type**: `number` (formatted as a string or number) + +**Default**: `undefined` + +**Description**: The increment to use for the range. Can be used with letters or numbers. + +**Example(s)** + +```js +// numbers +console.log(fill('1', '10', 2)); //=> [ '1', '3', '5', '7', '9' ] +console.log(fill('1', '10', 3)); //=> [ '1', '4', '7', '10' ] +console.log(fill('1', '10', 4)); //=> [ '1', '5', '9' ] + +// letters +console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ] +console.log(fill('a', 'z', 7)); //=> [ 'a', 'h', 'o', 'v' ] +console.log(fill('a', 'z', 9)); //=> [ 'a', 'j', 's' ] +``` + +### options.strictRanges + +**Type**: `boolean` + +**Default**: `false` + +**Description**: By default, `null` is returned when an invalid range is passed. Enable this option to throw a `RangeError` on invalid ranges. + +**Example(s)** + +The following are all invalid: + +```js +fill('1.1', '2'); // decimals not supported in ranges +fill('a', '2'); // incompatible range values +fill(1, 10, 'foo'); // invalid "step" argument +``` + +### options.stringify + +**Type**: `boolean` + +**Default**: `undefined` + +**Description**: Cast all returned values to strings. By default, integers are returned as numbers. + +**Example(s)** + +```js +console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ] +console.log(fill(1, 5, {stringify: true})); //=> [ '1', '2', '3', '4', '5' ] +``` + +### options.toRegex + +**Type**: `boolean` + +**Default**: `undefined` + +**Description**: Create a regex-compatible source string, instead of expanding values to an array. + +**Example(s)** + +```js +// alphabetical range +console.log(fill('a', 'e', {toRegex: true})); //=> '[a-e]' +// alphabetical with step +console.log(fill('a', 'z', 3, {toRegex: true})); //=> 'a|d|g|j|m|p|s|v|y' +// numerical range +console.log(fill('1', '100', {toRegex: true})); //=> '[1-9]|[1-9][0-9]|100' +// numerical range with zero padding +console.log(fill('000001', '100000', {toRegex: true})); +//=> '0{5}[1-9]|0{4}[1-9][0-9]|0{3}[1-9][0-9]{2}|0{2}[1-9][0-9]{3}|0[1-9][0-9]{4}|100000' +``` + +### options.transform + +**Type**: `function` + +**Default**: `undefined` + +**Description**: Customize each value in the returned array (or [string](#optionstoRegex)). _(you can also pass this function as the last argument to `fill()`)_. + +**Example(s)** + +```js +// increase padding by two +var arr = fill('01', '05', function(val, a, b, step, idx, arr, options) { + return repeat('0', (options.maxLength + 2) - val.length) + val; +}); + +console.log(arr); +//=> ['0001', '0002', '0003', '0004', '0005'] +``` + +## About + +### Related projects + +* [braces](https://www.npmjs.com/package/braces): Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) | [homepage](https://github.com/jonschlinkert/braces "Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces specification, without sacrificing speed.") +* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch.") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") +* [to-regex-range](https://www.npmjs.com/package/to-regex-range): Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than… [more](https://github.com/jonschlinkert/to-regex-range) | [homepage](https://github.com/jonschlinkert/to-regex-range "Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.87 million test assertions.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 103 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [paulmillr](https://github.com/paulmillr) | +| 1 | [edorivai](https://github.com/edorivai) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 23, 2017._ \ No newline at end of file diff --git a/node_modules/fill-range/index.js b/node_modules/fill-range/index.js new file mode 100644 index 0000000..294a2ed --- /dev/null +++ b/node_modules/fill-range/index.js @@ -0,0 +1,208 @@ +/*! + * fill-range + * + * Copyright (c) 2014-2015, 2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var util = require('util'); +var isNumber = require('is-number'); +var extend = require('extend-shallow'); +var repeat = require('repeat-string'); +var toRegex = require('to-regex-range'); + +/** + * Return a range of numbers or letters. + * + * @param {String} `start` Start of the range + * @param {String} `stop` End of the range + * @param {String} `step` Increment or decrement to use. + * @param {Function} `fn` Custom function to modify each element in the range. + * @return {Array} + */ + +function fillRange(start, stop, step, options) { + if (typeof start === 'undefined') { + return []; + } + + if (typeof stop === 'undefined' || start === stop) { + // special case, for handling negative zero + var isString = typeof start === 'string'; + if (isNumber(start) && !toNumber(start)) { + return [isString ? '0' : 0]; + } + return [start]; + } + + if (typeof step !== 'number' && typeof step !== 'string') { + options = step; + step = undefined; + } + + if (typeof options === 'function') { + options = { transform: options }; + } + + var opts = extend({step: step}, options); + if (opts.step && !isValidNumber(opts.step)) { + if (opts.strictRanges === true) { + throw new TypeError('expected options.step to be a number'); + } + return []; + } + + opts.isNumber = isValidNumber(start) && isValidNumber(stop); + if (!opts.isNumber && !isValid(start, stop)) { + if (opts.strictRanges === true) { + throw new RangeError('invalid range arguments: ' + util.inspect([start, stop])); + } + return []; + } + + opts.isPadded = isPadded(start) || isPadded(stop); + opts.toString = opts.stringify + || typeof opts.step === 'string' + || typeof start === 'string' + || typeof stop === 'string' + || !opts.isNumber; + + if (opts.isPadded) { + opts.maxLength = Math.max(String(start).length, String(stop).length); + } + + // support legacy minimatch/fill-range options + if (typeof opts.optimize === 'boolean') opts.toRegex = opts.optimize; + if (typeof opts.makeRe === 'boolean') opts.toRegex = opts.makeRe; + return expand(start, stop, opts); +} + +function expand(start, stop, options) { + var a = options.isNumber ? toNumber(start) : start.charCodeAt(0); + var b = options.isNumber ? toNumber(stop) : stop.charCodeAt(0); + + var step = Math.abs(toNumber(options.step)) || 1; + if (options.toRegex && step === 1) { + return toRange(a, b, start, stop, options); + } + + var zero = {greater: [], lesser: []}; + var asc = a < b; + var arr = new Array(Math.round((asc ? b - a : a - b) / step)); + var idx = 0; + + while (asc ? a <= b : a >= b) { + var val = options.isNumber ? a : String.fromCharCode(a); + if (options.toRegex && (val >= 0 || !options.isNumber)) { + zero.greater.push(val); + } else { + zero.lesser.push(Math.abs(val)); + } + + if (options.isPadded) { + val = zeros(val, options); + } + + if (options.toString) { + val = String(val); + } + + if (typeof options.transform === 'function') { + arr[idx++] = options.transform(val, a, b, step, idx, arr, options); + } else { + arr[idx++] = val; + } + + if (asc) { + a += step; + } else { + a -= step; + } + } + + if (options.toRegex === true) { + return toSequence(arr, zero, options); + } + return arr; +} + +function toRange(a, b, start, stop, options) { + if (options.isPadded) { + return toRegex(start, stop, options); + } + + if (options.isNumber) { + return toRegex(Math.min(a, b), Math.max(a, b), options); + } + + var start = String.fromCharCode(Math.min(a, b)); + var stop = String.fromCharCode(Math.max(a, b)); + return '[' + start + '-' + stop + ']'; +} + +function toSequence(arr, zeros, options) { + var greater = '', lesser = ''; + if (zeros.greater.length) { + greater = zeros.greater.join('|'); + } + if (zeros.lesser.length) { + lesser = '-(' + zeros.lesser.join('|') + ')'; + } + var res = greater && lesser + ? greater + '|' + lesser + : greater || lesser; + + if (options.capture) { + return '(' + res + ')'; + } + return res; +} + +function zeros(val, options) { + if (options.isPadded) { + var str = String(val); + var len = str.length; + var dash = ''; + if (str.charAt(0) === '-') { + dash = '-'; + str = str.slice(1); + } + var diff = options.maxLength - len; + var pad = repeat('0', diff); + val = (dash + pad + str); + } + if (options.stringify) { + return String(val); + } + return val; +} + +function toNumber(val) { + return Number(val) || 0; +} + +function isPadded(str) { + return /^-?0\d/.test(str); +} + +function isValid(min, max) { + return (isValidNumber(min) || isValidLetter(min)) + && (isValidNumber(max) || isValidLetter(max)); +} + +function isValidLetter(ch) { + return typeof ch === 'string' && ch.length === 1 && /^\w+$/.test(ch); +} + +function isValidNumber(n) { + return isNumber(n) && !/\./.test(n); +} + +/** + * Expose `fillRange` + * @type {Function} + */ + +module.exports = fillRange; diff --git a/node_modules/fill-range/node_modules/extend-shallow/LICENSE b/node_modules/fill-range/node_modules/extend-shallow/LICENSE new file mode 100644 index 0000000..fa30c4c --- /dev/null +++ b/node_modules/fill-range/node_modules/extend-shallow/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +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. diff --git a/node_modules/fill-range/node_modules/extend-shallow/README.md b/node_modules/fill-range/node_modules/extend-shallow/README.md new file mode 100644 index 0000000..cdc45d4 --- /dev/null +++ b/node_modules/fill-range/node_modules/extend-shallow/README.md @@ -0,0 +1,61 @@ +# extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow) + +> Extend an object with the properties of additional objects. node.js/javascript util. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i extend-shallow --save +``` + +## Usage + +```js +var extend = require('extend-shallow'); + +extend({a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +Pass an empty object to shallow clone: + +```js +var obj = {}; +extend(obj, {a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +## Related + +* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. +* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) +* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) +* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. +* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. +* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._ \ No newline at end of file diff --git a/node_modules/fill-range/node_modules/extend-shallow/index.js b/node_modules/fill-range/node_modules/extend-shallow/index.js new file mode 100644 index 0000000..92a067f --- /dev/null +++ b/node_modules/fill-range/node_modules/extend-shallow/index.js @@ -0,0 +1,33 @@ +'use strict'; + +var isObject = require('is-extendable'); + +module.exports = function extend(o/*, objects*/) { + if (!isObject(o)) { o = {}; } + + var len = arguments.length; + for (var i = 1; i < len; i++) { + var obj = arguments[i]; + + if (isObject(obj)) { + assign(o, obj); + } + } + return o; +}; + +function assign(a, b) { + for (var key in b) { + if (hasOwn(b, key)) { + a[key] = b[key]; + } + } +} + +/** + * Returns true if the given `key` is an own property of `obj`. + */ + +function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} diff --git a/node_modules/fill-range/node_modules/extend-shallow/package.json b/node_modules/fill-range/node_modules/extend-shallow/package.json new file mode 100644 index 0000000..f77421e --- /dev/null +++ b/node_modules/fill-range/node_modules/extend-shallow/package.json @@ -0,0 +1,87 @@ +{ + "_from": "extend-shallow@^2.0.1", + "_id": "extend-shallow@2.0.1", + "_inBundle": false, + "_integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "_location": "/fill-range/extend-shallow", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "extend-shallow@^2.0.1", + "name": "extend-shallow", + "escapedName": "extend-shallow", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/fill-range" + ], + "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "_shasum": "51af7d614ad9a9f610ea1bafbb989d6b1c56890f", + "_spec": "extend-shallow@^2.0.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/fill-range", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/extend-shallow/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "deprecated": false, + "description": "Extend an object with the properties of additional objects. node.js/javascript util.", + "devDependencies": { + "array-slice": "^0.2.3", + "benchmarked": "^0.1.4", + "chalk": "^1.0.0", + "for-own": "^0.1.3", + "glob": "^5.0.12", + "is-plain-object": "^2.0.1", + "kind-of": "^2.0.0", + "minimist": "^1.1.1", + "mocha": "^2.2.5", + "should": "^7.0.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/extend-shallow", + "keywords": [ + "assign", + "extend", + "javascript", + "js", + "keys", + "merge", + "obj", + "object", + "prop", + "properties", + "property", + "props", + "shallow", + "util", + "utility", + "utils", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "extend-shallow", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/extend-shallow.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.0.1" +} diff --git a/node_modules/fill-range/package.json b/node_modules/fill-range/package.json new file mode 100644 index 0000000..192092f --- /dev/null +++ b/node_modules/fill-range/package.json @@ -0,0 +1,130 @@ +{ + "_from": "fill-range@^4.0.0", + "_id": "fill-range@4.0.0", + "_inBundle": false, + "_integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "_location": "/fill-range", + "_phantomChildren": { + "is-extendable": "0.1.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "fill-range@^4.0.0", + "name": "fill-range", + "escapedName": "fill-range", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/braces" + ], + "_resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "_shasum": "d544811d428f98eb06a63dc402d2403c328c38f7", + "_spec": "fill-range@^4.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/braces", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/fill-range/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "email": "wtgtybhertgeghgtwtg@gmail.com", + "url": "https://github.com/wtgtybhertgeghgtwtg" + }, + { + "name": "Edo Rivai", + "email": "edo.rivai@gmail.com", + "url": "edo.rivai.nl" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Paul Miller", + "email": "paul+gh@paulmillr.com", + "url": "paulmillr.com" + } + ], + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "deprecated": false, + "description": "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`", + "devDependencies": { + "ansi-cyan": "^0.1.1", + "benchmarked": "^1.0.0", + "gulp-format-md": "^0.1.12", + "minimist": "^1.2.0", + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/fill-range", + "keywords": [ + "alpha", + "alphabetical", + "array", + "bash", + "brace", + "expand", + "expansion", + "fill", + "glob", + "match", + "matches", + "matching", + "number", + "numerical", + "range", + "ranges", + "regex", + "sh" + ], + "license": "MIT", + "main": "index.js", + "name": "fill-range", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/fill-range.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "braces", + "expand-range", + "micromatch", + "to-regex-range" + ] + }, + "toc": true, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "4.0.0" +} diff --git a/node_modules/find-cache-dir/index.js b/node_modules/find-cache-dir/index.js new file mode 100644 index 0000000..05dd5fc --- /dev/null +++ b/node_modules/find-cache-dir/index.js @@ -0,0 +1,32 @@ +'use strict'; +const path = require('path'); +const commonDir = require('commondir'); +const pkgDir = require('pkg-dir'); +const makeDir = require('make-dir'); + +module.exports = (options = {}) => { + const {name} = options; + let directory = options.cwd; + + if (options.files) { + directory = commonDir(directory, options.files); + } else { + directory = directory || process.cwd(); + } + + directory = pkgDir.sync(directory); + + if (directory) { + directory = path.join(directory, 'node_modules', '.cache', name); + + if (directory && options.create) { + makeDir.sync(directory); + } + + if (options.thunk) { + return (...arguments_) => path.join(directory, ...arguments_); + } + } + + return directory; +}; diff --git a/node_modules/find-cache-dir/license b/node_modules/find-cache-dir/license new file mode 100644 index 0000000..32a380a --- /dev/null +++ b/node_modules/find-cache-dir/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) James Talmage (github.com/jamestalmage) + +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. diff --git a/node_modules/find-cache-dir/package.json b/node_modules/find-cache-dir/package.json new file mode 100644 index 0000000..908db44 --- /dev/null +++ b/node_modules/find-cache-dir/package.json @@ -0,0 +1,74 @@ +{ + "_from": "find-cache-dir@^2.1.0", + "_id": "find-cache-dir@2.1.0", + "_inBundle": false, + "_integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "_location": "/find-cache-dir", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "find-cache-dir@^2.1.0", + "name": "find-cache-dir", + "escapedName": "find-cache-dir", + "rawSpec": "^2.1.0", + "saveSpec": null, + "fetchSpec": "^2.1.0" + }, + "_requiredBy": [ + "/terser-webpack-plugin" + ], + "_resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "_shasum": "8d0f94cd13fe43c6c7c261a0d86115ca918c05f7", + "_spec": "find-cache-dir@^2.1.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/terser-webpack-plugin", + "bugs": { + "url": "https://github.com/avajs/find-cache-dir/issues" + }, + "bundleDependencies": false, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "deprecated": false, + "description": "Finds the common standard cache directory", + "devDependencies": { + "ava": "^1.3.1", + "coveralls": "^3.0.3", + "del": "^4.0.0", + "nyc": "^13.3.0", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/avajs/find-cache-dir#readme", + "keywords": [ + "cache", + "directory", + "dir", + "caching", + "find", + "search" + ], + "license": "MIT", + "name": "find-cache-dir", + "nyc": { + "reporter": [ + "lcov", + "text" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/avajs/find-cache-dir.git" + }, + "scripts": { + "test": "xo && nyc ava" + }, + "version": "2.1.0" +} diff --git a/node_modules/find-cache-dir/readme.md b/node_modules/find-cache-dir/readme.md new file mode 100644 index 0000000..ddea29e --- /dev/null +++ b/node_modules/find-cache-dir/readme.md @@ -0,0 +1,116 @@ +# find-cache-dir [![Build Status](https://travis-ci.org/avajs/find-cache-dir.svg?branch=master)](https://travis-ci.org/avajs/find-cache-dir) [![Coverage Status](https://coveralls.io/repos/github/avajs/find-cache-dir/badge.svg?branch=master)](https://coveralls.io/github/avajs/find-cache-dir?branch=master) + +> Finds the common standard cache directory + +The [`nyc`](https://github.com/istanbuljs/nyc) and [`AVA`](https://ava.li) projects decided to standardize on a common directory structure for storing cache information: + +```sh +# nyc +./node_modules/.cache/nyc + +# ava +./node_modules/.cache/ava + +# your-module +./node_modules/.cache/your-module +``` + +This module makes it easy to correctly locate the cache directory according to this shared spec. If this pattern becomes ubiquitous, clearing the cache for multiple dependencies becomes easy and consistent: + +``` +rm -rf ./node_modules/.cache +``` + +If you decide to adopt this pattern, please file a PR adding your name to the list of adopters below. + + +## Install + +``` +$ npm install find-cache-dir +``` + + +## Usage + +```js +const findCacheDir = require('find-cache-dir'); + +findCacheDir({name: 'unicorns'}); +//=> '/user/path/node-modules/.cache/unicorns' +``` + + +## API + +### findCacheDir([options]) + +Finds the cache directory using the supplied options. The algorithm tries to find a `package.json` file, searching every parent directory of the `cwd` specified (or implied from other options). It returns a `string` containing the absolute path to the cache directory, or `null` if `package.json` was never found. + +#### options + +Type: `Object` + +##### name + +*Required*
+Type: `string` + +Should be the same as your project name in `package.json`. + +##### files + +Type: `string[]` `string` + +An array of files that will be searched for a common parent directory. This common parent directory will be used in lieu of the `cwd` option below. + +##### cwd + +Type: `string`
+Default `process.cwd()` + +Directory to start searching for a `package.json` from. + +##### create + +Type: `boolean`
+Default `false` + +If `true`, the directory will be created synchronously before returning. + +##### thunk + +Type: `boolean`
+Default `false` + +If `true`, this modifies the return type to be a function that is a thunk for `path.join(theFoundCacheDirectory)`. + +```js +const thunk = findCacheDir({name: 'foo', thunk: true}); + +thunk(); +//=> '/some/path/node_modules/.cache/foo' + +thunk('bar.js') +//=> '/some/path/node_modules/.cache/foo/bar.js' + +thunk('baz', 'quz.js') +//=> '/some/path/node_modules/.cache/foo/baz/quz.js' +``` + +This is helpful for actually putting actual files in the cache! + + +## Adopters + +- [`AVA`](https://ava.li) +- [`nyc`](https://github.com/istanbuljs/nyc) +- [`babel-loader`](https://github.com/babel/babel-loader) +- [`eslint-loader`](https://github.com/MoOx/eslint-loader) +- [`Phenomic`](https://phenomic.io) +- [`javascripthon-loader`](https://github.com/Beg-in/javascripthon-loader) + + +## License + +MIT diff --git a/node_modules/find-up/index.js b/node_modules/find-up/index.js new file mode 100644 index 0000000..8e83819 --- /dev/null +++ b/node_modules/find-up/index.js @@ -0,0 +1,46 @@ +'use strict'; +const path = require('path'); +const locatePath = require('locate-path'); + +module.exports = (filename, opts = {}) => { + const startDir = path.resolve(opts.cwd || ''); + const {root} = path.parse(startDir); + + const filenames = [].concat(filename); + + return new Promise(resolve => { + (function find(dir) { + locatePath(filenames, {cwd: dir}).then(file => { + if (file) { + resolve(path.join(dir, file)); + } else if (dir === root) { + resolve(null); + } else { + find(path.dirname(dir)); + } + }); + })(startDir); + }); +}; + +module.exports.sync = (filename, opts = {}) => { + let dir = path.resolve(opts.cwd || ''); + const {root} = path.parse(dir); + + const filenames = [].concat(filename); + + // eslint-disable-next-line no-constant-condition + while (true) { + const file = locatePath.sync(filenames, {cwd: dir}); + + if (file) { + return path.join(dir, file); + } + + if (dir === root) { + return null; + } + + dir = path.dirname(dir); + } +}; diff --git a/node_modules/find-up/license b/node_modules/find-up/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/find-up/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/find-up/package.json b/node_modules/find-up/package.json new file mode 100644 index 0000000..a8251cb --- /dev/null +++ b/node_modules/find-up/package.json @@ -0,0 +1,82 @@ +{ + "_from": "find-up@^3.0.0", + "_id": "find-up@3.0.0", + "_inBundle": false, + "_integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "_location": "/find-up", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "find-up@^3.0.0", + "name": "find-up", + "escapedName": "find-up", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/pkg-dir" + ], + "_resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "_shasum": "49169f1d7993430646da61ecc5ae355c21c97b73", + "_spec": "find-up@^3.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/pkg-dir", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/find-up/issues" + }, + "bundleDependencies": false, + "dependencies": { + "locate-path": "^3.0.0" + }, + "deprecated": false, + "description": "Find a file or directory by walking up parent directories", + "devDependencies": { + "ava": "*", + "tempy": "^0.2.1", + "xo": "*" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/find-up#readme", + "keywords": [ + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "package", + "resolve", + "parent", + "parents", + "folder", + "directory", + "dir", + "walk", + "walking", + "path" + ], + "license": "MIT", + "name": "find-up", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/find-up.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0" +} diff --git a/node_modules/find-up/readme.md b/node_modules/find-up/readme.md new file mode 100644 index 0000000..810ad7c --- /dev/null +++ b/node_modules/find-up/readme.md @@ -0,0 +1,87 @@ +# find-up [![Build Status: Linux and macOS](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/l0cyjmvh5lq72vq2/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/find-up/branch/master) + +> Find a file or directory by walking up parent directories + + +## Install + +``` +$ npm install find-up +``` + + +## Usage + +``` +/ +└── Users + └── sindresorhus + ├── unicorn.png + └── foo + └── bar + ├── baz + └── example.js +``` + +`example.js` + +```js +const findUp = require('find-up'); + +(async () => { + console.log(await findUp('unicorn.png')); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(['rainbow.png', 'unicorn.png'])); + //=> '/Users/sindresorhus/unicorn.png' +})(); +``` + + +## API + +### findUp(filename, [options]) + +Returns a `Promise` for either the filepath or `null` if it couldn't be found. + +### findUp([filenameA, filenameB], [options]) + +Returns a `Promise` for either the first filepath found (by respecting the order) or `null` if none could be found. + +### findUp.sync(filename, [options]) + +Returns a filepath or `null`. + +### findUp.sync([filenameA, filenameB], [options]) + +Returns the first filepath found (by respecting the order) or `null`. + +#### filename + +Type: `string` + +Filename of the file to find. + +#### options + +Type: `Object` + +##### cwd + +Type: `string`
+Default: `process.cwd()` + +Directory to start from. + + +## Related + +- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package +- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/findup-sync/LICENSE b/node_modules/findup-sync/LICENSE new file mode 100644 index 0000000..6e210d0 --- /dev/null +++ b/node_modules/findup-sync/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013-2018 Ben Alman , Blaine Bublitz , and Eric Schoffstall + +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. diff --git a/node_modules/findup-sync/README.md b/node_modules/findup-sync/README.md new file mode 100644 index 0000000..3d1b17b --- /dev/null +++ b/node_modules/findup-sync/README.md @@ -0,0 +1,57 @@ +

+ + + +

+ + +# findup-sync + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +Find the first file matching a given pattern in the current directory or the nearest ancestor directory. + +Matching is done with [micromatch][micromatch], please report any matching related issues on that repository. + +## Usage + +```js +var findup = require('findup-sync'); +findup(patternOrPatterns [, micromatchOptions]); + +// Start looking in the CWD. +var filepath1 = findup('{a,b}*.txt'); + +// Start looking somewhere else, and ignore case (probably a good idea). +var filepath2 = findup('{a,b}*.txt', {cwd: '/some/path', nocase: true}); +``` + +## API + +### `findup(patterns, [options])` + +* `patterns` **{String|Array}**: Glob pattern(s) or file path(s) to match against. +* `options` **{Object}**: Options to pass to [micromatch]. Note that if you want to start in a different directory than the current working directory, specify a `cwd` property here. +* `returns` **{String}**: Returns the first matching file. + +## License + +MIT + +[micromatch]: http://github.com/jonschlinkert/micromatch + +[downloads-image]: http://img.shields.io/npm/dm/findup-sync.svg +[npm-url]: https://www.npmjs.com/package/findup-sync +[npm-image]: http://img.shields.io/npm/v/findup-sync.svg + +[travis-url]: https://travis-ci.org/gulpjs/findup-sync +[travis-image]: http://img.shields.io/travis/gulpjs/findup-sync.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/findup-sync +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/findup-sync.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/findup-sync +[coveralls-image]: http://img.shields.io/coveralls/gulpjs/findup-sync/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/node_modules/findup-sync/index.js b/node_modules/findup-sync/index.js new file mode 100644 index 0000000..2a9e117 --- /dev/null +++ b/node_modules/findup-sync/index.js @@ -0,0 +1,87 @@ +'use strict'; + +/** + * Module dependencies + */ + +var fs = require('fs'); +var path = require('path'); +var isGlob = require('is-glob'); +var resolveDir = require('resolve-dir'); +var detect = require('detect-file'); +var mm = require('micromatch'); + +/** + * @param {String|Array} `pattern` Glob pattern or file path(s) to match against. + * @param {Object} `options` Options to pass to [micromatch]. Note that if you want to start in a different directory than the current working directory, specify the `options.cwd` property here. + * @return {String} Returns the first matching file. + * @api public + */ + +module.exports = function(patterns, options) { + options = options || {}; + var cwd = path.resolve(resolveDir(options.cwd || '')); + + if (typeof patterns === 'string') { + return lookup(cwd, [patterns], options); + } + + if (!Array.isArray(patterns)) { + throw new TypeError('findup-sync expects a string or array as the first argument.'); + } + + return lookup(cwd, patterns, options); +}; + +function lookup(cwd, patterns, options) { + var len = patterns.length; + var idx = -1; + var res; + + while (++idx < len) { + if (isGlob(patterns[idx])) { + res = matchFile(cwd, patterns[idx], options); + } else { + res = findFile(cwd, patterns[idx], options); + } + if (res) { + return res; + } + } + + var dir = path.dirname(cwd); + if (dir === cwd) { + return null; + } + return lookup(dir, patterns, options); +} + +function matchFile(cwd, pattern, opts) { + var isMatch = mm.matcher(pattern, opts); + var files = tryReaddirSync(cwd); + var len = files.length; + var idx = -1; + + while (++idx < len) { + var name = files[idx]; + var fp = path.join(cwd, name); + if (isMatch(name) || isMatch(fp)) { + return fp; + } + } + return null; +} + +function findFile(cwd, filename, options) { + var fp = cwd ? path.resolve(cwd, filename) : filename; + return detect(fp, options); +} + +function tryReaddirSync(fp) { + try { + return fs.readdirSync(fp); + } catch (err) { + // Ignore error + } + return []; +} diff --git a/node_modules/findup-sync/package.json b/node_modules/findup-sync/package.json new file mode 100644 index 0000000..577db42 --- /dev/null +++ b/node_modules/findup-sync/package.json @@ -0,0 +1,105 @@ +{ + "_from": "findup-sync@3.0.0", + "_id": "findup-sync@3.0.0", + "_inBundle": false, + "_integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", + "_location": "/findup-sync", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "findup-sync@3.0.0", + "name": "findup-sync", + "escapedName": "findup-sync", + "rawSpec": "3.0.0", + "saveSpec": null, + "fetchSpec": "3.0.0" + }, + "_requiredBy": [ + "/webpack-cli" + ], + "_resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", + "_shasum": "17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1", + "_spec": "findup-sync@3.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/webpack-cli", + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "http://gulpjs.com/" + }, + "bugs": { + "url": "https://github.com/gulpjs/findup-sync/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Ben Alman", + "email": "cowboy@rj3.net" + }, + { + "name": "Tyler Kellen", + "email": "tyler@sleekcode.net" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com" + } + ], + "dependencies": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + }, + "deprecated": false, + "description": "Find the first file matching a given pattern in the current directory or the nearest ancestor directory.", + "devDependencies": { + "eslint": "^2.13.0", + "eslint-config-gulp": "^3.0.1", + "expect": "^1.20.2", + "homedir-polyfill": "^1.0.1", + "istanbul": "^0.4.3", + "istanbul-coveralls": "^1.0.3", + "mocha": "^3.5.3", + "normalize-path": "^3.0.0", + "resolve": "^1.4.0" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "index.js", + "LICENSE" + ], + "homepage": "https://github.com/gulpjs/findup-sync#readme", + "keywords": [ + "file", + "find", + "find-up", + "findup", + "glob", + "match", + "pattern", + "resolve", + "search" + ], + "license": "MIT", + "main": "index.js", + "name": "findup-sync", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/findup-sync.git" + }, + "scripts": { + "cover": "istanbul cover _mocha --report lcovonly", + "coveralls": "npm run cover && istanbul-coveralls", + "lint": "eslint .", + "pretest": "npm run lint", + "test": "mocha --async-only" + }, + "version": "3.0.0" +} diff --git a/node_modules/fined/LICENSE b/node_modules/fined/LICENSE new file mode 100644 index 0000000..538c116 --- /dev/null +++ b/node_modules/fined/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016, 2017, 2018 Blaine Bublitz and Eric Schoffstall + +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. diff --git a/node_modules/fined/README.md b/node_modules/fined/README.md new file mode 100644 index 0000000..d0ec267 --- /dev/null +++ b/node_modules/fined/README.md @@ -0,0 +1,81 @@ +

+ + + +

+ +# fined + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +Find a file given a declaration of locations. + +## Usage + +```js +var fined = require('fined'); + +fined({ path: 'path/to/file', extensions: ['.js', '.json'] }); +// => { path: '/absolute/path/to/file.js', extension: '.js' } (if file exists) +// => null (if file does not exist) + +var opts = { + name: '.app', + cwd: '.', + extensions: { + 'rc': 'default-rc-loader', + '.yml': 'default-yml-loader', + }, +}; + +fined({ path: '.' }, opts); +// => { path: '/absolute/of/cwd/.app.yml', extension: { '.yml': 'default-yml-loader' } } + +fined({ path: '~', extensions: { 'rc': 'some-special-rc-loader' } }, opts); +// => { path: '/User/home/.apprc', extension: { 'rc': 'some-special-rc-loader' } } +``` + +## API + +### fined(pathObj, opts) => object | null + +#### Arguments: + +* **pathObj** [string | object] : a path setting for finding a file. +* **opts** [object] : a plain object supplements `pathObj`. + + `pathObj` and `opts` can have same properties: + + * **path** [string] : a path string. + * **name** [string] : a basename. + * **extensions**: [string | array | object] : extensions. + * **cwd**: a base directory of `path` and for finding up. + * **findUp**: [boolean] : a flag to find up. + +#### Return: + +This function returns a plain object which consists of following properties if a file exists otherwise null. + + * **path** : an absolute path + * **extension** : a string or a plain object of extension. + + +## License + +MIT + +[downloads-image]: http://img.shields.io/npm/dm/fined.svg +[npm-url]: https://www.npmjs.com/package/fined +[npm-image]: http://img.shields.io/npm/v/fined.svg + +[travis-url]: https://travis-ci.org/gulpjs/fined +[travis-image]: http://img.shields.io/travis/gulpjs/fined.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/fined +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/fined.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/fined +[coveralls-image]: http://img.shields.io/coveralls/gulpjs/fined/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/node_modules/fined/index.js b/node_modules/fined/index.js new file mode 100644 index 0000000..1a66ab2 --- /dev/null +++ b/node_modules/fined/index.js @@ -0,0 +1,174 @@ +'use strict'; + +var fs = require('fs'); +var path = require('path'); + +var isPlainObject = require('is-plain-object'); +var pick = require('object.pick'); +var defaults = require('object.defaults/immutable'); +var expandTilde = require('expand-tilde'); +var parsePath = require('parse-filepath'); + + +function fined(pathObj, defaultObj) { + var expandedPath = expandPath(pathObj, defaultObj); + return expandedPath ? findWithExpandedPath(expandedPath) : null; +} + +function expandPath(pathObj, defaultObj) { + if (!isPlainObject(defaultObj)) { + defaultObj = {}; + } + + if (isString(pathObj)) { + pathObj = { path: pathObj }; + } + + if (!isPlainObject(pathObj)) { + pathObj = {}; + } + + pathObj = defaults(pathObj, defaultObj); + + var filePath; + if (!isString(pathObj.path)) { + return null; + } + // Execution of toString is for a String object. + if (isString(pathObj.name) && pathObj.name) { + if (pathObj.path) { + filePath = expandTilde(pathObj.path.toString()); + filePath = path.join(filePath, pathObj.name.toString()); + } else { + filePath = pathObj.name.toString(); + } + } else { + filePath = expandTilde(pathObj.path.toString()); + } + + var extArr = createExtensionArray(pathObj.extensions); + var extMap = createExtensionMap(pathObj.extensions); + + var basedir = isString(pathObj.cwd) ? pathObj.cwd.toString() : '.'; + basedir = path.resolve(expandTilde(basedir)); + + var findUp = !!pathObj.findUp; + + var parsed = parsePath(filePath); + if (parsed.isAbsolute) { + filePath = filePath.slice(parsed.root.length); + findUp = false; + basedir = parsed.root; + /* istanbul ignore if */ + } else if (parsed.root) { // Expanded path has a drive letter on Windows. + filePath = filePath.slice(parsed.root.length); + basedir = path.resolve(parsed.root); + } + + if (parsed.ext) { + filePath = filePath.slice(0, -parsed.ext.length); + // This ensures that only the original extension is matched. + extArr = [parsed.ext]; + } + + return { + path: filePath, + basedir: basedir, + findUp: findUp, + extArr: extArr, + extMap: extMap, + }; +} + +function findWithExpandedPath(expanded) { + var found = expanded.findUp ? + findUpFile(expanded.basedir, expanded.path, expanded.extArr) : + findFile(expanded.basedir, expanded.path, expanded.extArr); + + if (!found) { + return null; + } + + if (expanded.extMap) { + found.extension = pick(expanded.extMap, found.extension); + } + return found; +} + +function findFile(basedir, relpath, extArr) { + var noExtPath = path.resolve(basedir, relpath); + for (var i = 0, n = extArr.length; i < n; i++) { + var filepath = noExtPath + extArr[i]; + try { + fs.statSync(filepath); + return { path: filepath, extension: extArr[i] }; + } catch (e) { + // Ignore error + } + } + + return null; +} + +function findUpFile(basedir, filepath, extArr) { + var lastdir; + do { + var found = findFile(basedir, filepath, extArr); + if (found) { + return found; + } + + lastdir = basedir; + basedir = path.dirname(basedir); + } while (lastdir !== basedir); + + return null; +} + +function createExtensionArray(exts) { + if (isString(exts)) { + return [exts]; + } + + if (Array.isArray(exts)) { + exts = exts.filter(isString); + return (exts.length > 0) ? exts : ['']; + } + + if (isPlainObject(exts)) { + exts = Object.keys(exts); + return (exts.length > 0) ? exts : ['']; + } + + return ['']; +} + +function createExtensionMap(exts) { + if (!isPlainObject(exts)) { + return null; + } + + if (isEmpty(exts)) { + return { '': null }; + } + + return exts; +} + +function isEmpty(object) { + return !Object.keys(object).length; +} + +function isString(value) { + if (typeof value === 'string') { + return true; + } + + if (Object.prototype.toString.call(value) === '[object String]') { + return true; + } + + return false; +} + +module.exports = fined; diff --git a/node_modules/fined/package.json b/node_modules/fined/package.json new file mode 100644 index 0000000..d33bd11 --- /dev/null +++ b/node_modules/fined/package.json @@ -0,0 +1,89 @@ +{ + "_from": "fined@^1.0.1", + "_id": "fined@1.2.0", + "_inBundle": false, + "_integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", + "_location": "/fined", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fined@^1.0.1", + "name": "fined", + "escapedName": "fined", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/liftoff" + ], + "_resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", + "_shasum": "d00beccf1aa2b475d16d423b0238b713a2c4a37b", + "_spec": "fined@^1.0.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/liftoff", + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "http://gulpjs.com/" + }, + "bugs": { + "url": "https://github.com/gulpjs/fined/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Takayuki Sato", + "email": "sttk.xslet@gmail.com" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com" + } + ], + "dependencies": { + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" + }, + "deprecated": false, + "description": "Find a file given a declaration of locations.", + "devDependencies": { + "eslint": "^2.13.0", + "eslint-config-gulp": "^3.0.1", + "expect": "^1.20.2", + "istanbul": "^0.4.3", + "istanbul-coveralls": "^1.0.3", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "index.js", + "LICENSE" + ], + "homepage": "https://github.com/gulpjs/fined#readme", + "keywords": [ + "find", + "lookup", + "config" + ], + "license": "MIT", + "main": "index.js", + "name": "fined", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/fined.git" + }, + "scripts": { + "cover": "istanbul cover _mocha --report lcovonly", + "coveralls": "npm run cover && istanbul-coveralls", + "lint": "eslint .", + "pretest": "npm run lint", + "test": "mocha --async-only" + }, + "version": "1.2.0" +} diff --git a/node_modules/flagged-respawn/LICENSE b/node_modules/flagged-respawn/LICENSE new file mode 100644 index 0000000..ca63f90 --- /dev/null +++ b/node_modules/flagged-respawn/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2018 Tyler Kellen , Blaine Bublitz , and Eric Schoffstall + +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. diff --git a/node_modules/flagged-respawn/README.md b/node_modules/flagged-respawn/README.md new file mode 100644 index 0000000..44899fc --- /dev/null +++ b/node_modules/flagged-respawn/README.md @@ -0,0 +1,111 @@ +

+ + + +

+ +# flagged-respawn + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +A tool for respawning node binaries when special flags are present. + +## What is it? + +Say you wrote a command line tool that runs arbitrary javascript (e.g. task runner, test framework, etc). For the sake of discussion, let's pretend it's a testing harness you've named `testify`. + +Everything is going splendidly until one day you decide to test some code that relies on a feature behind a v8 flag in node (`--harmony`, for example). Without much thought, you run `testify --harmony spec tests.js`. + +It doesn't work. After digging around for a bit, you realize this produces a [`process.argv`](http://nodejs.org/docs/latest/api/process.html#process_process_argv) of: + +`['node', '/usr/local/bin/test', '--harmony', 'spec', 'tests.js']` + +Crap. The `--harmony` flag is in the wrong place! It should be applied to the **node** command, not our binary. What we actually wanted was this: + +`['node', '--harmony', '/usr/local/bin/test', 'spec', 'tests.js']` + +Flagged-respawn fixes this problem and handles all the edge cases respawning creates, such as: +- Providing a method to determine if a respawn is needed. +- Piping stderr/stdout from the child into the parent. +- Making the parent process exit with the same code as the child. +- If the child is killed, making the parent exit with the same signal. + +To see it in action, clone this repository and run `npm install` / `npm run respawn` / `npm run nospawn`. + +## Sample Usage + +```js +#!/usr/bin/env node + +const flaggedRespawn = require('flagged-respawn'); + +// get a list of all possible v8 flags for the running version of node +const v8flags = require('v8flags').fetch(); + +flaggedRespawn(v8flags, process.argv, function (ready, child) { + if (ready) { + console.log('Running!'); + // your cli code here + } else { + console.log('Special flags found, respawning.'); + } + if (process.pid !== child.pid) { + console.log('Respawned to PID:', child.pid); + } +}); + +``` + + +## API + +### flaggedRespawn(flags, argv, [ forcedFlags, ] callback) : Void + +Respawns the script itself when *argv* has special flag contained in *flags* and/or *forcedFlags* is not empty. Because members of *flags* and *forcedFlags* are passed to `node` command, each of them needs to be a node flag or a V8 flag. + +#### Forbid respawning + +If `--no-respawning` flag is given in *argv*, this function does not respawned even if *argv* contains members of flags or *forcedFlags* is not empty. (This flag is also used internally to prevent from respawning more than once). + +#### Parameter: + +| Parameter | Type | Description | +|:--------------|:------:|:----------------------------------------------------| +| *flags* | Array | An array of node flags and V8 flags which are available when present in *argv*. | +| *argv* | Array | Command line arguments to respawn. | +| *forcedFlags* | Array or String | An array of node flags or a string of a single flag and V8 flags for respawning forcely. | +| *callback* | function | A called function when not respawning or after respawned. | + +* **callback(ready, proc, argv) : Void** + + *callback* function is called both when respawned or not, and it can be distinguished by callback's argument: *ready*. (*ready* indicates whether a process spawned its child process (false) or not (true), but it does not indicate whether a process is a spawned child process or not. *ready* for a spawned child process is true.) + + *argv* is an array of command line arguments which is respawned (when *ready* is false) or is passed current process except flags within *flags* and `--no-respawning` (when *ready* is true). + + **Parameter:** + + | Parameter | Type | Description | + |:----------|:-------:|:--------------------------| + | *ready* | boolean | True, if not respawning and is ready to execute main function. | + | *proc* | object | Child process object if respawned, otherwise current process object. | + | *argv* | Array | An array of command line arguments. | + +## License + +MIT + +[downloads-image]: http://img.shields.io/npm/dm/flagged-respawn.svg +[npm-url]: https://www.npmjs.com/package/flagged-respawn +[npm-image]: http://img.shields.io/npm/v/flagged-respawn.svg + +[travis-url]: https://travis-ci.org/gulpjs/flagged-respawn +[travis-image]: http://img.shields.io/travis/gulpjs/flagged-respawn.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/flagged-respawn +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/flagged-respawn.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/flagged-respawn +[coveralls-image]: http://img.shields.io/coveralls/gulpjs/flagged-respawn/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/node_modules/flagged-respawn/index.js b/node_modules/flagged-respawn/index.js new file mode 100644 index 0000000..15c1c1f --- /dev/null +++ b/node_modules/flagged-respawn/index.js @@ -0,0 +1,52 @@ +var reorder = require('./lib/reorder'); +var respawn = require('./lib/respawn'); +var remover = require('./lib/remover'); + +var FORBID_RESPAWNING_FLAG = '--no-respawning'; + +module.exports = function(flags, argv, forcedFlags, execute) { + if (!flags) { + throw new Error('You must specify flags to respawn with.'); + } + if (!argv) { + throw new Error('You must specify an argv array.'); + } + + if (typeof forcedFlags === 'function') { + execute = forcedFlags; + forcedFlags = []; + } + + if (typeof forcedFlags === 'string') { + forcedFlags = [forcedFlags]; + } + + if (!Array.isArray(forcedFlags)) { + forcedFlags = []; + } + + var index = argv.indexOf(FORBID_RESPAWNING_FLAG); + if (index >= 0) { + argv = argv.slice(0, index).concat(argv.slice(index + 1)); + argv = remover(flags, argv); + execute(true, process, argv); + return; + } + + var proc = process; + var reordered = reorder(flags, argv); + var ready = JSON.stringify(argv) === JSON.stringify(reordered); + + if (forcedFlags.length) { + reordered = reordered.slice(0, 1) + .concat(forcedFlags) + .concat(reordered.slice(1)); + ready = false; + } + + if (!ready) { + reordered.push(FORBID_RESPAWNING_FLAG); + proc = respawn(reordered); + } + execute(ready, proc, reordered); +}; diff --git a/node_modules/flagged-respawn/lib/is-v8flags.js b/node_modules/flagged-respawn/lib/is-v8flags.js new file mode 100644 index 0000000..34df9d2 --- /dev/null +++ b/node_modules/flagged-respawn/lib/is-v8flags.js @@ -0,0 +1,13 @@ +function isV8flags(flag, v8flags) { + return v8flags.indexOf(replaceSeparatorsFromDashesToUnderscores(flag)) >= 0; +} + +function replaceSeparatorsFromDashesToUnderscores(flag) { + var arr = /^(-+)(.*)$/.exec(flag); + if (!arr) { + return flag; + } + return arr[1] + arr[2].replace(/\-/g, '_'); +} + +module.exports = isV8flags; diff --git a/node_modules/flagged-respawn/lib/remover.js b/node_modules/flagged-respawn/lib/remover.js new file mode 100644 index 0000000..3d194fa --- /dev/null +++ b/node_modules/flagged-respawn/lib/remover.js @@ -0,0 +1,13 @@ +var isV8flags = require('./is-v8flags'); + +module.exports = function(flags, argv) { + var args = argv.slice(0, 1); + for (var i = 1, n = argv.length; i < n; i++) { + var arg = argv[i]; + var flag = arg.split('=')[0]; + if (!isV8flags(flag, flags)) { + args.push(arg); + } + } + return args; +}; diff --git a/node_modules/flagged-respawn/lib/reorder.js b/node_modules/flagged-respawn/lib/reorder.js new file mode 100644 index 0000000..125fc6c --- /dev/null +++ b/node_modules/flagged-respawn/lib/reorder.js @@ -0,0 +1,18 @@ +var isV8flags = require('./is-v8flags'); + +module.exports = function(flags, argv) { + if (!argv) { + argv = process.argv; + } + var args = [argv[1]]; + argv.slice(2).forEach(function(arg) { + var flag = arg.split('=')[0]; + if (isV8flags(flag, flags)) { + args.unshift(arg); + } else { + args.push(arg); + } + }); + args.unshift(argv[0]); + return args; +}; diff --git a/node_modules/flagged-respawn/lib/respawn.js b/node_modules/flagged-respawn/lib/respawn.js new file mode 100644 index 0000000..c7e40fe --- /dev/null +++ b/node_modules/flagged-respawn/lib/respawn.js @@ -0,0 +1,16 @@ +var spawn = require('child_process').spawn; + +module.exports = function(argv) { + var child = spawn(argv[0], argv.slice(1), { stdio: 'inherit' }); + child.on('exit', function(code, signal) { + process.on('exit', function() { + /* istanbul ignore if */ + if (signal) { + process.kill(process.pid, signal); + } else { + process.exit(code); + } + }); + }); + return child; +}; diff --git a/node_modules/flagged-respawn/package.json b/node_modules/flagged-respawn/package.json new file mode 100644 index 0000000..9056f1e --- /dev/null +++ b/node_modules/flagged-respawn/package.json @@ -0,0 +1,95 @@ +{ + "_from": "flagged-respawn@^1.0.0", + "_id": "flagged-respawn@1.0.1", + "_inBundle": false, + "_integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", + "_location": "/flagged-respawn", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "flagged-respawn@^1.0.0", + "name": "flagged-respawn", + "escapedName": "flagged-respawn", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/liftoff" + ], + "_resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", + "_shasum": "e7de6f1279ddd9ca9aac8a5971d618606b3aab41", + "_spec": "flagged-respawn@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/liftoff", + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "http://gulpjs.com/" + }, + "bugs": { + "url": "https://github.com/gulpjs/flagged-respawn/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Takayuki Sato", + "email": "sttk.xslet@gmail.com" + }, + { + "name": "Bertrand Marron", + "email": "bertrand.marron@ionisx.com" + }, + { + "name": "Tyler Kellen", + "email": "tyler@sleekcode.net" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "A tool for respawning node binaries when special flags are present.", + "devDependencies": { + "eslint": "^2.13.0", + "eslint-config-gulp": "^3.0.1", + "expect": "^1.20.2", + "istanbul": "^0.4.3", + "istanbul-coveralls": "^1.0.3", + "mocha": "^3.5.3", + "nyc": "^11.3.0", + "v8flags": "^3.0.1" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "index.js", + "lib/", + "LICENSE" + ], + "homepage": "https://github.com/gulpjs/flagged-respawn#readme", + "keywords": [ + "respawn", + "flags" + ], + "license": "MIT", + "main": "index.js", + "name": "flagged-respawn", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/flagged-respawn.git" + }, + "scripts": { + "cover": "nyc --reporter=lcov --reporter=text-summary npm test", + "coveralls": "npm run cover && istanbul-coveralls", + "lint": "eslint .", + "nospawn": "node test/bin/respawner test", + "pretest": "npm run lint", + "respawn": "node test/bin/respawner --harmony test", + "test": "mocha --async-only" + }, + "version": "1.0.1" +} diff --git a/node_modules/flush-write-stream/.travis.yml b/node_modules/flush-write-stream/.travis.yml new file mode 100644 index 0000000..4689cb7 --- /dev/null +++ b/node_modules/flush-write-stream/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - '4' + - '6' + - '8' + - '10' diff --git a/node_modules/flush-write-stream/LICENSE b/node_modules/flush-write-stream/LICENSE new file mode 100644 index 0000000..66a4d2a --- /dev/null +++ b/node_modules/flush-write-stream/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Mathias Buus + +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. diff --git a/node_modules/flush-write-stream/README.md b/node_modules/flush-write-stream/README.md new file mode 100644 index 0000000..7ea7b69 --- /dev/null +++ b/node_modules/flush-write-stream/README.md @@ -0,0 +1,59 @@ +# flush-write-stream + +A write stream constructor that supports a flush function that is called before `finish` is emitted + +``` +npm install flush-write-stream +``` + +[![build status](http://img.shields.io/travis/mafintosh/flush-write-stream.svg?style=flat)](http://travis-ci.org/mafintosh/flush-write-stream) + +## Usage + +``` js +var writer = require('flush-write-stream') + +var ws = writer(write, flush) + +ws.on('finish', function () { + console.log('finished') +}) + +ws.write('hello') +ws.write('world') +ws.end() + +function write (data, enc, cb) { + // i am your normal ._write method + console.log('writing', data.toString()) + cb() +} + +function flush (cb) { + // i am called before finish is emitted + setTimeout(cb, 1000) // wait 1 sec +} +``` + +If you run the above it will produce the following output + +``` +writing hello +writing world +(nothing happens for 1 sec) +finished +``` + +## API + +#### `var ws = writer([options], write, [flush])` + +Create a new writable stream. Options are forwarded to the stream constructor. + +#### `var ws = writer.obj([options], write, [flush])` + +Same as the above except `objectMode` is set to `true` per default. + +## License + +MIT diff --git a/node_modules/flush-write-stream/example.js b/node_modules/flush-write-stream/example.js new file mode 100644 index 0000000..fa6b5da --- /dev/null +++ b/node_modules/flush-write-stream/example.js @@ -0,0 +1,22 @@ +var writer = require('./') + +var ws = writer(write, flush) + +ws.on('finish', function () { + console.log('finished') +}) + +ws.write('hello') +ws.write('world') +ws.end() + +function write (data, enc, cb) { + // i am your normal ._write method + console.log('writing', data.toString()) + cb() +} + +function flush (cb) { + // i am called before finish is emitted + setTimeout(cb, 1000) // wait 1 sec +} diff --git a/node_modules/flush-write-stream/index.js b/node_modules/flush-write-stream/index.js new file mode 100644 index 0000000..d7c6209 --- /dev/null +++ b/node_modules/flush-write-stream/index.js @@ -0,0 +1,54 @@ +var stream = require('readable-stream') +var inherits = require('inherits') + +var SIGNAL_FLUSH =(Buffer.from && Buffer.from !== Uint8Array.from) + ? Buffer.from([0]) + : new Buffer([0]) + +module.exports = WriteStream + +function WriteStream (opts, write, flush) { + if (!(this instanceof WriteStream)) return new WriteStream(opts, write, flush) + + if (typeof opts === 'function') { + flush = write + write = opts + opts = {} + } + + stream.Writable.call(this, opts) + + this.destroyed = false + this._worker = write || null + this._flush = flush || null +} + +inherits(WriteStream, stream.Writable) + +WriteStream.obj = function (opts, worker, flush) { + if (typeof opts === 'function') return WriteStream.obj(null, opts, worker) + if (!opts) opts = {} + opts.objectMode = true + return new WriteStream(opts, worker, flush) +} + +WriteStream.prototype._write = function (data, enc, cb) { + if (SIGNAL_FLUSH === data) this._flush(cb) + else this._worker(data, enc, cb) +} + +WriteStream.prototype.end = function (data, enc, cb) { + if (!this._flush) return stream.Writable.prototype.end.apply(this, arguments) + if (typeof data === 'function') return this.end(null, null, data) + if (typeof enc === 'function') return this.end(data, null, enc) + if (data) this.write(data) + if (!this._writableState.ending) this.write(SIGNAL_FLUSH) + return stream.Writable.prototype.end.call(this, cb) +} + +WriteStream.prototype.destroy = function (err) { + if (this.destroyed) return + this.destroyed = true + if (err) this.emit('error', err) + this.emit('close') +} diff --git a/node_modules/flush-write-stream/package.json b/node_modules/flush-write-stream/package.json new file mode 100644 index 0000000..20f7941 --- /dev/null +++ b/node_modules/flush-write-stream/package.json @@ -0,0 +1,54 @@ +{ + "_from": "flush-write-stream@^1.0.0", + "_id": "flush-write-stream@1.1.1", + "_inBundle": false, + "_integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "_location": "/flush-write-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "flush-write-stream@^1.0.0", + "name": "flush-write-stream", + "escapedName": "flush-write-stream", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/mississippi" + ], + "_resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "_shasum": "8dd7d873a1babc207d94ead0c2e0e44276ebf2e8", + "_spec": "flush-write-stream@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/mississippi", + "author": { + "name": "Mathias Buus", + "url": "@mafintosh" + }, + "bugs": { + "url": "https://github.com/mafintosh/flush-write-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + }, + "deprecated": false, + "description": "A write stream constructor that supports a flush function that is called before finish is emitted", + "devDependencies": { + "tape": "^4.2.2" + }, + "homepage": "https://github.com/mafintosh/flush-write-stream", + "license": "MIT", + "main": "index.js", + "name": "flush-write-stream", + "repository": { + "type": "git", + "url": "git+https://github.com/mafintosh/flush-write-stream.git" + }, + "scripts": { + "test": "tape test.js" + }, + "version": "1.1.1" +} diff --git a/node_modules/flush-write-stream/test.js b/node_modules/flush-write-stream/test.js new file mode 100644 index 0000000..6cd0c20 --- /dev/null +++ b/node_modules/flush-write-stream/test.js @@ -0,0 +1,85 @@ +var tape = require('tape') +var writer = require('./') + +tape('is a write stream', function (t) { + var expected = ['hello', 'world', 'verden'] + var ws = writer.obj(write) + + ws.write('hello') + ws.write('world') + ws.write('verden') + ws.end(function () { + t.same(expected.length, 0) + t.end() + }) + + function write (data, enc, cb) { + t.same(data, expected.shift()) + cb() + } +}) + +tape('is flushable', function (t) { + var expected = ['hello', 'world', 'verden'] + var flushed = false + + var ws = writer.obj(write, flush) + + ws.write('hello') + ws.write('world') + ws.write('verden') + ws.end(function () { + t.same(expected.length, 0) + t.ok(flushed, 'was flushed') + t.end() + }) + + function write (data, enc, cb) { + t.same(data, expected.shift()) + cb() + } + + function flush (cb) { + flushed = true + process.nextTick(cb) + } +}) + +tape('can pass options', function (t) { + var expected = ['hello', 'world', 'verden'] + var flushed = false + + var ws = writer({objectMode: true}, write, flush) + + ws.write('hello') + ws.write('world') + ws.write('verden') + ws.end(function () { + t.same(expected.length, 0) + t.ok(flushed, 'was flushed') + t.end() + }) + + function write (data, enc, cb) { + t.same(data, expected.shift()) + cb() + } + + function flush (cb) { + flushed = true + process.nextTick(cb) + } +}) + +tape('emits error on destroy', function (t) { + var expected = new Error() + + var ws = writer({objectMode: true}, function () {}) + + ws.on('error', function (err) { + t.equal(err, expected) + }) + ws.on('close', t.end) + + ws.destroy(expected) +}) diff --git a/node_modules/for-in/LICENSE b/node_modules/for-in/LICENSE new file mode 100644 index 0000000..d734237 --- /dev/null +++ b/node_modules/for-in/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +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. diff --git a/node_modules/for-in/README.md b/node_modules/for-in/README.md new file mode 100644 index 0000000..874e189 --- /dev/null +++ b/node_modules/for-in/README.md @@ -0,0 +1,85 @@ +# for-in [![NPM version](https://img.shields.io/npm/v/for-in.svg?style=flat)](https://www.npmjs.com/package/for-in) [![NPM monthly downloads](https://img.shields.io/npm/dm/for-in.svg?style=flat)](https://npmjs.org/package/for-in) [![NPM total downloads](https://img.shields.io/npm/dt/for-in.svg?style=flat)](https://npmjs.org/package/for-in) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/for-in.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/for-in) + +> Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save for-in +``` + +## Usage + +```js +var forIn = require('for-in'); + +var obj = {a: 'foo', b: 'bar', c: 'baz'}; +var values = []; +var keys = []; + +forIn(obj, function (value, key, o) { + keys.push(key); + values.push(value); +}); + +console.log(keys); +//=> ['a', 'b', 'c']; + +console.log(values); +//=> ['foo', 'bar', 'baz']; +``` + +## About + +### Related projects + +* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") +* [collection-map](https://www.npmjs.com/package/collection-map): Returns an array of mapped values from an array or object. | [homepage](https://github.com/jonschlinkert/collection-map "Returns an array of mapped values from an array or object.") +* [for-own](https://www.npmjs.com/package/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) | [homepage](https://github.com/jonschlinkert/for-own "Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 16 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [paulirish](https://github.com/paulirish) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 28, 2017._ \ No newline at end of file diff --git a/node_modules/for-in/index.js b/node_modules/for-in/index.js new file mode 100644 index 0000000..0b5f95f --- /dev/null +++ b/node_modules/for-in/index.js @@ -0,0 +1,16 @@ +/*! + * for-in + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function forIn(obj, fn, thisArg) { + for (var key in obj) { + if (fn.call(thisArg, obj[key], key, obj) === false) { + break; + } + } +}; diff --git a/node_modules/for-in/package.json b/node_modules/for-in/package.json new file mode 100644 index 0000000..221a599 --- /dev/null +++ b/node_modules/for-in/package.json @@ -0,0 +1,106 @@ +{ + "_from": "for-in@^1.0.2", + "_id": "for-in@1.0.2", + "_inBundle": false, + "_integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "_location": "/for-in", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "for-in@^1.0.2", + "name": "for-in", + "escapedName": "for-in", + "rawSpec": "^1.0.2", + "saveSpec": null, + "fetchSpec": "^1.0.2" + }, + "_requiredBy": [ + "/mixin-deep" + ], + "_resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "_shasum": "81068d295a8142ec0ac726c6e2200c30fb6d5e80", + "_spec": "for-in@^1.0.2", + "_where": "/usr/share/r3-server/beta/r3/node_modules/mixin-deep", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/for-in/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Paul Irish", + "url": "http://paulirish.com" + } + ], + "deprecated": false, + "description": "Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js", + "devDependencies": { + "gulp-format-md": "^0.1.11", + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/for-in", + "keywords": [ + "for", + "for-in", + "for-own", + "has", + "has-own", + "hasOwn", + "in", + "key", + "keys", + "object", + "own", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "for-in", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/for-in.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "arr-flatten", + "collection-map", + "for-own" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.2" +} diff --git a/node_modules/for-own/LICENSE b/node_modules/for-own/LICENSE new file mode 100644 index 0000000..d290fe0 --- /dev/null +++ b/node_modules/for-own/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, 2017, Jon Schlinkert + +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. diff --git a/node_modules/for-own/README.md b/node_modules/for-own/README.md new file mode 100644 index 0000000..fd56877 --- /dev/null +++ b/node_modules/for-own/README.md @@ -0,0 +1,85 @@ +# for-own [![NPM version](https://img.shields.io/npm/v/for-own.svg?style=flat)](https://www.npmjs.com/package/for-own) [![NPM monthly downloads](https://img.shields.io/npm/dm/for-own.svg?style=flat)](https://npmjs.org/package/for-own) [![NPM total downloads](https://img.shields.io/npm/dt/for-own.svg?style=flat)](https://npmjs.org/package/for-own) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/for-own.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/for-own) + +> Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save for-own +``` + +## Usage + +```js +var forOwn = require('for-own'); + +var obj = {a: 'foo', b: 'bar', c: 'baz'}; +var values = []; +var keys = []; + +forOwn(obj, function (value, key, o) { + keys.push(key); + values.push(value); +}); + +console.log(keys); +//=> ['a', 'b', 'c']; + +console.log(values); +//=> ['foo', 'bar', 'baz']; +``` + +## About + +### Related projects + +* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") +* [collection-map](https://www.npmjs.com/package/collection-map): Returns an array of mapped values from an array or object. | [homepage](https://github.com/jonschlinkert/collection-map "Returns an array of mapped values from an array or object.") +* [for-in](https://www.npmjs.com/package/for-in): Iterate over the own and inherited enumerable properties of an object, and return an object… [more](https://github.com/jonschlinkert/for-in) | [homepage](https://github.com/jonschlinkert/for-in "Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 10 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [javiercejudo](https://github.com/javiercejudo) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 26, 2017._ \ No newline at end of file diff --git a/node_modules/for-own/index.js b/node_modules/for-own/index.js new file mode 100644 index 0000000..74e2d75 --- /dev/null +++ b/node_modules/for-own/index.js @@ -0,0 +1,19 @@ +/*! + * for-own + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var forIn = require('for-in'); +var hasOwn = Object.prototype.hasOwnProperty; + +module.exports = function forOwn(obj, fn, thisArg) { + forIn(obj, function(val, key) { + if (hasOwn.call(obj, key)) { + return fn.call(thisArg, obj[key], key, obj); + } + }); +}; diff --git a/node_modules/for-own/package.json b/node_modules/for-own/package.json new file mode 100644 index 0000000..8947b1e --- /dev/null +++ b/node_modules/for-own/package.json @@ -0,0 +1,112 @@ +{ + "_from": "for-own@^1.0.0", + "_id": "for-own@1.0.0", + "_inBundle": false, + "_integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "_location": "/for-own", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "for-own@^1.0.0", + "name": "for-own", + "escapedName": "for-own", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/collection-map", + "/object.defaults", + "/object.map", + "/object.reduce" + ], + "_resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "_shasum": "c63332f415cedc4b04dbfe70cf836494c53cb44b", + "_spec": "for-own@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/object.defaults", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/for-own/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Javier Cejudo", + "email": "javier@javiercejudo.com", + "url": "https://www.javiercejudo.com" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "for-in": "^1.0.1" + }, + "deprecated": false, + "description": "Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.", + "devDependencies": { + "gulp-format-md": "^0.1.11", + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/for-own", + "keywords": [ + "for", + "for-in", + "for-own", + "has", + "has-own", + "hasOwn", + "key", + "keys", + "object", + "own", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "for-own", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/for-own.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "arr-flatten", + "collection-map", + "for-in" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/node_modules/fragment-cache/LICENSE b/node_modules/fragment-cache/LICENSE new file mode 100644 index 0000000..b11cb79 --- /dev/null +++ b/node_modules/fragment-cache/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016-2017, Jon Schlinkert + +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. diff --git a/node_modules/fragment-cache/README.md b/node_modules/fragment-cache/README.md new file mode 100644 index 0000000..541ef0f --- /dev/null +++ b/node_modules/fragment-cache/README.md @@ -0,0 +1,156 @@ +# fragment-cache [![NPM version](https://img.shields.io/npm/v/fragment-cache.svg?style=flat)](https://www.npmjs.com/package/fragment-cache) [![NPM downloads](https://img.shields.io/npm/dm/fragment-cache.svg?style=flat)](https://npmjs.org/package/fragment-cache) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/fragment-cache.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/fragment-cache) + +> A cache for managing namespaced sub-caches + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save fragment-cache +``` + +## Usage + +```js +var Fragment = require('fragment-cache'); +var fragment = new Fragment(); +``` + +## API + +### [FragmentCache](index.js#L24) + +Create a new `FragmentCache` with an optional object to use for `caches`. + +**Example** + +```js +var fragment = new FragmentCache(); +``` + +**Params** + +* `cacheName` **{String}** +* `returns` **{Object}**: Returns the [map-cache](https://github.com/jonschlinkert/map-cache) instance. + +### [.cache](index.js#L49) + +Get cache `name` from the `fragment.caches` object. Creates a new `MapCache` if it doesn't already exist. + +**Example** + +```js +var cache = fragment.cache('files'); +console.log(fragment.caches.hasOwnProperty('files')); +//=> true +``` + +**Params** + +* `cacheName` **{String}** +* `returns` **{Object}**: Returns the [map-cache](https://github.com/jonschlinkert/map-cache) instance. + +### [.set](index.js#L67) + +Set a value for property `key` on cache `name` + +**Example** + +```js +fragment.set('files', 'somefile.js', new File({path: 'somefile.js'})); +``` + +**Params** + +* `name` **{String}** +* `key` **{String}**: Property name to set +* `val` **{any}**: The value of `key` +* `returns` **{Object}**: The cache instance for chaining + +### [.has](index.js#L93) + +Returns true if a non-undefined value is set for `key` on fragment cache `name`. + +**Example** + +```js +var cache = fragment.cache('files'); +cache.set('somefile.js'); + +console.log(cache.has('somefile.js')); +//=> true + +console.log(cache.has('some-other-file.js')); +//=> false +``` + +**Params** + +* `name` **{String}**: Cache name +* `key` **{String}**: Optionally specify a property to check for on cache `name` +* `returns` **{Boolean}** + +### [.get](index.js#L115) + +Get `name`, or if specified, the value of `key`. Invokes the [cache](#cache) method, so that cache `name` will be created it doesn't already exist. If `key` is not passed, the entire cache (`name`) is returned. + +**Example** + +```js +var Vinyl = require('vinyl'); +var cache = fragment.cache('files'); +cache.set('somefile.js', new Vinyl({path: 'somefile.js'})); +console.log(cache.get('somefile.js')); +//=> +``` + +**Params** + +* `name` **{String}** +* `returns` **{Object}**: Returns cache `name`, or the value of `key` if specified + +## About + +### Related projects + +* [base](https://www.npmjs.com/package/base): base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://github.com/node-base/base) | [homepage](https://github.com/node-base/base "base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting with a handful of common methods, like `set`, `get`, `del` and `use`.") +* [map-cache](https://www.npmjs.com/package/map-cache): Basic cache object for storing key-value pairs. | [homepage](https://github.com/jonschlinkert/map-cache "Basic cache object for storing key-value pairs.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/fragment-cache/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 17, 2016._ \ No newline at end of file diff --git a/node_modules/fragment-cache/index.js b/node_modules/fragment-cache/index.js new file mode 100644 index 0000000..8ce6216 --- /dev/null +++ b/node_modules/fragment-cache/index.js @@ -0,0 +1,128 @@ +/*! + * fragment-cache + * + * Copyright (c) 2016-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var MapCache = require('map-cache'); + +/** + * Create a new `FragmentCache` with an optional object to use for `caches`. + * + * ```js + * var fragment = new FragmentCache(); + * ``` + * @name FragmentCache + * @param {String} `cacheName` + * @return {Object} Returns the [map-cache][] instance. + * @api public + */ + +function FragmentCache(caches) { + this.caches = caches || {}; +} + +/** + * Prototype + */ + +FragmentCache.prototype = { + + /** + * Get cache `name` from the `fragment.caches` object. Creates a new + * `MapCache` if it doesn't already exist. + * + * ```js + * var cache = fragment.cache('files'); + * console.log(fragment.caches.hasOwnProperty('files')); + * //=> true + * ``` + * @name .cache + * @param {String} `cacheName` + * @return {Object} Returns the [map-cache][] instance. + * @api public + */ + + cache: function(cacheName) { + return this.caches[cacheName] || (this.caches[cacheName] = new MapCache()); + }, + + /** + * Set a value for property `key` on cache `name` + * + * ```js + * fragment.set('files', 'somefile.js', new File({path: 'somefile.js'})); + * ``` + * @name .set + * @param {String} `name` + * @param {String} `key` Property name to set + * @param {any} `val` The value of `key` + * @return {Object} The cache instance for chaining + * @api public + */ + + set: function(cacheName, key, val) { + var cache = this.cache(cacheName); + cache.set(key, val); + return cache; + }, + + /** + * Returns true if a non-undefined value is set for `key` on fragment cache `name`. + * + * ```js + * var cache = fragment.cache('files'); + * cache.set('somefile.js'); + * + * console.log(cache.has('somefile.js')); + * //=> true + * + * console.log(cache.has('some-other-file.js')); + * //=> false + * ``` + * @name .has + * @param {String} `name` Cache name + * @param {String} `key` Optionally specify a property to check for on cache `name` + * @return {Boolean} + * @api public + */ + + has: function(cacheName, key) { + return typeof this.get(cacheName, key) !== 'undefined'; + }, + + /** + * Get `name`, or if specified, the value of `key`. Invokes the [cache]() method, + * so that cache `name` will be created it doesn't already exist. If `key` is not passed, + * the entire cache (`name`) is returned. + * + * ```js + * var Vinyl = require('vinyl'); + * var cache = fragment.cache('files'); + * cache.set('somefile.js', new Vinyl({path: 'somefile.js'})); + * console.log(cache.get('somefile.js')); + * //=> + * ``` + * @name .get + * @param {String} `name` + * @return {Object} Returns cache `name`, or the value of `key` if specified + * @api public + */ + + get: function(name, key) { + var cache = this.cache(name); + if (typeof key === 'string') { + return cache.get(key); + } + return cache; + } +}; + +/** + * Expose `FragmentCache` + */ + +exports = module.exports = FragmentCache; diff --git a/node_modules/fragment-cache/package.json b/node_modules/fragment-cache/package.json new file mode 100644 index 0000000..a840da2 --- /dev/null +++ b/node_modules/fragment-cache/package.json @@ -0,0 +1,93 @@ +{ + "_from": "fragment-cache@^0.2.1", + "_id": "fragment-cache@0.2.1", + "_inBundle": false, + "_integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "_location": "/fragment-cache", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fragment-cache@^0.2.1", + "name": "fragment-cache", + "escapedName": "fragment-cache", + "rawSpec": "^0.2.1", + "saveSpec": null, + "fetchSpec": "^0.2.1" + }, + "_requiredBy": [ + "/extglob", + "/micromatch", + "/nanomatch" + ], + "_resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "_shasum": "4290fad27f13e89be7f33799c6bc5a0abfff0d19", + "_spec": "fragment-cache@^0.2.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/fragment-cache/issues" + }, + "bundleDependencies": false, + "dependencies": { + "map-cache": "^0.2.2" + }, + "deprecated": false, + "description": "A cache for managing namespaced sub-caches", + "devDependencies": { + "gulp": "^3.9.1", + "gulp-eslint": "^3.0.1", + "gulp-format-md": "^0.1.11", + "gulp-istanbul": "^1.1.1", + "gulp-mocha": "^3.0.1", + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/fragment-cache", + "keywords": [ + "cache", + "fragment" + ], + "license": "MIT", + "main": "index.js", + "name": "fragment-cache", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/fragment-cache.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "plugins": [ + "gulp-format-md" + ], + "reflinks": [ + "map-cache", + "verb" + ], + "related": { + "list": [ + "base", + "map-cache" + ] + }, + "layout": "default", + "toc": false, + "tasks": [ + "readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.2.1" +} diff --git a/node_modules/from2/.travis.yml b/node_modules/from2/.travis.yml new file mode 100644 index 0000000..b03ffab --- /dev/null +++ b/node_modules/from2/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +before_install: + - npm install -g npm +node_js: + - "0.8" + - "0.10" + - "0.12" + - "iojs" diff --git a/node_modules/from2/LICENSE.md b/node_modules/from2/LICENSE.md new file mode 100644 index 0000000..146cb32 --- /dev/null +++ b/node_modules/from2/LICENSE.md @@ -0,0 +1,21 @@ +## The MIT License (MIT) ## + +Copyright (c) 2014 Hugh Kennedy + +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. diff --git a/node_modules/from2/README.md b/node_modules/from2/README.md new file mode 100644 index 0000000..3e041a4 --- /dev/null +++ b/node_modules/from2/README.md @@ -0,0 +1,70 @@ +# from2 [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/from2&title=from2&description=hughsk/from2%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) # + +`from2` is a high-level module for creating readable streams that properly handle backpressure. + +Convience wrapper for +[readable-stream](http://github.com/isaacs/readable-stream)'s `ReadableStream` +base class, with an API lifted from +[from](http://github.com/dominictarr/from) and +[through2](http://github.com/rvagg/through2). + +## Usage ## + +[![from2](https://nodei.co/npm/from2.png?mini=true)](https://nodei.co/npm/from2) + +### `stream = from2([opts], read)` ### + +Where `opts` are the options to pass on to the `ReadableStream` constructor, +and `read(size, next)` is called when data is requested from the stream. + +* `size` is the recommended amount of data (in bytes) to retrieve. +* `next(err)` should be called when you're ready to emit more data. + +For example, here's a readable stream that emits the contents of a given +string: + +``` javascript +var from = require('from2') + +function fromString(string) { + return from(function(size, next) { + // if there's no more content + // left in the string, close the stream. + if (string.length <= 0) return next(null, null) + + // Pull in a new chunk of text, + // removing it from the string. + var chunk = string.slice(0, size) + string = string.slice(size) + + // Emit "chunk" from the stream. + next(null, chunk) + }) +} + +// pipe "hello world" out +// to stdout. +fromString('hello world').pipe(process.stdout) +``` + +### `stream = from2.obj([opts], read)` ### + +Shorthand for `from2({ objectMode: true }, read)`. + +### `createStream = from2.ctor([opts], read)` ### + +If you're creating similar streams in quick succession you can improve +performance by generating a stream **constructor** that you can reuse instead +of creating one-off streams on each call. + +Takes the same options as `from2`, instead returning a constructor which you +can use to create new streams. + +### See Also + +- [from2-array](https://github.com/binocarlos/from2-array) - Create a from2 stream based on an array of source values. +- [from2-string](https://github.com/yoshuawuyts/from2-string) - Create a stream from a string. Sugary wrapper around from2. + +## License ## + +MIT. See [LICENSE.md](http://github.com/hughsk/from2/blob/master/LICENSE.md) for details. diff --git a/node_modules/from2/index.js b/node_modules/from2/index.js new file mode 100644 index 0000000..cb200c6 --- /dev/null +++ b/node_modules/from2/index.js @@ -0,0 +1,103 @@ +var Readable = require('readable-stream').Readable +var inherits = require('inherits') + +module.exports = from2 + +from2.ctor = ctor +from2.obj = obj + +var Proto = ctor() + +function toFunction(list) { + list = list.slice() + return function (_, cb) { + var err = null + var item = list.length ? list.shift() : null + if (item instanceof Error) { + err = item + item = null + } + + cb(err, item) + } +} + +function from2(opts, read) { + if (typeof opts !== 'object' || Array.isArray(opts)) { + read = opts + opts = {} + } + + var rs = new Proto(opts) + rs._from = Array.isArray(read) ? toFunction(read) : (read || noop) + return rs +} + +function ctor(opts, read) { + if (typeof opts === 'function') { + read = opts + opts = {} + } + + opts = defaults(opts) + + inherits(Class, Readable) + function Class(override) { + if (!(this instanceof Class)) return new Class(override) + this._reading = false + this._callback = check + this.destroyed = false + Readable.call(this, override || opts) + + var self = this + var hwm = this._readableState.highWaterMark + + function check(err, data) { + if (self.destroyed) return + if (err) return self.destroy(err) + if (data === null) return self.push(null) + self._reading = false + if (self.push(data)) self._read(hwm) + } + } + + Class.prototype._from = read || noop + Class.prototype._read = function(size) { + if (this._reading || this.destroyed) return + this._reading = true + this._from(size, this._callback) + } + + Class.prototype.destroy = function(err) { + if (this.destroyed) return + this.destroyed = true + + var self = this + process.nextTick(function() { + if (err) self.emit('error', err) + self.emit('close') + }) + } + + return Class +} + +function obj(opts, read) { + if (typeof opts === 'function' || Array.isArray(opts)) { + read = opts + opts = {} + } + + opts = defaults(opts) + opts.objectMode = true + opts.highWaterMark = 16 + + return from2(opts, read) +} + +function noop () {} + +function defaults(opts) { + opts = opts || {} + return opts +} diff --git a/node_modules/from2/package.json b/node_modules/from2/package.json new file mode 100644 index 0000000..e8c2adb --- /dev/null +++ b/node_modules/from2/package.json @@ -0,0 +1,69 @@ +{ + "_from": "from2@^2.1.0", + "_id": "from2@2.3.0", + "_inBundle": false, + "_integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "_location": "/from2", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "from2@^2.1.0", + "name": "from2", + "escapedName": "from2", + "rawSpec": "^2.1.0", + "saveSpec": null, + "fetchSpec": "^2.1.0" + }, + "_requiredBy": [ + "/mississippi" + ], + "_resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "_shasum": "8bfb5502bde4a4d36cfdeea007fcca21d7e382af", + "_spec": "from2@^2.1.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/mississippi", + "author": { + "name": "Hugh Kennedy", + "email": "hughskennedy@gmail.com", + "url": "http://hughsk.io/" + }, + "bugs": { + "url": "https://github.com/hughsk/from2/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Mathias Buus", + "email": "mathiasbuus@gmail.com" + } + ], + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + }, + "deprecated": false, + "description": "Convenience wrapper for ReadableStream, with an API lifted from \"from\" and \"through2\"", + "devDependencies": { + "tape": "^4.0.0" + }, + "homepage": "https://github.com/hughsk/from2", + "keywords": [ + "from", + "stream", + "readable", + "pull", + "convenience", + "wrapper" + ], + "license": "MIT", + "main": "index.js", + "name": "from2", + "repository": { + "type": "git", + "url": "git://github.com/hughsk/from2.git" + }, + "scripts": { + "test": "node test" + }, + "version": "2.3.0" +} diff --git a/node_modules/from2/test.js b/node_modules/from2/test.js new file mode 100644 index 0000000..b11bd6c --- /dev/null +++ b/node_modules/from2/test.js @@ -0,0 +1,123 @@ +var test = require('tape') +var path = require('path') +var from = require('./') +var fs = require('fs') + +var tmp = path.resolve( + __dirname, 'tmp.txt' +) + +function fromString(string) { + return from(function(size, next) { + if (string.length <= 0) return next(null, null) + var chunk = string.slice(0, size) + string = string.slice(size) + next(null, chunk) + }) +} + +test('from2', function(t) { + var contents = fs.readFileSync(__filename, 'utf8') + var stream = fromString(contents) + + stream + .pipe(fs.createWriteStream(tmp)) + .on('close', function() { + t.equal(fs.readFileSync(tmp, 'utf8'), contents) + fs.unlinkSync(tmp) + t.end() + }) +}) + +test('old mode', function(t) { + var contents = fs.readFileSync(__filename, 'utf8') + var stream = fromString(contents) + var buffer = '' + + stream.on('data', function(data) { + buffer += data + }).on('end', function() { + t.equal(buffer, contents) + t.end() + }) +}) + +test('destroy', function(t) { + var stream = from(function(size, next) { + process.nextTick(function() { + next(null, 'no') + }) + }) + + stream.on('data', function(data) { + t.ok(false) + }).on('close', function() { + t.ok(true) + t.end() + }) + + stream.destroy() +}) + +test('arrays', function (t) { + var input = ['a', 'b', 'c'] + var stream = from(input) + var output = [] + stream.on('data', function (letter) { + output.push(letter.toString()) + }) + stream.on('end', function () { + t.deepEqual(input, output) + t.end() + }) +}) + +test('obj arrays', function (t) { + var input = [{foo:'a'}, {foo:'b'}, {foo:'c'}] + var stream = from.obj(input) + var output = [] + stream.on('data', function (letter) { + output.push(letter) + }) + stream.on('end', function () { + t.deepEqual(input, output) + t.end() + }) +}) + + +test('arrays can emit errors', function (t) { + var input = ['a', 'b', new Error('ooops'), 'c'] + var stream = from(input) + var output = [] + stream.on('data', function (letter) { + output.push(letter.toString()) + }) + stream.on('error', function(e){ + t.deepEqual(['a', 'b'], output) + t.equal('ooops', e.message) + t.end() + }) + stream.on('end', function () { + t.fail('the stream should have errored') + }) +}) + +test('obj arrays can emit errors', function (t) { + var input = [{foo:'a'}, {foo:'b'}, new Error('ooops'), {foo:'c'}] + var stream = from.obj(input) + var output = [] + stream.on('data', function (letter) { + output.push(letter) + }) + stream.on('error', function(e){ + t.deepEqual([{foo:'a'}, {foo:'b'}], output) + t.equal('ooops', e.message) + t.end() + }) + stream.on('end', function () { + t.fail('the stream should have errored') + }) +}) + + diff --git a/node_modules/fs-mkdirp-stream/LICENSE b/node_modules/fs-mkdirp-stream/LICENSE new file mode 100644 index 0000000..73593ac --- /dev/null +++ b/node_modules/fs-mkdirp-stream/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Blaine Bublitz , Eric Schoffstall and other contributors (Originally based on code from node-mkdirp - MIT/X11 license - Copyright 2010 James Halliday) + +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. diff --git a/node_modules/fs-mkdirp-stream/README.md b/node_modules/fs-mkdirp-stream/README.md new file mode 100644 index 0000000..819f8a3 --- /dev/null +++ b/node_modules/fs-mkdirp-stream/README.md @@ -0,0 +1,65 @@ +

+ + + +

+ +# fs-mkdirp-stream + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +Ensure directories exist before writing to them. + +## Usage + +```js +var to = require('to2'); +var from = require('from2'); +var mkdirpStream = require('fs-mkdirp-stream'); + +from.obj([{ dirname: '/path/to/my/', path: '/path/to/my/file.js' }]) + .pipe(mkdirpStream.obj(function(obj, callback) { + // callback can take 3 arguments (err, dirname, mode) + callback(null, obj.dirname); + })) + .pipe(to.obj(function(obj) { + // This will be called once the directory exists + // obj === { dirname: '/path/to/my/', path: '/path/to/my/file.js' } + })); +``` + +## API + +### `mkdirpStream(resolver)` + +Takes a `resolver` function or string and returns a `through2` stream. + +If the `resolver` is a function, it will be called once per chunk with the signature `(chunk, callback)`. The `callback(error, dirpath, mode)` must be called with the `dirpath` to be created as the 2nd parameter or an `error` as the 1st parameter; optionally with a `mode` as the 3rd parameter. + +If the `resolver` is a string, it will be created/ensured for each chunk (e.g. if it were deleted between chunks, it would be recreated). When using a string, a custom `mode` can't be used. + +### `mkdirpStream.obj(resolver)` + +The same as the top-level API but for object streams. See the example to see the benefit of object streams with this module. + +## License + +MIT + +Contains a custom implementation of `mkdirp` originally based on https://github.com/substack/node-mkdirp (Licensed MIT/X11 - Copyright 2010 James Halliday) with heavy modification to better support custom modes. + +[downloads-image]: http://img.shields.io/npm/dm/fs-mkdirp-stream.svg +[npm-url]: https://npmjs.com/package/fs-mkdirp-stream +[npm-image]: http://img.shields.io/npm/v/fs-mkdirp-stream.svg + +[travis-url]: https://travis-ci.org/gulpjs/fs-mkdirp-stream +[travis-image]: http://img.shields.io/travis/gulpjs/fs-mkdirp-stream.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/fs-mkdirp-stream +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/fs-mkdirp-stream.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/fs-mkdirp-stream +[coveralls-image]: http://img.shields.io/coveralls/gulpjs/fs-mkdirp-stream/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.png diff --git a/node_modules/fs-mkdirp-stream/index.js b/node_modules/fs-mkdirp-stream/index.js new file mode 100644 index 0000000..cde5e19 --- /dev/null +++ b/node_modules/fs-mkdirp-stream/index.js @@ -0,0 +1,50 @@ +'use strict'; + +var through = require('through2'); + +var mkdirp = require('./mkdirp'); + +function toFunction(dirpath) { + function stringResolver(chunk, callback) { + callback(null, dirpath); + } + + return stringResolver; +} + +function define(options) { + + function mkdirpStream(resolver) { + // Handle resolver that's just a dirpath + if (typeof resolver === 'string') { + resolver = toFunction(resolver); + } + + function makeFileDirs(chunk, enc, callback) { + resolver(chunk, onDirpath); + + function onDirpath(dirpathErr, dirpath, mode) { + if (dirpathErr) { + return callback(dirpathErr); + } + + mkdirp(dirpath, mode, onMkdirp); + } + + function onMkdirp(mkdirpErr) { + if (mkdirpErr) { + return callback(mkdirpErr); + } + + callback(null, chunk); + } + } + + return through(options, makeFileDirs); + } + + return mkdirpStream; +} + +module.exports = define(); +module.exports.obj = define({ objectMode: true, highWaterMark: 16 }); diff --git a/node_modules/fs-mkdirp-stream/mkdirp.js b/node_modules/fs-mkdirp-stream/mkdirp.js new file mode 100644 index 0000000..e70031b --- /dev/null +++ b/node_modules/fs-mkdirp-stream/mkdirp.js @@ -0,0 +1,71 @@ +'use strict'; + +var path = require('path'); + +var fs = require('graceful-fs'); + +var MASK_MODE = parseInt('7777', 8); +var DEFAULT_DIR_MODE = parseInt('0777', 8); + +function mkdirp(dirpath, customMode, callback) { + if (typeof customMode === 'function') { + callback = customMode; + customMode = undefined; + } + + var mode = customMode || (DEFAULT_DIR_MODE & ~process.umask()); + dirpath = path.resolve(dirpath); + + fs.mkdir(dirpath, mode, onMkdir); + + function onMkdir(mkdirErr) { + if (!mkdirErr) { + return fs.stat(dirpath, onStat); + } + + switch (mkdirErr.code) { + case 'ENOENT': { + return mkdirp(path.dirname(dirpath), onRecurse); + } + + case 'EEXIST': { + return fs.stat(dirpath, onStat); + } + + default: { + return callback(mkdirErr); + } + } + + function onStat(statErr, stats) { + if (statErr) { + return callback(statErr); + } + + if (!stats.isDirectory()) { + return callback(mkdirErr); + } + + // TODO: Is it proper to mask like this? + if ((stats.mode & MASK_MODE) === mode) { + return callback(); + } + + if (!customMode) { + return callback(); + } + + fs.chmod(dirpath, mode, callback); + } + } + + function onRecurse(recurseErr) { + if (recurseErr) { + return callback(recurseErr); + } + + mkdirp(dirpath, mode, callback); + } +} + +module.exports = mkdirp; diff --git a/node_modules/fs-mkdirp-stream/package.json b/node_modules/fs-mkdirp-stream/package.json new file mode 100644 index 0000000..ea52b41 --- /dev/null +++ b/node_modules/fs-mkdirp-stream/package.json @@ -0,0 +1,91 @@ +{ + "_from": "fs-mkdirp-stream@^1.0.0", + "_id": "fs-mkdirp-stream@1.0.0", + "_inBundle": false, + "_integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", + "_location": "/fs-mkdirp-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fs-mkdirp-stream@^1.0.0", + "name": "fs-mkdirp-stream", + "escapedName": "fs-mkdirp-stream", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/vinyl-fs" + ], + "_resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", + "_shasum": "0b7815fc3201c6a69e14db98ce098c16935259eb", + "_spec": "fs-mkdirp-stream@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/vinyl-fs", + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "http://gulpjs.com/" + }, + "bugs": { + "url": "https://github.com/gulpjs/fs-mkdirp-stream/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com" + } + ], + "dependencies": { + "graceful-fs": "^4.1.11", + "through2": "^2.0.3" + }, + "deprecated": false, + "description": "Ensure directories exist before writing to them.", + "devDependencies": { + "eslint": "^1.10.3", + "eslint-config-gulp": "^2.0.0", + "expect": "^1.20.2", + "istanbul": "^0.4.3", + "istanbul-coveralls": "^1.0.3", + "jscs": "^2.4.0", + "jscs-preset-gulp": "^1.0.0", + "mississippi": "^1.3.0", + "mocha": "^3.2.0", + "rimraf": "^2.6.1" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "LICENSE", + "index.js", + "mkdirp.js" + ], + "homepage": "https://github.com/gulpjs/fs-mkdirp-stream#readme", + "keywords": [ + "fs", + "mkdirp", + "stream", + "mkdir", + "directory", + "directories", + "ensure" + ], + "license": "MIT", + "main": "index.js", + "name": "fs-mkdirp-stream", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/fs-mkdirp-stream.git" + }, + "scripts": { + "cover": "istanbul cover _mocha --report lcovonly", + "coveralls": "npm run cover && istanbul-coveralls", + "lint": "eslint index.js mkdirp.js test/ && jscs index.js mkdirp.js test/", + "pretest": "npm run lint", + "test": "mocha --async-only" + }, + "version": "1.0.0" +} diff --git a/node_modules/fs-write-stream-atomic/.npmignore b/node_modules/fs-write-stream-atomic/.npmignore new file mode 100644 index 0000000..2f24c57 --- /dev/null +++ b/node_modules/fs-write-stream-atomic/.npmignore @@ -0,0 +1,3 @@ +node_modules/ +coverage/ +.nyc_output/ diff --git a/node_modules/fs-write-stream-atomic/.travis.yml b/node_modules/fs-write-stream-atomic/.travis.yml new file mode 100644 index 0000000..6894662 --- /dev/null +++ b/node_modules/fs-write-stream-atomic/.travis.yml @@ -0,0 +1,11 @@ +language: node_js +sudo: false +before_install: + - "npm -g install npm" +node_js: + - "0.8" + - "0.10" + - "0.12" + - "iojs" + - "4" + - "5" diff --git a/node_modules/fs-write-stream-atomic/LICENSE b/node_modules/fs-write-stream-atomic/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/fs-write-stream-atomic/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/fs-write-stream-atomic/README.md b/node_modules/fs-write-stream-atomic/README.md new file mode 100644 index 0000000..9a15d05 --- /dev/null +++ b/node_modules/fs-write-stream-atomic/README.md @@ -0,0 +1,35 @@ +# fs-write-stream-atomic + +Like `fs.createWriteStream(...)`, but atomic. + +Writes to a tmp file and does an atomic `fs.rename` to move it into +place when it's done. + +First rule of debugging: **It's always a race condition.** + +## USAGE + +```javascript +var fsWriteStreamAtomic = require('fs-write-stream-atomic') +// options are optional. +var write = fsWriteStreamAtomic('output.txt', options) +var read = fs.createReadStream('input.txt') +read.pipe(write) + +// When the write stream emits a 'finish' or 'close' event, +// you can be sure that it is moved into place, and contains +// all the bytes that were written to it, even if something else +// was writing to `output.txt` at the same time. +``` + +### `fsWriteStreamAtomic(filename, [options])` + +* `filename` {String} The file we want to write to +* `options` {Object} + * `chown` {Object} User and group to set ownership after write + * `uid` {Number} + * `gid` {Number} + * `encoding` {String} default = 'utf8' + * `mode` {Number} default = `0666` + * `flags` {String} default = `'w'` + diff --git a/node_modules/fs-write-stream-atomic/index.js b/node_modules/fs-write-stream-atomic/index.js new file mode 100644 index 0000000..1690ff5 --- /dev/null +++ b/node_modules/fs-write-stream-atomic/index.js @@ -0,0 +1,176 @@ +var fs = require('graceful-fs') +var Writable = require('readable-stream').Writable +var util = require('util') +var MurmurHash3 = require('imurmurhash') +var iferr = require('iferr') +var crypto = require('crypto') + +function murmurhex () { + var hash = MurmurHash3('') + for (var ii = 0; ii < arguments.length; ++ii) { + hash.hash('' + arguments[ii]) + } + return hash.result() +} + +var invocations = 0 +function getTmpname (filename) { + return filename + '.' + murmurhex(__filename, process.pid, ++invocations) +} + +var setImmediate = global.setImmediate || setTimeout + +module.exports = WriteStreamAtomic + +// Requirements: +// 1. Write everything written to the stream to a temp file. +// 2. If there are no errors: +// a. moves the temp file into its final destination +// b. emits `finish` & `closed` ONLY after the file is +// fully flushed and renamed. +// 3. If there's an error, removes the temp file. + +util.inherits(WriteStreamAtomic, Writable) +function WriteStreamAtomic (path, options) { + if (!(this instanceof WriteStreamAtomic)) { + return new WriteStreamAtomic(path, options) + } + Writable.call(this, options) + + this.__isWin = options && options.hasOwnProperty('isWin') ? options.isWin : process.platform === 'win32' + + this.__atomicTarget = path + this.__atomicTmp = getTmpname(path) + + this.__atomicChown = options && options.chown + + this.__atomicClosed = false + + this.__atomicStream = fs.WriteStream(this.__atomicTmp, options) + + this.__atomicStream.once('open', handleOpen(this)) + this.__atomicStream.once('close', handleClose(this)) + this.__atomicStream.once('error', handleError(this)) +} + +// We have to suppress default finish emitting, because ordinarily it +// would happen as soon as `end` is called on us and all of the +// data has been written to our target stream. So we suppress +// finish from being emitted here, and only emit it after our +// target stream is closed and we've moved everything around. +WriteStreamAtomic.prototype.emit = function (event) { + if (event === 'finish') return this.__atomicStream.end() + return Writable.prototype.emit.apply(this, arguments) +} + +WriteStreamAtomic.prototype._write = function (buffer, encoding, cb) { + var flushed = this.__atomicStream.write(buffer, encoding) + if (flushed) return cb() + this.__atomicStream.once('drain', cb) +} + +function handleOpen (writeStream) { + return function (fd) { + writeStream.emit('open', fd) + } +} + +function handleClose (writeStream) { + return function () { + if (writeStream.__atomicClosed) return + writeStream.__atomicClosed = true + if (writeStream.__atomicChown) { + var uid = writeStream.__atomicChown.uid + var gid = writeStream.__atomicChown.gid + return fs.chown(writeStream.__atomicTmp, uid, gid, iferr(cleanup, moveIntoPlace)) + } else { + moveIntoPlace() + } + } + + function moveIntoPlace () { + fs.rename(writeStream.__atomicTmp, writeStream.__atomicTarget, iferr(trapWindowsEPERM, end)) + } + + function trapWindowsEPERM (err) { + if (writeStream.__isWin && + err.syscall && err.syscall === 'rename' && + err.code && err.code === 'EPERM' + ) { + checkFileHashes(err) + } else { + cleanup(err) + } + } + + function checkFileHashes (eperm) { + var inprocess = 2 + var tmpFileHash = crypto.createHash('sha512') + var targetFileHash = crypto.createHash('sha512') + + fs.createReadStream(writeStream.__atomicTmp) + .on('data', function (data, enc) { tmpFileHash.update(data, enc) }) + .on('error', fileHashError) + .on('end', fileHashComplete) + fs.createReadStream(writeStream.__atomicTarget) + .on('data', function (data, enc) { targetFileHash.update(data, enc) }) + .on('error', fileHashError) + .on('end', fileHashComplete) + + function fileHashError () { + if (inprocess === 0) return + inprocess = 0 + cleanup(eperm) + } + + function fileHashComplete () { + if (inprocess === 0) return + if (--inprocess) return + if (tmpFileHash.digest('hex') === targetFileHash.digest('hex')) { + return cleanup() + } else { + return cleanup(eperm) + } + } + } + + function cleanup (err) { + fs.unlink(writeStream.__atomicTmp, function () { + if (err) { + writeStream.emit('error', err) + writeStream.emit('close') + } else { + end() + } + }) + } + + function end () { + // We have to use our parent class directly because we suppress `finish` + // events fired via our own emit method. + Writable.prototype.emit.call(writeStream, 'finish') + + // Delay the close to provide the same temporal separation a physical + // file operation would have– that is, the close event is emitted only + // after the async close operation completes. + setImmediate(function () { + writeStream.emit('close') + }) + } +} + +function handleError (writeStream) { + return function (er) { + cleanupSync() + writeStream.emit('error', er) + writeStream.__atomicClosed = true + writeStream.emit('close') + } + function cleanupSync () { + try { + fs.unlinkSync(writeStream.__atomicTmp) + } finally { + return + } + } +} diff --git a/node_modules/fs-write-stream-atomic/package.json b/node_modules/fs-write-stream-atomic/package.json new file mode 100644 index 0000000..901fe54 --- /dev/null +++ b/node_modules/fs-write-stream-atomic/package.json @@ -0,0 +1,63 @@ +{ + "_from": "fs-write-stream-atomic@^1.0.8", + "_id": "fs-write-stream-atomic@1.0.10", + "_inBundle": false, + "_integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "_location": "/fs-write-stream-atomic", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fs-write-stream-atomic@^1.0.8", + "name": "fs-write-stream-atomic", + "escapedName": "fs-write-stream-atomic", + "rawSpec": "^1.0.8", + "saveSpec": null, + "fetchSpec": "^1.0.8" + }, + "_requiredBy": [ + "/copy-concurrently", + "/move-concurrently" + ], + "_resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "_shasum": "b47df53493ef911df75731e70a9ded0189db40c9", + "_spec": "fs-write-stream-atomic@^1.0.8", + "_where": "/usr/share/r3-server/beta/r3/node_modules/move-concurrently", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/npm/fs-write-stream-atomic/issues" + }, + "bundleDependencies": false, + "dependencies": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + }, + "deprecated": false, + "description": "Like `fs.createWriteStream(...)`, but atomic.", + "devDependencies": { + "rimraf": "^2.4.4", + "standard": "^5.4.1", + "tap": "^2.3.1" + }, + "directories": { + "test": "test" + }, + "homepage": "https://github.com/npm/fs-write-stream-atomic", + "license": "ISC", + "main": "index.js", + "name": "fs-write-stream-atomic", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/fs-write-stream-atomic.git" + }, + "scripts": { + "test": "standard && tap --coverage test/*.js" + }, + "version": "1.0.10" +} diff --git a/node_modules/fs-write-stream-atomic/test/basic.js b/node_modules/fs-write-stream-atomic/test/basic.js new file mode 100644 index 0000000..d0205e1 --- /dev/null +++ b/node_modules/fs-write-stream-atomic/test/basic.js @@ -0,0 +1,97 @@ +var fs = require('graceful-fs') +var test = require('tap').test +var path = require('path') +var writeStream = require('../index.js') + +var rename = fs.rename +fs.rename = function (from, to, cb) { + setTimeout(function () { + rename(from, to, cb) + }, 100) +} + +test('basic', function (t) { + // open 10 write streams to the same file. + // then write to each of them, and to the target + // and verify at the end that each of them does their thing + var target = path.resolve(__dirname, 'test.txt') + var n = 10 + + // We run all of our assertions twice: + // once for finish, once for close + // There are 6 assertions, two fixed, plus 4 lines in the file. + t.plan(n * 2 * 6) + + var streams = [] + for (var i = 0; i < n; i++) { + var s = writeStream(target) + s.on('finish', verifier('finish', i)) + s.on('close', verifier('close', i)) + streams.push(s) + } + + function verifier (ev, num) { + return function () { + if (ev === 'close') { + t.equal(this.__emittedFinish, true, num + '. closed only after finish') + } else { + this.__emittedFinish = true + t.equal(ev, 'finish', num + '. finished') + } + + // make sure that one of the atomic streams won. + var res = fs.readFileSync(target, 'utf8') + var lines = res.trim().split(/\n/) + lines.forEach(function (line, lineno) { + var first = lines[0].match(/\d+$/)[0] + var cur = line.match(/\d+$/)[0] + t.equal(cur, first, num + '. line ' + lineno + ' matches') + }) + + var resExpr = /^first write \d+\nsecond write \d+\nthird write \d+\nfinal write \d+\n$/ + t.similar(res, resExpr, num + '. content matches') + } + } + + // now write something to each stream. + streams.forEach(function (stream, i) { + stream.write('first write ' + i + '\n') + }) + + // wait a sec for those writes to go out. + setTimeout(function () { + // write something else to the target. + fs.writeFileSync(target, 'brutality!\n') + + // write some more stuff. + streams.forEach(function (stream, i) { + stream.write('second write ' + i + '\n') + }) + + setTimeout(function () { + // Oops! Deleted the file! + fs.unlinkSync(target) + + // write some more stuff. + streams.forEach(function (stream, i) { + stream.write('third write ' + i + '\n') + }) + + setTimeout(function () { + fs.writeFileSync(target, 'brutality TWO!\n') + streams.forEach(function (stream, i) { + stream.end('final write ' + i + '\n') + }) + }, 50) + }, 50) + }, 50) +}) + +test('cleanup', function (t) { + fs.readdirSync(__dirname).filter(function (f) { + return f.match(/^test.txt/) + }).forEach(function (file) { + fs.unlinkSync(path.resolve(__dirname, file)) + }) + t.end() +}) diff --git a/node_modules/fs-write-stream-atomic/test/chown.js b/node_modules/fs-write-stream-atomic/test/chown.js new file mode 100644 index 0000000..1733cf2 --- /dev/null +++ b/node_modules/fs-write-stream-atomic/test/chown.js @@ -0,0 +1,44 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var writeStream = require('../index.js') + +var target = path.resolve(__dirname, 'test-chown') + +test('chown works', function (t) { + t.plan(1) + var stream = writeStream(target, {chown: {uid: process.getuid(), gid: process.getgid()}}) + var hadError = false + stream.on('error', function (er) { + hadError = true + console.log('#', er) + }) + stream.on('close', function () { + t.is(hadError, false, 'no errors before close') + }) + stream.end() +}) + +test('chown fails', function (t) { + t.plan(1) + fs.chown = function (file, uid, gid, cb) { + cb(new Error('TEST BREAK')) + } + var stream = writeStream(target, {chown: {uid: process.getuid(), gid: process.getgid()}}) + var hadError = false + stream.on('error', function (er) { + hadError = true + console.log('#', er) + }) + stream.on('close', function () { + t.is(hadError, true, 'error before close') + }) + stream.end() +}) + +test('cleanup', function (t) { + rimraf.sync(target) + t.end() +}) diff --git a/node_modules/fs-write-stream-atomic/test/rename-eperm.js b/node_modules/fs-write-stream-atomic/test/rename-eperm.js new file mode 100644 index 0000000..b1be0f3 --- /dev/null +++ b/node_modules/fs-write-stream-atomic/test/rename-eperm.js @@ -0,0 +1,154 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var writeStream = require('../index.js') + +var target = path.resolve(__dirname, 'test-rename-eperm1') +var target2 = path.resolve(__dirname, 'test-rename-eperm2') +var target3 = path.resolve(__dirname, 'test-rename-eperm3') + +test('rename eperm none existing file', function (t) { + t.plan(2) + + var _rename = fs.rename + fs.existsSync = function (src) { + return true + } + fs.rename = function (src, dest, cb) { + // simulate a failure during rename where the file + // is renamed successfully but the process encounters + // an EPERM error and the target file does not exist + _rename(src, dest, function (e) { + var err = new Error('TEST BREAK') + err.syscall = 'rename' + err.code = 'EPERM' + cb(err) + }) + } + + var stream = writeStream(target, { isWin: true }) + var hadError = false + var calledFinish = false + stream.on('error', function (er) { + hadError = true + console.log('#', er) + }) + stream.on('finish', function () { + calledFinish = true + }) + stream.on('close', function () { + t.is(hadError, true, 'error was caught') + t.is(calledFinish, false, 'finish was called before close') + }) + stream.end() +}) + +// test existing file with diff. content +test('rename eperm existing file different content', function (t) { + t.plan(2) + + var _rename = fs.rename + fs.existsSync = function (src) { + return true + } + fs.rename = function (src, dest, cb) { + // simulate a failure during rename where the file + // is renamed successfully but the process encounters + // an EPERM error and the target file that has another content than the + // destination + _rename(src, dest, function (e) { + fs.writeFile(src, 'dest', function (writeErr) { + if (writeErr) { + return console.log('WRITEERR: ' + writeErr) + } + + fs.writeFile(target2, 'target', function (writeErr) { + if (writeErr) { + return console.log('WRITEERR: ' + writeErr) + } + + var err = new Error('TEST BREAK') + err.syscall = 'rename' + err.code = 'EPERM' + cb(err) + }) + }) + }) + } + + var stream = writeStream(target2, { isWin: true }) + var hadError = false + var calledFinish = false + stream.on('error', function (er) { + hadError = true + console.log('#', er) + }) + stream.on('finish', function () { + calledFinish = true + }) + stream.on('close', function () { + t.is(hadError, true, 'error was caught') + t.is(calledFinish, false, 'finish was called before close') + }) + stream.end() +}) + +// test existing file with the same content +// test existing file with diff. content +test('rename eperm existing file different content', function (t) { + t.plan(2) + + var _rename = fs.rename + fs.existsSync = function (src) { + return true + } + fs.rename = function (src, dest, cb) { + // simulate a failure during rename where the file + // is renamed successfully but the process encounters + // an EPERM error and the target file that has the same content than the + // destination + _rename(src, dest, function (e) { + fs.writeFile(src, 'target2', function (writeErr) { + if (writeErr) { + return console.log('WRITEERR: ' + writeErr) + } + + fs.writeFile(target3, 'target2', function (writeErr) { + if (writeErr) { + return console.log('WRITEERR: ' + writeErr) + } + + var err = new Error('TEST BREAK') + err.syscall = 'rename' + err.code = 'EPERM' + cb(err) + }) + }) + }) + } + + var stream = writeStream(target3, { isWin: true }) + var hadError = false + var calledFinish = false + stream.on('error', function (er) { + hadError = true + console.log('#', er) + }) + stream.on('finish', function () { + calledFinish = true + }) + stream.on('close', function () { + t.is(hadError, false, 'error was caught') + t.is(calledFinish, true, 'finish was called before close') + }) + stream.end() +}) + +test('cleanup', function (t) { + rimraf.sync(target) + rimraf.sync(target2) + rimraf.sync(target3) + t.end() +}) diff --git a/node_modules/fs-write-stream-atomic/test/rename-fail.js b/node_modules/fs-write-stream-atomic/test/rename-fail.js new file mode 100644 index 0000000..7e27f0b --- /dev/null +++ b/node_modules/fs-write-stream-atomic/test/rename-fail.js @@ -0,0 +1,30 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var writeStream = require('../index.js') + +var target = path.resolve(__dirname, 'test-rename') + +test('rename fails', function (t) { + t.plan(1) + fs.rename = function (src, dest, cb) { + cb(new Error('TEST BREAK')) + } + var stream = writeStream(target) + var hadError = false + stream.on('error', function (er) { + hadError = true + console.log('#', er) + }) + stream.on('close', function () { + t.is(hadError, true, 'error before close') + }) + stream.end() +}) + +test('cleanup', function (t) { + rimraf.sync(target) + t.end() +}) diff --git a/node_modules/fs-write-stream-atomic/test/slow-close.js b/node_modules/fs-write-stream-atomic/test/slow-close.js new file mode 100644 index 0000000..9840a6e --- /dev/null +++ b/node_modules/fs-write-stream-atomic/test/slow-close.js @@ -0,0 +1,40 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var writeStream = require('../index.js') + +var target = path.resolve(__dirname, 'test-chown') + +test('slow close', function (t) { + t.plan(2) + // The goal here is to simulate the "file close" step happening so slowly + // that the whole close/rename process could finish before the file is + // actually closed (and thus buffers truely flushed to the OS). In + // previous versions of this module, this would result in the module + // emitting finish & close before the file was fully written and in + // turn, could break other layers that tried to read the new file. + var realEmit = fs.WriteStream.prototype.emit + var reallyClosed = false + fs.WriteStream.prototype.emit = function (event) { + if (event !== 'close') return realEmit.apply(this, arguments) + setTimeout(function () { + reallyClosed = true + realEmit.call(this, 'close') + }.bind(this), 200) + } + var stream = writeStream(target) + stream.on('finish', function () { + t.is(reallyClosed, true, "didn't finish before target was closed") + }) + stream.on('close', function () { + t.is(reallyClosed, true, "didn't close before target was closed") + }) + stream.end() +}) + +test('cleanup', function (t) { + rimraf.sync(target) + t.end() +}) diff --git a/node_modules/fs-write-stream-atomic/test/toolong.js b/node_modules/fs-write-stream-atomic/test/toolong.js new file mode 100644 index 0000000..f146cc5 --- /dev/null +++ b/node_modules/fs-write-stream-atomic/test/toolong.js @@ -0,0 +1,29 @@ +var path = require('path') +var test = require('tap').test +var writeStream = require('../index.js') + +function repeat (times, string) { + var output = '' + for (var ii = 0; ii < times; ++ii) { + output += string + } + return output +} + +var target = path.resolve(__dirname, repeat(1000, 'test')) + +test('name too long', function (t) { + t.plan(2) + var stream = writeStream(target) + var hadError = false + stream.on('error', function (er) { + if (!hadError) { + t.is(er.code, 'ENAMETOOLONG', target.length + ' character name results in ENAMETOOLONG') + hadError = true + } + }) + stream.on('close', function () { + t.ok(hadError, 'got error before close') + }) + stream.end() +}) diff --git a/node_modules/fs.realpath/LICENSE b/node_modules/fs.realpath/LICENSE new file mode 100644 index 0000000..5bd884c --- /dev/null +++ b/node_modules/fs.realpath/LICENSE @@ -0,0 +1,43 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---- + +This library bundles a version of the `fs.realpath` and `fs.realpathSync` +methods from Node.js v0.10 under the terms of the Node.js MIT license. + +Node's license follows, also included at the header of `old.js` which contains +the licensed code: + + Copyright Joyent, Inc. and other Node contributors. + + 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. diff --git a/node_modules/fs.realpath/README.md b/node_modules/fs.realpath/README.md new file mode 100644 index 0000000..a42ceac --- /dev/null +++ b/node_modules/fs.realpath/README.md @@ -0,0 +1,33 @@ +# fs.realpath + +A backwards-compatible fs.realpath for Node v6 and above + +In Node v6, the JavaScript implementation of fs.realpath was replaced +with a faster (but less resilient) native implementation. That raises +new and platform-specific errors and cannot handle long or excessively +symlink-looping paths. + +This module handles those cases by detecting the new errors and +falling back to the JavaScript implementation. On versions of Node +prior to v6, it has no effect. + +## USAGE + +```js +var rp = require('fs.realpath') + +// async version +rp.realpath(someLongAndLoopingPath, function (er, real) { + // the ELOOP was handled, but it was a bit slower +}) + +// sync version +var real = rp.realpathSync(someLongAndLoopingPath) + +// monkeypatch at your own risk! +// This replaces the fs.realpath/fs.realpathSync builtins +rp.monkeypatch() + +// un-do the monkeypatching +rp.unmonkeypatch() +``` diff --git a/node_modules/fs.realpath/index.js b/node_modules/fs.realpath/index.js new file mode 100644 index 0000000..b09c7c7 --- /dev/null +++ b/node_modules/fs.realpath/index.js @@ -0,0 +1,66 @@ +module.exports = realpath +realpath.realpath = realpath +realpath.sync = realpathSync +realpath.realpathSync = realpathSync +realpath.monkeypatch = monkeypatch +realpath.unmonkeypatch = unmonkeypatch + +var fs = require('fs') +var origRealpath = fs.realpath +var origRealpathSync = fs.realpathSync + +var version = process.version +var ok = /^v[0-5]\./.test(version) +var old = require('./old.js') + +function newError (er) { + return er && er.syscall === 'realpath' && ( + er.code === 'ELOOP' || + er.code === 'ENOMEM' || + er.code === 'ENAMETOOLONG' + ) +} + +function realpath (p, cache, cb) { + if (ok) { + return origRealpath(p, cache, cb) + } + + if (typeof cache === 'function') { + cb = cache + cache = null + } + origRealpath(p, cache, function (er, result) { + if (newError(er)) { + old.realpath(p, cache, cb) + } else { + cb(er, result) + } + }) +} + +function realpathSync (p, cache) { + if (ok) { + return origRealpathSync(p, cache) + } + + try { + return origRealpathSync(p, cache) + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache) + } else { + throw er + } + } +} + +function monkeypatch () { + fs.realpath = realpath + fs.realpathSync = realpathSync +} + +function unmonkeypatch () { + fs.realpath = origRealpath + fs.realpathSync = origRealpathSync +} diff --git a/node_modules/fs.realpath/old.js b/node_modules/fs.realpath/old.js new file mode 100644 index 0000000..b40305e --- /dev/null +++ b/node_modules/fs.realpath/old.js @@ -0,0 +1,303 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +var pathModule = require('path'); +var isWindows = process.platform === 'win32'; +var fs = require('fs'); + +// JavaScript implementation of realpath, ported from node pre-v6 + +var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; + + return callback; + + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } + } + + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } + } + } +} + +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} + +var normalize = pathModule.normalize; + +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} + +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; +} + +exports.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; + } + + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; + } else { + var stat = fs.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; + } + + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } + } + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows) seenLinks[id] = linkTarget; + } + + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } + + if (cache) cache[original] = p; + + return p; +}; + + +exports.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; + } + + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); + } + + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); + } + + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); + } + + return fs.lstat(base, gotStat); + } + + function gotStat(err, stat) { + if (err) return cb(err); + + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); + } + + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs.stat(base, function(err) { + if (err) return cb(err); + + fs.readlink(base, function(err, target) { + if (!isWindows) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } + + function gotTarget(err, target, base) { + if (err) return cb(err); + + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } + + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } +}; diff --git a/node_modules/fs.realpath/package.json b/node_modules/fs.realpath/package.json new file mode 100644 index 0000000..a6504c4 --- /dev/null +++ b/node_modules/fs.realpath/package.json @@ -0,0 +1,59 @@ +{ + "_from": "fs.realpath@^1.0.0", + "_id": "fs.realpath@1.0.0", + "_inBundle": false, + "_integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "_location": "/fs.realpath", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fs.realpath@^1.0.0", + "name": "fs.realpath", + "escapedName": "fs.realpath", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "_shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", + "_spec": "fs.realpath@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/glob", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/fs.realpath/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", + "devDependencies": {}, + "files": [ + "old.js", + "index.js" + ], + "homepage": "https://github.com/isaacs/fs.realpath#readme", + "keywords": [ + "realpath", + "fs", + "polyfill" + ], + "license": "ISC", + "main": "index.js", + "name": "fs.realpath", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/fs.realpath.git" + }, + "scripts": { + "test": "tap test/*.js --cov" + }, + "version": "1.0.0" +} diff --git a/node_modules/function-bind/.editorconfig b/node_modules/function-bind/.editorconfig new file mode 100644 index 0000000..ac29ade --- /dev/null +++ b/node_modules/function-bind/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 120 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/function-bind/.eslintrc b/node_modules/function-bind/.eslintrc new file mode 100644 index 0000000..9b33d8e --- /dev/null +++ b/node_modules/function-bind/.eslintrc @@ -0,0 +1,15 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-name-matching": 0, + "indent": [2, 4], + "max-nested-callbacks": [2, 3], + "max-params": [2, 3], + "max-statements": [2, 20], + "no-new-func": [1], + "strict": [0] + } +} diff --git a/node_modules/function-bind/.jscs.json b/node_modules/function-bind/.jscs.json new file mode 100644 index 0000000..8c44794 --- /dev/null +++ b/node_modules/function-bind/.jscs.json @@ -0,0 +1,176 @@ +{ + "es3": true, + + "additionalRules": [], + + "requireSemicolons": true, + + "disallowMultipleSpaces": true, + + "disallowIdentifierNames": [], + + "requireCurlyBraces": { + "allExcept": [], + "keywords": ["if", "else", "for", "while", "do", "try", "catch"] + }, + + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], + + "disallowSpaceAfterKeywords": [], + + "disallowSpaceBeforeComma": true, + "disallowSpaceAfterComma": false, + "disallowSpaceBeforeSemicolon": true, + + "disallowNodeTypes": [ + "DebuggerStatement", + "ForInStatement", + "LabeledStatement", + "SwitchCase", + "SwitchStatement", + "WithStatement" + ], + + "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, + + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + + "requireSpaceBetweenArguments": true, + + "disallowSpacesInsideParentheses": true, + + "disallowSpacesInsideArrayBrackets": true, + + "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, + + "disallowSpaceAfterObjectKeys": true, + + "requireCommaBeforeLineBreak": true, + + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "requireSpaceAfterPrefixUnaryOperators": [], + + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireSpaceBeforePostfixUnaryOperators": [], + + "disallowSpaceBeforeBinaryOperators": [], + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "disallowSpaceAfterBinaryOperators": [], + + "disallowImplicitTypeConversion": ["binary", "string"], + + "disallowKeywords": ["with", "eval"], + + "requireKeywordsOnNewLine": [], + "disallowKeywordsOnNewLine": ["else"], + + "requireLineFeedAtFileEnd": true, + + "disallowTrailingWhitespace": true, + + "disallowTrailingComma": true, + + "excludeFiles": ["node_modules/**", "vendor/**"], + + "disallowMultipleLineStrings": true, + + "requireDotNotation": { "allExcept": ["keywords"] }, + + "requireParenthesesAroundIIFE": true, + + "validateLineBreaks": "LF", + + "validateQuoteMarks": { + "escape": true, + "mark": "'" + }, + + "disallowOperatorBeforeLineBreak": [], + + "requireSpaceBeforeKeywords": [ + "do", + "for", + "if", + "else", + "switch", + "case", + "try", + "catch", + "finally", + "while", + "with", + "return" + ], + + "validateAlignedFunctionParameters": { + "lineBreakAfterOpeningBraces": true, + "lineBreakBeforeClosingBraces": true + }, + + "requirePaddingNewLinesBeforeExport": true, + + "validateNewlineAfterArrayElements": { + "maximum": 8 + }, + + "requirePaddingNewLinesAfterUseStrict": true, + + "disallowArrowFunctions": true, + + "disallowMultiLineTernary": true, + + "validateOrderInObjectKeys": "asc-insensitive", + + "disallowIdenticalDestructuringNames": true, + + "disallowNestedTernaries": { "maxLevel": 1 }, + + "requireSpaceAfterComma": { "allExcept": ["trailing"] }, + "requireAlignedMultilineParams": false, + + "requireSpacesInGenerator": { + "afterStar": true + }, + + "disallowSpacesInGenerator": { + "beforeStar": true + }, + + "disallowVar": false, + + "requireArrayDestructuring": false, + + "requireEnhancedObjectLiterals": false, + + "requireObjectDestructuring": false, + + "requireEarlyReturn": false, + + "requireCapitalizedConstructorsNew": { + "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] + }, + + "requireImportAlphabetized": false, + + "requireSpaceBeforeObjectValues": true, + "requireSpaceBeforeDestructuredValues": true, + + "disallowSpacesInsideTemplateStringPlaceholders": true, + + "disallowArrayDestructuringReturn": false, + + "requireNewlineBeforeSingleStatementsInIf": false, + + "disallowUnusedVariables": true, + + "requireSpacesInsideImportedObjectBraces": true, + + "requireUseStrict": true +} + diff --git a/node_modules/function-bind/.npmignore b/node_modules/function-bind/.npmignore new file mode 100644 index 0000000..dbb555f --- /dev/null +++ b/node_modules/function-bind/.npmignore @@ -0,0 +1,22 @@ +# gitignore +.DS_Store +.monitor +.*.swp +.nodemonignore +releases +*.log +*.err +fleet.json +public/browserify +bin/*.json +.bin +build +compile +.lock-wscript +coverage +node_modules + +# Only apps should have lockfiles +npm-shrinkwrap.json +package-lock.json +yarn.lock diff --git a/node_modules/function-bind/.travis.yml b/node_modules/function-bind/.travis.yml new file mode 100644 index 0000000..85f70d2 --- /dev/null +++ b/node_modules/function-bind/.travis.yml @@ -0,0 +1,168 @@ +language: node_js +os: + - linux +node_js: + - "8.4" + - "7.10" + - "6.11" + - "5.12" + - "4.8" + - "iojs-v3.3" + - "iojs-v2.5" + - "iojs-v1.8" + - "0.12" + - "0.10" + - "0.8" +before_install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' + - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then if [ "${TRAVIS_NODE_VERSION%${TRAVIS_NODE_VERSION#[0-9]}}" = "0" ] || [ "${TRAVIS_NODE_VERSION:0:4}" = "iojs" ]; then npm install -g npm@4.5 ; else npm install -g npm; fi; fi' +install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' +script: + - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' + - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' + - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' +sudo: false +env: + - TEST=true +matrix: + fast_finish: true + include: + - node_js: "node" + env: PRETEST=true + - node_js: "4" + env: COVERAGE=true + - node_js: "8.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.4" + env: TEST=true ALLOW_FAILURE=true + allow_failures: + - os: osx + - env: TEST=true ALLOW_FAILURE=true diff --git a/node_modules/function-bind/LICENSE b/node_modules/function-bind/LICENSE new file mode 100644 index 0000000..62d6d23 --- /dev/null +++ b/node_modules/function-bind/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2013 Raynos. + +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. + diff --git a/node_modules/function-bind/README.md b/node_modules/function-bind/README.md new file mode 100644 index 0000000..81862a0 --- /dev/null +++ b/node_modules/function-bind/README.md @@ -0,0 +1,48 @@ +# function-bind + + + + + +Implementation of function.prototype.bind + +## Example + +I mainly do this for unit tests I run on phantomjs. +PhantomJS does not have Function.prototype.bind :( + +```js +Function.prototype.bind = require("function-bind") +``` + +## Installation + +`npm install function-bind` + +## Contributors + + - Raynos + +## MIT Licenced + + [travis-svg]: https://travis-ci.org/Raynos/function-bind.svg + [travis-url]: https://travis-ci.org/Raynos/function-bind + [npm-badge-svg]: https://badge.fury.io/js/function-bind.svg + [npm-url]: https://npmjs.org/package/function-bind + [5]: https://coveralls.io/repos/Raynos/function-bind/badge.png + [6]: https://coveralls.io/r/Raynos/function-bind + [7]: https://gemnasium.com/Raynos/function-bind.png + [8]: https://gemnasium.com/Raynos/function-bind + [deps-svg]: https://david-dm.org/Raynos/function-bind.svg + [deps-url]: https://david-dm.org/Raynos/function-bind + [dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg + [dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies + [11]: https://ci.testling.com/Raynos/function-bind.png + [12]: https://ci.testling.com/Raynos/function-bind diff --git a/node_modules/function-bind/implementation.js b/node_modules/function-bind/implementation.js new file mode 100644 index 0000000..cc4daec --- /dev/null +++ b/node_modules/function-bind/implementation.js @@ -0,0 +1,52 @@ +'use strict'; + +/* eslint no-invalid-this: 1 */ + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var slice = Array.prototype.slice; +var toStr = Object.prototype.toString; +var funcType = '[object Function]'; + +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.call(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slice.call(arguments, 1); + + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + } + }; + + var boundLength = Math.max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } + + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + + return bound; +}; diff --git a/node_modules/function-bind/index.js b/node_modules/function-bind/index.js new file mode 100644 index 0000000..3bb6b96 --- /dev/null +++ b/node_modules/function-bind/index.js @@ -0,0 +1,5 @@ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = Function.prototype.bind || implementation; diff --git a/node_modules/function-bind/package.json b/node_modules/function-bind/package.json new file mode 100644 index 0000000..dbf11c9 --- /dev/null +++ b/node_modules/function-bind/package.json @@ -0,0 +1,94 @@ +{ + "_from": "function-bind@^1.1.1", + "_id": "function-bind@1.1.1", + "_inBundle": false, + "_integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "_location": "/function-bind", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "function-bind@^1.1.1", + "name": "function-bind", + "escapedName": "function-bind", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/object.assign" + ], + "_resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "_shasum": "a56899d3ea3c9bab874bb9773b7c5ede92f4895d", + "_spec": "function-bind@^1.1.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/object.assign", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Raynos/function-bind/issues", + "email": "raynos2@gmail.com" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Raynos" + }, + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Implementation of Function.prototype.bind", + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "covert": "^1.1.0", + "eslint": "^4.5.0", + "jscs": "^3.0.7", + "tape": "^4.8.0" + }, + "homepage": "https://github.com/Raynos/function-bind", + "keywords": [ + "function", + "bind", + "shim", + "es5" + ], + "license": "MIT", + "main": "index", + "name": "function-bind", + "repository": { + "type": "git", + "url": "git://github.com/Raynos/function-bind.git" + }, + "scripts": { + "coverage": "covert test/*.js", + "eslint": "eslint *.js */*.js", + "jscs": "jscs *.js */*.js", + "lint": "npm run jscs && npm run eslint", + "posttest": "npm run coverage -- --quiet", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "node test" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "ie/8..latest", + "firefox/16..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.1.1" +} diff --git a/node_modules/function-bind/test/.eslintrc b/node_modules/function-bind/test/.eslintrc new file mode 100644 index 0000000..8a56d5b --- /dev/null +++ b/node_modules/function-bind/test/.eslintrc @@ -0,0 +1,9 @@ +{ + "rules": { + "array-bracket-newline": 0, + "array-element-newline": 0, + "max-statements-per-line": [2, { "max": 2 }], + "no-invalid-this": 0, + "no-magic-numbers": 0, + } +} diff --git a/node_modules/function-bind/test/index.js b/node_modules/function-bind/test/index.js new file mode 100644 index 0000000..2edecce --- /dev/null +++ b/node_modules/function-bind/test/index.js @@ -0,0 +1,252 @@ +// jscs:disable requireUseStrict + +var test = require('tape'); + +var functionBind = require('../implementation'); +var getCurrentContext = function () { return this; }; + +test('functionBind is a function', function (t) { + t.equal(typeof functionBind, 'function'); + t.end(); +}); + +test('non-functions', function (t) { + var nonFunctions = [true, false, [], {}, 42, 'foo', NaN, /a/g]; + t.plan(nonFunctions.length); + for (var i = 0; i < nonFunctions.length; ++i) { + try { functionBind.call(nonFunctions[i]); } catch (ex) { + t.ok(ex instanceof TypeError, 'throws when given ' + String(nonFunctions[i])); + } + } + t.end(); +}); + +test('without a context', function (t) { + t.test('binds properly', function (st) { + var args, context; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }) + }; + namespace.func(1, 2, 3); + st.deepEqual(args, [1, 2, 3]); + st.equal(context, getCurrentContext.call()); + st.end(); + }); + + t.test('binds properly, and still supplies bound arguments', function (st) { + var args, context; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, undefined, 1, 2, 3) + }; + namespace.func(4, 5, 6); + st.deepEqual(args, [1, 2, 3, 4, 5, 6]); + st.equal(context, getCurrentContext.call()); + st.end(); + }); + + t.test('returns properly', function (st) { + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, null) + }; + var context = namespace.func(1, 2, 3); + st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); + st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); + st.end(); + }); + + t.test('returns properly with bound arguments', function (st) { + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, null, 1, 2, 3) + }; + var context = namespace.func(4, 5, 6); + st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); + st.end(); + }); + + t.test('called as a constructor', function (st) { + var thunkify = function (value) { + return function () { return value; }; + }; + st.test('returns object value', function (sst) { + var expectedReturnValue = [1, 2, 3]; + var Constructor = functionBind.call(thunkify(expectedReturnValue), null); + var result = new Constructor(); + sst.equal(result, expectedReturnValue); + sst.end(); + }); + + st.test('does not return primitive value', function (sst) { + var Constructor = functionBind.call(thunkify(42), null); + var result = new Constructor(); + sst.notEqual(result, 42); + sst.end(); + }); + + st.test('object from bound constructor is instance of original and bound constructor', function (sst) { + var A = function (x) { + this.name = x || 'A'; + }; + var B = functionBind.call(A, null, 'B'); + + var result = new B(); + sst.ok(result instanceof B, 'result is instance of bound constructor'); + sst.ok(result instanceof A, 'result is instance of original constructor'); + sst.end(); + }); + + st.end(); + }); + + t.end(); +}); + +test('with a context', function (t) { + t.test('with no bound arguments', function (st) { + var args, context; + var boundContext = {}; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, boundContext) + }; + namespace.func(1, 2, 3); + st.equal(context, boundContext, 'binds a context properly'); + st.deepEqual(args, [1, 2, 3], 'supplies passed arguments'); + st.end(); + }); + + t.test('with bound arguments', function (st) { + var args, context; + var boundContext = {}; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, boundContext, 1, 2, 3) + }; + namespace.func(4, 5, 6); + st.equal(context, boundContext, 'binds a context properly'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'supplies bound and passed arguments'); + st.end(); + }); + + t.test('returns properly', function (st) { + var boundContext = {}; + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, boundContext) + }; + var context = namespace.func(1, 2, 3); + st.equal(context, boundContext, 'returned context is bound context'); + st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); + st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); + st.end(); + }); + + t.test('returns properly with bound arguments', function (st) { + var boundContext = {}; + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, boundContext, 1, 2, 3) + }; + var context = namespace.func(4, 5, 6); + st.equal(context, boundContext, 'returned context is bound context'); + st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); + st.end(); + }); + + t.test('passes the correct arguments when called as a constructor', function (st) { + var expected = { name: 'Correct' }; + var namespace = { + Func: functionBind.call(function (arg) { + return arg; + }, { name: 'Incorrect' }) + }; + var returned = new namespace.Func(expected); + st.equal(returned, expected, 'returns the right arg when called as a constructor'); + st.end(); + }); + + t.test('has the new instance\'s context when called as a constructor', function (st) { + var actualContext; + var expectedContext = { foo: 'bar' }; + var namespace = { + Func: functionBind.call(function () { + actualContext = this; + }, expectedContext) + }; + var result = new namespace.Func(); + st.equal(result instanceof namespace.Func, true); + st.notEqual(actualContext, expectedContext); + st.end(); + }); + + t.end(); +}); + +test('bound function length', function (t) { + t.test('sets a correct length without thisArg', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }); + st.equal(subject.length, 3); + st.equal(subject(1, 2, 3), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}); + st.equal(subject.length, 3); + st.equal(subject(1, 2, 3), 6); + st.end(); + }); + + t.test('sets a correct length without thisArg and first argument', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1); + st.equal(subject.length, 2); + st.equal(subject(2, 3), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg and first argument', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1); + st.equal(subject.length, 2); + st.equal(subject(2, 3), 6); + st.end(); + }); + + t.test('sets a correct length without thisArg and too many arguments', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1, 2, 3, 4); + st.equal(subject.length, 0); + st.equal(subject(), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg and too many arguments', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1, 2, 3, 4); + st.equal(subject.length, 0); + st.equal(subject(), 6); + st.end(); + }); +}); diff --git a/node_modules/get-caller-file/LICENSE.md b/node_modules/get-caller-file/LICENSE.md new file mode 100644 index 0000000..bf3e1c0 --- /dev/null +++ b/node_modules/get-caller-file/LICENSE.md @@ -0,0 +1,6 @@ +ISC License (ISC) +Copyright 2018 Stefan Penner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/get-caller-file/README.md b/node_modules/get-caller-file/README.md new file mode 100644 index 0000000..a7d8c07 --- /dev/null +++ b/node_modules/get-caller-file/README.md @@ -0,0 +1,41 @@ +# get-caller-file + +[![Build Status](https://travis-ci.org/stefanpenner/get-caller-file.svg?branch=master)](https://travis-ci.org/stefanpenner/get-caller-file) +[![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master) + +This is a utility, which allows a function to figure out from which file it was invoked. It does so by inspecting v8's stack trace at the time it is invoked. + +Inspired by http://stackoverflow.com/questions/13227489 + +*note: this relies on Node/V8 specific APIs, as such other runtimes may not work* + +## Installation + +```bash +yarn add get-caller-file +``` + +## Usage + +Given: + +```js +// ./foo.js +const getCallerFile = require('get-caller-file'); + +module.exports = function() { + return getCallerFile(); // figures out who called it +}; +``` + +```js +// index.js +const foo = require('./foo'); + +foo() // => /full/path/to/this/file/index.js +``` + + +## Options: + +* `getCallerFile(position = 2)`: where position is stack frame whos fileName we want. diff --git a/node_modules/get-caller-file/index.d.ts b/node_modules/get-caller-file/index.d.ts new file mode 100644 index 0000000..babed69 --- /dev/null +++ b/node_modules/get-caller-file/index.d.ts @@ -0,0 +1,2 @@ +declare const _default: (position?: number) => any; +export = _default; diff --git a/node_modules/get-caller-file/index.js b/node_modules/get-caller-file/index.js new file mode 100644 index 0000000..57304f8 --- /dev/null +++ b/node_modules/get-caller-file/index.js @@ -0,0 +1,22 @@ +"use strict"; +// Call this function in a another function to find out the file from +// which that function was called from. (Inspects the v8 stack trace) +// +// Inspired by http://stackoverflow.com/questions/13227489 +module.exports = function getCallerFile(position) { + if (position === void 0) { position = 2; } + if (position >= Error.stackTraceLimit) { + throw new TypeError('getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `' + position + '` and Error.stackTraceLimit was: `' + Error.stackTraceLimit + '`'); + } + var oldPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = function (_, stack) { return stack; }; + var stack = new Error().stack; + Error.prepareStackTrace = oldPrepareStackTrace; + if (stack !== null && typeof stack === 'object') { + // stack[0] holds this file + // stack[1] holds where this function was called + // stack[2] holds the file we're interested in + return stack[position] ? stack[position].getFileName() : undefined; + } +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/get-caller-file/index.js.map b/node_modules/get-caller-file/index.js.map new file mode 100644 index 0000000..89c655c --- /dev/null +++ b/node_modules/get-caller-file/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,qEAAqE;AACrE,EAAE;AACF,0DAA0D;AAE1D,iBAAS,SAAS,aAAa,CAAC,QAAY;IAAZ,yBAAA,EAAA,YAAY;IAC1C,IAAI,QAAQ,IAAI,KAAK,CAAC,eAAe,EAAE;QACrC,MAAM,IAAI,SAAS,CAAC,kGAAkG,GAAG,QAAQ,GAAG,oCAAoC,GAAG,KAAK,CAAC,eAAe,GAAG,GAAG,CAAC,CAAC;KACzM;IAED,IAAM,oBAAoB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACrD,KAAK,CAAC,iBAAiB,GAAG,UAAC,CAAC,EAAE,KAAK,IAAM,OAAA,KAAK,EAAL,CAAK,CAAC;IAC/C,IAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC;IAChC,KAAK,CAAC,iBAAiB,GAAG,oBAAoB,CAAC;IAG/C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC/C,2BAA2B;QAC3B,gDAAgD;QAChD,8CAA8C;QAC9C,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAE,KAAK,CAAC,QAAQ,CAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;KAC7E;AACH,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/get-caller-file/package.json b/node_modules/get-caller-file/package.json new file mode 100644 index 0000000..9e5bbbc --- /dev/null +++ b/node_modules/get-caller-file/package.json @@ -0,0 +1,69 @@ +{ + "_from": "get-caller-file@^2.0.1", + "_id": "get-caller-file@2.0.5", + "_inBundle": false, + "_integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "_location": "/get-caller-file", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "get-caller-file@^2.0.1", + "name": "get-caller-file", + "escapedName": "get-caller-file", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/yargs" + ], + "_resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "_shasum": "4f94412a82db32f36e3b0b9741f8a97feb031f7e", + "_spec": "get-caller-file@^2.0.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/yargs", + "author": { + "name": "Stefan Penner" + }, + "bugs": { + "url": "https://github.com/stefanpenner/get-caller-file/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "[![Build Status](https://travis-ci.org/stefanpenner/get-caller-file.svg?branch=master)](https://travis-ci.org/stefanpenner/get-caller-file) [![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master)", + "devDependencies": { + "@types/chai": "^4.1.7", + "@types/ensure-posix-path": "^1.0.0", + "@types/mocha": "^5.2.6", + "@types/node": "^11.10.5", + "chai": "^4.1.2", + "ensure-posix-path": "^1.0.1", + "mocha": "^5.2.0", + "typescript": "^3.3.3333" + }, + "directories": { + "test": "tests" + }, + "engines": { + "node": "6.* || 8.* || >= 10.*" + }, + "files": [ + "index.js", + "index.js.map", + "index.d.ts" + ], + "homepage": "https://github.com/stefanpenner/get-caller-file#readme", + "license": "ISC", + "main": "index.js", + "name": "get-caller-file", + "repository": { + "type": "git", + "url": "git+https://github.com/stefanpenner/get-caller-file.git" + }, + "scripts": { + "prepare": "tsc", + "test": "mocha test", + "test:debug": "mocha test" + }, + "version": "2.0.5" +} diff --git a/node_modules/get-stream/buffer-stream.js b/node_modules/get-stream/buffer-stream.js new file mode 100644 index 0000000..4121c8e --- /dev/null +++ b/node_modules/get-stream/buffer-stream.js @@ -0,0 +1,51 @@ +'use strict'; +const {PassThrough} = require('stream'); + +module.exports = options => { + options = Object.assign({}, options); + + const {array} = options; + let {encoding} = options; + const buffer = encoding === 'buffer'; + let objectMode = false; + + if (array) { + objectMode = !(encoding || buffer); + } else { + encoding = encoding || 'utf8'; + } + + if (buffer) { + encoding = null; + } + + let len = 0; + const ret = []; + const stream = new PassThrough({objectMode}); + + if (encoding) { + stream.setEncoding(encoding); + } + + stream.on('data', chunk => { + ret.push(chunk); + + if (objectMode) { + len = ret.length; + } else { + len += chunk.length; + } + }); + + stream.getBufferedValue = () => { + if (array) { + return ret; + } + + return buffer ? Buffer.concat(ret, len) : ret.join(''); + }; + + stream.getBufferedLength = () => len; + + return stream; +}; diff --git a/node_modules/get-stream/index.js b/node_modules/get-stream/index.js new file mode 100644 index 0000000..7e5584a --- /dev/null +++ b/node_modules/get-stream/index.js @@ -0,0 +1,50 @@ +'use strict'; +const pump = require('pump'); +const bufferStream = require('./buffer-stream'); + +class MaxBufferError extends Error { + constructor() { + super('maxBuffer exceeded'); + this.name = 'MaxBufferError'; + } +} + +function getStream(inputStream, options) { + if (!inputStream) { + return Promise.reject(new Error('Expected a stream')); + } + + options = Object.assign({maxBuffer: Infinity}, options); + + const {maxBuffer} = options; + + let stream; + return new Promise((resolve, reject) => { + const rejectPromise = error => { + if (error) { // A null check + error.bufferedData = stream.getBufferedValue(); + } + reject(error); + }; + + stream = pump(inputStream, bufferStream(options), error => { + if (error) { + rejectPromise(error); + return; + } + + resolve(); + }); + + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + rejectPromise(new MaxBufferError()); + } + }); + }).then(() => stream.getBufferedValue()); +} + +module.exports = getStream; +module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'})); +module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true})); +module.exports.MaxBufferError = MaxBufferError; diff --git a/node_modules/get-stream/license b/node_modules/get-stream/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/get-stream/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/get-stream/package.json b/node_modules/get-stream/package.json new file mode 100644 index 0000000..fcb72fd --- /dev/null +++ b/node_modules/get-stream/package.json @@ -0,0 +1,78 @@ +{ + "_from": "get-stream@^4.0.0", + "_id": "get-stream@4.1.0", + "_inBundle": false, + "_integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "_location": "/get-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "get-stream@^4.0.0", + "name": "get-stream", + "escapedName": "get-stream", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/execa" + ], + "_resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "_shasum": "c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5", + "_spec": "get-stream@^4.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/execa", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/get-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "pump": "^3.0.0" + }, + "deprecated": false, + "description": "Get a stream as a string, buffer, or array", + "devDependencies": { + "ava": "*", + "into-stream": "^3.0.0", + "xo": "*" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js", + "buffer-stream.js" + ], + "homepage": "https://github.com/sindresorhus/get-stream#readme", + "keywords": [ + "get", + "stream", + "promise", + "concat", + "string", + "text", + "buffer", + "read", + "data", + "consume", + "readable", + "readablestream", + "array", + "object" + ], + "license": "MIT", + "name": "get-stream", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/get-stream.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "4.1.0" +} diff --git a/node_modules/get-stream/readme.md b/node_modules/get-stream/readme.md new file mode 100644 index 0000000..b87a4d3 --- /dev/null +++ b/node_modules/get-stream/readme.md @@ -0,0 +1,123 @@ +# get-stream [![Build Status](https://travis-ci.org/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stream) + +> Get a stream as a string, buffer, or array + + +## Install + +``` +$ npm install get-stream +``` + + +## Usage + +```js +const fs = require('fs'); +const getStream = require('get-stream'); + +(async () => { + const stream = fs.createReadStream('unicorn.txt'); + + console.log(await getStream(stream)); + /* + ,,))))))));, + __)))))))))))))), + \|/ -\(((((''''((((((((. + -*-==//////(('' . `)))))), + /|\ ))| o ;-. '((((( ,(, + ( `| / ) ;))))' ,_))^;(~ + | | | ,))((((_ _____------~~~-. %,;(;(>';'~ + o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~ + ; ''''```` `: `:::|\,__,%% );`'; ~ + | _ ) / `:|`----' `-' + ______/\/~ | / / + /~;;.____/;;' / ___--,-( `;;;/ + / // _;______;'------~~~~~ /;;/\ / + // | | / ; \;;,\ + (<_ | ; /',/-----' _> + \_| ||_ //~;~~~~~~~~~ + `\_| (,~~ + \~\ + ~~ + */ +})(); +``` + + +## API + +The methods returns a promise that resolves when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode. + +### getStream(stream, [options]) + +Get the `stream` as a string. + +#### options + +Type: `Object` + +##### encoding + +Type: `string`
+Default: `utf8` + +[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream. + +##### maxBuffer + +Type: `number`
+Default: `Infinity` + +Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected with a `getStream.MaxBufferError` error. + +### getStream.buffer(stream, [options]) + +Get the `stream` as a buffer. + +It honors the `maxBuffer` option as above, but it refers to byte length rather than string length. + +### getStream.array(stream, [options]) + +Get the `stream` as an array of values. + +It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen: + +- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes). + +- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array. + +- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array. + + +## Errors + +If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error. + +```js +(async () => { + try { + await getStream(streamThatErrorsAtTheEnd('unicorn')); + } catch (error) { + console.log(error.bufferedData); + //=> 'unicorn' + } +})() +``` + + +## FAQ + +### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)? + +This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package. + + +## Related + +- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/get-value/LICENSE b/node_modules/get-value/LICENSE new file mode 100644 index 0000000..39245ac --- /dev/null +++ b/node_modules/get-value/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +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. diff --git a/node_modules/get-value/index.js b/node_modules/get-value/index.js new file mode 100644 index 0000000..5879a88 --- /dev/null +++ b/node_modules/get-value/index.js @@ -0,0 +1,50 @@ +/*! + * get-value + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function(obj, prop, a, b, c) { + if (!isObject(obj) || !prop) { + return obj; + } + + prop = toString(prop); + + // allowing for multiple properties to be passed as + // a string or array, but much faster (3-4x) than doing + // `[].slice.call(arguments)` + if (a) prop += '.' + toString(a); + if (b) prop += '.' + toString(b); + if (c) prop += '.' + toString(c); + + if (prop in obj) { + return obj[prop]; + } + + var segs = prop.split('.'); + var len = segs.length; + var i = -1; + + while (obj && (++i < len)) { + var key = segs[i]; + while (key[key.length - 1] === '\\') { + key = key.slice(0, -1) + '.' + segs[++i]; + } + obj = obj[key]; + } + return obj; +}; + +function isObject(val) { + return val !== null && (typeof val === 'object' || typeof val === 'function'); +} + +function toString(val) { + if (!val) return ''; + if (Array.isArray(val)) { + return val.join('.'); + } + return val; +} diff --git a/node_modules/get-value/package.json b/node_modules/get-value/package.json new file mode 100644 index 0000000..df21737 --- /dev/null +++ b/node_modules/get-value/package.json @@ -0,0 +1,113 @@ +{ + "_from": "get-value@^2.0.6", + "_id": "get-value@2.0.6", + "_inBundle": false, + "_integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "_location": "/get-value", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "get-value@^2.0.6", + "name": "get-value", + "escapedName": "get-value", + "rawSpec": "^2.0.6", + "saveSpec": null, + "fetchSpec": "^2.0.6" + }, + "_requiredBy": [ + "/cache-base", + "/has-value", + "/union-value", + "/unset-value/has-value" + ], + "_resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "_shasum": "dc15ca1c672387ca76bd37ac0a395ba2042a2c28", + "_spec": "get-value@^2.0.6", + "_where": "/usr/share/r3-server/beta/r3/node_modules/cache-base", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/get-value/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Use property paths (`a.b.c`) to get a nested value from an object.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "arr-reduce": "^1.0.1", + "benchmarked": "^0.1.4", + "dot-prop": "^2.2.0", + "getobject": "^0.1.0", + "gulp": "^3.9.0", + "gulp-eslint": "^1.1.1", + "gulp-format-md": "^0.1.5", + "gulp-istanbul": "^0.10.2", + "gulp-mocha": "^2.1.3", + "isobject": "^2.0.0", + "matched": "^0.3.2", + "minimist": "^1.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/get-value", + "keywords": [ + "get", + "key", + "nested", + "object", + "path", + "paths", + "prop", + "properties", + "property", + "props", + "segment", + "value", + "values" + ], + "license": "MIT", + "main": "index.js", + "name": "get-value", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/get-value.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "has-any", + "has-any-deep", + "has-value", + "set-value", + "unset-value" + ] + }, + "reflinks": [ + "verb", + "verb-readme-generator" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.0.6" +} diff --git a/node_modules/glob-parent/LICENSE b/node_modules/glob-parent/LICENSE new file mode 100644 index 0000000..734076d --- /dev/null +++ b/node_modules/glob-parent/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2015 Elan Shanker + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/glob-parent/README.md b/node_modules/glob-parent/README.md new file mode 100644 index 0000000..3bec5c7 --- /dev/null +++ b/node_modules/glob-parent/README.md @@ -0,0 +1,109 @@ +glob-parent [![Build Status](https://travis-ci.org/es128/glob-parent.svg)](https://travis-ci.org/es128/glob-parent) [![Coverage Status](https://img.shields.io/coveralls/es128/glob-parent.svg)](https://coveralls.io/r/es128/glob-parent?branch=master) +====== +Javascript module to extract the non-magic parent path from a glob string. + +[![NPM](https://nodei.co/npm/glob-parent.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/glob-parent/) +[![NPM](https://nodei.co/npm-dl/glob-parent.png?height=3&months=9)](https://nodei.co/npm-dl/glob-parent/) + +Usage +----- +```sh +npm install glob-parent --save +``` + +**Examples** + +```js +var globParent = require('glob-parent'); + +globParent('path/to/*.js'); // 'path/to' +globParent('/root/path/to/*.js'); // '/root/path/to' +globParent('/*.js'); // '/' +globParent('*.js'); // '.' +globParent('**/*.js'); // '.' +globParent('path/{to,from}'); // 'path' +globParent('path/!(to|from)'); // 'path' +globParent('path/?(to|from)'); // 'path' +globParent('path/+(to|from)'); // 'path' +globParent('path/*(to|from)'); // 'path' +globParent('path/@(to|from)'); // 'path' +globParent('path/**/*'); // 'path' + +// if provided a non-glob path, returns the nearest dir +globParent('path/foo/bar.js'); // 'path/foo' +globParent('path/foo/'); // 'path/foo' +globParent('path/foo'); // 'path' (see issue #3 for details) +``` + +## Escaping + +The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters: + +- `?` (question mark) +- `*` (star) +- `|` (pipe) +- `(` (opening parenthesis) +- `)` (closing parenthesis) +- `{` (opening curly brace) +- `}` (closing curly brace) +- `[` (opening bracket) +- `]` (closing bracket) + +**Example** + +```js +globParent('foo/[bar]/') // 'foo' +globParent('foo/\\[bar]/') // 'foo/[bar]' +``` + +## Limitations + +#### Braces & Brackets +This library attempts a quick and imperfect method of determining which path +parts have glob magic without fully parsing/lexing the pattern. There are some +advanced use cases that can trip it up, such as nested braces where the outer +pair is escaped and the inner one contains a path separator. If you find +yourself in the unlikely circumstance of being affected by this or need to +ensure higher-fidelity glob handling in your library, it is recommended that you +pre-process your input with [expand-braces] and/or [expand-brackets]. + +#### Windows +Backslashes are not valid path separators for globs. If a path with backslashes +is provided anyway, for simple cases, glob-parent will replace the path +separator for you and return the non-glob parent path (now with +forward-slashes, which are still valid as Windows path separators). + +This cannot be used in conjunction with escape characters. + +```js +// BAD +globParent('C:\\Program Files \\(x86\\)\\*.ext') // 'C:/Program Files /(x86/)' + +// GOOD +globParent('C:/Program Files\\(x86\\)/*.ext') // 'C:/Program Files (x86)' +``` + +If you are using escape characters for a pattern without path parts (i.e. +relative to `cwd`), prefix with `./` to avoid confusing glob-parent. + +```js +// BAD +globParent('foo \\[bar]') // 'foo ' +globParent('foo \\[bar]*') // 'foo ' + +// GOOD +globParent('./foo \\[bar]') // 'foo [bar]' +globParent('./foo \\[bar]*') // '.' +``` + + +Change Log +---------- +[See release notes page on GitHub](https://github.com/es128/glob-parent/releases) + +License +------- +[ISC](https://raw.github.com/es128/glob-parent/master/LICENSE) + +[expand-braces]: https://github.com/jonschlinkert/expand-braces +[expand-brackets]: https://github.com/jonschlinkert/expand-brackets diff --git a/node_modules/glob-parent/index.js b/node_modules/glob-parent/index.js new file mode 100644 index 0000000..3a14a53 --- /dev/null +++ b/node_modules/glob-parent/index.js @@ -0,0 +1,24 @@ +'use strict'; + +var path = require('path'); +var isglob = require('is-glob'); +var pathDirname = require('path-dirname'); +var isWin32 = require('os').platform() === 'win32'; + +module.exports = function globParent(str) { + // flip windows path separators + if (isWin32 && str.indexOf('/') < 0) str = str.split('\\').join('/'); + + // special case for strings ending in enclosure containing path separator + if (/[\{\[].*[\/]*.*[\}\]]$/.test(str)) str += '/'; + + // preserves full path in case of trailing path separator + str += 'a'; + + // remove path parts that are globby + do {str = pathDirname.posix(str)} + while (isglob(str) || /(^|[^\\])([\{\[]|\([^\)]+$)/.test(str)); + + // remove escape chars and return result + return str.replace(/\\([\*\?\|\[\]\(\)\{\}])/g, '$1'); +}; diff --git a/node_modules/glob-parent/node_modules/is-glob/LICENSE b/node_modules/glob-parent/node_modules/is-glob/LICENSE new file mode 100644 index 0000000..39245ac --- /dev/null +++ b/node_modules/glob-parent/node_modules/is-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +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. diff --git a/node_modules/glob-parent/node_modules/is-glob/README.md b/node_modules/glob-parent/node_modules/is-glob/README.md new file mode 100644 index 0000000..6f4404f --- /dev/null +++ b/node_modules/glob-parent/node_modules/is-glob/README.md @@ -0,0 +1,142 @@ +# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-glob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-glob) + +> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-glob +``` + +You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). + +## Usage + +```js +var isGlob = require('is-glob'); +``` + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js'); +isGlob('*.js'); +isGlob('**/abc.js'); +isGlob('abc/*.js'); +isGlob('abc/(aaa|bbb).js'); +isGlob('abc/[a-z].js'); +isGlob('abc/{a,b}.js'); +isGlob('abc/?.js'); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js'); +isGlob('abc/!(a).js'); +isGlob('abc/+(a).js'); +isGlob('abc/*(a).js'); +isGlob('abc/?(a).js'); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('abc/\\@(a).js'); +isGlob('abc/\\!(a).js'); +isGlob('abc/\\+(a).js'); +isGlob('abc/\\*(a).js'); +isGlob('abc/\\?(a).js'); +isGlob('\\!foo.js'); +isGlob('\\*.js'); +isGlob('\\*\\*/abc.js'); +isGlob('abc/\\*.js'); +isGlob('abc/\\(aaa|bbb).js'); +isGlob('abc/\\[a-z].js'); +isGlob('abc/\\{a,b}.js'); +isGlob('abc/\\?.js'); +//=> false +``` + +Patterns that do not have glob patterns return `false`: + +```js +isGlob('abc.js'); +isGlob('abc/def/ghi.js'); +isGlob('foo.js'); +isGlob('abc/@.js'); +isGlob('abc/+.js'); +isGlob(); +isGlob(null); +//=> false +``` + +Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): + +```js +isGlob(['**/*.js']); +isGlob(['foo.js']); +//=> false +``` + +## About + +### Related projects + +* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") +* [base](https://www.npmjs.com/package/base): base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://github.com/node-base/base) | [homepage](https://github.com/node-base/base "base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting with a handful of common methods, like `set`, `get`, `del` and `use`.") +* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") +* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor**
| +| --- | --- | +| 40 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [tuvistavie](https://github.com/tuvistavie) | + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-glob/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file diff --git a/node_modules/glob-parent/node_modules/is-glob/index.js b/node_modules/glob-parent/node_modules/is-glob/index.js new file mode 100644 index 0000000..2ecbe2a --- /dev/null +++ b/node_modules/glob-parent/node_modules/is-glob/index.js @@ -0,0 +1,25 @@ +/*! + * is-glob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +var isExtglob = require('is-extglob'); + +module.exports = function isGlob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + if (isExtglob(str)) return true; + + var regex = /(\\).|([*?]|\[.*\]|\{.*\}|\(.*\|.*\)|^!)/; + var match; + + while ((match = regex.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + return false; +}; diff --git a/node_modules/glob-parent/node_modules/is-glob/package.json b/node_modules/glob-parent/node_modules/is-glob/package.json new file mode 100644 index 0000000..736c8c2 --- /dev/null +++ b/node_modules/glob-parent/node_modules/is-glob/package.json @@ -0,0 +1,119 @@ +{ + "_from": "is-glob@^3.1.0", + "_id": "is-glob@3.1.0", + "_inBundle": false, + "_integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "_location": "/glob-parent/is-glob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-glob@^3.1.0", + "name": "is-glob", + "escapedName": "is-glob", + "rawSpec": "^3.1.0", + "saveSpec": null, + "fetchSpec": "^3.1.0" + }, + "_requiredBy": [ + "/glob-parent" + ], + "_resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "_shasum": "7ba5ae24217804ac70707b96922567486cc3e84a", + "_spec": "is-glob@^3.1.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/glob-parent", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-glob/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Daniel Perez", + "email": "daniel@claudetech.com", + "url": "http://tuvistavie.com" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "is-extglob": "^2.1.0" + }, + "deprecated": false, + "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-glob", + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "license": "MIT", + "main": "index.js", + "name": "is-glob", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-glob.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "layout": "default", + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "assemble", + "base", + "update", + "verb" + ] + }, + "reflinks": [ + "assemble", + "bach", + "base", + "composer", + "gulp", + "has-glob", + "is-valid-glob", + "micromatch", + "npm", + "scaffold", + "verb", + "vinyl" + ] + }, + "version": "3.1.0" +} diff --git a/node_modules/glob-parent/package.json b/node_modules/glob-parent/package.json new file mode 100644 index 0000000..40504b3 --- /dev/null +++ b/node_modules/glob-parent/package.json @@ -0,0 +1,72 @@ +{ + "_from": "glob-parent@^3.1.0", + "_id": "glob-parent@3.1.0", + "_inBundle": false, + "_integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "_location": "/glob-parent", + "_phantomChildren": { + "is-extglob": "2.1.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "glob-parent@^3.1.0", + "name": "glob-parent", + "escapedName": "glob-parent", + "rawSpec": "^3.1.0", + "saveSpec": null, + "fetchSpec": "^3.1.0" + }, + "_requiredBy": [ + "/chokidar" + ], + "_resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "_shasum": "9e6af6299d8d3bd2bd40430832bd113df906c5ae", + "_spec": "glob-parent@^3.1.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/chokidar", + "author": { + "name": "Elan Shanker", + "url": "https://github.com/es128" + }, + "bugs": { + "url": "https://github.com/es128/glob-parent/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "deprecated": false, + "description": "Strips glob magic from a string to provide the parent directory path", + "devDependencies": { + "coveralls": "^2.11.2", + "istanbul": "^0.3.5", + "mocha": "^2.1.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/es128/glob-parent", + "keywords": [ + "glob", + "parent", + "strip", + "path", + "dirname", + "directory", + "base", + "wildcard" + ], + "license": "ISC", + "main": "index.js", + "name": "glob-parent", + "repository": { + "type": "git", + "url": "git+https://github.com/es128/glob-parent.git" + }, + "scripts": { + "ci-test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls", + "test": "istanbul test node_modules/mocha/bin/_mocha" + }, + "version": "3.1.0" +} diff --git a/node_modules/glob-stream/LICENSE b/node_modules/glob-stream/LICENSE new file mode 100755 index 0000000..67fa13b --- /dev/null +++ b/node_modules/glob-stream/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017 Blaine Bublitz , Eric Schoffstall and other contributors + +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. diff --git a/node_modules/glob-stream/README.md b/node_modules/glob-stream/README.md new file mode 100644 index 0000000..12c103e --- /dev/null +++ b/node_modules/glob-stream/README.md @@ -0,0 +1,146 @@ +

+ + + +

+ +# glob-stream + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +A [Readable Stream][readable-stream-url] interface over [node-glob][node-glob-url]. + +## Usage + +```javascript +var gs = require('glob-stream'); + +var readable = gs('./files/**/*.coffee', { /* options */ }); + +var writable = /* your WriteableStream */ + +readable.pipe(writable); +``` + +You can pass any combination of glob strings. One caveat is that you cannot __only__ pass a negative glob, you must give it at least one positive glob so it knows where to start. If given a non-glob path (also referred to as a singular glob), only one file will be emitted. If given a singular glob and no files match, an error is emitted (see also [`options.allowEmpty`][allow-empty-url]). + +## API + +### `globStream(globs, options)` + +Takes a glob string or an array of glob strings as the first argument and an options object as the second. Returns a stream of objects that contain `cwd`, `base` and `path` properties. + +#### Options + +##### `options.allowEmpty` + +Whether or not to error upon an empty singular glob. + +Type: `Boolean` + +Default: `false` (error upon no match) + +##### `options.dot` + +Whether or not to treat dotfiles as regular files. This is passed through to [node-glob][node-glob-url]. + +Type: `Boolean` + +Default: `false` + +##### `options.silent` + +Whether or not to suppress warnings on stderr from [node-glob][node-glob-url]. This is passed through to [node-glob][node-glob-url]. + +Type: `Boolean` + +Default: `true` + +##### `options.cwd` + +The current working directory that the glob is resolved against. + +Type: `String` + +Default: `process.cwd()` + +##### `options.root` + +The root path that the glob is resolved against. + +__Note: This is never passed to [node-glob][node-glob-url] because it is pre-resolved against your paths.__ + +Type: `String` + +Default: `undefined` (use the filesystem root) + +##### `options.base` + +The absolute segment of the glob path that isn't a glob. This value is attached to each glob object and is useful for relative pathing. + +Type: `String` + +Default: The absolute path segement before a glob starts (see [glob-parent][glob-parent-url]) + +##### `options.cwdbase` + +Whether or not the `cwd` and `base` should be the same. + +Type: `Boolean` + +Default: `false` + +##### `options.uniqueBy` + +Filters stream to remove duplicates based on the string property name or the result of function. When using a function, the function receives the streamed data (objects containing `cwd`, `base`, `path` properties) to compare against. + +Type: `String` or `Function` + +Default: `'path'` + +##### other + +Any glob-related options are documented in [node-glob][node-glob-url]. Those options are forwarded verbatim, with the exception of `root` and `ignore`. `root` is pre-resolved and `ignore` is joined with all negative globs. + +#### Globbing & Negation + +```js +var stream = gs(['./**/*.js', '!./node_modules/**/*']); +``` + +Globs are executed in order, so negations should follow positive globs. For example: + +The following would __not__ exclude any files: +```js +gs(['!b*.js', '*.js']) +``` + +However, this would exclude all files that started with `b`: +```js +gs(['*.js', '!b*.js']) +``` + +## License + +MIT + +[node-glob-url]: https://github.com/isaacs/node-glob +[glob-parent-url]: https://github.com/es128/glob-parent +[allow-empty-url]: #optionsallowempty +[readable-stream-url]: https://nodejs.org/api/stream.html#stream_readable_streams + +[downloads-image]: http://img.shields.io/npm/dm/glob-stream.svg +[npm-url]: https://www.npmjs.com/package/glob-stream +[npm-image]: http://img.shields.io/npm/v/glob-stream.svg + +[travis-url]: https://travis-ci.org/gulpjs/glob-stream +[travis-image]: http://img.shields.io/travis/gulpjs/glob-stream.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-stream +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-stream.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/glob-stream +[coveralls-image]: http://img.shields.io/coveralls/gulpjs/glob-stream.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/node_modules/glob-stream/index.js b/node_modules/glob-stream/index.js new file mode 100644 index 0000000..dd012f6 --- /dev/null +++ b/node_modules/glob-stream/index.js @@ -0,0 +1,94 @@ +'use strict'; + +var Combine = require('ordered-read-streams'); +var unique = require('unique-stream'); +var pumpify = require('pumpify'); +var isNegatedGlob = require('is-negated-glob'); +var extend = require('extend'); + +var GlobStream = require('./readable'); + +function globStream(globs, opt) { + if (!opt) { + opt = {}; + } + + var ourOpt = extend({}, opt); + var ignore = ourOpt.ignore; + + ourOpt.cwd = typeof ourOpt.cwd === 'string' ? ourOpt.cwd : process.cwd(); + ourOpt.dot = typeof ourOpt.dot === 'boolean' ? ourOpt.dot : false; + ourOpt.silent = typeof ourOpt.silent === 'boolean' ? ourOpt.silent : true; + ourOpt.cwdbase = typeof ourOpt.cwdbase === 'boolean' ? ourOpt.cwdbase : false; + ourOpt.uniqueBy = typeof ourOpt.uniqueBy === 'string' || + typeof ourOpt.uniqueBy === 'function' ? ourOpt.uniqueBy : 'path'; + + if (ourOpt.cwdbase) { + ourOpt.base = ourOpt.cwd; + } + // Normalize string `ignore` to array + if (typeof ignore === 'string') { + ignore = [ignore]; + } + // Ensure `ignore` is an array + if (!Array.isArray(ignore)) { + ignore = []; + } + + // Only one glob no need to aggregate + if (!Array.isArray(globs)) { + globs = [globs]; + } + + var positives = []; + var negatives = []; + + globs.forEach(sortGlobs); + + function sortGlobs(globString, index) { + if (typeof globString !== 'string') { + throw new Error('Invalid glob at index ' + index); + } + + var glob = isNegatedGlob(globString); + var globArray = glob.negated ? negatives : positives; + + globArray.push({ + index: index, + glob: glob.pattern, + }); + } + + if (positives.length === 0) { + throw new Error('Missing positive glob'); + } + + // Create all individual streams + var streams = positives.map(streamFromPositive); + + // Then just pipe them to a single unique stream and return it + var aggregate = new Combine(streams); + var uniqueStream = unique(ourOpt.uniqueBy); + + return pumpify.obj(aggregate, uniqueStream); + + function streamFromPositive(positive) { + var negativeGlobs = negatives + .filter(indexGreaterThan(positive.index)) + .map(toGlob) + .concat(ignore); + return new GlobStream(positive.glob, negativeGlobs, ourOpt); + } +} + +function indexGreaterThan(index) { + return function(obj) { + return obj.index > index; + }; +} + +function toGlob(obj) { + return obj.glob; +} + +module.exports = globStream; diff --git a/node_modules/glob-stream/package.json b/node_modules/glob-stream/package.json new file mode 100644 index 0000000..7259287 --- /dev/null +++ b/node_modules/glob-stream/package.json @@ -0,0 +1,101 @@ +{ + "_from": "glob-stream@^6.1.0", + "_id": "glob-stream@6.1.0", + "_inBundle": false, + "_integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=", + "_location": "/glob-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "glob-stream@^6.1.0", + "name": "glob-stream", + "escapedName": "glob-stream", + "rawSpec": "^6.1.0", + "saveSpec": null, + "fetchSpec": "^6.1.0" + }, + "_requiredBy": [ + "/vinyl-fs" + ], + "_resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", + "_shasum": "7045c99413b3eb94888d83ab46d0b404cc7bdde4", + "_spec": "glob-stream@^6.1.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/vinyl-fs", + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "http://gulpjs.com/" + }, + "bugs": { + "url": "https://github.com/gulpjs/glob-stream/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Eric Schoffstall", + "email": "yo@contra.io" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com" + } + ], + "dependencies": { + "extend": "^3.0.0", + "glob": "^7.1.1", + "glob-parent": "^3.1.0", + "is-negated-glob": "^1.0.0", + "ordered-read-streams": "^1.0.0", + "pumpify": "^1.3.5", + "readable-stream": "^2.1.5", + "remove-trailing-separator": "^1.0.1", + "to-absolute-glob": "^2.0.0", + "unique-stream": "^2.0.2" + }, + "deprecated": false, + "description": "A Readable Stream interface over node-glob.", + "devDependencies": { + "eslint": "^1.10.3", + "eslint-config-gulp": "^2.0.0", + "expect": "^1.19.0", + "istanbul": "^0.4.3", + "istanbul-coveralls": "^1.0.3", + "jscs": "^2.4.0", + "jscs-preset-gulp": "^1.0.0", + "mississippi": "^1.2.0", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "index.js", + "readable.js", + "LICENSE" + ], + "homepage": "https://github.com/gulpjs/glob-stream#readme", + "keywords": [ + "glob", + "stream", + "gulp", + "readable", + "fs", + "files" + ], + "license": "MIT", + "main": "index.js", + "name": "glob-stream", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/glob-stream.git" + }, + "scripts": { + "cover": "istanbul cover _mocha --report lcovonly", + "coveralls": "npm run cover && istanbul-coveralls", + "lint": "eslint . && jscs index.js readable.js test/", + "pretest": "npm run lint", + "test": "mocha --async-only" + }, + "version": "6.1.0" +} diff --git a/node_modules/glob-stream/readable.js b/node_modules/glob-stream/readable.js new file mode 100644 index 0000000..36cf7b6 --- /dev/null +++ b/node_modules/glob-stream/readable.js @@ -0,0 +1,117 @@ +'use strict'; + +var inherits = require('util').inherits; + +var glob = require('glob'); +var extend = require('extend'); +var Readable = require('readable-stream').Readable; +var globParent = require('glob-parent'); +var toAbsoluteGlob = require('to-absolute-glob'); +var removeTrailingSeparator = require('remove-trailing-separator'); + +var globErrMessage1 = 'File not found with singular glob: '; +var globErrMessage2 = ' (if this was purposeful, use `allowEmpty` option)'; + +function getBasePath(ourGlob, opt) { + return globParent(toAbsoluteGlob(ourGlob, opt)); +} + +function globIsSingular(glob) { + var globSet = glob.minimatch.set; + if (globSet.length !== 1) { + return false; + } + + return globSet[0].every(function isString(value) { + return typeof value === 'string'; + }); +} + +function GlobStream(ourGlob, negatives, opt) { + if (!(this instanceof GlobStream)) { + return new GlobStream(ourGlob, negatives, opt); + } + + var ourOpt = extend({}, opt); + + Readable.call(this, { + objectMode: true, + highWaterMark: ourOpt.highWaterMark || 16, + }); + + // Delete `highWaterMark` after inheriting from Readable + delete ourOpt.highWaterMark; + + var self = this; + + function resolveNegatives(negative) { + return toAbsoluteGlob(negative, ourOpt); + } + + var ourNegatives = negatives.map(resolveNegatives); + ourOpt.ignore = ourNegatives; + + var cwd = ourOpt.cwd; + var allowEmpty = ourOpt.allowEmpty || false; + + // Extract base path from glob + var basePath = ourOpt.base || getBasePath(ourGlob, ourOpt); + + // Remove path relativity to make globs make sense + ourGlob = toAbsoluteGlob(ourGlob, ourOpt); + // Delete `root` after all resolving done + delete ourOpt.root; + + var globber = new glob.Glob(ourGlob, ourOpt); + this._globber = globber; + + var found = false; + + globber.on('match', function(filepath) { + found = true; + var obj = { + cwd: cwd, + base: basePath, + path: removeTrailingSeparator(filepath), + }; + if (!self.push(obj)) { + globber.pause(); + } + }); + + globber.once('end', function() { + if (allowEmpty !== true && !found && globIsSingular(globber)) { + var err = new Error(globErrMessage1 + ourGlob + globErrMessage2); + + return self.destroy(err); + } + + self.push(null); + }); + + function onError(err) { + self.destroy(err); + } + + globber.once('error', onError); +} +inherits(GlobStream, Readable); + +GlobStream.prototype._read = function() { + this._globber.resume(); +}; + +GlobStream.prototype.destroy = function(err) { + var self = this; + + this._globber.abort(); + + process.nextTick(function() { + if (err) { + self.emit('error', err); + } + self.emit('close'); + }); +}; + +module.exports = GlobStream; diff --git a/node_modules/glob-watcher/LICENSE b/node_modules/glob-watcher/LICENSE new file mode 100755 index 0000000..b8fc743 --- /dev/null +++ b/node_modules/glob-watcher/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Blaine Bublitz , Eric Schoffstall and other contributors + +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. diff --git a/node_modules/glob-watcher/README.md b/node_modules/glob-watcher/README.md new file mode 100644 index 0000000..dba40cf --- /dev/null +++ b/node_modules/glob-watcher/README.md @@ -0,0 +1,137 @@ +

+ + + +

+ +# glob-watcher + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +Watch globs and execute a function upon change, with intelligent defaults for debouncing and queueing. + +## Usage + +```js +var watch = require('glob-watcher'); + +watch(['./*.js', '!./something.js'], function(done){ + // This function will be called each time a globbed file is changed + // but is debounced with a 200ms delay (default) and queues subsequent calls + + // Make sure to signal async completion with the callback + // or by returning a stream, promise, observable or child process + done(); + + // if you need access to the `path` or `stat` object, listen + // for the `change` event (see below) + + // if you need to listen to specific events, use the returned + // watcher instance (see below) +}); + +// Raw chokidar instance +var watcher = watch(['./*.js', '!./something.js']); + +// Listen for the 'change' event to get `path`/`stat` +// No async completion available because this is the raw chokidar instance +watcher.on('change', function(path, stat) { + // `path` is the path of the changed file + // `stat` is an `fs.Stat` object (not always available) +}); + +// Listen for other events +// No async completion available because this is the raw chokidar instance +watcher.on('add', function(path, stat) { + // `path` is the path of the changed file + // `stat` is an `fs.Stat` object (not always available) +}); +``` + +## API + +### `watch(globs[, options][, fn])` + +Takes a path string, an array of path strings, a [glob][micromatch] string or an array of [glob][micromatch] strings as `globs` to watch on the filesystem. Also optionally takes `options` to configure the watcher and a `fn` to execute when a file changes. + +__Note: As of 5.0.0, globs must use `/` as the separator character because `\\` is reserved for escape sequences (as per the Bash 4.3 & Micromatch specs). This means you can't use `path.join()` or `__dirname` in Windows environments. If you need to use `path.join()`, you can use [normalize-path][normalize-path] against your paths afterwards. If you need to use `__dirname`, you can set it as the `cwd` option that gets passed directly to [chokidar][chokidar]. The [micromatch docs][micromatch-backslashes] contain more information about backslashes.__ + +Returns an instance of [chokidar][chokidar]. + +#### `fn([callback])` + +If the `fn` is passed, it will be called when the watcher emits a `change`, `add` or `unlink` event. It is automatically debounced with a default delay of 200 milliseconds and subsequent calls will be queued and called upon completion. These defaults can be changed using the `options`. + +The `fn` is passed a single argument, `callback`, which is a function that must be called when work in the `fn` is complete. Instead of calling the `callback` function, [async completion][async-completion] can be signalled by: + * Returning a `Stream` or `EventEmitter` + * Returning a `Child Process` + * Returning a `Promise` + * Returning an `Observable` + +Once async completion is signalled, if another run is queued, it will be executed. + +#### `options` + +##### `options.ignoreInitial` + +If set to `false` the `fn` is called during [chokidar][chokidar] instantiation as it discovers the file paths. Useful if it is desirable to trigger the `fn` during startup. + +__Passed through to [chokidar][chokidar], but defaulted to `true` instead of `false`.__ + +Type: `Boolean` + +Default: `true` + +##### `options.delay` + +The delay to wait before triggering the `fn`. Useful for waiting on many changes before doing the work on changed files, e.g. find-and-replace on many files. + +Type: `Number` + +Default: `200` (milliseconds) + +##### `options.queue` + +Whether or not a file change should queue the `fn` execution if the `fn` is already running. Useful for a long running `fn`. + +Type: `Boolean` + +Default: `true` + +##### `options.events` + +An event name or array of event names to listen for. Useful if you only need to watch specific events. + +Type: `String | Array` + +Default: `[ 'add', 'change', 'unlink' ]` + +##### other + +Options are passed directly to [chokidar][chokidar]. + +## License + +MIT + +[micromatch]: https://github.com/micromatch/micromatch +[normalize-path]: https://www.npmjs.com/package/normalize-path +[micromatch-backslashes]: https://github.com/micromatch/micromatch#backslashes +[async-completion]: https://github.com/gulpjs/async-done#completion-and-error-resolution +[chokidar]: https://github.com/paulmillr/chokidar + +[downloads-image]: http://img.shields.io/npm/dm/glob-watcher.svg +[npm-url]: https://npmjs.com/package/glob-watcher +[npm-image]: http://img.shields.io/npm/v/glob-watcher.svg + +[travis-url]: https://travis-ci.org/gulpjs/glob-watcher +[travis-image]: http://img.shields.io/travis/gulpjs/glob-watcher.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-watcher +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-watcher.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/glob-watcher +[coveralls-image]: http://img.shields.io/coveralls/gulpjs/glob-watcher/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.png diff --git a/node_modules/glob-watcher/index.js b/node_modules/glob-watcher/index.js new file mode 100644 index 0000000..5cc346b --- /dev/null +++ b/node_modules/glob-watcher/index.js @@ -0,0 +1,138 @@ +'use strict'; + +var chokidar = require('chokidar'); +var debounce = require('just-debounce'); +var asyncDone = require('async-done'); +var defaults = require('object.defaults/immutable'); +var isNegatedGlob = require('is-negated-glob'); +var anymatch = require('anymatch'); + +var defaultOpts = { + delay: 200, + events: ['add', 'change', 'unlink'], + ignored: [], + ignoreInitial: true, + queue: true, +}; + +function listenerCount(ee, evtName) { + if (typeof ee.listenerCount === 'function') { + return ee.listenerCount(evtName); + } + + return ee.listeners(evtName).length; +} + +function hasErrorListener(ee) { + return listenerCount(ee, 'error') !== 0; +} + +function exists(val) { + return val != null; +} + +function watch(glob, options, cb) { + if (typeof options === 'function') { + cb = options; + options = {}; + } + + var opt = defaults(options, defaultOpts); + + if (!Array.isArray(opt.events)) { + opt.events = [opt.events]; + } + + if (Array.isArray(glob)) { + // We slice so we don't mutate the passed globs array + glob = glob.slice(); + } else { + glob = [glob]; + } + + var queued = false; + var running = false; + + // These use sparse arrays to keep track of the index in the + // original globs array + var positives = new Array(glob.length); + var negatives = new Array(glob.length); + + // Reverse the glob here so we don't end up with a positive + // and negative glob in position 0 after a reverse + glob.reverse().forEach(sortGlobs); + + function sortGlobs(globString, index) { + var result = isNegatedGlob(globString); + if (result.negated) { + negatives[index] = result.pattern; + } else { + positives[index] = result.pattern; + } + } + + function shouldBeIgnored(path) { + var positiveMatch = anymatch(positives, path, true); + var negativeMatch = anymatch(negatives, path, true); + // If negativeMatch is -1, that means it was never negated + if (negativeMatch === -1) { + return false; + } + + // If the negative is "less than" the positive, that means + // it came later in the glob array before we reversed them + return negativeMatch < positiveMatch; + } + + var toWatch = positives.filter(exists); + + // We only do add our custom `ignored` if there are some negative globs + // TODO: I'm not sure how to test this + if (negatives.some(exists)) { + opt.ignored = [].concat(opt.ignored, shouldBeIgnored); + } + var watcher = chokidar.watch(toWatch, opt); + + function runComplete(err) { + running = false; + + if (err && hasErrorListener(watcher)) { + watcher.emit('error', err); + } + + // If we have a run queued, start onChange again + if (queued) { + queued = false; + onChange(); + } + } + + function onChange() { + if (running) { + if (opt.queue) { + queued = true; + } + return; + } + + running = true; + asyncDone(cb, runComplete); + } + + var fn; + if (typeof cb === 'function') { + fn = debounce(onChange, opt.delay); + } + + function watchEvent(eventName) { + watcher.on(eventName, fn); + } + + if (fn) { + opt.events.forEach(watchEvent); + } + + return watcher; +} + +module.exports = watch; diff --git a/node_modules/glob-watcher/package.json b/node_modules/glob-watcher/package.json new file mode 100644 index 0000000..422b14d --- /dev/null +++ b/node_modules/glob-watcher/package.json @@ -0,0 +1,88 @@ +{ + "_from": "glob-watcher@^5.0.3", + "_id": "glob-watcher@5.0.3", + "_inBundle": false, + "_integrity": "sha512-8tWsULNEPHKQ2MR4zXuzSmqbdyV5PtwwCaWSGQ1WwHsJ07ilNeN1JB8ntxhckbnpSHaf9dXFUHzIWvm1I13dsg==", + "_location": "/glob-watcher", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "glob-watcher@^5.0.3", + "name": "glob-watcher", + "escapedName": "glob-watcher", + "rawSpec": "^5.0.3", + "saveSpec": null, + "fetchSpec": "^5.0.3" + }, + "_requiredBy": [ + "/gulp" + ], + "_resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.3.tgz", + "_shasum": "88a8abf1c4d131eb93928994bc4a593c2e5dd626", + "_spec": "glob-watcher@^5.0.3", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp", + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "http://gulpjs.com/" + }, + "bugs": { + "url": "https://github.com/gulpjs/glob-watcher/issues" + }, + "bundleDependencies": false, + "contributors": [], + "dependencies": { + "anymatch": "^2.0.0", + "async-done": "^1.2.0", + "chokidar": "^2.0.0", + "is-negated-glob": "^1.0.0", + "just-debounce": "^1.0.0", + "object.defaults": "^1.1.0" + }, + "deprecated": false, + "description": "Watch globs and execute a function upon change, with intelligent defaults for debouncing and queueing.", + "devDependencies": { + "coveralls": "^2.11.2", + "eslint": "^2.13.1", + "eslint-config-gulp": "^3.0.1", + "expect": "^1.16.0", + "istanbul": "^0.4.0", + "istanbul-coveralls": "^1.0.1", + "mocha": "^2.0.0", + "mocha-lcov-reporter": "^1.2.0", + "normalize-path": "^2.1.1", + "rimraf": "^2.6.1", + "through2": "^2.0.1" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/gulpjs/glob-watcher#readme", + "keywords": [ + "watch", + "glob", + "async", + "queue", + "debounce", + "callback" + ], + "license": "MIT", + "main": "index.js", + "name": "glob-watcher", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/glob-watcher.git" + }, + "scripts": { + "cover": "istanbul cover _mocha --report lcovonly", + "coveralls": "npm run cover && istanbul-coveralls", + "lint": "eslint .", + "pretest": "npm run lint", + "test": "mocha --async-only" + }, + "version": "5.0.3" +} diff --git a/node_modules/glob/LICENSE b/node_modules/glob/LICENSE new file mode 100644 index 0000000..42ca266 --- /dev/null +++ b/node_modules/glob/LICENSE @@ -0,0 +1,21 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +## Glob Logo + +Glob's logo created by Tanya Brassie , licensed +under a Creative Commons Attribution-ShareAlike 4.0 International License +https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/node_modules/glob/README.md b/node_modules/glob/README.md new file mode 100644 index 0000000..0916a48 --- /dev/null +++ b/node_modules/glob/README.md @@ -0,0 +1,375 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](logo/glob.png) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) +* `absolute` Set to true to always receive absolute paths for matched + files. Unlike `realpath`, this also affects the values returned in + the `match` event. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Glob Logo +Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). + +The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` + +![](oh-my-glob.gif) diff --git a/node_modules/glob/changelog.md b/node_modules/glob/changelog.md new file mode 100644 index 0000000..4163677 --- /dev/null +++ b/node_modules/glob/changelog.md @@ -0,0 +1,67 @@ +## 7.0 + +- Raise error if `options.cwd` is specified, and not a directory + +## 6.0 + +- Remove comment and negation pattern support +- Ignore patterns are always in `dot:true` mode + +## 5.0 + +- Deprecate comment and negation patterns +- Fix regression in `mark` and `nodir` options from making all cache + keys absolute path. +- Abort if `fs.readdir` returns an error that's unexpected +- Don't emit `match` events for ignored items +- Treat ENOTSUP like ENOTDIR in readdir + +## 4.5 + +- Add `options.follow` to always follow directory symlinks in globstar +- Add `options.realpath` to call `fs.realpath` on all results +- Always cache based on absolute path + +## 4.4 + +- Add `options.ignore` +- Fix handling of broken symlinks + +## 4.3 + +- Bump minimatch to 2.x +- Pass all tests on Windows + +## 4.2 + +- Add `glob.hasMagic` function +- Add `options.nodir` flag + +## 4.1 + +- Refactor sync and async implementations for performance +- Throw if callback provided to sync glob function +- Treat symbolic links in globstar results the same as Bash 4.3 + +## 4.0 + +- Use `^` for dependency versions (bumped major because this breaks + older npm versions) +- Ensure callbacks are only ever called once +- switch to ISC license + +## 3.x + +- Rewrite in JavaScript +- Add support for setting root, cwd, and windows support +- Cache many fs calls +- Add globstar support +- emit match events + +## 2.x + +- Use `glob.h` and `fnmatch.h` from NetBSD + +## 1.x + +- `glob.h` static binding. diff --git a/node_modules/glob/common.js b/node_modules/glob/common.js new file mode 100644 index 0000000..66651bb --- /dev/null +++ b/node_modules/glob/common.js @@ -0,0 +1,240 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/node_modules/glob/glob.js b/node_modules/glob/glob.js new file mode 100644 index 0000000..58dec0f --- /dev/null +++ b/node_modules/glob/glob.js @@ -0,0 +1,790 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + this._processing = 0 + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) + e = abs + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) +} diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json new file mode 100644 index 0000000..03606f2 --- /dev/null +++ b/node_modules/glob/package.json @@ -0,0 +1,80 @@ +{ + "_from": "glob@^7.1.4", + "_id": "glob@7.1.6", + "_inBundle": false, + "_integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "_location": "/glob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "glob@^7.1.4", + "name": "glob", + "escapedName": "glob", + "rawSpec": "^7.1.4", + "saveSpec": null, + "fetchSpec": "^7.1.4" + }, + "_requiredBy": [ + "/cacache", + "/rimraf" + ], + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "_shasum": "141f33b81a7c2492e125594307480c46679278a6", + "_spec": "glob@^7.1.4", + "_where": "/usr/share/r3-server/beta/r3/node_modules/cacache", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "bundleDependencies": false, + "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" + }, + "deprecated": false, + "description": "a little globber", + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^12.0.1", + "tick": "0.0.6" + }, + "engines": { + "node": "*" + }, + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "homepage": "https://github.com/isaacs/node-glob#readme", + "license": "ISC", + "main": "glob.js", + "name": "glob", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "scripts": { + "bench": "bash benchmark.sh", + "benchclean": "node benchclean.js", + "prepublish": "npm run benchclean", + "prof": "bash prof.sh && cat profile.txt", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" + }, + "version": "7.1.6" +} diff --git a/node_modules/glob/sync.js b/node_modules/glob/sync.js new file mode 100644 index 0000000..c952134 --- /dev/null +++ b/node_modules/glob/sync.js @@ -0,0 +1,486 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/node_modules/global-modules/LICENSE b/node_modules/global-modules/LICENSE new file mode 100644 index 0000000..7cccaf9 --- /dev/null +++ b/node_modules/global-modules/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-present, Jon Schlinkert. + +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. diff --git a/node_modules/global-modules/README.md b/node_modules/global-modules/README.md new file mode 100644 index 0000000..d86a264 --- /dev/null +++ b/node_modules/global-modules/README.md @@ -0,0 +1,87 @@ +# global-modules [![NPM version](https://img.shields.io/npm/v/global-modules.svg?style=flat)](https://www.npmjs.com/package/global-modules) [![NPM monthly downloads](https://img.shields.io/npm/dm/global-modules.svg?style=flat)](https://npmjs.org/package/global-modules) [![NPM total downloads](https://img.shields.io/npm/dt/global-modules.svg?style=flat)](https://npmjs.org/package/global-modules) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/global-modules.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/global-modules) + +> The directory used by npm for globally installed npm modules. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save global-modules +``` + +## Usage + +```js +const globalModules = require('global-modules'); +console.log(globalModules); +//=> '/usr/local/lib/node_modules' +``` +_(Note that this path might be different based on platform, user-defined configuration settings, etc)_ + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [git-config-path](https://www.npmjs.com/package/git-config-path): Resolve the path to the user's local or global .gitconfig. | [homepage](https://github.com/jonschlinkert/git-config-path "Resolve the path to the user's local or global .gitconfig.") +* [global-prefix](https://www.npmjs.com/package/global-prefix): Get the npm global path prefix. | [homepage](https://github.com/jonschlinkert/global-prefix "Get the npm global path prefix.") +* [npm-paths](https://www.npmjs.com/package/npm-paths): Returns an array of unique "npm" directories based on the user's platform and environment. | [homepage](https://github.com/jonschlinkert/npm-paths "Returns an array of unique "npm" directories based on the user's platform and environment.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 20 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [Kikobeats](https://github.com/Kikobeats) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on December 14, 2018._ \ No newline at end of file diff --git a/node_modules/global-modules/index.js b/node_modules/global-modules/index.js new file mode 100644 index 0000000..6696521 --- /dev/null +++ b/node_modules/global-modules/index.js @@ -0,0 +1,29 @@ +/*! + * global-modules + * + * Copyright (c) 2015-2017 Jon Schlinkert. + * Licensed under the MIT license. + */ + +'use strict'; + +const path = require('path'); +const prefix = require('global-prefix'); +let gm; + +function getPath() { + if (process.platform === 'win32' || process.env.OSTYPE === 'msys' || process.env.OSTYPE === 'cygwin') { + return path.resolve(prefix, 'node_modules'); + } + return path.resolve(prefix, 'lib/node_modules'); +} + +/** + * Expose `global-modules` path + */ + +Reflect.defineProperty(module, 'exports', { + get() { + return gm || (gm = getPath()); + } +}); diff --git a/node_modules/global-modules/node_modules/global-prefix/LICENSE b/node_modules/global-modules/node_modules/global-prefix/LICENSE new file mode 100644 index 0000000..7cccaf9 --- /dev/null +++ b/node_modules/global-modules/node_modules/global-prefix/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-present, Jon Schlinkert. + +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. diff --git a/node_modules/global-modules/node_modules/global-prefix/README.md b/node_modules/global-modules/node_modules/global-prefix/README.md new file mode 100644 index 0000000..fd116ca --- /dev/null +++ b/node_modules/global-modules/node_modules/global-prefix/README.md @@ -0,0 +1,92 @@ +# global-prefix [![NPM version](https://img.shields.io/npm/v/global-prefix.svg?style=flat)](https://www.npmjs.com/package/global-prefix) [![NPM monthly downloads](https://img.shields.io/npm/dm/global-prefix.svg?style=flat)](https://npmjs.org/package/global-prefix) [![NPM total downloads](https://img.shields.io/npm/dt/global-prefix.svg?style=flat)](https://npmjs.org/package/global-prefix) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/global-prefix.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/global-prefix) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/global-prefix.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/global-prefix) + +> Get the npm global path prefix. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save global-prefix +``` + +This is partially based on the code used by npm internally to resolve the global prefix. + +## Usage + +```js +var prefix = require('global-prefix'); +//=> '/usr/local' (this path will differ by system and user-defined config) +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [global-modules](https://www.npmjs.com/package/global-modules): The directory used by npm for globally installed npm modules. | [homepage](https://github.com/jonschlinkert/global-modules "The directory used by npm for globally installed npm modules.") +* [global-paths](https://www.npmjs.com/package/global-paths): Returns an array of unique "global" directories based on the user's platform and environment. The… [more](https://github.com/jonschlinkert/global-paths) | [homepage](https://github.com/jonschlinkert/global-paths "Returns an array of unique "global" directories based on the user's platform and environment. The resulting paths can be used for doing lookups for generators or other globally installed npm packages. Node.js / JavaScript.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 23 | [jonschlinkert](https://github.com/jonschlinkert) | +| 15 | [doowb](https://github.com/doowb) | +| 2 | [phated](https://github.com/phated) | +| 1 | [rmbaad](https://github.com/rmbaad) | +| 1 | [avengerpenguin](https://github.com/avengerpenguin) | +| 1 | [jorrit](https://github.com/jorrit) | +| 1 | [mathiasvr](https://github.com/mathiasvr) | +| 1 | [tunnckoCore](https://github.com/tunnckoCore) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on October 11, 2018._ \ No newline at end of file diff --git a/node_modules/global-modules/node_modules/global-prefix/index.js b/node_modules/global-modules/node_modules/global-prefix/index.js new file mode 100644 index 0000000..1defb68 --- /dev/null +++ b/node_modules/global-modules/node_modules/global-prefix/index.js @@ -0,0 +1,85 @@ +/*! + * global-prefix + * + * Copyright (c) 2015-present Jon Schlinkert. + * Licensed under the MIT license. + */ + +'use strict'; + +const fs = require('fs'); +const os = require('os'); +const path = require('path'); +const ini = require('ini'); +let prefix; + +const getPrefix = () => { + if (process.env.PREFIX) return process.env.PREFIX; + if (prefix) return prefix; + + // Start by checking if the global prefix is set by the user + let home = os.homedir(); + + // os.homedir() returns undefined if $HOME is not set; path.resolve requires strings + if (home) { + prefix = tryConfigPath(path.resolve(home, '.npmrc')); + } + + if (prefix) { + return prefix; + } + + // Otherwise find the path of npm + let npm = tryNpmPath(); + if (npm) { + // Check the built-in npm config file + prefix = tryConfigPath(path.resolve(npm, '..', '..', 'npmrc')); + + if (prefix) { + // Now the global npm config can also be checked. + prefix = tryConfigPath(path.resolve(prefix, 'etc', 'npmrc')) || prefix; + } + } + + if (!prefix) { + let { APPDATA, DESTDIR, OSTYPE } = process.env; + + // c:\node\node.exe --> prefix=c:\node\ + if (process.platform === 'win32' || OSTYPE === 'msys' || OSTYPE === 'cygwin') { + prefix = APPDATA ? path.join(APPDATA, 'npm') : path.dirname(process.execPath); + return prefix; + } + + // /usr/local/bin/node --> prefix=/usr/local + prefix = path.dirname(path.dirname(process.execPath)); + + // destdir only is respected on Unix + if (DESTDIR) { + prefix = path.join(DESTDIR, prefix); + } + } + + return prefix; +} + +function tryNpmPath() { + try { + return fs.realpathSync(require('which').sync('npm')); + } catch (err) { /* do nothing */ } +} + +function tryConfigPath(configPath) { + try { + return ini.parse(fs.readFileSync(configPath, 'utf-8')).prefix; + } catch (err) { /* do nothing */ } +} + +/** + * Expose `prefix` + */ + +Reflect.defineProperty(module, 'exports', { + get() { + return getPrefix(); + } +}); diff --git a/node_modules/global-modules/node_modules/global-prefix/package.json b/node_modules/global-modules/node_modules/global-prefix/package.json new file mode 100644 index 0000000..818996a --- /dev/null +++ b/node_modules/global-modules/node_modules/global-prefix/package.json @@ -0,0 +1,105 @@ +{ + "_from": "global-prefix@^3.0.0", + "_id": "global-prefix@3.0.0", + "_inBundle": false, + "_integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "_location": "/global-modules/global-prefix", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "global-prefix@^3.0.0", + "name": "global-prefix", + "escapedName": "global-prefix", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/global-modules" + ], + "_resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "_shasum": "fc85f73064df69f50421f47f883fe5b913ba9b97", + "_spec": "global-prefix@^3.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/global-modules", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/global-prefix/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Alexandr Bogachev", + "url": "https://github.com/rmbaad" + }, + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Charlike Mike Reagent", + "url": "https://i.am.charlike.online" + }, + { + "name": "JasonChang", + "url": "https://packagist.org/packages/jason-chang" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Jorrit Schippers", + "url": "https://www.ncode.nl" + }, + { + "name": "Mathias Rasmussen", + "url": "chrome://dino" + }, + { + "name": "Ross Fenning", + "url": "http://rossfenning.co.uk" + } + ], + "dependencies": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "deprecated": false, + "description": "Get the npm global path prefix.", + "devDependencies": { + "gulp-format-md": "^2.0.0", + "mocha": "^5.2.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/global-prefix", + "keywords": [ + "global", + "module", + "modules", + "npm", + "path", + "prefix", + "resolve" + ], + "license": "MIT", + "main": "index.js", + "name": "global-prefix", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/global-prefix.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "3.0.0" +} diff --git a/node_modules/global-modules/package.json b/node_modules/global-modules/package.json new file mode 100644 index 0000000..734c035 --- /dev/null +++ b/node_modules/global-modules/package.json @@ -0,0 +1,110 @@ +{ + "_from": "global-modules@2.0.0", + "_id": "global-modules@2.0.0", + "_inBundle": false, + "_integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "_location": "/global-modules", + "_phantomChildren": { + "ini": "1.3.5", + "kind-of": "6.0.3", + "which": "1.3.1" + }, + "_requested": { + "type": "version", + "registry": true, + "raw": "global-modules@2.0.0", + "name": "global-modules", + "escapedName": "global-modules", + "rawSpec": "2.0.0", + "saveSpec": null, + "fetchSpec": "2.0.0" + }, + "_requiredBy": [ + "/webpack-cli" + ], + "_resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "_shasum": "997605ad2345f27f51539bea26574421215c7780", + "_spec": "global-modules@2.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/webpack-cli", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/global-modules/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "JasonChang", + "url": "https://packagist.org/packages/jason-chang" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Kiko Beats", + "url": "https://kikobeats.com" + } + ], + "dependencies": { + "global-prefix": "^3.0.0" + }, + "deprecated": false, + "description": "The directory used by npm for globally installed npm modules.", + "devDependencies": { + "gulp-format-md": "^2.0.0", + "mocha": "^5.2.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/global-modules", + "keywords": [ + "directory", + "dirname", + "global", + "module", + "modules", + "package", + "path", + "prefix", + "resolve" + ], + "license": "MIT", + "main": "index.js", + "name": "global-modules", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/global-modules.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "git-config-path", + "global-prefix", + "npm-paths" + ] + }, + "lint": { + "reflinks": true + } + }, + "version": "2.0.0" +} diff --git a/node_modules/global-prefix/LICENSE b/node_modules/global-prefix/LICENSE new file mode 100644 index 0000000..c0d7f13 --- /dev/null +++ b/node_modules/global-prefix/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/global-prefix/README.md b/node_modules/global-prefix/README.md new file mode 100644 index 0000000..31d78ff --- /dev/null +++ b/node_modules/global-prefix/README.md @@ -0,0 +1,78 @@ +# global-prefix [![NPM version](https://img.shields.io/npm/v/global-prefix.svg?style=flat)](https://www.npmjs.com/package/global-prefix) [![NPM monthly downloads](https://img.shields.io/npm/dm/global-prefix.svg?style=flat)](https://npmjs.org/package/global-prefix) [![NPM total downloads](https://img.shields.io/npm/dt/global-prefix.svg?style=flat)](https://npmjs.org/package/global-prefix) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/global-prefix.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/global-prefix) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/global-prefix.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/global-prefix) + +> Get the npm global path prefix. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save global-prefix +``` + +This is partially based on the code used by npm internally to resolve the global prefix. + +## Usage + +```js +var prefix = require('global-prefix'); +//=> '/usr/local' (this path will differ by system and user-defined config) +``` + +## About + +### Related projects + +* [global-modules](https://www.npmjs.com/package/global-modules): The directory used by npm for globally installed npm modules. | [homepage](https://github.com/jonschlinkert/global-modules "The directory used by npm for globally installed npm modules.") +* [global-paths](https://www.npmjs.com/package/global-paths): Returns an array of unique "global" directories based on the user's platform and environment. The… [more](https://github.com/jonschlinkert/global-paths) | [homepage](https://github.com/jonschlinkert/global-paths "Returns an array of unique "global" directories based on the user's platform and environment. The resulting paths can be used for doing lookups for generators or other globally installed npm packages. Node.js / JavaScript.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 16 | [jonschlinkert](https://github.com/jonschlinkert) | +| 15 | [doowb](https://github.com/doowb) | +| 1 | [rmbaad](https://github.com/rmbaad) | +| 1 | [avengerpenguin](https://github.com/avengerpenguin) | +| 1 | [jason-chang](https://github.com/jason-chang) | +| 1 | [jorrit](https://github.com/jorrit) | +| 1 | [mathiasvr](https://github.com/mathiasvr) | +| 1 | [tunnckoCore](https://github.com/tunnckoCore) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 28, 2017._ \ No newline at end of file diff --git a/node_modules/global-prefix/index.js b/node_modules/global-prefix/index.js new file mode 100644 index 0000000..cc66d95 --- /dev/null +++ b/node_modules/global-prefix/index.js @@ -0,0 +1,96 @@ +/*! + * global-prefix + * + * Copyright (c) 2015-2017 Jon Schlinkert. + * Licensed under the MIT license. + */ + +'use strict'; + +var fs = require('fs'); +var path = require('path'); +var expand = require('expand-tilde'); +var homedir = require('homedir-polyfill'); +var ini = require('ini'); +var prefix; + +function getPrefix() { + if (process.env.PREFIX) { + prefix = process.env.PREFIX; + } else { + // Start by checking if the global prefix is set by the user + var home = homedir(); + if (home) { + // homedir() returns undefined if $HOME not set; path.resolve requires strings + var userConfig = path.resolve(home, '.npmrc'); + prefix = tryConfigPath(userConfig); + } + + if (!prefix) { + // Otherwise find the path of npm + var npm = tryNpmPath(); + if (npm) { + // Check the built-in npm config file + var builtinConfig = path.resolve(npm, '..', '..', 'npmrc'); + prefix = tryConfigPath(builtinConfig); + + if (prefix) { + // Now the global npm config can also be checked. + var globalConfig = path.resolve(prefix, 'etc', 'npmrc'); + prefix = tryConfigPath(globalConfig) || prefix; + } + } + + if (!prefix) fallback(); + } + } + + if (prefix) { + return expand(prefix); + } +} + +function fallback() { + var isWindows = require('is-windows'); + if (isWindows()) { + // c:\node\node.exe --> prefix=c:\node\ + prefix = process.env.APPDATA + ? path.join(process.env.APPDATA, 'npm') + : path.dirname(process.execPath); + } else { + // /usr/local/bin/node --> prefix=/usr/local + prefix = path.dirname(path.dirname(process.execPath)); + + // destdir only is respected on Unix + if (process.env.DESTDIR) { + prefix = path.join(process.env.DESTDIR, prefix); + } + } +} + +function tryNpmPath() { + try { + return fs.realpathSync(require('which').sync('npm')); + } catch (err) {} + return null; +} + +function tryConfigPath(configPath) { + try { + var data = fs.readFileSync(configPath, 'utf-8'); + var config = ini.parse(data); + if (config.prefix) return config.prefix; + } catch (err) {} + return null; +} + +/** + * Expose `prefix` + */ + +Object.defineProperty(module, 'exports', { + enumerable: true, + get: function() { + return prefix || (prefix = getPrefix()); + } +}); diff --git a/node_modules/global-prefix/package.json b/node_modules/global-prefix/package.json new file mode 100644 index 0000000..8a698be --- /dev/null +++ b/node_modules/global-prefix/package.json @@ -0,0 +1,130 @@ +{ + "_from": "global-prefix@^1.0.1", + "_id": "global-prefix@1.0.2", + "_inBundle": false, + "_integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "_location": "/global-prefix", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "global-prefix@^1.0.1", + "name": "global-prefix", + "escapedName": "global-prefix", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/resolve-dir/global-modules" + ], + "_resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "_shasum": "dbf743c6c14992593c655568cb66ed32c0122ebe", + "_spec": "global-prefix@^1.0.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/resolve-dir/node_modules/global-modules", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/global-prefix/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Alexandr Bogachev", + "url": "https://github.com/rmbaad" + }, + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Charlike Mike Reagent", + "url": "https://i.am.charlike.online" + }, + { + "name": "JasonChang", + "url": "https://packagist.org/packages/jason-chang" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Jorrit Schippers", + "url": "https://www.ncode.nl" + }, + { + "name": "Mathias Rasmussen", + "url": "chrome://dino" + }, + { + "name": "Ross Fenning", + "url": "http://rossfenning.co.uk" + } + ], + "dependencies": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + }, + "deprecated": false, + "description": "Get the npm global path prefix.", + "devDependencies": { + "gulp-format-md": "^0.1.12", + "mocha": "^3.4.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/global-prefix", + "keywords": [ + "global", + "module", + "modules", + "npm", + "path", + "prefix", + "resolve" + ], + "license": "MIT", + "main": "index.js", + "name": "global-prefix", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/global-prefix.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "global-modules", + "global-paths" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.2" +} diff --git a/node_modules/glogg/LICENSE b/node_modules/glogg/LICENSE new file mode 100644 index 0000000..3a58630 --- /dev/null +++ b/node_modules/glogg/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014, 2015, 2018 Blaine Bublitz and Eric Schoffstall + +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. + diff --git a/node_modules/glogg/README.md b/node_modules/glogg/README.md new file mode 100644 index 0000000..897e105 --- /dev/null +++ b/node_modules/glogg/README.md @@ -0,0 +1,114 @@ +

+ + + +

+ +# glogg + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +Global logging utility. + +## Usage + +```js +var getLogger = require('glogg'); + +var logger = getLogger('my-namespace'); + +// logs strings +logger.debug('The MOST verbose!'); +logger.info('Some important info'); +logger.warn('All the warnings to you'); +logger.error('OH NO! SOMETHING HAPPENED!'); + +// supports util.format! +logger.info('%s style!', 'printf'); + +// log anything +logger.debug({ my: 'obj' }); +logger.info([1, 2, 3]); + +// somewhere else +logger.on('info', function(msg){ + // do something with msg +}); + +// must be handled to avoid crashing process +logger.on('error', function(msg){ + // now it won't crash +}); +``` + +## API + +__Note: This module makes no assumptions about the log levels and they will always +be emitted. If you are looking to filter some out, your listeners will need to have +extra logic.__ + +### getLogger([namespace]) + +Create a new logger at the given namespace (or the default if no namespace is provided). +Returns an augmented [`sparkles`](https://github.com/phated/sparkles) EventEmitter object +with 4 methods: `debug()`, `info()`, `warn()` and `error()`. When called, these methods emit +an event with the same name. If the first argument is a string, the arguments +are passed through node's `util.format()` before being emitted. Other parts +of a node program can get the logger by namespace and listen for the events to +be emitted. + +#### logger.debug(msg) + +Emits a `debug` event with the given `msg`. + +If the first argument is a string, all arguments are passed to node's +`util.format()` before being emitted. + +#### logger.info(msg) + +Emits a `info` event with the given `msg`. + +If the first argument is a string, all arguments are passed to node's +`util.format()` before being emitted. + +#### logger.warn(msg) + +Emits a `warn` event with the given `msg`. + +If the first argument is a string, all arguments are passed to node's +`util.format()` before being emitted. + +#### logger.error(msg) + +Emits a `error` event with the given `msg`. + +If the first argument is a string, all arguments are passed to node's +`util.format()` before being emitted. + +__Note: You must handle this event in some way or the node process will crash +when an `error` event is emitted.__ + +#### logger.on(event, fn) + +Standard API from node's `EventEmitter`. Use this to listen for events from +the logger methods. + +## License + +MIT + +[downloads-image]: http://img.shields.io/npm/dm/glogg.svg +[npm-url]: https://www.npmjs.com/package/glogg +[npm-image]: http://img.shields.io/npm/v/glogg.svg + +[travis-url]: https://travis-ci.org/gulpjs/glogg +[travis-image]: http://img.shields.io/travis/gulpjs/glogg.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glogg +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glogg.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/glogg +[coveralls-image]: http://img.shields.io/coveralls/gulpjs/glogg/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/node_modules/glogg/index.js b/node_modules/glogg/index.js new file mode 100644 index 0000000..6e34bcf --- /dev/null +++ b/node_modules/glogg/index.js @@ -0,0 +1,34 @@ +'use strict'; + +var format = require('util').format; + +var sparkles = require('sparkles'); + +var levels = [ + 'debug', + 'info', + 'warn', + 'error', +]; + +function getLogger(namespace) { + var logger = sparkles(namespace); + + levels.forEach(function(level) { + logger[level] = makeLogLevel(logger, level); + }); + + return logger; +} + +function makeLogLevel(self, level) { + return function(msg) { + if (typeof msg === 'string') { + msg = format.apply(null, arguments); + } + + self.emit(level, msg); + }; +} + +module.exports = getLogger; diff --git a/node_modules/glogg/package.json b/node_modules/glogg/package.json new file mode 100644 index 0000000..29c1a7d --- /dev/null +++ b/node_modules/glogg/package.json @@ -0,0 +1,83 @@ +{ + "_from": "glogg@^1.0.0", + "_id": "glogg@1.0.2", + "_inBundle": false, + "_integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", + "_location": "/glogg", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "glogg@^1.0.0", + "name": "glogg", + "escapedName": "glogg", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/gulplog" + ], + "_resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", + "_shasum": "2d7dd702beda22eb3bffadf880696da6d846313f", + "_spec": "glogg@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulplog", + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "http://gulpjs.com/" + }, + "bugs": { + "url": "https://github.com/gulpjs/glogg/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com" + } + ], + "dependencies": { + "sparkles": "^1.0.0" + }, + "deprecated": false, + "description": "Global logging utility", + "devDependencies": { + "eslint": "^2.13.0", + "eslint-config-gulp": "^3.0.1", + "expect": "^1.20.2", + "istanbul": "^0.4.3", + "istanbul-coveralls": "^1.0.3", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "LICENSE", + "index.js" + ], + "homepage": "https://github.com/gulpjs/glogg#readme", + "keywords": [ + "global", + "log", + "logger", + "logging", + "shared" + ], + "license": "MIT", + "main": "index.js", + "name": "glogg", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/glogg.git" + }, + "scripts": { + "cover": "istanbul cover _mocha --report lcovonly", + "coveralls": "npm run cover && istanbul-coveralls", + "lint": "eslint .", + "pretest": "npm run lint", + "test": "mocha --async-only" + }, + "version": "1.0.2" +} diff --git a/node_modules/graceful-fs/LICENSE b/node_modules/graceful-fs/LICENSE new file mode 100644 index 0000000..9d2c803 --- /dev/null +++ b/node_modules/graceful-fs/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/graceful-fs/README.md b/node_modules/graceful-fs/README.md new file mode 100644 index 0000000..5273a50 --- /dev/null +++ b/node_modules/graceful-fs/README.md @@ -0,0 +1,133 @@ +# graceful-fs + +graceful-fs functions as a drop-in replacement for the fs module, +making various improvements. + +The improvements are meant to normalize behavior across different +platforms and environments, and to make filesystem access more +resilient to errors. + +## Improvements over [fs module](https://nodejs.org/api/fs.html) + +* Queues up `open` and `readdir` calls, and retries them once + something closes if there is an EMFILE error from too many file + descriptors. +* fixes `lchmod` for Node versions prior to 0.6.2. +* implements `fs.lutimes` if possible. Otherwise it becomes a noop. +* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or + `lchown` if the user isn't root. +* makes `lchmod` and `lchown` become noops, if not available. +* retries reading a file if `read` results in EAGAIN error. + +On Windows, it retries renaming a file for up to one second if `EACCESS` +or `EPERM` error occurs, likely because antivirus software has locked +the directory. + +## USAGE + +```javascript +// use just like fs +var fs = require('graceful-fs') + +// now go and do stuff with it... +fs.readFileSync('some-file-or-whatever') +``` + +## Global Patching + +If you want to patch the global fs module (or any other fs-like +module) you can do this: + +```javascript +// Make sure to read the caveat below. +var realFs = require('fs') +var gracefulFs = require('graceful-fs') +gracefulFs.gracefulify(realFs) +``` + +This should only ever be done at the top-level application layer, in +order to delay on EMFILE errors from any fs-using dependencies. You +should **not** do this in a library, because it can cause unexpected +delays in other parts of the program. + +## Changes + +This module is fairly stable at this point, and used by a lot of +things. That being said, because it implements a subtle behavior +change in a core part of the node API, even modest changes can be +extremely breaking, and the versioning is thus biased towards +bumping the major when in doubt. + +The main change between major versions has been switching between +providing a fully-patched `fs` module vs monkey-patching the node core +builtin, and the approach by which a non-monkey-patched `fs` was +created. + +The goal is to trade `EMFILE` errors for slower fs operations. So, if +you try to open a zillion files, rather than crashing, `open` +operations will be queued up and wait for something else to `close`. + +There are advantages to each approach. Monkey-patching the fs means +that no `EMFILE` errors can possibly occur anywhere in your +application, because everything is using the same core `fs` module, +which is patched. However, it can also obviously cause undesirable +side-effects, especially if the module is loaded multiple times. + +Implementing a separate-but-identical patched `fs` module is more +surgical (and doesn't run the risk of patching multiple times), but +also imposes the challenge of keeping in sync with the core module. + +The current approach loads the `fs` module, and then creates a +lookalike object that has all the same methods, except a few that are +patched. It is safe to use in all versions of Node from 0.8 through +7.0. + +### v4 + +* Do not monkey-patch the fs module. This module may now be used as a + drop-in dep, and users can opt into monkey-patching the fs builtin + if their app requires it. + +### v3 + +* Monkey-patch fs, because the eval approach no longer works on recent + node. +* fixed possible type-error throw if rename fails on windows +* verify that we *never* get EMFILE errors +* Ignore ENOSYS from chmod/chown +* clarify that graceful-fs must be used as a drop-in + +### v2.1.0 + +* Use eval rather than monkey-patching fs. +* readdir: Always sort the results +* win32: requeue a file if error has an OK status + +### v2.0 + +* A return to monkey patching +* wrap process.cwd + +### v1.1 + +* wrap readFile +* Wrap fs.writeFile. +* readdir protection +* Don't clobber the fs builtin +* Handle fs.read EAGAIN errors by trying again +* Expose the curOpen counter +* No-op lchown/lchmod if not implemented +* fs.rename patch only for win32 +* Patch fs.rename to handle AV software on Windows +* Close #4 Chown should not fail on einval or eperm if non-root +* Fix isaacs/fstream#1 Only wrap fs one time +* Fix #3 Start at 1024 max files, then back off on EMFILE +* lutimes that doens't blow up on Linux +* A full on-rewrite using a queue instead of just swallowing the EMFILE error +* Wrap Read/Write streams as well + +### 1.0 + +* Update engines for node 0.6 +* Be lstat-graceful on Windows +* first diff --git a/node_modules/graceful-fs/clone.js b/node_modules/graceful-fs/clone.js new file mode 100644 index 0000000..028356c --- /dev/null +++ b/node_modules/graceful-fs/clone.js @@ -0,0 +1,19 @@ +'use strict' + +module.exports = clone + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: obj.__proto__ } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} diff --git a/node_modules/graceful-fs/graceful-fs.js b/node_modules/graceful-fs/graceful-fs.js new file mode 100644 index 0000000..8c75ee2 --- /dev/null +++ b/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,346 @@ +var fs = require('fs') +var polyfills = require('./polyfills.js') +var legacy = require('./legacy-streams.js') +var clone = require('./clone.js') + +var util = require('util') + +/* istanbul ignore next - node 0.x polyfill */ +var gracefulQueue +var previousSymbol + +/* istanbul ignore else - node 0.x polyfill */ +if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { + gracefulQueue = Symbol.for('graceful-fs.queue') + // This is used in testing by future versions + previousSymbol = Symbol.for('graceful-fs.previous') +} else { + gracefulQueue = '___graceful-fs.queue' + previousSymbol = '___graceful-fs.previous' +} + +function noop () {} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +// Once time initialization +if (!global[gracefulQueue]) { + // This queue can be shared by multiple loaded instances + var queue = [] + Object.defineProperty(global, gracefulQueue, { + get: function() { + return queue + } + }) + + // Patch fs.close/closeSync to shared queue version, because we need + // to retry() whenever a close happens *anywhere* in the program. + // This is essential when multiple graceful-fs instances are + // in play at the same time. + fs.close = (function (fs$close) { + function close (fd, cb) { + return fs$close.call(fs, fd, function (err) { + // This function uses the graceful-fs shared queue + if (!err) { + retry() + } + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) + } + + Object.defineProperty(close, previousSymbol, { + value: fs$close + }) + return close + })(fs.close) + + fs.closeSync = (function (fs$closeSync) { + function closeSync (fd) { + // This function uses the graceful-fs shared queue + fs$closeSync.apply(fs, arguments) + retry() + } + + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }) + return closeSync + })(fs.closeSync) + + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(global[gracefulQueue]) + require('assert').equal(global[gracefulQueue].length, 0) + }) + } +} + +module.exports = patch(clone(fs)) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { + module.exports = patch(fs) + fs.__patched = true; +} + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + function readdir (path, options, cb) { + var args = [path] + if (typeof options !== 'function') { + args.push(options) + } else { + cb = options + } + args.push(go$readdir$cb) + + return go$readdir(args) + + function go$readdir$cb (err, files) { + if (files && files.sort) + files.sort() + + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readdir, [args]]) + + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + } + } + + function go$readdir (args) { + return fs$readdir.apply(fs, args) + } + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + } + + var fs$WriteStream = fs.WriteStream + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + } + + Object.defineProperty(fs, 'ReadStream', { + get: function () { + return ReadStream + }, + set: function (val) { + ReadStream = val + }, + enumerable: true, + configurable: true + }) + Object.defineProperty(fs, 'WriteStream', { + get: function () { + return WriteStream + }, + set: function (val) { + WriteStream = val + }, + enumerable: true, + configurable: true + }) + + // legacy names + var FileReadStream = ReadStream + Object.defineProperty(fs, 'FileReadStream', { + get: function () { + return FileReadStream + }, + set: function (val) { + FileReadStream = val + }, + enumerable: true, + configurable: true + }) + var FileWriteStream = WriteStream + Object.defineProperty(fs, 'FileWriteStream', { + get: function () { + return FileWriteStream + }, + set: function (val) { + FileWriteStream = val + }, + enumerable: true, + configurable: true + }) + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new fs.ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new fs.WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + global[gracefulQueue].push(elem) +} + +function retry () { + var elem = global[gracefulQueue].shift() + if (elem) { + debug('RETRY', elem[0].name, elem[1]) + elem[0].apply(null, elem[1]) + } +} diff --git a/node_modules/graceful-fs/legacy-streams.js b/node_modules/graceful-fs/legacy-streams.js new file mode 100644 index 0000000..d617b50 --- /dev/null +++ b/node_modules/graceful-fs/legacy-streams.js @@ -0,0 +1,118 @@ +var Stream = require('stream').Stream + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} diff --git a/node_modules/graceful-fs/package.json b/node_modules/graceful-fs/package.json new file mode 100644 index 0000000..50bccb7 --- /dev/null +++ b/node_modules/graceful-fs/package.json @@ -0,0 +1,83 @@ +{ + "_from": "graceful-fs@^4.1.2", + "_id": "graceful-fs@4.2.3", + "_inBundle": false, + "_integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "_location": "/graceful-fs", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "graceful-fs@^4.1.2", + "name": "graceful-fs", + "escapedName": "graceful-fs", + "rawSpec": "^4.1.2", + "saveSpec": null, + "fetchSpec": "^4.1.2" + }, + "_requiredBy": [ + "/cacache", + "/enhanced-resolve", + "/fs-write-stream-atomic", + "/readdirp", + "/watchpack" + ], + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "_shasum": "4a12ff1b60376ef09862c2093edd908328be8423", + "_spec": "graceful-fs@^4.1.2", + "_where": "/usr/share/r3-server/beta/r3/node_modules/enhanced-resolve", + "bugs": { + "url": "https://github.com/isaacs/node-graceful-fs/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "A drop-in replacement for fs, making various improvements.", + "devDependencies": { + "import-fresh": "^2.0.0", + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^12.7.0" + }, + "directories": { + "test": "test" + }, + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js", + "clone.js" + ], + "homepage": "https://github.com/isaacs/node-graceful-fs#readme", + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "ISC", + "main": "graceful-fs.js", + "name": "graceful-fs", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/node-graceful-fs.git" + }, + "scripts": { + "postpublish": "git push origin --follow-tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "node test.js | tap -" + }, + "version": "4.2.3" +} diff --git a/node_modules/graceful-fs/polyfills.js b/node_modules/graceful-fs/polyfills.js new file mode 100644 index 0000000..a5808d2 --- /dev/null +++ b/node_modules/graceful-fs/polyfills.js @@ -0,0 +1,342 @@ +var constants = require('constants') + +var origCwd = process.cwd +var cwd = null + +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +var chdir = process.chdir +process.chdir = function(d) { + cwd = null + chdir.call(process, d) +} + +module.exports = patch + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) + + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) + + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (!fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (!fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. + + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = (function (fs$rename) { return function (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + }})(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = (function (fs$read) { + function read (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + + // This ensures `util.promisify` works as it does for native `fs.read`. + read.__proto__ = fs$read + return read + })(fs.read) + + fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) + + function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + } + + function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK")) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } + } + + function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + + function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + function callback (er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + if (cb) cb.apply(this, arguments) + } + return options ? orig.call(fs, target, options, callback) + : orig.call(fs, target, callback) + } + } + + function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options) { + var stats = options ? orig.call(fs, target, options) + : orig.call(fs, target) + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + return stats; + } + } + + // ENOSYS means that the fs doesn't support the op. Just ignore + // that, because it doesn't matter. + // + // if there's no getuid, or if getuid() is something other + // than 0, and the error is EINVAL or EPERM, then just ignore + // it. + // + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // + // When running as root, or if other types of errors are + // encountered, then it's strict. + function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false + } +} diff --git a/node_modules/gulp/CHANGELOG.md b/node_modules/gulp/CHANGELOG.md new file mode 100644 index 0000000..d6555de --- /dev/null +++ b/node_modules/gulp/CHANGELOG.md @@ -0,0 +1,269 @@ +# gulp changelog + +## 4.0.0 + +### Task system changes + +- replaced 3.x task system (orchestrator) with new task system (bach) + - removed gulp.reset + - removed 3 argument syntax for `gulp.task` + - `gulp.task` should only be used when you will call the task with the CLI + - added `gulp.series` and `gulp.parallel` methods for composing tasks. Everything must use these now. + - added single argument syntax for `gulp.task` which allows a named function to be used as the name of the task and task function. + - added `gulp.tree` method for retrieving the task tree. Pass `{ deep: true }` for an `archy` compatible node list. + - added `gulp.registry` for setting custom registries. + +### CLI changes + +- split CLI out into a module if you want to save bandwidth/disk space. you can install the gulp CLI using either `npm install gulp -g` or `npm install gulp-cli -g`, where gulp-cli is the smaller one (no module code included) +- add `--tasks-json` flag to CLI to dump the whole tree out for other tools to consume +- added `--verify` flag to check the dependencies in package.json against the plugin blacklist. + +### vinyl/vinyl-fs changes + +- added `gulp.symlink` which functions exactly like `gulp.dest`, but symlinks instead. +- added `dirMode` param to `gulp.dest` and `gulp.symlink` which allows better control over the mode of the destination folder that is created. +- globs passed to `gulp.src` will be evaluated in order, which means this is possible `gulp.src(['*.js', '!b*.js', 'bad.js'])` (exclude every JS file that starts with a b except bad.js) +- performance for gulp.src has improved massively + - `gulp.src(['**/*', '!b.js'])` will no longer eat CPU since negations happen during walking now +- added `since` option to `gulp.src` which lets you only match files that have been modified since a certain date (for incremental builds) +- fixed `gulp.src` not following symlinks +- added `overwrite` option to `gulp.dest` which allows you to enable or disable overwriting of existing files + +## 3.9.1 + +- update interpret to 1.0.0 (support for babel-register) +- fix to include manpages in published tarball +- documentation/recipe updates + +## 3.9.0 + +- add babel support +- add transpiler fallback support +- add support for some renamed transpilers: livescript, etc +- add JSCS +- update dependencies (liftoff, interpret) +- documentation tweaks + +## 3.8.11 + +- fix node 0.12/iojs problems +- add node 0.12 and iojs to travis +- update dependencies (liftoff, v8flags) +- documentation tweaks + +## 3.8.10 + +- add link to spanish docs +- update dependencies (archy, semver, mocha, etc) +- documentation tweaks + +## 3.8.9 + +- fix local version undefined output +- add completion for fish shell +- fix powershell completion line splitting +- add support for arbitrary node flags (oops, should have been a minor bump) +- add v8flags dependency +- update dependencies (liftoff) +- documentation tweaks + +## 3.8.8 + +- update dependencies (minimist, tildify) +- documentation tweaks + +## 3.8.7 + +- handle errors a bit better +- update dependencies (gulp-util, semver, etc) +- documentation tweaks + +## 3.8.6 + +- remove executable flag from LICENSE +- update dependencies (chalk, minimist, liftoff, etc) +- documentation tweaks + +## 3.8.5 + +- simplify --silent and --tasks-simple +- fix bug in autocomplete where errors would come out + +## 3.8.4 + +- CLI will use exit code 1 on exit when any task fails during the lifetime of the process + + +## 3.8.3 + +- Tweak error formatting to work better with PluginErrors and strings + +## 3.8.2 + +- add manpage generation + +## 3.8.1 + +- the CLI now adds process.env.INIT_CWD which is the original cwd it was launched from + +## 3.8.0 + +- update vinyl-fs + - gulp.src is now a writable passthrough, this means you can use it to add files to your pipeline at any point + - gulp.dest can now take a function to determine the folder + +This is now possible! + +```js +gulp.src('lib/*.js') + .pipe(uglify()) + .pipe(gulp.src('styles/*.css')) + .pipe(gulp.dest(function(file){ + // I don't know, you can do something cool here + return 'build/whatever'; + })); +``` + +## 3.7.0 + +- update vinyl-fs to remove BOM from UTF8 files +- add --tasks-simple flag for plaintext task listings +- updated autocomplete scripts to be simpler and use new --tasks-simple flag +- added support for transpilers via liftoff 0.11 and interpret + - just npm install your compiler (coffee-script for example) and it will work out of the box + +## 3.5.5 + +- update deps +- gulp.dest now support mode option, uses source file mode by default (file.stat.mode) +- use chalk for colors in bin +- update gulp.env deprecation msg to be more helpful + + +## 3.5.2 + +- add -V for version on CLI (unix standard) +- -v is deprecated, use -V +- add -T as an alias for --tasks +- documentation + +## 3.5 + +- added `gulp.watch(globs, tasksArray)` sugar +- remove gulp.taskQueue +- deprecate gulp.run +- deprecate gulp.env +- add engineStrict to prevent people with node < 0.9 from installing + +## 3.4 + +- added `--tasks` that prints out the tree of tasks + deps +- global cli + local install mismatch is no longer fatal +- remove tests for fs stuff +- switch core src, dest, and watch to vinyl-fs +- internal cleaning + +## 3.3.4 + +- `--base` is now `--cwd` + +## 3.3.3 + +- support for `--base` CLI arg to change where the search for gulpfile/`--require`s starts +- support for `--gulpfile` CLI arg to point to a gulpfile specifically + +## 3.3.0 + +- file.contents streams are no longer paused coming out of src +- dest now passes files through before they are empty to fix passing to multiple dests + +## 3.2.4 + +- Bug fix - we didn't have any CLI tests + +## 3.2.3 + +- Update dependencies for bug fixes +- autocomplete stuff in the completion folder + +## 3.2 + +- File object is now [vinyl](https://github.com/wearefractal/vinyl) +- .watch() is now [glob-watcher](https://github.com/wearefractal/glob-watcher) +- Fix CLI -v when no gulpfile found +- gulp-util updated +- Logging moved to CLI bin file + - Will cause double logging if you update global CLI to 3.2 but not local + - Will cause no logging if you update local to 3.1 but not global CLI +- Drop support for < 0.9 + +## 3.1.3 + +- Move isStream and isBuffer to gulp-util + +## 3.1 + +- Move file class to gulp-util + +## 3.0 + +- Ability to pass multiple globs and glob negations to glob-stream +- Breaking change to the way glob-stream works +- File object is now a class +- file.shortened changed to file.relative +- file.cwd added +- Break out getStats to avoid nesting +- Major code reorganization + +## 2.7 + +- Breaking change to the way options are passed to glob-stream +- Introduce new File object to ease pain of computing shortened names (now a getter) + +## 2.4 - 2.6 + +- Moved stuff to gulp-util +- Quit exposing createGlobStream (just use the glob-stream module) +- More logging +- Prettier time durations +- Tons of documentation changes +- gulp.trigger(tasks...) as a through stream + +## 1.2-2.4 (11/12/13) + +- src buffer=false fixed for 0.8 and 0.9 (remember to .resume() on these versions before consuming) +- CLI completely rewritten + - Colorful logging + - Uses local version of gulp to run tasks + - Uses findup to locate gulpfile (so you can run it anywhere in your project) + - chdir to gulpfile directory before loading it + - Correct exit codes on errors +- silent flag added to gulp to disable logging +- Fixes to task orchestration (3rd party) +- Better support for globbed directories (thanks @robrich) + +## 1.2 (10/28/13) + +- Can specify buffer=false on src streams to make file.content a stream +- Can specify read=false on src streams to disable file.content + +## 1.1 (10/21/13) + +- Can specify run callback +- Can specify task dependencies +- Tasks can accept callback or return promise +- `gulp.verbose` exposes run-time internals + +## 1.0 (9/26/13) + +- Specify dependency versions +- Updated docs + +## 0.2 (8/6/13) + +- Rename .files() to .src() and .folder() to .dest() + +## 0.1 (7/18/13) + +- Initial Release diff --git a/node_modules/gulp/LICENSE b/node_modules/gulp/LICENSE new file mode 100644 index 0000000..6a29df9 --- /dev/null +++ b/node_modules/gulp/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013-2018 Blaine Bublitz , Eric Schoffstall and other contributors + +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. diff --git a/node_modules/gulp/README.md b/node_modules/gulp/README.md new file mode 100644 index 0000000..aac4230 --- /dev/null +++ b/node_modules/gulp/README.md @@ -0,0 +1,284 @@ +

+ + + +

The streaming build system

+

+ +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Azure Pipelines Build Status][azure-pipelines-image]][azure-pipelines-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![OpenCollective Backers][backer-badge]][backer-url] [![OpenCollective Sponsors][sponsor-badge]][sponsor-url] [![Gitter chat][gitter-image]][gitter-url] + + +## What is gulp? + +- **Automation** - gulp is a toolkit that helps you automate painful or time-consuming tasks in your development workflow. +- **Platform-agnostic** - Integrations are built into all major IDEs and people are using gulp with PHP, .NET, Node.js, Java, and other platforms. +- **Strong Ecosystem** - Use npm modules to do anything you want + over 2000 curated plugins for streaming file transformations +- **Simple** - By providing only a minimal API surface, gulp is easy to learn and simple to use + +## What's new in 4.0?! + +* The task system was rewritten from the ground-up, allowing task composition using `series()` and `parallel()` methods +* The watcher was updated, now using chokidar (no more need for gulp-watch!), with feature parity to our task system +* First-class support was added for incremental builds using `lastRun()` +* A `symlink()` method was exposed to create symlinks instead of copying files +* Built-in support for sourcemaps was added - the gulp-sourcemaps plugin is no longer necessary! +* Task registration of exported functions - using node or ES exports - is now recommended +* Custom registries were designed, allowing for shared tasks or augmented functionality +* Stream implementations were improved, allowing for better conditional and phased builds + +## Installation + +Follow our [Quick Start guide][quick-start]. + +## Roadmap + +Find out about all our work-in-progress and outstanding issues at https://github.com/orgs/gulpjs/projects. + +## Documentation + +Check out the [Getting Started guide][getting-started-guide] and [API docs][api-docs] on our website! + +__Excuse our dust! All other docs will be behind until we get everything updated. Please open an issue if something isn't working.__ + +## Sample `gulpfile.js` + +This file will give you a taste of what gulp does. + +```js +var gulp = require('gulp'); +var less = require('gulp-less'); +var babel = require('gulp-babel'); +var concat = require('gulp-concat'); +var uglify = require('gulp-uglify'); +var rename = require('gulp-rename'); +var cleanCSS = require('gulp-clean-css'); +var del = require('del'); + +var paths = { + styles: { + src: 'src/styles/**/*.less', + dest: 'assets/styles/' + }, + scripts: { + src: 'src/scripts/**/*.js', + dest: 'assets/scripts/' + } +}; + +/* Not all tasks need to use streams, a gulpfile is just another node program + * and you can use all packages available on npm, but it must return either a + * Promise, a Stream or take a callback and call it + */ +function clean() { + // You can use multiple globbing patterns as you would with `gulp.src`, + // for example if you are using del 2.0 or above, return its promise + return del([ 'assets' ]); +} + +/* + * Define our tasks using plain functions + */ +function styles() { + return gulp.src(paths.styles.src) + .pipe(less()) + .pipe(cleanCSS()) + // pass in options to the stream + .pipe(rename({ + basename: 'main', + suffix: '.min' + })) + .pipe(gulp.dest(paths.styles.dest)); +} + +function scripts() { + return gulp.src(paths.scripts.src, { sourcemaps: true }) + .pipe(babel()) + .pipe(uglify()) + .pipe(concat('main.min.js')) + .pipe(gulp.dest(paths.scripts.dest)); +} + +function watch() { + gulp.watch(paths.scripts.src, scripts); + gulp.watch(paths.styles.src, styles); +} + +/* + * Specify if tasks run in series or parallel using `gulp.series` and `gulp.parallel` + */ +var build = gulp.series(clean, gulp.parallel(styles, scripts)); + +/* + * You can use CommonJS `exports` module notation to declare tasks + */ +exports.clean = clean; +exports.styles = styles; +exports.scripts = scripts; +exports.watch = watch; +exports.build = build; +/* + * Define default task that can be called by just running `gulp` from cli + */ +exports.default = build; +``` + +## Use latest JavaScript version in your gulpfile + +__Most new versions of node support most features that Babel provides, except the `import`/`export` syntax. When only that syntax is desired, rename to `gulpfile.esm.js`, install the [esm][esm-module] module, and skip the Babel portion below.__ + +Node already supports a lot of __ES2015+__ features, but to avoid compatibility problems we suggest to install Babel and rename your `gulpfile.js` to `gulpfile.babel.js`. + +```sh +npm install --save-dev @babel/register @babel/core @babel/preset-env +``` + +Then create a **.babelrc** file with the preset configuration. + +```js +{ + "presets": [ "@babel/preset-env" ] +} +``` + +And here's the same sample from above written in **ES2015+**. + +```js +import gulp from 'gulp'; +import less from 'gulp-less'; +import babel from 'gulp-babel'; +import concat from 'gulp-concat'; +import uglify from 'gulp-uglify'; +import rename from 'gulp-rename'; +import cleanCSS from 'gulp-clean-css'; +import del from 'del'; + +const paths = { + styles: { + src: 'src/styles/**/*.less', + dest: 'assets/styles/' + }, + scripts: { + src: 'src/scripts/**/*.js', + dest: 'assets/scripts/' + } +}; + +/* + * For small tasks you can export arrow functions + */ +export const clean = () => del([ 'assets' ]); + +/* + * You can also declare named functions and export them as tasks + */ +export function styles() { + return gulp.src(paths.styles.src) + .pipe(less()) + .pipe(cleanCSS()) + // pass in options to the stream + .pipe(rename({ + basename: 'main', + suffix: '.min' + })) + .pipe(gulp.dest(paths.styles.dest)); +} + +export function scripts() { + return gulp.src(paths.scripts.src, { sourcemaps: true }) + .pipe(babel()) + .pipe(uglify()) + .pipe(concat('main.min.js')) + .pipe(gulp.dest(paths.scripts.dest)); +} + + /* + * You could even use `export as` to rename exported tasks + */ +function watchFiles() { + gulp.watch(paths.scripts.src, scripts); + gulp.watch(paths.styles.src, styles); +} +export { watchFiles as watch }; + +const build = gulp.series(clean, gulp.parallel(styles, scripts)); +/* + * Export a default task + */ +export default build; +``` + +## Incremental Builds + +You can filter out unchanged files between runs of a task using +the `gulp.src` function's `since` option and `gulp.lastRun`: +```js +const paths = { + ... + images: { + src: 'src/images/**/*.{jpg,jpeg,png}', + dest: 'build/img/' + } +} + +function images() { + return gulp.src(paths.images.src, {since: gulp.lastRun(images)}) + .pipe(imagemin({optimizationLevel: 5})) + .pipe(gulp.dest(paths.images.dest)); +} + +function watch() { + gulp.watch(paths.images.src, images); +} +``` +Task run times are saved in memory and are lost when gulp exits. It will only +save time during the `watch` task when running the `images` task +for a second time. + +## Want to contribute? + +Anyone can help make this project better - check out our [Contributing guide](/CONTRIBUTING.md)! + +## Backers + +Support us with a monthly donation and help us continue our activities. + +[![Backers][backers-image]][support-url] + +## Sponsors + +Become a sponsor to get your logo on our README on Github. + +[![Sponsors][sponsors-image]][support-url] + +[downloads-image]: https://img.shields.io/npm/dm/gulp.svg +[npm-url]: https://www.npmjs.com/package/gulp +[npm-image]: https://img.shields.io/npm/v/gulp.svg + +[azure-pipelines-url]: https://dev.azure.com/gulpjs/gulp/_build/latest?definitionId=1&branchName=master +[azure-pipelines-image]: https://dev.azure.com/gulpjs/gulp/_apis/build/status/gulp?branchName=master + +[travis-url]: https://travis-ci.org/gulpjs/gulp +[travis-image]: https://img.shields.io/travis/gulpjs/gulp.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/gulp +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/gulp.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/gulp +[coveralls-image]: https://img.shields.io/coveralls/gulpjs/gulp/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg + +[backer-url]: #backers +[backer-badge]: https://opencollective.com/gulpjs/backers/badge.svg?color=blue +[sponsor-url]: #sponsors +[sponsor-badge]: https://opencollective.com/gulpjs/sponsors/badge.svg?color=blue + +[support-url]: https://opencollective.com/gulpjs#support + +[backers-image]: https://opencollective.com/gulpjs/backers.svg +[sponsors-image]: https://opencollective.com/gulpjs/sponsors.svg + +[quick-start]: https://gulpjs.com/docs/en/getting-started/quick-start +[getting-started-guide]: https://gulpjs.com/docs/en/getting-started/quick-start +[api-docs]: https://gulpjs.com/docs/en/api/concepts diff --git a/node_modules/gulp/bin/gulp.js b/node_modules/gulp/bin/gulp.js new file mode 100755 index 0000000..f4b80cc --- /dev/null +++ b/node_modules/gulp/bin/gulp.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +require('gulp-cli')(); diff --git a/node_modules/gulp/index.js b/node_modules/gulp/index.js new file mode 100644 index 0000000..8b73521 --- /dev/null +++ b/node_modules/gulp/index.js @@ -0,0 +1,55 @@ +'use strict'; + +var util = require('util'); +var Undertaker = require('undertaker'); +var vfs = require('vinyl-fs'); +var watch = require('glob-watcher'); + +function Gulp() { + Undertaker.call(this); + + // Bind the functions for destructuring + this.watch = this.watch.bind(this); + this.task = this.task.bind(this); + this.series = this.series.bind(this); + this.parallel = this.parallel.bind(this); + this.registry = this.registry.bind(this); + this.tree = this.tree.bind(this); + this.lastRun = this.lastRun.bind(this); + this.src = this.src.bind(this); + this.dest = this.dest.bind(this); + this.symlink = this.symlink.bind(this); +} +util.inherits(Gulp, Undertaker); + +Gulp.prototype.src = vfs.src; +Gulp.prototype.dest = vfs.dest; +Gulp.prototype.symlink = vfs.symlink; +Gulp.prototype.watch = function(glob, opt, task) { + if (typeof opt === 'string' || typeof task === 'string' || + Array.isArray(opt) || Array.isArray(task)) { + throw new Error('watching ' + glob + ': watch task has to be ' + + 'a function (optionally generated by using gulp.parallel ' + + 'or gulp.series)'); + } + + if (typeof opt === 'function') { + task = opt; + opt = {}; + } + + opt = opt || {}; + + var fn; + if (typeof task === 'function') { + fn = this.parallel(task); + } + + return watch(glob, opt, fn); +}; + +// Let people use this class from our instance +Gulp.prototype.Gulp = Gulp; + +var inst = new Gulp(); +module.exports = inst; diff --git a/node_modules/gulp/node_modules/.bin/gulp b/node_modules/gulp/node_modules/.bin/gulp new file mode 120000 index 0000000..0ca0cd6 --- /dev/null +++ b/node_modules/gulp/node_modules/.bin/gulp @@ -0,0 +1 @@ +../gulp-cli/bin/gulp.js \ No newline at end of file diff --git a/node_modules/gulp/node_modules/ansi-regex/index.js b/node_modules/gulp/node_modules/ansi-regex/index.js new file mode 100644 index 0000000..b9574ed --- /dev/null +++ b/node_modules/gulp/node_modules/ansi-regex/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = function () { + return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; +}; diff --git a/node_modules/gulp/node_modules/ansi-regex/license b/node_modules/gulp/node_modules/ansi-regex/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/gulp/node_modules/ansi-regex/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/gulp/node_modules/ansi-regex/package.json b/node_modules/gulp/node_modules/ansi-regex/package.json new file mode 100644 index 0000000..074770e --- /dev/null +++ b/node_modules/gulp/node_modules/ansi-regex/package.json @@ -0,0 +1,108 @@ +{ + "_from": "ansi-regex@^2.0.0", + "_id": "ansi-regex@2.1.1", + "_inBundle": false, + "_integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "_location": "/gulp/ansi-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ansi-regex@^2.0.0", + "name": "ansi-regex", + "escapedName": "ansi-regex", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/gulp/strip-ansi" + ], + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "_shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df", + "_spec": "ansi-regex@^2.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for matching ANSI escape codes", + "devDependencies": { + "ava": "0.17.0", + "xo": "0.16.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/ansi-regex#readme", + "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" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" + }, + { + "name": "JD Ballard", + "email": "i.am.qix@gmail.com", + "url": "github.com/qix-" + } + ], + "name": "ansi-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-regex.git" + }, + "scripts": { + "test": "xo && ava --verbose", + "view-supported": "node fixtures/view-codes.js" + }, + "version": "2.1.1", + "xo": { + "rules": { + "guard-for-in": 0, + "no-loop-func": 0 + } + } +} diff --git a/node_modules/gulp/node_modules/ansi-regex/readme.md b/node_modules/gulp/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000..6a928ed --- /dev/null +++ b/node_modules/gulp/node_modules/ansi-regex/readme.md @@ -0,0 +1,39 @@ +# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) + +> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save 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. If I recall correctly, 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. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/camelcase/index.js b/node_modules/gulp/node_modules/camelcase/index.js new file mode 100644 index 0000000..5670f73 --- /dev/null +++ b/node_modules/gulp/node_modules/camelcase/index.js @@ -0,0 +1,56 @@ +'use strict'; + +function preserveCamelCase(str) { + var isLastCharLower = false; + + for (var i = 0; i < str.length; i++) { + var c = str.charAt(i); + + if (isLastCharLower && (/[a-zA-Z]/).test(c) && c.toUpperCase() === c) { + str = str.substr(0, i) + '-' + str.substr(i); + isLastCharLower = false; + i++; + } else { + isLastCharLower = (c.toLowerCase() === c); + } + } + + return str; +} + +module.exports = function () { + var str = [].map.call(arguments, function (str) { + return str.trim(); + }).filter(function (str) { + return str.length; + }).join('-'); + + if (!str.length) { + return ''; + } + + if (str.length === 1) { + return str.toLowerCase(); + } + + if (!(/[_.\- ]+/).test(str)) { + if (str === str.toUpperCase()) { + return str.toLowerCase(); + } + + if (str[0] !== str[0].toLowerCase()) { + return str[0].toLowerCase() + str.slice(1); + } + + return str; + } + + str = preserveCamelCase(str); + + return str + .replace(/^[_.\- ]+/, '') + .toLowerCase() + .replace(/[_.\- ]+(\w|$)/g, function (m, p1) { + return p1.toUpperCase(); + }); +}; diff --git a/node_modules/gulp/node_modules/camelcase/license b/node_modules/gulp/node_modules/camelcase/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/gulp/node_modules/camelcase/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/gulp/node_modules/camelcase/package.json b/node_modules/gulp/node_modules/camelcase/package.json new file mode 100644 index 0000000..c7bca1b --- /dev/null +++ b/node_modules/gulp/node_modules/camelcase/package.json @@ -0,0 +1,72 @@ +{ + "_from": "camelcase@^3.0.0", + "_id": "camelcase@3.0.0", + "_inBundle": false, + "_integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "_location": "/gulp/camelcase", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "camelcase@^3.0.0", + "name": "camelcase", + "escapedName": "camelcase", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/gulp/yargs", + "/gulp/yargs-parser" + ], + "_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "_shasum": "32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a", + "_spec": "camelcase@^3.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/yargs", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/camelcase/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/camelcase#readme", + "keywords": [ + "camelcase", + "camel-case", + "camel", + "case", + "dash", + "hyphen", + "dot", + "underscore", + "separator", + "string", + "text", + "convert" + ], + "license": "MIT", + "name": "camelcase", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/camelcase.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0" +} diff --git a/node_modules/gulp/node_modules/camelcase/readme.md b/node_modules/gulp/node_modules/camelcase/readme.md new file mode 100644 index 0000000..080b2a1 --- /dev/null +++ b/node_modules/gulp/node_modules/camelcase/readme.md @@ -0,0 +1,57 @@ +# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](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](http://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/cliui/CHANGELOG.md b/node_modules/gulp/node_modules/cliui/CHANGELOG.md new file mode 100644 index 0000000..ef6a35e --- /dev/null +++ b/node_modules/gulp/node_modules/cliui/CHANGELOG.md @@ -0,0 +1,15 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# [3.2.0](https://github.com/yargs/cliui/compare/v3.1.2...v3.2.0) (2016-04-11) + + +### Bug Fixes + +* reduces tarball size ([acc6c33](https://github.com/yargs/cliui/commit/acc6c33)) + +### Features + +* adds standard-version for release management ([ff84e32](https://github.com/yargs/cliui/commit/ff84e32)) diff --git a/node_modules/gulp/node_modules/cliui/LICENSE.txt b/node_modules/gulp/node_modules/cliui/LICENSE.txt new file mode 100644 index 0000000..c7e2747 --- /dev/null +++ b/node_modules/gulp/node_modules/cliui/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2015, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/gulp/node_modules/cliui/README.md b/node_modules/gulp/node_modules/cliui/README.md new file mode 100644 index 0000000..028392c --- /dev/null +++ b/node_modules/gulp/node_modules/cliui/README.md @@ -0,0 +1,110 @@ +# cliui + +[![Build Status](https://travis-ci.org/yargs/cliui.svg)](https://travis-ci.org/yargs/cliui) +[![Coverage Status](https://coveralls.io/repos/yargs/cliui/badge.svg?branch=)](https://coveralls.io/r/yargs/cliui?branch=) +[![NPM version](https://img.shields.io/npm/v/cliui.svg)](https://www.npmjs.com/package/cliui) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +easily create complex multi-column command-line-interfaces. + +## Example + +```js +var ui = require('cliui')({ + width: 80 +}) + +ui.div('Usage: $0 [command] [options]') + +ui.div({ + text: 'Options:', + padding: [2, 0, 2, 0] +}) + +ui.div( + { + text: "-f, --file", + width: 20, + padding: [0, 4, 0, 4] + }, + { + text: "the file to load." + + chalk.green("(if this description is long it wraps).") + , + width: 20 + }, + { + text: chalk.red("[required]"), + align: 'right' + } +) + +console.log(ui.toString()) +``` + + + +## Layout DSL + +cliui exposes a simple layout DSL: + +If you create a single `ui.row`, passing a string rather than an +object: + +* `\n`: characters will be interpreted as new rows. +* `\t`: characters will be interpreted as new columns. +* `\s`: characters will be interpreted as padding. + +**as an example...** + +```js +var ui = require('./')({ + width: 60 +}) + +ui.div( + 'Usage: node ./bin/foo.js\n' + + ' \t provide a regex\n' + + ' \t provide a glob\t [required]' +) + +console.log(ui.toString()) +``` + +**will output:** + +```shell +Usage: node ./bin/foo.js + provide a regex + provide a glob [required] +``` + +## Methods + +```js +cliui = require('cliui') +``` + +### cliui({width: integer}) + +Specify the maximum width of the UI being generated. + +### cliui({wrap: boolean}) + +Enable or disable the wrapping of text in a column. + +### cliui.div(column, column, column) + +Create a row with any number of columns, a column +can either be a string, or an object with the following +options: + +* **width:** the width of a column. +* **align:** alignment, `right` or `center`. +* **padding:** `[top, right, bottom, left]`. +* **border:** should a border be placed around the div? + +### cliui.span(column, column, column) + +Similar to `div`, except the next row will be appended without +a new line being created. diff --git a/node_modules/gulp/node_modules/cliui/index.js b/node_modules/gulp/node_modules/cliui/index.js new file mode 100644 index 0000000..e501e78 --- /dev/null +++ b/node_modules/gulp/node_modules/cliui/index.js @@ -0,0 +1,316 @@ +var stringWidth = require('string-width') +var stripAnsi = require('strip-ansi') +var wrap = require('wrap-ansi') +var align = { + right: alignRight, + center: alignCenter +} +var top = 0 +var right = 1 +var bottom = 2 +var left = 3 + +function UI (opts) { + this.width = opts.width + this.wrap = opts.wrap + this.rows = [] +} + +UI.prototype.span = function () { + var cols = this.div.apply(this, arguments) + cols.span = true +} + +UI.prototype.div = function () { + if (arguments.length === 0) this.div('') + if (this.wrap && this._shouldApplyLayoutDSL.apply(this, arguments)) { + return this._applyLayoutDSL(arguments[0]) + } + + var cols = [] + + for (var i = 0, arg; (arg = arguments[i]) !== undefined; i++) { + if (typeof arg === 'string') cols.push(this._colFromString(arg)) + else cols.push(arg) + } + + this.rows.push(cols) + return cols +} + +UI.prototype._shouldApplyLayoutDSL = function () { + return arguments.length === 1 && typeof arguments[0] === 'string' && + /[\t\n]/.test(arguments[0]) +} + +UI.prototype._applyLayoutDSL = function (str) { + var _this = this + var rows = str.split('\n') + var leftColumnWidth = 0 + + // simple heuristic for layout, make sure the + // second column lines up along the left-hand. + // don't allow the first column to take up more + // than 50% of the screen. + rows.forEach(function (row) { + var columns = row.split('\t') + if (columns.length > 1 && stringWidth(columns[0]) > leftColumnWidth) { + leftColumnWidth = Math.min( + Math.floor(_this.width * 0.5), + stringWidth(columns[0]) + ) + } + }) + + // generate a table: + // replacing ' ' with padding calculations. + // using the algorithmically generated width. + rows.forEach(function (row) { + var columns = row.split('\t') + _this.div.apply(_this, columns.map(function (r, i) { + return { + text: r.trim(), + padding: _this._measurePadding(r), + width: (i === 0 && columns.length > 1) ? leftColumnWidth : undefined + } + })) + }) + + return this.rows[this.rows.length - 1] +} + +UI.prototype._colFromString = function (str) { + return { + text: str, + padding: this._measurePadding(str) + } +} + +UI.prototype._measurePadding = function (str) { + // measure padding without ansi escape codes + var noAnsi = stripAnsi(str) + return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length] +} + +UI.prototype.toString = function () { + var _this = this + var lines = [] + + _this.rows.forEach(function (row, i) { + _this.rowToString(row, lines) + }) + + // don't display any lines with the + // hidden flag set. + lines = lines.filter(function (line) { + return !line.hidden + }) + + return lines.map(function (line) { + return line.text + }).join('\n') +} + +UI.prototype.rowToString = function (row, lines) { + var _this = this + var padding + var rrows = this._rasterize(row) + var str = '' + var ts + var width + var wrapWidth + + rrows.forEach(function (rrow, r) { + str = '' + rrow.forEach(function (col, c) { + ts = '' // temporary string used during alignment/padding. + width = row[c].width // the width with padding. + wrapWidth = _this._negatePadding(row[c]) // the width without padding. + + ts += col + + for (var i = 0; i < wrapWidth - stringWidth(col); i++) { + ts += ' ' + } + + // align the string within its column. + if (row[c].align && row[c].align !== 'left' && _this.wrap) { + ts = align[row[c].align](ts, wrapWidth) + if (stringWidth(ts) < wrapWidth) ts += new Array(width - stringWidth(ts)).join(' ') + } + + // apply border and padding to string. + padding = row[c].padding || [0, 0, 0, 0] + if (padding[left]) str += new Array(padding[left] + 1).join(' ') + str += addBorder(row[c], ts, '| ') + str += ts + str += addBorder(row[c], ts, ' |') + if (padding[right]) str += new Array(padding[right] + 1).join(' ') + + // if prior row is span, try to render the + // current row on the prior line. + if (r === 0 && lines.length > 0) { + str = _this._renderInline(str, lines[lines.length - 1]) + } + }) + + // remove trailing whitespace. + lines.push({ + text: str.replace(/ +$/, ''), + span: row.span + }) + }) + + return lines +} + +function addBorder (col, ts, style) { + if (col.border) { + if (/[.']-+[.']/.test(ts)) return '' + else if (ts.trim().length) return style + else return ' ' + } + return '' +} + +// if the full 'source' can render in +// the target line, do so. +UI.prototype._renderInline = function (source, previousLine) { + var leadingWhitespace = source.match(/^ */)[0].length + var target = previousLine.text + var targetTextWidth = stringWidth(target.trimRight()) + + if (!previousLine.span) return source + + // if we're not applying wrapping logic, + // just always append to the span. + if (!this.wrap) { + previousLine.hidden = true + return target + source + } + + if (leadingWhitespace < targetTextWidth) return source + + previousLine.hidden = true + + return target.trimRight() + new Array(leadingWhitespace - targetTextWidth + 1).join(' ') + source.trimLeft() +} + +UI.prototype._rasterize = function (row) { + var _this = this + var i + var rrow + var rrows = [] + var widths = this._columnWidths(row) + var wrapped + + // word wrap all columns, and create + // a data-structure that is easy to rasterize. + row.forEach(function (col, c) { + // leave room for left and right padding. + col.width = widths[c] + if (_this.wrap) wrapped = wrap(col.text, _this._negatePadding(col), {hard: true}).split('\n') + else wrapped = col.text.split('\n') + + if (col.border) { + wrapped.unshift('.' + new Array(_this._negatePadding(col) + 3).join('-') + '.') + wrapped.push("'" + new Array(_this._negatePadding(col) + 3).join('-') + "'") + } + + // add top and bottom padding. + if (col.padding) { + for (i = 0; i < (col.padding[top] || 0); i++) wrapped.unshift('') + for (i = 0; i < (col.padding[bottom] || 0); i++) wrapped.push('') + } + + wrapped.forEach(function (str, r) { + if (!rrows[r]) rrows.push([]) + + rrow = rrows[r] + + for (var i = 0; i < c; i++) { + if (rrow[i] === undefined) rrow.push('') + } + rrow.push(str) + }) + }) + + return rrows +} + +UI.prototype._negatePadding = function (col) { + var wrapWidth = col.width + if (col.padding) wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0) + if (col.border) wrapWidth -= 4 + return wrapWidth +} + +UI.prototype._columnWidths = function (row) { + var _this = this + var widths = [] + var unset = row.length + var unsetWidth + var remainingWidth = this.width + + // column widths can be set in config. + row.forEach(function (col, i) { + if (col.width) { + unset-- + widths[i] = col.width + remainingWidth -= col.width + } else { + widths[i] = undefined + } + }) + + // any unset widths should be calculated. + if (unset) unsetWidth = Math.floor(remainingWidth / unset) + widths.forEach(function (w, i) { + if (!_this.wrap) widths[i] = row[i].width || stringWidth(row[i].text) + else if (w === undefined) widths[i] = Math.max(unsetWidth, _minWidth(row[i])) + }) + + return widths +} + +// calculates the minimum width of +// a column, based on padding preferences. +function _minWidth (col) { + var padding = col.padding || [] + var minWidth = 1 + (padding[left] || 0) + (padding[right] || 0) + if (col.border) minWidth += 4 + return minWidth +} + +function alignRight (str, width) { + str = str.trim() + var padding = '' + var strWidth = stringWidth(str) + + if (strWidth < width) { + padding = new Array(width - strWidth + 1).join(' ') + } + + return padding + str +} + +function alignCenter (str, width) { + str = str.trim() + var padding = '' + var strWidth = stringWidth(str.trim()) + + if (strWidth < width) { + padding = new Array(parseInt((width - strWidth) / 2, 10) + 1).join(' ') + } + + return padding + str +} + +module.exports = function (opts) { + opts = opts || {} + + return new UI({ + width: (opts || {}).width || 80, + wrap: typeof opts.wrap === 'boolean' ? opts.wrap : true + }) +} diff --git a/node_modules/gulp/node_modules/cliui/package.json b/node_modules/gulp/node_modules/cliui/package.json new file mode 100644 index 0000000..344b212 --- /dev/null +++ b/node_modules/gulp/node_modules/cliui/package.json @@ -0,0 +1,96 @@ +{ + "_from": "cliui@^3.2.0", + "_id": "cliui@3.2.0", + "_inBundle": false, + "_integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "_location": "/gulp/cliui", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "cliui@^3.2.0", + "name": "cliui", + "escapedName": "cliui", + "rawSpec": "^3.2.0", + "saveSpec": null, + "fetchSpec": "^3.2.0" + }, + "_requiredBy": [ + "/gulp/yargs" + ], + "_resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "_shasum": "120601537a916d29940f934da3b48d585a39213d", + "_spec": "cliui@^3.2.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/yargs", + "author": { + "name": "Ben Coe", + "email": "ben@npmjs.com" + }, + "bugs": { + "url": "https://github.com/yargs/cliui/issues" + }, + "bundleDependencies": false, + "config": { + "blanket": { + "pattern": [ + "index.js" + ], + "data-cover-never": [ + "node_modules", + "test" + ], + "output-reporter": "spec" + } + }, + "dependencies": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + }, + "deprecated": false, + "description": "easily create complex multi-column command-line-interfaces", + "devDependencies": { + "chai": "^3.5.0", + "chalk": "^1.1.2", + "coveralls": "^2.11.8", + "mocha": "^2.4.5", + "nyc": "^6.4.0", + "standard": "^6.0.8", + "standard-version": "^2.1.2" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/yargs/cliui#readme", + "keywords": [ + "cli", + "command-line", + "layout", + "design", + "console", + "wrap", + "table" + ], + "license": "ISC", + "main": "index.js", + "name": "cliui", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/yargs/cliui.git" + }, + "scripts": { + "coverage": "nyc --reporter=text-lcov mocha | coveralls", + "pretest": "standard", + "test": "nyc mocha", + "version": "standard-version" + }, + "standard": { + "ignore": [ + "**/example/**" + ], + "globals": [ + "it" + ] + }, + "version": "3.2.0" +} diff --git a/node_modules/gulp/node_modules/get-caller-file/LICENSE.md b/node_modules/gulp/node_modules/get-caller-file/LICENSE.md new file mode 100644 index 0000000..bf3e1c0 --- /dev/null +++ b/node_modules/gulp/node_modules/get-caller-file/LICENSE.md @@ -0,0 +1,6 @@ +ISC License (ISC) +Copyright 2018 Stefan Penner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/gulp/node_modules/get-caller-file/README.md b/node_modules/gulp/node_modules/get-caller-file/README.md new file mode 100644 index 0000000..1944927 --- /dev/null +++ b/node_modules/gulp/node_modules/get-caller-file/README.md @@ -0,0 +1,4 @@ +# get-caller-file + +[![Build Status](https://travis-ci.org/stefanpenner/get-caller-file.svg?branch=master)](https://travis-ci.org/stefanpenner/get-caller-file) +[![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master) diff --git a/node_modules/gulp/node_modules/get-caller-file/index.js b/node_modules/gulp/node_modules/get-caller-file/index.js new file mode 100644 index 0000000..03e7dfc --- /dev/null +++ b/node_modules/gulp/node_modules/get-caller-file/index.js @@ -0,0 +1,20 @@ +'use strict'; + +// Call this function in a another function to find out the file from +// which that function was called from. (Inspects the v8 stack trace) +// +// Inspired by http://stackoverflow.com/questions/13227489 + +module.exports = function getCallerFile(_position) { + var oldPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = function(err, stack) { return stack; }; + var stack = new Error().stack; + Error.prepareStackTrace = oldPrepareStackTrace; + + var position = _position ? _position : 2; + + // stack[0] holds this file + // stack[1] holds where this function was called + // stack[2] holds the file we're interested in + return stack[position] ? stack[position].getFileName() : undefined; +}; diff --git a/node_modules/gulp/node_modules/get-caller-file/package.json b/node_modules/gulp/node_modules/get-caller-file/package.json new file mode 100644 index 0000000..7ffb8f7 --- /dev/null +++ b/node_modules/gulp/node_modules/get-caller-file/package.json @@ -0,0 +1,58 @@ +{ + "_from": "get-caller-file@^1.0.1", + "_id": "get-caller-file@1.0.3", + "_inBundle": false, + "_integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "_location": "/gulp/get-caller-file", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "get-caller-file@^1.0.1", + "name": "get-caller-file", + "escapedName": "get-caller-file", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/gulp/yargs" + ], + "_resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "_shasum": "f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a", + "_spec": "get-caller-file@^1.0.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/yargs", + "author": { + "name": "Stefan Penner" + }, + "bugs": { + "url": "https://github.com/stefanpenner/get-caller-file/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "[![Build Status](https://travis-ci.org/stefanpenner/get-caller-file.svg?branch=master)](https://travis-ci.org/stefanpenner/get-caller-file) [![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master)", + "devDependencies": { + "chai": "^4.1.2", + "ensure-posix-path": "^1.0.1", + "mocha": "^5.2.0" + }, + "directories": { + "test": "tests" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/stefanpenner/get-caller-file#readme", + "license": "ISC", + "main": "index.js", + "name": "get-caller-file", + "repository": { + "type": "git", + "url": "git+https://github.com/stefanpenner/get-caller-file.git" + }, + "scripts": { + "test": "mocha test", + "test:debug": "mocha test" + }, + "version": "1.0.3" +} diff --git a/node_modules/gulp/node_modules/gulp-cli/LICENSE b/node_modules/gulp/node_modules/gulp-cli/LICENSE new file mode 100644 index 0000000..9aedc0d --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Blaine Bublitz, Eric Schoffstall and other contributors + +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. diff --git a/node_modules/gulp/node_modules/gulp-cli/README.md b/node_modules/gulp/node_modules/gulp-cli/README.md new file mode 100644 index 0000000..a998637 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/README.md @@ -0,0 +1,240 @@ +

+ + + +

+ +# gulp-cli + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +Command Line Utility for Gulp + +## Usage + +```bash +> gulp [flags] ... +``` + +## Custom Metadata + +When listing tasks with the `gulp -T` command, gulp-cli displays some custom metadata as defined upon task functions. Currently supported properties: + +* `task.description` - String of the description to display. + +```js +function clean() { ... } +clean.description = 'Cleans up generated files.'; +``` + +* `task.flags` - Object with key/value pairs being flag/description to display. + +```js +function build() { ... } +build.flags = { + '--prod': 'Builds in production mode.' +}; +``` + +Example Usage: + +```js +function build() { ... } +build.description = 'Build entire project.'; +build.flags = { + '--prod': 'Builds in production mode (minification, etc).' +}; +// gulp 3.x +gulp.task('build', build); +// gulp 4.x +gulp.task(build); +``` + +## Tasks + +The task(s) listed on the command line will be executed. +If more than one task is listed, Gulp will execute all of them +concurrently, that is, as if they had all been listed as dependencies of +a single task. + +By default, Gulp does not serialize tasks listed on the command line. If you would like to execute tasks serially, you must specify the `--series` flag. e.g. `gulp clean build --series` + +Just running `gulp` will execute the task `default`. If there is no +`default` task, gulp will error. + +## Completion +> Thanks to the grunt team, specifically Tyler Kellen + +To enable tasks auto-completion in shell you should add `eval "$(gulp --completion=shell)"` in your `.shellrc` file. + +###### Bash: + +Add `eval "$(gulp --completion=bash)"` to `~/.bashrc`. + +###### Zsh: + +Add `eval "$(gulp --completion=zsh)"` to `~/.zshrc`. + +###### Powershell: + +Add `Invoke-Expression ((gulp --completion=powershell) -join [System.Environment]::NewLine)` to `$PROFILE`. + +###### Fish: + +Add `gulp --completion=fish | source` to `~/.config/fish/config.fish`. + +## Compilers + +You can find a list of supported languages at https://github.com/js-cli/js-interpret. If you would like to add support for a new language, send pull requests/open issues on that project. + +## Environment + +The CLI adds process.env.INIT_CWD which is the original cwd it was launched from. + +## Configuration + +Configuration is supported through the use of a `.gulp.*` file (e.g. `.gulp.json`, `.gulp.yml`). You can find a list of supported languages at https://github.com/js-cli/js-interpret. + +Configuration from the home directory (`~`) and current working directory (`cwd`) are merged with `cwd` taking precedence. + +Supported configurations properties: + +| Property | Description | +|--------------------|-------------| +| description | Top-level description of the project/gulpfile (Replaces "Tasks for ~/path/of/gulpfile.js") | +| flags.continue | Continue execution of tasks upon failure by default. | +| flags.compactTasks | Reduce the output of task dependency tree by default. | +| flags.tasksDepth | Set default depth of task dependency tree. | +| flags.gulpfile | Set a default gulpfile | +| flags.silent | Silence logging by default | +| flags.series | Run tasks given on the CLI in series (the default is parallel) | +| flags.require | An array of modules to require before running the gulpfile. Any relative paths will be resolved against the `--cwd` directory (if you don't want that behavior, use absolute paths) | +| flags.nodeFlags | An array of flags used to forcibly respawn the process upon startup. For example, if you always want your gulpfiles to run in node's harmony mode, you can set `--harmony` here | + +## Flags + +gulp has very few flags to know about. All other flags are for tasks to use if needed. + +__Some flags only work with gulp 4 and will be ignored when invoked against gulp 3.__ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FlagShort FlagDescription
--help-hShow this help.
--version-vPrint the global and local gulp versions.
--require [path]Will require a module before running the gulpfile. This is useful for transpilers but also has other applications.
--gulpfile [path]-fManually set path of gulpfile. Useful if you have multiple gulpfiles. This will set the CWD to the gulpfile directory as well.
--cwd [path]Manually set the CWD. The search for the gulpfile, as well as the relativity of all requires (including the `--require` flag) will be from here.
--verify [path (optional)]Will verify plugins referenced in project's package.json against the plugins blacklist.
--tasks-TPrint the task dependency tree for the loaded gulpfile.
--tasks-simplePrint a plaintext list of tasks for the loaded gulpfile.
--tasks-json [path]Print the task dependency tree, in JSON format, for the loaded gulpfile. The [path] argument is optional, and if given writes the JSON to the path.
--tasks-depth [number]Specify the depth of the task dependency tree to print. This flag can be used with --tasks or --tasks-json. (This flag was named --depth before but is deprecated.)
--compact-tasksReduce the output of task dependency tree by printing only top tasks and their child tasks. This flag can be used with --tasks or --tasks-json.
--sort-tasksWill sort top tasks of task dependency tree. This flag can be used with --tasks.
--colorWill force gulp and gulp plugins to display colors, even when no color support is detected.
--no-colorWill force gulp and gulp plugins to not display colors, even when color support is detected.
--silent-SSuppress all gulp logging.
--continueContinue execution of tasks upon failure.
--seriesRun tasks given on the CLI in series (the default is parallel).
--log-level-LSet the loglevel. -L for least verbose and -LLLL for most verbose. -LLL is default.
+ +## License + +MIT + +[downloads-image]: http://img.shields.io/npm/dm/gulp-cli.svg +[npm-url]: https://www.npmjs.com/package/gulp-cli +[npm-image]: http://img.shields.io/npm/v/gulp-cli.svg + +[travis-url]: https://travis-ci.org/gulpjs/gulp-cli +[travis-image]: http://img.shields.io/travis/gulpjs/gulp-cli.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/gulp-cli +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/gulp-cli.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/gulp-cli +[coveralls-image]: http://img.shields.io/coveralls/gulpjs/gulp-cli/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/node_modules/gulp/node_modules/gulp-cli/bin/gulp.js b/node_modules/gulp/node_modules/gulp-cli/bin/gulp.js new file mode 100755 index 0000000..b6423d1 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/bin/gulp.js @@ -0,0 +1,5 @@ +#!/usr/bin/env node + +'use strict'; + +require('../')(); diff --git a/node_modules/gulp/node_modules/gulp-cli/completion/README.md b/node_modules/gulp/node_modules/gulp-cli/completion/README.md new file mode 100644 index 0000000..3fa466f --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/completion/README.md @@ -0,0 +1,20 @@ +# Completion for gulp +> Thanks to the grunt team, specifically Tyler Kellen + +To enable tasks auto-completion in shell you should add `eval "$(gulp --completion=shell)"` in your `.shellrc` file. + +## Bash + +Add `eval "$(gulp --completion=bash)"` to `~/.bashrc`. + +## Zsh + +Add `eval "$(gulp --completion=zsh)"` to `~/.zshrc`. + +## Powershell + +Add `Invoke-Expression ((gulp --completion=powershell) -join [System.Environment]::NewLine)` to `$PROFILE`. + +## Fish + +Add `gulp --completion=fish | source` to `~/.config/fish/config.fish`. diff --git a/node_modules/gulp/node_modules/gulp-cli/completion/bash b/node_modules/gulp/node_modules/gulp-cli/completion/bash new file mode 100644 index 0000000..704c27c --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/completion/bash @@ -0,0 +1,27 @@ +#!/bin/bash + +# Borrowed from grunt-cli +# http://gruntjs.com/ +# +# Copyright (c) 2012 Tyler Kellen, contributors +# Licensed under the MIT license. +# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT + +# Usage: +# +# To enable bash completion for gulp, add the following line (minus the +# leading #, which is the bash comment character) to your ~/.bashrc file: +# +# eval "$(gulp --completion=bash)" + +# Enable bash autocompletion. +function _gulp_completions() { + # The currently-being-completed word. + local cur="${COMP_WORDS[COMP_CWORD]}" + #Grab tasks + local compls=$(gulp --tasks-simple) + # Tell complete what stuff to show. + COMPREPLY=($(compgen -W "$compls" -- "$cur")) +} + +complete -o default -F _gulp_completions gulp diff --git a/node_modules/gulp/node_modules/gulp-cli/completion/fish b/node_modules/gulp/node_modules/gulp-cli/completion/fish new file mode 100644 index 0000000..f27f224 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/completion/fish @@ -0,0 +1,10 @@ +#!/usr/bin/env fish + +# Usage: +# +# To enable fish completion for gulp, add the following line to +# your ~/.config/fish/config.fish file: +# +# gulp --completion=fish | source + +complete -c gulp -a "(gulp --tasks-simple)" -f diff --git a/node_modules/gulp/node_modules/gulp-cli/completion/powershell b/node_modules/gulp/node_modules/gulp-cli/completion/powershell new file mode 100644 index 0000000..08ec438 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/completion/powershell @@ -0,0 +1,61 @@ +# Copyright (c) 2014 Jason Jarrett +# +# Tab completion for the `gulp` +# +# Usage: +# +# To enable powershell completion for gulp you need to be running +# at least PowerShell v3 or greater and add the below to your $PROFILE +# +# Invoke-Expression ((gulp --completion=powershell) -join [System.Environment]::NewLine) +# +# + +$gulp_completion_Process = { + param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) + + + # Load up an assembly to read the gulpfile's sha1 + if(-not $global:GulpSHA1Managed) { + [Reflection.Assembly]::LoadWithPartialName("System.Security") | out-null + $global:GulpSHA1Managed = new-Object System.Security.Cryptography.SHA1Managed + } + + # setup a global (in-memory) cache + if(-not $global:GulpfileShaCache) { + $global:GulpfileShaCache = @{}; + } + + $cache = $global:GulpfileShaCache; + + # Get the gulpfile's sha1 + $sha1gulpFile = (resolve-path gulpfile.js -ErrorAction Ignore | %{ + $file = [System.IO.File]::Open($_.Path, "open", "read") + [string]::join('', ($global:GulpSHA1Managed.ComputeHash($file) | %{ $_.ToString("x2") })) + $file.Dispose() + }) + + # lookup the sha1 for previously cached task lists. + if($cache.ContainsKey($sha1gulpFile)){ + $tasks = $cache[$sha1gulpFile]; + } else { + $tasks = (gulp --tasks-simple).split("`n"); + $cache[$sha1gulpFile] = $tasks; + } + + + $tasks | + where { $_.startswith($commandName) } + Sort-Object | + foreach { New-Object System.Management.Automation.CompletionResult $_, $_, 'ParameterValue', ('{0}' -f $_) } +} + +if (-not $global:options) { + $global:options = @{ + CustomArgumentCompleters = @{}; + NativeArgumentCompleters = @{} + } +} + +$global:options['NativeArgumentCompleters']['gulp'] = $gulp_completion_Process +$function:tabexpansion2 = $function:tabexpansion2 -replace 'End\r\n{','End { if ($null -ne $options) { $options += $global:options} else {$options = $global:options}' diff --git a/node_modules/gulp/node_modules/gulp-cli/completion/zsh b/node_modules/gulp/node_modules/gulp-cli/completion/zsh new file mode 100644 index 0000000..8169b22 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/completion/zsh @@ -0,0 +1,25 @@ +#!/bin/zsh + +# Borrowed from grunt-cli +# http://gruntjs.com/ +# +# Copyright (c) 2012 Tyler Kellen, contributors +# Licensed under the MIT license. +# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT + +# Usage: +# +# To enable zsh completion for gulp, add the following line (minus the +# leading #, which is the zsh comment character) to your ~/.zshrc file: +# +# eval "$(gulp --completion=zsh)" + +# Enable zsh autocompletion. +function _gulp_completion() { + # Grab tasks + compls=$(gulp --tasks-simple) + completions=(${=compls}) + compadd -- $completions +} + +compdef _gulp_completion gulp diff --git a/node_modules/gulp/node_modules/gulp-cli/gulp.1 b/node_modules/gulp/node_modules/gulp-cli/gulp.1 new file mode 100644 index 0000000..dc24a01 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/gulp.1 @@ -0,0 +1,83 @@ +.TH "GULP" "" "April 2019" "" "" +.SH "NAME" +\fBgulp\fR +.SS Usage +.P +\fBgulp [flags] \.\.\.\fP +.SS Tasks +.P +The task(s) listed will be executed\. +If more than one task is listed, Gulp will execute all of them +concurrently, that is, as if they had all been listed as dependencies of +a single task\. +.P +By default, Gulp does not serialize tasks listed on the command line\. If you would like to execute tasks serially, you must specify the \fB\-\-series\fP flag\. e\.g\. \fBgulp clean build \-\-series\fP +.P +Just running \fBgulp\fP will execute the task \fBdefault\fP\|\. If there is no +\fBdefault\fP task, gulp will error\. +.SS Compilers +.P +You can find a list of supported languages at https:// If you would like to add support for a new language, send pull requests/open issues on that project\. +.SS Environment +.P +The CLI adds process\.env\.INIT_CWD which is the original cwd it was launched from\. +.SS Flags +.P +gulp has very few flags to know about\. All other flags are for tasks to use if needed\. +.P +\fBSome flags only work with gulp 4 and will be ignored when invoked against gulp 3\.\fR +.P +\fB\-\-help\fR, \fB\-h\fR + Show the help\. +.P +\fB\-\-version\fR, \fB\-v\fR + Print the global and local gulp versions\. +.P +\fB\-\-require\fR [path] + Will require a module before running the gulpfile\. This is useful for transpilers but also has other applications\. +.P +\fB\-\-gulpfile\fR [path], \fB\-f\fR [path] + Manually set path of gulpfile\. Useful if you have multiple gulpfiles\. This will set the CWD to the gulpfile directory as well\. +.P +\fB\-\-cwd\fR [path] + Manually set the CWD\. The search for the gulpfile, as well as the relativity of all requires will be from here\. +.P +\fB\-\-verify\fR [path (optional)] + Will verify plugins referenced in project's package\.json against the plugins blacklist\. +.P +\fB\-\-tasks\fR, \fB\-T\fR + Print the task dependency tree for the loaded gulpfile\. +.P +\fB\-\-tasks\-simple\fR + Print a plaintext list of tasks for the loaded gulpfile\. +.P +\fB\-\-tasks\-json\fR [path] + Print the task dependency tree, in JSON format, for the loaded gulpfile\. The [path] argument is optional, and if given writes the JSON to the path\. +.P +\fB\-\-tasks\-depth\fR [number] + Specify the depth of the task dependency tree to print\. This flag can be used with \-\-tasks or \-\-tasks\-json\. (This flag was named \-\-depth before but is deprecated\.) +.P +\fB\-\-compact\-tasks\fR + Reduce the output of task dependency tree by printing only top tasks and their child tasks\. This flag can be used with \-\-tasks or \-\-tasks\-json\. +.P +\fB\-\-sort\-tasks\fR + Will sort top tasks of task dependency tree\. This flag can be used with \-\-tasks\. +.P +\fB\-\-color\fR + Will force gulp and gulp plugins to display colors, even when no color support is detected\. +.P +\fB\-\-no\-color\fR + Will force gulp and gulp plugins to not display colors, even when color support is detected\. +.P +\fB\-\-silent\fR, \fB\-S\fR + Suppress all gulp logging\. +.P +\fB\-\-continue\fR + Continue execution of tasks upon failure\. +.P +\fB\-\-series\fR + Run tasks given on the CLI in series (the default is parallel)\. +.P +\fB\-\-log\-level\fR, \fB\-L\fR + Set the loglevel\. \-L for least verbose and \-LLLL for most verbose\. \-LLL is default\. + diff --git a/node_modules/gulp/node_modules/gulp-cli/index.js b/node_modules/gulp/node_modules/gulp-cli/index.js new file mode 100644 index 0000000..9a7e66f --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/index.js @@ -0,0 +1,202 @@ +'use strict'; + +var fs = require('fs'); +var path = require('path'); +var log = require('gulplog'); +var yargs = require('yargs'); +var Liftoff = require('liftoff'); +var interpret = require('interpret'); +var v8flags = require('v8flags'); +var findRange = require('semver-greatest-satisfied-range'); +var ansi = require('./lib/shared/ansi'); +var exit = require('./lib/shared/exit'); +var tildify = require('./lib/shared/tildify'); +var makeTitle = require('./lib/shared/make-title'); +var cliOptions = require('./lib/shared/cli-options'); +var completion = require('./lib/shared/completion'); +var verifyDeps = require('./lib/shared/verify-dependencies'); +var cliVersion = require('./package.json').version; +var getBlacklist = require('./lib/shared/get-blacklist'); +var toConsole = require('./lib/shared/log/to-console'); + +var loadConfigFiles = require('./lib/shared/config/load-files'); +var mergeConfigToCliFlags = require('./lib/shared/config/cli-flags'); +var mergeConfigToEnvFlags = require('./lib/shared/config/env-flags'); + +// Logging functions +var logVerify = require('./lib/shared/log/verify'); +var logBlacklistError = require('./lib/shared/log/blacklist-error'); + +// Get supported ranges +var ranges = fs.readdirSync(__dirname + '/lib/versioned/'); + +// Set env var for ORIGINAL cwd +// before anything touches it +process.env.INIT_CWD = process.cwd(); + +var cli = new Liftoff({ + name: 'gulp', + processTitle: makeTitle('gulp', process.argv.slice(2)), + completions: completion, + extensions: interpret.jsVariants, + v8flags: v8flags, + configFiles: { + '.gulp': { + home: { + path: '~', + extensions: interpret.extensions, + }, + cwd: { + path: '.', + extensions: interpret.extensions, + }, + }, + }, +}); + +var usage = + '\n' + ansi.bold('Usage:') + + ' gulp ' + ansi.blue('[options]') + ' tasks'; + +var parser = yargs.usage(usage, cliOptions); +var opts = parser.argv; + +cli.on('require', function(name) { + log.info('Requiring external module', ansi.magenta(name)); +}); + +cli.on('requireFail', function(name, error) { + log.warn( + ansi.yellow('Failed to load external module'), + ansi.magenta(name) + ); + /* istanbul ignore else */ + if (error) { + log.warn(ansi.yellow(error.toString())); + } +}); + +cli.on('respawn', function(flags, child) { + var nodeFlags = ansi.magenta(flags.join(', ')); + var pid = ansi.magenta(child.pid); + log.info('Node flags detected:', nodeFlags); + log.info('Respawned to PID:', pid); +}); + +function run() { + cli.prepare({ + cwd: opts.cwd, + configPath: opts.gulpfile, + require: opts.require, + completion: opts.completion, + }, function(env) { + var cfgLoadOrder = ['home', 'cwd']; + var cfg = loadConfigFiles(env.configFiles['.gulp'], cfgLoadOrder); + opts = mergeConfigToCliFlags(opts, cfg); + env = mergeConfigToEnvFlags(env, cfg, opts); + env.configProps = cfg; + + // Set up event listeners for logging again after configuring. + toConsole(log, opts); + + cli.execute(env, env.nodeFlags, handleArguments); + }); +} + +module.exports = run; + +// The actual logic +function handleArguments(env) { + + // This translates the --continue flag in gulp + // To the settle env variable for undertaker + // We use the process.env so the user's gulpfile + // Can know about the flag + if (opts.continue) { + process.env.UNDERTAKER_SETTLE = 'true'; + } + + if (opts.help) { + parser.showHelp(console.log); + exit(0); + } + + // Anything that needs to print outside of the logging mechanism should use console.log + if (opts.version) { + console.log('CLI version:', cliVersion); + console.log('Local version:', env.modulePackage.version || 'Unknown'); + exit(0); + } + + if (opts.verify) { + var pkgPath = opts.verify !== true ? opts.verify : 'package.json'; + /* istanbul ignore else */ + if (path.resolve(pkgPath) !== path.normalize(pkgPath)) { + pkgPath = path.join(env.cwd, pkgPath); + } + log.info('Verifying plugins in ' + pkgPath); + return getBlacklist(function(err, blacklist) { + /* istanbul ignore if */ + if (err) { + return logBlacklistError(err); + } + + var blacklisted = verifyDeps(require(pkgPath), blacklist); + + logVerify(blacklisted); + }); + } + + if (!env.modulePath) { + /* istanbul ignore next */ + var missingNodeModules = + fs.existsSync(path.join(env.cwd, 'package.json')) + && !fs.existsSync(path.join(env.cwd, 'node_modules')); + + /* istanbul ignore next */ + var missingGulpMessage = + missingNodeModules + ? 'Local modules not found in' + : 'Local gulp not found in'; + log.error( + ansi.red(missingGulpMessage), + ansi.magenta(tildify(env.cwd)) + ); + /* istanbul ignore next */ + var installCommand = + missingNodeModules + ? 'npm install' + : 'npm install gulp'; + log.error(ansi.red('Try running: ' + installCommand)); + exit(1); + } + + if (!env.configPath) { + log.error(ansi.red('No gulpfile found')); + exit(1); + } + + // Chdir before requiring gulpfile to make sure + // we let them chdir as needed + if (process.cwd() !== env.cwd) { + process.chdir(env.cwd); + log.info( + 'Working directory changed to', + ansi.magenta(tildify(env.cwd)) + ); + } + + // Find the correct CLI version to run + var range = findRange(env.modulePackage.version, ranges); + + if (!range) { + log.error( + ansi.red('Unsupported gulp version', env.modulePackage.version) + ); + exit(1); + } + + // Load and execute the CLI version + var versionedDir = path.join(__dirname, '/lib/versioned/', range, '/'); + require(versionedDir)(opts, env, env.configProps); +} diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/ansi.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/ansi.js new file mode 100644 index 0000000..d5030fa --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/ansi.js @@ -0,0 +1,41 @@ +'use strict'; + +var colors = require('ansi-colors'); +var supportsColor = require('color-support'); + +var hasColors = colorize(); + +/* istanbul ignore next */ +module.exports = { + red: hasColors ? colors.red : noColor, + green: hasColors ? colors.green : noColor, + blue: hasColors ? colors.blue : noColor, + magenta: hasColors ? colors.magenta : noColor, + cyan: hasColors ? colors.cyan : noColor, + white: hasColors ? colors.white : noColor, + gray: hasColors ? colors.gray : noColor, + bgred: hasColors ? colors.bgred : noColor, + bold: hasColors ? colors.bold : noColor, + yellow: hasColors ? colors.yellow : noColor, +}; + +function noColor(message) { + return message; +} + +function hasFlag(flag) { + return (process.argv.indexOf('--' + flag) !== -1); +} + +function colorize() { + if (hasFlag('no-color')) { + return false; + } + + /* istanbul ignore if */ + if (hasFlag('color')) { + return true; + } + + return supportsColor(); +} diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/cli-options.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/cli-options.js new file mode 100644 index 0000000..09d98e3 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/cli-options.js @@ -0,0 +1,122 @@ +'use strict'; + +var ansi = require('./ansi'); + +module.exports = { + help: { + alias: 'h', + type: 'boolean', + desc: ansi.gray( + 'Show this help.'), + }, + version: { + alias: 'v', + type: 'boolean', + desc: ansi.gray( + 'Print the global and local gulp versions.'), + }, + require: { + type: 'string', + requiresArg: true, + desc: ansi.gray( + 'Will require a module before running the gulpfile. ' + + 'This is useful for transpilers but also has other applications.'), + }, + gulpfile: { + alias: 'f', + type: 'string', + requiresArg: true, + desc: ansi.gray( + 'Manually set path of gulpfile. Useful if you have multiple gulpfiles. ' + + 'This will set the CWD to the gulpfile directory as well.'), + }, + cwd: { + type: 'string', + requiresArg: true, + desc: ansi.gray( + 'Manually set the CWD. The search for the gulpfile, ' + + 'as well as the relativity of all requires will be from here.'), + }, + verify: { + desc: ansi.gray( + 'Will verify plugins referenced in project\'s package.json against ' + + 'the plugins blacklist.'), + }, + tasks: { + alias: 'T', + type: 'boolean', + desc: ansi.gray( + 'Print the task dependency tree for the loaded gulpfile.'), + }, + 'tasks-simple': { + type: 'boolean', + desc: ansi.gray( + 'Print a plaintext list of tasks for the loaded gulpfile.'), + }, + 'tasks-json': { + desc: ansi.gray( + 'Print the task dependency tree, ' + + 'in JSON format, for the loaded gulpfile.'), + }, + 'tasks-depth': { + alias: 'depth', + type: 'number', + requiresArg: true, + default: undefined, // To detect if this cli option is specified. + desc: ansi.gray( + 'Specify the depth of the task dependency tree.'), + }, + 'compact-tasks': { + type: 'boolean', + default: undefined, // To detect if this cli option is specified. + desc: ansi.gray( + 'Reduce the output of task dependency tree by printing ' + + 'only top tasks and their child tasks.'), + }, + 'sort-tasks': { + type: 'boolean', + default: undefined, // To detect if this cli option is specified. + desc: ansi.gray( + 'Will sort top tasks of task dependency tree.'), + }, + color: { + type: 'boolean', + desc: ansi.gray( + 'Will force gulp and gulp plugins to display colors, ' + + 'even when no color support is detected.'), + }, + 'no-color': { + type: 'boolean', + desc: ansi.gray( + 'Will force gulp and gulp plugins to not display colors, ' + + 'even when color support is detected.'), + }, + silent: { + alias: 'S', + type: 'boolean', + default: undefined, // To detect if this cli option is specified. + desc: ansi.gray( + 'Suppress all gulp logging.'), + }, + continue: { + type: 'boolean', + default: undefined, // To detect if this cli option is specified. + desc: ansi.gray( + 'Continue execution of tasks upon failure.'), + }, + series: { + type: 'boolean', + default: undefined, // To detect if this cli option is specified. + desc: ansi.gray( + 'Run tasks given on the CLI in series (the default is parallel).'), + }, + 'log-level': { + alias: 'L', + // Type isn't needed because count acts as a boolean + count: true, + default: undefined, // To detect if this cli option is specified. + desc: ansi.gray( + 'Set the loglevel. -L for least verbose and -LLLL for most verbose. ' + + '-LLL is default.'), + }, +}; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/completion.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/completion.js new file mode 100644 index 0000000..3a47023 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/completion.js @@ -0,0 +1,22 @@ +'use strict'; + +var fs = require('fs'); +var path = require('path'); + +module.exports = function(name) { + if (typeof name !== 'string') { + throw new Error('Missing completion type'); + } + var file = path.join(__dirname, '../../completion', name); + try { + console.log(fs.readFileSync(file, 'utf8')); + process.exit(0); + } catch (err) { + console.log( + 'echo "gulp autocompletion rules for', + '\'' + name + '\'', + 'not found"' + ); + process.exit(5); + } +}; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/config/cli-flags.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/config/cli-flags.js new file mode 100644 index 0000000..1baf38d --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/config/cli-flags.js @@ -0,0 +1,25 @@ +'use strict'; + +var copyProps = require('copy-props'); + +var fromTo = { + 'flags.silent': 'silent', + 'flags.continue': 'continue', + 'flags.series': 'series', + 'flags.logLevel': 'logLevel', + 'flags.compactTasks': 'compactTasks', + 'flags.tasksDepth': 'tasksDepth', + 'flags.sortTasks': 'sortTasks', +}; + +function mergeConfigToCliFlags(opt, config) { + return copyProps(config, opt, fromTo, defaults); +} + +function defaults(cfgInfo, optInfo) { + if (optInfo.value === undefined) { + return cfgInfo.value; + } +} + +module.exports = mergeConfigToCliFlags; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/config/env-flags.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/config/env-flags.js new file mode 100644 index 0000000..a5a4abd --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/config/env-flags.js @@ -0,0 +1,44 @@ +'use strict'; + +var path = require('path'); +var copyProps = require('copy-props'); + +var toFrom = { + configPath: 'flags.gulpfile', + configBase: 'flags.gulpfile', + require: 'flags.require', + nodeFlags: 'flags.nodeFlags', +}; + +function mergeConfigToEnvFlags(env, config, cliOpts) { + // This must reverse because `flags.gulpfile` determines 2 different properties + var reverse = true; + return copyProps(env, config, toFrom, convert, reverse); + + function convert(configInfo, envInfo) { + if (envInfo.keyChain === 'configBase') { + if (cliOpts.gulpfile === undefined) { + return path.dirname(configInfo.value); + } + return; + } + + if (envInfo.keyChain === 'configPath') { + if (cliOpts.gulpfile === undefined) { + return configInfo.value; + } + return; + } + + if (envInfo.keyChain === 'require') { + return [].concat(envInfo.value, configInfo.value); + } + + /* istanbul ignore else */ + if (envInfo.keyChain === 'nodeFlags') { + return [].concat(configInfo.value || []); + } + } +} + +module.exports = mergeConfigToEnvFlags; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/config/load-files.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/config/load-files.js new file mode 100644 index 0000000..4ebb29c --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/config/load-files.js @@ -0,0 +1,30 @@ +'use strict'; + +var copyProps = require('copy-props'); +var path = require('path'); + +function loadConfigFiles(configFiles, configFileOrder) { + var config = {}; + + configFileOrder.forEach(loadFile); + + function loadFile(key) { + var filePath = configFiles[key]; + if (!filePath) { + return; + } + + copyProps(require(filePath), config, convert); + + function convert(loadedInfo) { + if (loadedInfo.keyChain === 'flags.gulpfile') { + return path.resolve(path.dirname(filePath), loadedInfo.value); + } + return loadedInfo.value; + } + } + + return config; +} + +module.exports = loadConfigFiles; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/exit.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/exit.js new file mode 100644 index 0000000..9d619c3 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/exit.js @@ -0,0 +1,15 @@ +'use strict'; + +// Fix stdout truncation on windows +function exit(code) { + /* istanbul ignore next */ + if (process.platform === 'win32' && process.stdout.bufferSize) { + process.stdout.once('drain', function() { + process.exit(code); + }); + return; + } + process.exit(code); +} + +module.exports = exit; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/get-blacklist.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/get-blacklist.js new file mode 100644 index 0000000..31258be --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/get-blacklist.js @@ -0,0 +1,62 @@ +'use strict'; + +var https = require('https'); + +var concat = require('concat-stream'); + +var url = 'https://gulpjs.com/plugins/blackList.json'; + +function collect(stream, cb) { + stream.on('error', cb); + stream.pipe(concat(onSuccess)); + + function onSuccess(result) { + cb(null, result); + } +} + +function parse(str, cb) { + try { + cb(null, JSON.parse(str)); + } catch (err) { + /* istanbul ignore next */ + cb(new Error('Invalid Blacklist JSON.')); + } +} + +// TODO: Test this impl +function getBlacklist(cb) { + https.get(url, onRequest); + + function onRequest(res) { + /* istanbul ignore if */ + if (res.statusCode !== 200) { + // TODO: Test different status codes + return cb(new Error('Request failed. Status Code: ' + res.statusCode)); + } + + res.setEncoding('utf8'); + + collect(res, onCollect); + } + + function onCollect(err, result) { + /* istanbul ignore if */ + if (err) { + return cb(err); + } + + parse(result, onParse); + } + + function onParse(err, blacklist) { + /* istanbul ignore if */ + if (err) { + return cb(err); + } + + cb(null, blacklist); + } +} + +module.exports = getBlacklist; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/log/blacklist-error.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/log/blacklist-error.js new file mode 100644 index 0000000..b0355b2 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/log/blacklist-error.js @@ -0,0 +1,15 @@ +'use strict'; + +var log = require('gulplog'); + +var ansi = require('../ansi'); +var exit = require('../exit'); + +/* istanbul ignore next */ +function logBlacklistError(err) { + log.error(ansi.red('Error: failed to retrieve plugins black-list')); + log.error(err.message); // Avoid duplicating for each version + exit(1); +} + +module.exports = logBlacklistError; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/log/copy-tree.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/log/copy-tree.js new file mode 100644 index 0000000..99d7b5f --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/log/copy-tree.js @@ -0,0 +1,81 @@ +'use strict'; + +function copyNode(node) { + var newNode = {}; + Object.keys(node).forEach(function(key) { + newNode[key] = node[key]; + }); + return newNode; +} + +var defaultNodeFactory = { + topNode: copyNode, + taskNode: copyNode, + childNode: copyNode, +}; + +function copyTree(tree, opts, nodeFactory) { + opts = opts || {}; + + var depth = opts.tasksDepth; + depth = typeof depth === 'number' ? ((depth < 1) ? 1 : depth) : null; + + nodeFactory = nodeFactory || defaultNodeFactory; + + var newTree = nodeFactory.topNode(tree); + newTree.nodes = []; + + if (Array.isArray(tree.nodes)) { + tree.nodes.forEach(visit); + } + + function visit(node) { + var newNode = nodeFactory.taskNode(node); + newNode.nodes = []; + newTree.nodes.push(newNode); + + if (opts.compactTasks) { + forEach(node.nodes, copyNotRecursively, newNode); + + } else if (!depth || depth > 1) { + forEach(node.nodes, copyRecursively, depth, 2, newNode); + } + } + + function copyNotRecursively(child, newParent) { + var newChild = nodeFactory.childNode(child); + newChild.nodes = []; + newParent.nodes.push(newChild); + + if (child.branch) { + forEach(child.nodes, copyNotRecursively, newChild); + } + } + + function copyRecursively(child, maxDepth, nowDepth, newParent) { + var newChild = nodeFactory.childNode(child); + newChild.nodes = []; + newParent.nodes.push(newChild); + + if (!maxDepth || maxDepth > nowDepth) { + forEach(child.nodes, copyRecursively, maxDepth, nowDepth + 1, newChild); + } + } + + return newTree; +} + +function forEach(nodes, fn) { + if (!Array.isArray(nodes)) { + return; + } + + var args = Array.prototype.slice.call(arguments, 2); + + for (var i = 0, n = nodes.length; i < n; i++) { + fn.apply(nodes[i], [nodes[i]].concat(args)); + } +} + +module.exports = copyTree; + diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/log/tasks.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/log/tasks.js new file mode 100644 index 0000000..0b76b08 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/log/tasks.js @@ -0,0 +1,166 @@ +'use strict'; + +var archy = require('archy'); +var log = require('gulplog'); + +var sortBy = require('array-sort'); +var isObject = require('isobject'); + +var ansi = require('../ansi'); +var copyTree = require('./copy-tree'); + +function logTasks(tree, opts, getTask) { + if (opts.sortTasks) { + tree.nodes = sortBy(tree.nodes, 'label'); + } + + var lineInfos = []; + var entryObserver = getLineInfoCollector(lineInfos); + var nodeFactory = getNodeFactory(getTask, entryObserver); + + tree = copyTree(tree, opts, nodeFactory); + var spacer = getSpacerForLineIndents(tree, lineInfos); + var lines = getLinesContainingOnlyBranches(tree); + + log.info(tree.label); + printTreeList(lines, spacer, lineInfos); +} + +function getLineInfoCollector(lineInfos) { + return { + topTask: function(node) { + lineInfos.push({ + name: node.label, + desc: node.desc, + type: 'top', + }); + }, + option: function(opt) { + lineInfos.push({ + name: opt.label, + desc: opt.desc, + type: 'option', + }); + }, + childTask: function(node) { + lineInfos.push({ + name: node.label, + type: 'child', + }); + }, + }; +} + +function getNodeFactory(getTask, entryObserver) { + return { + topNode: function(node) { + return { + label: node.label, + }; + }, + + taskNode: function(node) { + /* istanbul ignore next */ + var task = getTask(node.label) || {}; + + var newNode = { + label: node.label, + desc: typeof task.description === 'string' ? task.description : '', + opts: [], + }; + entryObserver.topTask(newNode); + + if (isObject(task.flags)) { + Object.keys(task.flags).sort().forEach(function(flag) { + if (flag.length === 0) { + return; + } + /* istanbul ignore next */ + var opt = { + label: flag, + desc: typeof task.flags[flag] === 'string' ? task.flags[flag] : '', + }; + entryObserver.option(opt); + newNode.opts.push(opt); + newNode.label += '\n' + opt.label; // The way of archy for options. + }); + } + + return newNode; + }, + + childNode: function(node) { + var newChild = { + label: node.label, + }; + entryObserver.childTask(newChild); + newChild.label = ''; // Because don't use child tasks to calc indents. + + return newChild; + }, + }; +} + +function getSpacerForLineIndents(tree, lineInfos) { + var maxSize = 0; + var sizes = []; + + archy(tree) + .split('\n') + .slice(1, -1) + .forEach(function(line, index) { + var info = lineInfos[index]; + if (info.type === 'top' || info.type === 'option') { + maxSize = Math.max(maxSize, line.length); + sizes.push(line.length); + } else { + sizes.push(0); + } + }); + + maxSize += 3; + + return function(index) { + return Array(maxSize - sizes[index]).join(' '); + }; +} + +function getLinesContainingOnlyBranches(tree) { + tree.nodes.forEach(function(node) { + node.label = ''; + node.opts.forEach(function() { + node.label += '\n'; + }); + }); + + return archy(tree) + .split('\n') + .slice(1, -1); +} + +function printTreeList(lines, spacer, lineInfos) { + lines.forEach(function(branch, index) { + var info = lineInfos[index]; + + var line = ansi.white(branch); + + if (info.type === 'top') { + line += ansi.cyan(info.name); + if (info.desc.length > 0) { + line += spacer(index) + ansi.white(info.desc); + } + } else if (info.type === 'option') { + line += ansi.magenta(info.name); + if (info.desc.length > 0) { + line += spacer(index) + ansi.white('…' + info.desc); + } + } else { // If (info.type === 'child') { + line += ansi.white(info.name); + } + + log.info(line); + }); +} + +module.exports = logTasks; + diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/log/to-console.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/log/to-console.js new file mode 100644 index 0000000..43650af --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/log/to-console.js @@ -0,0 +1,58 @@ +'use strict'; + +var fancyLog = require('fancy-log'); + +/* istanbul ignore next */ +function noop() {} + +// The sorting of the levels is +// significant. +var levels = [ + 'error', // -L: Logs error events. + 'warn', // -LL: Logs warn and error events. + 'info', // -LLL: Logs info, warn and error events. + 'debug', // -LLLL: Logs all log levels. +]; + +function cleanup(log) { + levels.forEach(removeListeners); + + function removeListeners(level) { + if (level === 'error') { + log.removeListener(level, noop); + log.removeListener(level, fancyLog.error); + } else { + log.removeListener(level, fancyLog); + } + } +} + +function toConsole(log, opts) { + // Remove previous listeners to enable to call this twice. + cleanup(log); + + // Return immediately if logging is + // not desired. + if (opts.tasksSimple || opts.tasksJson || opts.help || opts.version || opts.silent) { + // Keep from crashing process when silent. + log.on('error', noop); + return; + } + + // Default loglevel to info level (3). + var loglevel = opts.logLevel || 3; + + levels + .filter(function(item, i) { + return i < loglevel; + }) + .forEach(function(level) { + if (level === 'error') { + log.on(level, fancyLog.error); + } else { + log.on(level, fancyLog); + } + }); +} + +module.exports = toConsole; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/log/verify.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/log/verify.js new file mode 100644 index 0000000..7104623 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/log/verify.js @@ -0,0 +1,28 @@ +'use strict'; + +var log = require('gulplog'); + +var ansi = require('../ansi'); +var exit = require('../exit'); + +function logVerify(blacklisted) { + var pluginNames = Object.keys(blacklisted); + + if (!pluginNames.length) { + log.info( + ansi.green('There are no blacklisted plugins in this project') + ); + exit(0); + } + + log.warn(ansi.red('Blacklisted plugins found in this project:')); + + pluginNames.map(function(pluginName) { + var reason = blacklisted[pluginName]; + log.warn(ansi.bgred(pluginName) + ': ' + reason); + }); + + exit(1); +} + +module.exports = logVerify; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/make-title.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/make-title.js new file mode 100644 index 0000000..aa6d2ee --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/make-title.js @@ -0,0 +1,11 @@ +'use strict'; + +function makeTitle(cmd, argv) { + if (!argv || argv.length === 0) { + return cmd; + } + + return [cmd].concat(argv).join(' '); +} + +module.exports = makeTitle; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/register-exports.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/register-exports.js new file mode 100644 index 0000000..572e9ed --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/register-exports.js @@ -0,0 +1,21 @@ +'use strict'; + +function registerExports(gulpInst, tasks) { + var taskNames = Object.keys(tasks); + + if (taskNames.length) { + taskNames.forEach(register); + } + + function register(taskName) { + var task = tasks[taskName]; + + if (typeof task !== 'function') { + return; + } + + gulpInst.task(task.displayName || taskName, task); + } +} + +module.exports = registerExports; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/tildify.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/tildify.js new file mode 100644 index 0000000..a9c61fc --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/tildify.js @@ -0,0 +1,9 @@ +'use strict'; + +var replaceHomedir = require('replace-homedir'); + +function tildify(filepath) { + return replaceHomedir(filepath, '~'); +} + +module.exports = tildify; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/shared/verify-dependencies.js b/node_modules/gulp/node_modules/gulp-cli/lib/shared/verify-dependencies.js new file mode 100644 index 0000000..a0d4812 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/shared/verify-dependencies.js @@ -0,0 +1,25 @@ +'use strict'; + +var matchdep = require('matchdep'); + +/** + * Given a collection of plugin names verifies this collection against + * the blacklist. Returns an object with: + * [plugin name]=>[blacklisting reason] + * or an empty object if none of the dependencies to check are blacklisted. + * + * @param pkg - package.json contents + * @param blacklist - contents of the blacklist in JSON format + */ +function verifyDependencies(pkg, blacklist) { + var blacklisted = matchdep + .filterAll(Object.keys(blacklist), pkg) + .reduce(function(blacklisted, pluginName) { + blacklisted[pluginName] = blacklist[pluginName]; + return blacklisted; + }, {}); + + return blacklisted; +} + +module.exports = verifyDependencies; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/format-error.js b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/format-error.js new file mode 100644 index 0000000..705e0bf --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/format-error.js @@ -0,0 +1,23 @@ +'use strict'; + +// Format orchestrator errors +function formatError(e) { + if (!e.err) { + return e.message; + } + + // PluginError + if (typeof e.err.showStack === 'boolean') { + return e.err.toString(); + } + + // Normal error + if (e.err.stack) { + return e.err.stack; + } + + // Unknown (string, number, etc.) + return new Error(String(e.err)).stack; +} + +module.exports = formatError; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/index.js b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/index.js new file mode 100644 index 0000000..542d0cc --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/index.js @@ -0,0 +1,76 @@ +'use strict'; + +var fs = require('fs'); + +var log = require('gulplog'); +var stdout = require('mute-stdout'); + +var taskTree = require('./task-tree'); +var copyTree = require('../../shared/log/copy-tree'); + +var tildify = require('../../shared/tildify'); +var logTasks = require('../../shared/log/tasks'); +var ansi = require('../../shared/ansi'); +var logEvents = require('./log/events'); +var logTasksSimple = require('./log/tasks-simple'); +var registerExports = require('../../shared/register-exports'); + +function execute(opts, env, config) { + var tasks = opts._; + var toRun = tasks.length ? tasks : ['default']; + + if (opts.tasksSimple || opts.tasks || opts.tasksJson) { + // Mute stdout if we are listing tasks + stdout.mute(); + } + + // This is what actually loads up the gulpfile + var exported = require(env.configPath); + log.info('Using gulpfile', ansi.magenta(tildify(env.configPath))); + + var gulpInst = require(env.modulePath); + logEvents(gulpInst); + + registerExports(gulpInst, exported); + + // Always unmute stdout after gulpfile is required + stdout.unmute(); + + process.nextTick(function() { + var tree; + + if (opts.tasksSimple) { + return logTasksSimple(env, gulpInst); + } + if (opts.tasks) { + tree = taskTree(gulpInst.tasks); + if (config.description && typeof config.description === 'string') { + tree.label = config.description; + } else { + tree.label = 'Tasks for ' + ansi.magenta(tildify(env.configPath)); + } + return logTasks(tree, opts, function(task) { + return gulpInst.tasks[task].fn; + }); + } + if (opts.tasksJson) { + tree = taskTree(gulpInst.tasks); + if (config.description && typeof config.description === 'string') { + tree.label = config.description; + } else { + tree.label = 'Tasks for ' + tildify(env.configPath); + } + + var output = JSON.stringify(copyTree(tree, opts)); + + if (typeof opts.tasksJson === 'boolean') { + return console.log(output); + } + + return fs.writeFileSync(opts.tasksJson, output, 'utf-8'); + } + gulpInst.start.apply(gulpInst, toRun); + }); +} + +module.exports = execute; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/log/events.js b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/log/events.js new file mode 100644 index 0000000..b7bd00a --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/log/events.js @@ -0,0 +1,60 @@ +'use strict'; + +var log = require('gulplog'); +var prettyTime = require('pretty-hrtime'); + +var ansi = require('../../../shared/ansi'); +var exit = require('../../../shared/exit'); +var formatError = require('../format-error'); + +// Wire up logging events +function logEvents(gulpInst) { + + // Exit with 0 or 1 + var failed = false; + process.once('exit', function(code) { + if (code === 0 && failed) { + exit(1); + } + }); + + // Total hack due to poor error management in orchestrator + gulpInst.on('err', function() { + failed = true; + }); + + gulpInst.on('task_start', function(e) { + // TODO: batch these + // so when 5 tasks start at once it only logs one time with all 5 + log.info('Starting', '\'' + ansi.cyan(e.task) + '\'...'); + }); + + gulpInst.on('task_stop', function(e) { + var time = prettyTime(e.hrDuration); + log.info( + 'Finished', '\'' + ansi.cyan(e.task) + '\'', + 'after', ansi.magenta(time) + ); + }); + + gulpInst.on('task_err', function(e) { + var msg = formatError(e); + var time = prettyTime(e.hrDuration); + log.error( + '\'' + ansi.cyan(e.task) + '\'', + ansi.red('errored after'), + ansi.magenta(time) + ); + log.error(msg); + }); + + gulpInst.on('task_not_found', function(err) { + log.error( + ansi.red('Task \'' + err.task + '\' is not in your gulpfile') + ); + log.error('Please check the documentation for proper gulpfile formatting'); + exit(1); + }); +} + +module.exports = logEvents; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/log/tasks-simple.js b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/log/tasks-simple.js new file mode 100644 index 0000000..dca2fdf --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/log/tasks-simple.js @@ -0,0 +1,9 @@ +'use strict'; + +function logTasksSimple(env, localGulp) { + console.log(Object.keys(localGulp.tasks) + .join('\n') + .trim()); +} + +module.exports = logTasksSimple; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/task-tree.js b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/task-tree.js new file mode 100644 index 0000000..8d68980 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^3.7.0/task-tree.js @@ -0,0 +1,27 @@ +'use strict'; + +module.exports = function(tasks) { + var map = {}; + var arr = []; + Object.keys(tasks).forEach(function(taskname) { + var task = { + label: taskname, + type: 'task', + nodes: [], + }; + map[taskname] = task; + arr.push(task); + }); + Object.keys(tasks).forEach(function(taskname) { + var task = map[taskname]; + tasks[taskname].dep.forEach(function(childname) { + var child = map[childname] || { + label: childname, + type: 'task', + nodes: [], + }; + task.nodes.push(child); + }); + }); + return { label: 'Tasks', nodes: arr }; +}; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0-alpha.1/index.js b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0-alpha.1/index.js new file mode 100644 index 0000000..ae8854c --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0-alpha.1/index.js @@ -0,0 +1,91 @@ +'use strict'; + +var fs = require('fs'); + +var log = require('gulplog'); +var stdout = require('mute-stdout'); + +var ansi = require('../../shared/ansi'); +var exit = require('../../shared/exit'); +var tildify = require('../../shared/tildify'); + +var logTasks = require('../../shared/log/tasks'); +var logEvents = require('../^4.0.0/log/events'); +var logSyncTask = require('../^4.0.0/log/sync-task'); +var logTasksSimple = require('../^4.0.0/log/tasks-simple'); +var registerExports = require('../../shared/register-exports'); + +var copyTree = require('../../shared/log/copy-tree'); + +function execute(opts, env, config) { + + var tasks = opts._; + var toRun = tasks.length ? tasks : ['default']; + + if (opts.tasksSimple || opts.tasks || opts.tasksJson) { + // Mute stdout if we are listing tasks + stdout.mute(); + } + + var gulpInst = require(env.modulePath); + logEvents(gulpInst); + logSyncTask(gulpInst); + + // This is what actually loads up the gulpfile + var exported = require(env.configPath); + + registerExports(gulpInst, exported); + + // Always unmute stdout after gulpfile is required + stdout.unmute(); + + process.nextTick(function() { + var tree; + + if (opts.tasksSimple) { + return logTasksSimple(gulpInst.tree()); + } + if (opts.tasks) { + tree = {}; + if (config.description && typeof config.description === 'string') { + tree.label = config.description; + } else { + tree.label = 'Tasks for ' + ansi.magenta(tildify(env.configPath)); + } + tree.nodes = gulpInst.tree({ deep: true }); + return logTasks(tree, opts, function(taskname) { + return gulpInst.task(taskname); + }); + } + if (opts.tasksJson) { + tree = {}; + if (config.description && typeof config.description === 'string') { + tree.label = config.description; + } else { + tree.label = 'Tasks for ' + tildify(env.configPath); + } + tree.nodes = gulpInst.tree({ deep: true }); + + var output = JSON.stringify(copyTree(tree, opts)); + if (typeof opts.tasksJson === 'boolean' && opts.tasksJson) { + return console.log(output); + } + return fs.writeFileSync(opts.tasksJson, output, 'utf-8'); + } + try { + log.info('Using gulpfile', ansi.magenta(tildify(env.configPath))); + var runMethod = opts.series ? 'series' : 'parallel'; + gulpInst[runMethod](toRun)(function(err) { + if (err) { + exit(1); + } + }); + } catch (err) { + log.error(ansi.red(err.message)); + log.error('To list available tasks, try running: gulp --tasks'); + exit(1); + } + }); +} + +module.exports = execute; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0-alpha.2/index.js b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0-alpha.2/index.js new file mode 100644 index 0000000..faaf999 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0-alpha.2/index.js @@ -0,0 +1,91 @@ +'use strict'; + +var fs = require('fs'); + +var log = require('gulplog'); +var stdout = require('mute-stdout'); + +var ansi = require('../../shared/ansi'); +var exit = require('../../shared/exit'); +var tildify = require('../../shared/tildify'); + +var logTasks = require('../../shared/log/tasks'); +var logEvents = require('../^4.0.0/log/events'); +var logSyncTask = require('../^4.0.0/log/sync-task'); +var logTasksSimple = require('../^4.0.0/log/tasks-simple'); +var registerExports = require('../../shared/register-exports'); + +var copyTree = require('../../shared/log/copy-tree'); +var getTask = require('../^4.0.0/log/get-task'); + +function execute(opts, env, config) { + + var tasks = opts._; + var toRun = tasks.length ? tasks : ['default']; + + if (opts.tasksSimple || opts.tasks || opts.tasksJson) { + // Mute stdout if we are listing tasks + stdout.mute(); + } + + var gulpInst = require(env.modulePath); + logEvents(gulpInst); + logSyncTask(gulpInst); + + // This is what actually loads up the gulpfile + var exported = require(env.configPath); + + registerExports(gulpInst, exported); + + // Always unmute stdout after gulpfile is required + stdout.unmute(); + + process.nextTick(function() { + var tree; + + if (opts.tasksSimple) { + tree = gulpInst.tree(); + return logTasksSimple(tree.nodes); + } + if (opts.tasks) { + tree = gulpInst.tree({ deep: true }); + if (config.description && typeof config.description === 'string') { + tree.label = config.description; + } else { + tree.label = 'Tasks for ' + ansi.magenta(tildify(env.configPath)); + } + + return logTasks(tree, opts, getTask(gulpInst)); + } + if (opts.tasksJson) { + tree = gulpInst.tree({ deep: true }); + if (config.description && typeof config.description === 'string') { + tree.label = config.description; + } else { + tree.label = 'Tasks for ' + tildify(env.configPath); + } + + var output = JSON.stringify(copyTree(tree, opts)); + + if (typeof opts.tasksJson === 'boolean' && opts.tasksJson) { + return console.log(output); + } + return fs.writeFileSync(opts.tasksJson, output, 'utf-8'); + } + try { + log.info('Using gulpfile', ansi.magenta(tildify(env.configPath))); + var runMethod = opts.series ? 'series' : 'parallel'; + gulpInst[runMethod](toRun)(function(err) { + if (err) { + exit(1); + } + }); + } catch (err) { + log.error(ansi.red(err.message)); + log.error('To list available tasks, try running: gulp --tasks'); + exit(1); + } + }); +} + +module.exports = execute; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/format-error.js b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/format-error.js new file mode 100644 index 0000000..3d8a771 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/format-error.js @@ -0,0 +1,24 @@ +'use strict'; + +// Format orchestrator errors +/* istanbul ignore next */ +function formatError(e) { + if (!e.error) { + return e.message; + } + + // PluginError + if (typeof e.error.showStack === 'boolean') { + return e.error.toString(); + } + + // Normal error + if (e.error.stack) { + return e.error.stack; + } + + // Unknown (string, number, etc.) + return new Error(String(e.error)).stack; +} + +module.exports = formatError; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js new file mode 100644 index 0000000..ded28c3 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js @@ -0,0 +1,91 @@ +'use strict'; + +var fs = require('fs'); + +var log = require('gulplog'); +var stdout = require('mute-stdout'); + +var ansi = require('../../shared/ansi'); +var exit = require('../../shared/exit'); +var tildify = require('../../shared/tildify'); + +var logTasks = require('../../shared/log/tasks'); +var logEvents = require('./log/events'); +var logSyncTask = require('./log/sync-task'); +var logTasksSimple = require('./log/tasks-simple'); +var registerExports = require('../../shared/register-exports'); + +var copyTree = require('../../shared/log/copy-tree'); +var getTask = require('./log/get-task'); + +function execute(opts, env, config) { + + var tasks = opts._; + var toRun = tasks.length ? tasks : ['default']; + + if (opts.tasksSimple || opts.tasks || opts.tasksJson) { + // Mute stdout if we are listing tasks + stdout.mute(); + } + + var gulpInst = require(env.modulePath); + logEvents(gulpInst); + logSyncTask(gulpInst); + + // This is what actually loads up the gulpfile + var exported = require(env.configPath); + + registerExports(gulpInst, exported); + + // Always unmute stdout after gulpfile is required + stdout.unmute(); + + process.nextTick(function() { + var tree; + + if (opts.tasksSimple) { + tree = gulpInst.tree(); + return logTasksSimple(tree.nodes); + } + if (opts.tasks) { + tree = gulpInst.tree({ deep: true }); + if (config.description && typeof config.description === 'string') { + tree.label = config.description; + } else { + tree.label = 'Tasks for ' + ansi.magenta(tildify(env.configPath)); + } + + return logTasks(tree, opts, getTask(gulpInst)); + } + if (opts.tasksJson) { + tree = gulpInst.tree({ deep: true }); + if (config.description && typeof config.description === 'string') { + tree.label = config.description; + } else { + tree.label = 'Tasks for ' + tildify(env.configPath); + } + + var output = JSON.stringify(copyTree(tree, opts)); + + if (typeof opts.tasksJson === 'boolean' && opts.tasksJson) { + return console.log(output); + } + return fs.writeFileSync(opts.tasksJson, output, 'utf-8'); + } + try { + log.info('Using gulpfile', ansi.magenta(tildify(env.configPath))); + var runMethod = opts.series ? 'series' : 'parallel'; + gulpInst[runMethod](toRun)(function(err) { + if (err) { + exit(1); + } + }); + } catch (err) { + log.error(ansi.red(err.message)); + log.error('To list available tasks, try running: gulp --tasks'); + exit(1); + } + }); +} + +module.exports = execute; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/events.js b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/events.js new file mode 100644 index 0000000..1f6e7b1 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/events.js @@ -0,0 +1,50 @@ +'use strict'; + +var log = require('gulplog'); +var prettyTime = require('pretty-hrtime'); + +var ansi = require('../../../shared/ansi'); +var formatError = require('../format-error'); + +// Wire up logging events +function logEvents(gulpInst) { + + var loggedErrors = []; + + gulpInst.on('start', function(evt) { + /* istanbul ignore next */ + // TODO: batch these + // so when 5 tasks start at once it only logs one time with all 5 + var level = evt.branch ? 'debug' : 'info'; + log[level]('Starting', '\'' + ansi.cyan(evt.name) + '\'...'); + }); + + gulpInst.on('stop', function(evt) { + var time = prettyTime(evt.duration); + /* istanbul ignore next */ + var level = evt.branch ? 'debug' : 'info'; + log[level]( + 'Finished', '\'' + ansi.cyan(evt.name) + '\'', + 'after', ansi.magenta(time) + ); + }); + + gulpInst.on('error', function(evt) { + var msg = formatError(evt); + var time = prettyTime(evt.duration); + var level = evt.branch ? 'debug' : 'error'; + log[level]( + '\'' + ansi.cyan(evt.name) + '\'', + ansi.red('errored after'), + ansi.magenta(time) + ); + + // If we haven't logged this before, log it and add to list + if (loggedErrors.indexOf(evt.error) === -1) { + log.error(msg); + loggedErrors.push(evt.error); + } + }); +} + +module.exports = logEvents; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/get-task.js b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/get-task.js new file mode 100644 index 0000000..1b15871 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/get-task.js @@ -0,0 +1,43 @@ +'use strict'; + +var isObject = require('isobject'); + +function getTask(gulpInst) { + return function(name) { + var task = gulpInst.task(name); + return { + description: getDescription(task), + flags: getFlags(task), + }; + }; +} + +function getDescription(task) { + if (typeof task.description === 'string') { + return task.description; + } + /* istanbul ignore else */ + if (typeof task.unwrap === 'function') { + var origFn = task.unwrap(); + if (typeof origFn.description === 'string') { + return origFn.description; + } + } + return undefined; +} + +function getFlags(task) { + if (isObject(task.flags)) { + return task.flags; + } + /* istanbul ignore else */ + if (typeof task.unwrap === 'function') { + var origFn = task.unwrap(); + if (isObject(origFn.flags)) { + return origFn.flags; + } + } + return undefined; +} + +module.exports = getTask; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/sync-task.js b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/sync-task.js new file mode 100644 index 0000000..08b78d4 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/sync-task.js @@ -0,0 +1,46 @@ +'use strict'; + +var log = require('gulplog'); +var ansi = require('../../../shared/ansi'); + +var tasks = {}; + +function warn() { + var taskKeys = Object.keys(tasks); + + if (!taskKeys.length) { + return; + } + + var taskNames = taskKeys.map(function(key) { + return tasks[key]; + }).join(', '); + + process.exitCode = 1; + + log.warn( + ansi.red('The following tasks did not complete:'), + ansi.cyan(taskNames) + ); + log.warn( + ansi.red('Did you forget to signal async completion?') + ); +} + +function start(e) { + tasks[e.uid] = e.name; +} + +function clear(e) { + delete tasks[e.uid]; +} + +function logSyncTask(gulpInst) { + + process.once('exit', warn); + gulpInst.on('start', start); + gulpInst.on('stop', clear); + gulpInst.on('error', clear); +} + +module.exports = logSyncTask; diff --git a/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/tasks-simple.js b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/tasks-simple.js new file mode 100644 index 0000000..65cde51 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/tasks-simple.js @@ -0,0 +1,7 @@ +'use strict'; + +function logTasksSimple(nodes) { + console.log(nodes.join('\n').trim()); +} + +module.exports = logTasksSimple; diff --git a/node_modules/gulp/node_modules/gulp-cli/package.json b/node_modules/gulp/node_modules/gulp-cli/package.json new file mode 100644 index 0000000..cc06e56 --- /dev/null +++ b/node_modules/gulp/node_modules/gulp-cli/package.json @@ -0,0 +1,113 @@ +{ + "_from": "gulp-cli@^2.2.0", + "_id": "gulp-cli@2.2.0", + "_inBundle": false, + "_integrity": "sha512-rGs3bVYHdyJpLqR0TUBnlcZ1O5O++Zs4bA0ajm+zr3WFCfiSLjGwoCBqFs18wzN+ZxahT9DkOK5nDf26iDsWjA==", + "_location": "/gulp/gulp-cli", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "gulp-cli@^2.2.0", + "name": "gulp-cli", + "escapedName": "gulp-cli", + "rawSpec": "^2.2.0", + "saveSpec": null, + "fetchSpec": "^2.2.0" + }, + "_requiredBy": [ + "/gulp" + ], + "_resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.2.0.tgz", + "_shasum": "5533126eeb7fe415a7e3e84a297d334d5cf70ebc", + "_spec": "gulp-cli@^2.2.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp", + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "http://gulpjs.com/" + }, + "bin": { + "gulp": "bin/gulp.js" + }, + "bugs": { + "url": "https://github.com/gulpjs/gulp-cli/issues" + }, + "bundleDependencies": false, + "contributors": [], + "dependencies": { + "ansi-colors": "^1.0.1", + "archy": "^1.0.0", + "array-sort": "^1.0.0", + "color-support": "^1.1.3", + "concat-stream": "^1.6.0", + "copy-props": "^2.0.1", + "fancy-log": "^1.3.2", + "gulplog": "^1.0.0", + "interpret": "^1.1.0", + "isobject": "^3.0.1", + "liftoff": "^3.1.0", + "matchdep": "^2.0.0", + "mute-stdout": "^1.0.0", + "pretty-hrtime": "^1.0.0", + "replace-homedir": "^1.0.0", + "semver-greatest-satisfied-range": "^1.1.0", + "v8flags": "^3.0.1", + "yargs": "^7.1.0" + }, + "deprecated": false, + "description": "Command line interface for gulp", + "devDependencies": { + "babel-preset-es2015": "^6.5.0", + "babel-register": "^6.5.1", + "coveralls": "^3.0.3", + "eslint": "^2.13.1", + "eslint-config-gulp": "^3.0.1", + "expect": "^1.20.2", + "gulp": "^4.0.0", + "gulp-test-tools": "^0.6.1", + "marked-man": "^0.2.1", + "mocha": "^3.2.0", + "nyc": "^13.3.0", + "rimraf": "^2.6.1" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "index.js", + "lib", + "bin", + "completion", + "gulp.1" + ], + "homepage": "http://gulpjs.com", + "keywords": [ + "build", + "stream", + "system", + "make", + "tool", + "asset", + "pipeline" + ], + "license": "MIT", + "main": "index.js", + "man": [ + "gulp.1" + ], + "name": "gulp-cli", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/gulp-cli.git" + }, + "scripts": { + "cover": "nyc --reporter=lcov --reporter=text-summary npm test", + "coveralls": "nyc --reporter=text-lcov npm test | coveralls", + "lint": "eslint .", + "prepublish": "marked-man --name gulp docs/CLI.md > gulp.1", + "pretest": "npm run lint", + "test": "mocha --async-only --timeout 5000 test/lib test" + }, + "version": "2.2.0" +} diff --git a/node_modules/gulp/node_modules/invert-kv/index.js b/node_modules/gulp/node_modules/invert-kv/index.js new file mode 100644 index 0000000..61e2196 --- /dev/null +++ b/node_modules/gulp/node_modules/invert-kv/index.js @@ -0,0 +1,15 @@ +'use strict'; +module.exports = function (obj) { + if (typeof obj !== 'object') { + throw new TypeError('Expected an object'); + } + + var ret = {}; + + for (var key in obj) { + var val = obj[key]; + ret[val] = key; + } + + return ret; +}; diff --git a/node_modules/gulp/node_modules/invert-kv/package.json b/node_modules/gulp/node_modules/invert-kv/package.json new file mode 100644 index 0000000..f9cec5b --- /dev/null +++ b/node_modules/gulp/node_modules/invert-kv/package.json @@ -0,0 +1,65 @@ +{ + "_from": "invert-kv@^1.0.0", + "_id": "invert-kv@1.0.0", + "_inBundle": false, + "_integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "_location": "/gulp/invert-kv", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "invert-kv@^1.0.0", + "name": "invert-kv", + "escapedName": "invert-kv", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/gulp/lcid" + ], + "_resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "_shasum": "104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6", + "_spec": "invert-kv@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/lcid", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/invert-kv/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Invert the key/value of an object. Example: {foo: 'bar'} → {bar: 'foo'}", + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/invert-kv#readme", + "keywords": [ + "object", + "obj", + "key", + "value", + "val", + "kv", + "invert" + ], + "license": "MIT", + "name": "invert-kv", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/invert-kv.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.0.0" +} diff --git a/node_modules/gulp/node_modules/invert-kv/readme.md b/node_modules/gulp/node_modules/invert-kv/readme.md new file mode 100644 index 0000000..039fc7c --- /dev/null +++ b/node_modules/gulp/node_modules/invert-kv/readme.md @@ -0,0 +1,25 @@ +# invert-kv [![Build Status](https://travis-ci.org/sindresorhus/invert-kv.svg?branch=master)](https://travis-ci.org/sindresorhus/invert-kv) + +> Invert the key/value of an object. Example: `{foo: 'bar'}` → `{bar: 'foo'}` + + +## Install + +```sh +$ npm install --save invert-kv +``` + + +## Usage + +```js +var invertKv = require('invert-kv'); + +invertKv({foo: 'bar', unicorn: 'rainbow'}); +//=> {bar: 'foo', rainbow: 'unicorn'} +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/is-fullwidth-code-point/index.js b/node_modules/gulp/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 0000000..a7d3e38 --- /dev/null +++ b/node_modules/gulp/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,46 @@ +'use strict'; +var numberIsNan = require('number-is-nan'); + +module.exports = function (x) { + if (numberIsNan(x)) { + return false; + } + + // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369 + + // code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if (x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + 0x2329 === x || // LEFT-POINTING ANGLE BRACKET + 0x232a === x || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + 0x3250 <= x && x <= 0x4dbf || + // CJK Unified Ideographs .. Yi Radicals + 0x4e00 <= x && x <= 0xa4c6 || + // Hangul Jamo Extended-A + 0xa960 <= x && x <= 0xa97c || + // Hangul Syllables + 0xac00 <= x && x <= 0xd7a3 || + // CJK Compatibility Ideographs + 0xf900 <= x && x <= 0xfaff || + // Vertical Forms + 0xfe10 <= x && x <= 0xfe19 || + // CJK Compatibility Forms .. Small Form Variants + 0xfe30 <= x && x <= 0xfe6b || + // Halfwidth and Fullwidth Forms + 0xff01 <= x && x <= 0xff60 || + 0xffe0 <= x && x <= 0xffe6 || + // Kana Supplement + 0x1b000 <= x && x <= 0x1b001 || + // Enclosed Ideographic Supplement + 0x1f200 <= x && x <= 0x1f251 || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + 0x20000 <= x && x <= 0x3fffd)) { + return true; + } + + return false; +} diff --git a/node_modules/gulp/node_modules/is-fullwidth-code-point/license b/node_modules/gulp/node_modules/is-fullwidth-code-point/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/gulp/node_modules/is-fullwidth-code-point/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/gulp/node_modules/is-fullwidth-code-point/package.json b/node_modules/gulp/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 0000000..48cc1d1 --- /dev/null +++ b/node_modules/gulp/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,77 @@ +{ + "_from": "is-fullwidth-code-point@^1.0.0", + "_id": "is-fullwidth-code-point@1.0.0", + "_inBundle": false, + "_integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "_location": "/gulp/is-fullwidth-code-point", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-fullwidth-code-point@^1.0.0", + "name": "is-fullwidth-code-point", + "escapedName": "is-fullwidth-code-point", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/gulp/string-width" + ], + "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "_shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", + "_spec": "is-fullwidth-code-point@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" + }, + "bundleDependencies": false, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "deprecated": false, + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "devDependencies": { + "ava": "0.0.4", + "code-point-at": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "char", + "string", + "str", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "license": "MIT", + "name": "is-fullwidth-code-point", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/node_modules/gulp/node_modules/is-fullwidth-code-point/readme.md b/node_modules/gulp/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 0000000..4936464 --- /dev/null +++ b/node_modules/gulp/node_modules/is-fullwidth-code-point/readme.md @@ -0,0 +1,39 @@ +# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) + +> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) + + +## Install + +``` +$ npm install --save is-fullwidth-code-point +``` + + +## Usage + +```js +var isFullwidthCodePoint = require('is-fullwidth-code-point'); + +isFullwidthCodePoint('谢'.codePointAt()); +//=> true + +isFullwidthCodePoint('a'.codePointAt()); +//=> false +``` + + +## API + +### isFullwidthCodePoint(input) + +#### input + +Type: `number` + +[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/lcid/index.js b/node_modules/gulp/node_modules/lcid/index.js new file mode 100644 index 0000000..69bd3d2 --- /dev/null +++ b/node_modules/gulp/node_modules/lcid/index.js @@ -0,0 +1,22 @@ +'use strict'; +var invertKv = require('invert-kv'); +var all = require('./lcid.json'); +var inverted = invertKv(all); + +exports.from = function (lcidCode) { + if (typeof lcidCode !== 'number') { + throw new TypeError('Expected a number'); + } + + return inverted[lcidCode]; +}; + +exports.to = function (localeId) { + if (typeof localeId !== 'string') { + throw new TypeError('Expected a string'); + } + + return all[localeId]; +}; + +exports.all = all; diff --git a/node_modules/gulp/node_modules/lcid/lcid.json b/node_modules/gulp/node_modules/lcid/lcid.json new file mode 100644 index 0000000..9c89f6a --- /dev/null +++ b/node_modules/gulp/node_modules/lcid/lcid.json @@ -0,0 +1,203 @@ +{ + "af_ZA": 1078, + "am_ET": 1118, + "ar_AE": 14337, + "ar_BH": 15361, + "ar_DZ": 5121, + "ar_EG": 3073, + "ar_IQ": 2049, + "ar_JO": 11265, + "ar_KW": 13313, + "ar_LB": 12289, + "ar_LY": 4097, + "ar_MA": 6145, + "ar_OM": 8193, + "ar_QA": 16385, + "ar_SA": 1025, + "ar_SY": 10241, + "ar_TN": 7169, + "ar_YE": 9217, + "arn_CL": 1146, + "as_IN": 1101, + "az_AZ": 2092, + "ba_RU": 1133, + "be_BY": 1059, + "bg_BG": 1026, + "bn_IN": 1093, + "bo_BT": 2129, + "bo_CN": 1105, + "br_FR": 1150, + "bs_BA": 8218, + "ca_ES": 1027, + "co_FR": 1155, + "cs_CZ": 1029, + "cy_GB": 1106, + "da_DK": 1030, + "de_AT": 3079, + "de_CH": 2055, + "de_DE": 1031, + "de_LI": 5127, + "de_LU": 4103, + "div_MV": 1125, + "dsb_DE": 2094, + "el_GR": 1032, + "en_AU": 3081, + "en_BZ": 10249, + "en_CA": 4105, + "en_CB": 9225, + "en_GB": 2057, + "en_IE": 6153, + "en_IN": 18441, + "en_JA": 8201, + "en_MY": 17417, + "en_NZ": 5129, + "en_PH": 13321, + "en_TT": 11273, + "en_US": 1033, + "en_ZA": 7177, + "en_ZW": 12297, + "es_AR": 11274, + "es_BO": 16394, + "es_CL": 13322, + "es_CO": 9226, + "es_CR": 5130, + "es_DO": 7178, + "es_EC": 12298, + "es_ES": 3082, + "es_GT": 4106, + "es_HN": 18442, + "es_MX": 2058, + "es_NI": 19466, + "es_PA": 6154, + "es_PE": 10250, + "es_PR": 20490, + "es_PY": 15370, + "es_SV": 17418, + "es_UR": 14346, + "es_US": 21514, + "es_VE": 8202, + "et_EE": 1061, + "eu_ES": 1069, + "fa_IR": 1065, + "fi_FI": 1035, + "fil_PH": 1124, + "fo_FO": 1080, + "fr_BE": 2060, + "fr_CA": 3084, + "fr_CH": 4108, + "fr_FR": 1036, + "fr_LU": 5132, + "fr_MC": 6156, + "fy_NL": 1122, + "ga_IE": 2108, + "gbz_AF": 1164, + "gl_ES": 1110, + "gsw_FR": 1156, + "gu_IN": 1095, + "ha_NG": 1128, + "he_IL": 1037, + "hi_IN": 1081, + "hr_BA": 4122, + "hr_HR": 1050, + "hu_HU": 1038, + "hy_AM": 1067, + "id_ID": 1057, + "ii_CN": 1144, + "is_IS": 1039, + "it_CH": 2064, + "it_IT": 1040, + "iu_CA": 2141, + "ja_JP": 1041, + "ka_GE": 1079, + "kh_KH": 1107, + "kk_KZ": 1087, + "kl_GL": 1135, + "kn_IN": 1099, + "ko_KR": 1042, + "kok_IN": 1111, + "ky_KG": 1088, + "lb_LU": 1134, + "lo_LA": 1108, + "lt_LT": 1063, + "lv_LV": 1062, + "mi_NZ": 1153, + "mk_MK": 1071, + "ml_IN": 1100, + "mn_CN": 2128, + "mn_MN": 1104, + "moh_CA": 1148, + "mr_IN": 1102, + "ms_BN": 2110, + "ms_MY": 1086, + "mt_MT": 1082, + "my_MM": 1109, + "nb_NO": 1044, + "ne_NP": 1121, + "nl_BE": 2067, + "nl_NL": 1043, + "nn_NO": 2068, + "ns_ZA": 1132, + "oc_FR": 1154, + "or_IN": 1096, + "pa_IN": 1094, + "pl_PL": 1045, + "ps_AF": 1123, + "pt_BR": 1046, + "pt_PT": 2070, + "qut_GT": 1158, + "quz_BO": 1131, + "quz_EC": 2155, + "quz_PE": 3179, + "rm_CH": 1047, + "ro_RO": 1048, + "ru_RU": 1049, + "rw_RW": 1159, + "sa_IN": 1103, + "sah_RU": 1157, + "se_FI": 3131, + "se_NO": 1083, + "se_SE": 2107, + "si_LK": 1115, + "sk_SK": 1051, + "sl_SI": 1060, + "sma_NO": 6203, + "sma_SE": 7227, + "smj_NO": 4155, + "smj_SE": 5179, + "smn_FI": 9275, + "sms_FI": 8251, + "sq_AL": 1052, + "sr_BA": 7194, + "sr_SP": 3098, + "sv_FI": 2077, + "sv_SE": 1053, + "sw_KE": 1089, + "syr_SY": 1114, + "ta_IN": 1097, + "te_IN": 1098, + "tg_TJ": 1064, + "th_TH": 1054, + "tk_TM": 1090, + "tmz_DZ": 2143, + "tn_ZA": 1074, + "tr_TR": 1055, + "tt_RU": 1092, + "ug_CN": 1152, + "uk_UA": 1058, + "ur_IN": 2080, + "ur_PK": 1056, + "uz_UZ": 2115, + "vi_VN": 1066, + "wen_DE": 1070, + "wo_SN": 1160, + "xh_ZA": 1076, + "yo_NG": 1130, + "zh_CHS": 4, + "zh_CHT": 31748, + "zh_CN": 2052, + "zh_HK": 3076, + "zh_MO": 5124, + "zh_SG": 4100, + "zh_TW": 1028, + "zu_ZA": 1077 +} diff --git a/node_modules/gulp/node_modules/lcid/license b/node_modules/gulp/node_modules/lcid/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/gulp/node_modules/lcid/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/gulp/node_modules/lcid/package.json b/node_modules/gulp/node_modules/lcid/package.json new file mode 100644 index 0000000..76a60e0 --- /dev/null +++ b/node_modules/gulp/node_modules/lcid/package.json @@ -0,0 +1,78 @@ +{ + "_from": "lcid@^1.0.0", + "_id": "lcid@1.0.0", + "_inBundle": false, + "_integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "_location": "/gulp/lcid", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lcid@^1.0.0", + "name": "lcid", + "escapedName": "lcid", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/gulp/os-locale" + ], + "_resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "_shasum": "308accafa0bc483a3867b4b6f2b9506251d1b835", + "_spec": "lcid@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/os-locale", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/lcid/issues" + }, + "bundleDependencies": false, + "dependencies": { + "invert-kv": "^1.0.0" + }, + "deprecated": false, + "description": "Mapping between standard locale identifiers and Windows locale identifiers (LCID)", + "devDependencies": { + "ava": "0.0.4" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "lcid.json" + ], + "homepage": "https://github.com/sindresorhus/lcid#readme", + "keywords": [ + "lcid", + "locale", + "string", + "str", + "id", + "identifier", + "windows", + "language", + "lang", + "map", + "mapping", + "convert", + "json", + "bcp47", + "ietf", + "tag" + ], + "license": "MIT", + "name": "lcid", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/lcid.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/node_modules/gulp/node_modules/lcid/readme.md b/node_modules/gulp/node_modules/lcid/readme.md new file mode 100644 index 0000000..bee4a70 --- /dev/null +++ b/node_modules/gulp/node_modules/lcid/readme.md @@ -0,0 +1,35 @@ +# lcid [![Build Status](https://travis-ci.org/sindresorhus/lcid.svg?branch=master)](https://travis-ci.org/sindresorhus/lcid) + +> Mapping between [standard locale identifiers](http://en.wikipedia.org/wiki/Locale) and [Windows locale identifiers (LCID)](http://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms) + +Based on the [mapping](https://github.com/python/cpython/blob/be2a1a76fa43bb1ea1b3577bb5bdd506a2e90e37/Lib/locale.py#L1395-L1604) used in the Python standard library. + +The mapping itself is just a [JSON file](lcid.json) and can be used wherever. + + +## Install + +``` +$ npm install --save lcid +``` + + +## Usage + +```js +var lcid = require('lcid'); + +lcid.from(1044); +//=> 'nb_NO' + +lcid.to('nb_NO'); +//=> 1044 + +lcid.all; +//=> {'af_ZA': 1078, ...} +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/os-locale/index.js b/node_modules/gulp/node_modules/os-locale/index.js new file mode 100644 index 0000000..2c8a006 --- /dev/null +++ b/node_modules/gulp/node_modules/os-locale/index.js @@ -0,0 +1,127 @@ +'use strict'; +var childProcess = require('child_process'); +var execFileSync = childProcess.execFileSync; +var lcid = require('lcid'); +var defaultOpts = {spawn: true}; +var cache; + +function fallback() { + cache = 'en_US'; + return cache; +} + +function getEnvLocale(env) { + env = env || process.env; + var ret = env.LC_ALL || env.LC_MESSAGES || env.LANG || env.LANGUAGE; + cache = getLocale(ret); + return ret; +} + +function parseLocale(x) { + var env = x.split('\n').reduce(function (env, def) { + def = def.split('='); + env[def[0]] = def[1]; + return env; + }, {}); + return getEnvLocale(env); +} + +function getLocale(str) { + return (str && str.replace(/[.:].*/, '')) || fallback(); +} + +module.exports = function (opts, cb) { + if (typeof opts === 'function') { + cb = opts; + opts = defaultOpts; + } else { + opts = opts || defaultOpts; + } + + if (cache || getEnvLocale() || opts.spawn === false) { + setImmediate(cb, null, cache); + return; + } + + var getAppleLocale = function () { + childProcess.execFile('defaults', ['read', '-g', 'AppleLocale'], function (err, stdout) { + if (err) { + fallback(); + return; + } + + cache = stdout.trim() || fallback(); + cb(null, cache); + }); + }; + + if (process.platform === 'win32') { + childProcess.execFile('wmic', ['os', 'get', 'locale'], function (err, stdout) { + if (err) { + fallback(); + return; + } + + var lcidCode = parseInt(stdout.replace('Locale', ''), 16); + cache = lcid.from(lcidCode) || fallback(); + cb(null, cache); + }); + } else { + childProcess.execFile('locale', function (err, stdout) { + if (err) { + fallback(); + return; + } + + var res = parseLocale(stdout); + + if (!res && process.platform === 'darwin') { + getAppleLocale(); + return; + } + + cache = getLocale(res); + cb(null, cache); + }); + } +}; + +module.exports.sync = function (opts) { + opts = opts || defaultOpts; + + if (cache || getEnvLocale() || !execFileSync || opts.spawn === false) { + return cache; + } + + if (process.platform === 'win32') { + var stdout; + + try { + stdout = execFileSync('wmic', ['os', 'get', 'locale'], {encoding: 'utf8'}); + } catch (err) { + return fallback(); + } + + var lcidCode = parseInt(stdout.replace('Locale', ''), 16); + cache = lcid.from(lcidCode) || fallback(); + return cache; + } + + var res; + + try { + res = parseLocale(execFileSync('locale', {encoding: 'utf8'})); + } catch (err) {} + + if (!res && process.platform === 'darwin') { + try { + cache = execFileSync('defaults', ['read', '-g', 'AppleLocale'], {encoding: 'utf8'}).trim() || fallback(); + return cache; + } catch (err) { + return fallback(); + } + } + + cache = getLocale(res); + return cache; +}; diff --git a/node_modules/gulp/node_modules/os-locale/license b/node_modules/gulp/node_modules/os-locale/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/gulp/node_modules/os-locale/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/gulp/node_modules/os-locale/package.json b/node_modules/gulp/node_modules/os-locale/package.json new file mode 100644 index 0000000..0ca800c --- /dev/null +++ b/node_modules/gulp/node_modules/os-locale/package.json @@ -0,0 +1,75 @@ +{ + "_from": "os-locale@^1.4.0", + "_id": "os-locale@1.4.0", + "_inBundle": false, + "_integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "_location": "/gulp/os-locale", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "os-locale@^1.4.0", + "name": "os-locale", + "escapedName": "os-locale", + "rawSpec": "^1.4.0", + "saveSpec": null, + "fetchSpec": "^1.4.0" + }, + "_requiredBy": [ + "/gulp/yargs" + ], + "_resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "_shasum": "20f9f17ae29ed345e8bde583b13d2009803c14d9", + "_spec": "os-locale@^1.4.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/yargs", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/os-locale/issues" + }, + "bundleDependencies": false, + "dependencies": { + "lcid": "^1.0.0" + }, + "deprecated": false, + "description": "Get the system locale", + "devDependencies": { + "ava": "*", + "require-uncached": "^1.0.2", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/os-locale#readme", + "keywords": [ + "locale", + "lang", + "language", + "system", + "os", + "string", + "str", + "user", + "country", + "id", + "identifier", + "region" + ], + "license": "MIT", + "name": "os-locale", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/os-locale.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.4.0" +} diff --git a/node_modules/gulp/node_modules/os-locale/readme.md b/node_modules/gulp/node_modules/os-locale/readme.md new file mode 100644 index 0000000..b80a0bd --- /dev/null +++ b/node_modules/gulp/node_modules/os-locale/readme.md @@ -0,0 +1,47 @@ +# os-locale [![Build Status](https://travis-ci.org/sindresorhus/os-locale.svg?branch=master)](https://travis-ci.org/sindresorhus/os-locale) + +> Get the system [locale](http://en.wikipedia.org/wiki/Locale) + +Useful for localizing your module or app. + +POSIX systems: The returned locale refers to the [`LC_MESSAGE`](http://www.gnu.org/software/libc/manual/html_node/Locale-Categories.html#Locale-Categories) category, suitable for selecting the language used in the user interface for message translation. + + +## Install + +``` +$ npm install --save os-locale +``` + + +## Usage + +```js +var osLocale = require('os-locale'); + +osLocale(function (err, locale) { + console.log(locale); + //=> 'en_US' +}); +``` + + +## API + +### osLocale([options], callback(error, locale)) + +### osLocale.sync([options]) + +Returns the locale. + +#### options.spawn + +Type: `boolean` +Default: `true` + +Set to `false` to avoid spawning subprocesses and instead only resolve the locale from environment variables. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/require-main-filename/.npmignore b/node_modules/gulp/node_modules/require-main-filename/.npmignore new file mode 100644 index 0000000..6f9fe6b --- /dev/null +++ b/node_modules/gulp/node_modules/require-main-filename/.npmignore @@ -0,0 +1,3 @@ +node_modules +.DS_Store +.nyc_output diff --git a/node_modules/gulp/node_modules/require-main-filename/.travis.yml b/node_modules/gulp/node_modules/require-main-filename/.travis.yml new file mode 100644 index 0000000..ab61ce7 --- /dev/null +++ b/node_modules/gulp/node_modules/require-main-filename/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +os: + - linux +node_js: + - "0.10" + - "0.12" + - "4.1" + - "node" diff --git a/node_modules/gulp/node_modules/require-main-filename/LICENSE.txt b/node_modules/gulp/node_modules/require-main-filename/LICENSE.txt new file mode 100644 index 0000000..836440b --- /dev/null +++ b/node_modules/gulp/node_modules/require-main-filename/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2016, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/gulp/node_modules/require-main-filename/README.md b/node_modules/gulp/node_modules/require-main-filename/README.md new file mode 100644 index 0000000..820d9f5 --- /dev/null +++ b/node_modules/gulp/node_modules/require-main-filename/README.md @@ -0,0 +1,26 @@ +# require-main-filename + +[![Build Status](https://travis-ci.org/yargs/require-main-filename.png)](https://travis-ci.org/yargs/require-main-filename) +[![Coverage Status](https://coveralls.io/repos/yargs/require-main-filename/badge.svg?branch=master)](https://coveralls.io/r/yargs/require-main-filename?branch=master) +[![NPM version](https://img.shields.io/npm/v/require-main-filename.svg)](https://www.npmjs.com/package/require-main-filename) + +`require.main.filename` is great for figuring out the entry +point for the current application. This can be combined with a module like +[pkg-conf](https://www.npmjs.com/package/pkg-conf) to, _as if by magic_, load +top-level configuration. + +Unfortunately, `require.main.filename` sometimes fails when an application is +executed with an alternative process manager, e.g., [iisnode](https://github.com/tjanczuk/iisnode). + +`require-main-filename` is a shim that addresses this problem. + +## Usage + +```js +var main = require('require-main-filename')() +// use main as an alternative to require.main.filename. +``` + +## License + +ISC diff --git a/node_modules/gulp/node_modules/require-main-filename/index.js b/node_modules/gulp/node_modules/require-main-filename/index.js new file mode 100644 index 0000000..dca7f0c --- /dev/null +++ b/node_modules/gulp/node_modules/require-main-filename/index.js @@ -0,0 +1,18 @@ +module.exports = function (_require) { + _require = _require || require + var main = _require.main + if (main && isIISNode(main)) return handleIISNode(main) + else return main ? main.filename : process.cwd() +} + +function isIISNode (main) { + return /\\iisnode\\/.test(main.filename) +} + +function handleIISNode (main) { + if (!main.children.length) { + return main.filename + } else { + return main.children[0].filename + } +} diff --git a/node_modules/gulp/node_modules/require-main-filename/package.json b/node_modules/gulp/node_modules/require-main-filename/package.json new file mode 100644 index 0000000..19233a7 --- /dev/null +++ b/node_modules/gulp/node_modules/require-main-filename/package.json @@ -0,0 +1,58 @@ +{ + "_from": "require-main-filename@^1.0.1", + "_id": "require-main-filename@1.0.1", + "_inBundle": false, + "_integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "_location": "/gulp/require-main-filename", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "require-main-filename@^1.0.1", + "name": "require-main-filename", + "escapedName": "require-main-filename", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/gulp/yargs" + ], + "_resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "_shasum": "97f717b69d48784f5f526a6c5aa8ffdda055a4d1", + "_spec": "require-main-filename@^1.0.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/yargs", + "author": { + "name": "Ben Coe", + "email": "ben@npmjs.com" + }, + "bugs": { + "url": "https://github.com/yargs/require-main-filename/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "shim for require.main.filename() that works in as many environments as possible", + "devDependencies": { + "chai": "^3.5.0", + "standard": "^6.0.5", + "tap": "^5.2.0" + }, + "homepage": "https://github.com/yargs/require-main-filename#readme", + "keywords": [ + "require", + "shim", + "iisnode" + ], + "license": "ISC", + "main": "index.js", + "name": "require-main-filename", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/yargs/require-main-filename.git" + }, + "scripts": { + "pretest": "standard", + "test": "tap --coverage test.js" + }, + "version": "1.0.1" +} diff --git a/node_modules/gulp/node_modules/require-main-filename/test.js b/node_modules/gulp/node_modules/require-main-filename/test.js new file mode 100644 index 0000000..d89e7dc --- /dev/null +++ b/node_modules/gulp/node_modules/require-main-filename/test.js @@ -0,0 +1,36 @@ +/* global describe, it */ + +var requireMainFilename = require('./') + +require('tap').mochaGlobals() +require('chai').should() + +describe('require-main-filename', function () { + it('returns require.main.filename in normal circumstances', function () { + requireMainFilename().should.match(/test\.js/) + }) + + it('should use children[0].filename when running on iisnode', function () { + var main = { + filename: 'D:\\Program Files (x86)\\iisnode\\interceptor.js', + children: [ {filename: 'D:\\home\\site\\wwwroot\\server.js'} ] + } + requireMainFilename({ + main: main + }).should.match(/server\.js/) + }) + + it('should not use children[0] if no children exist', function () { + var main = { + filename: 'D:\\Program Files (x86)\\iisnode\\interceptor.js', + children: [] + } + requireMainFilename({ + main: main + }).should.match(/interceptor\.js/) + }) + + it('should default to process.cwd() if require.main is undefined', function () { + requireMainFilename({}).should.match(/require-main-filename/) + }) +}) diff --git a/node_modules/gulp/node_modules/string-width/index.js b/node_modules/gulp/node_modules/string-width/index.js new file mode 100644 index 0000000..b9bec62 --- /dev/null +++ b/node_modules/gulp/node_modules/string-width/index.js @@ -0,0 +1,37 @@ +'use strict'; +var stripAnsi = require('strip-ansi'); +var codePointAt = require('code-point-at'); +var isFullwidthCodePoint = require('is-fullwidth-code-point'); + +// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345 +module.exports = function (str) { + if (typeof str !== 'string' || str.length === 0) { + return 0; + } + + var width = 0; + + str = stripAnsi(str); + + for (var i = 0; i < str.length; i++) { + var code = codePointAt(str, i); + + // ignore control characters + if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) { + continue; + } + + // surrogates + if (code >= 0x10000) { + i++; + } + + if (isFullwidthCodePoint(code)) { + width += 2; + } else { + width++; + } + } + + return width; +}; diff --git a/node_modules/gulp/node_modules/string-width/license b/node_modules/gulp/node_modules/string-width/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/gulp/node_modules/string-width/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/gulp/node_modules/string-width/package.json b/node_modules/gulp/node_modules/string-width/package.json new file mode 100644 index 0000000..5a2a0be --- /dev/null +++ b/node_modules/gulp/node_modules/string-width/package.json @@ -0,0 +1,90 @@ +{ + "_from": "string-width@^1.0.2", + "_id": "string-width@1.0.2", + "_inBundle": false, + "_integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "_location": "/gulp/string-width", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "string-width@^1.0.2", + "name": "string-width", + "escapedName": "string-width", + "rawSpec": "^1.0.2", + "saveSpec": null, + "fetchSpec": "^1.0.2" + }, + "_requiredBy": [ + "/gulp/cliui", + "/gulp/wrap-ansi", + "/gulp/yargs" + ], + "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "_shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", + "_spec": "string-width@^1.0.2", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/yargs", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/string-width/issues" + }, + "bundleDependencies": false, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "deprecated": false, + "description": "Get the visual width of a string - the number of columns required to display it", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/string-width#readme", + "keywords": [ + "string", + "str", + "character", + "char", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "license": "MIT", + "name": "string-width", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/string-width.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.2" +} diff --git a/node_modules/gulp/node_modules/string-width/readme.md b/node_modules/gulp/node_modules/string-width/readme.md new file mode 100644 index 0000000..1ab42c9 --- /dev/null +++ b/node_modules/gulp/node_modules/string-width/readme.md @@ -0,0 +1,42 @@ +# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) + +> Get the visual width of a string - the number of columns required to display it + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + +Useful to be able to measure the actual width of command-line output. + + +## Install + +``` +$ npm install --save string-width +``` + + +## Usage + +```js +const stringWidth = require('string-width'); + +stringWidth('古'); +//=> 2 + +stringWidth('\u001b[1m古\u001b[22m'); +//=> 2 + +stringWidth('a'); +//=> 1 +``` + + +## Related + +- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module +- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string +- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/strip-ansi/index.js b/node_modules/gulp/node_modules/strip-ansi/index.js new file mode 100644 index 0000000..099480f --- /dev/null +++ b/node_modules/gulp/node_modules/strip-ansi/index.js @@ -0,0 +1,6 @@ +'use strict'; +var ansiRegex = require('ansi-regex')(); + +module.exports = function (str) { + return typeof str === 'string' ? str.replace(ansiRegex, '') : str; +}; diff --git a/node_modules/gulp/node_modules/strip-ansi/license b/node_modules/gulp/node_modules/strip-ansi/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/gulp/node_modules/strip-ansi/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/gulp/node_modules/strip-ansi/package.json b/node_modules/gulp/node_modules/strip-ansi/package.json new file mode 100644 index 0000000..d3fe8e6 --- /dev/null +++ b/node_modules/gulp/node_modules/strip-ansi/package.json @@ -0,0 +1,103 @@ +{ + "_from": "strip-ansi@^3.0.1", + "_id": "strip-ansi@3.0.1", + "_inBundle": false, + "_integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "_location": "/gulp/strip-ansi", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "strip-ansi@^3.0.1", + "name": "strip-ansi", + "escapedName": "strip-ansi", + "rawSpec": "^3.0.1", + "saveSpec": null, + "fetchSpec": "^3.0.1" + }, + "_requiredBy": [ + "/gulp/cliui", + "/gulp/string-width", + "/gulp/wrap-ansi" + ], + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "_shasum": "6a385fb8853d952d5ff05d0e8aaf94278dc63dcf", + "_spec": "strip-ansi@^3.0.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/cliui", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/strip-ansi/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "deprecated": false, + "description": "Strip ANSI escape codes", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/strip-ansi#readme", + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Boy Nicolai Appelman", + "email": "joshua@jbna.nl", + "url": "jbna.nl" + }, + { + "name": "JD Ballard", + "email": "i.am.qix@gmail.com", + "url": "github.com/qix-" + } + ], + "name": "strip-ansi", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/strip-ansi.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.1" +} diff --git a/node_modules/gulp/node_modules/strip-ansi/readme.md b/node_modules/gulp/node_modules/strip-ansi/readme.md new file mode 100644 index 0000000..cb7d9ff --- /dev/null +++ b/node_modules/gulp/node_modules/strip-ansi/readme.md @@ -0,0 +1,33 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save strip-ansi +``` + + +## Usage + +```js +var stripAnsi = require('strip-ansi'); + +stripAnsi('\u001b[4mcake\u001b[0m'); +//=> 'cake' +``` + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/which-module/CHANGELOG.md b/node_modules/gulp/node_modules/which-module/CHANGELOG.md new file mode 100644 index 0000000..6c8f5f2 --- /dev/null +++ b/node_modules/gulp/node_modules/which-module/CHANGELOG.md @@ -0,0 +1,11 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# 1.0.0 (2016-06-06) + + +### Features + +* initial code ([08074cd](https://github.com/nexdrew/which-module/commit/08074cd)) diff --git a/node_modules/gulp/node_modules/which-module/LICENSE b/node_modules/gulp/node_modules/which-module/LICENSE new file mode 100644 index 0000000..ab601b6 --- /dev/null +++ b/node_modules/gulp/node_modules/which-module/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2016, Contributors + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/node_modules/gulp/node_modules/which-module/README.md b/node_modules/gulp/node_modules/which-module/README.md new file mode 100644 index 0000000..a8c4bf8 --- /dev/null +++ b/node_modules/gulp/node_modules/which-module/README.md @@ -0,0 +1,55 @@ +# which-module + +> Find the module object for something that was require()d + +[![Build Status](https://travis-ci.org/nexdrew/which-module.svg?branch=master)](https://travis-ci.org/nexdrew/which-module) +[![Coverage Status](https://coveralls.io/repos/github/nexdrew/which-module/badge.svg?branch=master)](https://coveralls.io/github/nexdrew/which-module?branch=master) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +Find the `module` object in `require.cache` for something that was `require()`d +or `import`ed - essentially a reverse `require()` lookup. + +Useful for libs that want to e.g. lookup a filename for a module or submodule +that it did not `require()` itself. + +## Install and Usage + +``` +npm install --save which-module +``` + +```js +const whichModule = require('which-module') + +console.log(whichModule(require('something'))) +// Module { +// id: '/path/to/project/node_modules/something/index.js', +// exports: [Function], +// parent: ..., +// filename: '/path/to/project/node_modules/something/index.js', +// loaded: true, +// children: [], +// paths: [ '/path/to/project/node_modules/something/node_modules', +// '/path/to/project/node_modules', +// '/path/to/node_modules', +// '/path/node_modules', +// '/node_modules' ] } +``` + +## API + +### `whichModule(exported)` + +Return the [`module` object](https://nodejs.org/api/modules.html#modules_the_module_object), +if any, that represents the given argument in the `require.cache`. + +`exported` can be anything that was previously `require()`d or `import`ed as a +module, submodule, or dependency - which means `exported` is identical to the +`module.exports` returned by this method. + +If `exported` did not come from the `exports` of a `module` in `require.cache`, +then this method returns `null`. + +## License + +ISC © Contributors diff --git a/node_modules/gulp/node_modules/which-module/index.js b/node_modules/gulp/node_modules/which-module/index.js new file mode 100644 index 0000000..45559b7 --- /dev/null +++ b/node_modules/gulp/node_modules/which-module/index.js @@ -0,0 +1,9 @@ +'use strict' + +module.exports = function whichModule (exported) { + for (var i = 0, files = Object.keys(require.cache), mod; i < files.length; i++) { + mod = require.cache[files[i]] + if (mod.exports === exported) return mod + } + return null +} diff --git a/node_modules/gulp/node_modules/which-module/package.json b/node_modules/gulp/node_modules/which-module/package.json new file mode 100644 index 0000000..bb65c6d --- /dev/null +++ b/node_modules/gulp/node_modules/which-module/package.json @@ -0,0 +1,68 @@ +{ + "_from": "which-module@^1.0.0", + "_id": "which-module@1.0.0", + "_inBundle": false, + "_integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "_location": "/gulp/which-module", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "which-module@^1.0.0", + "name": "which-module", + "escapedName": "which-module", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/gulp/yargs" + ], + "_resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "_shasum": "bba63ca861948994ff307736089e3b96026c2a4f", + "_spec": "which-module@^1.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/yargs", + "author": { + "name": "nexdrew" + }, + "bugs": { + "url": "https://github.com/nexdrew/which-module/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Find the module object for something that was require()d", + "devDependencies": { + "ava": "^0.15.2", + "coveralls": "^2.11.9", + "nyc": "^6.4.4", + "standard": "^7.1.2", + "standard-version": "^2.3.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/nexdrew/which-module#readme", + "keywords": [ + "which", + "module", + "exports", + "filename", + "require", + "reverse", + "lookup" + ], + "license": "ISC", + "main": "index.js", + "name": "which-module", + "repository": { + "type": "git", + "url": "git+https://github.com/nexdrew/which-module.git" + }, + "scripts": { + "coverage": "nyc report --reporter=text-lcov | coveralls", + "pretest": "standard", + "release": "standard-version", + "test": "nyc ava" + }, + "version": "1.0.0" +} diff --git a/node_modules/gulp/node_modules/wrap-ansi/index.js b/node_modules/gulp/node_modules/wrap-ansi/index.js new file mode 100755 index 0000000..ff62543 --- /dev/null +++ b/node_modules/gulp/node_modules/wrap-ansi/index.js @@ -0,0 +1,168 @@ +'use strict'; +var stringWidth = require('string-width'); +var stripAnsi = require('strip-ansi'); + +var ESCAPES = [ + '\u001b', + '\u009b' +]; + +var END_CODE = 39; + +var ESCAPE_CODES = { + 0: 0, + 1: 22, + 2: 22, + 3: 23, + 4: 24, + 7: 27, + 8: 28, + 9: 29, + 30: 39, + 31: 39, + 32: 39, + 33: 39, + 34: 39, + 35: 39, + 36: 39, + 37: 39, + 90: 39, + 40: 49, + 41: 49, + 42: 49, + 43: 49, + 44: 49, + 45: 49, + 46: 49, + 47: 49 +}; + +function wrapAnsi(code) { + return ESCAPES[0] + '[' + code + 'm'; +} + +// calculate the length of words split on ' ', ignoring +// the extra characters added by ansi escape codes. +function wordLengths(str) { + return str.split(' ').map(function (s) { + return stringWidth(s); + }); +} + +// wrap a long word across multiple rows. +// ansi escape codes do not count towards length. +function wrapWord(rows, word, cols) { + var insideEscape = false; + var visible = stripAnsi(rows[rows.length - 1]).length; + + for (var i = 0; i < word.length; i++) { + var x = word[i]; + + rows[rows.length - 1] += x; + + if (ESCAPES.indexOf(x) !== -1) { + insideEscape = true; + } else if (insideEscape && x === 'm') { + insideEscape = false; + continue; + } + + if (insideEscape) { + continue; + } + + visible++; + + if (visible >= cols && i < word.length - 1) { + rows.push(''); + visible = 0; + } + } + + // it's possible that the last row we copy over is only + // ansi escape characters, handle this edge-case. + if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) { + rows[rows.length - 2] += rows.pop(); + } +} + +// the wrap-ansi module can be invoked +// in either 'hard' or 'soft' wrap mode. +// +// 'hard' will never allow a string to take up more +// than cols characters. +// +// 'soft' allows long words to expand past the column length. +function exec(str, cols, opts) { + var options = opts || {}; + + var pre = ''; + var ret = ''; + var escapeCode; + + var lengths = wordLengths(str); + var words = str.split(' '); + var rows = ['']; + + for (var i = 0, word; (word = words[i]) !== undefined; i++) { + var rowLength = stringWidth(rows[rows.length - 1]); + + if (rowLength) { + rows[rows.length - 1] += ' '; + rowLength++; + } + + // in 'hard' wrap mode, the length of a line is + // never allowed to extend past 'cols'. + if (lengths[i] > cols && options.hard) { + if (rowLength) { + rows.push(''); + } + wrapWord(rows, word, cols); + continue; + } + + if (rowLength + lengths[i] > cols && rowLength > 0) { + if (options.wordWrap === false && rowLength < cols) { + wrapWord(rows, word, cols); + continue; + } + + rows.push(''); + } + + rows[rows.length - 1] += word; + } + + pre = rows.map(function (r) { + return r.trim(); + }).join('\n'); + + for (var j = 0; j < pre.length; j++) { + var y = pre[j]; + + ret += y; + + if (ESCAPES.indexOf(y) !== -1) { + var code = parseFloat(/[0-9][^m]*/.exec(pre.slice(j, j + 4))); + escapeCode = code === END_CODE ? null : code; + } + + if (escapeCode && ESCAPE_CODES[escapeCode]) { + if (pre[j + 1] === '\n') { + ret += wrapAnsi(ESCAPE_CODES[escapeCode]); + } else if (y === '\n') { + ret += wrapAnsi(escapeCode); + } + } + } + + return ret; +} + +// for each line break, invoke the method separately. +module.exports = function (str, cols, opts) { + return String(str).split('\n').map(function (substr) { + return exec(substr, cols, opts); + }).join('\n'); +}; diff --git a/node_modules/gulp/node_modules/wrap-ansi/license b/node_modules/gulp/node_modules/wrap-ansi/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/gulp/node_modules/wrap-ansi/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/gulp/node_modules/wrap-ansi/package.json b/node_modules/gulp/node_modules/wrap-ansi/package.json new file mode 100644 index 0000000..427a65c --- /dev/null +++ b/node_modules/gulp/node_modules/wrap-ansi/package.json @@ -0,0 +1,116 @@ +{ + "_from": "wrap-ansi@^2.0.0", + "_id": "wrap-ansi@2.1.0", + "_inBundle": false, + "_integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "_location": "/gulp/wrap-ansi", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "wrap-ansi@^2.0.0", + "name": "wrap-ansi", + "escapedName": "wrap-ansi", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/gulp/cliui" + ], + "_resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "_shasum": "d8fc3d284dd05794fe84973caecdd1cf824fdd85", + "_spec": "wrap-ansi@^2.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/cliui", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/wrap-ansi/issues" + }, + "bundleDependencies": false, + "dependencies": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "deprecated": false, + "description": "Wordwrap a string with ANSI escape codes", + "devDependencies": { + "ava": "^0.16.0", + "chalk": "^1.1.0", + "coveralls": "^2.11.4", + "has-ansi": "^2.0.0", + "nyc": "^6.2.1", + "strip-ansi": "^3.0.0", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/wrap-ansi#readme", + "keywords": [ + "wrap", + "break", + "wordwrap", + "wordbreak", + "linewrap", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" + }, + { + "name": "JD Ballard", + "email": "i.am.qix@gmail.com", + "url": "github.com/qix-" + }, + { + "name": "Benjamin Coe", + "email": "ben@npmjs.com", + "url": "github.com/bcoe" + } + ], + "name": "wrap-ansi", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/wrap-ansi.git" + }, + "scripts": { + "coveralls": "nyc report --reporter=text-lcov | coveralls", + "test": "xo && nyc ava" + }, + "version": "2.1.0" +} diff --git a/node_modules/gulp/node_modules/wrap-ansi/readme.md b/node_modules/gulp/node_modules/wrap-ansi/readme.md new file mode 100644 index 0000000..59fc96b --- /dev/null +++ b/node_modules/gulp/node_modules/wrap-ansi/readme.md @@ -0,0 +1,73 @@ +# wrap-ansi [![Build Status](https://travis-ci.org/chalk/wrap-ansi.svg?branch=master)](https://travis-ci.org/chalk/wrap-ansi) [![Coverage Status](https://coveralls.io/repos/github/chalk/wrap-ansi/badge.svg?branch=master)](https://coveralls.io/github/chalk/wrap-ansi?branch=master) + +> Wordwrap a string with [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) + + +## Install + +``` +$ npm install --save wrap-ansi +``` + + +## Usage + +```js +const chalk = require('chalk'); +const wrapAnsi = require('wrap-ansi'); + +const input = 'The quick brown ' + chalk.red('fox jumped over ') + + 'the lazy ' + chalk.green('dog and then ran away with the unicorn.'); + +console.log(wrapAnsi(input, 20)); +``` + + + + +## API + +### wrapAnsi(input, columns, [options]) + +Wrap words to the specified column width. + +#### input + +Type: `string` + +String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). + +#### columns + +Type: `number` + +Number of columns to wrap the text to. + +#### options + +##### hard + +Type: `boolean`
+Default: `false` + +By default the wrap is soft, meaning long words may extend past the column width. Setting this to `true` will make it hard wrap at the column width. + +##### wordWrap + +Type: `boolean`
+Default: `true` + +By default, an attempt is made to split words at spaces, ensuring that they don't extend past the configured columns. If wordWrap is `false`, each column will instead be completely filled splitting words as necessary. + + +## Related + +- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes +- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right +- [jsesc](https://github.com/mathiasbynens/jsesc) - Generate ASCII-only output from Unicode strings. Useful for creating test fixtures. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/y18n/LICENSE b/node_modules/gulp/node_modules/y18n/LICENSE new file mode 100644 index 0000000..3c157f0 --- /dev/null +++ b/node_modules/gulp/node_modules/y18n/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Contributors + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/node_modules/gulp/node_modules/y18n/README.md b/node_modules/gulp/node_modules/y18n/README.md new file mode 100644 index 0000000..9859458 --- /dev/null +++ b/node_modules/gulp/node_modules/y18n/README.md @@ -0,0 +1,91 @@ +# y18n + +[![Build Status][travis-image]][travis-url] +[![Coverage Status][coveralls-image]][coveralls-url] +[![NPM version][npm-image]][npm-url] +[![js-standard-style][standard-image]][standard-url] + +The bare-bones internationalization library used by yargs. + +Inspired by [i18n](https://www.npmjs.com/package/i18n). + +## Examples + +_simple string translation:_ + +```js +var __ = require('y18n').__ + +console.log(__('my awesome string %s', 'foo')) +``` + +output: + +`my awesome string foo` + +_pluralization support:_ + +```js +var __n = require('y18n').__n + +console.log(__n('one fish %s', '%d fishes %s', 2, 'foo')) +``` + +output: + +`2 fishes foo` + +## JSON Language Files + +The JSON language files should be stored in a `./locales` folder. +File names correspond to locales, e.g., `en.json`, `pirate.json`. + +When strings are observed for the first time they will be +added to the JSON file corresponding to the current locale. + +## Methods + +### require('y18n')(config) + +Create an instance of y18n with the config provided, options include: + +* `directory`: the locale directory, default `./locales`. +* `updateFiles`: should newly observed strings be updated in file, default `true`. +* `locale`: what locale should be used. +* `fallbackToLanguage`: should fallback to a language-only file (e.g. `en.json`) + be allowed if a file matching the locale does not exist (e.g. `en_US.json`), + default `true`. + +### y18n.\_\_(str, arg, arg, arg) + +Print a localized string, `%s` will be replaced with `arg`s. + +### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg) + +Print a localized string with appropriate pluralization. If `%d` is provided +in the string, the `count` will replace this placeholder. + +### y18n.setLocale(str) + +Set the current locale being used. + +### y18n.getLocale() + +What locale is currently being used? + +### y18n.updateLocale(obj) + +Update the current locale with the key value pairs in `obj`. + +## License + +ISC + +[travis-url]: https://travis-ci.org/yargs/y18n +[travis-image]: https://img.shields.io/travis/yargs/y18n.svg +[coveralls-url]: https://coveralls.io/github/yargs/y18n +[coveralls-image]: https://img.shields.io/coveralls/yargs/y18n.svg +[npm-url]: https://npmjs.org/package/y18n +[npm-image]: https://img.shields.io/npm/v/y18n.svg +[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg +[standard-url]: https://github.com/feross/standard diff --git a/node_modules/gulp/node_modules/y18n/index.js b/node_modules/gulp/node_modules/y18n/index.js new file mode 100644 index 0000000..91b159e --- /dev/null +++ b/node_modules/gulp/node_modules/y18n/index.js @@ -0,0 +1,172 @@ +var fs = require('fs') +var path = require('path') +var util = require('util') + +function Y18N (opts) { + // configurable options. + opts = opts || {} + this.directory = opts.directory || './locales' + this.updateFiles = typeof opts.updateFiles === 'boolean' ? opts.updateFiles : true + this.locale = opts.locale || 'en' + this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true + + // internal stuff. + this.cache = {} + this.writeQueue = [] +} + +Y18N.prototype.__ = function () { + var args = Array.prototype.slice.call(arguments) + var str = args.shift() + var cb = function () {} // start with noop. + + if (typeof args[args.length - 1] === 'function') cb = args.pop() + cb = cb || function () {} // noop. + + if (!this.cache[this.locale]) this._readLocaleFile() + + // we've observed a new string, update the language file. + if (!this.cache[this.locale][str] && this.updateFiles) { + this.cache[this.locale][str] = str + + // include the current directory and locale, + // since these values could change before the + // write is performed. + this._enqueueWrite([this.directory, this.locale, cb]) + } else { + cb() + } + + return util.format.apply(util, [this.cache[this.locale][str] || str].concat(args)) +} + +Y18N.prototype._enqueueWrite = function (work) { + this.writeQueue.push(work) + if (this.writeQueue.length === 1) this._processWriteQueue() +} + +Y18N.prototype._processWriteQueue = function () { + var _this = this + var work = this.writeQueue[0] + + // destructure the enqueued work. + var directory = work[0] + var locale = work[1] + var cb = work[2] + + var languageFile = this._resolveLocaleFile(directory, locale) + var serializedLocale = JSON.stringify(this.cache[locale], null, 2) + + fs.writeFile(languageFile, serializedLocale, 'utf-8', function (err) { + _this.writeQueue.shift() + if (_this.writeQueue.length > 0) _this._processWriteQueue() + cb(err) + }) +} + +Y18N.prototype._readLocaleFile = function () { + var localeLookup = {} + var languageFile = this._resolveLocaleFile(this.directory, this.locale) + + try { + localeLookup = JSON.parse(fs.readFileSync(languageFile, 'utf-8')) + } catch (err) { + if (err instanceof SyntaxError) { + err.message = 'syntax error in ' + languageFile + } + + if (err.code === 'ENOENT') localeLookup = {} + else throw err + } + + this.cache[this.locale] = localeLookup +} + +Y18N.prototype._resolveLocaleFile = function (directory, locale) { + var file = path.resolve(directory, './', locale + '.json') + if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) { + // attempt fallback to language only + var languageFile = path.resolve(directory, './', locale.split('_')[0] + '.json') + if (this._fileExistsSync(languageFile)) file = languageFile + } + return file +} + +// this only exists because fs.existsSync() "will be deprecated" +// see https://nodejs.org/api/fs.html#fs_fs_existssync_path +Y18N.prototype._fileExistsSync = function (file) { + try { + return fs.statSync(file).isFile() + } catch (err) { + return false + } +} + +Y18N.prototype.__n = function () { + var args = Array.prototype.slice.call(arguments) + var singular = args.shift() + var plural = args.shift() + var quantity = args.shift() + + var cb = function () {} // start with noop. + if (typeof args[args.length - 1] === 'function') cb = args.pop() + + if (!this.cache[this.locale]) this._readLocaleFile() + + var str = quantity === 1 ? singular : plural + if (this.cache[this.locale][singular]) { + str = this.cache[this.locale][singular][quantity === 1 ? 'one' : 'other'] + } + + // we've observed a new string, update the language file. + if (!this.cache[this.locale][singular] && this.updateFiles) { + this.cache[this.locale][singular] = { + one: singular, + other: plural + } + + // include the current directory and locale, + // since these values could change before the + // write is performed. + this._enqueueWrite([this.directory, this.locale, cb]) + } else { + cb() + } + + // if a %d placeholder is provided, add quantity + // to the arguments expanded by util.format. + var values = [str] + if (~str.indexOf('%d')) values.push(quantity) + + return util.format.apply(util, values.concat(args)) +} + +Y18N.prototype.setLocale = function (locale) { + this.locale = locale +} + +Y18N.prototype.getLocale = function () { + return this.locale +} + +Y18N.prototype.updateLocale = function (obj) { + if (!this.cache[this.locale]) this._readLocaleFile() + + for (var key in obj) { + this.cache[this.locale][key] = obj[key] + } +} + +module.exports = function (opts) { + var y18n = new Y18N(opts) + + // bind all functions to y18n, so that + // they can be used in isolation. + for (var key in y18n) { + if (typeof y18n[key] === 'function') { + y18n[key] = y18n[key].bind(y18n) + } + } + + return y18n +} diff --git a/node_modules/gulp/node_modules/y18n/package.json b/node_modules/gulp/node_modules/y18n/package.json new file mode 100644 index 0000000..339cf58 --- /dev/null +++ b/node_modules/gulp/node_modules/y18n/package.json @@ -0,0 +1,65 @@ +{ + "_from": "y18n@^3.2.1", + "_id": "y18n@3.2.1", + "_inBundle": false, + "_integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "_location": "/gulp/y18n", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "y18n@^3.2.1", + "name": "y18n", + "escapedName": "y18n", + "rawSpec": "^3.2.1", + "saveSpec": null, + "fetchSpec": "^3.2.1" + }, + "_requiredBy": [ + "/gulp/yargs" + ], + "_resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "_shasum": "6d15fba884c08679c0d77e88e7759e811e07fa41", + "_spec": "y18n@^3.2.1", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/yargs", + "author": { + "name": "Ben Coe", + "email": "ben@npmjs.com" + }, + "bugs": { + "url": "https://github.com/yargs/y18n/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "the bare-bones internationalization library used by yargs", + "devDependencies": { + "chai": "^3.4.1", + "coveralls": "^2.11.6", + "mocha": "^2.3.4", + "nyc": "^6.1.1", + "rimraf": "^2.5.0", + "standard": "^5.4.1" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/yargs/y18n", + "keywords": [ + "i18n", + "internationalization", + "yargs" + ], + "license": "ISC", + "main": "index.js", + "name": "y18n", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/yargs/y18n.git" + }, + "scripts": { + "coverage": "nyc report --reporter=text-lcov | coveralls", + "pretest": "standard", + "test": "nyc mocha" + }, + "version": "3.2.1" +} diff --git a/node_modules/gulp/node_modules/yargs-parser/CHANGELOG.md b/node_modules/gulp/node_modules/yargs-parser/CHANGELOG.md new file mode 100644 index 0000000..cd060f3 --- /dev/null +++ b/node_modules/gulp/node_modules/yargs-parser/CHANGELOG.md @@ -0,0 +1,169 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# [5.0.0](https://github.com/yargs/yargs-parser/compare/v4.2.1...v5.0.0) (2017-02-18) + + +### Bug Fixes + +* environment variables should take precedence over config file ([#81](https://github.com/yargs/yargs-parser/issues/81)) ([76cee1f](https://github.com/yargs/yargs-parser/commit/76cee1f)) + + +### BREAKING CHANGES + +* environment variables will now override config files (args, env, config-file, config-object) + + + + +## [4.2.1](https://github.com/yargs/yargs-parser/compare/v4.2.0...v4.2.1) (2017-01-02) + + +### Bug Fixes + +* flatten/duplicate regression ([#75](https://github.com/yargs/yargs-parser/issues/75)) ([68d68a0](https://github.com/yargs/yargs-parser/commit/68d68a0)) + + + + +# [4.2.0](https://github.com/yargs/yargs-parser/compare/v4.1.0...v4.2.0) (2016-12-01) + + +### Bug Fixes + +* inner objects in configs had their keys appended to top-level key when dot-notation was disabled ([#72](https://github.com/yargs/yargs-parser/issues/72)) ([0b1b5f9](https://github.com/yargs/yargs-parser/commit/0b1b5f9)) + + +### Features + +* allow multiple arrays to be provided, rather than always combining ([#71](https://github.com/yargs/yargs-parser/issues/71)) ([0f0fb2d](https://github.com/yargs/yargs-parser/commit/0f0fb2d)) + + + + +# [4.1.0](https://github.com/yargs/yargs-parser/compare/v4.0.2...v4.1.0) (2016-11-07) + + +### Features + +* apply coercions to default options ([#65](https://github.com/yargs/yargs-parser/issues/65)) ([c79052b](https://github.com/yargs/yargs-parser/commit/c79052b)) +* handle dot notation boolean options ([#63](https://github.com/yargs/yargs-parser/issues/63)) ([02c3545](https://github.com/yargs/yargs-parser/commit/02c3545)) + + + + +## [4.0.2](https://github.com/yargs/yargs-parser/compare/v4.0.1...v4.0.2) (2016-09-30) + + +### Bug Fixes + +* whoops, let's make the assign not change the Object key order ([29d069a](https://github.com/yargs/yargs-parser/commit/29d069a)) + + + + +## [4.0.1](https://github.com/yargs/yargs-parser/compare/v4.0.0...v4.0.1) (2016-09-30) + + +### Bug Fixes + +* lodash.assign was deprecated ([#59](https://github.com/yargs/yargs-parser/issues/59)) ([5e7eb11](https://github.com/yargs/yargs-parser/commit/5e7eb11)) + + + + +# [4.0.0](https://github.com/yargs/yargs-parser/compare/v3.2.0...v4.0.0) (2016-09-26) + + +### Bug Fixes + +* coerce should be applied to the final objects and arrays created ([#57](https://github.com/yargs/yargs-parser/issues/57)) ([4ca69da](https://github.com/yargs/yargs-parser/commit/4ca69da)) + + +### BREAKING CHANGES + +* coerce is no longer applied to individual arguments in an implicit array. + + + + +# [3.2.0](https://github.com/yargs/yargs-parser/compare/v3.1.0...v3.2.0) (2016-08-13) + + +### Features + +* coerce full array instead of each element ([#51](https://github.com/yargs/yargs-parser/issues/51)) ([cc4dc56](https://github.com/yargs/yargs-parser/commit/cc4dc56)) + + + + +# [3.1.0](https://github.com/yargs/yargs-parser/compare/v3.0.0...v3.1.0) (2016-08-09) + + +### Bug Fixes + +* address pkgConf parsing bug outlined in [#37](https://github.com/yargs/yargs-parser/issues/37) ([#45](https://github.com/yargs/yargs-parser/issues/45)) ([be76ee6](https://github.com/yargs/yargs-parser/commit/be76ee6)) +* better parsing of negative values ([#44](https://github.com/yargs/yargs-parser/issues/44)) ([2e43692](https://github.com/yargs/yargs-parser/commit/2e43692)) +* check aliases when guessing defaults for arguments fixes [#41](https://github.com/yargs/yargs-parser/issues/41) ([#43](https://github.com/yargs/yargs-parser/issues/43)) ([f3e4616](https://github.com/yargs/yargs-parser/commit/f3e4616)) + + +### Features + +* added coerce option, for providing specialized argument parsing ([#42](https://github.com/yargs/yargs-parser/issues/42)) ([7b49cd2](https://github.com/yargs/yargs-parser/commit/7b49cd2)) + + + + +# [3.0.0](https://github.com/yargs/yargs-parser/compare/v2.4.1...v3.0.0) (2016-08-07) + + +### Bug Fixes + +* parsing issue with numeric character in group of options ([#19](https://github.com/yargs/yargs-parser/issues/19)) ([f743236](https://github.com/yargs/yargs-parser/commit/f743236)) +* upgraded lodash.assign ([5d7fdf4](https://github.com/yargs/yargs-parser/commit/5d7fdf4)) + +### BREAKING CHANGES + +* subtle change to how values are parsed in a group of single-character arguments. +* _first released in 3.1.0, better handling of negative values should be considered a breaking change._ + + + + +## [2.4.1](https://github.com/yargs/yargs-parser/compare/v2.4.0...v2.4.1) (2016-07-16) + + +### Bug Fixes + +* **count:** do not increment a default value ([#39](https://github.com/yargs/yargs-parser/issues/39)) ([b04a189](https://github.com/yargs/yargs-parser/commit/b04a189)) + + + + +# [2.4.0](https://github.com/yargs/yargs-parser/compare/v2.3.0...v2.4.0) (2016-04-11) + + +### Features + +* **environment:** Support nested options in environment variables ([#26](https://github.com/yargs/yargs-parser/issues/26)) thanks [@elas7](https://github.com/elas7) \o/ ([020778b](https://github.com/yargs/yargs-parser/commit/020778b)) + + + + +# [2.3.0](https://github.com/yargs/yargs-parser/compare/v2.2.0...v2.3.0) (2016-04-09) + + +### Bug Fixes + +* **boolean:** fix for boolean options with non boolean defaults (#20) ([2dbe86b](https://github.com/yargs/yargs-parser/commit/2dbe86b)), closes [(#20](https://github.com/(/issues/20) +* **package:** remove tests from tarball ([0353c0d](https://github.com/yargs/yargs-parser/commit/0353c0d)) +* **parsing:** handle calling short option with an empty string as the next value. ([a867165](https://github.com/yargs/yargs-parser/commit/a867165)) +* boolean flag when next value contains the strings 'true' or 'false'. ([69941a6](https://github.com/yargs/yargs-parser/commit/69941a6)) +* update dependencies; add standard-version bin for next release (#24) ([822d9d5](https://github.com/yargs/yargs-parser/commit/822d9d5)) + +### Features + +* **configuration:** Allow to pass configuration objects to yargs-parser ([0780900](https://github.com/yargs/yargs-parser/commit/0780900)) +* **normalize:** allow normalize to work with arrays ([e0eaa1a](https://github.com/yargs/yargs-parser/commit/e0eaa1a)) diff --git a/node_modules/gulp/node_modules/yargs-parser/LICENSE.txt b/node_modules/gulp/node_modules/yargs-parser/LICENSE.txt new file mode 100644 index 0000000..836440b --- /dev/null +++ b/node_modules/gulp/node_modules/yargs-parser/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2016, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/gulp/node_modules/yargs-parser/README.md b/node_modules/gulp/node_modules/yargs-parser/README.md new file mode 100644 index 0000000..6d5916c --- /dev/null +++ b/node_modules/gulp/node_modules/yargs-parser/README.md @@ -0,0 +1,257 @@ +# yargs-parser + +[![Build Status](https://travis-ci.org/yargs/yargs-parser.png)](https://travis-ci.org/yargs/yargs-parser) +[![Coverage Status](https://coveralls.io/repos/yargs/yargs-parser/badge.svg?branch=)](https://coveralls.io/r/yargs/yargs-parser?branch=master) +[![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser) +[![Windows Tests](https://img.shields.io/appveyor/ci/bcoe/yargs-parser/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/bcoe/yargs-parser) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + + +The mighty option parser used by [yargs](https://github.com/yargs/yargs). + +visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions. + + + +## Example + +```sh +npm i yargs-parser --save +``` + +```js +var argv = require('yargs-parser')(process.argv.slice(2)) +console.log(argv) +``` + +```sh +node example.js --foo=33 --bar hello +{ _: [], foo: 33, bar: 'hello' } +``` + +_or parse a string!_ + +```js +var argv = require('./')('--foo=99 --bar=33') +console.log(argv) +``` + +```sh +{ _: [], foo: 99, bar: 33 } +``` + +Convert an array of mixed types before passing to `yargs-parser`: + +```js +var parse = require('yargs-parser') +parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to string +parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings +``` + +## API + +### require('yargs-parser')(args, opts={}) + +Parses command line arguments returning a simple mapping of keys and values. + +**expects:** + +* `args`: a string or array of strings representing the options to parse. +* `opts`: provide a set of hints indicating how `args` should be parsed: + * `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`. + * `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`. + * `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`. + * `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed). + * `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided + (or throws an error), e.g. `{coerce: {foo: function (arg) {return modifiedArg}}}`. + * `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`. + * `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`. + * `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed. + * `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`. + * `opts.normalize`: `path.normalize()` will be applied to values set to this key. + * `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`). + * `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)). + * `opts.number`: keys should be treated as numbers. + +**returns:** + +* `obj`: an object representing the parsed value of `args` + * `key/value`: key value pairs for each argument and their aliases. + * `_`: an array representing the positional arguments. + +### require('yargs-parser').detailed(args, opts={}) + +Parses a command line string, returning detailed information required by the +yargs engine. + +**expects:** + +* `args`: a string or array of strings representing options to parse. +* `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`. + +**returns:** + +* `argv`: an object representing the parsed value of `args` + * `key/value`: key value pairs for each argument and their aliases. + * `_`: an array representing the positional arguments. +* `error`: populated with an error object if an exception occurred during parsing. +* `aliases`: the inferred list of aliases built by combining lists in `opts.alias`. +* `newAliases`: any new aliases added via camel-case expansion. +* `configuration`: the configuration loaded from the `yargs` stanza in package.json. + + +### Configuration + +The yargs-parser applies several automated transformations on the keys provided +in `args`. These features can be turned on and off using the `configuration` field +of `opts`. + +```js +var parsed = parser(['--no-dice'], { + configuration: { + 'boolean-negation': false + } +}) +``` + +### short option groups + +* default: `true`. +* key: `short-option-groups`. + +Should a group of short-options be treated as boolean flags? + +```sh +node example.js -abc +{ _: [], a: true, b: true, c: true } +``` + +_if disabled:_ + +```sh +node example.js -abc +{ _: [], abc: true } +``` + +### camel-case expansion + +* default: `true`. +* key: `camel-case-expansion`. + +Should hyphenated arguments be expanded into camel-case aliases? + +```sh +node example.js --foo-bar +{ _: [], 'foo-bar': true, fooBar: true } +``` + +_if disabled:_ + +```sh +node example.js --foo-bar +{ _: [], 'foo-bar': true } +``` + +### dot-notation + +* default: `true` +* key: `dot-notation` + +Should keys that contain `.` be treated as objects? + +```sh +node example.js --foo.bar +{ _: [], foo: { bar: true } } +``` + +_if disabled:_ + +```sh +node example.js --foo.bar +{ _: [], "foo.bar": true } +``` + +### parse numbers + +* default: `true` +* key: `parse-numbers` + +Should keys that look like numbers be treated as such? + +```sh +node example.js --foo=99.3 +{ _: [], foo: 99.3 } +``` + +_if disabled:_ + +```sh +node example.js --foo=99.3 +{ _: [], foo: "99.3" } +``` + +### boolean negation + +* default: `true` +* key: `boolean-negation` + +Should variables prefixed with `--no` be treated as negations? + +```sh +node example.js --no-foo +{ _: [], foo: false } +``` + +_if disabled:_ + +```sh +node example.js --no-foo +{ _: [], "no-foo": true } +``` + +### duplicate arguments array + +* default: `true` +* key: `duplicate-arguments-array` + +Should arguments be coerced into an array when duplicated: + +```sh +node example.js -x 1 -x 2 +{ _: [], x: [1, 2] } +``` + +_if disabled:_ + +```sh +node example.js -x 1 -x 2 +{ _: [], x: 2 } +``` + +### flatten duplicate arrays + +* default: `true` +* key: `flatten-duplicate-arrays` + +Should array arguments be coerced into a single array when duplicated: + +```sh +node example.js -x 1 2 -x 3 4 +{ _: [], x: [1, 2, 3, 4] } +``` + +_if disabled:_ + +```sh +node example.js -x 1 2 -x 3 4 +{ _: [], x: [[1, 2], [3, 4]] } +``` + +## Special Thanks + +The yargs project evolves from optimist and minimist. It owes its +existence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \o/ + +## License + +ISC diff --git a/node_modules/gulp/node_modules/yargs-parser/index.js b/node_modules/gulp/node_modules/yargs-parser/index.js new file mode 100644 index 0000000..b71faf5 --- /dev/null +++ b/node_modules/gulp/node_modules/yargs-parser/index.js @@ -0,0 +1,759 @@ +var camelCase = require('camelcase') +var path = require('path') +var tokenizeArgString = require('./lib/tokenize-arg-string') +var util = require('util') + +function parse (args, opts) { + if (!opts) opts = {} + // allow a string argument to be passed in rather + // than an argv array. + args = tokenizeArgString(args) + // aliases might have transitive relationships, normalize this. + var aliases = combineAliases(opts.alias || {}) + var configuration = assign({ + 'short-option-groups': true, + 'camel-case-expansion': true, + 'dot-notation': true, + 'parse-numbers': true, + 'boolean-negation': true, + 'duplicate-arguments-array': true, + 'flatten-duplicate-arrays': true + }, opts.configuration) + var defaults = opts.default || {} + var configObjects = opts.configObjects || [] + var envPrefix = opts.envPrefix + var newAliases = {} + // allow a i18n handler to be passed in, default to a fake one (util.format). + var __ = opts.__ || function (str) { + return util.format.apply(util, Array.prototype.slice.call(arguments)) + } + var error = null + var flags = { + aliases: {}, + arrays: {}, + bools: {}, + strings: {}, + numbers: {}, + counts: {}, + normalize: {}, + configs: {}, + defaulted: {}, + nargs: {}, + coercions: {} + } + var negative = /^-[0-9]+(\.[0-9]+)?/ + + ;[].concat(opts.array).filter(Boolean).forEach(function (key) { + flags.arrays[key] = true + }) + + ;[].concat(opts.boolean).filter(Boolean).forEach(function (key) { + flags.bools[key] = true + }) + + ;[].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true + }) + + ;[].concat(opts.number).filter(Boolean).forEach(function (key) { + flags.numbers[key] = true + }) + + ;[].concat(opts.count).filter(Boolean).forEach(function (key) { + flags.counts[key] = true + }) + + ;[].concat(opts.normalize).filter(Boolean).forEach(function (key) { + flags.normalize[key] = true + }) + + Object.keys(opts.narg || {}).forEach(function (k) { + flags.nargs[k] = opts.narg[k] + }) + + Object.keys(opts.coerce || {}).forEach(function (k) { + flags.coercions[k] = opts.coerce[k] + }) + + if (Array.isArray(opts.config) || typeof opts.config === 'string') { + ;[].concat(opts.config).filter(Boolean).forEach(function (key) { + flags.configs[key] = true + }) + } else { + Object.keys(opts.config || {}).forEach(function (k) { + flags.configs[k] = opts.config[k] + }) + } + + // create a lookup table that takes into account all + // combinations of aliases: {f: ['foo'], foo: ['f']} + extendAliases(opts.key, aliases, opts.default, flags.arrays) + + // apply default values to all aliases. + Object.keys(defaults).forEach(function (key) { + (flags.aliases[key] || []).forEach(function (alias) { + defaults[alias] = defaults[key] + }) + }) + + var argv = { _: [] } + + Object.keys(flags.bools).forEach(function (key) { + setArg(key, !(key in defaults) ? false : defaults[key]) + setDefaulted(key) + }) + + var notFlags = [] + if (args.indexOf('--') !== -1) { + notFlags = args.slice(args.indexOf('--') + 1) + args = args.slice(0, args.indexOf('--')) + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i] + var broken + var key + var letters + var m + var next + var value + + // -- seperated by = + if (arg.match(/^--.+=/) || ( + !configuration['short-option-groups'] && arg.match(/^-.+=/) + )) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + m = arg.match(/^--?([^=]+)=([\s\S]*)$/) + + // nargs format = '--f=monkey washing cat' + if (checkAllAliases(m[1], flags.nargs)) { + args.splice(i + 1, 0, m[2]) + i = eatNargs(i, m[1], args) + // arrays format = '--f=a b c' + } else if (checkAllAliases(m[1], flags.arrays) && args.length > i + 1) { + args.splice(i + 1, 0, m[2]) + i = eatArray(i, m[1], args) + } else { + setArg(m[1], m[2]) + } + } else if (arg.match(/^--no-.+/) && configuration['boolean-negation']) { + key = arg.match(/^--no-(.+)/)[1] + setArg(key, false) + + // -- seperated by space. + } else if (arg.match(/^--.+/) || ( + !configuration['short-option-groups'] && arg.match(/^-.+/) + )) { + key = arg.match(/^--?(.+)/)[1] + + // nargs format = '--foo a b c' + if (checkAllAliases(key, flags.nargs)) { + i = eatNargs(i, key, args) + // array format = '--foo a b c' + } else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) { + i = eatArray(i, key, args) + } else { + next = args[i + 1] + + if (next !== undefined && (!next.match(/^-/) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next) + i++ + } else if (/^(true|false)$/.test(next)) { + setArg(key, next) + i++ + } else { + setArg(key, defaultForType(guessType(key, flags))) + } + } + + // dot-notation flag seperated by '='. + } else if (arg.match(/^-.\..+=/)) { + m = arg.match(/^-([^=]+)=([\s\S]*)$/) + setArg(m[1], m[2]) + + // dot-notation flag seperated by space. + } else if (arg.match(/^-.\..+/)) { + next = args[i + 1] + key = arg.match(/^-(.\..+)/)[1] + + if (next !== undefined && !next.match(/^-/) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next) + i++ + } else { + setArg(key, defaultForType(guessType(key, flags))) + } + } else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { + letters = arg.slice(1, -1).split('') + broken = false + + for (var j = 0; j < letters.length; j++) { + next = arg.slice(j + 2) + + if (letters[j + 1] && letters[j + 1] === '=') { + value = arg.slice(j + 3) + key = letters[j] + + // nargs format = '-f=monkey washing cat' + if (checkAllAliases(key, flags.nargs)) { + args.splice(i + 1, 0, value) + i = eatNargs(i, key, args) + // array format = '-f=a b c' + } else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) { + args.splice(i + 1, 0, value) + i = eatArray(i, key, args) + } else { + setArg(key, value) + } + + broken = true + break + } + + if (next === '-') { + setArg(letters[j], next) + continue + } + + // current letter is an alphabetic character and next value is a number + if (/[A-Za-z]/.test(letters[j]) && + /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { + setArg(letters[j], next) + broken = true + break + } + + if (letters[j + 1] && letters[j + 1].match(/\W/)) { + setArg(letters[j], next) + broken = true + break + } else { + setArg(letters[j], defaultForType(guessType(letters[j], flags))) + } + } + + key = arg.slice(-1)[0] + + if (!broken && key !== '-') { + // nargs format = '-f a b c' + if (checkAllAliases(key, flags.nargs)) { + i = eatNargs(i, key, args) + // array format = '-f a b c' + } else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) { + i = eatArray(i, key, args) + } else { + next = args[i + 1] + + if (next !== undefined && (!/^(-|--)[^-]/.test(next) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next) + i++ + } else if (/^(true|false)$/.test(next)) { + setArg(key, next) + i++ + } else { + setArg(key, defaultForType(guessType(key, flags))) + } + } + } + } else { + argv._.push( + flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) + ) + } + } + + // order of precedence: + // 1. command line arg + // 2. value from env var + // 3. value from config file + // 4. value from config objects + // 5. configured default value + applyEnvVars(argv, true) // special case: check env vars that point to config file + applyEnvVars(argv, false) + setConfig(argv) + setConfigObjects() + applyDefaultsAndAliases(argv, flags.aliases, defaults) + applyCoercions(argv) + + // for any counts either not in args or without an explicit default, set to 0 + Object.keys(flags.counts).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) setArg(key, 0) + }) + + notFlags.forEach(function (key) { + argv._.push(key) + }) + + // how many arguments should we consume, based + // on the nargs option? + function eatNargs (i, key, args) { + var toEat = checkAllAliases(key, flags.nargs) + + if (args.length - (i + 1) < toEat) error = Error(__('Not enough arguments following: %s', key)) + + for (var ii = i + 1; ii < (toEat + i + 1); ii++) { + setArg(key, args[ii]) + } + + return (i + toEat) + } + + // if an option is an array, eat all non-hyphenated arguments + // following it... YUM! + // e.g., --foo apple banana cat becomes ["apple", "banana", "cat"] + function eatArray (i, key, args) { + var start = i + 1 + var argsToSet = [] + var multipleArrayFlag = i > 0 + for (var ii = i + 1; ii < args.length; ii++) { + if (/^-/.test(args[ii]) && !negative.test(args[ii])) { + if (ii === start) { + setArg(key, defaultForType('array')) + } + multipleArrayFlag = true + break + } + i = ii + argsToSet.push(args[ii]) + } + if (multipleArrayFlag) { + setArg(key, argsToSet.map(function (arg) { + return processValue(key, arg) + })) + } else { + argsToSet.forEach(function (arg) { + setArg(key, arg) + }) + } + + return i + } + + function setArg (key, val) { + unsetDefaulted(key) + + if (/-/.test(key) && !(flags.aliases[key] && flags.aliases[key].length) && configuration['camel-case-expansion']) { + var c = camelCase(key) + flags.aliases[key] = [c] + newAliases[c] = true + } + + var value = processValue(key, val) + + var splitKey = key.split('.') + setKey(argv, splitKey, value) + + // handle populating aliases of the full key + if (flags.aliases[key]) { + flags.aliases[key].forEach(function (x) { + x = x.split('.') + setKey(argv, x, value) + }) + } + + // handle populating aliases of the first element of the dot-notation key + if (splitKey.length > 1 && configuration['dot-notation']) { + ;(flags.aliases[splitKey[0]] || []).forEach(function (x) { + x = x.split('.') + + // expand alias with nested objects in key + var a = [].concat(splitKey) + a.shift() // nuke the old key. + x = x.concat(a) + + setKey(argv, x, value) + }) + } + + // Set normalize getter and setter when key is in 'normalize' but isn't an array + if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) { + var keys = [key].concat(flags.aliases[key] || []) + keys.forEach(function (key) { + argv.__defineSetter__(key, function (v) { + val = path.normalize(v) + }) + + argv.__defineGetter__(key, function () { + return typeof val === 'string' ? path.normalize(val) : val + }) + }) + } + } + + function processValue (key, val) { + // handle parsing boolean arguments --foo=true --bar false. + if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) { + if (typeof val === 'string') val = val === 'true' + } + + var value = val + if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.coercions)) { + if (isNumber(val)) value = Number(val) + if (!isUndefined(val) && !isNumber(val) && checkAllAliases(key, flags.numbers)) value = NaN + } + + // increment a count given as arg (either no value or value parsed as boolean) + if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) { + value = increment + } + + // Set normalized value when key is in 'normalize' and in 'arrays' + if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) { + if (Array.isArray(val)) value = val.map(path.normalize) + else value = path.normalize(val) + } + return value + } + + // set args from config.json file, this should be + // applied last so that defaults can be applied. + function setConfig (argv) { + var configLookup = {} + + // expand defaults/aliases, in-case any happen to reference + // the config.json file. + applyDefaultsAndAliases(configLookup, flags.aliases, defaults) + + Object.keys(flags.configs).forEach(function (configKey) { + var configPath = argv[configKey] || configLookup[configKey] + if (configPath) { + try { + var config = null + var resolvedConfigPath = path.resolve(process.cwd(), configPath) + + if (typeof flags.configs[configKey] === 'function') { + try { + config = flags.configs[configKey](resolvedConfigPath) + } catch (e) { + config = e + } + if (config instanceof Error) { + error = config + return + } + } else { + config = require(resolvedConfigPath) + } + + setConfigObject(config) + } catch (ex) { + if (argv[configKey]) error = Error(__('Invalid JSON config file: %s', configPath)) + } + } + }) + } + + // set args from config object. + // it recursively checks nested objects. + function setConfigObject (config, prev) { + Object.keys(config).forEach(function (key) { + var value = config[key] + var fullKey = prev ? prev + '.' + key : key + + // if the value is an inner object and we have dot-notation + // enabled, treat inner objects in config the same as + // heavily nested dot notations (foo.bar.apple). + if (typeof value === 'object' && !Array.isArray(value) && configuration['dot-notation']) { + // if the value is an object but not an array, check nested object + setConfigObject(value, fullKey) + } else { + // setting arguments via CLI takes precedence over + // values within the config file. + if (!hasKey(argv, fullKey.split('.')) || (flags.defaulted[fullKey])) { + setArg(fullKey, value) + } + } + }) + } + + // set all config objects passed in opts + function setConfigObjects () { + if (typeof configObjects === 'undefined') return + configObjects.forEach(function (configObject) { + setConfigObject(configObject) + }) + } + + function applyEnvVars (argv, configOnly) { + if (typeof envPrefix === 'undefined') return + + var prefix = typeof envPrefix === 'string' ? envPrefix : '' + Object.keys(process.env).forEach(function (envVar) { + if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) { + // get array of nested keys and convert them to camel case + var keys = envVar.split('__').map(function (key, i) { + if (i === 0) { + key = key.substring(prefix.length) + } + return camelCase(key) + }) + + if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && (!hasKey(argv, keys) || flags.defaulted[keys.join('.')])) { + setArg(keys.join('.'), process.env[envVar]) + } + } + }) + } + + function applyCoercions (argv) { + var coerce + Object.keys(argv).forEach(function (key) { + coerce = checkAllAliases(key, flags.coercions) + if (typeof coerce === 'function') { + try { + argv[key] = coerce(argv[key]) + } catch (err) { + error = err + } + } + }) + } + + function applyDefaultsAndAliases (obj, aliases, defaults) { + Object.keys(defaults).forEach(function (key) { + if (!hasKey(obj, key.split('.'))) { + setKey(obj, key.split('.'), defaults[key]) + + ;(aliases[key] || []).forEach(function (x) { + if (hasKey(obj, x.split('.'))) return + setKey(obj, x.split('.'), defaults[key]) + }) + } + }) + } + + function hasKey (obj, keys) { + var o = obj + + if (!configuration['dot-notation']) keys = [keys.join('.')] + + keys.slice(0, -1).forEach(function (key) { + o = (o[key] || {}) + }) + + var key = keys[keys.length - 1] + + if (typeof o !== 'object') return false + else return key in o + } + + function setKey (obj, keys, value) { + var o = obj + + if (!configuration['dot-notation']) keys = [keys.join('.')] + + keys.slice(0, -1).forEach(function (key) { + if (o[key] === undefined) o[key] = {} + o = o[key] + }) + + var key = keys[keys.length - 1] + + var isTypeArray = checkAllAliases(key, flags.arrays) + var isValueArray = Array.isArray(value) + var duplicate = configuration['duplicate-arguments-array'] + + if (value === increment) { + o[key] = increment(o[key]) + } else if (Array.isArray(o[key])) { + if (duplicate && isTypeArray && isValueArray) { + o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : [o[key]].concat([value]) + } else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { + o[key] = value + } else { + o[key] = o[key].concat([value]) + } + } else if (o[key] === undefined && isTypeArray) { + o[key] = isValueArray ? value : [value] + } else if (duplicate && !(o[key] === undefined || checkAllAliases(key, flags.bools) || checkAllAliases(keys.join('.'), flags.bools) || checkAllAliases(key, flags.counts))) { + o[key] = [ o[key], value ] + } else { + o[key] = value + } + } + + // extend the aliases list with inferred aliases. + function extendAliases () { + Array.prototype.slice.call(arguments).forEach(function (obj) { + Object.keys(obj || {}).forEach(function (key) { + // short-circuit if we've already added a key + // to the aliases array, for example it might + // exist in both 'opts.default' and 'opts.key'. + if (flags.aliases[key]) return + + flags.aliases[key] = [].concat(aliases[key] || []) + // For "--option-name", also set argv.optionName + flags.aliases[key].concat(key).forEach(function (x) { + if (/-/.test(x) && configuration['camel-case-expansion']) { + var c = camelCase(x) + flags.aliases[key].push(c) + newAliases[c] = true + } + }) + flags.aliases[key].forEach(function (x) { + flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) { + return x !== y + })) + }) + }) + }) + } + + // check if a flag is set for any of a key's aliases. + function checkAllAliases (key, flag) { + var isSet = false + var toCheck = [].concat(flags.aliases[key] || [], key) + + toCheck.forEach(function (key) { + if (flag[key]) isSet = flag[key] + }) + + return isSet + } + + function setDefaulted (key) { + [].concat(flags.aliases[key] || [], key).forEach(function (k) { + flags.defaulted[k] = true + }) + } + + function unsetDefaulted (key) { + [].concat(flags.aliases[key] || [], key).forEach(function (k) { + delete flags.defaulted[k] + }) + } + + // return a default value, given the type of a flag., + // e.g., key of type 'string' will default to '', rather than 'true'. + function defaultForType (type) { + var def = { + boolean: true, + string: '', + number: undefined, + array: [] + } + + return def[type] + } + + // given a flag, enforce a default type. + function guessType (key, flags) { + var type = 'boolean' + + if (checkAllAliases(key, flags.strings)) type = 'string' + else if (checkAllAliases(key, flags.numbers)) type = 'number' + else if (checkAllAliases(key, flags.arrays)) type = 'array' + + return type + } + + function isNumber (x) { + if (!configuration['parse-numbers']) return false + if (typeof x === 'number') return true + if (/^0x[0-9a-f]+$/i.test(x)) return true + return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x) + } + + function isUndefined (num) { + return num === undefined + } + + return { + argv: argv, + error: error, + aliases: flags.aliases, + newAliases: newAliases, + configuration: configuration + } +} + +// if any aliases reference each other, we should +// merge them together. +function combineAliases (aliases) { + var aliasArrays = [] + var change = true + var combined = {} + + // turn alias lookup hash {key: ['alias1', 'alias2']} into + // a simple array ['key', 'alias1', 'alias2'] + Object.keys(aliases).forEach(function (key) { + aliasArrays.push( + [].concat(aliases[key], key) + ) + }) + + // combine arrays until zero changes are + // made in an iteration. + while (change) { + change = false + for (var i = 0; i < aliasArrays.length; i++) { + for (var ii = i + 1; ii < aliasArrays.length; ii++) { + var intersect = aliasArrays[i].filter(function (v) { + return aliasArrays[ii].indexOf(v) !== -1 + }) + + if (intersect.length) { + aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]) + aliasArrays.splice(ii, 1) + change = true + break + } + } + } + } + + // map arrays back to the hash-lookup (de-dupe while + // we're at it). + aliasArrays.forEach(function (aliasArray) { + aliasArray = aliasArray.filter(function (v, i, self) { + return self.indexOf(v) === i + }) + combined[aliasArray.pop()] = aliasArray + }) + + return combined +} + +function assign (defaults, configuration) { + var o = {} + configuration = configuration || {} + + Object.keys(defaults).forEach(function (k) { + o[k] = defaults[k] + }) + Object.keys(configuration).forEach(function (k) { + o[k] = configuration[k] + }) + + return o +} + +// this function should only be called when a count is given as an arg +// it is NOT called to set a default value +// thus we can start the count at 1 instead of 0 +function increment (orig) { + return orig !== undefined ? orig + 1 : 1 +} + +function Parser (args, opts) { + var result = parse(args.slice(), opts) + + return result.argv +} + +// parse arguments and return detailed +// meta information, aliases, etc. +Parser.detailed = function (args, opts) { + return parse(args.slice(), opts) +} + +module.exports = Parser diff --git a/node_modules/gulp/node_modules/yargs-parser/lib/tokenize-arg-string.js b/node_modules/gulp/node_modules/yargs-parser/lib/tokenize-arg-string.js new file mode 100644 index 0000000..23d39e1 --- /dev/null +++ b/node_modules/gulp/node_modules/yargs-parser/lib/tokenize-arg-string.js @@ -0,0 +1,34 @@ +// take an un-split argv string and tokenize it. +module.exports = function (argString) { + if (Array.isArray(argString)) return argString + + var i = 0 + var c = null + var opening = null + var args = [] + + for (var ii = 0; ii < argString.length; ii++) { + c = argString.charAt(ii) + + // split on spaces unless we're in quotes. + if (c === ' ' && !opening) { + i++ + continue + } + + // don't split the string if we're in matching + // opening or closing single and double quotes. + if (c === opening) { + opening = null + continue + } else if ((c === "'" || c === '"') && !opening) { + opening = c + continue + } + + if (!args[i]) args[i] = '' + args[i] += c + } + + return args +} diff --git a/node_modules/gulp/node_modules/yargs-parser/package.json b/node_modules/gulp/node_modules/yargs-parser/package.json new file mode 100644 index 0000000..1c6c60e --- /dev/null +++ b/node_modules/gulp/node_modules/yargs-parser/package.json @@ -0,0 +1,75 @@ +{ + "_from": "yargs-parser@^5.0.0", + "_id": "yargs-parser@5.0.0", + "_inBundle": false, + "_integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + "_location": "/gulp/yargs-parser", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "yargs-parser@^5.0.0", + "name": "yargs-parser", + "escapedName": "yargs-parser", + "rawSpec": "^5.0.0", + "saveSpec": null, + "fetchSpec": "^5.0.0" + }, + "_requiredBy": [ + "/gulp/yargs" + ], + "_resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", + "_shasum": "275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a", + "_spec": "yargs-parser@^5.0.0", + "_where": "/usr/share/r3-server/beta/r3/node_modules/gulp/node_modules/yargs", + "author": { + "name": "Ben Coe", + "email": "ben@npmjs.com" + }, + "bugs": { + "url": "https://github.com/yargs/yargs-parser/issues" + }, + "bundleDependencies": false, + "dependencies": { + "camelcase": "^3.0.0" + }, + "deprecated": false, + "description": "the mighty option parser used by yargs", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^2.11.12", + "mocha": "^3.0.1", + "nyc": "^10.0.0", + "standard": "^8.0.0", + "standard-version": "^4.0.0" + }, + "files": [ + "lib", + "index.js" + ], + "homepage": "https://github.com/yargs/yargs-parser#readme", + "keywords": [ + "argument", + "parser", + "yargs", + "command", + "cli", + "parsing", + "option", + "args", + "argument" + ], + "license": "ISC", + "main": "index.js", + "name": "yargs-parser", + "repository": { + "url": "git+ssh://git@github.com/yargs/yargs-parser.git" + }, + "scripts": { + "coverage": "nyc report --reporter=text-lcov | coveralls", + "pretest": "standard", + "release": "standard-version", + "test": "nyc mocha test/*.js" + }, + "version": "5.0.0" +} diff --git a/node_modules/gulp/node_modules/yargs/CHANGELOG.md b/node_modules/gulp/node_modules/yargs/CHANGELOG.md new file mode 100644 index 0000000..eadcd6a --- /dev/null +++ b/node_modules/gulp/node_modules/yargs/CHANGELOG.md @@ -0,0 +1,921 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# [7.1.0](https://github.com/yargs/yargs/compare/v7.0.2...v7.1.0) (2017-04-13) + + +### Bug Fixes + +* fix demandOption no longer treats 'false' as truthy ([#829](https://github.com/yargs/yargs/issues/829)) ([c748dd2](https://github.com/yargs/yargs/commit/c748dd2)) +* get terminalWidth in non interactive mode no longer causes a validation exception ([#837](https://github.com/yargs/yargs/issues/837)) ([360e301](https://github.com/yargs/yargs/commit/360e301)) +* we shouldn't output help if we've printed a prior help-like message ([#847](https://github.com/yargs/yargs/issues/847)) ([17e89bd](https://github.com/yargs/yargs/commit/17e89bd)) + + +### Features + +* add support for numeric commands ([#825](https://github.com/yargs/yargs/issues/825)) ([fde0564](https://github.com/yargs/yargs/commit/fde0564)) + + + + +## [7.0.2](https://github.com/yargs/yargs/compare/v7.0.1...v7.0.2) (2017-03-10) + + +### Bug Fixes + +* populating placeholder arguments broke validation ([b3eb2fe](https://github.com/yargs/yargs/commit/b3eb2fe)) + + + + +## [7.0.1](https://github.com/yargs/yargs/compare/v7.0.0...v7.0.1) (2017-03-03) + + +### Bug Fixes + +* --help with default command should print top-level help ([#810](https://github.com/yargs/yargs/issues/810)) ([9c03fa4](https://github.com/yargs/yargs/commit/9c03fa4)) + + + + +# [7.0.0](https://github.com/yargs/yargs/compare/v6.6.0...v7.0.0) (2017-02-26) + + +### Bug Fixes + +* address min/max validation message regression ([#750](https://github.com/yargs/yargs/issues/750)) ([2e5ce0f](https://github.com/yargs/yargs/commit/2e5ce0f)) +* address positional argument strict() bug introduced in [#766](https://github.com/yargs/yargs/issues/766) ([#784](https://github.com/yargs/yargs/issues/784)) ([a8528e6](https://github.com/yargs/yargs/commit/a8528e6)) +* console.warn() rather than throwing errors when api signatures are incorrect ([#804](https://github.com/yargs/yargs/issues/804)) ([a607061](https://github.com/yargs/yargs/commit/a607061)) +* context should override parsed argv ([#786](https://github.com/yargs/yargs/issues/786)) ([0997288](https://github.com/yargs/yargs/commit/0997288)) +* context variables are now recognized in strict() mode ([#796](https://github.com/yargs/yargs/issues/796)) ([48575cd](https://github.com/yargs/yargs/commit/48575cd)) +* errors were not bubbling appropriately from sub-commands to top-level ([#802](https://github.com/yargs/yargs/issues/802)) ([8a992f5](https://github.com/yargs/yargs/commit/8a992f5)) +* positional arguments of sub-commands threw strict() exception ([#805](https://github.com/yargs/yargs/issues/805)) ([f3f074b](https://github.com/yargs/yargs/commit/f3f074b)) +* pull in yargs-parser with modified env precedence ([#787](https://github.com/yargs/yargs/issues/787)) ([e0fbbe5](https://github.com/yargs/yargs/commit/e0fbbe5)) +* running parse() multiple times on the same yargs instance caused exception if help() enabled ([#790](https://github.com/yargs/yargs/issues/790)) ([07e39b7](https://github.com/yargs/yargs/commit/07e39b7)) +* use path.resolve() to support node 0.10 ([#797](https://github.com/yargs/yargs/issues/797)) ([49a93fc](https://github.com/yargs/yargs/commit/49a93fc)) + + +### Features + +* add conflicts and implies shorthands. ([#753](https://github.com/yargs/yargs/issues/753)) ([bd1472b](https://github.com/yargs/yargs/commit/bd1472b)) +* add traditional Chinese translation ([#780](https://github.com/yargs/yargs/issues/780)) ([6ab6a95](https://github.com/yargs/yargs/commit/6ab6a95)) +* allow provided config object to extend other configs ([#779](https://github.com/yargs/yargs/issues/779)) ([3280dd0](https://github.com/yargs/yargs/commit/3280dd0)) +* function argument validation ([#773](https://github.com/yargs/yargs/issues/773)) ([22ed9bb](https://github.com/yargs/yargs/commit/22ed9bb)) +* if only one column is provided for examples, allow it to take up the entire line ([#749](https://github.com/yargs/yargs/issues/749)) ([7931652](https://github.com/yargs/yargs/commit/7931652)) +* introduce custom yargs error object ([#765](https://github.com/yargs/yargs/issues/765)) ([8308efa](https://github.com/yargs/yargs/commit/8308efa)) +* introduces support for default commands, using the '*' identifier ([#785](https://github.com/yargs/yargs/issues/785)) ([d78a0f5](https://github.com/yargs/yargs/commit/d78a0f5)) +* rethink how options are inherited by commands ([#766](https://github.com/yargs/yargs/issues/766)) ([ab1fa4b](https://github.com/yargs/yargs/commit/ab1fa4b)) + + +### BREAKING CHANGES + +* `extends` key in config file is now used for extending other config files +* environment variables now take precedence over config files. +* context now takes precedence over argv and defaults +* the arguments passed to functions are now validated, there's a good chance this will throw exceptions for a few folks who are using the API in an unexpected way. +* by default options, and many of yargs' parsing helpers will now default to being applied globally; such that they are no-longer reset before being passed into commands. +* yargs will no longer aggressively suppress errors, allowing errors that are not generated internally to bubble. + + + + +# [6.6.0](https://github.com/yargs/yargs/compare/v6.5.0...v6.6.0) (2016-12-29) + + +### Bug Fixes + +* [object Object] was accidentally being populated on options object ([#736](https://github.com/yargs/yargs/issues/736)) ([f755e27](https://github.com/yargs/yargs/commit/f755e27)) +* do not use cwd when resolving package.json for yargs parsing config ([#726](https://github.com/yargs/yargs/issues/726)) ([9bdaab7](https://github.com/yargs/yargs/commit/9bdaab7)) + + +### Features + +* implement conflicts() for defining mutually exclusive arguments; thanks [@madcampos](https://github.com/madcampos)! ([#741](https://github.com/yargs/yargs/issues/741)) ([5883779](https://github.com/yargs/yargs/commit/5883779)) +* split demand() into demandCommand()/demandOption() ([#740](https://github.com/yargs/yargs/issues/740)) ([66573c8](https://github.com/yargs/yargs/commit/66573c8)) +* support for positional argument aliases ([#727](https://github.com/yargs/yargs/issues/727)) ([27e1a57](https://github.com/yargs/yargs/commit/27e1a57)) + + + + +# [6.5.0](https://github.com/yargs/yargs/compare/v6.4.0...v6.5.0) (2016-12-01) + + +### Bug Fixes + +* still freeze/unfreeze if parse() is called in isolation ([#717](https://github.com/yargs/yargs/issues/717)) ([30a9492](https://github.com/yargs/yargs/commit/30a9492)) + + +### Features + +* pull in yargs-parser introducing additional settings ([#688](https://github.com/yargs/yargs/issues/688)), and fixing [#716](https://github.com/yargs/yargs/issues/716) ([#722](https://github.com/yargs/yargs/issues/722)) ([702995a](https://github.com/yargs/yargs/commit/702995a)) + + + + +# [6.4.0](https://github.com/yargs/yargs/compare/v6.3.0...v6.4.0) (2016-11-13) + + +### Bug Fixes + +* **locales:** correct some Russian translations ([#691](https://github.com/yargs/yargs/issues/691)) ([a980671](https://github.com/yargs/yargs/commit/a980671)) + + +### Features + +* **locales:** Added Belarusian translation ([#690](https://github.com/yargs/yargs/issues/690)) ([68dac1f](https://github.com/yargs/yargs/commit/68dac1f)) +* **locales:** Create nl.json ([#687](https://github.com/yargs/yargs/issues/687)) ([46ce1bb](https://github.com/yargs/yargs/commit/46ce1bb)) +* update to yargs-parser that addresses [#598](https://github.com/yargs/yargs/issues/598), [#617](https://github.com/yargs/yargs/issues/617) ([#700](https://github.com/yargs/yargs/issues/700)) ([54cb31d](https://github.com/yargs/yargs/commit/54cb31d)) +* yargs is now passed as the third-argument to fail handler ([#613](https://github.com/yargs/yargs/issues/613)) ([21b74f9](https://github.com/yargs/yargs/commit/21b74f9)) + + +### Performance Improvements + +* normalizing package data is an expensive operation ([#705](https://github.com/yargs/yargs/issues/705)) ([49cf533](https://github.com/yargs/yargs/commit/49cf533)) + + + + +# [6.3.0](https://github.com/yargs/yargs/compare/v6.2.0...v6.3.0) (2016-10-19) + + +### Bug Fixes + +* **command:** subcommands via commandDir() now supported for parse(msg, cb) ([#678](https://github.com/yargs/yargs/issues/678)) ([6b85cc6](https://github.com/yargs/yargs/commit/6b85cc6)) + + +### Features + +* **locales:** Add Thai locale file ([#679](https://github.com/yargs/yargs/issues/679)) ([c05e36b](https://github.com/yargs/yargs/commit/c05e36b)) + + + + +# [6.2.0](https://github.com/yargs/yargs/compare/v6.1.1...v6.2.0) (2016-10-16) + + +### Bug Fixes + +* stop applying parser to context object ([#675](https://github.com/yargs/yargs/issues/675)) ([3fe9b8f](https://github.com/yargs/yargs/commit/3fe9b8f)) + + +### Features + +* add new pt_BR translations ([#674](https://github.com/yargs/yargs/issues/674)) ([5615a82](https://github.com/yargs/yargs/commit/5615a82)) +* Italian translations for 'did you mean' and 'aliases' ([#673](https://github.com/yargs/yargs/issues/673)) ([81984e6](https://github.com/yargs/yargs/commit/81984e6)) + + + + +## [6.1.1](https://github.com/yargs/yargs/compare/v6.1.0...v6.1.1) (2016-10-15) + + +### Bug Fixes + +* freeze was not resetting configObjects to initial state; addressed performance issue raised by [@nexdrew](https://github.com/nexdrew). ([#670](https://github.com/yargs/yargs/issues/670)) ([ae4bcd4](https://github.com/yargs/yargs/commit/ae4bcd4)) + + + + +# [6.1.0](https://github.com/yargs/yargs/compare/v6.0.0...v6.1.0) (2016-10-15) + + +### Bug Fixes + +* **locales:** change some translations ([#667](https://github.com/yargs/yargs/issues/667)) ([aa966c5](https://github.com/yargs/yargs/commit/aa966c5)) +* **locales:** conform hi locale to y18n.__n expectations ([#666](https://github.com/yargs/yargs/issues/666)) ([22adb18](https://github.com/yargs/yargs/commit/22adb18)) + + +### Features + +* initial support for command aliases ([#647](https://github.com/yargs/yargs/issues/647)) ([127a040](https://github.com/yargs/yargs/commit/127a040)) +* **command:** add camelcase commands to argv ([#658](https://github.com/yargs/yargs/issues/658)) ([b1cabae](https://github.com/yargs/yargs/commit/b1cabae)) +* **locales:** add Hindi translations ([9290912](https://github.com/yargs/yargs/commit/9290912)) +* **locales:** add Hungarian translations ([be92327](https://github.com/yargs/yargs/commit/be92327)) +* **locales:** Japanese translations for 'did you mean' and 'aliases' ([#651](https://github.com/yargs/yargs/issues/651)) ([5eb78fc](https://github.com/yargs/yargs/commit/5eb78fc)) +* **locales:** Polish translations for 'did you mean' and 'aliases' ([#650](https://github.com/yargs/yargs/issues/650)) ([c951c0e](https://github.com/yargs/yargs/commit/c951c0e)) +* reworking yargs API to make it easier to run in headless environments, e.g., Slack ([#646](https://github.com/yargs/yargs/issues/646)) ([f284c29](https://github.com/yargs/yargs/commit/f284c29)) +* Turkish translations for 'did you mean' and 'aliases' ([#660](https://github.com/yargs/yargs/issues/660)) ([072fd45](https://github.com/yargs/yargs/commit/072fd45)) + + + + +# [6.0.0](https://github.com/yargs/yargs/compare/v5.0.0...v6.0.0) (2016-09-30) + + +### Bug Fixes + +* changed parsing of the command string to ignore extra spaces ([#600](https://github.com/yargs/yargs/issues/600)) ([e8e5a72](https://github.com/yargs/yargs/commit/e8e5a72)) +* drop lodash.assign ([#641](https://github.com/yargs/yargs/issues/641)) ([ad3146f](https://github.com/yargs/yargs/commit/ad3146f)) +* for args that have skipValidation set to `true`, check if the parsed arg is `true` ([#619](https://github.com/yargs/yargs/issues/619)) ([658a34c](https://github.com/yargs/yargs/commit/658a34c)) +* upgrade standard, and fix appveyor config so that it works with newest standard ([#607](https://github.com/yargs/yargs/issues/607)) ([c301f42](https://github.com/yargs/yargs/commit/c301f42)) + + +### Chores + +* upgrade yargs-parser ([#633](https://github.com/yargs/yargs/issues/633)) ([cc1224e](https://github.com/yargs/yargs/commit/cc1224e)) + + +### Features + +* make opts object optional for .option() ([#624](https://github.com/yargs/yargs/issues/624)) ([4f29de6](https://github.com/yargs/yargs/commit/4f29de6)) + + +### Performance Improvements + +* defer windowWidth() to improve perf for non-help usage ([#610](https://github.com/yargs/yargs/issues/610)) ([cbc3636](https://github.com/yargs/yargs/commit/cbc3636)) + + +### BREAKING CHANGES + +* coerce is now applied as a final step after other parsing is complete + + + + +# [5.0.0](https://github.com/yargs/yargs/compare/v4.8.1...v5.0.0) (2016-08-14) + + +### Bug Fixes + +* **default:** Remove undocumented alias of default() ([#469](https://github.com/yargs/yargs/issues/469)) ([b8591b2](https://github.com/yargs/yargs/commit/b8591b2)) +* remove deprecated zh.json ([#578](https://github.com/yargs/yargs/issues/578)) ([317c62c](https://github.com/yargs/yargs/commit/317c62c)) + + +### Features + +* .help() API can now enable implicit help command ([#574](https://github.com/yargs/yargs/issues/574)) ([7645019](https://github.com/yargs/yargs/commit/7645019)) +* **command:** builder function no longer needs to return the yargs instance ([#549](https://github.com/yargs/yargs/issues/549)) ([eaa2873](https://github.com/yargs/yargs/commit/eaa2873)) +* add coerce api ([#586](https://github.com/yargs/yargs/issues/586)) ([1d53ccb](https://github.com/yargs/yargs/commit/1d53ccb)) +* adds recommendCommands() for command suggestions ([#580](https://github.com/yargs/yargs/issues/580)) ([59474dc](https://github.com/yargs/yargs/commit/59474dc)) +* apply .env() globally ([#553](https://github.com/yargs/yargs/issues/553)) ([be65728](https://github.com/yargs/yargs/commit/be65728)) +* apply default builder to command() and apply fail() handlers globally ([#583](https://github.com/yargs/yargs/issues/583)) ([0aaa68b](https://github.com/yargs/yargs/commit/0aaa68b)) +* update yargs-parser to version 3.1.0 ([#581](https://github.com/yargs/yargs/issues/581)) ([882a127](https://github.com/yargs/yargs/commit/882a127)) + + +### Performance Improvements + +* defer requiring most external libs until needed ([#584](https://github.com/yargs/yargs/issues/584)) ([f9b0ed4](https://github.com/yargs/yargs/commit/f9b0ed4)) + + +### BREAKING CHANGES + +* fail is now applied globally. +* we now default to an empty builder function when command is executed with no builder. +* yargs-parser now better handles negative integer values, at the cost of handling numeric option names, e.g., -1 hello +* default: removed undocumented `defaults` alias for `default`. +* introduces a default `help` command which outputs help, as an alternative to a help flag. +* interpret demand() numbers as relative to executing command ([#582](https://github.com/yargs/yargs/issues/582)) ([927810c](https://github.com/yargs/yargs/commit/927810c)) + + + + +## [4.8.1](https://github.com/yargs/yargs/compare/v4.8.0...v4.8.1) (2016-07-16) + + +### Bug Fixes + +* **commandDir:** make dir relative to caller instead of require.main.filename ([#548](https://github.com/yargs/yargs/issues/548)) ([3c2e479](https://github.com/yargs/yargs/commit/3c2e479)) +* add config lookup for .implies() ([#556](https://github.com/yargs/yargs/issues/556)) ([8d7585c](https://github.com/yargs/yargs/commit/8d7585c)) +* cache pkg lookups by path to avoid returning the wrong one ([#552](https://github.com/yargs/yargs/issues/552)) ([fea7e0b](https://github.com/yargs/yargs/commit/fea7e0b)) +* positional arguments were not being handled appropriately by parse() ([#559](https://github.com/yargs/yargs/issues/559)) ([063a866](https://github.com/yargs/yargs/commit/063a866)) +* pull in [@nexdrew](https://github.com/nexdrew)'s fixes to yargs-parser ([#560](https://github.com/yargs/yargs/issues/560)) ([c77c080](https://github.com/yargs/yargs/commit/c77c080)), closes [#560](https://github.com/yargs/yargs/issues/560) + + + + +# [4.8.0](https://github.com/yargs/yargs/compare/v4.7.1...v4.8.0) (2016-07-09) + + +### Bug Fixes + +* drop unused camelcase dependency fixes [#516](https://github.com/yargs/yargs/issues/516) ([#525](https://github.com/yargs/yargs/issues/525)) ([365fb9a](https://github.com/yargs/yargs/commit/365fb9a)), closes [#516](https://github.com/yargs/yargs/issues/516) [#525](https://github.com/yargs/yargs/issues/525) +* fake a tty in tests, so that we can use the new set-blocking ([#512](https://github.com/yargs/yargs/issues/512)) ([a54c742](https://github.com/yargs/yargs/commit/a54c742)) +* ignore invalid package.json during read-pkg-up ([#546](https://github.com/yargs/yargs/issues/546)) ([e058c87](https://github.com/yargs/yargs/commit/e058c87)) +* keep both zh and zh_CN until yargs[@5](https://github.com/5).x ([0f8faa7](https://github.com/yargs/yargs/commit/0f8faa7)) +* lazy-load package.json and cache. get rid of pkg-conf dependency. ([#544](https://github.com/yargs/yargs/issues/544)) ([2609b2e](https://github.com/yargs/yargs/commit/2609b2e)) +* we now respect the order of _ when applying commands ([#537](https://github.com/yargs/yargs/issues/537)) ([ed86b78](https://github.com/yargs/yargs/commit/ed86b78)) + + +### Features + +* add .commandDir(dir) to API to apply all command modules from a relative directory ([#494](https://github.com/yargs/yargs/issues/494)) ([b299dff](https://github.com/yargs/yargs/commit/b299dff)) +* **command:** derive missing command string from module filename ([#527](https://github.com/yargs/yargs/issues/527)) ([20d4b8a](https://github.com/yargs/yargs/commit/20d4b8a)) +* builder is now optional for a command module ([#545](https://github.com/yargs/yargs/issues/545)) ([8d6ad6e](https://github.com/yargs/yargs/commit/8d6ad6e)) + + + + +## [4.7.1](https://github.com/yargs/yargs/compare/v4.7.0...v4.7.1) (2016-05-15) + + +### Bug Fixes + +* switch to using `const` rather than `var` ([#499](https://github.com/yargs/yargs/pull/499)) +* make stdout flush on newer versions of Node.js ([#501](https://github.com/yargs/yargs/issues/501)) ([9f8c6f4](https://github.com/yargs/yargs/commit/9f8c6f4)) + + + + +# [4.7.0](https://github.com/yargs/yargs/compare/v4.6.0...v4.7.0) (2016-05-02) + + +### Bug Fixes + +* **pkgConf:** fix aliases issues in .pkgConf() ([#478](https://github.com/yargs/yargs/issues/478))([b900502](https://github.com/yargs/yargs/commit/b900502)) + + +### Features + +* **completion:** allow to get completions for any string, not just process.argv ([#470](https://github.com/yargs/yargs/issues/470))([74fcfbc](https://github.com/yargs/yargs/commit/74fcfbc)) +* **configuration:** Allow to directly pass a configuration object to .config() ([#480](https://github.com/yargs/yargs/issues/480))([e0a7e05](https://github.com/yargs/yargs/commit/e0a7e05)) +* **validation:** Add .skipValidation() method ([#471](https://github.com/yargs/yargs/issues/471))([d72badb](https://github.com/yargs/yargs/commit/d72badb)) + + + + +# [4.6.0](https://github.com/yargs/yargs/compare/v4.5.0...v4.6.0) (2016-04-11) + + +### Bug Fixes + +* **my brand!:** I agree with [@osher](https://github.com/osher) lightweight isn't a huge selling point of ours any longer, see [#468](https://github.com/yargs/yargs/issues/468) ([c46d7e1](https://github.com/yargs/yargs/commit/c46d7e1)) + +### Features + +* switch to standard-version for release management ([f70f801](https://github.com/yargs/yargs/commit/f70f801)) +* upgrade to version of yargs-parser that introduces some slick new features, great work [@elas7](https://github.com/elas7). update cliui, replace win-spawn, replace badge. ([#475](https://github.com/yargs/yargs/issues/475)) ([f915dd4](https://github.com/yargs/yargs/commit/f915dd4)) + + + + +# [4.5.0](https://github.com/yargs/yargs/compare/v4.4.0...v4.5.0) (2016-04-05) + + +### Bug Fixes + +* **windows:** handle $0 better on Windows platforms ([eb6e03f](https://github.com/yargs/yargs/commit/eb6e03f)) + +### Features + +* **commands:** implemented variadic positional arguments ([51d926e](https://github.com/yargs/yargs/commit/51d926e)) +* **completion:** completion now better handles aliases, and avoids duplicating keys. ([86416c8](https://github.com/yargs/yargs/commit/86416c8)) +* **config:** If invoking .config() without parameters, set a default option ([0413dd1](https://github.com/yargs/yargs/commit/0413dd1)) +* **conventional-changelog:** switching to using conventional-changelog for generating the changelog ([a2b5a2a](https://github.com/yargs/yargs/commit/a2b5a2a)) + + + +### v4.4.0 (2016/04/03 21:10 +07:00) + +- [#454](https://github.com/yargs/yargs/pull/454) fix demand() when second argument is an array (@elas7) +- [#452](https://github.com/yargs/yargs/pull/452) fix code example for `.help()` docs (@maxrimue) +- [#450](https://github.com/yargs/yargs/pull/450) fix for bash completion trailing space edge-case (@elas7) +- [#448](https://github.com/yargs/yargs/pull/448) allow a method to be passed to `showHelp`, rather than a log-level (@osher) +- [#446](https://github.com/yargs/yargs/pull/446) update yargs-parser, y18n, nyc, cliui, pkg-conf (@bcoe) +- [#436](https://github.com/yargs/yargs/pull/436) the rebase method is only used by tests, do not export it in two places (@elas7) +- [#428](https://github.com/yargs/yargs/pull/428) initial support for subcommands (@nexdrew) + +### v4.3.2 (2016/3/20 15:07 +07:00) + +- [#445](https://github.com/yargs/yargs/pull/445) strict mode was failing if no commands were registered (@nexdrew) +- [#443](https://github.com/yargs/yargs/pull/443) adds Italian translation \o/ (@madrisan) +- [#441](https://github.com/yargs/yargs/pull/441) remove duplicate keys from array options configuration (@elas7) +- [#437](https://github.com/yargs/yargs/pull/437) standardize tests for .command() (@lrlna) + +### v4.3.0 (2016/3/12 14:19 +07:00) + +- [#432](https://github.com/yargs/yargs/pull/432) non-singleton version of yargs (@bcoe) +- [#422, #425, #420] translations for number (@zkat, @rilut, @maxrimue, @watilde) +- [#414](https://github.com/yargs/yargs/pull/414) all command options can be defined in module now (@nexdrew) + +### v4.2.0 (2016/2/22 11:02 +07:00) + +- [#395](https://github.com/yargs/yargs/pull/395) do not reset groups if they contain + global keys (@novemberborn) +- [#393](https://github.com/yargs/yargs/pull/393) use sane default for usage strings (@nexdrew) +- [#392](https://github.com/yargs/yargs/pull/392) resetting wrap() was causing layout issues + with commands (@nexdrew) +- [#391](https://github.com/yargs/yargs/pull/391) commands were being added multiple times (@nexdrew) + +### v4.0.0 (2016/2/14 1:27 +07:00) + +- [#384](https://github.com/bcoe/yargs/pull/384) add new number type to yargs (@lrlna, @maxrimue) +- [#382](https://github.com/bcoe/yargs/pull/382) pass error as extra parameter to fail (@gajus) +- [#378](https://github.com/bcoe/yargs/pull/378) introduces the pkgConf feature, which tells + yargs to load default argument values from a key on a project's package.json (@bcoe) +- [#376](https://github.com/bcoe/yargs/pull/376) **breaking change**, make help() method signature + more consistent with other commands (@maxrimue) +- [#368](https://github.com/bcoe/yargs/pull/368) **breaking change**, overhaul to command handling API: + introducing named positional arguments, commands as modules, introduces the concept of global options (options that don't reset). (@nexdrew, @bcoe). +- [#364](https://github.com/bcoe/yargs/pull/364) add the slick new yargs website to the package.json (@iarna). +- [#357](https://github.com/bcoe/yargs/pull/357) .strict() now requires that a valid command is provided (@lrlna) +- [#356](https://github.com/bcoe/yargs/pull/356) pull the parsing bits of yargs into the separate module yargs-parser. Various parsing options can now be turned on and off using configuration (@bcoe). +- [#330](https://github.com/bcoe/yargs/pull/330) **breaking change**, fix inconsistencies with `.version()` API. (@maxrimue). + +### v3.32.0 (2016/1/14 10:13 +07:00) + +- [#344](https://github.com/bcoe/yargs/pull/344) yargs now has a code of conduct and contributor guidelines (@bcoe) +- [#341](https://github.com/bcoe/yargs/issues/341) Fix edge-case with camel-case arguments (@davibe) +- [#331](https://github.com/bcoe/yargs/pull/331) Handle parsing a raw argument string (@kellyselden) +- [#325](https://github.com/bcoe/yargs/pull/325) Tweaks to make tests pass again on Windows (@isaacs) +- [#321](https://github.com/bcoe/yargs/pull/321) Custom config parsing function (@bcoe) + +### v3.31.0 (2015/12/03 10:15 +07:00) + +- [#239](https://github.com/bcoe/yargs/pull/239) Pass argv to commands (@bcoe) +- [#308](https://github.com/bcoe/yargs/pull/308) Yargs now handles environment variables (@nexdrew) +- [#302](https://github.com/bcoe/yargs/pull/302) Add Indonesian translation (@rilut) +- [#300](https://github.com/bcoe/yargs/pull/300) Add Turkish translation (@feyzo) +- [#298](https://github.com/bcoe/yargs/pull/298) Add Norwegian Bokmål translation (@sindresorhus) +- [#297](https://github.com/bcoe/yargs/pull/297) Fix for layout of cjk characters (@disjukr) +- [#296](https://github.com/bcoe/yargs/pull/296) Add Korean translation (@disjukr) + +### v3.30.0 (2015/11/13 16:29 +07:00) + +- [#293](https://github.com/bcoe/yargs/pull/293) Polish language support (@kamilogorek) +- [#291](https://github.com/bcoe/yargs/pull/291) fix edge-cases with `.alias()` (@bcoe) +- [#289](https://github.com/bcoe/yargs/pull/289) group options in custom groups (@bcoe) + +### v3.29.0 (2015/10/16 21:51 +07:00) + +- [#282](https://github.com/bcoe/yargs/pull/282) completions now accept promises (@LinusU) +- [#281](https://github.com/bcoe/yargs/pull/281) fix parsing issues with dot notation (@bcoe) + +### v3.28.0 (2015/10/16 1:55 +07:00) + +- [#277](https://github.com/bcoe/yargs/pull/277) adds support for ansi escape codes (@bcoe) + +### v3.27.0 (2015/10/08 1:55 +00:00) + +- [#271](https://github.com/bcoe/yargs/pull/273) skips validation for help or version flags with exitProcess(false) (@tepez) +- [#273](https://github.com/bcoe/yargs/pull/273) implements single output for errors with exitProcess(false) (@nexdrew) +- [#269](https://github.com/bcoe/yargs/pull/269) verifies single output for errors with exitProcess(false) (@tepez) +- [#268](https://github.com/bcoe/yargs/pull/268) adds Chinese translation (@qiu8310) +- [#266](https://github.com/bcoe/yargs/pull/266) adds case for -- after -- in parser test (@geophree) + +### v3.26.0 (2015/09/25 2:14 +00:00) + +- [#263](https://github.com/bcoe/yargs/pull/263) document count() and option() object keys (@nexdrew) +- [#259](https://github.com/bcoe/yargs/pull/259) remove util in readme (@38elements) +- [#258](https://github.com/bcoe/yargs/pull/258) node v4 builds, update deps (@nexdrew) +- [#257](https://github.com/bcoe/yargs/pull/257) fix spelling errors (@dkoleary88) + +### v3.25.0 (2015/09/13 7:38 -07:00) + +- [#254](https://github.com/bcoe/yargs/pull/254) adds Japanese translation (@oti) +- [#253](https://github.com/bcoe/yargs/pull/253) fixes for tests on Windows (@bcoe) + +### v3.24.0 (2015/09/04 12:02 +00:00) + +- [#248](https://github.com/bcoe/yargs/pull/248) reinstate os-locale, no spawning (@nexdrew) +- [#249](https://github.com/bcoe/yargs/pull/249) use travis container-based infrastructure (@nexdrew) +- [#247](https://github.com/bcoe/yargs/pull/247) upgrade standard (@nexdrew) + +### v3.23.0 (2015/08/30 23:00 +00:00) + +- [#246](https://github.com/bcoe/yargs/pull/246) detect locale based only on environment variables (@bcoe) +- [#244](https://github.com/bcoe/yargs/pull/244) adds Windows CI testing (@bcoe) +- [#245](https://github.com/bcoe/yargs/pull/245) adds OSX CI testing (@bcoe, @nexdrew) + +### v3.22.0 (2015/08/28 22:26 +00:00) +- [#242](https://github.com/bcoe/yargs/pull/242) adds detectLocale config option (@bcoe) + +### v3.21.1 (2015/08/28 20:58 +00:00) +- [#240](https://github.com/bcoe/yargs/pull/240) hot-fix for Atom on Windows (@bcoe) + +### v3.21.0 (2015/08/21 21:20 +00:00) +- [#238](https://github.com/bcoe/yargs/pull/238) upgrade camelcase, window-size, chai, mocha (@nexdrew) +- [#237](https://github.com/bcoe/yargs/pull/237) adds defaultDescription to option() (@nexdrew) + +### v3.20.0 (2015/08/20 01:29 +00:00) +- [#231](https://github.com/bcoe/yargs/pull/231) Merge pull request #231 from bcoe/detect-locale (@sindresorhus) +- [#235](https://github.com/bcoe/yargs/pull/235) adds german translation to yargs (@maxrimue) + +### v3.19.0 (2015/08/14 05:12 +00:00) +- [#224](https://github.com/bcoe/yargs/pull/224) added Portuguese translation (@codemonkey3045) + +### v3.18.1 (2015/08/12 05:53 +00:00) + +- [#228](https://github.com/bcoe/yargs/pull/228) notes about embedding yargs in Electron (@etiktin) +- [#223](https://github.com/bcoe/yargs/pull/223) make booleans work in config files (@sgentle) + +### v3.18.0 (2015/08/06 20:05 +00:00) +- [#222](https://github.com/bcoe/yargs/pull/222) updates fr locale (@nexdrew) +- [#221](https://github.com/bcoe/yargs/pull/221) adds missing locale strings (@nexdrew) +- [#220](https://github.com/bcoe/yargs/pull/220) adds es locale (@zkat) + +### v3.17.1 (2015/08/02 19:35 +00:00) +- [#218](https://github.com/bcoe/yargs/pull/218) upgrades nyc (@bcoe) + +### v3.17.0 (2015/08/02 18:39 +00:00) +- [#217](https://github.com/bcoe/yargs/pull/217) sort methods in README.md (@nexdrew) +- [#215](https://github.com/bcoe/yargs/pull/215) adds fr locale (@LoicMahieu) + +### v3.16.0 (2015/07/30 04:35 +00:00) +- [#210](https://github.com/bcoe/yargs/pull/210) adds i18n support to yargs (@bcoe) +- [#209](https://github.com/bcoe/yargs/pull/209) adds choices type to yargs (@nexdrew) +- [#207](https://github.com/bcoe/yargs/pull/207) pretty new shields from shields.io (@SimenB) +- [#208](https://github.com/bcoe/yargs/pull/208) improvements to README.md (@nexdrew) +- [#205](https://github.com/bcoe/yargs/pull/205) faster build times on Travis (@ChristianMurphy) + +### v3.15.0 (2015/07/06 06:01 +00:00) +- [#197](https://github.com/bcoe/yargs/pull/197) tweaks to how errors bubble up from parser.js (@bcoe) +- [#193](https://github.com/bcoe/yargs/pull/193) upgraded nyc, reporting now happens by default (@bcoe) + +### v3.14.0 (2015/06/28 02:12 +00:00) + +- [#192](https://github.com/bcoe/yargs/pull/192) standard style nits (@bcoe) +- [#190](https://github.com/bcoe/yargs/pull/190) allow for hidden commands, e.g., + .completion('completion', false) (@tschaub) + +### v3.13.0 (2015/06/24 04:12 +00:00) + +- [#187](https://github.com/bcoe/yargs/pull/187) completion now behaves differently + if it is being run in the context of a command (@tschaub) +- [#186](https://github.com/bcoe/yargs/pull/186) if no matches are found for a completion + default to filename completion (@tschaub) + +### v3.12.0 (2015/06/19 03:23 +00:00) +- [#183](https://github.com/bcoe/yargs/pull/183) don't complete commands if they've already been completed (@tschaub) +- [#181](https://github.com/bcoe/yargs/pull/181) various fixes for completion. (@bcoe, @tschaub) +- [#182](https://github.com/bcoe/yargs/pull/182) you can now set a maximum # of of required arguments (@bcoe) + +### v3.11.0 (2015/06/15 05:15 +00:00) + +- [#173](https://github.com/bcoe/yargs/pull/173) update standard, window-size, chai (@bcoe) +- [#171](https://github.com/bcoe/yargs/pull/171) a description can now be set + when providing a config option. (@5c077yP) + +### v3.10.0 (2015/05/29 04:25 +00:00) + +- [#165](https://github.com/bcoe/yargs/pull/165) expose yargs.terminalWidth() thanks @ensonic (@bcoe) +- [#164](https://github.com/bcoe/yargs/pull/164) better array handling thanks @getify (@bcoe) + +### v3.9.1 (2015/05/20 05:14 +00:00) +- [b6662b6](https://github.com/bcoe/yargs/commit/b6662b6774cfeab4876f41ec5e2f67b7698f4e2f) clarify .config() docs (@linclark) +- [0291360](https://github.com/bcoe/yargs/commit/02913606285ce31ce81d7f12c48d8a3029776ec7) fixed tests, switched to nyc for coverage, fixed security issue, added Lin as collaborator (@bcoe) + +### v3.9.0 (2015/05/10 18:32 +00:00) +- [#157](https://github.com/bcoe/yargs/pull/157) Merge pull request #157 from bcoe/command-yargs. allows handling of command specific arguments. Thanks for the suggestion @ohjames (@bcoe) +- [#158](https://github.com/bcoe/yargs/pull/158) Merge pull request #158 from kemitchell/spdx-license. Update license format (@kemitchell) + +### v3.8.0 (2015/04/24 23:10 +00:00) +- [#154](https://github.com/bcoe/yargs/pull/154) showHelp's method signature was misleading fixes #153 (@bcoe) +- [#151](https://github.com/bcoe/yargs/pull/151) refactor yargs' table layout logic to use new helper library (@bcoe) +- [#150](https://github.com/bcoe/yargs/pull/150) Fix README example in argument requirements (@annonymouse) + +### v3.7.2 (2015/04/13 11:52 -07:00) + +* [679fbbf](https://github.com/bcoe/yargs/commit/679fbbf55904030ccee8a2635e8e5f46551ab2f0) updated yargs to use the [standard](https://github.com/feross/standard) style guide (agokjr) +* [22382ee](https://github.com/bcoe/yargs/commit/22382ee9f5b495bc2586c1758cd1091cec3647f9 various bug fixes for $0 (@nylen) + +### v3.7.1 (2015/04/10 11:06 -07:00) + +* [89e1992](https://github.com/bcoe/yargs/commit/89e1992a004ba73609b5f9ee6890c4060857aba4) detect iojs bin along with node bin. (@bcoe) +* [755509e](https://github.com/bcoe/yargs/commit/755509ea90041e5f7833bba3b8c5deffe56f0aab) improvements to example documentation in README.md (@rstacruz) +* [0d2dfc8](https://github.com/bcoe/yargs/commit/0d2dfc822a43418242908ad97ddd5291a1b35dc6) showHelp() no longer requires that .argv has been called (@bcoe) + +### v3.7.0 (2015/04/04 02:29 -07:00) + +* [56cbe2d](https://github.com/bcoe/yargs/commit/56cbe2ddd33dc176dcbf97ba40559864a9f114e4) make .requiresArg() work with type hints. (@bcoe). +* [2f5d562](https://github.com/bcoe/yargs/commit/2f5d5624f736741deeedf6a664d57bc4d857bdd0) serialize arrays and objects in usage strings. (@bcoe). +* [5126304](https://github.com/bcoe/yargs/commit/5126304dd18351fc28f10530616fdd9361e0af98) be more lenient about alias/primary key ordering in chaining API. (@bcoe) + +### v3.6.0 (2015/03/21 01:00 +00:00) +- [4e24e22](https://github.com/bcoe/yargs/commit/4e24e22e6a195e55ab943ede704a0231ac33b99c) support for .js configuration files. (@pirxpilot) + +### v3.5.4 (2015/03/12 05:56 +00:00) +- [c16cc08](https://github.com/bcoe/yargs/commit/c16cc085501155cf7fd853ccdf8584b05ab92b78) message for non-option arguments is now optional, thanks to (@raine) + +### v3.5.3 (2015/03/09 06:14 +00:00) +- [870b428](https://github.com/bcoe/yargs/commit/870b428cf515d560926ca392555b7ad57dba9e3d) completion script was missing in package.json (@bcoe) + +### v3.5.2 (2015/03/09 06:11 +00:00) +- [58a4b24](https://github.com/bcoe/yargs/commit/58a4b2473ebbb326713d522be53e32d3aabb08d2) parse was being called multiple times, resulting in strange behavior (@bcoe) + +### v3.5.1 (2015/03/09 04:55 +00:00) +- [4e588e0](https://github.com/bcoe/yargs/commit/4e588e055afbeb9336533095f051496e3977f515) accidentally left testing logic in (@bcoe) + +### v3.5.0 (2015/03/09 04:49 +00:00) +- [718bacd](https://github.com/bcoe/yargs/commit/718bacd81b9b44f786af76b2afe491fe06274f19) added support for bash completions see #4 (@bcoe) +- [a192882](https://github.com/bcoe/yargs/commit/a19288270fc431396c42af01125eeb4443664528) downgrade to mocha 2.1.0 until https://github.com/mochajs/mocha/issues/1585 can be sorted out (@bcoe) + +### v3.4.7 (2015/03/09 04:09 +00:00) +- [9845e5c](https://github.com/bcoe/yargs/commit/9845e5c1a9c684ba0be3f0bfb40e7b62ab49d9c8) the Argv singleton was not being updated when manually parsing arguments, fixes #114 (@bcoe) + +### v3.4.6 (2015/03/09 04:01 +00:00) +- [45b4c80](https://github.com/bcoe/yargs/commit/45b4c80b890d02770b0a94f326695a8a566e8fe9) set placeholders for all keys fixes #115 (@bcoe) + +### v3.4.5 (2015/03/01 20:31 +00:00) +- [a758e0b](https://github.com/bcoe/yargs/commit/a758e0b2556184f067cf3d9c4ef886d39817ebd2) fix for count consuming too many arguments (@bcoe) + +### v3.4.4 (2015/02/28 04:52 +00:00) +- [0476af7](https://github.com/bcoe/yargs/commit/0476af757966acf980d998b45108221d4888cfcb) added nargs feature, allowing you to specify the number of arguments after an option (@bcoe) +- [092477d](https://github.com/bcoe/yargs/commit/092477d7ab3efbf0ba11cede57f7d8cfc70b024f) updated README with full example of v3.0 API (@bcoe) + +### v3.3.3 (2015/02/28 04:23 +00:00) +- [0c4b769](https://github.com/bcoe/yargs/commit/0c4b769516cd8d93a7c4e5e675628ae0049aa9a8) remove string dependency, which conflicted with other libraries see #106 (@bcoe) + +### v3.3.2 (2015/02/28 04:11 +00:00) +- [2a98906](https://github.com/bcoe/yargs/commit/2a9890675821c0e7a12f146ce008b0562cb8ec9a) add $0 to epilog (@schnittstabil) + +### v3.3.1 (2015/02/24 03:28 +00:00) +- [ad485ce](https://github.com/bcoe/yargs/commit/ad485ce748ebdfce25b88ef9d6e83d97a2f68987) fix for applying defaults to camel-case args (@bcoe) + +### v3.3.0 (2015/02/24 00:49 +00:00) +- [8bfe36d](https://github.com/bcoe/yargs/commit/8bfe36d7fb0f93a799ea3f4c756a7467c320f8c0) fix and document restart() command, as a tool for building nested CLIs (@bcoe) + +### v3.2.1 (2015/02/22 05:45 +00:00) +- [49a6d18](https://github.com/bcoe/yargs/commit/49a6d1822a4ef9b1ea6f90cc366be60912628885) you can now provide a function that generates a default value (@bcoe) + +### v3.2.0 (2015/02/22 05:24 +00:00) +- [7a55886](https://github.com/bcoe/yargs/commit/7a55886c9343cf71a20744ca5cdd56d2ea7412d5) improvements to yargs two-column text layout (@bcoe) +- [b6ab513](https://github.com/bcoe/yargs/commit/b6ab5136a4c3fa6aa496f6b6360382e403183989) Tweak NPM version badge (@nylen) + +### v3.1.0 (2015/02/19 19:37 +00:00) +- [9bd2379](https://github.com/bcoe/yargs/commit/9bd237921cf1b61fd9f32c0e6d23f572fc225861) version now accepts a function, making it easy to load version #s from a package.json (@bcoe) + +### v3.0.4 (2015/02/14 01:40 +00:00) +- [0b7c19b](https://github.com/bcoe/yargs/commit/0b7c19beaecb747267ca4cc10e5cb2a8550bc4b7) various fixes for dot-notation handling (@bcoe) + +### v3.0.3 (2015/02/14 00:59 +00:00) +- [c3f35e9](https://github.com/bcoe/yargs/commit/c3f35e99bd5a0d278073fcadd95e2d778616cc17) make sure dot-notation is applied to aliases (@bcoe) + +### 3.0.2 (2015/02/13 16:50 +00:00) +- [74c8967](https://github.com/bcoe/yargs/commit/74c8967c340c204a0a7edf8a702b6f46c2705435) document epilog shorthand of epilogue. (@bcoe) +- [670110f](https://github.com/bcoe/yargs/commit/670110fc01bedc4831b6fec6afac54517d5a71bc) any non-truthy value now causes check to fail see #76 (@bcoe) +- [0d8f791](https://github.com/bcoe/yargs/commit/0d8f791a33c11ced4cd431ea8d3d3a337d456b56) finished implementing my wish-list of fetures for yargs 3.0. see #88 (@bcoe) +- [5768447](https://github.com/bcoe/yargs/commit/5768447447c4c8e8304f178846206ce86540f063) fix coverage. (@bcoe) +- [82e793f](https://github.com/bcoe/yargs/commit/82e793f3f61c41259eaacb67f0796aea2cf2aaa0) detect console width and perform word-wrapping. (@bcoe) +- [67476b3](https://github.com/bcoe/yargs/commit/67476b37eea07fee55f23f35b9e0c7d76682b86d) refactor two-column table layout so that we can use it for examples and usage (@bcoe) +- [4724cdf](https://github.com/bcoe/yargs/commit/4724cdfcc8e37ae1ca3dcce9d762f476e9ef4bb4) major refactor of index.js, in prep for 3.x release. (@bcoe) + +### v2.3.0 (2015/02/08 20:41 +00:00) +- [d824620](https://github.com/bcoe/yargs/commit/d824620493df4e63664af1fe320764dd1a9244e6) allow for undefined boolean defaults (@ashi009) + +### v2.2.0 (2015/02/08 20:07 +00:00) +- [d6edd98](https://github.com/bcoe/yargs/commit/d6edd9848826e7389ed1393858c45d03961365fd) in-prep for further refactoring, and a 3.x release I've shuffled some things around and gotten test-coverage to 100%. (@bcoe) + +### v2.1.2 (2015/02/08 06:05 +00:00) +- [d640745](https://github.com/bcoe/yargs/commit/d640745a7b9f8d476e0223879d056d18d9c265c4) switch to path.relative (@bcoe) +- [3bfd41f](https://github.com/bcoe/yargs/commit/3bfd41ff262a041f29d828b88936a79c63cad594) remove mocha.opts. (@bcoe) +- [47a2f35](https://github.com/bcoe/yargs/commit/47a2f357091db70903a402d6765501c1d63f15fe) document using .string('_') for string ids. see #56 (@bcoe) +- [#57](https://github.com/bcoe/yargs/pull/57) Merge pull request #57 from eush77/option-readme (@eush77) + +### v2.1.1 (2015/02/06 08:08 +00:00) +- [01c6c61](https://github.com/bcoe/yargs/commit/01c6c61d67b4ebf88f41f0b32a345ec67f0ac17d) fix for #71, 'newAliases' of undefined (@bcoe) + +### v2.1.0 (2015/02/06 07:59 +00:00) +- [6a1a3fa](https://github.com/bcoe/yargs/commit/6a1a3fa731958e26ccd56885f183dd8985cc828f) try to guess argument types, and apply sensible defaults see #73 (@bcoe) + +### v2.0.1 (2015/02/06 07:54 +00:00) +- [96a06b2](https://github.com/bcoe/yargs/commit/96a06b2650ff1d085a52b7328d8bba614c20cc12) Fix for strange behavior with --sort option, see #51 (@bcoe) + +### v2.0.0 (2015/02/06 07:45 +00:00) +- [0250517](https://github.com/bcoe/yargs/commit/0250517c9643e53f431b824e8ccfa54937414011) - [108fb84](https://github.com/bcoe/yargs/commit/108fb8409a3a63dcaf99d917fe4dfcfaa1de236d) fixed bug with boolean parsing, when bools separated by = see #66 (@bcoe) +- [a465a59](https://github.com/bcoe/yargs/commit/a465a5915f912715738de890982e4f8395958b10) Add `files` field to the package.json (@shinnn) +- [31043de](https://github.com/bcoe/yargs/commit/31043de7a38a17c4c97711f1099f5fb164334db3) fix for yargs.argv having the same keys added multiple times see #63 (@bcoe) +- [2d68c5b](https://github.com/bcoe/yargs/commit/2d68c5b91c976431001c4863ce47c9297850f1ad) Disable process.exit calls using .exitProcess(false) (@cianclarke) +- [45da9ec](https://github.com/bcoe/yargs/commit/45da9ec4c55a7bd394721bc6a1db0dabad7bc52a) Mention .option in README (@eush77) + +### v1.3.2 (2014/10/06 21:56 +00:00) +- [b8d3472](https://github.com/bcoe/yargs/commit/b8d34725482e5821a3cc809c0df71378f282f526) 1.3.2 (@chevex) + +### list (2014/08/30 18:41 +00:00) +- [fbc777f](https://github.com/bcoe/yargs/commit/fbc777f416eeefd37c84e44d27d7dfc7c1925721) Now that yargs is the successor to optimist, I'm changing the README language to be more universal. Pirate speak isn't very accessible to non-native speakers. (@chevex) +- [a54d068](https://github.com/bcoe/yargs/commit/a54d0682ae2efc2394d407ab171cc8a8bbd135ea) version output will not print extra newline (@boneskull) +- [1cef5d6](https://github.com/bcoe/yargs/commit/1cef5d62a9d6d61a3948a49574892e01932cc6ae) Added contributors section to package.json (@chrisn) +- [cc295c0](https://github.com/bcoe/yargs/commit/cc295c0a80a2de267e0155b60d315fc4b6f7c709) Added 'require' and 'required' as synonyms for 'demand' (@chrisn) +- [d0bf951](https://github.com/bcoe/yargs/commit/d0bf951d949066b6280101ed606593d079ee15c8) Updating minimist. (@chevex) +- [c15f8e7](https://github.com/bcoe/yargs/commit/c15f8e7f245b261e542cf205ce4f4313630cbdb4) Fix #31 (bad interaction between camelCase options and strict mode) (@nylen) +- [d991b9b](https://github.com/bcoe/yargs/commit/d991b9be687a68812dee1e3b185ba64b7778b82d) Added .help() and .version() methods (@chrisn) +- [e8c8aa4](https://github.com/bcoe/yargs/commit/e8c8aa46268379357cb11e9fc34b8c403037724b) Added .showHelpOnFail() method (@chrisn) +- [e855af4](https://github.com/bcoe/yargs/commit/e855af4a933ea966b5bbdd3c4c6397a4bac1a053) Allow boolean flag with .demand() (@chrisn) +- [14dbec2](https://github.com/bcoe/yargs/commit/14dbec24fb7380683198e2b20c4deb8423e64bea) Fixes issue #22. Arguments are no longer printed to the console when using .config. (@chevex) +- [bef74fc](https://github.com/bcoe/yargs/commit/bef74fcddc1544598a804f80d0a3728459f196bf) Informing users that Yargs is the official optimist successor. (@chevex) +- [#24](https://github.com/bcoe/yargs/pull/24) Merge pull request #24 from chrisn/strict (@chrisn) +- [889a2b2](https://github.com/bcoe/yargs/commit/889a2b28eb9768801b05163360a470d0fd6c8b79) Added requiresArg option, for options that require values (@chrisn) +- [eb16369](https://github.com/bcoe/yargs/commit/eb163692262be1fe80b992fd8803d5923c5a9b18) Added .strict() method, to report error if unknown arguments are given (@chrisn) +- [0471c3f](https://github.com/bcoe/yargs/commit/0471c3fd999e1ad4e6cded88b8aa02013b66d14f) Changed optimist to yargs in usage-options.js example (@chrisn) +- [5c88f74](https://github.com/bcoe/yargs/commit/5c88f74e3cf031b17c54b4b6606c83e485ff520e) Change optimist to yargs in examples (@chrisn) +- [66f12c8](https://github.com/bcoe/yargs/commit/66f12c82ba3c943e4de8ca862980e835da8ecb3a) Fix a couple of bad interactions between aliases and defaults (@nylen) +- [8fa1d80](https://github.com/bcoe/yargs/commit/8fa1d80f14b03eb1f2898863a61f1d1615bceb50) Document second argument of usage(message, opts) (@Gobie) +- [56e6528](https://github.com/bcoe/yargs/commit/56e6528cf674ff70d63083fb044ff240f608448e) For "--some-option", also set argv.someOption (@nylen) +- [ed5f6d3](https://github.com/bcoe/yargs/commit/ed5f6d33f57ad1086b11c91b51100f7c6c7fa8ee) Finished porting unit tests to Mocha. (@chevex) + +### v1.0.15 (2014/02/05 23:18 +00:00) +- [e2b1fc0](https://github.com/bcoe/yargs/commit/e2b1fc0c4a59cf532ae9b01b275e1ef57eeb64d2) 1.0.15 update to badges (@chevex) + +### v1.0.14 (2014/02/05 23:17 +00:00) +- [f33bbb0](https://github.com/bcoe/yargs/commit/f33bbb0f00fe18960f849cc8e15a7428a4cd59b8) Revert "Fixed issue which caused .demand function not to work correctly." (@chevex) + +### v1.0.13 (2014/02/05 22:13 +00:00) +- [6509e5e](https://github.com/bcoe/yargs/commit/6509e5e7dee6ef1a1f60eea104be0faa1a045075) Fixed issue which caused .demand function not to work correctly. (@chevex) + +### v1.0.12 (2013/12/13 00:09 +00:00) +- [05eb267](https://github.com/bcoe/yargs/commit/05eb26741c9ce446b33ff006e5d33221f53eaceb) 1.0.12 (@chevex) + +### v1.0.11 (2013/12/13 00:07 +00:00) +- [c1bde46](https://github.com/bcoe/yargs/commit/c1bde46e37318a68b87d17a50c130c861d6ce4a9) 1.0.11 (@chevex) + +### v1.0.10 (2013/12/12 23:57 +00:00) +- [dfebf81](https://github.com/bcoe/yargs/commit/dfebf8164c25c650701528ee581ca483a99dc21c) Fixed formatting in README (@chevex) + +### v1.0.9 (2013/12/12 23:47 +00:00) +- [0b4e34a](https://github.com/bcoe/yargs/commit/0b4e34af5e6d84a9dbb3bb6d02cd87588031c182) Update README.md (@chevex) + +### v1.0.8 (2013/12/06 16:36 +00:00) +- [#1](https://github.com/bcoe/yargs/pull/1) fix error caused by check() see #1 (@martinheidegger) + +### v1.0.7 (2013/11/24 18:01 +00:00) +- [a247d88](https://github.com/bcoe/yargs/commit/a247d88d6e46644cbb7303c18b1bb678fc132d72) Modified Pirate Joe image. (@chevex) + +### v1.0.6 (2013/11/23 19:21 +00:00) +- [d7f69e1](https://github.com/bcoe/yargs/commit/d7f69e1d34bc929736a8bdccdc724583e21b7eab) Updated Pirate Joe image. (@chevex) + +### v1.0.5 (2013/11/23 19:09 +00:00) +- [ece809c](https://github.com/bcoe/yargs/commit/ece809cf317cc659175e1d66d87f3ca68c2760be) Updated readme notice again. (@chevex) + +### v1.0.4 (2013/11/23 19:05 +00:00) +- [9e81e81](https://github.com/bcoe/yargs/commit/9e81e81654028f83ba86ffc3ac772a0476084e5e) Updated README with a notice about yargs being a fork of optimist and what that implies. (@chevex) + +### v1.0.3 (2013/11/23 17:43 +00:00) +- [65e7a78](https://github.com/bcoe/yargs/commit/65e7a782c86764944d63d084416aba9ee6019c5f) Changed some small wording in README.md. (@chevex) +- [459e20e](https://github.com/bcoe/yargs/commit/459e20e539b366b85128dd281ccd42221e96c7da) Fix a bug in the options function, when string and boolean options weren't applied to aliases. (@shockone) + +### v1.0.2 (2013/11/23 09:46 +00:00) +- [3d80ebe](https://github.com/bcoe/yargs/commit/3d80ebed866d3799224b6f7d596247186a3898a9) 1.0.2 (@chevex) + +### v1.0.1 (2013/11/23 09:39 +00:00) +- [f80ff36](https://github.com/bcoe/yargs/commit/f80ff3642d580d4b68bf9f5a94277481bd027142) Updated image. (@chevex) + +### v1.0.0 (2013/11/23 09:33 +00:00) +- [54e31d5](https://github.com/bcoe/yargs/commit/54e31d505f820b80af13644e460894b320bf25a3) Rebranded from optimist to yargs in the spirit of the fork :D (@chevex) +- [4ebb6c5](https://github.com/bcoe/yargs/commit/4ebb6c59f44787db7c24c5b8fe2680f01a23f498) Added documentation for demandCount(). (@chevex) +- [4561ce6](https://github.com/bcoe/yargs/commit/4561ce66dcffa95f49e8b4449b25b94cd68acb25) Simplified the error messages returned by .check(). (@chevex) +- [661c678](https://github.com/bcoe/yargs/commit/661c67886f479b16254a830b7e1db3be29e6b7a6) Fixed an issue with demand not accepting a zero value. (@chevex) +- [731dd3c](https://github.com/bcoe/yargs/commit/731dd3c37624790490bd6df4d5f1da8f4348279e) Add .fail(fn) so death isn't the only option. Should fix issue #39. (@chevex) +- [fa15417](https://github.com/bcoe/yargs/commit/fa15417ff9e70dace0d726627a5818654824c1d8) Added a few missing 'return self' (@chevex) +- [e655e4d](https://github.com/bcoe/yargs/commit/e655e4d99d1ae1d3695ef755d51c2de08d669761) Fix showing help in certain JS environments. (@chevex) +- [a746a31](https://github.com/bcoe/yargs/commit/a746a31cd47c87327028e6ea33762d6187ec5c87) Better string representation of default values. (@chevex) +- [6134619](https://github.com/bcoe/yargs/commit/6134619a7e90b911d5443230b644c5d447c1a68c) Implies: conditional demands (@chevex) +- [046b93b](https://github.com/bcoe/yargs/commit/046b93b5d40a27367af4cb29726e4d781d934639) Added support for JSON config files. (@chevex) +- [a677ec0](https://github.com/bcoe/yargs/commit/a677ec0a0ecccd99c75e571d03323f950688da03) Add .example(cmd, desc) feature. (@chevex) +- [1bd4375](https://github.com/bcoe/yargs/commit/1bd4375e11327ba1687d4bb6e5e9f3c30c1be2af) Added 'defaults' as alias to 'default' so as to avoid usage of a reserved keyword. (@chevex) +- [6b753c1](https://github.com/bcoe/yargs/commit/6b753c16ca09e723060e70b773b430323b29c45c) add .normalize(args..) support for normalizing paths (@chevex) +- [33d7d59](https://github.com/bcoe/yargs/commit/33d7d59341d364f03d3a25f0a55cb99004dbbe4b) Customize error messages with demand(key, msg) (@chevex) +- [647d37f](https://github.com/bcoe/yargs/commit/647d37f164c20f4bafbf67dd9db6cd6e2cd3b49f) Merge branch 'rewrite-duplicate-test' of github.com:isbadawi/node-optimist (@chevex) +- [9059d1a](https://github.com/bcoe/yargs/commit/9059d1ad5e8aea686c2a01c89a23efdf929fff2e) Pass aliases object to check functions for greater versatility. (@chevex) +- [623dc26](https://github.com/bcoe/yargs/commit/623dc26c7331abff2465ef8532e3418996d42fe6) Added ability to count boolean options and rolled minimist library back into project. (@chevex) +- [49f0dce](https://github.com/bcoe/yargs/commit/49f0dcef35de4db544c3966350d36eb5838703f6) Fixed small typo. (@chevex) +- [79ec980](https://github.com/bcoe/yargs/commit/79ec9806d9ca6eb0014cfa4b6d1849f4f004baf2) Removed dependency on wordwrap module. (@chevex) +- [ea14630](https://github.com/bcoe/yargs/commit/ea14630feddd69d1de99dd8c0e08948f4c91f00a) Merge branch 'master' of github.com:chbrown/node-optimist (@chevex) +- [2b75da2](https://github.com/bcoe/yargs/commit/2b75da2624061e0f4f3107d20303c06ec9054906) Merge branch 'master' of github.com:seanzhou1023/node-optimist (@chevex) +- [d9bda11](https://github.com/bcoe/yargs/commit/d9bda1116e26f3b40e833ca9ca19263afea53565) Merge branch 'patch-1' of github.com:thefourtheye/node-optimist (@chevex) +- [d6cc606](https://github.com/bcoe/yargs/commit/d6cc6064a4f1bea38a16a4430b8a1334832fbeff) Renamed README. (@chevex) +- [9498d3f](https://github.com/bcoe/yargs/commit/9498d3f59acfb5e102826503e681623c3a64b178) Renamed readme and added .gitignore. (@chevex) +- [bbd1fe3](https://github.com/bcoe/yargs/commit/bbd1fe37fefa366dde0fb3dc44d91fe8b28f57f5) Included examples for ```help``` and ```showHelp``` functions and fixed few formatting issues (@thefourtheye) +- [37fea04](https://github.com/bcoe/yargs/commit/37fea0470a5796a0294c1dcfff68d8041650e622) .alias({}) behaves differently based on mapping direction when generating descriptions (@chbrown) +- [855b20d](https://github.com/bcoe/yargs/commit/855b20d0be567ca121d06b30bea64001b74f3d6d) Documented function signatures are useful for dynamically typed languages. (@chbrown) + +### 0.6.0 (2013/06/25 08:48 +00:00) +- [d37bfe0](https://github.com/bcoe/yargs/commit/d37bfe05ae6d295a0ab481efe4881222412791f4) all tests passing using minimist (@substack) +- [76f1352](https://github.com/bcoe/yargs/commit/76f135270399d01f2bbc621e524a5966e5c422fd) all parse tests now passing (@substack) +- [a7b6754](https://github.com/bcoe/yargs/commit/a7b6754276c38d1565479a5685c3781aeb947816) using minimist, some tests passing (@substack) +- [6655688](https://github.com/bcoe/yargs/commit/66556882aa731cbbbe16cc4d42c85740a2e98099) Give credit where its due (@DeadAlready) +- [602a2a9](https://github.com/bcoe/yargs/commit/602a2a92a459f93704794ad51b115bbb08b535ce) v0.5.3 - Remove wordwrap as dependency (@DeadAlready) + +### 0.5.2 (2013/05/31 03:46 +00:00) +- [4497ca5](https://github.com/bcoe/yargs/commit/4497ca55e332760a37b866ec119ded347ca27a87) fixed the whitespace bug without breaking anything else (@substack) +- [5a3dd1a](https://github.com/bcoe/yargs/commit/5a3dd1a4e0211a38613c6e02f61328e1031953fa) failing test for whitespace arg (@substack) + +### 0.5.1 (2013/05/30 07:17 +00:00) +- [a20228f](https://github.com/bcoe/yargs/commit/a20228f62a454755dd07f628a7c5759113918327) fix parse() to work with functions before it (@substack) +- [b13bd4c](https://github.com/bcoe/yargs/commit/b13bd4cac856a9821d42fa173bdb58f089365a7d) failing test for parse() with modifiers (@substack) + +### 0.5.0 (2013/05/18 21:59 +00:00) +- [c474a64](https://github.com/bcoe/yargs/commit/c474a649231527915c222156e3b40806d365a87c) fixes for dash (@substack) + +### 0.4.0 (2013/04/13 19:03 +00:00) +- [dafe3e1](https://github.com/bcoe/yargs/commit/dafe3e18d7c6e7c2d68e06559df0e5cbea3adb14) failing short test (@substack) + +### 0.3.7 (2013/04/04 04:07 +00:00) +- [6c7a0ec](https://github.com/bcoe/yargs/commit/6c7a0ec94ce4199a505f0518b4d6635d4e47cc81) Fix for windows. On windows there is no _ in environment. (@hdf) + +### 0.3.6 (2013/04/04 04:04 +00:00) +- [e72346a](https://github.com/bcoe/yargs/commit/e72346a727b7267af5aa008b418db89970873f05) Add support for newlines in -a="" arguments (@danielbeardsley) +- [71e1fb5](https://github.com/bcoe/yargs/commit/71e1fb55ea9987110a669ac6ec12338cfff3821c) drop 0.4, add 0.8 to travis (@substack) + +### 0.3.5 (2012/10/10 11:09 +00:00) +- [ee692b3](https://github.com/bcoe/yargs/commit/ee692b37554c70a0bb16389a50a26b66745cbbea) Fix parsing booleans (@vojtajina) +- [5045122](https://github.com/bcoe/yargs/commit/5045122664c3f5b4805addf1be2148d5856f7ce8) set $0 properly in the tests (@substack) + +### 0.3.4 (2012/04/30 06:54 +00:00) +- [f28c0e6](https://github.com/bcoe/yargs/commit/f28c0e62ca94f6e0bb2e6d82fc3d91a55e69b903) bump for string "true" params (@substack) +- [8f44aeb](https://github.com/bcoe/yargs/commit/8f44aeb74121ddd689580e2bf74ef86a605e9bf2) Fix failing test for aliased booleans. (@coderarity) +- [b9f7b61](https://github.com/bcoe/yargs/commit/b9f7b613b1e68e11e6c23fbda9e555a517dcc976) Add failing test for short aliased booleans. (@coderarity) + +### 0.3.3 (2012/04/30 06:45 +00:00) +- [541bac8](https://github.com/bcoe/yargs/commit/541bac8dd787a5f1a5d28f6d8deb1627871705e7) Fixes #37. + +### 0.3.2 (2012/04/12 20:28 +00:00) +- [3a0f014](https://github.com/bcoe/yargs/commit/3a0f014c1451280ac1c9caa1f639d31675586eec) travis badge (@substack) +- [4fb60bf](https://github.com/bcoe/yargs/commit/4fb60bf17845f4ce3293f8ca49c9a1a7c736cfce) Fix boolean aliases. (@coderarity) +- [f14dda5](https://github.com/bcoe/yargs/commit/f14dda546efc4fe06ace04d36919bfbb7634f79b) Adjusted package.json to use tap (@jfhbrook) +- [88e5d32](https://github.com/bcoe/yargs/commit/88e5d32295be6e544c8d355ff84e355af38a1c74) test/usage.js no longer hangs (@jfhbrook) +- [e1e740c](https://github.com/bcoe/yargs/commit/e1e740c27082f3ce84deca2093d9db2ef735d0e5) two tests for combined boolean/alias opts parsing (@jfhbrook) + +### 0.3.1 (2011/12/31 08:44 +00:00) +- [d09b719](https://github.com/bcoe/yargs/commit/d09b71980ef711b6cf3918cd19beec8257e40e82) If "default" is set to false it was not passed on, fixed. (@wolframkriesing) + +### 0.3.0 (2011/12/09 06:03 +00:00) +- [6e74aa7](https://github.com/bcoe/yargs/commit/6e74aa7b46a65773e20c0cb68d2d336d4a0d553d) bump and documented dot notation (@substack) + +### 0.2.7 (2011/10/20 02:25 +00:00) +- [94adee2](https://github.com/bcoe/yargs/commit/94adee20e17b58d0836f80e8b9cdbe9813800916) argv._ can be told 'Hey! argv._! Don't be messing with my args.', and it WILL obey (@colinta) +- [c46fdd5](https://github.com/bcoe/yargs/commit/c46fdd56a05410ae4a1e724a4820c82e77ff5469) optimistic critter image (@substack) +- [5c95c73](https://github.com/bcoe/yargs/commit/5c95c73aedf4c7482bd423e10c545e86d7c8a125) alias options() to option() (@substack) +- [f7692ea](https://github.com/bcoe/yargs/commit/f7692ea8da342850af819367833abb685fde41d8) [fix] Fix for parsing boolean edge case (@indexzero) +- [d1f92d1](https://github.com/bcoe/yargs/commit/d1f92d1425bd7f356055e78621b30cdf9741a3c2) +- [b01bda8](https://github.com/bcoe/yargs/commit/b01bda8d86e455bbf74ce497864cb8ab5b9fb847) [fix test] Update to ensure optimist is aware of default booleans. Associated tests included (@indexzero) +- [aa753e7](https://github.com/bcoe/yargs/commit/aa753e7c54fb3a12f513769a0ff6d54aa0f63943) [dist test] Update devDependencies in package.json. Update test pathing to be more npm and require.paths future-proof (@indexzero) +- [7bfce2f](https://github.com/bcoe/yargs/commit/7bfce2f3b3c98e6539e7549d35fbabced7e9341e) s/sys/util/ (@substack) +- [d420a7a](https://github.com/bcoe/yargs/commit/d420a7a9c890d2cdb11acfaf3ea3f43bc3e39f41) update usage output (@substack) +- [cf86eed](https://github.com/bcoe/yargs/commit/cf86eede2e5fc7495b6ec15e6d137d9ac814f075) some sage readme protips about parsing rules (@substack) +- [5da9f7a](https://github.com/bcoe/yargs/commit/5da9f7a5c0e1758ec7c5801fb3e94d3f6e970513) documented all the methods finally (@substack) +- [8ca6879](https://github.com/bcoe/yargs/commit/8ca6879311224b25933642987300f6a29de5c21b) fenced syntax highlighting (@substack) +- [b72bacf](https://github.com/bcoe/yargs/commit/b72bacf1d02594778c1935405bc8137eb61761dc) right-alignment of wrapped extra params (@substack) +- [2b980bf](https://github.com/bcoe/yargs/commit/2b980bf2656b4ee8fc5134dc5f56a48855c35198) now with .wrap() (@substack) +- [d614f63](https://github.com/bcoe/yargs/commit/d614f639654057d1b7e35e3f5a306e88ec2ad1e4) don't show 'Options:' when there aren't any (@substack) +- [691eda3](https://github.com/bcoe/yargs/commit/691eda354df97b5a86168317abcbcaabdc08a0fb) failing test for multi-aliasing (@substack) +- [0826c9f](https://github.com/bcoe/yargs/commit/0826c9f462109feab2bc7a99346d22e72bf774b7) "Options:" > "options:" (@substack) +- [72f7490](https://github.com/bcoe/yargs/commit/72f749025d01b7f295738ed370a669d885fbada0) [minor] Update formatting for `.showHelp()` (@indexzero) +- [75aecce](https://github.com/bcoe/yargs/commit/75aeccea74329094072f95800e02c275e7d999aa) options works again, too lazy to write a proper test right now (@substack) +- [f742e54](https://github.com/bcoe/yargs/commit/f742e5439817c662dc3bd8734ddd6467e6018cfd) line_count_options example, which breaks (@substack) +- [4ca06b8](https://github.com/bcoe/yargs/commit/4ca06b8b4ea99b5d5714b315a2a8576bee6e5537) line count example (@substack) +- [eeb8423](https://github.com/bcoe/yargs/commit/eeb8423e0a5ecc9dc3eb1e6df9f3f8c1c88f920b) remove self.argv setting in boolean (@substack) +- [6903412](https://github.com/bcoe/yargs/commit/69034126804660af9cc20ea7f4457b50338ee3d7) removed camel case for now (@substack) +- [5a0d88b](https://github.com/bcoe/yargs/commit/5a0d88bf23e9fa79635dd034e2a1aa992acc83cd) remove dead longest checking code (@substack) +- [d782170](https://github.com/bcoe/yargs/commit/d782170babf7284b1aa34f5350df0dd49c373fa8) .help() too (@substack) +- [622ec17](https://github.com/bcoe/yargs/commit/622ec17379bb5374fdbb190404c82bc600975791) rm old help generator (@substack) +- [7c8baac](https://github.com/bcoe/yargs/commit/7c8baac4d66195e9f5158503ea9ebfb61153dab7) nub keys (@substack) +- [8197785](https://github.com/bcoe/yargs/commit/8197785ad4762465084485b041abd722f69bf344) generate help message based on the previous calls, todo: nub (@substack) +- [3ffbdc3](https://github.com/bcoe/yargs/commit/3ffbdc33c8f5e83d4ea2ac60575ce119570c7ede) stub out new showHelp, better checks (@substack) +- [d4e21f5](https://github.com/bcoe/yargs/commit/d4e21f56a4830f7de841900d3c79756fb9886184) let .options() take single options too (@substack) +- [3c4cf29](https://github.com/bcoe/yargs/commit/3c4cf2901a29bac119cca8e983028d8669230ec6) .options() is now heaps simpler (@substack) +- [89f0d04](https://github.com/bcoe/yargs/commit/89f0d043cbccd302f10ab30c2069e05d2bf817c9) defaults work again, all tests pass (@substack) +- [dd87333](https://github.com/bcoe/yargs/commit/dd8733365423006a6e4156372ebb55f98323af58) update test error messages, down to 2 failing tests (@substack) +- [53f7bc6](https://github.com/bcoe/yargs/commit/53f7bc626b9875f2abdfc5dd7a80bde7f14143a3) fix for bools doubling up, passes the parse test again, others fail (@substack) +- [2213e2d](https://github.com/bcoe/yargs/commit/2213e2ddc7263226fba717fb041dc3fde9bc2ee4) refactored for an argv getter, failing several tests (@substack) +- [d1e7379](https://github.com/bcoe/yargs/commit/d1e737970f15c6c006bebdd8917706827ff2f0f2) just rescan for now, alias test passes (@substack) +- [b2f8c99](https://github.com/bcoe/yargs/commit/b2f8c99cc477a8eb0fdf4cf178e1785b63185cfd) failing alias test (@substack) +- [d0c0174](https://github.com/bcoe/yargs/commit/d0c0174daa144bfb6dc7290fdc448c393c475e15) .alias() (@substack) +- [d85f431](https://github.com/bcoe/yargs/commit/d85f431ad7d07b058af3f2a57daa51495576c164) [api] Remove `.describe()` in favor of building upon the existing `.usage()` API (@indexzero) +- [edbd527](https://github.com/bcoe/yargs/commit/edbd5272a8e213e71acd802782135c7f9699913a) [doc api] Add `.describe()`, `.options()`, and `.showHelp()` methods along with example. (@indexzero) +- [be4902f](https://github.com/bcoe/yargs/commit/be4902ff0961ae8feb9093f2c0a4066463ded2cf) updates for coffee since it now does argv the node way (@substack) +- [e24cb23](https://github.com/bcoe/yargs/commit/e24cb23798ee64e53b60815e7fda78b87f42390c) more general coffeescript detection (@substack) +- [78ac753](https://github.com/bcoe/yargs/commit/78ac753e5d0ec32a96d39d893272afe989e42a4d) Don't trigger the CoffeeScript hack when running under node_g. (@papandreou) +- [bcfe973](https://github.com/bcoe/yargs/commit/bcfe9731d7f90d4632281b8a52e8d76eb0195ae6) .string() but failing test (@substack) +- [1987aca](https://github.com/bcoe/yargs/commit/1987aca28c7ba4e8796c07bbc547cb984804c826) test hex strings (@substack) +- [ef36db3](https://github.com/bcoe/yargs/commit/ef36db32259b0b0d62448dc907c760e5554fb7e7) more keywords (@substack) +- [cc53c56](https://github.com/bcoe/yargs/commit/cc53c56329960bed6ab077a79798e991711ba01d) Added camelCase function that converts --multi-word-option to camel case (so it becomes argv.multiWordOption). (@papandreou) +- [60b57da](https://github.com/bcoe/yargs/commit/60b57da36797716e5783a633c6d5c79099016d45) fixed boolean bug by rescanning (@substack) +- [dff6d07](https://github.com/bcoe/yargs/commit/dff6d078d97f8ac503c7d18dcc7b7a8c364c2883) boolean examples (@substack) +- [0e380b9](https://github.com/bcoe/yargs/commit/0e380b92c4ef4e3c8dac1da18b5c31d85b1d02c9) boolean() with passing test (@substack) +- [62644d4](https://github.com/bcoe/yargs/commit/62644d4bffbb8d1bbf0c2baf58a1d14a6359ef07) coffee compatibility with node regex for versions too (@substack) +- [430fafc](https://github.com/bcoe/yargs/commit/430fafcf1683d23774772826581acff84b456827) argv._ fixed by fixing the coffee detection (@substack) +- [343b8af](https://github.com/bcoe/yargs/commit/343b8afefd98af274ebe21b5a16b3a949ec5429f) whichNodeArgs test fails too (@substack) +- [63df2f3](https://github.com/bcoe/yargs/commit/63df2f371f31e63d7f1dec2cbf0022a5f08da9d2) replicated mnot's bug in whichNodeEmpty test (@substack) +- [35473a4](https://github.com/bcoe/yargs/commit/35473a4d93a45e5e7e512af8bb54ebb532997ae1) test for ./bin usage (@substack) +- [13df151](https://github.com/bcoe/yargs/commit/13df151e44228eed10e5441c7cd163e086c458a4) don't coerce booleans to numbers (@substack) +- [85f8007](https://github.com/bcoe/yargs/commit/85f8007e93b8be7124feea64b1f1916d8ba1894a) package bump for automatic number conversion (@substack) +- [8f17014](https://github.com/bcoe/yargs/commit/8f170141cded4ccc0c6d67a849c5bf996aa29643) updated readme and examples with new auto-numberification goodness (@substack) +- [73dc901](https://github.com/bcoe/yargs/commit/73dc9011ac968e39b55e19e916084a839391b506) auto number conversion works yay (@substack) +- [bcec56b](https://github.com/bcoe/yargs/commit/bcec56b3d031e018064cbb691539ccc4f28c14ad) failing test for not-implemented auto numification (@substack) +- [ebd2844](https://github.com/bcoe/yargs/commit/ebd2844d683feeac583df79af0e5124a7a7db04e) odd that eql doesn't check types careflly (@substack) +- [fd854b0](https://github.com/bcoe/yargs/commit/fd854b02e512ce854b76386d395672a7969c1bc4) package author + keywords (@substack) +- [656a1d5](https://github.com/bcoe/yargs/commit/656a1d5a1b7c0e49d72e80cb13f20671d56f76c6) updated readme with .default() stuff (@substack) +- [cd7f8c5](https://github.com/bcoe/yargs/commit/cd7f8c55f0b82b79b690d14c5f806851236998a1) passing tests for new .default() behavior (@substack) +- [932725e](https://github.com/bcoe/yargs/commit/932725e39ce65bc91a0385a5fab659a5fa976ac2) new default() thing for setting default key/values (@substack) +- [4e6c7ab](https://github.com/bcoe/yargs/commit/4e6c7aba6374ac9ebc6259ecf91f13af7bce40e3) test for coffee usage (@substack) +- [d54ffcc](https://github.com/bcoe/yargs/commit/d54ffccf2a5a905f51ed5108f7c647f35d64ae23) new --key value style with passing tests. NOTE: changes existing behavior (@substack) +- [ed2a2d5](https://github.com/bcoe/yargs/commit/ed2a2d5d828100ebeef6385c0fb88d146a5cfe9b) package bump for summatix's coffee script fix (@substack) +- [75a975e](https://github.com/bcoe/yargs/commit/75a975eed8430d28e2a79dc9e6d819ad545f4587) Added support for CoffeeScript (@summatix) +- [56b2b1d](https://github.com/bcoe/yargs/commit/56b2b1de8d11f8a2b91979d8ae2d6db02d8fe64d) test coverage for the falsy check() usage (@substack) +- [a4843a9](https://github.com/bcoe/yargs/commit/a4843a9f0e69ffb4afdf6a671d89eb6f218be35d) check bug fixed plus a handy string (@substack) +- [857bd2d](https://github.com/bcoe/yargs/commit/857bd2db933a5aaa9cfecba0ced2dc9b415f8111) tests for demandCount, back up to 100% coverage (@substack) +- [073b776](https://github.com/bcoe/yargs/commit/073b7768ebd781668ef05c13f9003aceca2f5c35) call demandCount from demand (@substack) +- [4bd4b7a](https://github.com/bcoe/yargs/commit/4bd4b7a085c8b6ce1d885a0f486cc9865cee2db1) add demandCount to check for the number of arguments in the _ list (@marshall) +- [b8689ac](https://github.com/bcoe/yargs/commit/b8689ac68dacf248119d242bba39a41cb0adfa07) Rebase checks. That will be its own module eventually. (@substack) +- [e688370](https://github.com/bcoe/yargs/commit/e688370b576f0aa733c3f46183df69e1b561668e) a $0 like in perl (@substack) +- [2e5e196](https://github.com/bcoe/yargs/commit/2e5e1960fc19afb21fb3293752316eaa8bcd3609) usage test hacking around process and console (@substack) +- [fcc3521](https://github.com/bcoe/yargs/commit/fcc352163fbec6a1dfe8caf47a0df39de24fe016) description pun (@substack) +- [87a1fe2](https://github.com/bcoe/yargs/commit/87a1fe29037ca2ca5fefda85141aaeb13e8ce761) mit/x11 license (@substack) +- [8d089d2](https://github.com/bcoe/yargs/commit/8d089d24cd687c0bde3640a96c09b78f884900dd) bool example is more consistent and also shows off short option grouping (@substack) +- [448d747](https://github.com/bcoe/yargs/commit/448d7473ac68e8e03d8befc9457b0d9e21725be0) start of the readme and examples (@substack) +- [da74dea](https://github.com/bcoe/yargs/commit/da74dea799a9b59dbf022cbb8001bfdb0d52eec9) more tests for long and short captures (@substack) +- [ab6387e](https://github.com/bcoe/yargs/commit/ab6387e6769ca4af82ca94c4c67c7319f0d9fcfa) silly bug in the tests with s/not/no/, all tests pass now (@substack) +- [102496a](https://github.com/bcoe/yargs/commit/102496a319e8e06f6550d828fc2f72992c7d9ecc) hack an instance for process.argv onto Argv so the export can be called to create an instance or used for argv, which is the most common case (@substack) +- [a01caeb](https://github.com/bcoe/yargs/commit/a01caeb532546d19f68f2b2b87f7036cfe1aaedd) divide example (@substack) +- [443da55](https://github.com/bcoe/yargs/commit/443da55736acbaf8ff8b04d1b9ce19ab016ddda2) start of the lib with a package.json (@substack) diff --git a/node_modules/gulp/node_modules/yargs/LICENSE b/node_modules/gulp/node_modules/yargs/LICENSE new file mode 100644 index 0000000..747ab11 --- /dev/null +++ b/node_modules/gulp/node_modules/yargs/LICENSE @@ -0,0 +1,22 @@ +Copyright 2010 James Halliday (mail@substack.net) +Modified work Copyright 2014 Contributors (ben@npmjs.com) + +This project is free software released under the MIT/X11 license: + +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. diff --git a/node_modules/gulp/node_modules/yargs/README.md b/node_modules/gulp/node_modules/yargs/README.md new file mode 100644 index 0000000..4887915 --- /dev/null +++ b/node_modules/gulp/node_modules/yargs/README.md @@ -0,0 +1,2017 @@ + yargs +======== + +Yargs be a node.js library fer hearties tryin' ter parse optstrings. + +With yargs, ye be havin' a map that leads straight to yer treasure! Treasure of course, being a simple option hash. + +[![Build Status][travis-image]][travis-url] +[![Coverage Status][coveralls-image]][coveralls-url] +[![NPM version][npm-image]][npm-url] +[![Windows Tests][windows-image]][windows-url] +[![js-standard-style][standard-image]][standard-url] +[![Conventional Commits][conventional-commits-image]][conventional-commits-url] +[![Gitter][gitter-image]][gitter-url] + +> Yargs is the official successor to optimist. Please feel free to submit issues and pull requests. If you'd like to contribute and don't know where to start, have a look at [the issue list](https://github.com/yargs/yargs/issues) :) + +examples +======== + +With yargs, the options be just a hash! +------------------------------------------------------------------- + +plunder.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs').argv; + +if (argv.ships > 3 && argv.distance < 53.5) { + console.log('Plunder more riffiwobbles!'); +} else { + console.log('Retreat from the xupptumblers!'); +} +```` + +*** + + $ ./plunder.js --ships=4 --distance=22 + Plunder more riffiwobbles! + + $ ./plunder.js --ships 12 --distance 98.7 + Retreat from the xupptumblers! + +![Joe was one optimistic pirate.](https://i.imgur.com/4WFGVJ9.png) + +But don't walk the plank just yet! There be more! You can do short options: +------------------------------------------------- + +short.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs').argv; +console.log('(%d,%d)', argv.x, argv.y); +```` + +*** + + $ ./short.js -x 10 -y 21 + (10,21) + +And booleans, both long, short, and even grouped: +---------------------------------- + +bool.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs').argv; + +if (argv.s) { + process.stdout.write(argv.fr ? 'Le perroquet dit: ' : 'The parrot says: '); +} +console.log( + (argv.fr ? 'couac' : 'squawk') + (argv.p ? '!' : '') +); +```` + +*** + + $ ./bool.js -s + The parrot says: squawk + + $ ./bool.js -sp + The parrot says: squawk! + + $ ./bool.js -sp --fr + Le perroquet dit: couac! + +And non-hyphenated options too! Just use `argv._`! +------------------------------------------------- + +nonopt.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs').argv; +console.log('(%d,%d)', argv.x, argv.y); +console.log(argv._); +```` + +*** + + $ ./nonopt.js -x 6.82 -y 3.35 rum + (6.82,3.35) + [ 'rum' ] + + $ ./nonopt.js "me hearties" -x 0.54 yo -y 1.12 ho + (0.54,1.12) + [ 'me hearties', 'yo', 'ho' ] + +Yargs even counts your booleans! +---------------------------------------------------------------------- + +count.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .count('verbose') + .alias('v', 'verbose') + .argv; + +VERBOSE_LEVEL = argv.verbose; + +function WARN() { VERBOSE_LEVEL >= 0 && console.log.apply(console, arguments); } +function INFO() { VERBOSE_LEVEL >= 1 && console.log.apply(console, arguments); } +function DEBUG() { VERBOSE_LEVEL >= 2 && console.log.apply(console, arguments); } + +WARN("Showing only important stuff"); +INFO("Showing semi-important stuff too"); +DEBUG("Extra chatty mode"); +```` + +*** + $ node count.js + Showing only important stuff + + $ node count.js -v + Showing only important stuff + Showing semi-important stuff too + + $ node count.js -vv + Showing only important stuff + Showing semi-important stuff too + Extra chatty mode + + $ node count.js -v --verbose + Showing only important stuff + Showing semi-important stuff too + Extra chatty mode + +Tell users how to use yer options and make demands. +------------------------------------------------- + +area.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .usage('Usage: $0 -w [num] -h [num]') + .demandOption(['w','h']) + .argv; + +console.log("The area is:", argv.w * argv.h); +```` + +*** + + $ ./area.js -w 55 -h 11 + The area is: 605 + + $ node ./area.js -w 4.91 -w 2.51 + Usage: area.js -w [num] -h [num] + + Options: + -w [required] + -h [required] + + Missing required arguments: h + +After yer demands have been met, demand more! Ask for non-hyphenated arguments! +----------------------------------------- + +demand_count.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .demandCommand(2) + .argv; +console.dir(argv); +```` + +*** + + $ ./demand_count.js a + + Not enough non-option arguments: got 1, need at least 2 + + $ ./demand_count.js a b + { _: [ 'a', 'b' ], '$0': 'demand_count.js' } + + $ ./demand_count.js a b c + { _: [ 'a', 'b', 'c' ], '$0': 'demand_count.js' } + +EVEN MORE SHIVER ME TIMBERS! +------------------ + +default_singles.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .default('x', 10) + .default('y', 10) + .argv +; +console.log(argv.x + argv.y); +```` + +*** + + $ ./default_singles.js -x 5 + 15 + +default_hash.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .default({ x : 10, y : 10 }) + .argv +; +console.log(argv.x + argv.y); +```` + +*** + + $ ./default_hash.js -y 7 + 17 + +And if you really want to get all descriptive about it... +--------------------------------------------------------- + +boolean_single.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .boolean('v') + .argv +; +console.dir(argv.v); +console.dir(argv._); +```` + +*** + + $ ./boolean_single.js -v "me hearties" yo ho + true + [ 'me hearties', 'yo', 'ho' ] + + +boolean_double.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .boolean(['x','y','z']) + .argv +; +console.dir([ argv.x, argv.y, argv.z ]); +console.dir(argv._); +```` + +*** + + $ ./boolean_double.js -x -z one two three + [ true, false, true ] + [ 'one', 'two', 'three' ] + +Yargs is here to help you... +--------------------------- + +Ye can describe parameters fer help messages and set aliases. Yargs figures +out how ter format a handy help string automatically. + +line_count.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .usage('Usage: $0 [options]') + .command('count', 'Count the lines in a file') + .example('$0 count -f foo.js', 'count the lines in the given file') + .alias('f', 'file') + .nargs('f', 1) + .describe('f', 'Load a file') + .demandOption(['f']) + .help('h') + .alias('h', 'help') + .epilog('copyright 2015') + .argv; + +var fs = require('fs'); +var s = fs.createReadStream(argv.file); + +var lines = 0; +s.on('data', function (buf) { + lines += buf.toString().match(/\n/g).length; +}); + +s.on('end', function () { + console.log(lines); +}); +```` + +*** + $ node line_count.js count + Usage: line_count.js [options] + + Commands: + count Count the lines in a file + + Options: + -f, --file Load a file [required] + -h, --help Show help [boolean] + + Examples: + line_count.js count -f foo.js count the lines in the given file + + copyright 2015 + + Missing required arguments: f + + $ node line_count.js count --file line_count.js + 26 + + $ node line_count.js count -f line_count.js + 26 + +methods +======= + +By itself, + +````javascript +require('yargs').argv +```` + +will use the `process.argv` array to construct the `argv` object. + +You can pass in the `process.argv` yourself: + +````javascript +require('yargs')([ '-x', '1', '-y', '2' ]).argv +```` + +or use `.parse()` to do the same thing: + +````javascript +require('yargs').parse([ '-x', '1', '-y', '2' ]) +```` + +The rest of these methods below come in just before the terminating `.argv`. + +.alias(key, alias) +------------------ + +Set key names as equivalent such that updates to a key will propagate to aliases +and vice-versa. + +Optionally `.alias()` can take an object that maps keys to aliases. +Each key of this object should be the canonical version of the option, and each +value should be a string or an array of strings. + +.argv +----- + +Get the arguments as a plain old object. + +Arguments without a corresponding flag show up in the `argv._` array. + +The script name or node command is available at `argv.$0` similarly to how `$0` +works in bash or perl. + +If `yargs` is executed in an environment that embeds node and there's no script name (e.g. +[Electron](http://electron.atom.io/) or [nw.js](http://nwjs.io/)), it will ignore the first parameter since it +expects it to be the script name. In order to override this behavior, use `.parse(process.argv.slice(1))` +instead of `.argv` and the first parameter won't be ignored. + +.array(key) +---------- + +Tell the parser to interpret `key` as an array. If `.array('foo')` is set, +`--foo foo bar` will be parsed as `['foo', 'bar']` rather than as `'foo'`. + +.boolean(key) +------------- + +Interpret `key` as a boolean. If a non-flag option follows `key` in +`process.argv`, that string won't get set as the value of `key`. + +`key` will default to `false`, unless a `default(key, undefined)` is +explicitly set. + +If `key` is an array, interpret all the elements as booleans. + +.check(fn, [global=true]) +---------- + +Check that certain conditions are met in the provided arguments. + +`fn` is called with two arguments, the parsed `argv` hash and an array of options and their aliases. + +If `fn` throws or returns a non-truthy value, show the thrown error, usage information, and +exit. + +`global` indicates whether `check()` should be enabled both +at the top-level and for each sub-command. + +.choices(key, choices) +---------------------- + +Limit valid values for `key` to a predefined set of `choices`, given as an array +or as an individual value. + +```js +var argv = require('yargs') + .alias('i', 'ingredient') + .describe('i', 'choose your sandwich ingredients') + .choices('i', ['peanut-butter', 'jelly', 'banana', 'pickles']) + .help('help') + .argv +``` + +If this method is called multiple times, all enumerated values will be merged +together. Choices are generally strings or numbers, and value matching is +case-sensitive. + +Optionally `.choices()` can take an object that maps multiple keys to their +choices. + +Choices can also be specified as `choices` in the object given to `option()`. + +```js +var argv = require('yargs') + .option('size', { + alias: 's', + describe: 'choose a size', + choices: ['xs', 's', 'm', 'l', 'xl'] + }) + .argv +``` + +.coerce(key, fn) +---------------- + +Provide a synchronous function to coerce or transform the value(s) given on the +command line for `key`. + +The coercion function should accept one argument, representing the parsed value +from the command line, and should return a new value or throw an error. The +returned value will be used as the value for `key` (or one of its aliases) in +`argv`. + +If the function throws, the error will be treated as a validation +failure, delegating to either a custom [`.fail()`](#fail) handler or printing +the error message in the console. + +Coercion will be applied to a value after +all other modifications, such as [`.normalize()`](#normalize). + +_Examples:_ + +```js +var argv = require('yargs') + .coerce('file', function (arg) { + return require('fs').readFileSync(arg, 'utf8') + }) + .argv +``` + +Optionally `.coerce()` can take an object that maps several keys to their +respective coercion function. + +```js +var argv = require('yargs') + .coerce({ + date: Date.parse, + json: JSON.parse + }) + .argv +``` + +You can also map the same function to several keys at one time. Just pass an +array of keys as the first argument to `.coerce()`: + +```js +var path = require('path') +var argv = require('yargs') + .coerce(['src', 'dest'], path.resolve) + .argv +``` + +If you are using dot-notion or arrays, .e.g., `user.email` and `user.password`, +coercion will be applied to the final object that has been parsed: + +```js +// --user.name Batman --user.password 123 +// gives us: {name: 'batman', password: '[SECRET]'} +var argv = require('yargs') + .option('user') + .coerce('user', opt => { + opt.name = opt.name.toLowerCase() + opt.password = '[SECRET]' + return opt + }) + .argv +``` + +.command(cmd, desc, [builder], [handler]) +----------------------------------------- +.command(cmd, desc, [module]) +----------------------------- +.command(module) +---------------- + +Define the commands exposed by your application. + +`cmd` should be a string representing the command or an array of strings +representing the command and its aliases. Read more about command aliases in the +subsection below. + +Use `desc` to provide a description for each command your application accepts (the +values stored in `argv._`). Set `desc` to `false` to create a hidden command. +Hidden commands don't show up in the help output and aren't available for +completion. + +Optionally, you can provide a `builder` object to give hints about the +options that your command accepts: + +```js +yargs + .command('get', 'make a get HTTP request', { + url: { + alias: 'u', + default: 'http://yargs.js.org/' + } + }) + .help() + .argv +``` + +`builder` can also be a function. This function is executed +with a `yargs` instance, and can be used to provide _advanced_ command specific help: + +```js +yargs + .command('get', 'make a get HTTP request', function (yargs) { + return yargs.option('url', { + alias: 'u', + default: 'http://yargs.js.org/' + }) + }) + .help() + .argv +``` + +You can also provide a handler function, which will be executed with the +parsed `argv` object: + +```js +yargs + .command( + 'get', + 'make a get HTTP request', + function (yargs) { + return yargs.option('u', { + alias: 'url', + describe: 'the URL to make an HTTP request to' + }) + }, + function (argv) { + console.log(argv.url) + } + ) + .help() + .argv +``` + +### Default Commands + +To specify a default command use the character `*`. A default command +will be run if the positional arguments provided match no known +commands: + +```js +const argv = require('yargs') + .command('*', 'the default command', () => {}, (argv) => { + console.log('this command will be run by default') + }) +``` + +The command defined above will be executed if the program +is run with `./my-cli.js --x=22`. + +Default commands can also be used as a command alias, like so: + +```js +const argv = require('yargs') + .command(['serve', '*'], 'the serve command', () => {}, (argv) => { + console.log('this command will be run by default') + }) +``` + +The command defined above will be executed if the program +is run with `./my-cli.js --x=22`, or with `./my-cli.js serve --x=22`. + +### Positional Arguments + +Commands can accept _optional_ and _required_ positional arguments. Required +positional arguments take the form ``, and optional arguments +take the form `[bar]`. The parsed positional arguments will be populated in +`argv`: + +```js +yargs.command('get [proxy]', 'make a get HTTP request') + .help() + .argv +``` + +#### Positional Argument Aliases + +Aliases can be provided for positional arguments using the `|` character. +As an example, suppose our application allows either a username _or_ +an email as the first argument: + +```js +yargs.command('get [password]', 'fetch a user by username or email.') + .help() + .argv +``` + +In this way, both `argv.username` and `argv.email` would be populated with the +same value when the command is executed. + +#### Variadic Positional Arguments + +The last positional argument can optionally accept an array of +values, by using the `..` operator: + +```js +yargs.command('download [files..]', 'download several files') + .help() + .argv +``` + +### Command Execution + +When a command is given on the command line, yargs will execute the following: + +1. push the command into the current context +2. reset non-global configuration +3. apply command configuration via the `builder`, if given +4. parse and validate args from the command line, including positional args +5. if validation succeeds, run the `handler` function, if given +6. pop the command from the current context + +### Command Aliases + +You can define aliases for a command by putting the command and all of its +aliases into an array. + +Alternatively, a command module may specify an `aliases` property, which may be +a string or an array of strings. All aliases defined via the `command` property +and the `aliases` property will be concatenated together. + +The first element in the array is considered the canonical command, which may +define positional arguments, and the remaining elements in the array are +considered aliases. Aliases inherit positional args from the canonical command, +and thus any positional args defined in the aliases themselves are ignored. + +If either the canonical command or any of its aliases are given on the command +line, the command will be executed. + +```js +#!/usr/bin/env node +require('yargs') + .command(['start [app]', 'run', 'up'], 'Start up an app', {}, (argv) => { + console.log('starting up the', argv.app || 'default', 'app') + }) + .command({ + command: 'configure [value]', + aliases: ['config', 'cfg'], + desc: 'Set a config variable', + builder: (yargs) => yargs.default('value', 'true'), + handler: (argv) => { + console.log(`setting ${argv.key} to ${argv.value}`) + } + }) + .demandCommand() + .help() + .wrap(72) + .argv +``` + +``` +$ ./svc.js help +Commands: + start [app] Start up an app [aliases: run, up] + configure [value] Set a config variable [aliases: config, cfg] + +Options: + --help Show help [boolean] + +$ ./svc.js cfg concurrency 4 +setting concurrency to 4 + +$ ./svc.js run web +starting up the web app +``` + +### Providing a Command Module + +For complicated commands you can pull the logic into a module. A module +simply needs to export: + +* `exports.command`: string (or array of strings) that executes this command when given on the command line, first string may contain positional args +* `exports.aliases`: array of strings (or a single string) representing aliases of `exports.command`, positional args defined in an alias are ignored +* `exports.describe`: string used as the description for the command in help text, use `false` for a hidden command +* `exports.builder`: object declaring the options the command accepts, or a function accepting and returning a yargs instance +* `exports.handler`: a function which will be passed the parsed argv. + +```js +// my-module.js +exports.command = 'get [proxy]' + +exports.describe = 'make a get HTTP request' + +exports.builder = { + banana: { + default: 'cool' + }, + batman: { + default: 'sad' + } +} + +exports.handler = function (argv) { + // do something with argv. +} +``` + +You then register the module like so: + +```js +yargs.command(require('my-module')) + .help() + .argv +``` + +Or if the module does not export `command` and `describe` (or if you just want to override them): + +```js +yargs.command('get [proxy]', 'make a get HTTP request', require('my-module')) + .help() + .argv +``` + +.commandDir(directory, [opts]) +------------------------------ + +Apply command modules from a directory relative to the module calling this method. + +This allows you to organize multiple commands into their own modules under a +single directory and apply all of them at once instead of calling +`.command(require('./dir/module'))` multiple times. + +By default, it ignores subdirectories. This is so you can use a directory +structure to represent your command hierarchy, where each command applies its +subcommands using this method in its builder function. See the example below. + +Note that yargs assumes all modules in the given directory are command modules +and will error if non-command modules are encountered. In this scenario, you +can either move your module to a different directory or use the `exclude` or +`visit` option to manually filter it out. More on that below. + +`directory` is a relative directory path as a string (required). + +`opts` is an options object (optional). The following options are valid: + +- `recurse`: boolean, default `false` + + Look for command modules in all subdirectories and apply them as a flattened + (non-hierarchical) list. + +- `extensions`: array of strings, default `['js']` + + The types of files to look for when requiring command modules. + +- `visit`: function + + A synchronous function called for each command module encountered. Accepts + `commandObject`, `pathToFile`, and `filename` as arguments. Returns + `commandObject` to include the command; any falsy value to exclude/skip it. + +- `include`: RegExp or function + + Whitelist certain modules. See [`require-directory` whitelisting](https://www.npmjs.com/package/require-directory#whitelisting) for details. + +- `exclude`: RegExp or function + + Blacklist certain modules. See [`require-directory` blacklisting](https://www.npmjs.com/package/require-directory#blacklisting) for details. + +### Example command hierarchy using `.commandDir()` + +Desired CLI: + +```sh +$ myapp --help +$ myapp init +$ myapp remote --help +$ myapp remote add base http://yargs.js.org +$ myapp remote prune base +$ myapp remote prune base fork whatever +``` + +Directory structure: + +``` +myapp/ +├─ cli.js +└─ cmds/ + ├─ init.js + ├─ remote.js + └─ remote_cmds/ + ├─ add.js + └─ prune.js +``` + +cli.js: + +```js +#!/usr/bin/env node +require('yargs') + .commandDir('cmds') + .demandCommand() + .help() + .argv +``` + +cmds/init.js: + +```js +exports.command = 'init [dir]' +exports.desc = 'Create an empty repo' +exports.builder = { + dir: { + default: '.' + } +} +exports.handler = function (argv) { + console.log('init called for dir', argv.dir) +} +``` + +cmds/remote.js: + +```js +exports.command = 'remote ' +exports.desc = 'Manage set of tracked repos' +exports.builder = function (yargs) { + return yargs.commandDir('remote_cmds') +} +exports.handler = function (argv) {} +``` + +cmds/remote_cmds/add.js: + +```js +exports.command = 'add ' +exports.desc = 'Add remote named for repo at url ' +exports.builder = {} +exports.handler = function (argv) { + console.log('adding remote %s at url %s', argv.name, argv.url) +} +``` + +cmds/remote_cmds/prune.js: + +```js +exports.command = 'prune [names..]' +exports.desc = 'Delete tracked branches gone stale for remotes' +exports.builder = {} +exports.handler = function (argv) { + console.log('pruning remotes %s', [].concat(argv.name).concat(argv.names).join(', ')) +} +``` + +.completion([cmd], [description], [fn]) +--------------------------------------- + +Enable bash-completion shortcuts for commands and options. + +`cmd`: When present in `argv._`, will result in the `.bashrc` completion script +being outputted. To enable bash completions, concat the generated script to your +`.bashrc` or `.bash_profile`. + +`description`: Provide a description in your usage instructions for the command +that generates bash completion scripts. + +`fn`: Rather than relying on yargs' default completion functionality, which +shiver me timbers is pretty awesome, you can provide your own completion +method. + +If invoked without parameters, `.completion()` will make `completion` the command to output +the completion script. + +```js +var argv = require('yargs') + .completion('completion', function(current, argv) { + // 'current' is the current command being completed. + // 'argv' is the parsed arguments so far. + // simply return an array of completions. + return [ + 'foo', + 'bar' + ]; + }) + .argv; +``` + +You can also provide asynchronous completions. + +```js +var argv = require('yargs') + .completion('completion', function(current, argv, done) { + setTimeout(function() { + done([ + 'apple', + 'banana' + ]); + }, 500); + }) + .argv; +``` + +But wait, there's more! You can return an asynchronous promise. + +```js +var argv = require('yargs') + .completion('completion', function(current, argv, done) { + return new Promise(function (resolve, reject) { + setTimeout(function () { + resolve(['apple', 'banana']) + }, 10) + }) + }) + .argv; +``` + +.config([key], [description], [parseFn]) +------------------------------------------------------------- +.config(object) +--------------- + +Tells the parser that if the option specified by `key` is passed in, it +should be interpreted as a path to a JSON config file. The file is loaded +and parsed, and its properties are set as arguments. Because the file is +loaded using Node's require(), the filename MUST end in `.json` to be +interpreted correctly. + +If invoked without parameters, `.config()` will make `--config` the option to pass the JSON config file. + +An optional `description` can be provided to customize the config (`key`) option +in the usage string. + +An optional `parseFn` can be used to provide a custom parser. The parsing +function must be synchronous, and should return an object containing +key value pairs or an error. + +```js +var argv = require('yargs') + .config('settings', function (configPath) { + return JSON.parse(fs.readFileSync(configPath, 'utf-8')) + }) + .argv +``` + +You can also pass an explicit configuration `object`, it will be parsed +and its properties will be set as arguments. + +```js +var argv = require('yargs') + .config({foo: 1, bar: 2}) + .argv +console.log(argv) +``` + +``` +$ node test.js +{ _: [], + foo: 1, + bar: 2, + '$0': 'test.js' } +``` + +Note that a configuration object may extend from a JSON file using the `"extends"` property. When doing so, the `"extends"` value should be a path (relative or absolute) to the extended JSON file. + +.conflicts(x, y) +---------------------------------------------- + +Given the key `x` is set, the key `y` must not be set. + +Optionally `.conflicts()` can accept an object specifying multiple conflicting keys. + +.count(key) +------------ + +Interpret `key` as a boolean flag, but set its parsed value to the number of +flag occurrences rather than `true` or `false`. Default value is thus `0`. + +.default(key, value, [description]) +--------------------------------------------------------- +.defaults(key, value, [description]) +------------------------------------ + +**Note:** The `.defaults()` alias is deprecated. It will be +removed in the next major version. + +Set `argv[key]` to `value` if no option was specified in `process.argv`. + +Optionally `.default()` can take an object that maps keys to default values. + +But wait, there's more! The default value can be a `function` which returns +a value. The name of the function will be used in the usage string: + +```js +var argv = require('yargs') + .default('random', function randomValue() { + return Math.random() * 256; + }).argv; +``` + +Optionally, `description` can also be provided and will take precedence over +displaying the value in the usage instructions: + +```js +.default('timeout', 60000, '(one-minute)') +``` + +.demand(count, [max], [msg]) [DEPRECATED] +-------------------- + +`demand()` has been deprecated, please instead see [`demandOption()`](#demandOption) and +[`demandCommand()`](#demandCommand). + +.demandOption(key, [msg | boolean]) +------------------------------ +.demandOption(key, msg) +------------------------------ + +If `key` is a string, show the usage information and exit if `key` wasn't +specified in `process.argv`. + +If `key` is an array, demand each element. + +If a `msg` string is given, it will be printed when the argument is missing, instead of the standard error message. + +```javascript +// demand an array of keys to be provided +require('yargs') + .option('run', { + alias: 'r', + describe: 'run your program' + }) + .option('path', { + alias: 'p', + describe: 'provide a path to file' + }) + .option('spec', { + alias: 's', + describe: 'program specifications' + }) + .demandOption(['run', 'path'], 'Please provide both run and path arguments to work with this tool') + .help() + .argv +``` +which will provide the following output: +```bash +Options: + --run, -r run your program [required] + --path, -p provide a path to file [required] + --spec, -s program specifications + --help Show help [boolean] + + Missing required arguments: run, path + Please provide both run and path arguments to work with this tool +``` + +If a `boolean` value is given, it controls whether the option is demanded; +this is useful when using `.options()` to specify command line parameters. + +```javascript +// demand individual options within the option constructor +require('yargs') + .options({ + 'run': { + alias: 'r', + describe: 'run your program', + demandOption: true + }, + 'path': { + alias: 'p', + describe: 'provide a path to file', + demandOption: true + }, + 'spec': { + alias: 's', + describe: 'program specifications' + } + }) + .help() + .argv +``` +which will provide the following output: +```bash +Options: + --run, -r run your program [required] + --path, -p provide a path to file [required] + --spec, -s program specifications + --help Show help [boolean] + +Missing required arguments: run, path +``` + +.demandCommand([min=1], [minMsg]) +------------------------------ +.demandCommand([min=1], [max], [minMsg], [maxMsg]) +------------------------------ + +Demand in context of commands. You can demand a minimum and a maximum number a user can have within your program, as well as provide corresponding error messages if either of the demands is not met. +```javascript +require('yargs') + .command({ + command: 'configure [value]', + aliases: ['config', 'cfg'], + desc: 'Set a config variable', + builder: (yargs) => yargs.default('value', 'true'), + handler: (argv) => { + console.log(`setting ${argv.key} to ${argv.value}`) + } + }) + // provide a minimum demand and a minimum demand message + .demandCommand(1, 'You need at least one command before moving on') + .help() + .argv +``` + +which will provide the following output: + +```bash +Commands: + configure [value] Set a config variable [aliases: config, cfg] + +Options: + --help Show help [boolean] + +You need at least one command before moving on +``` + +_Note: in `minMsg` and `maxMsg`, every occurrence of `$0` will be replaced +with the observed value, and every instance of `$1` will be replaced with the +expected value._ + +.describe(key, desc) +-------------------- + +Describe a `key` for the generated usage information. + +Optionally `.describe()` can take an object that maps keys to descriptions. + +.detectLocale(boolean) +----------- + +Should yargs attempt to detect the os' locale? Defaults to `true`. + +.env([prefix]) +-------------- + +Tell yargs to parse environment variables matching the given prefix and apply +them to argv as though they were command line arguments. + +Use the "__" separator in the environment variable to indicate nested options. +(e.g. prefix_nested__foo => nested.foo) + +If this method is called with no argument or with an empty string or with `true`, +then all env vars will be applied to argv. + +Program arguments are defined in this order of precedence: + +1. Command line args +2. Env vars +3. Config file/objects +4. Configured defaults + +```js +var argv = require('yargs') + .env('MY_PROGRAM') + .option('f', { + alias: 'fruit-thing', + default: 'apple' + }) + .argv +console.log(argv) +``` + +``` +$ node fruity.js +{ _: [], + f: 'apple', + 'fruit-thing': 'apple', + fruitThing: 'apple', + '$0': 'fruity.js' } +``` + +``` +$ MY_PROGRAM_FRUIT_THING=banana node fruity.js +{ _: [], + fruitThing: 'banana', + f: 'banana', + 'fruit-thing': 'banana', + '$0': 'fruity.js' } +``` + +``` +$ MY_PROGRAM_FRUIT_THING=banana node fruity.js -f cat +{ _: [], + f: 'cat', + 'fruit-thing': 'cat', + fruitThing: 'cat', + '$0': 'fruity.js' } +``` + +Env var parsing is disabled by default, but you can also explicitly disable it +by calling `.env(false)`, e.g. if you need to undo previous configuration. + +.epilog(str) +------------ +.epilogue(str) +-------------- + +A message to print at the end of the usage instructions, e.g. + +```js +var argv = require('yargs') + .epilogue('for more information, find our manual at http://example.com'); +``` + +.example(cmd, desc) +------------------- + +Give some example invocations of your program. Inside `cmd`, the string +`$0` will get interpolated to the current script name or node command for the +present script similar to how `$0` works in bash or perl. +Examples will be printed out as part of the help message. + +.exitProcess(enable) +---------------------------------- + +By default, yargs exits the process when the user passes a help flag, uses the +`.version` functionality, or when validation fails. Calling +`.exitProcess(false)` disables this behavior, enabling further actions after +yargs have been validated. + +.fail(fn) +--------- + +Method to execute when a failure occurs, rather than printing the failure message. + +`fn` is called with the failure message that would have been printed, the +`Error` instance originally thrown and yargs state when the failure +occured. + +```js +var argv = require('yargs') + .fail(function (msg, err, yargs) { + if (err) throw err // preserve stack + console.error('You broke it!') + console.error(msg) + console.error('You should be doing', yargs.help()) + process.exit(1) + }) + .argv +``` + +.getCompletion(args, done); +--------------------------- + +Allows to programmatically get completion choices for any line. + +`args`: An array of the words in the command line to complete. + +`done`: The callback to be called with the resulting completions. + +For example: + +```js +require('yargs') + .option('foobar') + .option('foobaz') + .completion() + .getCompletion(['./test.js', '--foo'], function (completions) { + console.log(completions) + }) +``` + +Outputs the same completion choices as `./test.js --foo`TAB: `--foobar` and `--foobaz` + +.global(globals, [global=true]) +------------ + +Indicate that an option (or group of options) should not be reset when a command +is executed, as an example: + +```js +var argv = require('yargs') + .option('a', { + alias: 'all', + default: true, + global: false + }) + .option('n', { + alias: 'none', + default: true, + global: false + }) + .command('foo', 'foo command', function (yargs) { + return yargs.option('b', { + alias: 'bar' + }) + }) + .help('help') + .global('a') + .argv +``` + +If the `foo` command is executed the `all` option will remain, but the `none` +option will have been eliminated. + +Options default to being global. + +.group(key(s), groupName) +-------------------- + +Given a key, or an array of keys, places options under an alternative heading +when displaying usage instructions, e.g., + +```js +var yargs = require('yargs')(['--help']) + .help() + .group('batman', 'Heroes:') + .describe('batman', "world's greatest detective") + .wrap(null) + .argv +``` +*** + Heroes: + --batman world's greatest detective + + Options: + --help Show help [boolean] + +.help() +----------------------------------------- +.help([option | boolean]) +----------------------------------------- +.help([option, [description | boolean]]) +----------------------------------------- +.help([option, [description, [boolean]]]) +----------------------------------------- + +Add an option (e.g. `--help`) and implicit command that displays the usage +string and exits the process. + +If present, the `description` parameter customizes the description of +the help option in the usage string. + +If a boolean argument is provided, it will enable or disable the use of an +implicit command. The implicit command is enabled by default, but it can be +disabled by passing `false`. + +Note that any multi-char aliases (e.g. `help`) used for the help option will +also be used for the implicit command. If there are no multi-char aliases (e.g. +`h`), then all single-char aliases will be used for the command. + +If invoked without parameters, `.help()` will use `--help` as the option and +`help` as the implicit command to trigger help output. + +Example: + +```js +var yargs = require("yargs")(['--help']) + .usage("$0 -operand1 number -operand2 number -operation [add|subtract]") + .help() + .argv +``` + +Later on, `argv` can be retrieved with `yargs.argv`. + +.implies(x, y) +-------------- + +Given the key `x` is set, it is required that the key `y` is set. + +Optionally `.implies()` can accept an object specifying multiple implications. + +.locale() +--------- + +Return the locale that yargs is currently using. + +By default, yargs will auto-detect the operating system's locale so that +yargs-generated help content will display in the user's language. + +To override this behavior with a static locale, pass the desired locale as a +string to this method (see below). + +.locale(locale) +--------------- + +Override the auto-detected locale from the user's operating system with a static +locale. Note that the OS locale can be modified by setting/exporting the `LC_ALL` +environment variable. + +```js +var argv = require('yargs') + .usage('./$0 - follow ye instructions true') + .option('option', { + alias: 'o', + describe: "'tis a mighty fine option", + demandOption: true + }) + .command('run', "Arrr, ya best be knowin' what yer doin'") + .example('$0 run foo', "shiver me timbers, here's an example for ye") + .help('help') + .wrap(70) + .locale('pirate') + .argv +``` + +*** + +```shell +./test.js - follow ye instructions true + +Choose yer command: + run Arrr, ya best be knowin' what yer doin' + +Options for me hearties! + --option, -o 'tis a mighty fine option [requi-yar-ed] + --help Parlay this here code of conduct [boolean] + +Ex. marks the spot: + test.js run foo shiver me timbers, here's an example for ye + +Ye be havin' to set the followin' argument land lubber: option +``` + +Locales currently supported: + +* **de:** German. +* **en:** American English. +* **es:** Spanish. +* **fr:** French. +* **hi:** Hindi. +* **hu:** Hungarian. +* **id:** Indonesian. +* **it:** Italian. +* **ja:** Japanese. +* **ko:** Korean. +* **nb:** Norwegian Bokmål. +* **pirate:** American Pirate. +* **pl:** Polish. +* **pt:** Portuguese. +* **pt_BR:** Brazilian Portuguese. +* **ru:** Russian. +* **th:** Thai. +* **tr:** Turkish. +* **zh_CN:** Chinese. + +To submit a new translation for yargs: + +1. use `./locales/en.json` as a starting point. +2. submit a pull request with the new locale file. + +*The [Microsoft Terminology Search](http://www.microsoft.com/Language/en-US/Search.aspx) can be useful for finding the correct terminology in your locale.* + +.nargs(key, count) +----------- + +The number of arguments that should be consumed after a key. This can be a +useful hint to prevent parsing ambiguity. For example: + +```js +var argv = require('yargs') + .nargs('token', 1) + .parse(['--token', '-my-token']); +``` + +parses as: + +`{ _: [], token: '-my-token', '$0': 'node test' }` + +Optionally `.nargs()` can take an object of `key`/`narg` pairs. + +.normalize(key) +--------------- + +The key provided represents a path and should have `path.normalize()` applied. + +.number(key) +------------ + +Tell the parser to always interpret `key` as a number. + +If `key` is an array, all elements will be parsed as numbers. + +If the option is given on the command line without a value, `argv` will be +populated with `undefined`. + +If the value given on the command line cannot be parsed as a number, `argv` will +be populated with `NaN`. + +Note that decimals, hexadecimals, and scientific notation are all accepted. + +```js +var argv = require('yargs') + .number('n') + .number(['width', 'height']) + .argv +``` + +.option(key, [opt]) +----------------- +.options(key, [opt]) +------------------ + +This method can be used to make yargs aware of options that _could_ +exist. You can also pass an `opt` object which can hold further +customization, like `.alias()`, `.demandOption()` etc. for that option. + +For example: + +````javascript +var argv = require('yargs') + .option('f', { + alias: 'file', + demandOption: true, + default: '/etc/passwd', + describe: 'x marks the spot', + type: 'string' + }) + .argv +; +```` + +is the same as + +````javascript +var argv = require('yargs') + .alias('f', 'file') + .demandOption('f') + .default('f', '/etc/passwd') + .describe('f', 'x marks the spot') + .string('f') + .argv +; +```` + +Optionally `.options()` can take an object that maps keys to `opt` parameters. + +````javascript +var argv = require('yargs') + .options({ + 'f': { + alias: 'file', + demandOption: true, + default: '/etc/passwd', + describe: 'x marks the spot', + type: 'string' + } + }) + .argv +; +```` + +Valid `opt` keys include: + +- `alias`: string or array of strings, alias(es) for the canonical option key, see [`alias()`](#alias) +- `array`: boolean, interpret option as an array, see [`array()`](#array) +- `boolean`: boolean, interpret option as a boolean flag, see [`boolean()`](#boolean) +- `choices`: value or array of values, limit valid option arguments to a predefined set, see [`choices()`](#choices) +- `coerce`: function, coerce or transform parsed command line values into another value, see [`coerce()`](#coerce) +- `config`: boolean, interpret option as a path to a JSON config file, see [`config()`](#config) +- `configParser`: function, provide a custom config parsing function, see [`config()`](#config) +- `conflicts`: string or object, require certain keys not to be set, see [`conflicts()`](#conflicts) +- `count`: boolean, interpret option as a count of boolean flags, see [`count()`](#count) +- `default`: value, set a default value for the option, see [`default()`](#default) +- `defaultDescription`: string, use this description for the default value in help content, see [`default()`](#default) +- `demandOption`: boolean or string, demand the option be given, with optional error message, see [`demandOption()`](#demandOption) +- `desc`/`describe`/`description`: string, the option description for help content, see [`describe()`](#describe) +- `global`: boolean, indicate that this key should not be [reset](#reset) when a command is invoked, see [`global()`](#global) +- `group`: string, when displaying usage instructions place the option under an alternative group heading, see [`group()`](#group) +- `implies`: string or object, require certain keys to be set, see [`implies()`](#implies) +- `nargs`: number, specify how many arguments should be consumed for the option, see [`nargs()`](#nargs) +- `normalize`: boolean, apply `path.normalize()` to the option, see [`normalize()`](#normalize) +- `number`: boolean, interpret option as a number, [`number()`](#number) +- `requiresArg`: boolean, require the option be specified with a value, see [`requiresArg()`](#requiresArg) +- `skipValidation`: boolean, skips validation if the option is present, see [`skipValidation()`](#skipValidation) +- `string`: boolean, interpret option as a string, see [`string()`](#string) +- `type`: one of the following strings + - `'array'`: synonymous for `array: true`, see [`array()`](#array) + - `'boolean'`: synonymous for `boolean: true`, see [`boolean()`](#boolean) + - `'count'`: synonymous for `count: true`, see [`count()`](#count) + - `'number'`: synonymous for `number: true`, see [`number()`](#number) + - `'string'`: synonymous for `string: true`, see [`string()`](#string) + +.parse(args, [context], [parseCallback]) +------------ + +Parse `args` instead of `process.argv`. Returns the `argv` object. +`args` may either be a pre-processed argv array, or a raw argument string. + +A `context` object can optionally be given as the second argument to `parse()`, providing a +useful mechanism for passing state information to commands: + +```js +const parser = yargs + .command('lunch-train ', 'start lunch train', function () {}, function (argv) { + console.log(argv.restaurant, argv.time) + }) + .parse("lunch-train rudy's", {time: '12:15'}) +``` + +A `parseCallback` can also be provided to `.parse()`. If a callback is given, it will be invoked with three arguments: + +1. `err`: populated if any validation errors raised while parsing. +2. `argv`: the parsed argv object. +3. `output`: any text that would have been output to the terminal, had a + callback not been provided. + +```js +// providing the `fn` argument to `parse()` runs yargs in headless mode, this +// makes it easy to use yargs in contexts other than the CLI, e.g., writing +// a chat-bot. +const parser = yargs + .command('lunch-train