From cca2fcc794b2083e61e22c46bf154134555b9290 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Sat, 27 Feb 2021 10:31:43 +0100 Subject: [PATCH] remove node modules --- .gitignore | 1 + node_modules/.bin/acorn | 1 - node_modules/.bin/cleancss | 1 - node_modules/.bin/jade | 1 - node_modules/.bin/mime | 1 - node_modules/.bin/mkdirp | 1 - node_modules/.bin/parser | 1 - node_modules/.bin/uglifyjs | 1 - node_modules/.bin/xml2json | 1 - .../helper-validator-identifier/LICENSE | 22 - .../helper-validator-identifier/README.md | 19 - .../lib/identifier.js | 77 - .../helper-validator-identifier/lib/index.js | 57 - .../lib/keyword.js | 38 - .../helper-validator-identifier/package.json | 50 - .../scripts/generate-identifier-regex.js | 75 - node_modules/@babel/parser/CHANGELOG.md | 1073 - node_modules/@babel/parser/LICENSE | 19 - node_modules/@babel/parser/README.md | 19 - .../@babel/parser/bin/babel-parser.js | 15 - node_modules/@babel/parser/lib/index.js | 13937 ----------- node_modules/@babel/parser/lib/index.js.map | 1 - node_modules/@babel/parser/package.json | 78 - .../@babel/parser/typings/babel-parser.d.ts | 169 - node_modules/@babel/types/LICENSE | 22 - node_modules/@babel/types/README.md | 19 - .../@babel/types/lib/asserts/assertNode.js | 19 - .../types/lib/asserts/generated/index.js | 1479 -- .../types/lib/ast-types/generated/index.js | 0 .../@babel/types/lib/builders/builder.js | 42 - .../lib/builders/flow/createFlowUnionType.js | 22 - .../flow/createTypeAnnotationBasedOnTypeof.js | 28 - .../types/lib/builders/generated/index.js | 1248 - .../types/lib/builders/generated/uppercase.js | 1489 -- .../types/lib/builders/react/buildChildren.js | 31 - .../builders/typescript/createTSUnionType.js | 23 - node_modules/@babel/types/lib/clone/clone.js | 14 - .../@babel/types/lib/clone/cloneDeep.js | 14 - .../types/lib/clone/cloneDeepWithoutLoc.js | 14 - .../@babel/types/lib/clone/cloneNode.js | 103 - .../@babel/types/lib/clone/cloneWithoutLoc.js | 14 - .../@babel/types/lib/comments/addComment.js | 17 - .../@babel/types/lib/comments/addComments.js | 23 - .../lib/comments/inheritInnerComments.js | 14 - .../lib/comments/inheritLeadingComments.js | 14 - .../lib/comments/inheritTrailingComments.js | 14 - .../types/lib/comments/inheritsComments.js | 21 - .../types/lib/comments/removeComments.js | 16 - .../types/lib/constants/generated/index.js | 99 - .../@babel/types/lib/constants/index.js | 49 - .../@babel/types/lib/converters/Scope.js | 0 .../types/lib/converters/ensureBlock.js | 14 - .../converters/gatherSequenceExpressions.js | 77 - .../lib/converters/toBindingIdentifierName.js | 16 - .../@babel/types/lib/converters/toBlock.js | 34 - .../types/lib/converters/toComputedKey.js | 15 - .../types/lib/converters/toExpression.js | 33 - .../types/lib/converters/toIdentifier.js | 32 - .../@babel/types/lib/converters/toKeyAlias.js | 48 - .../lib/converters/toSequenceExpression.js | 23 - .../types/lib/converters/toStatement.js | 47 - .../types/lib/converters/valueToNode.js | 91 - .../@babel/types/lib/definitions/core.js | 1489 -- .../types/lib/definitions/experimental.js | 213 - .../@babel/types/lib/definitions/flow.js | 467 - .../@babel/types/lib/definitions/index.js | 97 - .../@babel/types/lib/definitions/jsx.js | 165 - .../@babel/types/lib/definitions/misc.js | 35 - .../types/lib/definitions/placeholders.js | 33 - .../types/lib/definitions/typescript.js | 433 - .../@babel/types/lib/definitions/utils.js | 320 - .../@babel/types/lib/index-legacy.d.ts | 2634 --- node_modules/@babel/types/lib/index.d.ts | 2919 --- node_modules/@babel/types/lib/index.js | 654 - node_modules/@babel/types/lib/index.js.flow | 2495 -- .../modifications/appendToMemberExpression.js | 15 - .../flow/removeTypeDuplicates.js | 78 - .../types/lib/modifications/inherits.js | 33 - .../prependToMemberExpression.js | 13 - .../lib/modifications/removeProperties.js | 30 - .../lib/modifications/removePropertiesDeep.js | 17 - .../typescript/removeTypeDuplicates.js | 54 - .../lib/retrievers/getBindingIdentifiers.js | 103 - .../retrievers/getOuterBindingIdentifiers.js | 17 - .../@babel/types/lib/traverse/traverse.js | 55 - .../@babel/types/lib/traverse/traverseFast.js | 28 - .../@babel/types/lib/utils/inherit.js | 12 - .../react/cleanJSXElementLiteralChild.js | 47 - .../@babel/types/lib/utils/shallowEqual.js | 18 - .../validators/buildMatchMemberExpression.js | 15 - .../types/lib/validators/generated/index.js | 4685 ---- .../@babel/types/lib/validators/is.js | 35 - .../@babel/types/lib/validators/isBinding.js | 33 - .../types/lib/validators/isBlockScoped.js | 16 - .../types/lib/validators/isImmutable.js | 26 - .../@babel/types/lib/validators/isLet.js | 14 - .../@babel/types/lib/validators/isNode.js | 12 - .../types/lib/validators/isNodesEquivalent.js | 67 - .../types/lib/validators/isPlaceholderType.js | 21 - .../types/lib/validators/isReferenced.js | 116 - .../@babel/types/lib/validators/isScope.js | 20 - .../lib/validators/isSpecifierDefault.js | 14 - .../@babel/types/lib/validators/isType.js | 24 - .../lib/validators/isValidES3Identifier.js | 16 - .../types/lib/validators/isValidIdentifier.js | 20 - .../@babel/types/lib/validators/isVar.js | 16 - .../types/lib/validators/matchesPattern.js | 40 - .../types/lib/validators/react/isCompatTag.js | 10 - .../lib/validators/react/isReactComponent.js | 14 - .../@babel/types/lib/validators/validate.js | 32 - node_modules/@babel/types/package.json | 72 - .../types/scripts/generators/asserts.js | 50 - .../types/scripts/generators/ast-types.js | 138 - .../types/scripts/generators/builders.js | 163 - .../types/scripts/generators/constants.js | 15 - .../@babel/types/scripts/generators/docs.js | 115 - .../@babel/types/scripts/generators/flow.js | 260 - .../scripts/generators/typescript-legacy.js | 369 - .../types/scripts/generators/validators.js | 87 - .../@babel/types/scripts/package.json | 1 - .../types/scripts/utils/formatBuilderName.js | 8 - .../@babel/types/scripts/utils/lowerFirst.js | 3 - .../types/scripts/utils/stringifyValidator.js | 66 - .../types/scripts/utils/toFunctionName.js | 4 - node_modules/accepts/HISTORY.md | 236 - node_modules/accepts/LICENSE | 23 - node_modules/accepts/README.md | 142 - node_modules/accepts/index.js | 238 - node_modules/accepts/package.json | 86 - node_modules/acorn-globals/LICENSE | 19 - node_modules/acorn-globals/README.md | 76 - node_modules/acorn-globals/index.js | 180 - node_modules/acorn-globals/package.json | 65 - node_modules/acorn/.editorconfig | 7 - node_modules/acorn/.gitattributes | 1 - node_modules/acorn/.npmignore | 3 - node_modules/acorn/.tern-project | 6 - node_modules/acorn/.travis.yml | 6 - node_modules/acorn/AUTHORS | 43 - node_modules/acorn/LICENSE | 19 - node_modules/acorn/README.md | 396 - node_modules/acorn/bin/acorn | 71 - node_modules/acorn/bin/build-acorn.js | 82 - .../acorn/bin/generate-identifier-regex.js | 47 - node_modules/acorn/bin/update_authors.sh | 6 - node_modules/acorn/dist/.keep | 0 node_modules/acorn/dist/acorn.js | 3340 --- node_modules/acorn/dist/acorn_loose.js | 1300 -- node_modules/acorn/dist/walk.js | 377 - node_modules/acorn/package.json | 198 - node_modules/acorn/src/bin/acorn.js | 59 - node_modules/acorn/src/expression.js | 707 - node_modules/acorn/src/identifier.js | 90 - node_modules/acorn/src/index.js | 67 - node_modules/acorn/src/location.js | 24 - node_modules/acorn/src/locutil.js | 42 - node_modules/acorn/src/loose/acorn_loose.js | 0 node_modules/acorn/src/loose/expression.js | 501 - node_modules/acorn/src/loose/index.js | 50 - node_modules/acorn/src/loose/parseutil.js | 1 - node_modules/acorn/src/loose/state.js | 160 - node_modules/acorn/src/loose/statement.js | 420 - node_modules/acorn/src/loose/tokenize.js | 108 - node_modules/acorn/src/lval.js | 215 - node_modules/acorn/src/node.js | 50 - node_modules/acorn/src/options.js | 121 - node_modules/acorn/src/parseutil.js | 102 - node_modules/acorn/src/state.js | 104 - node_modules/acorn/src/statement.js | 626 - node_modules/acorn/src/tokencontext.js | 109 - node_modules/acorn/src/tokenize.js | 682 - node_modules/acorn/src/tokentype.js | 147 - node_modules/acorn/src/util.js | 9 - node_modules/acorn/src/walk/index.js | 340 - node_modules/acorn/src/whitespace.js | 12 - node_modules/align-text/LICENSE | 21 - node_modules/align-text/README.md | 236 - node_modules/align-text/index.js | 52 - node_modules/align-text/package.json | 78 - node_modules/amdefine/LICENSE | 58 - node_modules/amdefine/README.md | 171 - node_modules/amdefine/amdefine.js | 301 - node_modules/amdefine/intercept.js | 36 - node_modules/amdefine/package.json | 49 - node_modules/array-flatten/LICENSE | 21 - node_modules/array-flatten/README.md | 43 - node_modules/array-flatten/array-flatten.js | 64 - node_modules/array-flatten/package.json | 64 - node_modules/asap/LICENSE.md | 20 - node_modules/asap/README.md | 81 - node_modules/asap/asap.js | 113 - node_modules/asap/package.json | 42 - node_modules/assert-never/README.md | 39 - node_modules/assert-never/index.d.ts | 27 - node_modules/assert-never/index.js | 35 - node_modules/assert-never/index.ts | 36 - node_modules/assert-never/package.json | 63 - node_modules/babel-walk/LICENSE.md | 7 - node_modules/babel-walk/README.md | 127 - node_modules/babel-walk/lib/.tsbuildinfo | 1704 -- node_modules/babel-walk/lib/explode.d.ts | 8 - node_modules/babel-walk/lib/explode.js | 109 - node_modules/babel-walk/lib/explode.js.map | 1 - node_modules/babel-walk/lib/index.d.ts | 24 - node_modules/babel-walk/lib/index.js | 136 - node_modules/babel-walk/lib/index.js.map | 1 - node_modules/babel-walk/lib/test.d.ts | 1 - node_modules/babel-walk/lib/test.js | 35 - node_modules/babel-walk/lib/test.js.map | 1 - node_modules/babel-walk/package.json | 68 - node_modules/basic-auth/HISTORY.md | 52 - node_modules/basic-auth/LICENSE | 24 - node_modules/basic-auth/README.md | 113 - node_modules/basic-auth/index.js | 133 - node_modules/basic-auth/package.json | 73 - node_modules/bindings/LICENSE.md | 22 - node_modules/bindings/README.md | 98 - node_modules/bindings/bindings.js | 221 - node_modules/bindings/package.json | 57 - node_modules/body-parser/HISTORY.md | 588 - node_modules/body-parser/LICENSE | 23 - node_modules/body-parser/README.md | 445 - node_modules/body-parser/index.js | 157 - node_modules/body-parser/lib/read.js | 181 - node_modules/body-parser/lib/types/json.js | 230 - node_modules/body-parser/lib/types/raw.js | 101 - node_modules/body-parser/lib/types/text.js | 121 - .../body-parser/lib/types/urlencoded.js | 284 - .../node_modules/debug/.coveralls.yml | 1 - .../body-parser/node_modules/debug/.eslintrc | 11 - .../body-parser/node_modules/debug/.npmignore | 9 - .../node_modules/debug/.travis.yml | 14 - .../node_modules/debug/CHANGELOG.md | 362 - .../body-parser/node_modules/debug/LICENSE | 19 - .../body-parser/node_modules/debug/Makefile | 50 - .../body-parser/node_modules/debug/README.md | 312 - .../node_modules/debug/component.json | 19 - .../node_modules/debug/karma.conf.js | 70 - .../body-parser/node_modules/debug/node.js | 1 - .../node_modules/debug/package.json | 88 - .../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/http-errors/HISTORY.md | 132 - .../node_modules/http-errors/LICENSE | 23 - .../node_modules/http-errors/README.md | 135 - .../node_modules/http-errors/index.js | 260 - .../node_modules/http-errors/package.json | 90 - node_modules/body-parser/package.json | 97 - node_modules/bytes/History.md | 82 - node_modules/bytes/LICENSE | 23 - node_modules/bytes/Readme.md | 125 - node_modules/bytes/index.js | 159 - node_modules/bytes/package.json | 82 - node_modules/call-bind/.eslintignore | 1 - node_modules/call-bind/.eslintrc | 17 - node_modules/call-bind/.github/FUNDING.yml | 12 - node_modules/call-bind/.nycrc | 13 - node_modules/call-bind/CHANGELOG.md | 42 - node_modules/call-bind/LICENSE | 21 - node_modules/call-bind/README.md | 2 - node_modules/call-bind/callBound.js | 15 - node_modules/call-bind/index.js | 47 - node_modules/call-bind/package.json | 108 - node_modules/call-bind/test/callBound.js | 55 - node_modules/call-bind/test/index.js | 66 - node_modules/camelcase/index.js | 27 - node_modules/camelcase/license | 21 - node_modules/camelcase/package.json | 70 - node_modules/camelcase/readme.md | 56 - node_modules/center-align/LICENSE | 21 - node_modules/center-align/README.md | 74 - node_modules/center-align/index.js | 16 - node_modules/center-align/package.json | 82 - node_modules/center-align/utils.js | 40 - node_modules/character-parser/.npmignore | 2 - node_modules/character-parser/LICENSE | 19 - node_modules/character-parser/README.md | 142 - node_modules/character-parser/index.js | 231 - node_modules/character-parser/package.json | 60 - node_modules/clean-css/History.md | 1138 - node_modules/clean-css/LICENSE | 19 - node_modules/clean-css/README.md | 369 - node_modules/clean-css/bin/cleancss | 184 - node_modules/clean-css/index.js | 1 - node_modules/clean-css/lib/clean.js | 231 - .../lib/colors/hex-name-shortener.js | 186 - node_modules/clean-css/lib/colors/hsl.js | 67 - node_modules/clean-css/lib/colors/rgb.js | 16 - node_modules/clean-css/lib/imports/inliner.js | 399 - .../clean-css/lib/properties/break-up.js | 335 - .../clean-css/lib/properties/can-override.js | 142 - .../clean-css/lib/properties/clone.js | 26 - .../clean-css/lib/properties/compactable.js | 285 - .../lib/properties/every-combination.js | 28 - .../clean-css/lib/properties/has-inherit.js | 10 - .../lib/properties/invalid-property-error.js | 10 - .../clean-css/lib/properties/optimizer.js | 215 - .../lib/properties/override-compactor.js | 384 - .../lib/properties/populate-components.js | 32 - .../clean-css/lib/properties/remove-unused.js | 10 - .../lib/properties/restore-from-optimizing.js | 60 - .../clean-css/lib/properties/restore.js | 232 - .../lib/properties/shorthand-compactor.js | 134 - .../clean-css/lib/properties/validator.js | 197 - .../lib/properties/vendor-prefixes.js | 26 - .../lib/properties/wrap-for-optimizing.js | 118 - .../clean-css/lib/selectors/advanced.js | 86 - .../clean-css/lib/selectors/clean-up.js | 89 - .../clean-css/lib/selectors/extractor.js | 69 - .../clean-css/lib/selectors/is-special.js | 5 - .../clean-css/lib/selectors/merge-adjacent.js | 35 - .../lib/selectors/merge-media-queries.js | 64 - .../selectors/merge-non-adjacent-by-body.js | 61 - .../merge-non-adjacent-by-selector.js | 76 - .../lib/selectors/reduce-non-adjacent.js | 172 - .../remove-duplicate-media-queries.js | 21 - .../lib/selectors/remove-duplicates.js | 41 - .../clean-css/lib/selectors/reorderable.js | 99 - .../clean-css/lib/selectors/restructure.js | 369 - .../clean-css/lib/selectors/simple.js | 454 - .../clean-css/lib/source-maps/track.js | 119 - .../clean-css/lib/stringifier/helpers.js | 167 - .../clean-css/lib/stringifier/one-time.js | 50 - .../clean-css/lib/stringifier/simple.js | 22 - .../clean-css/lib/stringifier/source-maps.js | 96 - .../clean-css/lib/text/comments-processor.js | 131 - .../clean-css/lib/text/escape-store.js | 53 - .../lib/text/expressions-processor.js | 117 - .../clean-css/lib/text/free-text-processor.js | 98 - .../clean-css/lib/text/urls-processor.js | 75 - .../lib/tokenizer/extract-properties.js | 193 - .../lib/tokenizer/extract-selectors.js | 17 - .../clean-css/lib/tokenizer/tokenize.js | 297 - node_modules/clean-css/lib/urls/rebase.js | 30 - node_modules/clean-css/lib/urls/reduce.js | 154 - node_modules/clean-css/lib/urls/rewrite.js | 107 - .../clean-css/lib/utils/clone-array.js | 12 - .../clean-css/lib/utils/compatibility.js | 162 - .../lib/utils/input-source-map-tracker.js | 284 - node_modules/clean-css/lib/utils/object.js | 11 - .../clean-css/lib/utils/quote-scanner.js | 119 - .../clean-css/lib/utils/source-reader.js | 96 - .../clean-css/lib/utils/source-tracker.js | 31 - node_modules/clean-css/lib/utils/split.js | 62 - .../node_modules/commander/History.md | 256 - .../clean-css/node_modules/commander/LICENSE | 22 - .../node_modules/commander/Readme.md | 342 - .../clean-css/node_modules/commander/index.js | 1103 - .../node_modules/commander/package.json | 65 - node_modules/clean-css/package.json | 84 - node_modules/cliui/.coveralls.yml | 1 - node_modules/cliui/.npmignore | 2 - node_modules/cliui/.travis.yml | 7 - node_modules/cliui/LICENSE.txt | 14 - node_modules/cliui/README.md | 104 - node_modules/cliui/index.js | 273 - .../cliui/node_modules/wordwrap/.npmignore | 1 - .../node_modules/wordwrap/README.markdown | 70 - .../node_modules/wordwrap/example/center.js | 10 - .../node_modules/wordwrap/example/meat.js | 3 - .../cliui/node_modules/wordwrap/index.js | 76 - .../cliui/node_modules/wordwrap/package.json | 66 - .../cliui/node_modules/wordwrap/test/break.js | 30 - .../node_modules/wordwrap/test/idleness.txt | 63 - .../cliui/node_modules/wordwrap/test/wrap.js | 31 - node_modules/cliui/package.json | 91 - node_modules/cliui/test/cliui.js | 349 - node_modules/commander/History.md | 222 - node_modules/commander/Readme.md | 300 - node_modules/commander/index.js | 1020 - node_modules/commander/package.json | 62 - node_modules/constantinople/.gitattributes | 22 - node_modules/constantinople/.npmignore | 13 - node_modules/constantinople/.travis.yml | 3 - node_modules/constantinople/LICENSE | 19 - node_modules/constantinople/README.md | 42 - node_modules/constantinople/index.js | 100 - node_modules/constantinople/package.json | 52 - node_modules/constantinople/test/index.js | 71 - node_modules/content-disposition/HISTORY.md | 50 - node_modules/content-disposition/LICENSE | 22 - node_modules/content-disposition/README.md | 141 - node_modules/content-disposition/index.js | 445 - node_modules/content-disposition/package.json | 74 - node_modules/content-type/HISTORY.md | 24 - node_modules/content-type/LICENSE | 22 - node_modules/content-type/README.md | 92 - node_modules/content-type/index.js | 222 - node_modules/content-type/package.json | 76 - node_modules/cookie-parser/HISTORY.md | 95 - node_modules/cookie-parser/LICENSE | 23 - node_modules/cookie-parser/README.md | 102 - node_modules/cookie-parser/index.js | 182 - .../node_modules/cookie/HISTORY.md | 123 - .../cookie-parser/node_modules/cookie/LICENSE | 24 - .../node_modules/cookie/README.md | 253 - .../node_modules/cookie/index.js | 198 - .../node_modules/cookie/package.json | 78 - node_modules/cookie-parser/package.json | 85 - node_modules/cookie-signature/.npmignore | 4 - node_modules/cookie-signature/History.md | 38 - node_modules/cookie-signature/Readme.md | 42 - node_modules/cookie-signature/index.js | 51 - node_modules/cookie-signature/package.json | 57 - node_modules/cookie/HISTORY.md | 118 - node_modules/cookie/LICENSE | 24 - node_modules/cookie/README.md | 220 - node_modules/cookie/index.js | 195 - node_modules/cookie/package.json | 71 - node_modules/css-parse/.npmignore | 6 - node_modules/css-parse/History.md | 30 - node_modules/css-parse/Makefile | 7 - node_modules/css-parse/Readme.md | 62 - node_modules/css-parse/component.json | 8 - node_modules/css-parse/index.js | 265 - node_modules/css-parse/package.json | 44 - node_modules/css-stringify/.npmignore | 6 - node_modules/css-stringify/History.md | 30 - node_modules/css-stringify/Makefile | 7 - node_modules/css-stringify/Readme.md | 33 - node_modules/css-stringify/component.json | 8 - node_modules/css-stringify/index.js | 182 - node_modules/css-stringify/package.json | 45 - node_modules/css/.npmignore | 4 - node_modules/css/History.md | 20 - node_modules/css/Makefile | 8 - node_modules/css/Readme.md | 77 - node_modules/css/benchmark.js | 36 - node_modules/css/component.json | 13 - node_modules/css/index.js | 3 - node_modules/css/package.json | 44 - node_modules/css/test.js | 6 - 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/depd/History.md | 96 - node_modules/depd/LICENSE | 22 - node_modules/depd/Readme.md | 280 - node_modules/depd/index.js | 522 - node_modules/depd/lib/browser/index.js | 77 - .../depd/lib/compat/callsite-tostring.js | 103 - .../depd/lib/compat/event-listener-count.js | 22 - node_modules/depd/lib/compat/index.js | 79 - node_modules/depd/package.json | 81 - node_modules/destroy/LICENSE | 22 - node_modules/destroy/README.md | 60 - node_modules/destroy/index.js | 75 - node_modules/destroy/package.json | 71 - node_modules/doctypes/.npmignore | 13 - node_modules/doctypes/.travis.yml | 3 - node_modules/doctypes/HISTORY.md | 14 - node_modules/doctypes/LICENSE | 19 - node_modules/doctypes/README.md | 24 - node_modules/doctypes/index.js | 13 - node_modules/doctypes/package.json | 50 - node_modules/doctypes/test.js | 9 - node_modules/ee-first/LICENSE | 22 - node_modules/ee-first/README.md | 80 - node_modules/ee-first/index.js | 95 - node_modules/ee-first/package.json | 63 - node_modules/encodeurl/HISTORY.md | 14 - node_modules/encodeurl/LICENSE | 22 - node_modules/encodeurl/README.md | 128 - node_modules/encodeurl/index.js | 60 - node_modules/encodeurl/package.json | 78 - node_modules/escape-html/LICENSE | 24 - node_modules/escape-html/Readme.md | 43 - node_modules/escape-html/index.js | 78 - node_modules/escape-html/package.json | 59 - node_modules/etag/HISTORY.md | 83 - node_modules/etag/LICENSE | 22 - node_modules/etag/README.md | 159 - node_modules/etag/index.js | 131 - node_modules/etag/package.json | 86 - node_modules/express/History.md | 3421 --- node_modules/express/LICENSE | 24 - node_modules/express/Readme.md | 153 - node_modules/express/index.js | 11 - node_modules/express/lib/application.js | 644 - node_modules/express/lib/express.js | 114 - node_modules/express/lib/middleware/init.js | 43 - node_modules/express/lib/middleware/query.js | 47 - node_modules/express/lib/request.js | 521 - node_modules/express/lib/response.js | 1137 - node_modules/express/lib/router/index.js | 662 - node_modules/express/lib/router/layer.js | 181 - node_modules/express/lib/router/route.js | 216 - node_modules/express/lib/utils.js | 306 - node_modules/express/lib/view.js | 182 - .../express/node_modules/debug/.coveralls.yml | 1 - .../express/node_modules/debug/.eslintrc | 11 - .../express/node_modules/debug/.npmignore | 9 - .../express/node_modules/debug/.travis.yml | 14 - .../express/node_modules/debug/CHANGELOG.md | 362 - .../express/node_modules/debug/LICENSE | 19 - .../express/node_modules/debug/Makefile | 50 - .../express/node_modules/debug/README.md | 312 - .../express/node_modules/debug/component.json | 19 - .../express/node_modules/debug/karma.conf.js | 70 - .../express/node_modules/debug/node.js | 1 - .../express/node_modules/debug/package.json | 88 - .../express/node_modules/debug/src/browser.js | 185 - .../express/node_modules/debug/src/debug.js | 202 - .../express/node_modules/debug/src/index.js | 10 - .../node_modules/debug/src/inspector-log.js | 15 - .../express/node_modules/debug/src/node.js | 248 - node_modules/express/package.json | 156 - node_modules/file-uri-to-path/.npmignore | 1 - node_modules/file-uri-to-path/.travis.yml | 30 - node_modules/file-uri-to-path/History.md | 21 - node_modules/file-uri-to-path/LICENSE | 20 - node_modules/file-uri-to-path/README.md | 74 - node_modules/file-uri-to-path/index.d.ts | 2 - node_modules/file-uri-to-path/index.js | 66 - node_modules/file-uri-to-path/package.json | 61 - node_modules/file-uri-to-path/test/test.js | 24 - node_modules/file-uri-to-path/test/tests.json | 13 - node_modules/finalhandler/HISTORY.md | 180 - node_modules/finalhandler/LICENSE | 22 - node_modules/finalhandler/README.md | 148 - node_modules/finalhandler/index.js | 331 - .../node_modules/debug/.coveralls.yml | 1 - .../finalhandler/node_modules/debug/.eslintrc | 11 - .../node_modules/debug/.npmignore | 9 - .../node_modules/debug/.travis.yml | 14 - .../node_modules/debug/CHANGELOG.md | 362 - .../finalhandler/node_modules/debug/LICENSE | 19 - .../finalhandler/node_modules/debug/Makefile | 50 - .../finalhandler/node_modules/debug/README.md | 312 - .../node_modules/debug/component.json | 19 - .../node_modules/debug/karma.conf.js | 70 - .../finalhandler/node_modules/debug/node.js | 1 - .../node_modules/debug/package.json | 88 - .../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/finalhandler/package.json | 82 - node_modules/forwarded/HISTORY.md | 16 - node_modules/forwarded/LICENSE | 22 - node_modules/forwarded/README.md | 57 - node_modules/forwarded/index.js | 76 - node_modules/forwarded/package.json | 78 - node_modules/fresh/HISTORY.md | 70 - node_modules/fresh/LICENSE | 23 - node_modules/fresh/README.md | 119 - node_modules/fresh/index.js | 137 - node_modules/fresh/package.json | 90 - 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 | 96 - node_modules/function-bind/test/.eslintrc | 9 - node_modules/function-bind/test/index.js | 252 - node_modules/get-intrinsic/.eslintignore | 1 - node_modules/get-intrinsic/.eslintrc | 43 - .../get-intrinsic/.github/FUNDING.yml | 12 - node_modules/get-intrinsic/.nycrc | 13 - node_modules/get-intrinsic/CHANGELOG.md | 64 - node_modules/get-intrinsic/LICENSE | 21 - node_modules/get-intrinsic/README.md | 65 - node_modules/get-intrinsic/index.js | 330 - node_modules/get-intrinsic/package.json | 106 - .../get-intrinsic/test/GetIntrinsic.js | 260 - node_modules/graceful-readlink/.npmignore | 3 - node_modules/graceful-readlink/.travis.yml | 5 - node_modules/graceful-readlink/LICENSE | 22 - node_modules/graceful-readlink/README.md | 17 - node_modules/graceful-readlink/index.js | 12 - node_modules/graceful-readlink/package.json | 50 - 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 | 119 - 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/LICENSE-MIT | 22 - node_modules/has/README.md | 18 - node_modules/has/package.json | 74 - node_modules/has/src/index.js | 5 - node_modules/has/test/index.js | 10 - node_modules/hoek/.npmignore | 3 - node_modules/hoek/LICENSE | 32 - node_modules/hoek/README.md | 30 - node_modules/hoek/lib/escape.js | 168 - node_modules/hoek/lib/index.js | 978 - node_modules/hoek/package.json | 55 - node_modules/http-errors/HISTORY.md | 132 - node_modules/http-errors/LICENSE | 23 - node_modules/http-errors/README.md | 135 - node_modules/http-errors/index.js | 260 - node_modules/http-errors/package.json | 91 - node_modules/iconv-lite/.travis.yml | 23 - node_modules/iconv-lite/Changelog.md | 158 - node_modules/iconv-lite/LICENSE | 21 - node_modules/iconv-lite/README.md | 156 - .../iconv-lite/encodings/dbcs-codec.js | 555 - .../iconv-lite/encodings/dbcs-data.js | 176 - node_modules/iconv-lite/encodings/index.js | 22 - node_modules/iconv-lite/encodings/internal.js | 188 - .../iconv-lite/encodings/sbcs-codec.js | 72 - .../encodings/sbcs-data-generated.js | 451 - .../iconv-lite/encodings/sbcs-data.js | 169 - .../encodings/tables/big5-added.json | 122 - .../iconv-lite/encodings/tables/cp936.json | 264 - .../iconv-lite/encodings/tables/cp949.json | 273 - .../iconv-lite/encodings/tables/cp950.json | 177 - .../iconv-lite/encodings/tables/eucjp.json | 182 - .../encodings/tables/gb18030-ranges.json | 1 - .../encodings/tables/gbk-added.json | 55 - .../iconv-lite/encodings/tables/shiftjis.json | 125 - node_modules/iconv-lite/encodings/utf16.js | 177 - node_modules/iconv-lite/encodings/utf7.js | 290 - node_modules/iconv-lite/lib/bom-handling.js | 52 - node_modules/iconv-lite/lib/extend-node.js | 217 - node_modules/iconv-lite/lib/index.d.ts | 24 - node_modules/iconv-lite/lib/index.js | 153 - node_modules/iconv-lite/lib/streams.js | 121 - node_modules/iconv-lite/package.json | 77 - node_modules/inherits/LICENSE | 16 - node_modules/inherits/README.md | 42 - node_modules/inherits/inherits.js | 7 - node_modules/inherits/inherits_browser.js | 23 - node_modules/inherits/package.json | 63 - node_modules/ipaddr.js/LICENSE | 19 - node_modules/ipaddr.js/README.md | 233 - node_modules/ipaddr.js/ipaddr.min.js | 1 - node_modules/ipaddr.js/lib/ipaddr.js | 673 - node_modules/ipaddr.js/lib/ipaddr.js.d.ts | 68 - node_modules/ipaddr.js/package.json | 70 - 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 | 77 - node_modules/is-buffer/test/basic.js | 24 - node_modules/is-core-module/.eslintignore | 1 - node_modules/is-core-module/.eslintrc | 18 - .../is-core-module/.github/FUNDING.yml | 12 - .../.github/workflows/node-4+.yml | 54 - .../.github/workflows/node-iojs.yml | 58 - .../.github/workflows/node-pretest.yml | 26 - .../.github/workflows/node-zero.yml | 58 - .../.github/workflows/rebase.yml | 15 - .../.github/workflows/require-allow-edits.yml | 14 - node_modules/is-core-module/.nycrc | 13 - node_modules/is-core-module/CHANGELOG.md | 58 - node_modules/is-core-module/LICENSE | 20 - node_modules/is-core-module/README.md | 37 - node_modules/is-core-module/core.json | 83 - node_modules/is-core-module/index.js | 69 - node_modules/is-core-module/package.json | 94 - node_modules/is-core-module/test/index.js | 83 - node_modules/is-expression/CHANGELOG.md | 48 - node_modules/is-expression/LICENSE.md | 19 - node_modules/is-expression/README.md | 67 - node_modules/is-expression/index.js | 45 - .../is-expression/node_modules/.bin/acorn | 1 - .../node_modules/acorn/CHANGELOG.md | 620 - .../is-expression/node_modules/acorn/LICENSE | 21 - .../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 | 5186 ----- .../node_modules/acorn/dist/acorn.js.map | 1 - .../node_modules/acorn/dist/acorn.mjs | 5155 ---- .../node_modules/acorn/dist/acorn.mjs.d.ts | 2 - .../node_modules/acorn/dist/acorn.mjs.map | 1 - .../node_modules/acorn/dist/bin.js | 64 - .../node_modules/acorn/package.json | 67 - node_modules/is-expression/package.json | 62 - node_modules/is-promise/LICENSE | 19 - node_modules/is-promise/index.js | 6 - node_modules/is-promise/index.mjs | 3 - node_modules/is-promise/package.json | 55 - node_modules/is-promise/readme.md | 33 - node_modules/is-regex/.editorconfig | 20 - node_modules/is-regex/.eslintignore | 1 - node_modules/is-regex/.eslintrc | 19 - node_modules/is-regex/.nycrc | 13 - node_modules/is-regex/CHANGELOG.md | 179 - node_modules/is-regex/LICENSE | 20 - node_modules/is-regex/README.md | 47 - node_modules/is-regex/index.js | 59 - node_modules/is-regex/package.json | 112 - node_modules/is-regex/test/index.js | 105 - node_modules/isemail/LICENSE | 32 - node_modules/isemail/README.md | 84 - node_modules/isemail/lib/index.d.ts | 64 - node_modules/isemail/lib/index.js | 1499 -- node_modules/isemail/package.json | 68 - node_modules/jade/.npmignore | 15 - node_modules/jade/.release.json | 1 - node_modules/jade/History.md | 991 - node_modules/jade/LICENSE | 22 - node_modules/jade/README.md | 154 - node_modules/jade/Readme_zh-cn.md | 1285 - node_modules/jade/bin/jade.js | 295 - node_modules/jade/block-code.html | 0 node_modules/jade/component.json | 16 - node_modules/jade/jade.js | 9196 -------- node_modules/jade/lib/compiler.js | 723 - node_modules/jade/lib/doctypes.js | 12 - node_modules/jade/lib/filters-client.js | 10 - node_modules/jade/lib/filters.js | 96 - node_modules/jade/lib/index.js | 418 - node_modules/jade/lib/inline-tags.js | 23 - node_modules/jade/lib/lexer.js | 949 - node_modules/jade/lib/nodes/attrs.js | 83 - node_modules/jade/lib/nodes/block-comment.js | 24 - node_modules/jade/lib/nodes/block.js | 118 - node_modules/jade/lib/nodes/case.js | 33 - node_modules/jade/lib/nodes/code.js | 26 - node_modules/jade/lib/nodes/comment.js | 23 - node_modules/jade/lib/nodes/doctype.js | 20 - node_modules/jade/lib/nodes/each.js | 26 - node_modules/jade/lib/nodes/filter.js | 24 - node_modules/jade/lib/nodes/index.js | 16 - node_modules/jade/lib/nodes/literal.js | 20 - node_modules/jade/lib/nodes/mixin-block.js | 18 - node_modules/jade/lib/nodes/mixin.js | 26 - node_modules/jade/lib/nodes/node.js | 18 - node_modules/jade/lib/nodes/tag.js | 89 - node_modules/jade/lib/nodes/text.js | 26 - node_modules/jade/lib/parser.js | 846 - node_modules/jade/lib/runtime.js | 246 - node_modules/jade/lib/utils.js | 53 - node_modules/jade/package.json | 150 - node_modules/jade/release.js | 35 - node_modules/jade/runtime.js | 252 - node_modules/joi/CHANGELOG.md | 3 - node_modules/joi/LICENSE | 29 - node_modules/joi/README.md | 128 - node_modules/joi/lib/cast.js | 64 - node_modules/joi/lib/errors.js | 363 - node_modules/joi/lib/index.js | 447 - node_modules/joi/lib/language.js | 165 - node_modules/joi/lib/ref.js | 53 - node_modules/joi/lib/schemas.js | 25 - node_modules/joi/lib/set.js | 178 - .../joi/lib/types/alternatives/index.js | 193 - node_modules/joi/lib/types/any/index.js | 889 - node_modules/joi/lib/types/any/settings.js | 35 - node_modules/joi/lib/types/array/index.js | 669 - node_modules/joi/lib/types/binary/index.js | 100 - node_modules/joi/lib/types/boolean/index.js | 98 - node_modules/joi/lib/types/date/index.js | 179 - node_modules/joi/lib/types/func/index.js | 90 - node_modules/joi/lib/types/lazy/index.js | 53 - node_modules/joi/lib/types/number/index.js | 185 - node_modules/joi/lib/types/object/index.js | 928 - node_modules/joi/lib/types/string/index.js | 702 - node_modules/joi/lib/types/string/ip.js | 54 - node_modules/joi/lib/types/string/rfc3986.js | 219 - node_modules/joi/lib/types/string/uri.js | 46 - node_modules/joi/lib/types/symbol/index.js | 93 - node_modules/joi/node_modules/hoek/.npmignore | 3 - node_modules/joi/node_modules/hoek/LICENSE | 32 - node_modules/joi/node_modules/hoek/README.md | 30 - .../joi/node_modules/hoek/lib/escape.js | 168 - .../joi/node_modules/hoek/lib/index.js | 954 - .../joi/node_modules/hoek/package.json | 55 - node_modules/joi/package.json | 65 - node_modules/js-stringify/.npmignore | 13 - node_modules/js-stringify/.travis.yml | 3 - node_modules/js-stringify/LICENSE | 19 - node_modules/js-stringify/README.md | 34 - node_modules/js-stringify/index.js | 17 - node_modules/js-stringify/package.json | 49 - node_modules/js-stringify/test/index.js | 17 - node_modules/jstransformer/LICENSE | 19 - node_modules/jstransformer/README.md | 103 - node_modules/jstransformer/index.js | 328 - node_modules/jstransformer/package.json | 63 - 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/lazy-cache/LICENSE | 21 - node_modules/lazy-cache/README.md | 147 - node_modules/lazy-cache/index.js | 67 - node_modules/lazy-cache/package.json | 89 - node_modules/lodash/LICENSE | 47 - node_modules/lodash/README.md | 39 - node_modules/lodash/_DataView.js | 7 - node_modules/lodash/_Hash.js | 32 - node_modules/lodash/_LazyWrapper.js | 28 - node_modules/lodash/_ListCache.js | 32 - node_modules/lodash/_LodashWrapper.js | 22 - node_modules/lodash/_Map.js | 7 - node_modules/lodash/_MapCache.js | 32 - node_modules/lodash/_Promise.js | 7 - node_modules/lodash/_Set.js | 7 - node_modules/lodash/_SetCache.js | 27 - node_modules/lodash/_Stack.js | 27 - node_modules/lodash/_Symbol.js | 6 - node_modules/lodash/_Uint8Array.js | 6 - node_modules/lodash/_WeakMap.js | 7 - node_modules/lodash/_apply.js | 21 - node_modules/lodash/_arrayAggregator.js | 22 - node_modules/lodash/_arrayEach.js | 22 - node_modules/lodash/_arrayEachRight.js | 21 - node_modules/lodash/_arrayEvery.js | 23 - node_modules/lodash/_arrayFilter.js | 25 - node_modules/lodash/_arrayIncludes.js | 17 - node_modules/lodash/_arrayIncludesWith.js | 22 - node_modules/lodash/_arrayLikeKeys.js | 49 - node_modules/lodash/_arrayMap.js | 21 - node_modules/lodash/_arrayPush.js | 20 - node_modules/lodash/_arrayReduce.js | 26 - node_modules/lodash/_arrayReduceRight.js | 24 - node_modules/lodash/_arraySample.js | 15 - node_modules/lodash/_arraySampleSize.js | 17 - node_modules/lodash/_arrayShuffle.js | 15 - node_modules/lodash/_arraySome.js | 23 - node_modules/lodash/_asciiSize.js | 12 - node_modules/lodash/_asciiToArray.js | 12 - node_modules/lodash/_asciiWords.js | 15 - node_modules/lodash/_assignMergeValue.js | 20 - node_modules/lodash/_assignValue.js | 28 - node_modules/lodash/_assocIndexOf.js | 21 - node_modules/lodash/_baseAggregator.js | 21 - node_modules/lodash/_baseAssign.js | 17 - node_modules/lodash/_baseAssignIn.js | 17 - node_modules/lodash/_baseAssignValue.js | 25 - node_modules/lodash/_baseAt.js | 23 - node_modules/lodash/_baseClamp.js | 22 - node_modules/lodash/_baseClone.js | 166 - node_modules/lodash/_baseConforms.js | 18 - node_modules/lodash/_baseConformsTo.js | 27 - node_modules/lodash/_baseCreate.js | 30 - node_modules/lodash/_baseDelay.js | 21 - node_modules/lodash/_baseDifference.js | 67 - node_modules/lodash/_baseEach.js | 14 - node_modules/lodash/_baseEachRight.js | 14 - node_modules/lodash/_baseEvery.js | 21 - node_modules/lodash/_baseExtremum.js | 32 - node_modules/lodash/_baseFill.js | 32 - node_modules/lodash/_baseFilter.js | 21 - node_modules/lodash/_baseFindIndex.js | 24 - node_modules/lodash/_baseFindKey.js | 23 - node_modules/lodash/_baseFlatten.js | 38 - node_modules/lodash/_baseFor.js | 16 - node_modules/lodash/_baseForOwn.js | 16 - node_modules/lodash/_baseForOwnRight.js | 16 - node_modules/lodash/_baseForRight.js | 15 - node_modules/lodash/_baseFunctions.js | 19 - node_modules/lodash/_baseGet.js | 24 - node_modules/lodash/_baseGetAllKeys.js | 20 - node_modules/lodash/_baseGetTag.js | 28 - node_modules/lodash/_baseGt.js | 14 - node_modules/lodash/_baseHas.js | 19 - node_modules/lodash/_baseHasIn.js | 13 - node_modules/lodash/_baseInRange.js | 18 - node_modules/lodash/_baseIndexOf.js | 20 - node_modules/lodash/_baseIndexOfWith.js | 23 - node_modules/lodash/_baseIntersection.js | 74 - node_modules/lodash/_baseInverter.js | 21 - node_modules/lodash/_baseInvoke.js | 24 - node_modules/lodash/_baseIsArguments.js | 18 - node_modules/lodash/_baseIsArrayBuffer.js | 17 - node_modules/lodash/_baseIsDate.js | 18 - node_modules/lodash/_baseIsEqual.js | 28 - node_modules/lodash/_baseIsEqualDeep.js | 83 - node_modules/lodash/_baseIsMap.js | 18 - node_modules/lodash/_baseIsMatch.js | 62 - node_modules/lodash/_baseIsNaN.js | 12 - node_modules/lodash/_baseIsNative.js | 47 - node_modules/lodash/_baseIsRegExp.js | 18 - node_modules/lodash/_baseIsSet.js | 18 - node_modules/lodash/_baseIsTypedArray.js | 60 - node_modules/lodash/_baseIteratee.js | 31 - node_modules/lodash/_baseKeys.js | 30 - node_modules/lodash/_baseKeysIn.js | 33 - node_modules/lodash/_baseLodash.js | 10 - node_modules/lodash/_baseLt.js | 14 - node_modules/lodash/_baseMap.js | 22 - node_modules/lodash/_baseMatches.js | 22 - node_modules/lodash/_baseMatchesProperty.js | 33 - node_modules/lodash/_baseMean.js | 20 - node_modules/lodash/_baseMerge.js | 42 - node_modules/lodash/_baseMergeDeep.js | 94 - node_modules/lodash/_baseNth.js | 20 - node_modules/lodash/_baseOrderBy.js | 49 - node_modules/lodash/_basePick.js | 19 - node_modules/lodash/_basePickBy.js | 30 - node_modules/lodash/_baseProperty.js | 14 - node_modules/lodash/_basePropertyDeep.js | 16 - node_modules/lodash/_basePropertyOf.js | 14 - node_modules/lodash/_basePullAll.js | 51 - node_modules/lodash/_basePullAt.js | 37 - node_modules/lodash/_baseRandom.js | 18 - node_modules/lodash/_baseRange.js | 28 - node_modules/lodash/_baseReduce.js | 23 - node_modules/lodash/_baseRepeat.js | 35 - node_modules/lodash/_baseRest.js | 17 - node_modules/lodash/_baseSample.js | 15 - node_modules/lodash/_baseSampleSize.js | 18 - node_modules/lodash/_baseSet.js | 51 - node_modules/lodash/_baseSetData.js | 17 - node_modules/lodash/_baseSetToString.js | 22 - node_modules/lodash/_baseShuffle.js | 15 - node_modules/lodash/_baseSlice.js | 31 - node_modules/lodash/_baseSome.js | 22 - node_modules/lodash/_baseSortBy.js | 21 - node_modules/lodash/_baseSortedIndex.js | 42 - node_modules/lodash/_baseSortedIndexBy.js | 67 - node_modules/lodash/_baseSortedUniq.js | 30 - node_modules/lodash/_baseSum.js | 24 - node_modules/lodash/_baseTimes.js | 20 - node_modules/lodash/_baseToNumber.js | 24 - node_modules/lodash/_baseToPairs.js | 18 - node_modules/lodash/_baseToString.js | 37 - node_modules/lodash/_baseTrim.js | 19 - node_modules/lodash/_baseUnary.js | 14 - node_modules/lodash/_baseUniq.js | 72 - node_modules/lodash/_baseUnset.js | 20 - node_modules/lodash/_baseUpdate.js | 18 - node_modules/lodash/_baseValues.js | 19 - node_modules/lodash/_baseWhile.js | 26 - node_modules/lodash/_baseWrapperValue.js | 25 - node_modules/lodash/_baseXor.js | 36 - node_modules/lodash/_baseZipObject.js | 23 - node_modules/lodash/_cacheHas.js | 13 - node_modules/lodash/_castArrayLikeObject.js | 14 - node_modules/lodash/_castFunction.js | 14 - node_modules/lodash/_castPath.js | 21 - node_modules/lodash/_castRest.js | 14 - node_modules/lodash/_castSlice.js | 18 - node_modules/lodash/_charsEndIndex.js | 19 - node_modules/lodash/_charsStartIndex.js | 20 - node_modules/lodash/_cloneArrayBuffer.js | 16 - node_modules/lodash/_cloneBuffer.js | 35 - node_modules/lodash/_cloneDataView.js | 16 - node_modules/lodash/_cloneRegExp.js | 17 - node_modules/lodash/_cloneSymbol.js | 18 - node_modules/lodash/_cloneTypedArray.js | 16 - node_modules/lodash/_compareAscending.js | 41 - node_modules/lodash/_compareMultiple.js | 44 - node_modules/lodash/_composeArgs.js | 39 - node_modules/lodash/_composeArgsRight.js | 41 - node_modules/lodash/_copyArray.js | 20 - node_modules/lodash/_copyObject.js | 40 - node_modules/lodash/_copySymbols.js | 16 - node_modules/lodash/_copySymbolsIn.js | 16 - node_modules/lodash/_coreJsData.js | 6 - node_modules/lodash/_countHolders.js | 21 - node_modules/lodash/_createAggregator.js | 23 - node_modules/lodash/_createAssigner.js | 37 - node_modules/lodash/_createBaseEach.js | 32 - node_modules/lodash/_createBaseFor.js | 25 - node_modules/lodash/_createBind.js | 28 - node_modules/lodash/_createCaseFirst.js | 33 - node_modules/lodash/_createCompounder.js | 24 - node_modules/lodash/_createCtor.js | 37 - node_modules/lodash/_createCurry.js | 46 - node_modules/lodash/_createFind.js | 25 - node_modules/lodash/_createFlow.js | 78 - node_modules/lodash/_createHybrid.js | 92 - node_modules/lodash/_createInverter.js | 17 - node_modules/lodash/_createMathOperation.js | 38 - node_modules/lodash/_createOver.js | 27 - node_modules/lodash/_createPadding.js | 33 - node_modules/lodash/_createPartial.js | 43 - node_modules/lodash/_createRange.js | 30 - node_modules/lodash/_createRecurry.js | 56 - .../lodash/_createRelationalOperation.js | 20 - node_modules/lodash/_createRound.js | 35 - node_modules/lodash/_createSet.js | 19 - node_modules/lodash/_createToPairs.js | 30 - node_modules/lodash/_createWrap.js | 106 - .../lodash/_customDefaultsAssignIn.js | 29 - node_modules/lodash/_customDefaultsMerge.js | 28 - node_modules/lodash/_customOmitClone.js | 16 - node_modules/lodash/_deburrLetter.js | 71 - node_modules/lodash/_defineProperty.js | 11 - node_modules/lodash/_equalArrays.js | 84 - node_modules/lodash/_equalByTag.js | 112 - node_modules/lodash/_equalObjects.js | 90 - node_modules/lodash/_escapeHtmlChar.js | 21 - node_modules/lodash/_escapeStringChar.js | 22 - node_modules/lodash/_flatRest.js | 16 - node_modules/lodash/_freeGlobal.js | 4 - node_modules/lodash/_getAllKeys.js | 16 - node_modules/lodash/_getAllKeysIn.js | 17 - node_modules/lodash/_getData.js | 15 - node_modules/lodash/_getFuncName.js | 31 - node_modules/lodash/_getHolder.js | 13 - node_modules/lodash/_getMapData.js | 18 - node_modules/lodash/_getMatchData.js | 24 - node_modules/lodash/_getNative.js | 17 - node_modules/lodash/_getPrototype.js | 6 - node_modules/lodash/_getRawTag.js | 46 - node_modules/lodash/_getSymbols.js | 30 - node_modules/lodash/_getSymbolsIn.js | 25 - node_modules/lodash/_getTag.js | 58 - node_modules/lodash/_getValue.js | 13 - node_modules/lodash/_getView.js | 33 - node_modules/lodash/_getWrapDetails.js | 17 - node_modules/lodash/_hasPath.js | 39 - node_modules/lodash/_hasUnicode.js | 26 - node_modules/lodash/_hasUnicodeWord.js | 15 - node_modules/lodash/_hashClear.js | 15 - node_modules/lodash/_hashDelete.js | 17 - node_modules/lodash/_hashGet.js | 30 - node_modules/lodash/_hashHas.js | 23 - node_modules/lodash/_hashSet.js | 23 - node_modules/lodash/_initCloneArray.js | 26 - node_modules/lodash/_initCloneByTag.js | 77 - node_modules/lodash/_initCloneObject.js | 18 - node_modules/lodash/_insertWrapDetails.js | 23 - node_modules/lodash/_isFlattenable.js | 20 - node_modules/lodash/_isIndex.js | 25 - node_modules/lodash/_isIterateeCall.js | 30 - node_modules/lodash/_isKey.js | 29 - node_modules/lodash/_isKeyable.js | 15 - node_modules/lodash/_isLaziable.js | 28 - node_modules/lodash/_isMaskable.js | 14 - node_modules/lodash/_isMasked.js | 20 - node_modules/lodash/_isPrototype.js | 18 - node_modules/lodash/_isStrictComparable.js | 15 - node_modules/lodash/_iteratorToArray.js | 18 - node_modules/lodash/_lazyClone.js | 23 - node_modules/lodash/_lazyReverse.js | 23 - node_modules/lodash/_lazyValue.js | 69 - node_modules/lodash/_listCacheClear.js | 13 - node_modules/lodash/_listCacheDelete.js | 35 - node_modules/lodash/_listCacheGet.js | 19 - node_modules/lodash/_listCacheHas.js | 16 - node_modules/lodash/_listCacheSet.js | 26 - node_modules/lodash/_mapCacheClear.js | 21 - node_modules/lodash/_mapCacheDelete.js | 18 - node_modules/lodash/_mapCacheGet.js | 16 - node_modules/lodash/_mapCacheHas.js | 16 - node_modules/lodash/_mapCacheSet.js | 22 - node_modules/lodash/_mapToArray.js | 18 - .../lodash/_matchesStrictComparable.js | 20 - node_modules/lodash/_memoizeCapped.js | 26 - node_modules/lodash/_mergeData.js | 90 - node_modules/lodash/_metaMap.js | 6 - node_modules/lodash/_nativeCreate.js | 6 - node_modules/lodash/_nativeKeys.js | 6 - node_modules/lodash/_nativeKeysIn.js | 20 - node_modules/lodash/_nodeUtil.js | 30 - node_modules/lodash/_objectToString.js | 22 - node_modules/lodash/_overArg.js | 15 - node_modules/lodash/_overRest.js | 36 - node_modules/lodash/_parent.js | 16 - node_modules/lodash/_reEscape.js | 4 - node_modules/lodash/_reEvaluate.js | 4 - node_modules/lodash/_reInterpolate.js | 4 - node_modules/lodash/_realNames.js | 4 - node_modules/lodash/_reorder.js | 29 - node_modules/lodash/_replaceHolders.js | 29 - node_modules/lodash/_root.js | 9 - node_modules/lodash/_safeGet.js | 21 - node_modules/lodash/_setCacheAdd.js | 19 - node_modules/lodash/_setCacheHas.js | 14 - node_modules/lodash/_setData.js | 20 - node_modules/lodash/_setToArray.js | 18 - node_modules/lodash/_setToPairs.js | 18 - node_modules/lodash/_setToString.js | 14 - node_modules/lodash/_setWrapToString.js | 21 - node_modules/lodash/_shortOut.js | 37 - node_modules/lodash/_shuffleSelf.js | 28 - node_modules/lodash/_stackClear.js | 15 - node_modules/lodash/_stackDelete.js | 18 - node_modules/lodash/_stackGet.js | 14 - node_modules/lodash/_stackHas.js | 14 - node_modules/lodash/_stackSet.js | 34 - node_modules/lodash/_strictIndexOf.js | 23 - node_modules/lodash/_strictLastIndexOf.js | 21 - node_modules/lodash/_stringSize.js | 18 - node_modules/lodash/_stringToArray.js | 18 - node_modules/lodash/_stringToPath.js | 27 - node_modules/lodash/_toKey.js | 21 - node_modules/lodash/_toSource.js | 26 - node_modules/lodash/_trimmedEndIndex.js | 19 - node_modules/lodash/_unescapeHtmlChar.js | 21 - node_modules/lodash/_unicodeSize.js | 44 - node_modules/lodash/_unicodeToArray.js | 40 - node_modules/lodash/_unicodeWords.js | 69 - node_modules/lodash/_updateWrapDetails.js | 46 - node_modules/lodash/_wrapperClone.js | 23 - node_modules/lodash/add.js | 22 - node_modules/lodash/after.js | 42 - node_modules/lodash/array.js | 67 - node_modules/lodash/ary.js | 29 - node_modules/lodash/assign.js | 58 - node_modules/lodash/assignIn.js | 40 - node_modules/lodash/assignInWith.js | 38 - node_modules/lodash/assignWith.js | 37 - node_modules/lodash/at.js | 23 - node_modules/lodash/attempt.js | 35 - node_modules/lodash/before.js | 40 - node_modules/lodash/bind.js | 57 - node_modules/lodash/bindAll.js | 41 - node_modules/lodash/bindKey.js | 68 - node_modules/lodash/camelCase.js | 29 - node_modules/lodash/capitalize.js | 23 - node_modules/lodash/castArray.js | 44 - node_modules/lodash/ceil.js | 26 - node_modules/lodash/chain.js | 38 - node_modules/lodash/chunk.js | 50 - node_modules/lodash/clamp.js | 39 - node_modules/lodash/clone.js | 36 - node_modules/lodash/cloneDeep.js | 29 - node_modules/lodash/cloneDeepWith.js | 40 - node_modules/lodash/cloneWith.js | 42 - node_modules/lodash/collection.js | 30 - node_modules/lodash/commit.js | 33 - node_modules/lodash/compact.js | 31 - node_modules/lodash/concat.js | 43 - node_modules/lodash/cond.js | 60 - node_modules/lodash/conforms.js | 35 - node_modules/lodash/conformsTo.js | 32 - node_modules/lodash/constant.js | 26 - node_modules/lodash/core.js | 3877 --- node_modules/lodash/core.min.js | 29 - node_modules/lodash/countBy.js | 40 - node_modules/lodash/create.js | 43 - node_modules/lodash/curry.js | 57 - node_modules/lodash/curryRight.js | 54 - node_modules/lodash/date.js | 3 - node_modules/lodash/debounce.js | 191 - node_modules/lodash/deburr.js | 45 - node_modules/lodash/defaultTo.js | 25 - node_modules/lodash/defaults.js | 64 - node_modules/lodash/defaultsDeep.js | 30 - node_modules/lodash/defer.js | 26 - node_modules/lodash/delay.js | 28 - node_modules/lodash/difference.js | 33 - node_modules/lodash/differenceBy.js | 44 - node_modules/lodash/differenceWith.js | 40 - node_modules/lodash/divide.js | 22 - node_modules/lodash/drop.js | 38 - node_modules/lodash/dropRight.js | 39 - node_modules/lodash/dropRightWhile.js | 45 - node_modules/lodash/dropWhile.js | 45 - node_modules/lodash/each.js | 1 - node_modules/lodash/eachRight.js | 1 - node_modules/lodash/endsWith.js | 43 - node_modules/lodash/entries.js | 1 - node_modules/lodash/entriesIn.js | 1 - node_modules/lodash/eq.js | 37 - node_modules/lodash/escape.js | 43 - node_modules/lodash/escapeRegExp.js | 32 - node_modules/lodash/every.js | 56 - node_modules/lodash/extend.js | 1 - node_modules/lodash/extendWith.js | 1 - node_modules/lodash/fill.js | 45 - node_modules/lodash/filter.js | 52 - node_modules/lodash/find.js | 42 - node_modules/lodash/findIndex.js | 55 - node_modules/lodash/findKey.js | 44 - node_modules/lodash/findLast.js | 25 - node_modules/lodash/findLastIndex.js | 59 - node_modules/lodash/findLastKey.js | 44 - node_modules/lodash/first.js | 1 - node_modules/lodash/flake.lock | 40 - node_modules/lodash/flake.nix | 20 - node_modules/lodash/flatMap.js | 29 - node_modules/lodash/flatMapDeep.js | 31 - node_modules/lodash/flatMapDepth.js | 31 - node_modules/lodash/flatten.js | 22 - node_modules/lodash/flattenDeep.js | 25 - node_modules/lodash/flattenDepth.js | 33 - node_modules/lodash/flip.js | 28 - node_modules/lodash/floor.js | 26 - node_modules/lodash/flow.js | 27 - node_modules/lodash/flowRight.js | 26 - node_modules/lodash/forEach.js | 41 - node_modules/lodash/forEachRight.js | 31 - node_modules/lodash/forIn.js | 39 - node_modules/lodash/forInRight.js | 37 - node_modules/lodash/forOwn.js | 36 - node_modules/lodash/forOwnRight.js | 34 - node_modules/lodash/fp.js | 2 - node_modules/lodash/fp/F.js | 1 - node_modules/lodash/fp/T.js | 1 - node_modules/lodash/fp/__.js | 1 - node_modules/lodash/fp/_baseConvert.js | 569 - node_modules/lodash/fp/_convertBrowser.js | 18 - node_modules/lodash/fp/_falseOptions.js | 7 - node_modules/lodash/fp/_mapping.js | 358 - node_modules/lodash/fp/_util.js | 16 - node_modules/lodash/fp/add.js | 5 - node_modules/lodash/fp/after.js | 5 - node_modules/lodash/fp/all.js | 1 - node_modules/lodash/fp/allPass.js | 1 - node_modules/lodash/fp/always.js | 1 - node_modules/lodash/fp/any.js | 1 - node_modules/lodash/fp/anyPass.js | 1 - node_modules/lodash/fp/apply.js | 1 - node_modules/lodash/fp/array.js | 2 - node_modules/lodash/fp/ary.js | 5 - node_modules/lodash/fp/assign.js | 5 - node_modules/lodash/fp/assignAll.js | 5 - node_modules/lodash/fp/assignAllWith.js | 5 - node_modules/lodash/fp/assignIn.js | 5 - node_modules/lodash/fp/assignInAll.js | 5 - node_modules/lodash/fp/assignInAllWith.js | 5 - node_modules/lodash/fp/assignInWith.js | 5 - node_modules/lodash/fp/assignWith.js | 5 - node_modules/lodash/fp/assoc.js | 1 - node_modules/lodash/fp/assocPath.js | 1 - node_modules/lodash/fp/at.js | 5 - node_modules/lodash/fp/attempt.js | 5 - node_modules/lodash/fp/before.js | 5 - node_modules/lodash/fp/bind.js | 5 - node_modules/lodash/fp/bindAll.js | 5 - node_modules/lodash/fp/bindKey.js | 5 - node_modules/lodash/fp/camelCase.js | 5 - node_modules/lodash/fp/capitalize.js | 5 - node_modules/lodash/fp/castArray.js | 5 - node_modules/lodash/fp/ceil.js | 5 - node_modules/lodash/fp/chain.js | 5 - node_modules/lodash/fp/chunk.js | 5 - node_modules/lodash/fp/clamp.js | 5 - node_modules/lodash/fp/clone.js | 5 - node_modules/lodash/fp/cloneDeep.js | 5 - node_modules/lodash/fp/cloneDeepWith.js | 5 - node_modules/lodash/fp/cloneWith.js | 5 - node_modules/lodash/fp/collection.js | 2 - node_modules/lodash/fp/commit.js | 5 - node_modules/lodash/fp/compact.js | 5 - node_modules/lodash/fp/complement.js | 1 - node_modules/lodash/fp/compose.js | 1 - node_modules/lodash/fp/concat.js | 5 - node_modules/lodash/fp/cond.js | 5 - node_modules/lodash/fp/conforms.js | 1 - node_modules/lodash/fp/conformsTo.js | 5 - node_modules/lodash/fp/constant.js | 5 - node_modules/lodash/fp/contains.js | 1 - node_modules/lodash/fp/convert.js | 18 - node_modules/lodash/fp/countBy.js | 5 - node_modules/lodash/fp/create.js | 5 - node_modules/lodash/fp/curry.js | 5 - node_modules/lodash/fp/curryN.js | 5 - node_modules/lodash/fp/curryRight.js | 5 - node_modules/lodash/fp/curryRightN.js | 5 - node_modules/lodash/fp/date.js | 2 - node_modules/lodash/fp/debounce.js | 5 - node_modules/lodash/fp/deburr.js | 5 - node_modules/lodash/fp/defaultTo.js | 5 - node_modules/lodash/fp/defaults.js | 5 - node_modules/lodash/fp/defaultsAll.js | 5 - node_modules/lodash/fp/defaultsDeep.js | 5 - node_modules/lodash/fp/defaultsDeepAll.js | 5 - node_modules/lodash/fp/defer.js | 5 - node_modules/lodash/fp/delay.js | 5 - node_modules/lodash/fp/difference.js | 5 - node_modules/lodash/fp/differenceBy.js | 5 - node_modules/lodash/fp/differenceWith.js | 5 - node_modules/lodash/fp/dissoc.js | 1 - node_modules/lodash/fp/dissocPath.js | 1 - node_modules/lodash/fp/divide.js | 5 - node_modules/lodash/fp/drop.js | 5 - node_modules/lodash/fp/dropLast.js | 1 - node_modules/lodash/fp/dropLastWhile.js | 1 - node_modules/lodash/fp/dropRight.js | 5 - node_modules/lodash/fp/dropRightWhile.js | 5 - node_modules/lodash/fp/dropWhile.js | 5 - node_modules/lodash/fp/each.js | 1 - node_modules/lodash/fp/eachRight.js | 1 - node_modules/lodash/fp/endsWith.js | 5 - node_modules/lodash/fp/entries.js | 1 - node_modules/lodash/fp/entriesIn.js | 1 - node_modules/lodash/fp/eq.js | 5 - node_modules/lodash/fp/equals.js | 1 - node_modules/lodash/fp/escape.js | 5 - node_modules/lodash/fp/escapeRegExp.js | 5 - node_modules/lodash/fp/every.js | 5 - node_modules/lodash/fp/extend.js | 1 - node_modules/lodash/fp/extendAll.js | 1 - node_modules/lodash/fp/extendAllWith.js | 1 - node_modules/lodash/fp/extendWith.js | 1 - node_modules/lodash/fp/fill.js | 5 - node_modules/lodash/fp/filter.js | 5 - node_modules/lodash/fp/find.js | 5 - node_modules/lodash/fp/findFrom.js | 5 - node_modules/lodash/fp/findIndex.js | 5 - node_modules/lodash/fp/findIndexFrom.js | 5 - node_modules/lodash/fp/findKey.js | 5 - node_modules/lodash/fp/findLast.js | 5 - node_modules/lodash/fp/findLastFrom.js | 5 - node_modules/lodash/fp/findLastIndex.js | 5 - node_modules/lodash/fp/findLastIndexFrom.js | 5 - node_modules/lodash/fp/findLastKey.js | 5 - node_modules/lodash/fp/first.js | 1 - node_modules/lodash/fp/flatMap.js | 5 - node_modules/lodash/fp/flatMapDeep.js | 5 - node_modules/lodash/fp/flatMapDepth.js | 5 - node_modules/lodash/fp/flatten.js | 5 - node_modules/lodash/fp/flattenDeep.js | 5 - node_modules/lodash/fp/flattenDepth.js | 5 - node_modules/lodash/fp/flip.js | 5 - node_modules/lodash/fp/floor.js | 5 - node_modules/lodash/fp/flow.js | 5 - node_modules/lodash/fp/flowRight.js | 5 - node_modules/lodash/fp/forEach.js | 5 - node_modules/lodash/fp/forEachRight.js | 5 - node_modules/lodash/fp/forIn.js | 5 - node_modules/lodash/fp/forInRight.js | 5 - node_modules/lodash/fp/forOwn.js | 5 - node_modules/lodash/fp/forOwnRight.js | 5 - node_modules/lodash/fp/fromPairs.js | 5 - node_modules/lodash/fp/function.js | 2 - node_modules/lodash/fp/functions.js | 5 - node_modules/lodash/fp/functionsIn.js | 5 - node_modules/lodash/fp/get.js | 5 - node_modules/lodash/fp/getOr.js | 5 - node_modules/lodash/fp/groupBy.js | 5 - node_modules/lodash/fp/gt.js | 5 - node_modules/lodash/fp/gte.js | 5 - node_modules/lodash/fp/has.js | 5 - node_modules/lodash/fp/hasIn.js | 5 - node_modules/lodash/fp/head.js | 5 - node_modules/lodash/fp/identical.js | 1 - node_modules/lodash/fp/identity.js | 5 - node_modules/lodash/fp/inRange.js | 5 - node_modules/lodash/fp/includes.js | 5 - node_modules/lodash/fp/includesFrom.js | 5 - node_modules/lodash/fp/indexBy.js | 1 - node_modules/lodash/fp/indexOf.js | 5 - node_modules/lodash/fp/indexOfFrom.js | 5 - node_modules/lodash/fp/init.js | 1 - node_modules/lodash/fp/initial.js | 5 - node_modules/lodash/fp/intersection.js | 5 - node_modules/lodash/fp/intersectionBy.js | 5 - node_modules/lodash/fp/intersectionWith.js | 5 - node_modules/lodash/fp/invert.js | 5 - node_modules/lodash/fp/invertBy.js | 5 - node_modules/lodash/fp/invertObj.js | 1 - node_modules/lodash/fp/invoke.js | 5 - node_modules/lodash/fp/invokeArgs.js | 5 - node_modules/lodash/fp/invokeArgsMap.js | 5 - node_modules/lodash/fp/invokeMap.js | 5 - node_modules/lodash/fp/isArguments.js | 5 - node_modules/lodash/fp/isArray.js | 5 - node_modules/lodash/fp/isArrayBuffer.js | 5 - node_modules/lodash/fp/isArrayLike.js | 5 - node_modules/lodash/fp/isArrayLikeObject.js | 5 - node_modules/lodash/fp/isBoolean.js | 5 - node_modules/lodash/fp/isBuffer.js | 5 - node_modules/lodash/fp/isDate.js | 5 - node_modules/lodash/fp/isElement.js | 5 - node_modules/lodash/fp/isEmpty.js | 5 - node_modules/lodash/fp/isEqual.js | 5 - node_modules/lodash/fp/isEqualWith.js | 5 - node_modules/lodash/fp/isError.js | 5 - node_modules/lodash/fp/isFinite.js | 5 - node_modules/lodash/fp/isFunction.js | 5 - node_modules/lodash/fp/isInteger.js | 5 - node_modules/lodash/fp/isLength.js | 5 - node_modules/lodash/fp/isMap.js | 5 - node_modules/lodash/fp/isMatch.js | 5 - node_modules/lodash/fp/isMatchWith.js | 5 - node_modules/lodash/fp/isNaN.js | 5 - node_modules/lodash/fp/isNative.js | 5 - node_modules/lodash/fp/isNil.js | 5 - node_modules/lodash/fp/isNull.js | 5 - node_modules/lodash/fp/isNumber.js | 5 - node_modules/lodash/fp/isObject.js | 5 - node_modules/lodash/fp/isObjectLike.js | 5 - node_modules/lodash/fp/isPlainObject.js | 5 - node_modules/lodash/fp/isRegExp.js | 5 - node_modules/lodash/fp/isSafeInteger.js | 5 - node_modules/lodash/fp/isSet.js | 5 - node_modules/lodash/fp/isString.js | 5 - node_modules/lodash/fp/isSymbol.js | 5 - node_modules/lodash/fp/isTypedArray.js | 5 - node_modules/lodash/fp/isUndefined.js | 5 - node_modules/lodash/fp/isWeakMap.js | 5 - node_modules/lodash/fp/isWeakSet.js | 5 - node_modules/lodash/fp/iteratee.js | 5 - node_modules/lodash/fp/join.js | 5 - node_modules/lodash/fp/juxt.js | 1 - node_modules/lodash/fp/kebabCase.js | 5 - node_modules/lodash/fp/keyBy.js | 5 - node_modules/lodash/fp/keys.js | 5 - node_modules/lodash/fp/keysIn.js | 5 - node_modules/lodash/fp/lang.js | 2 - node_modules/lodash/fp/last.js | 5 - node_modules/lodash/fp/lastIndexOf.js | 5 - node_modules/lodash/fp/lastIndexOfFrom.js | 5 - node_modules/lodash/fp/lowerCase.js | 5 - node_modules/lodash/fp/lowerFirst.js | 5 - node_modules/lodash/fp/lt.js | 5 - node_modules/lodash/fp/lte.js | 5 - node_modules/lodash/fp/map.js | 5 - node_modules/lodash/fp/mapKeys.js | 5 - node_modules/lodash/fp/mapValues.js | 5 - node_modules/lodash/fp/matches.js | 1 - node_modules/lodash/fp/matchesProperty.js | 5 - node_modules/lodash/fp/math.js | 2 - node_modules/lodash/fp/max.js | 5 - node_modules/lodash/fp/maxBy.js | 5 - node_modules/lodash/fp/mean.js | 5 - node_modules/lodash/fp/meanBy.js | 5 - node_modules/lodash/fp/memoize.js | 5 - node_modules/lodash/fp/merge.js | 5 - node_modules/lodash/fp/mergeAll.js | 5 - node_modules/lodash/fp/mergeAllWith.js | 5 - node_modules/lodash/fp/mergeWith.js | 5 - node_modules/lodash/fp/method.js | 5 - node_modules/lodash/fp/methodOf.js | 5 - node_modules/lodash/fp/min.js | 5 - node_modules/lodash/fp/minBy.js | 5 - node_modules/lodash/fp/mixin.js | 5 - node_modules/lodash/fp/multiply.js | 5 - node_modules/lodash/fp/nAry.js | 1 - node_modules/lodash/fp/negate.js | 5 - node_modules/lodash/fp/next.js | 5 - node_modules/lodash/fp/noop.js | 5 - node_modules/lodash/fp/now.js | 5 - node_modules/lodash/fp/nth.js | 5 - node_modules/lodash/fp/nthArg.js | 5 - node_modules/lodash/fp/number.js | 2 - node_modules/lodash/fp/object.js | 2 - node_modules/lodash/fp/omit.js | 5 - node_modules/lodash/fp/omitAll.js | 1 - node_modules/lodash/fp/omitBy.js | 5 - node_modules/lodash/fp/once.js | 5 - node_modules/lodash/fp/orderBy.js | 5 - node_modules/lodash/fp/over.js | 5 - node_modules/lodash/fp/overArgs.js | 5 - node_modules/lodash/fp/overEvery.js | 5 - node_modules/lodash/fp/overSome.js | 5 - node_modules/lodash/fp/pad.js | 5 - node_modules/lodash/fp/padChars.js | 5 - node_modules/lodash/fp/padCharsEnd.js | 5 - node_modules/lodash/fp/padCharsStart.js | 5 - node_modules/lodash/fp/padEnd.js | 5 - node_modules/lodash/fp/padStart.js | 5 - node_modules/lodash/fp/parseInt.js | 5 - node_modules/lodash/fp/partial.js | 5 - node_modules/lodash/fp/partialRight.js | 5 - node_modules/lodash/fp/partition.js | 5 - node_modules/lodash/fp/path.js | 1 - node_modules/lodash/fp/pathEq.js | 1 - node_modules/lodash/fp/pathOr.js | 1 - node_modules/lodash/fp/paths.js | 1 - node_modules/lodash/fp/pick.js | 5 - node_modules/lodash/fp/pickAll.js | 1 - node_modules/lodash/fp/pickBy.js | 5 - node_modules/lodash/fp/pipe.js | 1 - node_modules/lodash/fp/placeholder.js | 6 - node_modules/lodash/fp/plant.js | 5 - node_modules/lodash/fp/pluck.js | 1 - node_modules/lodash/fp/prop.js | 1 - node_modules/lodash/fp/propEq.js | 1 - node_modules/lodash/fp/propOr.js | 1 - node_modules/lodash/fp/property.js | 1 - node_modules/lodash/fp/propertyOf.js | 5 - node_modules/lodash/fp/props.js | 1 - node_modules/lodash/fp/pull.js | 5 - node_modules/lodash/fp/pullAll.js | 5 - node_modules/lodash/fp/pullAllBy.js | 5 - node_modules/lodash/fp/pullAllWith.js | 5 - node_modules/lodash/fp/pullAt.js | 5 - node_modules/lodash/fp/random.js | 5 - node_modules/lodash/fp/range.js | 5 - node_modules/lodash/fp/rangeRight.js | 5 - node_modules/lodash/fp/rangeStep.js | 5 - node_modules/lodash/fp/rangeStepRight.js | 5 - node_modules/lodash/fp/rearg.js | 5 - node_modules/lodash/fp/reduce.js | 5 - node_modules/lodash/fp/reduceRight.js | 5 - node_modules/lodash/fp/reject.js | 5 - node_modules/lodash/fp/remove.js | 5 - node_modules/lodash/fp/repeat.js | 5 - node_modules/lodash/fp/replace.js | 5 - node_modules/lodash/fp/rest.js | 5 - node_modules/lodash/fp/restFrom.js | 5 - node_modules/lodash/fp/result.js | 5 - node_modules/lodash/fp/reverse.js | 5 - node_modules/lodash/fp/round.js | 5 - node_modules/lodash/fp/sample.js | 5 - node_modules/lodash/fp/sampleSize.js | 5 - node_modules/lodash/fp/seq.js | 2 - node_modules/lodash/fp/set.js | 5 - node_modules/lodash/fp/setWith.js | 5 - node_modules/lodash/fp/shuffle.js | 5 - node_modules/lodash/fp/size.js | 5 - node_modules/lodash/fp/slice.js | 5 - node_modules/lodash/fp/snakeCase.js | 5 - node_modules/lodash/fp/some.js | 5 - node_modules/lodash/fp/sortBy.js | 5 - node_modules/lodash/fp/sortedIndex.js | 5 - node_modules/lodash/fp/sortedIndexBy.js | 5 - node_modules/lodash/fp/sortedIndexOf.js | 5 - node_modules/lodash/fp/sortedLastIndex.js | 5 - node_modules/lodash/fp/sortedLastIndexBy.js | 5 - node_modules/lodash/fp/sortedLastIndexOf.js | 5 - node_modules/lodash/fp/sortedUniq.js | 5 - node_modules/lodash/fp/sortedUniqBy.js | 5 - node_modules/lodash/fp/split.js | 5 - node_modules/lodash/fp/spread.js | 5 - node_modules/lodash/fp/spreadFrom.js | 5 - node_modules/lodash/fp/startCase.js | 5 - node_modules/lodash/fp/startsWith.js | 5 - node_modules/lodash/fp/string.js | 2 - node_modules/lodash/fp/stubArray.js | 5 - node_modules/lodash/fp/stubFalse.js | 5 - node_modules/lodash/fp/stubObject.js | 5 - node_modules/lodash/fp/stubString.js | 5 - node_modules/lodash/fp/stubTrue.js | 5 - node_modules/lodash/fp/subtract.js | 5 - node_modules/lodash/fp/sum.js | 5 - node_modules/lodash/fp/sumBy.js | 5 - node_modules/lodash/fp/symmetricDifference.js | 1 - .../lodash/fp/symmetricDifferenceBy.js | 1 - .../lodash/fp/symmetricDifferenceWith.js | 1 - node_modules/lodash/fp/tail.js | 5 - node_modules/lodash/fp/take.js | 5 - node_modules/lodash/fp/takeLast.js | 1 - node_modules/lodash/fp/takeLastWhile.js | 1 - node_modules/lodash/fp/takeRight.js | 5 - node_modules/lodash/fp/takeRightWhile.js | 5 - node_modules/lodash/fp/takeWhile.js | 5 - node_modules/lodash/fp/tap.js | 5 - node_modules/lodash/fp/template.js | 5 - node_modules/lodash/fp/templateSettings.js | 5 - node_modules/lodash/fp/throttle.js | 5 - node_modules/lodash/fp/thru.js | 5 - node_modules/lodash/fp/times.js | 5 - node_modules/lodash/fp/toArray.js | 5 - node_modules/lodash/fp/toFinite.js | 5 - node_modules/lodash/fp/toInteger.js | 5 - node_modules/lodash/fp/toIterator.js | 5 - node_modules/lodash/fp/toJSON.js | 5 - node_modules/lodash/fp/toLength.js | 5 - node_modules/lodash/fp/toLower.js | 5 - node_modules/lodash/fp/toNumber.js | 5 - node_modules/lodash/fp/toPairs.js | 5 - node_modules/lodash/fp/toPairsIn.js | 5 - node_modules/lodash/fp/toPath.js | 5 - node_modules/lodash/fp/toPlainObject.js | 5 - node_modules/lodash/fp/toSafeInteger.js | 5 - node_modules/lodash/fp/toString.js | 5 - node_modules/lodash/fp/toUpper.js | 5 - node_modules/lodash/fp/transform.js | 5 - node_modules/lodash/fp/trim.js | 5 - node_modules/lodash/fp/trimChars.js | 5 - node_modules/lodash/fp/trimCharsEnd.js | 5 - node_modules/lodash/fp/trimCharsStart.js | 5 - node_modules/lodash/fp/trimEnd.js | 5 - node_modules/lodash/fp/trimStart.js | 5 - node_modules/lodash/fp/truncate.js | 5 - node_modules/lodash/fp/unapply.js | 1 - node_modules/lodash/fp/unary.js | 5 - node_modules/lodash/fp/unescape.js | 5 - node_modules/lodash/fp/union.js | 5 - node_modules/lodash/fp/unionBy.js | 5 - node_modules/lodash/fp/unionWith.js | 5 - node_modules/lodash/fp/uniq.js | 5 - node_modules/lodash/fp/uniqBy.js | 5 - node_modules/lodash/fp/uniqWith.js | 5 - node_modules/lodash/fp/uniqueId.js | 5 - node_modules/lodash/fp/unnest.js | 1 - node_modules/lodash/fp/unset.js | 5 - node_modules/lodash/fp/unzip.js | 5 - node_modules/lodash/fp/unzipWith.js | 5 - node_modules/lodash/fp/update.js | 5 - node_modules/lodash/fp/updateWith.js | 5 - node_modules/lodash/fp/upperCase.js | 5 - node_modules/lodash/fp/upperFirst.js | 5 - node_modules/lodash/fp/useWith.js | 1 - node_modules/lodash/fp/util.js | 2 - node_modules/lodash/fp/value.js | 5 - node_modules/lodash/fp/valueOf.js | 5 - node_modules/lodash/fp/values.js | 5 - node_modules/lodash/fp/valuesIn.js | 5 - node_modules/lodash/fp/where.js | 1 - node_modules/lodash/fp/whereEq.js | 1 - node_modules/lodash/fp/without.js | 5 - node_modules/lodash/fp/words.js | 5 - node_modules/lodash/fp/wrap.js | 5 - node_modules/lodash/fp/wrapperAt.js | 5 - node_modules/lodash/fp/wrapperChain.js | 5 - node_modules/lodash/fp/wrapperLodash.js | 5 - node_modules/lodash/fp/wrapperReverse.js | 5 - node_modules/lodash/fp/wrapperValue.js | 5 - node_modules/lodash/fp/xor.js | 5 - node_modules/lodash/fp/xorBy.js | 5 - node_modules/lodash/fp/xorWith.js | 5 - node_modules/lodash/fp/zip.js | 5 - node_modules/lodash/fp/zipAll.js | 5 - node_modules/lodash/fp/zipObj.js | 1 - node_modules/lodash/fp/zipObject.js | 5 - node_modules/lodash/fp/zipObjectDeep.js | 5 - node_modules/lodash/fp/zipWith.js | 5 - node_modules/lodash/fromPairs.js | 28 - node_modules/lodash/function.js | 25 - node_modules/lodash/functions.js | 31 - node_modules/lodash/functionsIn.js | 31 - node_modules/lodash/get.js | 33 - node_modules/lodash/groupBy.js | 41 - node_modules/lodash/gt.js | 29 - node_modules/lodash/gte.js | 30 - node_modules/lodash/has.js | 35 - node_modules/lodash/hasIn.js | 34 - node_modules/lodash/head.js | 23 - node_modules/lodash/identity.js | 21 - node_modules/lodash/inRange.js | 55 - node_modules/lodash/includes.js | 53 - node_modules/lodash/index.js | 1 - node_modules/lodash/indexOf.js | 42 - node_modules/lodash/initial.js | 22 - node_modules/lodash/intersection.js | 30 - node_modules/lodash/intersectionBy.js | 45 - node_modules/lodash/intersectionWith.js | 41 - node_modules/lodash/invert.js | 42 - node_modules/lodash/invertBy.js | 56 - node_modules/lodash/invoke.js | 24 - node_modules/lodash/invokeMap.js | 41 - node_modules/lodash/isArguments.js | 36 - node_modules/lodash/isArray.js | 26 - node_modules/lodash/isArrayBuffer.js | 27 - node_modules/lodash/isArrayLike.js | 33 - node_modules/lodash/isArrayLikeObject.js | 33 - node_modules/lodash/isBoolean.js | 29 - node_modules/lodash/isBuffer.js | 38 - node_modules/lodash/isDate.js | 27 - node_modules/lodash/isElement.js | 25 - node_modules/lodash/isEmpty.js | 77 - node_modules/lodash/isEqual.js | 35 - node_modules/lodash/isEqualWith.js | 41 - node_modules/lodash/isError.js | 36 - node_modules/lodash/isFinite.js | 36 - node_modules/lodash/isFunction.js | 37 - node_modules/lodash/isInteger.js | 33 - node_modules/lodash/isLength.js | 35 - node_modules/lodash/isMap.js | 27 - node_modules/lodash/isMatch.js | 36 - node_modules/lodash/isMatchWith.js | 41 - node_modules/lodash/isNaN.js | 38 - node_modules/lodash/isNative.js | 40 - node_modules/lodash/isNil.js | 25 - node_modules/lodash/isNull.js | 22 - node_modules/lodash/isNumber.js | 38 - node_modules/lodash/isObject.js | 31 - node_modules/lodash/isObjectLike.js | 29 - node_modules/lodash/isPlainObject.js | 62 - node_modules/lodash/isRegExp.js | 27 - node_modules/lodash/isSafeInteger.js | 37 - node_modules/lodash/isSet.js | 27 - node_modules/lodash/isString.js | 30 - node_modules/lodash/isSymbol.js | 29 - node_modules/lodash/isTypedArray.js | 27 - node_modules/lodash/isUndefined.js | 22 - node_modules/lodash/isWeakMap.js | 28 - node_modules/lodash/isWeakSet.js | 28 - node_modules/lodash/iteratee.js | 53 - node_modules/lodash/join.js | 26 - node_modules/lodash/kebabCase.js | 28 - node_modules/lodash/keyBy.js | 36 - node_modules/lodash/keys.js | 37 - node_modules/lodash/keysIn.js | 32 - node_modules/lodash/lang.js | 58 - node_modules/lodash/last.js | 20 - node_modules/lodash/lastIndexOf.js | 46 - node_modules/lodash/lodash.js | 17209 -------------- node_modules/lodash/lodash.min.js | 140 - node_modules/lodash/lowerCase.js | 27 - node_modules/lodash/lowerFirst.js | 22 - node_modules/lodash/lt.js | 29 - node_modules/lodash/lte.js | 30 - node_modules/lodash/map.js | 53 - node_modules/lodash/mapKeys.js | 36 - node_modules/lodash/mapValues.js | 43 - node_modules/lodash/matches.js | 46 - node_modules/lodash/matchesProperty.js | 44 - node_modules/lodash/math.js | 17 - node_modules/lodash/max.js | 29 - node_modules/lodash/maxBy.js | 34 - node_modules/lodash/mean.js | 22 - node_modules/lodash/meanBy.js | 31 - node_modules/lodash/memoize.js | 73 - node_modules/lodash/merge.js | 39 - node_modules/lodash/mergeWith.js | 39 - node_modules/lodash/method.js | 34 - node_modules/lodash/methodOf.js | 33 - node_modules/lodash/min.js | 29 - node_modules/lodash/minBy.js | 34 - node_modules/lodash/mixin.js | 74 - node_modules/lodash/multiply.js | 22 - node_modules/lodash/negate.js | 40 - node_modules/lodash/next.js | 35 - node_modules/lodash/noop.js | 17 - node_modules/lodash/now.js | 23 - node_modules/lodash/nth.js | 29 - node_modules/lodash/nthArg.js | 32 - node_modules/lodash/number.js | 5 - node_modules/lodash/object.js | 49 - node_modules/lodash/omit.js | 57 - node_modules/lodash/omitBy.js | 29 - node_modules/lodash/once.js | 25 - node_modules/lodash/orderBy.js | 47 - node_modules/lodash/over.js | 24 - node_modules/lodash/overArgs.js | 61 - node_modules/lodash/overEvery.js | 34 - node_modules/lodash/overSome.js | 37 - node_modules/lodash/package.json | 63 - node_modules/lodash/pad.js | 49 - node_modules/lodash/padEnd.js | 39 - node_modules/lodash/padStart.js | 39 - node_modules/lodash/parseInt.js | 43 - node_modules/lodash/partial.js | 50 - node_modules/lodash/partialRight.js | 49 - node_modules/lodash/partition.js | 43 - node_modules/lodash/pick.js | 25 - node_modules/lodash/pickBy.js | 37 - node_modules/lodash/plant.js | 48 - node_modules/lodash/property.js | 32 - node_modules/lodash/propertyOf.js | 30 - node_modules/lodash/pull.js | 29 - node_modules/lodash/pullAll.js | 29 - node_modules/lodash/pullAllBy.js | 33 - node_modules/lodash/pullAllWith.js | 32 - node_modules/lodash/pullAt.js | 43 - node_modules/lodash/random.js | 82 - node_modules/lodash/range.js | 46 - node_modules/lodash/rangeRight.js | 41 - node_modules/lodash/rearg.js | 33 - node_modules/lodash/reduce.js | 51 - node_modules/lodash/reduceRight.js | 36 - node_modules/lodash/reject.js | 46 - node_modules/lodash/release.md | 48 - node_modules/lodash/remove.js | 53 - node_modules/lodash/repeat.js | 37 - node_modules/lodash/replace.js | 29 - node_modules/lodash/rest.js | 40 - node_modules/lodash/result.js | 56 - node_modules/lodash/reverse.js | 34 - node_modules/lodash/round.js | 26 - node_modules/lodash/sample.js | 24 - node_modules/lodash/sampleSize.js | 37 - node_modules/lodash/seq.js | 16 - node_modules/lodash/set.js | 35 - node_modules/lodash/setWith.js | 32 - node_modules/lodash/shuffle.js | 25 - node_modules/lodash/size.js | 46 - node_modules/lodash/slice.js | 37 - node_modules/lodash/snakeCase.js | 28 - node_modules/lodash/some.js | 51 - node_modules/lodash/sortBy.js | 48 - node_modules/lodash/sortedIndex.js | 24 - node_modules/lodash/sortedIndexBy.js | 33 - node_modules/lodash/sortedIndexOf.js | 31 - node_modules/lodash/sortedLastIndex.js | 25 - node_modules/lodash/sortedLastIndexBy.js | 33 - node_modules/lodash/sortedLastIndexOf.js | 31 - node_modules/lodash/sortedUniq.js | 24 - node_modules/lodash/sortedUniqBy.js | 26 - node_modules/lodash/split.js | 52 - node_modules/lodash/spread.js | 63 - node_modules/lodash/startCase.js | 29 - node_modules/lodash/startsWith.js | 39 - node_modules/lodash/string.js | 33 - node_modules/lodash/stubArray.js | 23 - node_modules/lodash/stubFalse.js | 18 - node_modules/lodash/stubObject.js | 23 - node_modules/lodash/stubString.js | 18 - node_modules/lodash/stubTrue.js | 18 - node_modules/lodash/subtract.js | 22 - node_modules/lodash/sum.js | 24 - node_modules/lodash/sumBy.js | 33 - node_modules/lodash/tail.js | 22 - node_modules/lodash/take.js | 37 - node_modules/lodash/takeRight.js | 39 - node_modules/lodash/takeRightWhile.js | 45 - node_modules/lodash/takeWhile.js | 45 - node_modules/lodash/tap.js | 29 - node_modules/lodash/template.js | 272 - node_modules/lodash/templateSettings.js | 67 - node_modules/lodash/throttle.js | 69 - node_modules/lodash/thru.js | 28 - node_modules/lodash/times.js | 51 - node_modules/lodash/toArray.js | 58 - node_modules/lodash/toFinite.js | 42 - node_modules/lodash/toInteger.js | 36 - node_modules/lodash/toIterator.js | 23 - node_modules/lodash/toJSON.js | 1 - node_modules/lodash/toLength.js | 38 - node_modules/lodash/toLower.js | 28 - node_modules/lodash/toNumber.js | 64 - node_modules/lodash/toPairs.js | 30 - node_modules/lodash/toPairsIn.js | 30 - node_modules/lodash/toPath.js | 33 - node_modules/lodash/toPlainObject.js | 32 - node_modules/lodash/toSafeInteger.js | 37 - node_modules/lodash/toString.js | 28 - node_modules/lodash/toUpper.js | 28 - node_modules/lodash/transform.js | 65 - node_modules/lodash/trim.js | 47 - node_modules/lodash/trimEnd.js | 41 - node_modules/lodash/trimStart.js | 43 - node_modules/lodash/truncate.js | 111 - node_modules/lodash/unary.js | 22 - node_modules/lodash/unescape.js | 34 - node_modules/lodash/union.js | 26 - node_modules/lodash/unionBy.js | 39 - node_modules/lodash/unionWith.js | 34 - node_modules/lodash/uniq.js | 25 - node_modules/lodash/uniqBy.js | 31 - node_modules/lodash/uniqWith.js | 28 - node_modules/lodash/uniqueId.js | 28 - node_modules/lodash/unset.js | 34 - node_modules/lodash/unzip.js | 45 - node_modules/lodash/unzipWith.js | 39 - node_modules/lodash/update.js | 35 - node_modules/lodash/updateWith.js | 33 - node_modules/lodash/upperCase.js | 27 - node_modules/lodash/upperFirst.js | 22 - node_modules/lodash/util.js | 34 - node_modules/lodash/value.js | 1 - node_modules/lodash/valueOf.js | 1 - node_modules/lodash/values.js | 34 - node_modules/lodash/valuesIn.js | 32 - node_modules/lodash/without.js | 31 - node_modules/lodash/words.js | 35 - node_modules/lodash/wrap.js | 30 - node_modules/lodash/wrapperAt.js | 48 - node_modules/lodash/wrapperChain.js | 34 - node_modules/lodash/wrapperLodash.js | 147 - node_modules/lodash/wrapperReverse.js | 44 - node_modules/lodash/wrapperValue.js | 21 - node_modules/lodash/xor.js | 28 - node_modules/lodash/xorBy.js | 39 - node_modules/lodash/xorWith.js | 34 - node_modules/lodash/zip.js | 22 - node_modules/lodash/zipObject.js | 24 - node_modules/lodash/zipObjectDeep.js | 23 - node_modules/lodash/zipWith.js | 32 - node_modules/longest/LICENSE | 21 - node_modules/longest/README.md | 65 - node_modules/longest/index.js | 37 - node_modules/longest/package.json | 68 - node_modules/media-typer/HISTORY.md | 22 - node_modules/media-typer/LICENSE | 22 - node_modules/media-typer/README.md | 81 - node_modules/media-typer/index.js | 270 - node_modules/media-typer/package.json | 61 - node_modules/merge-descriptors/HISTORY.md | 21 - node_modules/merge-descriptors/LICENSE | 23 - node_modules/merge-descriptors/README.md | 48 - node_modules/merge-descriptors/index.js | 60 - node_modules/merge-descriptors/package.json | 69 - node_modules/methods/HISTORY.md | 29 - node_modules/methods/LICENSE | 24 - node_modules/methods/README.md | 51 - node_modules/methods/index.js | 69 - node_modules/methods/package.json | 79 - node_modules/mime-db/HISTORY.md | 466 - node_modules/mime-db/LICENSE | 22 - node_modules/mime-db/README.md | 102 - node_modules/mime-db/db.json | 8313 ------- node_modules/mime-db/index.js | 11 - node_modules/mime-db/package.json | 102 - node_modules/mime-types/HISTORY.md | 355 - node_modules/mime-types/LICENSE | 23 - node_modules/mime-types/README.md | 113 - node_modules/mime-types/index.js | 188 - node_modules/mime-types/package.json | 88 - node_modules/mime/LICENSE | 21 - node_modules/mime/README.md | 90 - node_modules/mime/build/build.js | 11 - node_modules/mime/build/test.js | 60 - node_modules/mime/cli.js | 8 - node_modules/mime/mime.js | 108 - node_modules/mime/package.json | 67 - node_modules/mime/types.json | 1 - node_modules/minimist/.travis.yml | 8 - node_modules/minimist/LICENSE | 18 - node_modules/minimist/example/parse.js | 2 - node_modules/minimist/index.js | 245 - node_modules/minimist/package.json | 73 - node_modules/minimist/readme.markdown | 95 - node_modules/minimist/test/all_bool.js | 32 - node_modules/minimist/test/bool.js | 178 - 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/proto.js | 44 - 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/mkdirp/LICENSE | 21 - node_modules/mkdirp/bin/cmd.js | 33 - node_modules/mkdirp/bin/usage.txt | 12 - node_modules/mkdirp/index.js | 99 - node_modules/mkdirp/package.json | 69 - node_modules/mkdirp/readme.markdown | 100 - node_modules/morgan/HISTORY.md | 202 - node_modules/morgan/LICENSE | 23 - node_modules/morgan/README.md | 414 - node_modules/morgan/index.js | 522 - .../morgan/node_modules/debug/.coveralls.yml | 1 - .../morgan/node_modules/debug/.eslintrc | 11 - .../morgan/node_modules/debug/.npmignore | 9 - .../morgan/node_modules/debug/.travis.yml | 14 - .../morgan/node_modules/debug/CHANGELOG.md | 362 - .../morgan/node_modules/debug/LICENSE | 19 - .../morgan/node_modules/debug/Makefile | 50 - .../morgan/node_modules/debug/README.md | 312 - .../morgan/node_modules/debug/component.json | 19 - .../morgan/node_modules/debug/karma.conf.js | 70 - .../morgan/node_modules/debug/node.js | 1 - .../morgan/node_modules/debug/package.json | 88 - .../morgan/node_modules/debug/src/browser.js | 185 - .../morgan/node_modules/debug/src/debug.js | 202 - .../morgan/node_modules/debug/src/index.js | 10 - .../node_modules/debug/src/inspector-log.js | 15 - .../morgan/node_modules/debug/src/node.js | 248 - node_modules/morgan/package.json | 94 - node_modules/ms/index.js | 152 - node_modules/ms/license.md | 21 - node_modules/ms/package.json | 73 - node_modules/ms/readme.md | 51 - node_modules/nan/CHANGELOG.md | 537 - node_modules/nan/LICENSE.md | 13 - node_modules/nan/README.md | 455 - node_modules/nan/doc/asyncworker.md | 146 - node_modules/nan/doc/buffers.md | 54 - node_modules/nan/doc/callback.md | 76 - node_modules/nan/doc/converters.md | 41 - node_modules/nan/doc/errors.md | 226 - node_modules/nan/doc/json.md | 62 - node_modules/nan/doc/maybe_types.md | 583 - node_modules/nan/doc/methods.md | 664 - node_modules/nan/doc/new.md | 147 - node_modules/nan/doc/node_misc.md | 123 - node_modules/nan/doc/object_wrappers.md | 263 - node_modules/nan/doc/persistent.md | 296 - node_modules/nan/doc/scopes.md | 73 - node_modules/nan/doc/script.md | 38 - node_modules/nan/doc/string_bytes.md | 62 - node_modules/nan/doc/v8_internals.md | 199 - node_modules/nan/doc/v8_misc.md | 85 - node_modules/nan/include_dirs.js | 1 - node_modules/nan/nan.h | 2898 --- node_modules/nan/nan_callbacks.h | 88 - node_modules/nan/nan_callbacks_12_inl.h | 514 - node_modules/nan/nan_callbacks_pre_12_inl.h | 520 - node_modules/nan/nan_converters.h | 72 - node_modules/nan/nan_converters_43_inl.h | 68 - node_modules/nan/nan_converters_pre_43_inl.h | 42 - .../nan/nan_define_own_property_helper.h | 29 - node_modules/nan/nan_implementation_12_inl.h | 430 - .../nan/nan_implementation_pre_12_inl.h | 263 - node_modules/nan/nan_json.h | 166 - node_modules/nan/nan_maybe_43_inl.h | 356 - node_modules/nan/nan_maybe_pre_43_inl.h | 268 - node_modules/nan/nan_new.h | 340 - node_modules/nan/nan_object_wrap.h | 156 - node_modules/nan/nan_persistent_12_inl.h | 132 - node_modules/nan/nan_persistent_pre_12_inl.h | 242 - node_modules/nan/nan_private.h | 73 - node_modules/nan/nan_string_bytes.h | 305 - node_modules/nan/nan_typedarray_contents.h | 96 - node_modules/nan/nan_weak.h | 437 - node_modules/nan/package.json | 98 - node_modules/nan/tools/1to2.js | 412 - node_modules/nan/tools/README.md | 14 - node_modules/nan/tools/package.json | 19 - node_modules/negotiator/HISTORY.md | 103 - node_modules/negotiator/LICENSE | 24 - node_modules/negotiator/README.md | 203 - node_modules/negotiator/index.js | 124 - node_modules/negotiator/lib/charset.js | 169 - node_modules/negotiator/lib/encoding.js | 184 - node_modules/negotiator/lib/language.js | 179 - node_modules/negotiator/lib/mediaType.js | 294 - node_modules/negotiator/package.json | 84 - node_modules/node-expat/LICENSE | 20 - node_modules/node-expat/README.md | 115 - node_modules/node-expat/binding.gyp | 14 - node_modules/node-expat/build/Makefile | 334 - .../build/Release/.deps/Release/libexpat.a.d | 1 - .../Release/.deps/Release/node_expat.node.d | 1 - .../obj.target/deps/libexpat/libexpat.a.d | 1 - .../expat/deps/libexpat/lib/xmlparse.o.d | 16 - .../expat/deps/libexpat/lib/xmlrole.o.d | 13 - .../expat/deps/libexpat/lib/xmltok.o.d | 23 - .../Release/obj.target/node_expat.node.d | 1 - .../obj.target/node_expat/node-expat.o.d | 65 - .../node-expat/build/Release/libexpat.a | Bin 339064 -> 0 bytes .../node-expat/build/Release/node_expat.node | Bin 255456 -> 0 bytes .../obj.target/deps/libexpat/libexpat.a | Bin 339064 -> 0 bytes .../expat/deps/libexpat/lib/xmlparse.o | Bin 84904 -> 0 bytes .../expat/deps/libexpat/lib/xmlrole.o | Bin 25176 -> 0 bytes .../expat/deps/libexpat/lib/xmltok.o | Bin 226520 -> 0 bytes .../build/Release/obj.target/node_expat.node | Bin 255456 -> 0 bytes .../obj.target/node_expat/node-expat.o | Bin 82216 -> 0 bytes .../node-expat/build/binding.Makefile | 6 - node_modules/node-expat/build/config.gypi | 204 - .../build/deps/libexpat/expat.target.mk | 176 - .../build/deps/libexpat/libexpat.Makefile | 6 - .../build/deps/libexpat/version.target.mk | 150 - .../node-expat/build/node_expat.target.mk | 166 - node_modules/node-expat/deps/libexpat/AUTHORS | 10 - .../node-expat/deps/libexpat/CMake.README | 42 - .../node-expat/deps/libexpat/CMakeLists.txt | 153 - node_modules/node-expat/deps/libexpat/COPYING | 21 - node_modules/node-expat/deps/libexpat/Changes | 389 - .../deps/libexpat/ConfigureChecks.cmake | 44 - .../node-expat/deps/libexpat/MANIFEST | 89 - .../node-expat/deps/libexpat/Makefile.in | 213 - node_modules/node-expat/deps/libexpat/README | 139 - .../node-expat/deps/libexpat/aclocal.m4 | 19 - .../node-expat/deps/libexpat/configure | 19409 ---------------- .../node-expat/deps/libexpat/configure.ac | 239 - .../deps/libexpat/conftools/PrintPath | 116 - .../conftools/ac_c_bigendian_cross.m4 | 81 - .../deps/libexpat/conftools/config.guess | 1473 -- .../deps/libexpat/conftools/config.sub | 1846 -- .../deps/libexpat/conftools/expat.m4 | 43 - .../deps/libexpat/conftools/get-version.sh | 46 - .../deps/libexpat/conftools/install-sh | 501 - .../deps/libexpat/conftools/ltmain.sh | 11200 --------- .../deps/libexpat/conftools/mkinstalldirs | 40 - .../node-expat/deps/libexpat/doc/expat.png | Bin 1029 -> 0 bytes .../deps/libexpat/doc/reference.html | 2394 -- .../node-expat/deps/libexpat/doc/style.css | 101 - .../deps/libexpat/doc/valid-xhtml10.png | Bin 2370 -> 0 bytes .../node-expat/deps/libexpat/doc/xmlwf.1 | 251 - .../node-expat/deps/libexpat/doc/xmlwf.xml | 440 - .../deps/libexpat/examples/elements.c | 68 - .../deps/libexpat/examples/outline.c | 109 - .../node-expat/deps/libexpat/expat.pc.in | 11 - .../node-expat/deps/libexpat/expat_config.h | 103 - .../deps/libexpat/expat_config.h.cmake | 91 - .../deps/libexpat/expat_config.h.in | 113 - .../node-expat/deps/libexpat/lib/ascii.h | 92 - .../node-expat/deps/libexpat/lib/asciitab.h | 36 - .../node-expat/deps/libexpat/lib/expat.h | 1058 - .../deps/libexpat/lib/expat_external.h | 132 - .../node-expat/deps/libexpat/lib/iasciitab.h | 37 - .../node-expat/deps/libexpat/lib/internal.h | 95 - .../node-expat/deps/libexpat/lib/latin1tab.h | 36 - .../node-expat/deps/libexpat/lib/libexpat.def | 76 - .../deps/libexpat/lib/libexpatw.def | 76 - .../node-expat/deps/libexpat/lib/nametab.h | 150 - .../node-expat/deps/libexpat/lib/siphash.h | 344 - .../node-expat/deps/libexpat/lib/utf8tab.h | 37 - .../node-expat/deps/libexpat/lib/winconfig.h | 40 - .../node-expat/deps/libexpat/lib/xmlparse.c | 6833 ------ .../node-expat/deps/libexpat/lib/xmlrole.c | 1330 -- .../node-expat/deps/libexpat/lib/xmlrole.h | 114 - .../node-expat/deps/libexpat/lib/xmltok.c | 1747 -- .../node-expat/deps/libexpat/lib/xmltok.h | 322 - .../deps/libexpat/lib/xmltok_impl.c | 1779 -- .../deps/libexpat/lib/xmltok_impl.h | 46 - .../node-expat/deps/libexpat/lib/xmltok_ns.c | 115 - .../node-expat/deps/libexpat/libexpat.gyp | 92 - .../node-expat/deps/libexpat/m4/libtool.m4 | 8387 ------- .../node-expat/deps/libexpat/m4/ltoptions.m4 | 437 - .../node-expat/deps/libexpat/m4/ltsugar.m4 | 124 - .../node-expat/deps/libexpat/m4/ltversion.m4 | 23 - .../deps/libexpat/m4/lt~obsolete.m4 | 99 - .../node-expat/deps/libexpat/run.sh.in | 12 - .../node-expat/deps/libexpat/tests/README.txt | 13 - .../deps/libexpat/tests/benchmark/README.txt | 16 - .../deps/libexpat/tests/benchmark/benchmark.c | 110 - .../node-expat/deps/libexpat/tests/chardata.c | 127 - .../node-expat/deps/libexpat/tests/chardata.h | 40 - .../node-expat/deps/libexpat/tests/memcheck.c | 173 - .../node-expat/deps/libexpat/tests/memcheck.h | 34 - .../deps/libexpat/tests/minicheck.c | 180 - .../deps/libexpat/tests/minicheck.h | 96 - .../node-expat/deps/libexpat/tests/runtests.c | 3617 --- .../deps/libexpat/tests/runtestspp.cpp | 6 - .../node-expat/deps/libexpat/tests/xmltest.sh | 145 - .../deps/libexpat/win32/MANIFEST.txt | 25 - .../node-expat/deps/libexpat/win32/README.txt | 75 - .../node-expat/deps/libexpat/win32/expat.iss | 72 - .../node-expat/deps/libexpat/xmlwf/codepage.c | 69 - .../node-expat/deps/libexpat/xmlwf/codepage.h | 6 - .../node-expat/deps/libexpat/xmlwf/ct.c | 147 - .../node-expat/deps/libexpat/xmlwf/filemap.h | 29 - .../deps/libexpat/xmlwf/readfilemap.c | 98 - .../deps/libexpat/xmlwf/unixfilemap.c | 69 - .../deps/libexpat/xmlwf/win32filemap.c | 97 - .../node-expat/deps/libexpat/xmlwf/xmlfile.c | 258 - .../node-expat/deps/libexpat/xmlwf/xmlfile.h | 20 - .../node-expat/deps/libexpat/xmlwf/xmlmime.c | 163 - .../node-expat/deps/libexpat/xmlwf/xmlmime.h | 19 - .../node-expat/deps/libexpat/xmlwf/xmltchar.h | 36 - .../node-expat/deps/libexpat/xmlwf/xmlurl.h | 13 - .../node-expat/deps/libexpat/xmlwf/xmlwf.c | 863 - .../deps/libexpat/xmlwf/xmlwin32url.cxx | 395 - node_modules/node-expat/lib/node-expat.js | 114 - node_modules/node-expat/node-expat.cc | 500 - node_modules/node-expat/package.json | 149 - node_modules/object-assign/index.js | 90 - node_modules/object-assign/license | 21 - node_modules/object-assign/package.json | 75 - node_modules/object-assign/readme.md | 61 - node_modules/on-finished/HISTORY.md | 88 - node_modules/on-finished/LICENSE | 23 - node_modules/on-finished/README.md | 154 - node_modules/on-finished/index.js | 196 - node_modules/on-finished/package.json | 73 - node_modules/on-headers/HISTORY.md | 21 - node_modules/on-headers/LICENSE | 22 - node_modules/on-headers/README.md | 81 - node_modules/on-headers/index.js | 132 - node_modules/on-headers/package.json | 77 - node_modules/optimist/.travis.yml | 4 - node_modules/optimist/LICENSE | 21 - node_modules/optimist/example/bool.js | 10 - .../optimist/example/boolean_double.js | 7 - .../optimist/example/boolean_single.js | 7 - node_modules/optimist/example/default_hash.js | 8 - .../optimist/example/default_singles.js | 7 - node_modules/optimist/example/divide.js | 8 - node_modules/optimist/example/line_count.js | 20 - .../optimist/example/line_count_options.js | 29 - .../optimist/example/line_count_wrap.js | 29 - node_modules/optimist/example/nonopt.js | 4 - node_modules/optimist/example/reflect.js | 2 - node_modules/optimist/example/short.js | 3 - node_modules/optimist/example/string.js | 11 - .../optimist/example/usage-options.js | 19 - node_modules/optimist/example/xup.js | 10 - node_modules/optimist/index.js | 478 - node_modules/optimist/package.json | 67 - node_modules/optimist/readme.markdown | 487 - node_modules/optimist/test/_.js | 71 - node_modules/optimist/test/_/argv.js | 2 - node_modules/optimist/test/_/bin.js | 3 - node_modules/optimist/test/parse.js | 446 - node_modules/optimist/test/usage.js | 292 - node_modules/parseurl/HISTORY.md | 58 - node_modules/parseurl/LICENSE | 24 - node_modules/parseurl/README.md | 133 - node_modules/parseurl/index.js | 158 - node_modules/parseurl/package.json | 81 - 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-to-regexp/History.md | 36 - node_modules/path-to-regexp/LICENSE | 21 - node_modules/path-to-regexp/Readme.md | 35 - node_modules/path-to-regexp/index.js | 129 - node_modules/path-to-regexp/package.json | 59 - node_modules/promise/.jshintrc | 5 - node_modules/promise/.npmignore | 6 - node_modules/promise/LICENSE | 19 - node_modules/promise/Readme.md | 221 - node_modules/promise/core.js | 5 - node_modules/promise/index.js | 6 - node_modules/promise/lib/core.js | 105 - node_modules/promise/lib/done.js | 14 - node_modules/promise/lib/es6-extensions.js | 108 - node_modules/promise/lib/node-extensions.js | 63 - node_modules/promise/package.json | 56 - node_modules/promise/polyfill-done.js | 12 - node_modules/promise/polyfill.js | 10 - node_modules/proxy-addr/HISTORY.md | 155 - node_modules/proxy-addr/LICENSE | 22 - node_modules/proxy-addr/README.md | 155 - node_modules/proxy-addr/index.js | 327 - node_modules/proxy-addr/package.json | 82 - node_modules/pug-attrs/LICENSE | 19 - node_modules/pug-attrs/README.md | 75 - node_modules/pug-attrs/index.js | 150 - .../node_modules/constantinople/.editorconfig | 10 - .../constantinople/.gitattributes | 22 - .../node_modules/constantinople/.prettierrc | 13 - .../node_modules/constantinople/.travis.yml | 5 - .../node_modules/constantinople/LICENSE | 19 - .../node_modules/constantinople/README.md | 46 - .../constantinople/lib/binaryOperation.d.ts | 2 - .../constantinople/lib/binaryOperation.js | 51 - .../constantinople/lib/index.d.ts | 19 - .../node_modules/constantinople/lib/index.js | 368 - .../node_modules/constantinople/package.json | 67 - .../constantinople/src/binaryOperation.ts | 76 - .../node_modules/constantinople/src/index.ts | 369 - .../node_modules/constantinople/test/index.js | 86 - .../node_modules/constantinople/tsconfig.json | 8 - node_modules/pug-attrs/package.json | 52 - node_modules/pug-code-gen/HISTORY.md | 13 - node_modules/pug-code-gen/LICENSE | 19 - node_modules/pug-code-gen/README.md | 64 - node_modules/pug-code-gen/index.js | 1000 - .../node_modules/constantinople/.editorconfig | 10 - .../constantinople/.gitattributes | 22 - .../node_modules/constantinople/.prettierrc | 13 - .../node_modules/constantinople/.travis.yml | 5 - .../node_modules/constantinople/LICENSE | 19 - .../node_modules/constantinople/README.md | 46 - .../constantinople/lib/binaryOperation.d.ts | 2 - .../constantinople/lib/binaryOperation.js | 51 - .../constantinople/lib/index.d.ts | 19 - .../node_modules/constantinople/lib/index.js | 368 - .../node_modules/constantinople/package.json | 67 - .../constantinople/src/binaryOperation.ts | 76 - .../node_modules/constantinople/src/index.ts | 369 - .../node_modules/constantinople/test/index.js | 86 - .../node_modules/constantinople/tsconfig.json | 8 - .../node_modules/void-elements/LICENSE | 22 - .../node_modules/void-elements/README.md | 27 - .../node_modules/void-elements/index.js | 21 - .../node_modules/void-elements/package.json | 64 - .../pug-code-gen/node_modules/with/.babelrc | 9 - .../workflows/rollingversions-canary.yml | 40 - .../.github/workflows/rollingversions.yml | 38 - .../with/.github/workflows/test.yml | 24 - .../pug-code-gen/node_modules/with/LICENSE | 19 - .../pug-code-gen/node_modules/with/README.md | 87 - .../node_modules/with/lib/globals.d.ts | 5 - .../node_modules/with/lib/globals.js | 190 - .../node_modules/with/lib/globals.js.map | 1 - .../node_modules/with/lib/index.d.ts | 8 - .../node_modules/with/lib/index.js | 148 - .../node_modules/with/lib/index.js.map | 1 - .../node_modules/with/lib/reference.d.ts | 2 - .../node_modules/with/lib/reference.js | 43 - .../node_modules/with/lib/reference.js.map | 1 - .../node_modules/with/package.json | 71 - .../node_modules/with/prettier.config.js | 1 - .../node_modules/with/src/globals.ts | 195 - .../node_modules/with/src/index.ts | 154 - .../node_modules/with/src/reference.ts | 24 - .../node_modules/with/tsconfig.json | 10 - .../node_modules/with/tslint.json | 7 - node_modules/pug-code-gen/package.json | 59 - node_modules/pug-error/LICENSE | 19 - node_modules/pug-error/README.md | 55 - node_modules/pug-error/index.js | 51 - node_modules/pug-error/package.json | 49 - node_modules/pug-filters/CHANGELOG.md | 34 - node_modules/pug-filters/LICENSE | 19 - node_modules/pug-filters/README.md | 42 - node_modules/pug-filters/index.js | 4 - .../pug-filters/lib/handle-filters.js | 144 - node_modules/pug-filters/lib/run-filter.js | 47 - .../pug-filters/node_modules/asap/CHANGES.md | 70 - .../pug-filters/node_modules/asap/LICENSE.md | 21 - .../pug-filters/node_modules/asap/README.md | 237 - .../pug-filters/node_modules/asap/asap.js | 65 - .../node_modules/asap/browser-asap.js | 66 - .../node_modules/asap/browser-raw.js | 223 - .../node_modules/asap/package.json | 87 - .../pug-filters/node_modules/asap/raw.js | 101 - .../node_modules/constantinople/.editorconfig | 10 - .../constantinople/.gitattributes | 22 - .../node_modules/constantinople/.prettierrc | 13 - .../node_modules/constantinople/.travis.yml | 5 - .../node_modules/constantinople/LICENSE | 19 - .../node_modules/constantinople/README.md | 46 - .../constantinople/lib/binaryOperation.d.ts | 2 - .../constantinople/lib/binaryOperation.js | 51 - .../constantinople/lib/index.d.ts | 19 - .../node_modules/constantinople/lib/index.js | 368 - .../node_modules/constantinople/package.json | 67 - .../constantinople/src/binaryOperation.ts | 76 - .../node_modules/constantinople/src/index.ts | 369 - .../node_modules/constantinople/test/index.js | 86 - .../node_modules/constantinople/tsconfig.json | 8 - .../node_modules/jstransformer/CHANGELOG.md | 38 - .../node_modules/jstransformer/LICENSE.md | 21 - .../node_modules/jstransformer/README.md | 114 - .../node_modules/jstransformer/index.js | 359 - .../node_modules/jstransformer/package.json | 62 - .../node_modules/promise/.jshintrc | 5 - .../node_modules/promise/.npmignore | 7 - .../pug-filters/node_modules/promise/LICENSE | 19 - .../node_modules/promise/Readme.md | 231 - .../pug-filters/node_modules/promise/build.js | 69 - .../pug-filters/node_modules/promise/core.js | 5 - .../node_modules/promise/domains/core.js | 213 - .../node_modules/promise/domains/done.js | 13 - .../promise/domains/es6-extensions.js | 107 - .../node_modules/promise/domains/finally.js | 16 - .../node_modules/promise/domains/index.js | 8 - .../promise/domains/node-extensions.js | 130 - .../promise/domains/rejection-tracking.js | 113 - .../promise/domains/synchronous.js | 62 - .../node_modules/promise/index.d.ts | 256 - .../pug-filters/node_modules/promise/index.js | 3 - .../node_modules/promise/lib/core.js | 213 - .../node_modules/promise/lib/done.js | 13 - .../promise/lib/es6-extensions.js | 107 - .../node_modules/promise/lib/finally.js | 16 - .../node_modules/promise/lib/index.js | 8 - .../promise/lib/node-extensions.js | 130 - .../promise/lib/rejection-tracking.js | 113 - .../node_modules/promise/lib/synchronous.js | 62 - .../node_modules/promise/package.json | 66 - .../node_modules/promise/polyfill-done.js | 12 - .../node_modules/promise/polyfill.js | 10 - .../node_modules/promise/setimmediate/core.js | 213 - .../node_modules/promise/setimmediate/done.js | 13 - .../promise/setimmediate/es6-extensions.js | 107 - .../promise/setimmediate/finally.js | 16 - .../promise/setimmediate/index.js | 8 - .../promise/setimmediate/node-extensions.js | 130 - .../setimmediate/rejection-tracking.js | 113 - .../promise/setimmediate/synchronous.js | 62 - .../node_modules/promise/src/core.js | 213 - .../node_modules/promise/src/done.js | 13 - .../promise/src/es6-extensions.js | 107 - .../node_modules/promise/src/finally.js | 16 - .../node_modules/promise/src/index.js | 8 - .../promise/src/node-extensions.js | 130 - .../promise/src/rejection-tracking.js | 113 - .../node_modules/promise/src/synchronous.js | 62 - node_modules/pug-filters/package.json | 68 - node_modules/pug-lexer/History.md | 66 - node_modules/pug-lexer/LICENSE | 19 - node_modules/pug-lexer/README.md | 73 - node_modules/pug-lexer/index.js | 1705 -- .../node_modules/character-parser/.npmignore | 2 - .../node_modules/character-parser/LICENSE | 19 - .../node_modules/character-parser/README.md | 177 - .../node_modules/character-parser/index.js | 296 - .../character-parser/package.json | 64 - node_modules/pug-lexer/package.json | 55 - node_modules/pug-linker/HISTORY.md | 10 - node_modules/pug-linker/LICENSE | 19 - node_modules/pug-linker/README.md | 28 - node_modules/pug-linker/index.js | 206 - node_modules/pug-linker/package.json | 53 - node_modules/pug-load/HISTORY.md | 19 - node_modules/pug-load/LICENSE | 19 - node_modules/pug-load/README.md | 105 - node_modules/pug-load/index.js | 120 - node_modules/pug-load/package.json | 52 - node_modules/pug-parser/HISTORY.md | 11 - node_modules/pug-parser/LICENSE | 19 - node_modules/pug-parser/README.md | 90 - node_modules/pug-parser/index.js | 1300 -- node_modules/pug-parser/lib/inline-tags.js | 23 - node_modules/pug-parser/package.json | 50 - node_modules/pug-runtime/CHANGELOG.md | 45 - node_modules/pug-runtime/LICENSE | 19 - node_modules/pug-runtime/README.md | 68 - node_modules/pug-runtime/build.js | 27 - node_modules/pug-runtime/index.js | 282 - node_modules/pug-runtime/lib/dependencies.js | 34 - node_modules/pug-runtime/lib/internals.js | 8 - node_modules/pug-runtime/lib/sources.js | 13 - node_modules/pug-runtime/package.json | 62 - node_modules/pug-runtime/wrap.js | 10 - node_modules/pug-strip-comments/CHANGELOG.md | 16 - node_modules/pug-strip-comments/LICENSE.md | 7 - node_modules/pug-strip-comments/README.md | 46 - node_modules/pug-strip-comments/index.js | 77 - node_modules/pug-strip-comments/package.json | 51 - node_modules/pug-walk/HISTORY.md | 4 - node_modules/pug-walk/LICENSE | 19 - node_modules/pug-walk/README.md | 138 - node_modules/pug-walk/index.js | 120 - node_modules/pug-walk/package.json | 50 - node_modules/pug/History.md | 991 - node_modules/pug/LICENSE | 22 - node_modules/pug/README.md | 168 - node_modules/pug/lib/index.js | 492 - node_modules/pug/package.json | 111 - node_modules/pug/register.js | 20 - 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/qs/.editorconfig | 30 - node_modules/qs/.eslintignore | 1 - node_modules/qs/.eslintrc | 19 - node_modules/qs/CHANGELOG.md | 226 - node_modules/qs/LICENSE | 28 - node_modules/qs/README.md | 475 - node_modules/qs/dist/qs.js | 638 - node_modules/qs/lib/formats.js | 18 - node_modules/qs/lib/index.js | 11 - node_modules/qs/lib/parse.js | 174 - node_modules/qs/lib/stringify.js | 210 - node_modules/qs/lib/utils.js | 213 - node_modules/qs/package.json | 81 - node_modules/qs/test/.eslintrc | 15 - node_modules/qs/test/index.js | 7 - node_modules/qs/test/parse.js | 574 - node_modules/qs/test/stringify.js | 597 - node_modules/qs/test/utils.js | 34 - node_modules/range-parser/HISTORY.md | 56 - node_modules/range-parser/LICENSE | 23 - node_modules/range-parser/README.md | 84 - node_modules/range-parser/index.js | 162 - node_modules/range-parser/package.json | 91 - node_modules/raw-body/HISTORY.md | 258 - node_modules/raw-body/LICENSE | 22 - node_modules/raw-body/README.md | 219 - node_modules/raw-body/index.d.ts | 87 - node_modules/raw-body/index.js | 286 - .../node_modules/http-errors/HISTORY.md | 132 - .../raw-body/node_modules/http-errors/LICENSE | 23 - .../node_modules/http-errors/README.md | 135 - .../node_modules/http-errors/index.js | 260 - .../node_modules/http-errors/package.json | 90 - node_modules/raw-body/package.json | 95 - 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 | 128 - node_modules/resolve/.editorconfig | 37 - node_modules/resolve/.eslintignore | 1 - node_modules/resolve/.eslintrc | 39 - node_modules/resolve/LICENSE | 21 - node_modules/resolve/SECURITY.md | 3 - node_modules/resolve/appveyor.yml | 74 - 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 | 320 - node_modules/resolve/lib/caller.js | 8 - node_modules/resolve/lib/core.js | 53 - node_modules/resolve/lib/core.json | 83 - 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 | 199 - node_modules/resolve/package.json | 80 - node_modules/resolve/readme.markdown | 279 - node_modules/resolve/test/.eslintrc | 5 - node_modules/resolve/test/core.js | 81 - 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 | 315 - node_modules/resolve/test/mock_sync.js | 216 - 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 | 54 - .../shadowed_core/node_modules/util/index.js | 0 node_modules/resolve/test/subdirs.js | 13 - node_modules/resolve/test/symlinks.js | 176 - node_modules/right-align/LICENSE | 21 - node_modules/right-align/README.md | 77 - node_modules/right-align/index.js | 16 - node_modules/right-align/package.json | 70 - 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 | 62 - node_modules/safer-buffer/LICENSE | 21 - node_modules/safer-buffer/Porting-Buffer.md | 268 - node_modules/safer-buffer/Readme.md | 156 - node_modules/safer-buffer/dangerous.js | 58 - node_modules/safer-buffer/package.json | 60 - node_modules/safer-buffer/safer.js | 77 - node_modules/safer-buffer/tests.js | 406 - node_modules/send/HISTORY.md | 462 - node_modules/send/LICENSE | 23 - node_modules/send/README.md | 306 - node_modules/send/index.js | 1130 - .../send/node_modules/debug/.coveralls.yml | 1 - .../send/node_modules/debug/.eslintrc | 11 - .../send/node_modules/debug/.npmignore | 9 - .../send/node_modules/debug/.travis.yml | 14 - .../send/node_modules/debug/CHANGELOG.md | 362 - node_modules/send/node_modules/debug/LICENSE | 19 - node_modules/send/node_modules/debug/Makefile | 50 - .../send/node_modules/debug/README.md | 312 - .../send/node_modules/debug/component.json | 19 - .../send/node_modules/debug/karma.conf.js | 70 - node_modules/send/node_modules/debug/node.js | 1 - .../send/node_modules/debug/package.json | 88 - .../send/node_modules/debug/src/browser.js | 185 - .../send/node_modules/debug/src/debug.js | 202 - .../send/node_modules/debug/src/index.js | 10 - .../node_modules/debug/src/inspector-log.js | 15 - .../send/node_modules/debug/src/node.js | 248 - .../send/node_modules/http-errors/HISTORY.md | 132 - .../send/node_modules/http-errors/LICENSE | 23 - .../send/node_modules/http-errors/README.md | 135 - .../send/node_modules/http-errors/index.js | 260 - .../node_modules/http-errors/package.json | 90 - node_modules/send/package.json | 112 - node_modules/serve-static/HISTORY.md | 433 - node_modules/serve-static/LICENSE | 25 - node_modules/serve-static/README.md | 258 - node_modules/serve-static/index.js | 210 - node_modules/serve-static/package.json | 75 - node_modules/setprototypeof/LICENSE | 13 - node_modules/setprototypeof/README.md | 26 - node_modules/setprototypeof/index.d.ts | 2 - node_modules/setprototypeof/index.js | 15 - node_modules/setprototypeof/package.json | 55 - node_modules/source-map/README.md | 510 - node_modules/source-map/build/assert-shim.js | 56 - node_modules/source-map/build/mini-require.js | 152 - .../source-map/build/prefix-source-map.jsm | 21 - .../source-map/build/prefix-utils.jsm | 18 - .../source-map/build/suffix-browser.js | 8 - .../source-map/build/suffix-source-map.jsm | 6 - .../source-map/build/suffix-utils.jsm | 21 - node_modules/source-map/build/test-prefix.js | 8 - node_modules/source-map/build/test-suffix.js | 3 - node_modules/source-map/lib/source-map.js | 8 - .../source-map/lib/source-map/array-set.js | 107 - .../source-map/lib/source-map/base64-vlq.js | 146 - .../source-map/lib/source-map/base64.js | 73 - .../lib/source-map/binary-search.js | 117 - .../source-map/lib/source-map/mapping-list.js | 86 - .../source-map/lib/source-map/quick-sort.js | 120 - .../lib/source-map/source-map-consumer.js | 1077 - .../lib/source-map/source-map-generator.js | 399 - .../source-map/lib/source-map/source-node.js | 414 - .../source-map/lib/source-map/util.js | 370 - node_modules/source-map/package.json | 198 - node_modules/statuses/HISTORY.md | 60 - node_modules/statuses/LICENSE | 23 - node_modules/statuses/README.md | 127 - node_modules/statuses/codes.json | 65 - node_modules/statuses/index.js | 113 - node_modules/statuses/package.json | 92 - node_modules/to-fast-properties/index.js | 27 - node_modules/to-fast-properties/license | 10 - node_modules/to-fast-properties/package.json | 67 - node_modules/to-fast-properties/readme.md | 37 - node_modules/token-stream/.npmignore | 14 - node_modules/token-stream/.travis.yml | 16 - node_modules/token-stream/HISTORY.md | 5 - node_modules/token-stream/LICENSE | 19 - node_modules/token-stream/README.md | 68 - node_modules/token-stream/index.js | 30 - node_modules/token-stream/package.json | 50 - node_modules/token-stream/test/index.js | 46 - node_modules/topo/LICENSE | 25 - node_modules/topo/README.md | 29 - node_modules/topo/lib/index.js | 228 - .../topo/node_modules/hoek/.npmignore | 3 - .../topo/node_modules/hoek/CHANGELOG.md | 3 - node_modules/topo/node_modules/hoek/LICENSE | 26 - node_modules/topo/node_modules/hoek/README.md | 15 - .../topo/node_modules/hoek/lib/deep-equal.js | 315 - .../topo/node_modules/hoek/lib/escape.js | 127 - .../topo/node_modules/hoek/lib/index.js | 686 - .../topo/node_modules/hoek/package.json | 52 - node_modules/topo/package.json | 57 - node_modules/transformers/.npmignore | 2 - node_modules/transformers/README.md | 141 - node_modules/transformers/history.md | 77 - node_modules/transformers/lib/shared.js | 162 - node_modules/transformers/lib/transformers.js | 604 - .../transformers/node_modules/.bin/uglifyjs | 1 - .../node_modules/is-promise/.npmignore | 6 - .../node_modules/is-promise/.travis.yml | 3 - .../node_modules/is-promise/LICENSE | 19 - .../node_modules/is-promise/index.js | 5 - .../node_modules/is-promise/package.json | 50 - .../node_modules/is-promise/readme.md | 29 - .../node_modules/promise/.npmignore | 6 - .../node_modules/promise/Readme.md | 85 - .../node_modules/promise/index.js | 164 - .../node_modules/promise/package.json | 54 - .../node_modules/source-map/.npmignore | 2 - .../node_modules/source-map/.travis.yml | 4 - .../node_modules/source-map/CHANGELOG.md | 194 - .../node_modules/source-map/LICENSE | 28 - .../source-map/Makefile.dryice.js | 166 - .../node_modules/source-map/README.md | 475 - .../source-map/build/assert-shim.js | 56 - .../source-map/build/mini-require.js | 152 - .../source-map/build/prefix-source-map.jsm | 20 - .../source-map/build/prefix-utils.jsm | 18 - .../source-map/build/suffix-browser.js | 8 - .../source-map/build/suffix-source-map.jsm | 6 - .../source-map/build/suffix-utils.jsm | 21 - .../source-map/build/test-prefix.js | 8 - .../source-map/build/test-suffix.js | 3 - .../node_modules/source-map/lib/source-map.js | 8 - .../source-map/lib/source-map/array-set.js | 97 - .../source-map/lib/source-map/base64-vlq.js | 142 - .../source-map/lib/source-map/base64.js | 42 - .../lib/source-map/binary-search.js | 80 - .../source-map/lib/source-map/mapping-list.js | 86 - .../lib/source-map/source-map-consumer.js | 575 - .../lib/source-map/source-map-generator.js | 400 - .../source-map/lib/source-map/source-node.js | 414 - .../source-map/lib/source-map/util.js | 319 - .../node_modules/source-map/package.json | 183 - .../node_modules/source-map/test/run-tests.js | 62 - .../source-map/test/source-map/test-api.js | 26 - .../test/source-map/test-array-set.js | 104 - .../test/source-map/test-base64-vlq.js | 23 - .../source-map/test/source-map/test-base64.js | 35 - .../test/source-map/test-binary-search.js | 54 - .../test/source-map/test-dog-fooding.js | 84 - .../source-map/test-source-map-consumer.js | 702 - .../source-map/test-source-map-generator.js | 679 - .../test/source-map/test-source-node.js | 612 - .../source-map/test/source-map/test-util.js | 216 - .../source-map/test/source-map/util.js | 192 - .../node_modules/uglify-js/.npmignore | 2 - .../node_modules/uglify-js/README.md | 544 - .../node_modules/uglify-js/bin/uglifyjs | 370 - .../node_modules/uglify-js/lib/ast.js | 964 - .../node_modules/uglify-js/lib/compress.js | 1968 -- .../node_modules/uglify-js/lib/mozilla-ast.js | 265 - .../node_modules/uglify-js/lib/output.js | 1220 - .../node_modules/uglify-js/lib/parse.js | 1407 -- .../node_modules/uglify-js/lib/scope.js | 580 - .../node_modules/uglify-js/lib/sourcemap.js | 81 - .../node_modules/uglify-js/lib/transform.js | 218 - .../node_modules/uglify-js/lib/utils.js | 288 - .../node_modules/uglify-js/package.json | 65 - .../uglify-js/test/compress/arrays.js | 12 - .../uglify-js/test/compress/blocks.js | 49 - .../uglify-js/test/compress/conditionals.js | 143 - .../uglify-js/test/compress/dead-code.js | 89 - .../uglify-js/test/compress/debugger.js | 24 - .../uglify-js/test/compress/drop-unused.js | 97 - .../uglify-js/test/compress/issue-105.js | 17 - .../uglify-js/test/compress/issue-12.js | 11 - .../uglify-js/test/compress/issue-22.js | 17 - .../uglify-js/test/compress/issue-44.js | 31 - .../uglify-js/test/compress/issue-59.js | 30 - .../uglify-js/test/compress/labels.js | 163 - .../uglify-js/test/compress/loops.js | 123 - .../uglify-js/test/compress/properties.js | 25 - .../uglify-js/test/compress/sequences.js | 161 - .../uglify-js/test/compress/switch.js | 210 - .../node_modules/uglify-js/test/run-tests.js | 170 - .../node_modules/uglify-js/tools/node.js | 164 - node_modules/transformers/package.json | 101 - node_modules/type-is/HISTORY.md | 259 - node_modules/type-is/LICENSE | 23 - node_modules/type-is/README.md | 170 - node_modules/type-is/index.js | 266 - node_modules/type-is/package.json | 85 - node_modules/uglify-js/LICENSE | 29 - node_modules/uglify-js/README.md | 995 - node_modules/uglify-js/bin/extract-props.js | 77 - node_modules/uglify-js/bin/uglifyjs | 635 - node_modules/uglify-js/lib/ast.js | 1052 - node_modules/uglify-js/lib/compress.js | 4101 ---- node_modules/uglify-js/lib/mozilla-ast.js | 611 - node_modules/uglify-js/lib/output.js | 1423 -- node_modules/uglify-js/lib/parse.js | 1599 -- node_modules/uglify-js/lib/propmangle.js | 264 - node_modules/uglify-js/lib/scope.js | 656 - node_modules/uglify-js/lib/sourcemap.js | 97 - node_modules/uglify-js/lib/transform.js | 218 - node_modules/uglify-js/lib/utils.js | 362 - .../node_modules/source-map/CHANGELOG.md | 301 - .../uglify-js/node_modules/source-map/LICENSE | 28 - .../node_modules/source-map/README.md | 729 - .../source-map/dist/source-map.debug.js | 3091 --- .../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 - .../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 | 1082 - .../source-map/lib/source-map-generator.js | 416 - .../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/uglify-js/package.json | 90 - node_modules/uglify-js/tools/domprops.json | 5603 ----- node_modules/uglify-js/tools/exports.js | 19 - node_modules/uglify-js/tools/node.js | 320 - node_modules/uglify-js/tools/props.html | 61 - node_modules/uglify-to-browserify/.npmignore | 14 - node_modules/uglify-to-browserify/.travis.yml | 3 - node_modules/uglify-to-browserify/LICENSE | 19 - node_modules/uglify-to-browserify/README.md | 15 - node_modules/uglify-to-browserify/index.js | 49 - .../uglify-to-browserify/package.json | 51 - .../uglify-to-browserify/test/index.js | 22 - node_modules/unpipe/HISTORY.md | 4 - node_modules/unpipe/LICENSE | 22 - node_modules/unpipe/README.md | 43 - node_modules/unpipe/index.js | 69 - node_modules/unpipe/package.json | 63 - node_modules/utils-merge/.npmignore | 9 - node_modules/utils-merge/LICENSE | 20 - node_modules/utils-merge/README.md | 34 - node_modules/utils-merge/index.js | 23 - node_modules/utils-merge/package.json | 66 - node_modules/vary/HISTORY.md | 39 - node_modules/vary/LICENSE | 22 - node_modules/vary/README.md | 101 - node_modules/vary/index.js | 149 - node_modules/vary/package.json | 78 - node_modules/void-elements/.gitattributes | 1 - node_modules/void-elements/.npmignore | 1 - node_modules/void-elements/.travis.yml | 4 - node_modules/void-elements/LICENSE | 22 - node_modules/void-elements/README.md | 27 - node_modules/void-elements/index.js | 23 - node_modules/void-elements/package.json | 58 - node_modules/void-elements/pre-publish.js | 29 - node_modules/void-elements/test/index.js | 5 - node_modules/window-size/LICENSE-MIT | 22 - node_modules/window-size/README.md | 26 - node_modules/window-size/index.js | 33 - node_modules/window-size/package.json | 58 - node_modules/with/.npmignore | 2 - node_modules/with/LICENSE | 19 - node_modules/with/README.md | 81 - node_modules/with/index.js | 125 - node_modules/with/node_modules/.bin/acorn | 1 - .../with/node_modules/acorn/.editorconfig | 7 - .../with/node_modules/acorn/.gitattributes | 1 - .../with/node_modules/acorn/.npmignore | 3 - .../with/node_modules/acorn/.tern-project | 1 - .../with/node_modules/acorn/.travis.yml | 2 - node_modules/with/node_modules/acorn/AUTHORS | 38 - node_modules/with/node_modules/acorn/LICENSE | 19 - .../with/node_modules/acorn/README.md | 377 - .../with/node_modules/acorn/bin/acorn | 54 - .../node_modules/acorn/bin/build-acorn.js | 51 - .../acorn/bin/generate-identifier-regex.js | 47 - .../with/node_modules/acorn/bin/prepublish.sh | 2 - .../node_modules/acorn/bin/update_authors.sh | 6 - .../with/node_modules/acorn/bin/without_eval | 48 - .../with/node_modules/acorn/dist/.keep | 0 .../with/node_modules/acorn/dist/acorn.js | 4014 ---- .../with/node_modules/acorn/dist/acorn_csp.js | 3985 ---- .../node_modules/acorn/dist/acorn_loose.js | 1298 -- .../with/node_modules/acorn/dist/walk.js | 342 - .../with/node_modules/acorn/package.json | 181 - .../with/node_modules/acorn/src/expression.js | 697 - .../with/node_modules/acorn/src/identifier.js | 129 - .../with/node_modules/acorn/src/index.js | 75 - .../with/node_modules/acorn/src/location.js | 68 - .../acorn/src/loose/acorn_loose.js | 0 .../acorn/src/loose/expression.js | 511 - .../node_modules/acorn/src/loose/index.js | 50 - .../node_modules/acorn/src/loose/parseutil.js | 126 - .../node_modules/acorn/src/loose/state.js | 17 - .../node_modules/acorn/src/loose/statement.js | 419 - .../node_modules/acorn/src/loose/tokenize.js | 108 - .../with/node_modules/acorn/src/lval.js | 213 - .../with/node_modules/acorn/src/node.js | 70 - .../with/node_modules/acorn/src/options.js | 119 - .../with/node_modules/acorn/src/parseutil.js | 89 - .../with/node_modules/acorn/src/state.js | 78 - .../with/node_modules/acorn/src/statement.js | 594 - .../node_modules/acorn/src/tokencontext.js | 107 - .../with/node_modules/acorn/src/tokenize.js | 672 - .../with/node_modules/acorn/src/tokentype.js | 142 - .../with/node_modules/acorn/src/util.js | 9 - .../with/node_modules/acorn/src/walk/index.js | 291 - .../with/node_modules/acorn/src/whitespace.js | 12 - node_modules/with/package.json | 54 - node_modules/wordwrap/LICENSE | 18 - node_modules/wordwrap/README.markdown | 70 - node_modules/wordwrap/example/center.js | 10 - node_modules/wordwrap/example/meat.js | 3 - node_modules/wordwrap/index.js | 76 - node_modules/wordwrap/package.json | 66 - node_modules/wordwrap/test/break.js | 30 - node_modules/wordwrap/test/idleness.txt | 63 - node_modules/wordwrap/test/wrap.js | 31 - node_modules/xml2json/.editorconfig | 14 - node_modules/xml2json/.npmignore | 1 - node_modules/xml2json/.travis.yml | 21 - node_modules/xml2json/AUTHORS | 22 - node_modules/xml2json/README.md | 120 - node_modules/xml2json/bin/xml2json | 26 - node_modules/xml2json/example.js | 10 - node_modules/xml2json/index.js | 1 - node_modules/xml2json/lib/index.js | 4 - node_modules/xml2json/lib/json2xml.js | 115 - node_modules/xml2json/lib/sanitize.js | 61 - node_modules/xml2json/lib/xml2json.js | 186 - node_modules/xml2json/package-lock.json | 1325 -- node_modules/xml2json/package.json | 124 - node_modules/xml2json/t.js | 17 - node_modules/xml2json/test/.npmignore | 1 - node_modules/xml2json/test/coerce-overhead.js | 20 - .../test/fixtures/alternate-text-node-A.json | 1 - .../test/fixtures/alternate-text-node-A.xml | 11 - .../test/fixtures/alternate-text-node-B.json | 1 - .../test/fixtures/alternate-text-node-C.json | 1 - .../test/fixtures/alternate-text-node-D.json | 1 - .../test/fixtures/alternate-text-node-D.xml | 22 - .../test/fixtures/array-notation.json | 1 - .../xml2json/test/fixtures/array-notation.xml | 8 - .../xml2json/test/fixtures/coerce.json | 1 - .../xml2json/test/fixtures/coerce.xml | 33 - .../test/fixtures/domain-reversible.json | 1 - .../xml2json/test/fixtures/domain.json | 1 - .../xml2json/test/fixtures/domain.xml | 1 - .../xml2json/test/fixtures/forceArray.json | 1 - .../xml2json/test/fixtures/forceArray.xml | 42 - .../xml2json/test/fixtures/large.json | 1 - node_modules/xml2json/test/fixtures/large.xml | 1132 - .../test/fixtures/null-properties-ignored.xml | 1 - .../fixtures/null-properties-not-ignored.xml | 1 - .../test/fixtures/null-properties.json | 1 - .../xml2json/test/fixtures/reorder.json | 1 - .../xml2json/test/fixtures/reorder.xml | 1 - .../xml2json/test/fixtures/spacetext.json | 1 - .../xml2json/test/fixtures/spacetext.xml | 14 - .../xml2json/test/fixtures/xmlsanitize.json | 1 - .../xml2json/test/fixtures/xmlsanitize.xml | 1 - .../xml2json/test/fixtures/xmlsanitize2.json | 1 - .../xml2json/test/fixtures/xmlsanitize2.xml | 1 - .../xml2json/test/fixtures/xmlsanitize3.json | 1 - .../xml2json/test/fixtures/xmlsanitize3.xml | 1 - node_modules/xml2json/test/test-reorder.js | 18 - node_modules/xml2json/test/test-space.js | 25 - .../xml2json/test/test-xmlsanitize.js | 16 - node_modules/xml2json/test/test.js | 334 - node_modules/yargs/CHANGELOG.md | 374 - node_modules/yargs/LICENSE | 21 - node_modules/yargs/README.md | 926 - node_modules/yargs/completion.sh.hbs | 22 - node_modules/yargs/index.js | 504 - node_modules/yargs/lib/completion.js | 71 - node_modules/yargs/lib/parser.js | 448 - node_modules/yargs/lib/usage.js | 314 - node_modules/yargs/lib/validation.js | 196 - node_modules/yargs/package.json | 114 - 2914 files changed, 1 insertion(+), 412638 deletions(-) delete mode 120000 node_modules/.bin/acorn delete mode 120000 node_modules/.bin/cleancss delete mode 120000 node_modules/.bin/jade delete mode 120000 node_modules/.bin/mime delete mode 120000 node_modules/.bin/mkdirp delete mode 120000 node_modules/.bin/parser delete mode 120000 node_modules/.bin/uglifyjs delete mode 120000 node_modules/.bin/xml2json delete mode 100644 node_modules/@babel/helper-validator-identifier/LICENSE delete mode 100644 node_modules/@babel/helper-validator-identifier/README.md delete mode 100644 node_modules/@babel/helper-validator-identifier/lib/identifier.js delete mode 100644 node_modules/@babel/helper-validator-identifier/lib/index.js delete mode 100644 node_modules/@babel/helper-validator-identifier/lib/keyword.js delete mode 100644 node_modules/@babel/helper-validator-identifier/package.json delete mode 100644 node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js delete mode 100644 node_modules/@babel/parser/CHANGELOG.md delete mode 100644 node_modules/@babel/parser/LICENSE delete mode 100644 node_modules/@babel/parser/README.md delete mode 100755 node_modules/@babel/parser/bin/babel-parser.js delete mode 100644 node_modules/@babel/parser/lib/index.js delete mode 100644 node_modules/@babel/parser/lib/index.js.map delete mode 100644 node_modules/@babel/parser/package.json delete mode 100644 node_modules/@babel/parser/typings/babel-parser.d.ts delete mode 100644 node_modules/@babel/types/LICENSE delete mode 100644 node_modules/@babel/types/README.md delete mode 100644 node_modules/@babel/types/lib/asserts/assertNode.js delete mode 100644 node_modules/@babel/types/lib/asserts/generated/index.js delete mode 100644 node_modules/@babel/types/lib/ast-types/generated/index.js delete mode 100644 node_modules/@babel/types/lib/builders/builder.js delete mode 100644 node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js delete mode 100644 node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js delete mode 100644 node_modules/@babel/types/lib/builders/generated/index.js delete mode 100644 node_modules/@babel/types/lib/builders/generated/uppercase.js delete mode 100644 node_modules/@babel/types/lib/builders/react/buildChildren.js delete mode 100644 node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js delete mode 100644 node_modules/@babel/types/lib/clone/clone.js delete mode 100644 node_modules/@babel/types/lib/clone/cloneDeep.js delete mode 100644 node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js delete mode 100644 node_modules/@babel/types/lib/clone/cloneNode.js delete mode 100644 node_modules/@babel/types/lib/clone/cloneWithoutLoc.js delete mode 100644 node_modules/@babel/types/lib/comments/addComment.js delete mode 100644 node_modules/@babel/types/lib/comments/addComments.js delete mode 100644 node_modules/@babel/types/lib/comments/inheritInnerComments.js delete mode 100644 node_modules/@babel/types/lib/comments/inheritLeadingComments.js delete mode 100644 node_modules/@babel/types/lib/comments/inheritTrailingComments.js delete mode 100644 node_modules/@babel/types/lib/comments/inheritsComments.js delete mode 100644 node_modules/@babel/types/lib/comments/removeComments.js delete mode 100644 node_modules/@babel/types/lib/constants/generated/index.js delete mode 100644 node_modules/@babel/types/lib/constants/index.js delete mode 100644 node_modules/@babel/types/lib/converters/Scope.js delete mode 100644 node_modules/@babel/types/lib/converters/ensureBlock.js delete mode 100644 node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js delete mode 100644 node_modules/@babel/types/lib/converters/toBindingIdentifierName.js delete mode 100644 node_modules/@babel/types/lib/converters/toBlock.js delete mode 100644 node_modules/@babel/types/lib/converters/toComputedKey.js delete mode 100644 node_modules/@babel/types/lib/converters/toExpression.js delete mode 100644 node_modules/@babel/types/lib/converters/toIdentifier.js delete mode 100644 node_modules/@babel/types/lib/converters/toKeyAlias.js delete mode 100644 node_modules/@babel/types/lib/converters/toSequenceExpression.js delete mode 100644 node_modules/@babel/types/lib/converters/toStatement.js delete mode 100644 node_modules/@babel/types/lib/converters/valueToNode.js delete mode 100644 node_modules/@babel/types/lib/definitions/core.js delete mode 100644 node_modules/@babel/types/lib/definitions/experimental.js delete mode 100644 node_modules/@babel/types/lib/definitions/flow.js delete mode 100644 node_modules/@babel/types/lib/definitions/index.js delete mode 100644 node_modules/@babel/types/lib/definitions/jsx.js delete mode 100644 node_modules/@babel/types/lib/definitions/misc.js delete mode 100644 node_modules/@babel/types/lib/definitions/placeholders.js delete mode 100644 node_modules/@babel/types/lib/definitions/typescript.js delete mode 100644 node_modules/@babel/types/lib/definitions/utils.js delete mode 100644 node_modules/@babel/types/lib/index-legacy.d.ts delete mode 100644 node_modules/@babel/types/lib/index.d.ts delete mode 100644 node_modules/@babel/types/lib/index.js delete mode 100644 node_modules/@babel/types/lib/index.js.flow delete mode 100644 node_modules/@babel/types/lib/modifications/appendToMemberExpression.js delete mode 100644 node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js delete mode 100644 node_modules/@babel/types/lib/modifications/inherits.js delete mode 100644 node_modules/@babel/types/lib/modifications/prependToMemberExpression.js delete mode 100644 node_modules/@babel/types/lib/modifications/removeProperties.js delete mode 100644 node_modules/@babel/types/lib/modifications/removePropertiesDeep.js delete mode 100644 node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js delete mode 100644 node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js delete mode 100644 node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js delete mode 100644 node_modules/@babel/types/lib/traverse/traverse.js delete mode 100644 node_modules/@babel/types/lib/traverse/traverseFast.js delete mode 100644 node_modules/@babel/types/lib/utils/inherit.js delete mode 100644 node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js delete mode 100644 node_modules/@babel/types/lib/utils/shallowEqual.js delete mode 100644 node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js delete mode 100644 node_modules/@babel/types/lib/validators/generated/index.js delete mode 100644 node_modules/@babel/types/lib/validators/is.js delete mode 100644 node_modules/@babel/types/lib/validators/isBinding.js delete mode 100644 node_modules/@babel/types/lib/validators/isBlockScoped.js delete mode 100644 node_modules/@babel/types/lib/validators/isImmutable.js delete mode 100644 node_modules/@babel/types/lib/validators/isLet.js delete mode 100644 node_modules/@babel/types/lib/validators/isNode.js delete mode 100644 node_modules/@babel/types/lib/validators/isNodesEquivalent.js delete mode 100644 node_modules/@babel/types/lib/validators/isPlaceholderType.js delete mode 100644 node_modules/@babel/types/lib/validators/isReferenced.js delete mode 100644 node_modules/@babel/types/lib/validators/isScope.js delete mode 100644 node_modules/@babel/types/lib/validators/isSpecifierDefault.js delete mode 100644 node_modules/@babel/types/lib/validators/isType.js delete mode 100644 node_modules/@babel/types/lib/validators/isValidES3Identifier.js delete mode 100644 node_modules/@babel/types/lib/validators/isValidIdentifier.js delete mode 100644 node_modules/@babel/types/lib/validators/isVar.js delete mode 100644 node_modules/@babel/types/lib/validators/matchesPattern.js delete mode 100644 node_modules/@babel/types/lib/validators/react/isCompatTag.js delete mode 100644 node_modules/@babel/types/lib/validators/react/isReactComponent.js delete mode 100644 node_modules/@babel/types/lib/validators/validate.js delete mode 100644 node_modules/@babel/types/package.json delete mode 100644 node_modules/@babel/types/scripts/generators/asserts.js delete mode 100644 node_modules/@babel/types/scripts/generators/ast-types.js delete mode 100644 node_modules/@babel/types/scripts/generators/builders.js delete mode 100644 node_modules/@babel/types/scripts/generators/constants.js delete mode 100644 node_modules/@babel/types/scripts/generators/docs.js delete mode 100644 node_modules/@babel/types/scripts/generators/flow.js delete mode 100644 node_modules/@babel/types/scripts/generators/typescript-legacy.js delete mode 100644 node_modules/@babel/types/scripts/generators/validators.js delete mode 100644 node_modules/@babel/types/scripts/package.json delete mode 100644 node_modules/@babel/types/scripts/utils/formatBuilderName.js delete mode 100644 node_modules/@babel/types/scripts/utils/lowerFirst.js delete mode 100644 node_modules/@babel/types/scripts/utils/stringifyValidator.js delete mode 100644 node_modules/@babel/types/scripts/utils/toFunctionName.js delete mode 100644 node_modules/accepts/HISTORY.md delete mode 100644 node_modules/accepts/LICENSE delete mode 100644 node_modules/accepts/README.md delete mode 100644 node_modules/accepts/index.js delete mode 100644 node_modules/accepts/package.json delete mode 100644 node_modules/acorn-globals/LICENSE delete mode 100644 node_modules/acorn-globals/README.md delete mode 100644 node_modules/acorn-globals/index.js delete mode 100644 node_modules/acorn-globals/package.json delete mode 100644 node_modules/acorn/.editorconfig delete mode 100644 node_modules/acorn/.gitattributes delete mode 100644 node_modules/acorn/.npmignore delete mode 100644 node_modules/acorn/.tern-project delete mode 100644 node_modules/acorn/.travis.yml delete mode 100644 node_modules/acorn/AUTHORS delete mode 100644 node_modules/acorn/LICENSE delete mode 100644 node_modules/acorn/README.md delete mode 100755 node_modules/acorn/bin/acorn delete mode 100644 node_modules/acorn/bin/build-acorn.js delete mode 100644 node_modules/acorn/bin/generate-identifier-regex.js delete mode 100755 node_modules/acorn/bin/update_authors.sh delete mode 100644 node_modules/acorn/dist/.keep delete mode 100644 node_modules/acorn/dist/acorn.js delete mode 100644 node_modules/acorn/dist/acorn_loose.js delete mode 100644 node_modules/acorn/dist/walk.js delete mode 100644 node_modules/acorn/package.json delete mode 100644 node_modules/acorn/src/bin/acorn.js delete mode 100644 node_modules/acorn/src/expression.js delete mode 100644 node_modules/acorn/src/identifier.js delete mode 100644 node_modules/acorn/src/index.js delete mode 100644 node_modules/acorn/src/location.js delete mode 100644 node_modules/acorn/src/locutil.js delete mode 100644 node_modules/acorn/src/loose/acorn_loose.js delete mode 100644 node_modules/acorn/src/loose/expression.js delete mode 100644 node_modules/acorn/src/loose/index.js delete mode 100644 node_modules/acorn/src/loose/parseutil.js delete mode 100644 node_modules/acorn/src/loose/state.js delete mode 100644 node_modules/acorn/src/loose/statement.js delete mode 100644 node_modules/acorn/src/loose/tokenize.js delete mode 100644 node_modules/acorn/src/lval.js delete mode 100644 node_modules/acorn/src/node.js delete mode 100644 node_modules/acorn/src/options.js delete mode 100644 node_modules/acorn/src/parseutil.js delete mode 100644 node_modules/acorn/src/state.js delete mode 100644 node_modules/acorn/src/statement.js delete mode 100644 node_modules/acorn/src/tokencontext.js delete mode 100644 node_modules/acorn/src/tokenize.js delete mode 100644 node_modules/acorn/src/tokentype.js delete mode 100644 node_modules/acorn/src/util.js delete mode 100644 node_modules/acorn/src/walk/index.js delete mode 100644 node_modules/acorn/src/whitespace.js delete mode 100644 node_modules/align-text/LICENSE delete mode 100644 node_modules/align-text/README.md delete mode 100644 node_modules/align-text/index.js delete mode 100644 node_modules/align-text/package.json delete mode 100644 node_modules/amdefine/LICENSE delete mode 100644 node_modules/amdefine/README.md delete mode 100644 node_modules/amdefine/amdefine.js delete mode 100644 node_modules/amdefine/intercept.js delete mode 100644 node_modules/amdefine/package.json delete mode 100644 node_modules/array-flatten/LICENSE delete mode 100644 node_modules/array-flatten/README.md delete mode 100644 node_modules/array-flatten/array-flatten.js delete mode 100644 node_modules/array-flatten/package.json delete mode 100644 node_modules/asap/LICENSE.md delete mode 100644 node_modules/asap/README.md delete mode 100644 node_modules/asap/asap.js delete mode 100644 node_modules/asap/package.json delete mode 100644 node_modules/assert-never/README.md delete mode 100644 node_modules/assert-never/index.d.ts delete mode 100644 node_modules/assert-never/index.js delete mode 100644 node_modules/assert-never/index.ts delete mode 100644 node_modules/assert-never/package.json delete mode 100644 node_modules/babel-walk/LICENSE.md delete mode 100644 node_modules/babel-walk/README.md delete mode 100644 node_modules/babel-walk/lib/.tsbuildinfo delete mode 100644 node_modules/babel-walk/lib/explode.d.ts delete mode 100644 node_modules/babel-walk/lib/explode.js delete mode 100644 node_modules/babel-walk/lib/explode.js.map delete mode 100644 node_modules/babel-walk/lib/index.d.ts delete mode 100644 node_modules/babel-walk/lib/index.js delete mode 100644 node_modules/babel-walk/lib/index.js.map delete mode 100644 node_modules/babel-walk/lib/test.d.ts delete mode 100644 node_modules/babel-walk/lib/test.js delete mode 100644 node_modules/babel-walk/lib/test.js.map delete mode 100644 node_modules/babel-walk/package.json delete mode 100644 node_modules/basic-auth/HISTORY.md delete mode 100644 node_modules/basic-auth/LICENSE delete mode 100644 node_modules/basic-auth/README.md delete mode 100644 node_modules/basic-auth/index.js delete mode 100644 node_modules/basic-auth/package.json delete mode 100644 node_modules/bindings/LICENSE.md delete mode 100644 node_modules/bindings/README.md delete mode 100644 node_modules/bindings/bindings.js delete mode 100644 node_modules/bindings/package.json delete mode 100644 node_modules/body-parser/HISTORY.md delete mode 100644 node_modules/body-parser/LICENSE delete mode 100644 node_modules/body-parser/README.md delete mode 100644 node_modules/body-parser/index.js delete mode 100644 node_modules/body-parser/lib/read.js delete mode 100644 node_modules/body-parser/lib/types/json.js delete mode 100644 node_modules/body-parser/lib/types/raw.js delete mode 100644 node_modules/body-parser/lib/types/text.js delete mode 100644 node_modules/body-parser/lib/types/urlencoded.js delete mode 100644 node_modules/body-parser/node_modules/debug/.coveralls.yml delete mode 100644 node_modules/body-parser/node_modules/debug/.eslintrc delete mode 100644 node_modules/body-parser/node_modules/debug/.npmignore delete mode 100644 node_modules/body-parser/node_modules/debug/.travis.yml delete mode 100644 node_modules/body-parser/node_modules/debug/CHANGELOG.md delete mode 100644 node_modules/body-parser/node_modules/debug/LICENSE delete mode 100644 node_modules/body-parser/node_modules/debug/Makefile delete mode 100644 node_modules/body-parser/node_modules/debug/README.md delete mode 100644 node_modules/body-parser/node_modules/debug/component.json delete mode 100644 node_modules/body-parser/node_modules/debug/karma.conf.js delete mode 100644 node_modules/body-parser/node_modules/debug/node.js delete mode 100644 node_modules/body-parser/node_modules/debug/package.json delete mode 100644 node_modules/body-parser/node_modules/debug/src/browser.js delete mode 100644 node_modules/body-parser/node_modules/debug/src/debug.js delete mode 100644 node_modules/body-parser/node_modules/debug/src/index.js delete mode 100644 node_modules/body-parser/node_modules/debug/src/inspector-log.js delete mode 100644 node_modules/body-parser/node_modules/debug/src/node.js delete mode 100644 node_modules/body-parser/node_modules/http-errors/HISTORY.md delete mode 100644 node_modules/body-parser/node_modules/http-errors/LICENSE delete mode 100644 node_modules/body-parser/node_modules/http-errors/README.md delete mode 100644 node_modules/body-parser/node_modules/http-errors/index.js delete mode 100644 node_modules/body-parser/node_modules/http-errors/package.json delete mode 100644 node_modules/body-parser/package.json delete mode 100644 node_modules/bytes/History.md delete mode 100644 node_modules/bytes/LICENSE delete mode 100644 node_modules/bytes/Readme.md delete mode 100644 node_modules/bytes/index.js delete mode 100644 node_modules/bytes/package.json delete mode 100644 node_modules/call-bind/.eslintignore delete mode 100644 node_modules/call-bind/.eslintrc delete mode 100644 node_modules/call-bind/.github/FUNDING.yml delete mode 100644 node_modules/call-bind/.nycrc delete mode 100644 node_modules/call-bind/CHANGELOG.md delete mode 100644 node_modules/call-bind/LICENSE delete mode 100644 node_modules/call-bind/README.md delete mode 100644 node_modules/call-bind/callBound.js delete mode 100644 node_modules/call-bind/index.js delete mode 100644 node_modules/call-bind/package.json delete mode 100644 node_modules/call-bind/test/callBound.js delete mode 100644 node_modules/call-bind/test/index.js delete mode 100644 node_modules/camelcase/index.js delete mode 100644 node_modules/camelcase/license delete mode 100644 node_modules/camelcase/package.json delete mode 100644 node_modules/camelcase/readme.md delete mode 100644 node_modules/center-align/LICENSE delete mode 100644 node_modules/center-align/README.md delete mode 100644 node_modules/center-align/index.js delete mode 100644 node_modules/center-align/package.json delete mode 100644 node_modules/center-align/utils.js delete mode 100644 node_modules/character-parser/.npmignore delete mode 100644 node_modules/character-parser/LICENSE delete mode 100644 node_modules/character-parser/README.md delete mode 100644 node_modules/character-parser/index.js delete mode 100644 node_modules/character-parser/package.json delete mode 100644 node_modules/clean-css/History.md delete mode 100644 node_modules/clean-css/LICENSE delete mode 100644 node_modules/clean-css/README.md delete mode 100755 node_modules/clean-css/bin/cleancss delete mode 100644 node_modules/clean-css/index.js delete mode 100644 node_modules/clean-css/lib/clean.js delete mode 100644 node_modules/clean-css/lib/colors/hex-name-shortener.js delete mode 100644 node_modules/clean-css/lib/colors/hsl.js delete mode 100644 node_modules/clean-css/lib/colors/rgb.js delete mode 100644 node_modules/clean-css/lib/imports/inliner.js delete mode 100644 node_modules/clean-css/lib/properties/break-up.js delete mode 100644 node_modules/clean-css/lib/properties/can-override.js delete mode 100644 node_modules/clean-css/lib/properties/clone.js delete mode 100644 node_modules/clean-css/lib/properties/compactable.js delete mode 100644 node_modules/clean-css/lib/properties/every-combination.js delete mode 100644 node_modules/clean-css/lib/properties/has-inherit.js delete mode 100644 node_modules/clean-css/lib/properties/invalid-property-error.js delete mode 100644 node_modules/clean-css/lib/properties/optimizer.js delete mode 100644 node_modules/clean-css/lib/properties/override-compactor.js delete mode 100644 node_modules/clean-css/lib/properties/populate-components.js delete mode 100644 node_modules/clean-css/lib/properties/remove-unused.js delete mode 100644 node_modules/clean-css/lib/properties/restore-from-optimizing.js delete mode 100644 node_modules/clean-css/lib/properties/restore.js delete mode 100644 node_modules/clean-css/lib/properties/shorthand-compactor.js delete mode 100644 node_modules/clean-css/lib/properties/validator.js delete mode 100644 node_modules/clean-css/lib/properties/vendor-prefixes.js delete mode 100644 node_modules/clean-css/lib/properties/wrap-for-optimizing.js delete mode 100644 node_modules/clean-css/lib/selectors/advanced.js delete mode 100644 node_modules/clean-css/lib/selectors/clean-up.js delete mode 100644 node_modules/clean-css/lib/selectors/extractor.js delete mode 100644 node_modules/clean-css/lib/selectors/is-special.js delete mode 100644 node_modules/clean-css/lib/selectors/merge-adjacent.js delete mode 100644 node_modules/clean-css/lib/selectors/merge-media-queries.js delete mode 100644 node_modules/clean-css/lib/selectors/merge-non-adjacent-by-body.js delete mode 100644 node_modules/clean-css/lib/selectors/merge-non-adjacent-by-selector.js delete mode 100644 node_modules/clean-css/lib/selectors/reduce-non-adjacent.js delete mode 100644 node_modules/clean-css/lib/selectors/remove-duplicate-media-queries.js delete mode 100644 node_modules/clean-css/lib/selectors/remove-duplicates.js delete mode 100644 node_modules/clean-css/lib/selectors/reorderable.js delete mode 100644 node_modules/clean-css/lib/selectors/restructure.js delete mode 100644 node_modules/clean-css/lib/selectors/simple.js delete mode 100644 node_modules/clean-css/lib/source-maps/track.js delete mode 100644 node_modules/clean-css/lib/stringifier/helpers.js delete mode 100644 node_modules/clean-css/lib/stringifier/one-time.js delete mode 100644 node_modules/clean-css/lib/stringifier/simple.js delete mode 100644 node_modules/clean-css/lib/stringifier/source-maps.js delete mode 100644 node_modules/clean-css/lib/text/comments-processor.js delete mode 100644 node_modules/clean-css/lib/text/escape-store.js delete mode 100644 node_modules/clean-css/lib/text/expressions-processor.js delete mode 100644 node_modules/clean-css/lib/text/free-text-processor.js delete mode 100644 node_modules/clean-css/lib/text/urls-processor.js delete mode 100644 node_modules/clean-css/lib/tokenizer/extract-properties.js delete mode 100644 node_modules/clean-css/lib/tokenizer/extract-selectors.js delete mode 100644 node_modules/clean-css/lib/tokenizer/tokenize.js delete mode 100644 node_modules/clean-css/lib/urls/rebase.js delete mode 100644 node_modules/clean-css/lib/urls/reduce.js delete mode 100644 node_modules/clean-css/lib/urls/rewrite.js delete mode 100644 node_modules/clean-css/lib/utils/clone-array.js delete mode 100644 node_modules/clean-css/lib/utils/compatibility.js delete mode 100644 node_modules/clean-css/lib/utils/input-source-map-tracker.js delete mode 100644 node_modules/clean-css/lib/utils/object.js delete mode 100644 node_modules/clean-css/lib/utils/quote-scanner.js delete mode 100644 node_modules/clean-css/lib/utils/source-reader.js delete mode 100644 node_modules/clean-css/lib/utils/source-tracker.js delete mode 100644 node_modules/clean-css/lib/utils/split.js delete mode 100644 node_modules/clean-css/node_modules/commander/History.md delete mode 100644 node_modules/clean-css/node_modules/commander/LICENSE delete mode 100644 node_modules/clean-css/node_modules/commander/Readme.md delete mode 100644 node_modules/clean-css/node_modules/commander/index.js delete mode 100644 node_modules/clean-css/node_modules/commander/package.json delete mode 100644 node_modules/clean-css/package.json delete mode 100644 node_modules/cliui/.coveralls.yml delete mode 100644 node_modules/cliui/.npmignore delete mode 100644 node_modules/cliui/.travis.yml delete mode 100644 node_modules/cliui/LICENSE.txt delete mode 100644 node_modules/cliui/README.md delete mode 100644 node_modules/cliui/index.js delete mode 100644 node_modules/cliui/node_modules/wordwrap/.npmignore delete mode 100644 node_modules/cliui/node_modules/wordwrap/README.markdown delete mode 100644 node_modules/cliui/node_modules/wordwrap/example/center.js delete mode 100644 node_modules/cliui/node_modules/wordwrap/example/meat.js delete mode 100644 node_modules/cliui/node_modules/wordwrap/index.js delete mode 100644 node_modules/cliui/node_modules/wordwrap/package.json delete mode 100644 node_modules/cliui/node_modules/wordwrap/test/break.js delete mode 100644 node_modules/cliui/node_modules/wordwrap/test/idleness.txt delete mode 100644 node_modules/cliui/node_modules/wordwrap/test/wrap.js delete mode 100644 node_modules/cliui/package.json delete mode 100644 node_modules/cliui/test/cliui.js delete mode 100644 node_modules/commander/History.md delete mode 100644 node_modules/commander/Readme.md delete mode 100644 node_modules/commander/index.js delete mode 100644 node_modules/commander/package.json delete mode 100644 node_modules/constantinople/.gitattributes delete mode 100644 node_modules/constantinople/.npmignore delete mode 100644 node_modules/constantinople/.travis.yml delete mode 100644 node_modules/constantinople/LICENSE delete mode 100644 node_modules/constantinople/README.md delete mode 100644 node_modules/constantinople/index.js delete mode 100644 node_modules/constantinople/package.json delete mode 100644 node_modules/constantinople/test/index.js delete mode 100644 node_modules/content-disposition/HISTORY.md delete mode 100644 node_modules/content-disposition/LICENSE delete mode 100644 node_modules/content-disposition/README.md delete mode 100644 node_modules/content-disposition/index.js delete mode 100644 node_modules/content-disposition/package.json delete mode 100644 node_modules/content-type/HISTORY.md delete mode 100644 node_modules/content-type/LICENSE delete mode 100644 node_modules/content-type/README.md delete mode 100644 node_modules/content-type/index.js delete mode 100644 node_modules/content-type/package.json delete mode 100644 node_modules/cookie-parser/HISTORY.md delete mode 100644 node_modules/cookie-parser/LICENSE delete mode 100644 node_modules/cookie-parser/README.md delete mode 100644 node_modules/cookie-parser/index.js delete mode 100644 node_modules/cookie-parser/node_modules/cookie/HISTORY.md delete mode 100644 node_modules/cookie-parser/node_modules/cookie/LICENSE delete mode 100644 node_modules/cookie-parser/node_modules/cookie/README.md delete mode 100644 node_modules/cookie-parser/node_modules/cookie/index.js delete mode 100644 node_modules/cookie-parser/node_modules/cookie/package.json delete mode 100644 node_modules/cookie-parser/package.json delete mode 100644 node_modules/cookie-signature/.npmignore delete mode 100644 node_modules/cookie-signature/History.md delete mode 100644 node_modules/cookie-signature/Readme.md delete mode 100644 node_modules/cookie-signature/index.js delete mode 100644 node_modules/cookie-signature/package.json delete mode 100644 node_modules/cookie/HISTORY.md delete mode 100644 node_modules/cookie/LICENSE delete mode 100644 node_modules/cookie/README.md delete mode 100644 node_modules/cookie/index.js delete mode 100644 node_modules/cookie/package.json delete mode 100644 node_modules/css-parse/.npmignore delete mode 100644 node_modules/css-parse/History.md delete mode 100644 node_modules/css-parse/Makefile delete mode 100644 node_modules/css-parse/Readme.md delete mode 100644 node_modules/css-parse/component.json delete mode 100644 node_modules/css-parse/index.js delete mode 100644 node_modules/css-parse/package.json delete mode 100644 node_modules/css-stringify/.npmignore delete mode 100644 node_modules/css-stringify/History.md delete mode 100644 node_modules/css-stringify/Makefile delete mode 100644 node_modules/css-stringify/Readme.md delete mode 100644 node_modules/css-stringify/component.json delete mode 100644 node_modules/css-stringify/index.js delete mode 100644 node_modules/css-stringify/package.json delete mode 100644 node_modules/css/.npmignore delete mode 100644 node_modules/css/History.md delete mode 100644 node_modules/css/Makefile delete mode 100644 node_modules/css/Readme.md delete mode 100644 node_modules/css/benchmark.js delete mode 100644 node_modules/css/component.json delete mode 100644 node_modules/css/index.js delete mode 100644 node_modules/css/package.json delete mode 100644 node_modules/css/test.js delete mode 100644 node_modules/decamelize/index.js delete mode 100644 node_modules/decamelize/license delete mode 100644 node_modules/decamelize/package.json delete mode 100644 node_modules/decamelize/readme.md delete mode 100644 node_modules/depd/History.md delete mode 100644 node_modules/depd/LICENSE delete mode 100644 node_modules/depd/Readme.md delete mode 100644 node_modules/depd/index.js delete mode 100644 node_modules/depd/lib/browser/index.js delete mode 100644 node_modules/depd/lib/compat/callsite-tostring.js delete mode 100644 node_modules/depd/lib/compat/event-listener-count.js delete mode 100644 node_modules/depd/lib/compat/index.js delete mode 100644 node_modules/depd/package.json delete mode 100644 node_modules/destroy/LICENSE delete mode 100644 node_modules/destroy/README.md delete mode 100644 node_modules/destroy/index.js delete mode 100644 node_modules/destroy/package.json delete mode 100644 node_modules/doctypes/.npmignore delete mode 100644 node_modules/doctypes/.travis.yml delete mode 100644 node_modules/doctypes/HISTORY.md delete mode 100644 node_modules/doctypes/LICENSE delete mode 100644 node_modules/doctypes/README.md delete mode 100644 node_modules/doctypes/index.js delete mode 100644 node_modules/doctypes/package.json delete mode 100644 node_modules/doctypes/test.js delete mode 100644 node_modules/ee-first/LICENSE delete mode 100644 node_modules/ee-first/README.md delete mode 100644 node_modules/ee-first/index.js delete mode 100644 node_modules/ee-first/package.json delete mode 100644 node_modules/encodeurl/HISTORY.md delete mode 100644 node_modules/encodeurl/LICENSE delete mode 100644 node_modules/encodeurl/README.md delete mode 100644 node_modules/encodeurl/index.js delete mode 100644 node_modules/encodeurl/package.json delete mode 100644 node_modules/escape-html/LICENSE delete mode 100644 node_modules/escape-html/Readme.md delete mode 100644 node_modules/escape-html/index.js delete mode 100644 node_modules/escape-html/package.json delete mode 100644 node_modules/etag/HISTORY.md delete mode 100644 node_modules/etag/LICENSE delete mode 100644 node_modules/etag/README.md delete mode 100644 node_modules/etag/index.js delete mode 100644 node_modules/etag/package.json delete mode 100644 node_modules/express/History.md delete mode 100644 node_modules/express/LICENSE delete mode 100644 node_modules/express/Readme.md delete mode 100644 node_modules/express/index.js delete mode 100644 node_modules/express/lib/application.js delete mode 100644 node_modules/express/lib/express.js delete mode 100644 node_modules/express/lib/middleware/init.js delete mode 100644 node_modules/express/lib/middleware/query.js delete mode 100644 node_modules/express/lib/request.js delete mode 100644 node_modules/express/lib/response.js delete mode 100644 node_modules/express/lib/router/index.js delete mode 100644 node_modules/express/lib/router/layer.js delete mode 100644 node_modules/express/lib/router/route.js delete mode 100644 node_modules/express/lib/utils.js delete mode 100644 node_modules/express/lib/view.js delete mode 100644 node_modules/express/node_modules/debug/.coveralls.yml delete mode 100644 node_modules/express/node_modules/debug/.eslintrc delete mode 100644 node_modules/express/node_modules/debug/.npmignore delete mode 100644 node_modules/express/node_modules/debug/.travis.yml delete mode 100644 node_modules/express/node_modules/debug/CHANGELOG.md delete mode 100644 node_modules/express/node_modules/debug/LICENSE delete mode 100644 node_modules/express/node_modules/debug/Makefile delete mode 100644 node_modules/express/node_modules/debug/README.md delete mode 100644 node_modules/express/node_modules/debug/component.json delete mode 100644 node_modules/express/node_modules/debug/karma.conf.js delete mode 100644 node_modules/express/node_modules/debug/node.js delete mode 100644 node_modules/express/node_modules/debug/package.json delete mode 100644 node_modules/express/node_modules/debug/src/browser.js delete mode 100644 node_modules/express/node_modules/debug/src/debug.js delete mode 100644 node_modules/express/node_modules/debug/src/index.js delete mode 100644 node_modules/express/node_modules/debug/src/inspector-log.js delete mode 100644 node_modules/express/node_modules/debug/src/node.js delete mode 100644 node_modules/express/package.json delete mode 100644 node_modules/file-uri-to-path/.npmignore delete mode 100644 node_modules/file-uri-to-path/.travis.yml delete mode 100644 node_modules/file-uri-to-path/History.md delete mode 100644 node_modules/file-uri-to-path/LICENSE delete mode 100644 node_modules/file-uri-to-path/README.md delete mode 100644 node_modules/file-uri-to-path/index.d.ts delete mode 100644 node_modules/file-uri-to-path/index.js delete mode 100644 node_modules/file-uri-to-path/package.json delete mode 100644 node_modules/file-uri-to-path/test/test.js delete mode 100644 node_modules/file-uri-to-path/test/tests.json delete mode 100644 node_modules/finalhandler/HISTORY.md delete mode 100644 node_modules/finalhandler/LICENSE delete mode 100644 node_modules/finalhandler/README.md delete mode 100644 node_modules/finalhandler/index.js delete mode 100644 node_modules/finalhandler/node_modules/debug/.coveralls.yml delete mode 100644 node_modules/finalhandler/node_modules/debug/.eslintrc delete mode 100644 node_modules/finalhandler/node_modules/debug/.npmignore delete mode 100644 node_modules/finalhandler/node_modules/debug/.travis.yml delete mode 100644 node_modules/finalhandler/node_modules/debug/CHANGELOG.md delete mode 100644 node_modules/finalhandler/node_modules/debug/LICENSE delete mode 100644 node_modules/finalhandler/node_modules/debug/Makefile delete mode 100644 node_modules/finalhandler/node_modules/debug/README.md delete mode 100644 node_modules/finalhandler/node_modules/debug/component.json delete mode 100644 node_modules/finalhandler/node_modules/debug/karma.conf.js delete mode 100644 node_modules/finalhandler/node_modules/debug/node.js delete mode 100644 node_modules/finalhandler/node_modules/debug/package.json delete mode 100644 node_modules/finalhandler/node_modules/debug/src/browser.js delete mode 100644 node_modules/finalhandler/node_modules/debug/src/debug.js delete mode 100644 node_modules/finalhandler/node_modules/debug/src/index.js delete mode 100644 node_modules/finalhandler/node_modules/debug/src/inspector-log.js delete mode 100644 node_modules/finalhandler/node_modules/debug/src/node.js delete mode 100644 node_modules/finalhandler/package.json delete mode 100644 node_modules/forwarded/HISTORY.md delete mode 100644 node_modules/forwarded/LICENSE delete mode 100644 node_modules/forwarded/README.md delete mode 100644 node_modules/forwarded/index.js delete mode 100644 node_modules/forwarded/package.json delete mode 100644 node_modules/fresh/HISTORY.md delete mode 100644 node_modules/fresh/LICENSE delete mode 100644 node_modules/fresh/README.md delete mode 100644 node_modules/fresh/index.js delete mode 100644 node_modules/fresh/package.json delete mode 100644 node_modules/function-bind/.editorconfig delete mode 100644 node_modules/function-bind/.eslintrc delete mode 100644 node_modules/function-bind/.jscs.json delete mode 100644 node_modules/function-bind/.npmignore delete mode 100644 node_modules/function-bind/.travis.yml delete mode 100644 node_modules/function-bind/LICENSE delete mode 100644 node_modules/function-bind/README.md delete mode 100644 node_modules/function-bind/implementation.js delete mode 100644 node_modules/function-bind/index.js delete mode 100644 node_modules/function-bind/package.json delete mode 100644 node_modules/function-bind/test/.eslintrc delete mode 100644 node_modules/function-bind/test/index.js delete mode 100644 node_modules/get-intrinsic/.eslintignore delete mode 100644 node_modules/get-intrinsic/.eslintrc delete mode 100644 node_modules/get-intrinsic/.github/FUNDING.yml delete mode 100644 node_modules/get-intrinsic/.nycrc delete mode 100644 node_modules/get-intrinsic/CHANGELOG.md delete mode 100644 node_modules/get-intrinsic/LICENSE delete mode 100644 node_modules/get-intrinsic/README.md delete mode 100644 node_modules/get-intrinsic/index.js delete mode 100644 node_modules/get-intrinsic/package.json delete mode 100644 node_modules/get-intrinsic/test/GetIntrinsic.js delete mode 100644 node_modules/graceful-readlink/.npmignore delete mode 100644 node_modules/graceful-readlink/.travis.yml delete mode 100644 node_modules/graceful-readlink/LICENSE delete mode 100644 node_modules/graceful-readlink/README.md delete mode 100644 node_modules/graceful-readlink/index.js delete mode 100644 node_modules/graceful-readlink/package.json delete mode 100644 node_modules/has-symbols/.eslintrc delete mode 100644 node_modules/has-symbols/.github/FUNDING.yml delete mode 100644 node_modules/has-symbols/.github/workflows/rebase.yml delete mode 100644 node_modules/has-symbols/.travis.yml delete mode 100644 node_modules/has-symbols/CHANGELOG.md delete mode 100644 node_modules/has-symbols/LICENSE delete mode 100644 node_modules/has-symbols/README.md delete mode 100644 node_modules/has-symbols/index.js delete mode 100644 node_modules/has-symbols/package.json delete mode 100644 node_modules/has-symbols/shams.js delete mode 100644 node_modules/has-symbols/test/index.js delete mode 100644 node_modules/has-symbols/test/shams/core-js.js delete mode 100644 node_modules/has-symbols/test/shams/get-own-property-symbols.js delete mode 100644 node_modules/has-symbols/test/tests.js delete mode 100644 node_modules/has/LICENSE-MIT delete mode 100644 node_modules/has/README.md delete mode 100644 node_modules/has/package.json delete mode 100644 node_modules/has/src/index.js delete mode 100644 node_modules/has/test/index.js delete mode 100644 node_modules/hoek/.npmignore delete mode 100644 node_modules/hoek/LICENSE delete mode 100644 node_modules/hoek/README.md delete mode 100755 node_modules/hoek/lib/escape.js delete mode 100755 node_modules/hoek/lib/index.js delete mode 100644 node_modules/hoek/package.json delete mode 100644 node_modules/http-errors/HISTORY.md delete mode 100644 node_modules/http-errors/LICENSE delete mode 100644 node_modules/http-errors/README.md delete mode 100644 node_modules/http-errors/index.js delete mode 100644 node_modules/http-errors/package.json delete mode 100644 node_modules/iconv-lite/.travis.yml delete mode 100644 node_modules/iconv-lite/Changelog.md delete mode 100644 node_modules/iconv-lite/LICENSE delete mode 100644 node_modules/iconv-lite/README.md delete mode 100644 node_modules/iconv-lite/encodings/dbcs-codec.js delete mode 100644 node_modules/iconv-lite/encodings/dbcs-data.js delete mode 100644 node_modules/iconv-lite/encodings/index.js delete mode 100644 node_modules/iconv-lite/encodings/internal.js delete mode 100644 node_modules/iconv-lite/encodings/sbcs-codec.js delete mode 100644 node_modules/iconv-lite/encodings/sbcs-data-generated.js delete mode 100644 node_modules/iconv-lite/encodings/sbcs-data.js delete mode 100644 node_modules/iconv-lite/encodings/tables/big5-added.json delete mode 100644 node_modules/iconv-lite/encodings/tables/cp936.json delete mode 100644 node_modules/iconv-lite/encodings/tables/cp949.json delete mode 100644 node_modules/iconv-lite/encodings/tables/cp950.json delete mode 100644 node_modules/iconv-lite/encodings/tables/eucjp.json delete mode 100644 node_modules/iconv-lite/encodings/tables/gb18030-ranges.json delete mode 100644 node_modules/iconv-lite/encodings/tables/gbk-added.json delete mode 100644 node_modules/iconv-lite/encodings/tables/shiftjis.json delete mode 100644 node_modules/iconv-lite/encodings/utf16.js delete mode 100644 node_modules/iconv-lite/encodings/utf7.js delete mode 100644 node_modules/iconv-lite/lib/bom-handling.js delete mode 100644 node_modules/iconv-lite/lib/extend-node.js delete mode 100644 node_modules/iconv-lite/lib/index.d.ts delete mode 100644 node_modules/iconv-lite/lib/index.js delete mode 100644 node_modules/iconv-lite/lib/streams.js delete mode 100644 node_modules/iconv-lite/package.json delete mode 100644 node_modules/inherits/LICENSE delete mode 100644 node_modules/inherits/README.md delete mode 100644 node_modules/inherits/inherits.js delete mode 100644 node_modules/inherits/inherits_browser.js delete mode 100644 node_modules/inherits/package.json delete mode 100644 node_modules/ipaddr.js/LICENSE delete mode 100644 node_modules/ipaddr.js/README.md delete mode 100644 node_modules/ipaddr.js/ipaddr.min.js delete mode 100644 node_modules/ipaddr.js/lib/ipaddr.js delete mode 100644 node_modules/ipaddr.js/lib/ipaddr.js.d.ts delete mode 100644 node_modules/ipaddr.js/package.json delete mode 100644 node_modules/is-buffer/LICENSE delete mode 100644 node_modules/is-buffer/README.md delete mode 100644 node_modules/is-buffer/index.js delete mode 100644 node_modules/is-buffer/package.json delete mode 100644 node_modules/is-buffer/test/basic.js delete mode 100644 node_modules/is-core-module/.eslintignore delete mode 100644 node_modules/is-core-module/.eslintrc delete mode 100644 node_modules/is-core-module/.github/FUNDING.yml delete mode 100644 node_modules/is-core-module/.github/workflows/node-4+.yml delete mode 100644 node_modules/is-core-module/.github/workflows/node-iojs.yml delete mode 100644 node_modules/is-core-module/.github/workflows/node-pretest.yml delete mode 100644 node_modules/is-core-module/.github/workflows/node-zero.yml delete mode 100644 node_modules/is-core-module/.github/workflows/rebase.yml delete mode 100644 node_modules/is-core-module/.github/workflows/require-allow-edits.yml delete mode 100644 node_modules/is-core-module/.nycrc delete mode 100644 node_modules/is-core-module/CHANGELOG.md delete mode 100644 node_modules/is-core-module/LICENSE delete mode 100644 node_modules/is-core-module/README.md delete mode 100644 node_modules/is-core-module/core.json delete mode 100644 node_modules/is-core-module/index.js delete mode 100644 node_modules/is-core-module/package.json delete mode 100644 node_modules/is-core-module/test/index.js delete mode 100644 node_modules/is-expression/CHANGELOG.md delete mode 100644 node_modules/is-expression/LICENSE.md delete mode 100644 node_modules/is-expression/README.md delete mode 100644 node_modules/is-expression/index.js delete mode 120000 node_modules/is-expression/node_modules/.bin/acorn delete mode 100644 node_modules/is-expression/node_modules/acorn/CHANGELOG.md delete mode 100644 node_modules/is-expression/node_modules/acorn/LICENSE delete mode 100644 node_modules/is-expression/node_modules/acorn/README.md delete mode 100755 node_modules/is-expression/node_modules/acorn/bin/acorn delete mode 100644 node_modules/is-expression/node_modules/acorn/dist/acorn.d.ts delete mode 100644 node_modules/is-expression/node_modules/acorn/dist/acorn.js delete mode 100644 node_modules/is-expression/node_modules/acorn/dist/acorn.js.map delete mode 100644 node_modules/is-expression/node_modules/acorn/dist/acorn.mjs delete mode 100644 node_modules/is-expression/node_modules/acorn/dist/acorn.mjs.d.ts delete mode 100644 node_modules/is-expression/node_modules/acorn/dist/acorn.mjs.map delete mode 100644 node_modules/is-expression/node_modules/acorn/dist/bin.js delete mode 100644 node_modules/is-expression/node_modules/acorn/package.json delete mode 100644 node_modules/is-expression/package.json delete mode 100644 node_modules/is-promise/LICENSE delete mode 100644 node_modules/is-promise/index.js delete mode 100644 node_modules/is-promise/index.mjs delete mode 100644 node_modules/is-promise/package.json delete mode 100644 node_modules/is-promise/readme.md delete mode 100644 node_modules/is-regex/.editorconfig delete mode 100644 node_modules/is-regex/.eslintignore delete mode 100644 node_modules/is-regex/.eslintrc delete mode 100644 node_modules/is-regex/.nycrc delete mode 100644 node_modules/is-regex/CHANGELOG.md delete mode 100644 node_modules/is-regex/LICENSE delete mode 100644 node_modules/is-regex/README.md delete mode 100644 node_modules/is-regex/index.js delete mode 100644 node_modules/is-regex/package.json delete mode 100644 node_modules/is-regex/test/index.js delete mode 100644 node_modules/isemail/LICENSE delete mode 100755 node_modules/isemail/README.md delete mode 100644 node_modules/isemail/lib/index.d.ts delete mode 100644 node_modules/isemail/lib/index.js delete mode 100644 node_modules/isemail/package.json delete mode 100644 node_modules/jade/.npmignore delete mode 100644 node_modules/jade/.release.json delete mode 100644 node_modules/jade/History.md delete mode 100644 node_modules/jade/LICENSE delete mode 100644 node_modules/jade/README.md delete mode 100644 node_modules/jade/Readme_zh-cn.md delete mode 100755 node_modules/jade/bin/jade.js delete mode 100644 node_modules/jade/block-code.html delete mode 100644 node_modules/jade/component.json delete mode 100644 node_modules/jade/jade.js delete mode 100644 node_modules/jade/lib/compiler.js delete mode 100644 node_modules/jade/lib/doctypes.js delete mode 100644 node_modules/jade/lib/filters-client.js delete mode 100644 node_modules/jade/lib/filters.js delete mode 100644 node_modules/jade/lib/index.js delete mode 100644 node_modules/jade/lib/inline-tags.js delete mode 100644 node_modules/jade/lib/lexer.js delete mode 100644 node_modules/jade/lib/nodes/attrs.js delete mode 100644 node_modules/jade/lib/nodes/block-comment.js delete mode 100644 node_modules/jade/lib/nodes/block.js delete mode 100644 node_modules/jade/lib/nodes/case.js delete mode 100644 node_modules/jade/lib/nodes/code.js delete mode 100644 node_modules/jade/lib/nodes/comment.js delete mode 100644 node_modules/jade/lib/nodes/doctype.js delete mode 100644 node_modules/jade/lib/nodes/each.js delete mode 100644 node_modules/jade/lib/nodes/filter.js delete mode 100644 node_modules/jade/lib/nodes/index.js delete mode 100644 node_modules/jade/lib/nodes/literal.js delete mode 100644 node_modules/jade/lib/nodes/mixin-block.js delete mode 100644 node_modules/jade/lib/nodes/mixin.js delete mode 100644 node_modules/jade/lib/nodes/node.js delete mode 100644 node_modules/jade/lib/nodes/tag.js delete mode 100644 node_modules/jade/lib/nodes/text.js delete mode 100644 node_modules/jade/lib/parser.js delete mode 100644 node_modules/jade/lib/runtime.js delete mode 100644 node_modules/jade/lib/utils.js delete mode 100644 node_modules/jade/package.json delete mode 100644 node_modules/jade/release.js delete mode 100644 node_modules/jade/runtime.js delete mode 100644 node_modules/joi/CHANGELOG.md delete mode 100644 node_modules/joi/LICENSE delete mode 100644 node_modules/joi/README.md delete mode 100644 node_modules/joi/lib/cast.js delete mode 100755 node_modules/joi/lib/errors.js delete mode 100644 node_modules/joi/lib/index.js delete mode 100644 node_modules/joi/lib/language.js delete mode 100644 node_modules/joi/lib/ref.js delete mode 100644 node_modules/joi/lib/schemas.js delete mode 100644 node_modules/joi/lib/set.js delete mode 100644 node_modules/joi/lib/types/alternatives/index.js delete mode 100644 node_modules/joi/lib/types/any/index.js delete mode 100644 node_modules/joi/lib/types/any/settings.js delete mode 100644 node_modules/joi/lib/types/array/index.js delete mode 100644 node_modules/joi/lib/types/binary/index.js delete mode 100644 node_modules/joi/lib/types/boolean/index.js delete mode 100644 node_modules/joi/lib/types/date/index.js delete mode 100644 node_modules/joi/lib/types/func/index.js delete mode 100644 node_modules/joi/lib/types/lazy/index.js delete mode 100644 node_modules/joi/lib/types/number/index.js delete mode 100644 node_modules/joi/lib/types/object/index.js delete mode 100755 node_modules/joi/lib/types/string/index.js delete mode 100644 node_modules/joi/lib/types/string/ip.js delete mode 100644 node_modules/joi/lib/types/string/rfc3986.js delete mode 100644 node_modules/joi/lib/types/string/uri.js delete mode 100644 node_modules/joi/lib/types/symbol/index.js delete mode 100644 node_modules/joi/node_modules/hoek/.npmignore delete mode 100644 node_modules/joi/node_modules/hoek/LICENSE delete mode 100644 node_modules/joi/node_modules/hoek/README.md delete mode 100755 node_modules/joi/node_modules/hoek/lib/escape.js delete mode 100755 node_modules/joi/node_modules/hoek/lib/index.js delete mode 100644 node_modules/joi/node_modules/hoek/package.json delete mode 100644 node_modules/joi/package.json delete mode 100644 node_modules/js-stringify/.npmignore delete mode 100644 node_modules/js-stringify/.travis.yml delete mode 100644 node_modules/js-stringify/LICENSE delete mode 100644 node_modules/js-stringify/README.md delete mode 100644 node_modules/js-stringify/index.js delete mode 100644 node_modules/js-stringify/package.json delete mode 100644 node_modules/js-stringify/test/index.js delete mode 100644 node_modules/jstransformer/LICENSE delete mode 100644 node_modules/jstransformer/README.md delete mode 100644 node_modules/jstransformer/index.js delete mode 100644 node_modules/jstransformer/package.json delete mode 100644 node_modules/kind-of/LICENSE delete mode 100644 node_modules/kind-of/README.md delete mode 100644 node_modules/kind-of/index.js delete mode 100644 node_modules/kind-of/package.json delete mode 100644 node_modules/lazy-cache/LICENSE delete mode 100644 node_modules/lazy-cache/README.md delete mode 100644 node_modules/lazy-cache/index.js delete mode 100644 node_modules/lazy-cache/package.json delete mode 100644 node_modules/lodash/LICENSE delete mode 100644 node_modules/lodash/README.md delete mode 100644 node_modules/lodash/_DataView.js delete mode 100644 node_modules/lodash/_Hash.js delete mode 100644 node_modules/lodash/_LazyWrapper.js delete mode 100644 node_modules/lodash/_ListCache.js delete mode 100644 node_modules/lodash/_LodashWrapper.js delete mode 100644 node_modules/lodash/_Map.js delete mode 100644 node_modules/lodash/_MapCache.js delete mode 100644 node_modules/lodash/_Promise.js delete mode 100644 node_modules/lodash/_Set.js delete mode 100644 node_modules/lodash/_SetCache.js delete mode 100644 node_modules/lodash/_Stack.js delete mode 100644 node_modules/lodash/_Symbol.js delete mode 100644 node_modules/lodash/_Uint8Array.js delete mode 100644 node_modules/lodash/_WeakMap.js delete mode 100644 node_modules/lodash/_apply.js delete mode 100644 node_modules/lodash/_arrayAggregator.js delete mode 100644 node_modules/lodash/_arrayEach.js delete mode 100644 node_modules/lodash/_arrayEachRight.js delete mode 100644 node_modules/lodash/_arrayEvery.js delete mode 100644 node_modules/lodash/_arrayFilter.js delete mode 100644 node_modules/lodash/_arrayIncludes.js delete mode 100644 node_modules/lodash/_arrayIncludesWith.js delete mode 100644 node_modules/lodash/_arrayLikeKeys.js delete mode 100644 node_modules/lodash/_arrayMap.js delete mode 100644 node_modules/lodash/_arrayPush.js delete mode 100644 node_modules/lodash/_arrayReduce.js delete mode 100644 node_modules/lodash/_arrayReduceRight.js delete mode 100644 node_modules/lodash/_arraySample.js delete mode 100644 node_modules/lodash/_arraySampleSize.js delete mode 100644 node_modules/lodash/_arrayShuffle.js delete mode 100644 node_modules/lodash/_arraySome.js delete mode 100644 node_modules/lodash/_asciiSize.js delete mode 100644 node_modules/lodash/_asciiToArray.js delete mode 100644 node_modules/lodash/_asciiWords.js delete mode 100644 node_modules/lodash/_assignMergeValue.js delete mode 100644 node_modules/lodash/_assignValue.js delete mode 100644 node_modules/lodash/_assocIndexOf.js delete mode 100644 node_modules/lodash/_baseAggregator.js delete mode 100644 node_modules/lodash/_baseAssign.js delete mode 100644 node_modules/lodash/_baseAssignIn.js delete mode 100644 node_modules/lodash/_baseAssignValue.js delete mode 100644 node_modules/lodash/_baseAt.js delete mode 100644 node_modules/lodash/_baseClamp.js delete mode 100644 node_modules/lodash/_baseClone.js delete mode 100644 node_modules/lodash/_baseConforms.js delete mode 100644 node_modules/lodash/_baseConformsTo.js delete mode 100644 node_modules/lodash/_baseCreate.js delete mode 100644 node_modules/lodash/_baseDelay.js delete mode 100644 node_modules/lodash/_baseDifference.js delete mode 100644 node_modules/lodash/_baseEach.js delete mode 100644 node_modules/lodash/_baseEachRight.js delete mode 100644 node_modules/lodash/_baseEvery.js delete mode 100644 node_modules/lodash/_baseExtremum.js delete mode 100644 node_modules/lodash/_baseFill.js delete mode 100644 node_modules/lodash/_baseFilter.js delete mode 100644 node_modules/lodash/_baseFindIndex.js delete mode 100644 node_modules/lodash/_baseFindKey.js delete mode 100644 node_modules/lodash/_baseFlatten.js delete mode 100644 node_modules/lodash/_baseFor.js delete mode 100644 node_modules/lodash/_baseForOwn.js delete mode 100644 node_modules/lodash/_baseForOwnRight.js delete mode 100644 node_modules/lodash/_baseForRight.js delete mode 100644 node_modules/lodash/_baseFunctions.js delete mode 100644 node_modules/lodash/_baseGet.js delete mode 100644 node_modules/lodash/_baseGetAllKeys.js delete mode 100644 node_modules/lodash/_baseGetTag.js delete mode 100644 node_modules/lodash/_baseGt.js delete mode 100644 node_modules/lodash/_baseHas.js delete mode 100644 node_modules/lodash/_baseHasIn.js delete mode 100644 node_modules/lodash/_baseInRange.js delete mode 100644 node_modules/lodash/_baseIndexOf.js delete mode 100644 node_modules/lodash/_baseIndexOfWith.js delete mode 100644 node_modules/lodash/_baseIntersection.js delete mode 100644 node_modules/lodash/_baseInverter.js delete mode 100644 node_modules/lodash/_baseInvoke.js delete mode 100644 node_modules/lodash/_baseIsArguments.js delete mode 100644 node_modules/lodash/_baseIsArrayBuffer.js delete mode 100644 node_modules/lodash/_baseIsDate.js delete mode 100644 node_modules/lodash/_baseIsEqual.js delete mode 100644 node_modules/lodash/_baseIsEqualDeep.js delete mode 100644 node_modules/lodash/_baseIsMap.js delete mode 100644 node_modules/lodash/_baseIsMatch.js delete mode 100644 node_modules/lodash/_baseIsNaN.js delete mode 100644 node_modules/lodash/_baseIsNative.js delete mode 100644 node_modules/lodash/_baseIsRegExp.js delete mode 100644 node_modules/lodash/_baseIsSet.js delete mode 100644 node_modules/lodash/_baseIsTypedArray.js delete mode 100644 node_modules/lodash/_baseIteratee.js delete mode 100644 node_modules/lodash/_baseKeys.js delete mode 100644 node_modules/lodash/_baseKeysIn.js delete mode 100644 node_modules/lodash/_baseLodash.js delete mode 100644 node_modules/lodash/_baseLt.js delete mode 100644 node_modules/lodash/_baseMap.js delete mode 100644 node_modules/lodash/_baseMatches.js delete mode 100644 node_modules/lodash/_baseMatchesProperty.js delete mode 100644 node_modules/lodash/_baseMean.js delete mode 100644 node_modules/lodash/_baseMerge.js delete mode 100644 node_modules/lodash/_baseMergeDeep.js delete mode 100644 node_modules/lodash/_baseNth.js delete mode 100644 node_modules/lodash/_baseOrderBy.js delete mode 100644 node_modules/lodash/_basePick.js delete mode 100644 node_modules/lodash/_basePickBy.js delete mode 100644 node_modules/lodash/_baseProperty.js delete mode 100644 node_modules/lodash/_basePropertyDeep.js delete mode 100644 node_modules/lodash/_basePropertyOf.js delete mode 100644 node_modules/lodash/_basePullAll.js delete mode 100644 node_modules/lodash/_basePullAt.js delete mode 100644 node_modules/lodash/_baseRandom.js delete mode 100644 node_modules/lodash/_baseRange.js delete mode 100644 node_modules/lodash/_baseReduce.js delete mode 100644 node_modules/lodash/_baseRepeat.js delete mode 100644 node_modules/lodash/_baseRest.js delete mode 100644 node_modules/lodash/_baseSample.js delete mode 100644 node_modules/lodash/_baseSampleSize.js delete mode 100644 node_modules/lodash/_baseSet.js delete mode 100644 node_modules/lodash/_baseSetData.js delete mode 100644 node_modules/lodash/_baseSetToString.js delete mode 100644 node_modules/lodash/_baseShuffle.js delete mode 100644 node_modules/lodash/_baseSlice.js delete mode 100644 node_modules/lodash/_baseSome.js delete mode 100644 node_modules/lodash/_baseSortBy.js delete mode 100644 node_modules/lodash/_baseSortedIndex.js delete mode 100644 node_modules/lodash/_baseSortedIndexBy.js delete mode 100644 node_modules/lodash/_baseSortedUniq.js delete mode 100644 node_modules/lodash/_baseSum.js delete mode 100644 node_modules/lodash/_baseTimes.js delete mode 100644 node_modules/lodash/_baseToNumber.js delete mode 100644 node_modules/lodash/_baseToPairs.js delete mode 100644 node_modules/lodash/_baseToString.js delete mode 100644 node_modules/lodash/_baseTrim.js delete mode 100644 node_modules/lodash/_baseUnary.js delete mode 100644 node_modules/lodash/_baseUniq.js delete mode 100644 node_modules/lodash/_baseUnset.js delete mode 100644 node_modules/lodash/_baseUpdate.js delete mode 100644 node_modules/lodash/_baseValues.js delete mode 100644 node_modules/lodash/_baseWhile.js delete mode 100644 node_modules/lodash/_baseWrapperValue.js delete mode 100644 node_modules/lodash/_baseXor.js delete mode 100644 node_modules/lodash/_baseZipObject.js delete mode 100644 node_modules/lodash/_cacheHas.js delete mode 100644 node_modules/lodash/_castArrayLikeObject.js delete mode 100644 node_modules/lodash/_castFunction.js delete mode 100644 node_modules/lodash/_castPath.js delete mode 100644 node_modules/lodash/_castRest.js delete mode 100644 node_modules/lodash/_castSlice.js delete mode 100644 node_modules/lodash/_charsEndIndex.js delete mode 100644 node_modules/lodash/_charsStartIndex.js delete mode 100644 node_modules/lodash/_cloneArrayBuffer.js delete mode 100644 node_modules/lodash/_cloneBuffer.js delete mode 100644 node_modules/lodash/_cloneDataView.js delete mode 100644 node_modules/lodash/_cloneRegExp.js delete mode 100644 node_modules/lodash/_cloneSymbol.js delete mode 100644 node_modules/lodash/_cloneTypedArray.js delete mode 100644 node_modules/lodash/_compareAscending.js delete mode 100644 node_modules/lodash/_compareMultiple.js delete mode 100644 node_modules/lodash/_composeArgs.js delete mode 100644 node_modules/lodash/_composeArgsRight.js delete mode 100644 node_modules/lodash/_copyArray.js delete mode 100644 node_modules/lodash/_copyObject.js delete mode 100644 node_modules/lodash/_copySymbols.js delete mode 100644 node_modules/lodash/_copySymbolsIn.js delete mode 100644 node_modules/lodash/_coreJsData.js delete mode 100644 node_modules/lodash/_countHolders.js delete mode 100644 node_modules/lodash/_createAggregator.js delete mode 100644 node_modules/lodash/_createAssigner.js delete mode 100644 node_modules/lodash/_createBaseEach.js delete mode 100644 node_modules/lodash/_createBaseFor.js delete mode 100644 node_modules/lodash/_createBind.js delete mode 100644 node_modules/lodash/_createCaseFirst.js delete mode 100644 node_modules/lodash/_createCompounder.js delete mode 100644 node_modules/lodash/_createCtor.js delete mode 100644 node_modules/lodash/_createCurry.js delete mode 100644 node_modules/lodash/_createFind.js delete mode 100644 node_modules/lodash/_createFlow.js delete mode 100644 node_modules/lodash/_createHybrid.js delete mode 100644 node_modules/lodash/_createInverter.js delete mode 100644 node_modules/lodash/_createMathOperation.js delete mode 100644 node_modules/lodash/_createOver.js delete mode 100644 node_modules/lodash/_createPadding.js delete mode 100644 node_modules/lodash/_createPartial.js delete mode 100644 node_modules/lodash/_createRange.js delete mode 100644 node_modules/lodash/_createRecurry.js delete mode 100644 node_modules/lodash/_createRelationalOperation.js delete mode 100644 node_modules/lodash/_createRound.js delete mode 100644 node_modules/lodash/_createSet.js delete mode 100644 node_modules/lodash/_createToPairs.js delete mode 100644 node_modules/lodash/_createWrap.js delete mode 100644 node_modules/lodash/_customDefaultsAssignIn.js delete mode 100644 node_modules/lodash/_customDefaultsMerge.js delete mode 100644 node_modules/lodash/_customOmitClone.js delete mode 100644 node_modules/lodash/_deburrLetter.js delete mode 100644 node_modules/lodash/_defineProperty.js delete mode 100644 node_modules/lodash/_equalArrays.js delete mode 100644 node_modules/lodash/_equalByTag.js delete mode 100644 node_modules/lodash/_equalObjects.js delete mode 100644 node_modules/lodash/_escapeHtmlChar.js delete mode 100644 node_modules/lodash/_escapeStringChar.js delete mode 100644 node_modules/lodash/_flatRest.js delete mode 100644 node_modules/lodash/_freeGlobal.js delete mode 100644 node_modules/lodash/_getAllKeys.js delete mode 100644 node_modules/lodash/_getAllKeysIn.js delete mode 100644 node_modules/lodash/_getData.js delete mode 100644 node_modules/lodash/_getFuncName.js delete mode 100644 node_modules/lodash/_getHolder.js delete mode 100644 node_modules/lodash/_getMapData.js delete mode 100644 node_modules/lodash/_getMatchData.js delete mode 100644 node_modules/lodash/_getNative.js delete mode 100644 node_modules/lodash/_getPrototype.js delete mode 100644 node_modules/lodash/_getRawTag.js delete mode 100644 node_modules/lodash/_getSymbols.js delete mode 100644 node_modules/lodash/_getSymbolsIn.js delete mode 100644 node_modules/lodash/_getTag.js delete mode 100644 node_modules/lodash/_getValue.js delete mode 100644 node_modules/lodash/_getView.js delete mode 100644 node_modules/lodash/_getWrapDetails.js delete mode 100644 node_modules/lodash/_hasPath.js delete mode 100644 node_modules/lodash/_hasUnicode.js delete mode 100644 node_modules/lodash/_hasUnicodeWord.js delete mode 100644 node_modules/lodash/_hashClear.js delete mode 100644 node_modules/lodash/_hashDelete.js delete mode 100644 node_modules/lodash/_hashGet.js delete mode 100644 node_modules/lodash/_hashHas.js delete mode 100644 node_modules/lodash/_hashSet.js delete mode 100644 node_modules/lodash/_initCloneArray.js delete mode 100644 node_modules/lodash/_initCloneByTag.js delete mode 100644 node_modules/lodash/_initCloneObject.js delete mode 100644 node_modules/lodash/_insertWrapDetails.js delete mode 100644 node_modules/lodash/_isFlattenable.js delete mode 100644 node_modules/lodash/_isIndex.js delete mode 100644 node_modules/lodash/_isIterateeCall.js delete mode 100644 node_modules/lodash/_isKey.js delete mode 100644 node_modules/lodash/_isKeyable.js delete mode 100644 node_modules/lodash/_isLaziable.js delete mode 100644 node_modules/lodash/_isMaskable.js delete mode 100644 node_modules/lodash/_isMasked.js delete mode 100644 node_modules/lodash/_isPrototype.js delete mode 100644 node_modules/lodash/_isStrictComparable.js delete mode 100644 node_modules/lodash/_iteratorToArray.js delete mode 100644 node_modules/lodash/_lazyClone.js delete mode 100644 node_modules/lodash/_lazyReverse.js delete mode 100644 node_modules/lodash/_lazyValue.js delete mode 100644 node_modules/lodash/_listCacheClear.js delete mode 100644 node_modules/lodash/_listCacheDelete.js delete mode 100644 node_modules/lodash/_listCacheGet.js delete mode 100644 node_modules/lodash/_listCacheHas.js delete mode 100644 node_modules/lodash/_listCacheSet.js delete mode 100644 node_modules/lodash/_mapCacheClear.js delete mode 100644 node_modules/lodash/_mapCacheDelete.js delete mode 100644 node_modules/lodash/_mapCacheGet.js delete mode 100644 node_modules/lodash/_mapCacheHas.js delete mode 100644 node_modules/lodash/_mapCacheSet.js delete mode 100644 node_modules/lodash/_mapToArray.js delete mode 100644 node_modules/lodash/_matchesStrictComparable.js delete mode 100644 node_modules/lodash/_memoizeCapped.js delete mode 100644 node_modules/lodash/_mergeData.js delete mode 100644 node_modules/lodash/_metaMap.js delete mode 100644 node_modules/lodash/_nativeCreate.js delete mode 100644 node_modules/lodash/_nativeKeys.js delete mode 100644 node_modules/lodash/_nativeKeysIn.js delete mode 100644 node_modules/lodash/_nodeUtil.js delete mode 100644 node_modules/lodash/_objectToString.js delete mode 100644 node_modules/lodash/_overArg.js delete mode 100644 node_modules/lodash/_overRest.js delete mode 100644 node_modules/lodash/_parent.js delete mode 100644 node_modules/lodash/_reEscape.js delete mode 100644 node_modules/lodash/_reEvaluate.js delete mode 100644 node_modules/lodash/_reInterpolate.js delete mode 100644 node_modules/lodash/_realNames.js delete mode 100644 node_modules/lodash/_reorder.js delete mode 100644 node_modules/lodash/_replaceHolders.js delete mode 100644 node_modules/lodash/_root.js delete mode 100644 node_modules/lodash/_safeGet.js delete mode 100644 node_modules/lodash/_setCacheAdd.js delete mode 100644 node_modules/lodash/_setCacheHas.js delete mode 100644 node_modules/lodash/_setData.js delete mode 100644 node_modules/lodash/_setToArray.js delete mode 100644 node_modules/lodash/_setToPairs.js delete mode 100644 node_modules/lodash/_setToString.js delete mode 100644 node_modules/lodash/_setWrapToString.js delete mode 100644 node_modules/lodash/_shortOut.js delete mode 100644 node_modules/lodash/_shuffleSelf.js delete mode 100644 node_modules/lodash/_stackClear.js delete mode 100644 node_modules/lodash/_stackDelete.js delete mode 100644 node_modules/lodash/_stackGet.js delete mode 100644 node_modules/lodash/_stackHas.js delete mode 100644 node_modules/lodash/_stackSet.js delete mode 100644 node_modules/lodash/_strictIndexOf.js delete mode 100644 node_modules/lodash/_strictLastIndexOf.js delete mode 100644 node_modules/lodash/_stringSize.js delete mode 100644 node_modules/lodash/_stringToArray.js delete mode 100644 node_modules/lodash/_stringToPath.js delete mode 100644 node_modules/lodash/_toKey.js delete mode 100644 node_modules/lodash/_toSource.js delete mode 100644 node_modules/lodash/_trimmedEndIndex.js delete mode 100644 node_modules/lodash/_unescapeHtmlChar.js delete mode 100644 node_modules/lodash/_unicodeSize.js delete mode 100644 node_modules/lodash/_unicodeToArray.js delete mode 100644 node_modules/lodash/_unicodeWords.js delete mode 100644 node_modules/lodash/_updateWrapDetails.js delete mode 100644 node_modules/lodash/_wrapperClone.js delete mode 100644 node_modules/lodash/add.js delete mode 100644 node_modules/lodash/after.js delete mode 100644 node_modules/lodash/array.js delete mode 100644 node_modules/lodash/ary.js delete mode 100644 node_modules/lodash/assign.js delete mode 100644 node_modules/lodash/assignIn.js delete mode 100644 node_modules/lodash/assignInWith.js delete mode 100644 node_modules/lodash/assignWith.js delete mode 100644 node_modules/lodash/at.js delete mode 100644 node_modules/lodash/attempt.js delete mode 100644 node_modules/lodash/before.js delete mode 100644 node_modules/lodash/bind.js delete mode 100644 node_modules/lodash/bindAll.js delete mode 100644 node_modules/lodash/bindKey.js delete mode 100644 node_modules/lodash/camelCase.js delete mode 100644 node_modules/lodash/capitalize.js delete mode 100644 node_modules/lodash/castArray.js delete mode 100644 node_modules/lodash/ceil.js delete mode 100644 node_modules/lodash/chain.js delete mode 100644 node_modules/lodash/chunk.js delete mode 100644 node_modules/lodash/clamp.js delete mode 100644 node_modules/lodash/clone.js delete mode 100644 node_modules/lodash/cloneDeep.js delete mode 100644 node_modules/lodash/cloneDeepWith.js delete mode 100644 node_modules/lodash/cloneWith.js delete mode 100644 node_modules/lodash/collection.js delete mode 100644 node_modules/lodash/commit.js delete mode 100644 node_modules/lodash/compact.js delete mode 100644 node_modules/lodash/concat.js delete mode 100644 node_modules/lodash/cond.js delete mode 100644 node_modules/lodash/conforms.js delete mode 100644 node_modules/lodash/conformsTo.js delete mode 100644 node_modules/lodash/constant.js delete mode 100644 node_modules/lodash/core.js delete mode 100644 node_modules/lodash/core.min.js delete mode 100644 node_modules/lodash/countBy.js delete mode 100644 node_modules/lodash/create.js delete mode 100644 node_modules/lodash/curry.js delete mode 100644 node_modules/lodash/curryRight.js delete mode 100644 node_modules/lodash/date.js delete mode 100644 node_modules/lodash/debounce.js delete mode 100644 node_modules/lodash/deburr.js delete mode 100644 node_modules/lodash/defaultTo.js delete mode 100644 node_modules/lodash/defaults.js delete mode 100644 node_modules/lodash/defaultsDeep.js delete mode 100644 node_modules/lodash/defer.js delete mode 100644 node_modules/lodash/delay.js delete mode 100644 node_modules/lodash/difference.js delete mode 100644 node_modules/lodash/differenceBy.js delete mode 100644 node_modules/lodash/differenceWith.js delete mode 100644 node_modules/lodash/divide.js delete mode 100644 node_modules/lodash/drop.js delete mode 100644 node_modules/lodash/dropRight.js delete mode 100644 node_modules/lodash/dropRightWhile.js delete mode 100644 node_modules/lodash/dropWhile.js delete mode 100644 node_modules/lodash/each.js delete mode 100644 node_modules/lodash/eachRight.js delete mode 100644 node_modules/lodash/endsWith.js delete mode 100644 node_modules/lodash/entries.js delete mode 100644 node_modules/lodash/entriesIn.js delete mode 100644 node_modules/lodash/eq.js delete mode 100644 node_modules/lodash/escape.js delete mode 100644 node_modules/lodash/escapeRegExp.js delete mode 100644 node_modules/lodash/every.js delete mode 100644 node_modules/lodash/extend.js delete mode 100644 node_modules/lodash/extendWith.js delete mode 100644 node_modules/lodash/fill.js delete mode 100644 node_modules/lodash/filter.js delete mode 100644 node_modules/lodash/find.js delete mode 100644 node_modules/lodash/findIndex.js delete mode 100644 node_modules/lodash/findKey.js delete mode 100644 node_modules/lodash/findLast.js delete mode 100644 node_modules/lodash/findLastIndex.js delete mode 100644 node_modules/lodash/findLastKey.js delete mode 100644 node_modules/lodash/first.js delete mode 100644 node_modules/lodash/flake.lock delete mode 100644 node_modules/lodash/flake.nix delete mode 100644 node_modules/lodash/flatMap.js delete mode 100644 node_modules/lodash/flatMapDeep.js delete mode 100644 node_modules/lodash/flatMapDepth.js delete mode 100644 node_modules/lodash/flatten.js delete mode 100644 node_modules/lodash/flattenDeep.js delete mode 100644 node_modules/lodash/flattenDepth.js delete mode 100644 node_modules/lodash/flip.js delete mode 100644 node_modules/lodash/floor.js delete mode 100644 node_modules/lodash/flow.js delete mode 100644 node_modules/lodash/flowRight.js delete mode 100644 node_modules/lodash/forEach.js delete mode 100644 node_modules/lodash/forEachRight.js delete mode 100644 node_modules/lodash/forIn.js delete mode 100644 node_modules/lodash/forInRight.js delete mode 100644 node_modules/lodash/forOwn.js delete mode 100644 node_modules/lodash/forOwnRight.js delete mode 100644 node_modules/lodash/fp.js delete mode 100644 node_modules/lodash/fp/F.js delete mode 100644 node_modules/lodash/fp/T.js delete mode 100644 node_modules/lodash/fp/__.js delete mode 100644 node_modules/lodash/fp/_baseConvert.js delete mode 100644 node_modules/lodash/fp/_convertBrowser.js delete mode 100644 node_modules/lodash/fp/_falseOptions.js delete mode 100644 node_modules/lodash/fp/_mapping.js delete mode 100644 node_modules/lodash/fp/_util.js delete mode 100644 node_modules/lodash/fp/add.js delete mode 100644 node_modules/lodash/fp/after.js delete mode 100644 node_modules/lodash/fp/all.js delete mode 100644 node_modules/lodash/fp/allPass.js delete mode 100644 node_modules/lodash/fp/always.js delete mode 100644 node_modules/lodash/fp/any.js delete mode 100644 node_modules/lodash/fp/anyPass.js delete mode 100644 node_modules/lodash/fp/apply.js delete mode 100644 node_modules/lodash/fp/array.js delete mode 100644 node_modules/lodash/fp/ary.js delete mode 100644 node_modules/lodash/fp/assign.js delete mode 100644 node_modules/lodash/fp/assignAll.js delete mode 100644 node_modules/lodash/fp/assignAllWith.js delete mode 100644 node_modules/lodash/fp/assignIn.js delete mode 100644 node_modules/lodash/fp/assignInAll.js delete mode 100644 node_modules/lodash/fp/assignInAllWith.js delete mode 100644 node_modules/lodash/fp/assignInWith.js delete mode 100644 node_modules/lodash/fp/assignWith.js delete mode 100644 node_modules/lodash/fp/assoc.js delete mode 100644 node_modules/lodash/fp/assocPath.js delete mode 100644 node_modules/lodash/fp/at.js delete mode 100644 node_modules/lodash/fp/attempt.js delete mode 100644 node_modules/lodash/fp/before.js delete mode 100644 node_modules/lodash/fp/bind.js delete mode 100644 node_modules/lodash/fp/bindAll.js delete mode 100644 node_modules/lodash/fp/bindKey.js delete mode 100644 node_modules/lodash/fp/camelCase.js delete mode 100644 node_modules/lodash/fp/capitalize.js delete mode 100644 node_modules/lodash/fp/castArray.js delete mode 100644 node_modules/lodash/fp/ceil.js delete mode 100644 node_modules/lodash/fp/chain.js delete mode 100644 node_modules/lodash/fp/chunk.js delete mode 100644 node_modules/lodash/fp/clamp.js delete mode 100644 node_modules/lodash/fp/clone.js delete mode 100644 node_modules/lodash/fp/cloneDeep.js delete mode 100644 node_modules/lodash/fp/cloneDeepWith.js delete mode 100644 node_modules/lodash/fp/cloneWith.js delete mode 100644 node_modules/lodash/fp/collection.js delete mode 100644 node_modules/lodash/fp/commit.js delete mode 100644 node_modules/lodash/fp/compact.js delete mode 100644 node_modules/lodash/fp/complement.js delete mode 100644 node_modules/lodash/fp/compose.js delete mode 100644 node_modules/lodash/fp/concat.js delete mode 100644 node_modules/lodash/fp/cond.js delete mode 100644 node_modules/lodash/fp/conforms.js delete mode 100644 node_modules/lodash/fp/conformsTo.js delete mode 100644 node_modules/lodash/fp/constant.js delete mode 100644 node_modules/lodash/fp/contains.js delete mode 100644 node_modules/lodash/fp/convert.js delete mode 100644 node_modules/lodash/fp/countBy.js delete mode 100644 node_modules/lodash/fp/create.js delete mode 100644 node_modules/lodash/fp/curry.js delete mode 100644 node_modules/lodash/fp/curryN.js delete mode 100644 node_modules/lodash/fp/curryRight.js delete mode 100644 node_modules/lodash/fp/curryRightN.js delete mode 100644 node_modules/lodash/fp/date.js delete mode 100644 node_modules/lodash/fp/debounce.js delete mode 100644 node_modules/lodash/fp/deburr.js delete mode 100644 node_modules/lodash/fp/defaultTo.js delete mode 100644 node_modules/lodash/fp/defaults.js delete mode 100644 node_modules/lodash/fp/defaultsAll.js delete mode 100644 node_modules/lodash/fp/defaultsDeep.js delete mode 100644 node_modules/lodash/fp/defaultsDeepAll.js delete mode 100644 node_modules/lodash/fp/defer.js delete mode 100644 node_modules/lodash/fp/delay.js delete mode 100644 node_modules/lodash/fp/difference.js delete mode 100644 node_modules/lodash/fp/differenceBy.js delete mode 100644 node_modules/lodash/fp/differenceWith.js delete mode 100644 node_modules/lodash/fp/dissoc.js delete mode 100644 node_modules/lodash/fp/dissocPath.js delete mode 100644 node_modules/lodash/fp/divide.js delete mode 100644 node_modules/lodash/fp/drop.js delete mode 100644 node_modules/lodash/fp/dropLast.js delete mode 100644 node_modules/lodash/fp/dropLastWhile.js delete mode 100644 node_modules/lodash/fp/dropRight.js delete mode 100644 node_modules/lodash/fp/dropRightWhile.js delete mode 100644 node_modules/lodash/fp/dropWhile.js delete mode 100644 node_modules/lodash/fp/each.js delete mode 100644 node_modules/lodash/fp/eachRight.js delete mode 100644 node_modules/lodash/fp/endsWith.js delete mode 100644 node_modules/lodash/fp/entries.js delete mode 100644 node_modules/lodash/fp/entriesIn.js delete mode 100644 node_modules/lodash/fp/eq.js delete mode 100644 node_modules/lodash/fp/equals.js delete mode 100644 node_modules/lodash/fp/escape.js delete mode 100644 node_modules/lodash/fp/escapeRegExp.js delete mode 100644 node_modules/lodash/fp/every.js delete mode 100644 node_modules/lodash/fp/extend.js delete mode 100644 node_modules/lodash/fp/extendAll.js delete mode 100644 node_modules/lodash/fp/extendAllWith.js delete mode 100644 node_modules/lodash/fp/extendWith.js delete mode 100644 node_modules/lodash/fp/fill.js delete mode 100644 node_modules/lodash/fp/filter.js delete mode 100644 node_modules/lodash/fp/find.js delete mode 100644 node_modules/lodash/fp/findFrom.js delete mode 100644 node_modules/lodash/fp/findIndex.js delete mode 100644 node_modules/lodash/fp/findIndexFrom.js delete mode 100644 node_modules/lodash/fp/findKey.js delete mode 100644 node_modules/lodash/fp/findLast.js delete mode 100644 node_modules/lodash/fp/findLastFrom.js delete mode 100644 node_modules/lodash/fp/findLastIndex.js delete mode 100644 node_modules/lodash/fp/findLastIndexFrom.js delete mode 100644 node_modules/lodash/fp/findLastKey.js delete mode 100644 node_modules/lodash/fp/first.js delete mode 100644 node_modules/lodash/fp/flatMap.js delete mode 100644 node_modules/lodash/fp/flatMapDeep.js delete mode 100644 node_modules/lodash/fp/flatMapDepth.js delete mode 100644 node_modules/lodash/fp/flatten.js delete mode 100644 node_modules/lodash/fp/flattenDeep.js delete mode 100644 node_modules/lodash/fp/flattenDepth.js delete mode 100644 node_modules/lodash/fp/flip.js delete mode 100644 node_modules/lodash/fp/floor.js delete mode 100644 node_modules/lodash/fp/flow.js delete mode 100644 node_modules/lodash/fp/flowRight.js delete mode 100644 node_modules/lodash/fp/forEach.js delete mode 100644 node_modules/lodash/fp/forEachRight.js delete mode 100644 node_modules/lodash/fp/forIn.js delete mode 100644 node_modules/lodash/fp/forInRight.js delete mode 100644 node_modules/lodash/fp/forOwn.js delete mode 100644 node_modules/lodash/fp/forOwnRight.js delete mode 100644 node_modules/lodash/fp/fromPairs.js delete mode 100644 node_modules/lodash/fp/function.js delete mode 100644 node_modules/lodash/fp/functions.js delete mode 100644 node_modules/lodash/fp/functionsIn.js delete mode 100644 node_modules/lodash/fp/get.js delete mode 100644 node_modules/lodash/fp/getOr.js delete mode 100644 node_modules/lodash/fp/groupBy.js delete mode 100644 node_modules/lodash/fp/gt.js delete mode 100644 node_modules/lodash/fp/gte.js delete mode 100644 node_modules/lodash/fp/has.js delete mode 100644 node_modules/lodash/fp/hasIn.js delete mode 100644 node_modules/lodash/fp/head.js delete mode 100644 node_modules/lodash/fp/identical.js delete mode 100644 node_modules/lodash/fp/identity.js delete mode 100644 node_modules/lodash/fp/inRange.js delete mode 100644 node_modules/lodash/fp/includes.js delete mode 100644 node_modules/lodash/fp/includesFrom.js delete mode 100644 node_modules/lodash/fp/indexBy.js delete mode 100644 node_modules/lodash/fp/indexOf.js delete mode 100644 node_modules/lodash/fp/indexOfFrom.js delete mode 100644 node_modules/lodash/fp/init.js delete mode 100644 node_modules/lodash/fp/initial.js delete mode 100644 node_modules/lodash/fp/intersection.js delete mode 100644 node_modules/lodash/fp/intersectionBy.js delete mode 100644 node_modules/lodash/fp/intersectionWith.js delete mode 100644 node_modules/lodash/fp/invert.js delete mode 100644 node_modules/lodash/fp/invertBy.js delete mode 100644 node_modules/lodash/fp/invertObj.js delete mode 100644 node_modules/lodash/fp/invoke.js delete mode 100644 node_modules/lodash/fp/invokeArgs.js delete mode 100644 node_modules/lodash/fp/invokeArgsMap.js delete mode 100644 node_modules/lodash/fp/invokeMap.js delete mode 100644 node_modules/lodash/fp/isArguments.js delete mode 100644 node_modules/lodash/fp/isArray.js delete mode 100644 node_modules/lodash/fp/isArrayBuffer.js delete mode 100644 node_modules/lodash/fp/isArrayLike.js delete mode 100644 node_modules/lodash/fp/isArrayLikeObject.js delete mode 100644 node_modules/lodash/fp/isBoolean.js delete mode 100644 node_modules/lodash/fp/isBuffer.js delete mode 100644 node_modules/lodash/fp/isDate.js delete mode 100644 node_modules/lodash/fp/isElement.js delete mode 100644 node_modules/lodash/fp/isEmpty.js delete mode 100644 node_modules/lodash/fp/isEqual.js delete mode 100644 node_modules/lodash/fp/isEqualWith.js delete mode 100644 node_modules/lodash/fp/isError.js delete mode 100644 node_modules/lodash/fp/isFinite.js delete mode 100644 node_modules/lodash/fp/isFunction.js delete mode 100644 node_modules/lodash/fp/isInteger.js delete mode 100644 node_modules/lodash/fp/isLength.js delete mode 100644 node_modules/lodash/fp/isMap.js delete mode 100644 node_modules/lodash/fp/isMatch.js delete mode 100644 node_modules/lodash/fp/isMatchWith.js delete mode 100644 node_modules/lodash/fp/isNaN.js delete mode 100644 node_modules/lodash/fp/isNative.js delete mode 100644 node_modules/lodash/fp/isNil.js delete mode 100644 node_modules/lodash/fp/isNull.js delete mode 100644 node_modules/lodash/fp/isNumber.js delete mode 100644 node_modules/lodash/fp/isObject.js delete mode 100644 node_modules/lodash/fp/isObjectLike.js delete mode 100644 node_modules/lodash/fp/isPlainObject.js delete mode 100644 node_modules/lodash/fp/isRegExp.js delete mode 100644 node_modules/lodash/fp/isSafeInteger.js delete mode 100644 node_modules/lodash/fp/isSet.js delete mode 100644 node_modules/lodash/fp/isString.js delete mode 100644 node_modules/lodash/fp/isSymbol.js delete mode 100644 node_modules/lodash/fp/isTypedArray.js delete mode 100644 node_modules/lodash/fp/isUndefined.js delete mode 100644 node_modules/lodash/fp/isWeakMap.js delete mode 100644 node_modules/lodash/fp/isWeakSet.js delete mode 100644 node_modules/lodash/fp/iteratee.js delete mode 100644 node_modules/lodash/fp/join.js delete mode 100644 node_modules/lodash/fp/juxt.js delete mode 100644 node_modules/lodash/fp/kebabCase.js delete mode 100644 node_modules/lodash/fp/keyBy.js delete mode 100644 node_modules/lodash/fp/keys.js delete mode 100644 node_modules/lodash/fp/keysIn.js delete mode 100644 node_modules/lodash/fp/lang.js delete mode 100644 node_modules/lodash/fp/last.js delete mode 100644 node_modules/lodash/fp/lastIndexOf.js delete mode 100644 node_modules/lodash/fp/lastIndexOfFrom.js delete mode 100644 node_modules/lodash/fp/lowerCase.js delete mode 100644 node_modules/lodash/fp/lowerFirst.js delete mode 100644 node_modules/lodash/fp/lt.js delete mode 100644 node_modules/lodash/fp/lte.js delete mode 100644 node_modules/lodash/fp/map.js delete mode 100644 node_modules/lodash/fp/mapKeys.js delete mode 100644 node_modules/lodash/fp/mapValues.js delete mode 100644 node_modules/lodash/fp/matches.js delete mode 100644 node_modules/lodash/fp/matchesProperty.js delete mode 100644 node_modules/lodash/fp/math.js delete mode 100644 node_modules/lodash/fp/max.js delete mode 100644 node_modules/lodash/fp/maxBy.js delete mode 100644 node_modules/lodash/fp/mean.js delete mode 100644 node_modules/lodash/fp/meanBy.js delete mode 100644 node_modules/lodash/fp/memoize.js delete mode 100644 node_modules/lodash/fp/merge.js delete mode 100644 node_modules/lodash/fp/mergeAll.js delete mode 100644 node_modules/lodash/fp/mergeAllWith.js delete mode 100644 node_modules/lodash/fp/mergeWith.js delete mode 100644 node_modules/lodash/fp/method.js delete mode 100644 node_modules/lodash/fp/methodOf.js delete mode 100644 node_modules/lodash/fp/min.js delete mode 100644 node_modules/lodash/fp/minBy.js delete mode 100644 node_modules/lodash/fp/mixin.js delete mode 100644 node_modules/lodash/fp/multiply.js delete mode 100644 node_modules/lodash/fp/nAry.js delete mode 100644 node_modules/lodash/fp/negate.js delete mode 100644 node_modules/lodash/fp/next.js delete mode 100644 node_modules/lodash/fp/noop.js delete mode 100644 node_modules/lodash/fp/now.js delete mode 100644 node_modules/lodash/fp/nth.js delete mode 100644 node_modules/lodash/fp/nthArg.js delete mode 100644 node_modules/lodash/fp/number.js delete mode 100644 node_modules/lodash/fp/object.js delete mode 100644 node_modules/lodash/fp/omit.js delete mode 100644 node_modules/lodash/fp/omitAll.js delete mode 100644 node_modules/lodash/fp/omitBy.js delete mode 100644 node_modules/lodash/fp/once.js delete mode 100644 node_modules/lodash/fp/orderBy.js delete mode 100644 node_modules/lodash/fp/over.js delete mode 100644 node_modules/lodash/fp/overArgs.js delete mode 100644 node_modules/lodash/fp/overEvery.js delete mode 100644 node_modules/lodash/fp/overSome.js delete mode 100644 node_modules/lodash/fp/pad.js delete mode 100644 node_modules/lodash/fp/padChars.js delete mode 100644 node_modules/lodash/fp/padCharsEnd.js delete mode 100644 node_modules/lodash/fp/padCharsStart.js delete mode 100644 node_modules/lodash/fp/padEnd.js delete mode 100644 node_modules/lodash/fp/padStart.js delete mode 100644 node_modules/lodash/fp/parseInt.js delete mode 100644 node_modules/lodash/fp/partial.js delete mode 100644 node_modules/lodash/fp/partialRight.js delete mode 100644 node_modules/lodash/fp/partition.js delete mode 100644 node_modules/lodash/fp/path.js delete mode 100644 node_modules/lodash/fp/pathEq.js delete mode 100644 node_modules/lodash/fp/pathOr.js delete mode 100644 node_modules/lodash/fp/paths.js delete mode 100644 node_modules/lodash/fp/pick.js delete mode 100644 node_modules/lodash/fp/pickAll.js delete mode 100644 node_modules/lodash/fp/pickBy.js delete mode 100644 node_modules/lodash/fp/pipe.js delete mode 100644 node_modules/lodash/fp/placeholder.js delete mode 100644 node_modules/lodash/fp/plant.js delete mode 100644 node_modules/lodash/fp/pluck.js delete mode 100644 node_modules/lodash/fp/prop.js delete mode 100644 node_modules/lodash/fp/propEq.js delete mode 100644 node_modules/lodash/fp/propOr.js delete mode 100644 node_modules/lodash/fp/property.js delete mode 100644 node_modules/lodash/fp/propertyOf.js delete mode 100644 node_modules/lodash/fp/props.js delete mode 100644 node_modules/lodash/fp/pull.js delete mode 100644 node_modules/lodash/fp/pullAll.js delete mode 100644 node_modules/lodash/fp/pullAllBy.js delete mode 100644 node_modules/lodash/fp/pullAllWith.js delete mode 100644 node_modules/lodash/fp/pullAt.js delete mode 100644 node_modules/lodash/fp/random.js delete mode 100644 node_modules/lodash/fp/range.js delete mode 100644 node_modules/lodash/fp/rangeRight.js delete mode 100644 node_modules/lodash/fp/rangeStep.js delete mode 100644 node_modules/lodash/fp/rangeStepRight.js delete mode 100644 node_modules/lodash/fp/rearg.js delete mode 100644 node_modules/lodash/fp/reduce.js delete mode 100644 node_modules/lodash/fp/reduceRight.js delete mode 100644 node_modules/lodash/fp/reject.js delete mode 100644 node_modules/lodash/fp/remove.js delete mode 100644 node_modules/lodash/fp/repeat.js delete mode 100644 node_modules/lodash/fp/replace.js delete mode 100644 node_modules/lodash/fp/rest.js delete mode 100644 node_modules/lodash/fp/restFrom.js delete mode 100644 node_modules/lodash/fp/result.js delete mode 100644 node_modules/lodash/fp/reverse.js delete mode 100644 node_modules/lodash/fp/round.js delete mode 100644 node_modules/lodash/fp/sample.js delete mode 100644 node_modules/lodash/fp/sampleSize.js delete mode 100644 node_modules/lodash/fp/seq.js delete mode 100644 node_modules/lodash/fp/set.js delete mode 100644 node_modules/lodash/fp/setWith.js delete mode 100644 node_modules/lodash/fp/shuffle.js delete mode 100644 node_modules/lodash/fp/size.js delete mode 100644 node_modules/lodash/fp/slice.js delete mode 100644 node_modules/lodash/fp/snakeCase.js delete mode 100644 node_modules/lodash/fp/some.js delete mode 100644 node_modules/lodash/fp/sortBy.js delete mode 100644 node_modules/lodash/fp/sortedIndex.js delete mode 100644 node_modules/lodash/fp/sortedIndexBy.js delete mode 100644 node_modules/lodash/fp/sortedIndexOf.js delete mode 100644 node_modules/lodash/fp/sortedLastIndex.js delete mode 100644 node_modules/lodash/fp/sortedLastIndexBy.js delete mode 100644 node_modules/lodash/fp/sortedLastIndexOf.js delete mode 100644 node_modules/lodash/fp/sortedUniq.js delete mode 100644 node_modules/lodash/fp/sortedUniqBy.js delete mode 100644 node_modules/lodash/fp/split.js delete mode 100644 node_modules/lodash/fp/spread.js delete mode 100644 node_modules/lodash/fp/spreadFrom.js delete mode 100644 node_modules/lodash/fp/startCase.js delete mode 100644 node_modules/lodash/fp/startsWith.js delete mode 100644 node_modules/lodash/fp/string.js delete mode 100644 node_modules/lodash/fp/stubArray.js delete mode 100644 node_modules/lodash/fp/stubFalse.js delete mode 100644 node_modules/lodash/fp/stubObject.js delete mode 100644 node_modules/lodash/fp/stubString.js delete mode 100644 node_modules/lodash/fp/stubTrue.js delete mode 100644 node_modules/lodash/fp/subtract.js delete mode 100644 node_modules/lodash/fp/sum.js delete mode 100644 node_modules/lodash/fp/sumBy.js delete mode 100644 node_modules/lodash/fp/symmetricDifference.js delete mode 100644 node_modules/lodash/fp/symmetricDifferenceBy.js delete mode 100644 node_modules/lodash/fp/symmetricDifferenceWith.js delete mode 100644 node_modules/lodash/fp/tail.js delete mode 100644 node_modules/lodash/fp/take.js delete mode 100644 node_modules/lodash/fp/takeLast.js delete mode 100644 node_modules/lodash/fp/takeLastWhile.js delete mode 100644 node_modules/lodash/fp/takeRight.js delete mode 100644 node_modules/lodash/fp/takeRightWhile.js delete mode 100644 node_modules/lodash/fp/takeWhile.js delete mode 100644 node_modules/lodash/fp/tap.js delete mode 100644 node_modules/lodash/fp/template.js delete mode 100644 node_modules/lodash/fp/templateSettings.js delete mode 100644 node_modules/lodash/fp/throttle.js delete mode 100644 node_modules/lodash/fp/thru.js delete mode 100644 node_modules/lodash/fp/times.js delete mode 100644 node_modules/lodash/fp/toArray.js delete mode 100644 node_modules/lodash/fp/toFinite.js delete mode 100644 node_modules/lodash/fp/toInteger.js delete mode 100644 node_modules/lodash/fp/toIterator.js delete mode 100644 node_modules/lodash/fp/toJSON.js delete mode 100644 node_modules/lodash/fp/toLength.js delete mode 100644 node_modules/lodash/fp/toLower.js delete mode 100644 node_modules/lodash/fp/toNumber.js delete mode 100644 node_modules/lodash/fp/toPairs.js delete mode 100644 node_modules/lodash/fp/toPairsIn.js delete mode 100644 node_modules/lodash/fp/toPath.js delete mode 100644 node_modules/lodash/fp/toPlainObject.js delete mode 100644 node_modules/lodash/fp/toSafeInteger.js delete mode 100644 node_modules/lodash/fp/toString.js delete mode 100644 node_modules/lodash/fp/toUpper.js delete mode 100644 node_modules/lodash/fp/transform.js delete mode 100644 node_modules/lodash/fp/trim.js delete mode 100644 node_modules/lodash/fp/trimChars.js delete mode 100644 node_modules/lodash/fp/trimCharsEnd.js delete mode 100644 node_modules/lodash/fp/trimCharsStart.js delete mode 100644 node_modules/lodash/fp/trimEnd.js delete mode 100644 node_modules/lodash/fp/trimStart.js delete mode 100644 node_modules/lodash/fp/truncate.js delete mode 100644 node_modules/lodash/fp/unapply.js delete mode 100644 node_modules/lodash/fp/unary.js delete mode 100644 node_modules/lodash/fp/unescape.js delete mode 100644 node_modules/lodash/fp/union.js delete mode 100644 node_modules/lodash/fp/unionBy.js delete mode 100644 node_modules/lodash/fp/unionWith.js delete mode 100644 node_modules/lodash/fp/uniq.js delete mode 100644 node_modules/lodash/fp/uniqBy.js delete mode 100644 node_modules/lodash/fp/uniqWith.js delete mode 100644 node_modules/lodash/fp/uniqueId.js delete mode 100644 node_modules/lodash/fp/unnest.js delete mode 100644 node_modules/lodash/fp/unset.js delete mode 100644 node_modules/lodash/fp/unzip.js delete mode 100644 node_modules/lodash/fp/unzipWith.js delete mode 100644 node_modules/lodash/fp/update.js delete mode 100644 node_modules/lodash/fp/updateWith.js delete mode 100644 node_modules/lodash/fp/upperCase.js delete mode 100644 node_modules/lodash/fp/upperFirst.js delete mode 100644 node_modules/lodash/fp/useWith.js delete mode 100644 node_modules/lodash/fp/util.js delete mode 100644 node_modules/lodash/fp/value.js delete mode 100644 node_modules/lodash/fp/valueOf.js delete mode 100644 node_modules/lodash/fp/values.js delete mode 100644 node_modules/lodash/fp/valuesIn.js delete mode 100644 node_modules/lodash/fp/where.js delete mode 100644 node_modules/lodash/fp/whereEq.js delete mode 100644 node_modules/lodash/fp/without.js delete mode 100644 node_modules/lodash/fp/words.js delete mode 100644 node_modules/lodash/fp/wrap.js delete mode 100644 node_modules/lodash/fp/wrapperAt.js delete mode 100644 node_modules/lodash/fp/wrapperChain.js delete mode 100644 node_modules/lodash/fp/wrapperLodash.js delete mode 100644 node_modules/lodash/fp/wrapperReverse.js delete mode 100644 node_modules/lodash/fp/wrapperValue.js delete mode 100644 node_modules/lodash/fp/xor.js delete mode 100644 node_modules/lodash/fp/xorBy.js delete mode 100644 node_modules/lodash/fp/xorWith.js delete mode 100644 node_modules/lodash/fp/zip.js delete mode 100644 node_modules/lodash/fp/zipAll.js delete mode 100644 node_modules/lodash/fp/zipObj.js delete mode 100644 node_modules/lodash/fp/zipObject.js delete mode 100644 node_modules/lodash/fp/zipObjectDeep.js delete mode 100644 node_modules/lodash/fp/zipWith.js delete mode 100644 node_modules/lodash/fromPairs.js delete mode 100644 node_modules/lodash/function.js delete mode 100644 node_modules/lodash/functions.js delete mode 100644 node_modules/lodash/functionsIn.js delete mode 100644 node_modules/lodash/get.js delete mode 100644 node_modules/lodash/groupBy.js delete mode 100644 node_modules/lodash/gt.js delete mode 100644 node_modules/lodash/gte.js delete mode 100644 node_modules/lodash/has.js delete mode 100644 node_modules/lodash/hasIn.js delete mode 100644 node_modules/lodash/head.js delete mode 100644 node_modules/lodash/identity.js delete mode 100644 node_modules/lodash/inRange.js delete mode 100644 node_modules/lodash/includes.js delete mode 100644 node_modules/lodash/index.js delete mode 100644 node_modules/lodash/indexOf.js delete mode 100644 node_modules/lodash/initial.js delete mode 100644 node_modules/lodash/intersection.js delete mode 100644 node_modules/lodash/intersectionBy.js delete mode 100644 node_modules/lodash/intersectionWith.js delete mode 100644 node_modules/lodash/invert.js delete mode 100644 node_modules/lodash/invertBy.js delete mode 100644 node_modules/lodash/invoke.js delete mode 100644 node_modules/lodash/invokeMap.js delete mode 100644 node_modules/lodash/isArguments.js delete mode 100644 node_modules/lodash/isArray.js delete mode 100644 node_modules/lodash/isArrayBuffer.js delete mode 100644 node_modules/lodash/isArrayLike.js delete mode 100644 node_modules/lodash/isArrayLikeObject.js delete mode 100644 node_modules/lodash/isBoolean.js delete mode 100644 node_modules/lodash/isBuffer.js delete mode 100644 node_modules/lodash/isDate.js delete mode 100644 node_modules/lodash/isElement.js delete mode 100644 node_modules/lodash/isEmpty.js delete mode 100644 node_modules/lodash/isEqual.js delete mode 100644 node_modules/lodash/isEqualWith.js delete mode 100644 node_modules/lodash/isError.js delete mode 100644 node_modules/lodash/isFinite.js delete mode 100644 node_modules/lodash/isFunction.js delete mode 100644 node_modules/lodash/isInteger.js delete mode 100644 node_modules/lodash/isLength.js delete mode 100644 node_modules/lodash/isMap.js delete mode 100644 node_modules/lodash/isMatch.js delete mode 100644 node_modules/lodash/isMatchWith.js delete mode 100644 node_modules/lodash/isNaN.js delete mode 100644 node_modules/lodash/isNative.js delete mode 100644 node_modules/lodash/isNil.js delete mode 100644 node_modules/lodash/isNull.js delete mode 100644 node_modules/lodash/isNumber.js delete mode 100644 node_modules/lodash/isObject.js delete mode 100644 node_modules/lodash/isObjectLike.js delete mode 100644 node_modules/lodash/isPlainObject.js delete mode 100644 node_modules/lodash/isRegExp.js delete mode 100644 node_modules/lodash/isSafeInteger.js delete mode 100644 node_modules/lodash/isSet.js delete mode 100644 node_modules/lodash/isString.js delete mode 100644 node_modules/lodash/isSymbol.js delete mode 100644 node_modules/lodash/isTypedArray.js delete mode 100644 node_modules/lodash/isUndefined.js delete mode 100644 node_modules/lodash/isWeakMap.js delete mode 100644 node_modules/lodash/isWeakSet.js delete mode 100644 node_modules/lodash/iteratee.js delete mode 100644 node_modules/lodash/join.js delete mode 100644 node_modules/lodash/kebabCase.js delete mode 100644 node_modules/lodash/keyBy.js delete mode 100644 node_modules/lodash/keys.js delete mode 100644 node_modules/lodash/keysIn.js delete mode 100644 node_modules/lodash/lang.js delete mode 100644 node_modules/lodash/last.js delete mode 100644 node_modules/lodash/lastIndexOf.js delete mode 100644 node_modules/lodash/lodash.js delete mode 100644 node_modules/lodash/lodash.min.js delete mode 100644 node_modules/lodash/lowerCase.js delete mode 100644 node_modules/lodash/lowerFirst.js delete mode 100644 node_modules/lodash/lt.js delete mode 100644 node_modules/lodash/lte.js delete mode 100644 node_modules/lodash/map.js delete mode 100644 node_modules/lodash/mapKeys.js delete mode 100644 node_modules/lodash/mapValues.js delete mode 100644 node_modules/lodash/matches.js delete mode 100644 node_modules/lodash/matchesProperty.js delete mode 100644 node_modules/lodash/math.js delete mode 100644 node_modules/lodash/max.js delete mode 100644 node_modules/lodash/maxBy.js delete mode 100644 node_modules/lodash/mean.js delete mode 100644 node_modules/lodash/meanBy.js delete mode 100644 node_modules/lodash/memoize.js delete mode 100644 node_modules/lodash/merge.js delete mode 100644 node_modules/lodash/mergeWith.js delete mode 100644 node_modules/lodash/method.js delete mode 100644 node_modules/lodash/methodOf.js delete mode 100644 node_modules/lodash/min.js delete mode 100644 node_modules/lodash/minBy.js delete mode 100644 node_modules/lodash/mixin.js delete mode 100644 node_modules/lodash/multiply.js delete mode 100644 node_modules/lodash/negate.js delete mode 100644 node_modules/lodash/next.js delete mode 100644 node_modules/lodash/noop.js delete mode 100644 node_modules/lodash/now.js delete mode 100644 node_modules/lodash/nth.js delete mode 100644 node_modules/lodash/nthArg.js delete mode 100644 node_modules/lodash/number.js delete mode 100644 node_modules/lodash/object.js delete mode 100644 node_modules/lodash/omit.js delete mode 100644 node_modules/lodash/omitBy.js delete mode 100644 node_modules/lodash/once.js delete mode 100644 node_modules/lodash/orderBy.js delete mode 100644 node_modules/lodash/over.js delete mode 100644 node_modules/lodash/overArgs.js delete mode 100644 node_modules/lodash/overEvery.js delete mode 100644 node_modules/lodash/overSome.js delete mode 100644 node_modules/lodash/package.json delete mode 100644 node_modules/lodash/pad.js delete mode 100644 node_modules/lodash/padEnd.js delete mode 100644 node_modules/lodash/padStart.js delete mode 100644 node_modules/lodash/parseInt.js delete mode 100644 node_modules/lodash/partial.js delete mode 100644 node_modules/lodash/partialRight.js delete mode 100644 node_modules/lodash/partition.js delete mode 100644 node_modules/lodash/pick.js delete mode 100644 node_modules/lodash/pickBy.js delete mode 100644 node_modules/lodash/plant.js delete mode 100644 node_modules/lodash/property.js delete mode 100644 node_modules/lodash/propertyOf.js delete mode 100644 node_modules/lodash/pull.js delete mode 100644 node_modules/lodash/pullAll.js delete mode 100644 node_modules/lodash/pullAllBy.js delete mode 100644 node_modules/lodash/pullAllWith.js delete mode 100644 node_modules/lodash/pullAt.js delete mode 100644 node_modules/lodash/random.js delete mode 100644 node_modules/lodash/range.js delete mode 100644 node_modules/lodash/rangeRight.js delete mode 100644 node_modules/lodash/rearg.js delete mode 100644 node_modules/lodash/reduce.js delete mode 100644 node_modules/lodash/reduceRight.js delete mode 100644 node_modules/lodash/reject.js delete mode 100644 node_modules/lodash/release.md delete mode 100644 node_modules/lodash/remove.js delete mode 100644 node_modules/lodash/repeat.js delete mode 100644 node_modules/lodash/replace.js delete mode 100644 node_modules/lodash/rest.js delete mode 100644 node_modules/lodash/result.js delete mode 100644 node_modules/lodash/reverse.js delete mode 100644 node_modules/lodash/round.js delete mode 100644 node_modules/lodash/sample.js delete mode 100644 node_modules/lodash/sampleSize.js delete mode 100644 node_modules/lodash/seq.js delete mode 100644 node_modules/lodash/set.js delete mode 100644 node_modules/lodash/setWith.js delete mode 100644 node_modules/lodash/shuffle.js delete mode 100644 node_modules/lodash/size.js delete mode 100644 node_modules/lodash/slice.js delete mode 100644 node_modules/lodash/snakeCase.js delete mode 100644 node_modules/lodash/some.js delete mode 100644 node_modules/lodash/sortBy.js delete mode 100644 node_modules/lodash/sortedIndex.js delete mode 100644 node_modules/lodash/sortedIndexBy.js delete mode 100644 node_modules/lodash/sortedIndexOf.js delete mode 100644 node_modules/lodash/sortedLastIndex.js delete mode 100644 node_modules/lodash/sortedLastIndexBy.js delete mode 100644 node_modules/lodash/sortedLastIndexOf.js delete mode 100644 node_modules/lodash/sortedUniq.js delete mode 100644 node_modules/lodash/sortedUniqBy.js delete mode 100644 node_modules/lodash/split.js delete mode 100644 node_modules/lodash/spread.js delete mode 100644 node_modules/lodash/startCase.js delete mode 100644 node_modules/lodash/startsWith.js delete mode 100644 node_modules/lodash/string.js delete mode 100644 node_modules/lodash/stubArray.js delete mode 100644 node_modules/lodash/stubFalse.js delete mode 100644 node_modules/lodash/stubObject.js delete mode 100644 node_modules/lodash/stubString.js delete mode 100644 node_modules/lodash/stubTrue.js delete mode 100644 node_modules/lodash/subtract.js delete mode 100644 node_modules/lodash/sum.js delete mode 100644 node_modules/lodash/sumBy.js delete mode 100644 node_modules/lodash/tail.js delete mode 100644 node_modules/lodash/take.js delete mode 100644 node_modules/lodash/takeRight.js delete mode 100644 node_modules/lodash/takeRightWhile.js delete mode 100644 node_modules/lodash/takeWhile.js delete mode 100644 node_modules/lodash/tap.js delete mode 100644 node_modules/lodash/template.js delete mode 100644 node_modules/lodash/templateSettings.js delete mode 100644 node_modules/lodash/throttle.js delete mode 100644 node_modules/lodash/thru.js delete mode 100644 node_modules/lodash/times.js delete mode 100644 node_modules/lodash/toArray.js delete mode 100644 node_modules/lodash/toFinite.js delete mode 100644 node_modules/lodash/toInteger.js delete mode 100644 node_modules/lodash/toIterator.js delete mode 100644 node_modules/lodash/toJSON.js delete mode 100644 node_modules/lodash/toLength.js delete mode 100644 node_modules/lodash/toLower.js delete mode 100644 node_modules/lodash/toNumber.js delete mode 100644 node_modules/lodash/toPairs.js delete mode 100644 node_modules/lodash/toPairsIn.js delete mode 100644 node_modules/lodash/toPath.js delete mode 100644 node_modules/lodash/toPlainObject.js delete mode 100644 node_modules/lodash/toSafeInteger.js delete mode 100644 node_modules/lodash/toString.js delete mode 100644 node_modules/lodash/toUpper.js delete mode 100644 node_modules/lodash/transform.js delete mode 100644 node_modules/lodash/trim.js delete mode 100644 node_modules/lodash/trimEnd.js delete mode 100644 node_modules/lodash/trimStart.js delete mode 100644 node_modules/lodash/truncate.js delete mode 100644 node_modules/lodash/unary.js delete mode 100644 node_modules/lodash/unescape.js delete mode 100644 node_modules/lodash/union.js delete mode 100644 node_modules/lodash/unionBy.js delete mode 100644 node_modules/lodash/unionWith.js delete mode 100644 node_modules/lodash/uniq.js delete mode 100644 node_modules/lodash/uniqBy.js delete mode 100644 node_modules/lodash/uniqWith.js delete mode 100644 node_modules/lodash/uniqueId.js delete mode 100644 node_modules/lodash/unset.js delete mode 100644 node_modules/lodash/unzip.js delete mode 100644 node_modules/lodash/unzipWith.js delete mode 100644 node_modules/lodash/update.js delete mode 100644 node_modules/lodash/updateWith.js delete mode 100644 node_modules/lodash/upperCase.js delete mode 100644 node_modules/lodash/upperFirst.js delete mode 100644 node_modules/lodash/util.js delete mode 100644 node_modules/lodash/value.js delete mode 100644 node_modules/lodash/valueOf.js delete mode 100644 node_modules/lodash/values.js delete mode 100644 node_modules/lodash/valuesIn.js delete mode 100644 node_modules/lodash/without.js delete mode 100644 node_modules/lodash/words.js delete mode 100644 node_modules/lodash/wrap.js delete mode 100644 node_modules/lodash/wrapperAt.js delete mode 100644 node_modules/lodash/wrapperChain.js delete mode 100644 node_modules/lodash/wrapperLodash.js delete mode 100644 node_modules/lodash/wrapperReverse.js delete mode 100644 node_modules/lodash/wrapperValue.js delete mode 100644 node_modules/lodash/xor.js delete mode 100644 node_modules/lodash/xorBy.js delete mode 100644 node_modules/lodash/xorWith.js delete mode 100644 node_modules/lodash/zip.js delete mode 100644 node_modules/lodash/zipObject.js delete mode 100644 node_modules/lodash/zipObjectDeep.js delete mode 100644 node_modules/lodash/zipWith.js delete mode 100644 node_modules/longest/LICENSE delete mode 100644 node_modules/longest/README.md delete mode 100644 node_modules/longest/index.js delete mode 100644 node_modules/longest/package.json delete mode 100644 node_modules/media-typer/HISTORY.md delete mode 100644 node_modules/media-typer/LICENSE delete mode 100644 node_modules/media-typer/README.md delete mode 100644 node_modules/media-typer/index.js delete mode 100644 node_modules/media-typer/package.json delete mode 100644 node_modules/merge-descriptors/HISTORY.md delete mode 100644 node_modules/merge-descriptors/LICENSE delete mode 100644 node_modules/merge-descriptors/README.md delete mode 100644 node_modules/merge-descriptors/index.js delete mode 100644 node_modules/merge-descriptors/package.json delete mode 100644 node_modules/methods/HISTORY.md delete mode 100644 node_modules/methods/LICENSE delete mode 100644 node_modules/methods/README.md delete mode 100644 node_modules/methods/index.js delete mode 100644 node_modules/methods/package.json delete mode 100644 node_modules/mime-db/HISTORY.md delete mode 100644 node_modules/mime-db/LICENSE delete mode 100644 node_modules/mime-db/README.md delete mode 100644 node_modules/mime-db/db.json delete mode 100644 node_modules/mime-db/index.js delete mode 100644 node_modules/mime-db/package.json delete mode 100644 node_modules/mime-types/HISTORY.md delete mode 100644 node_modules/mime-types/LICENSE delete mode 100644 node_modules/mime-types/README.md delete mode 100644 node_modules/mime-types/index.js delete mode 100644 node_modules/mime-types/package.json delete mode 100644 node_modules/mime/LICENSE delete mode 100644 node_modules/mime/README.md delete mode 100644 node_modules/mime/build/build.js delete mode 100644 node_modules/mime/build/test.js delete mode 100755 node_modules/mime/cli.js delete mode 100644 node_modules/mime/mime.js delete mode 100644 node_modules/mime/package.json delete mode 100644 node_modules/mime/types.json delete mode 100644 node_modules/minimist/.travis.yml delete mode 100644 node_modules/minimist/LICENSE delete mode 100644 node_modules/minimist/example/parse.js delete mode 100644 node_modules/minimist/index.js delete mode 100644 node_modules/minimist/package.json delete mode 100644 node_modules/minimist/readme.markdown delete mode 100644 node_modules/minimist/test/all_bool.js delete mode 100644 node_modules/minimist/test/bool.js delete mode 100644 node_modules/minimist/test/dash.js delete mode 100644 node_modules/minimist/test/default_bool.js delete mode 100644 node_modules/minimist/test/dotted.js delete mode 100644 node_modules/minimist/test/kv_short.js delete mode 100644 node_modules/minimist/test/long.js delete mode 100644 node_modules/minimist/test/num.js delete mode 100644 node_modules/minimist/test/parse.js delete mode 100644 node_modules/minimist/test/parse_modified.js delete mode 100644 node_modules/minimist/test/proto.js delete mode 100644 node_modules/minimist/test/short.js delete mode 100644 node_modules/minimist/test/stop_early.js delete mode 100644 node_modules/minimist/test/unknown.js delete mode 100644 node_modules/minimist/test/whitespace.js delete mode 100644 node_modules/mkdirp/LICENSE delete mode 100755 node_modules/mkdirp/bin/cmd.js delete mode 100644 node_modules/mkdirp/bin/usage.txt delete mode 100644 node_modules/mkdirp/index.js delete mode 100644 node_modules/mkdirp/package.json delete mode 100644 node_modules/mkdirp/readme.markdown delete mode 100644 node_modules/morgan/HISTORY.md delete mode 100644 node_modules/morgan/LICENSE delete mode 100644 node_modules/morgan/README.md delete mode 100644 node_modules/morgan/index.js delete mode 100644 node_modules/morgan/node_modules/debug/.coveralls.yml delete mode 100644 node_modules/morgan/node_modules/debug/.eslintrc delete mode 100644 node_modules/morgan/node_modules/debug/.npmignore delete mode 100644 node_modules/morgan/node_modules/debug/.travis.yml delete mode 100644 node_modules/morgan/node_modules/debug/CHANGELOG.md delete mode 100644 node_modules/morgan/node_modules/debug/LICENSE delete mode 100644 node_modules/morgan/node_modules/debug/Makefile delete mode 100644 node_modules/morgan/node_modules/debug/README.md delete mode 100644 node_modules/morgan/node_modules/debug/component.json delete mode 100644 node_modules/morgan/node_modules/debug/karma.conf.js delete mode 100644 node_modules/morgan/node_modules/debug/node.js delete mode 100644 node_modules/morgan/node_modules/debug/package.json delete mode 100644 node_modules/morgan/node_modules/debug/src/browser.js delete mode 100644 node_modules/morgan/node_modules/debug/src/debug.js delete mode 100644 node_modules/morgan/node_modules/debug/src/index.js delete mode 100644 node_modules/morgan/node_modules/debug/src/inspector-log.js delete mode 100644 node_modules/morgan/node_modules/debug/src/node.js delete mode 100644 node_modules/morgan/package.json delete mode 100644 node_modules/ms/index.js delete mode 100644 node_modules/ms/license.md delete mode 100644 node_modules/ms/package.json delete mode 100644 node_modules/ms/readme.md delete mode 100644 node_modules/nan/CHANGELOG.md delete mode 100644 node_modules/nan/LICENSE.md delete mode 100644 node_modules/nan/README.md delete mode 100644 node_modules/nan/doc/asyncworker.md delete mode 100644 node_modules/nan/doc/buffers.md delete mode 100644 node_modules/nan/doc/callback.md delete mode 100644 node_modules/nan/doc/converters.md delete mode 100644 node_modules/nan/doc/errors.md delete mode 100644 node_modules/nan/doc/json.md delete mode 100644 node_modules/nan/doc/maybe_types.md delete mode 100644 node_modules/nan/doc/methods.md delete mode 100644 node_modules/nan/doc/new.md delete mode 100644 node_modules/nan/doc/node_misc.md delete mode 100644 node_modules/nan/doc/object_wrappers.md delete mode 100644 node_modules/nan/doc/persistent.md delete mode 100644 node_modules/nan/doc/scopes.md delete mode 100644 node_modules/nan/doc/script.md delete mode 100644 node_modules/nan/doc/string_bytes.md delete mode 100644 node_modules/nan/doc/v8_internals.md delete mode 100644 node_modules/nan/doc/v8_misc.md delete mode 100644 node_modules/nan/include_dirs.js delete mode 100644 node_modules/nan/nan.h delete mode 100644 node_modules/nan/nan_callbacks.h delete mode 100644 node_modules/nan/nan_callbacks_12_inl.h delete mode 100644 node_modules/nan/nan_callbacks_pre_12_inl.h delete mode 100644 node_modules/nan/nan_converters.h delete mode 100644 node_modules/nan/nan_converters_43_inl.h delete mode 100644 node_modules/nan/nan_converters_pre_43_inl.h delete mode 100644 node_modules/nan/nan_define_own_property_helper.h delete mode 100644 node_modules/nan/nan_implementation_12_inl.h delete mode 100644 node_modules/nan/nan_implementation_pre_12_inl.h delete mode 100644 node_modules/nan/nan_json.h delete mode 100644 node_modules/nan/nan_maybe_43_inl.h delete mode 100644 node_modules/nan/nan_maybe_pre_43_inl.h delete mode 100644 node_modules/nan/nan_new.h delete mode 100644 node_modules/nan/nan_object_wrap.h delete mode 100644 node_modules/nan/nan_persistent_12_inl.h delete mode 100644 node_modules/nan/nan_persistent_pre_12_inl.h delete mode 100644 node_modules/nan/nan_private.h delete mode 100644 node_modules/nan/nan_string_bytes.h delete mode 100644 node_modules/nan/nan_typedarray_contents.h delete mode 100644 node_modules/nan/nan_weak.h delete mode 100644 node_modules/nan/package.json delete mode 100755 node_modules/nan/tools/1to2.js delete mode 100644 node_modules/nan/tools/README.md delete mode 100644 node_modules/nan/tools/package.json delete mode 100644 node_modules/negotiator/HISTORY.md delete mode 100644 node_modules/negotiator/LICENSE delete mode 100644 node_modules/negotiator/README.md delete mode 100644 node_modules/negotiator/index.js delete mode 100644 node_modules/negotiator/lib/charset.js delete mode 100644 node_modules/negotiator/lib/encoding.js delete mode 100644 node_modules/negotiator/lib/language.js delete mode 100644 node_modules/negotiator/lib/mediaType.js delete mode 100644 node_modules/negotiator/package.json delete mode 100644 node_modules/node-expat/LICENSE delete mode 100644 node_modules/node-expat/README.md delete mode 100644 node_modules/node-expat/binding.gyp delete mode 100644 node_modules/node-expat/build/Makefile delete mode 100644 node_modules/node-expat/build/Release/.deps/Release/libexpat.a.d delete mode 100644 node_modules/node-expat/build/Release/.deps/Release/node_expat.node.d delete mode 100644 node_modules/node-expat/build/Release/.deps/Release/obj.target/deps/libexpat/libexpat.a.d delete mode 100644 node_modules/node-expat/build/Release/.deps/Release/obj.target/expat/deps/libexpat/lib/xmlparse.o.d delete mode 100644 node_modules/node-expat/build/Release/.deps/Release/obj.target/expat/deps/libexpat/lib/xmlrole.o.d delete mode 100644 node_modules/node-expat/build/Release/.deps/Release/obj.target/expat/deps/libexpat/lib/xmltok.o.d delete mode 100644 node_modules/node-expat/build/Release/.deps/Release/obj.target/node_expat.node.d delete mode 100644 node_modules/node-expat/build/Release/.deps/Release/obj.target/node_expat/node-expat.o.d delete mode 100644 node_modules/node-expat/build/Release/libexpat.a delete mode 100755 node_modules/node-expat/build/Release/node_expat.node delete mode 100644 node_modules/node-expat/build/Release/obj.target/deps/libexpat/libexpat.a delete mode 100644 node_modules/node-expat/build/Release/obj.target/expat/deps/libexpat/lib/xmlparse.o delete mode 100644 node_modules/node-expat/build/Release/obj.target/expat/deps/libexpat/lib/xmlrole.o delete mode 100644 node_modules/node-expat/build/Release/obj.target/expat/deps/libexpat/lib/xmltok.o delete mode 100755 node_modules/node-expat/build/Release/obj.target/node_expat.node delete mode 100644 node_modules/node-expat/build/Release/obj.target/node_expat/node-expat.o delete mode 100644 node_modules/node-expat/build/binding.Makefile delete mode 100644 node_modules/node-expat/build/config.gypi delete mode 100644 node_modules/node-expat/build/deps/libexpat/expat.target.mk delete mode 100644 node_modules/node-expat/build/deps/libexpat/libexpat.Makefile delete mode 100644 node_modules/node-expat/build/deps/libexpat/version.target.mk delete mode 100644 node_modules/node-expat/build/node_expat.target.mk delete mode 100644 node_modules/node-expat/deps/libexpat/AUTHORS delete mode 100755 node_modules/node-expat/deps/libexpat/CMake.README delete mode 100755 node_modules/node-expat/deps/libexpat/CMakeLists.txt delete mode 100644 node_modules/node-expat/deps/libexpat/COPYING delete mode 100644 node_modules/node-expat/deps/libexpat/Changes delete mode 100755 node_modules/node-expat/deps/libexpat/ConfigureChecks.cmake delete mode 100644 node_modules/node-expat/deps/libexpat/MANIFEST delete mode 100644 node_modules/node-expat/deps/libexpat/Makefile.in delete mode 100644 node_modules/node-expat/deps/libexpat/README delete mode 100644 node_modules/node-expat/deps/libexpat/aclocal.m4 delete mode 100755 node_modules/node-expat/deps/libexpat/configure delete mode 100644 node_modules/node-expat/deps/libexpat/configure.ac delete mode 100755 node_modules/node-expat/deps/libexpat/conftools/PrintPath delete mode 100644 node_modules/node-expat/deps/libexpat/conftools/ac_c_bigendian_cross.m4 delete mode 100755 node_modules/node-expat/deps/libexpat/conftools/config.guess delete mode 100755 node_modules/node-expat/deps/libexpat/conftools/config.sub delete mode 100644 node_modules/node-expat/deps/libexpat/conftools/expat.m4 delete mode 100755 node_modules/node-expat/deps/libexpat/conftools/get-version.sh delete mode 100755 node_modules/node-expat/deps/libexpat/conftools/install-sh delete mode 100644 node_modules/node-expat/deps/libexpat/conftools/ltmain.sh delete mode 100755 node_modules/node-expat/deps/libexpat/conftools/mkinstalldirs delete mode 100644 node_modules/node-expat/deps/libexpat/doc/expat.png delete mode 100644 node_modules/node-expat/deps/libexpat/doc/reference.html delete mode 100644 node_modules/node-expat/deps/libexpat/doc/style.css delete mode 100644 node_modules/node-expat/deps/libexpat/doc/valid-xhtml10.png delete mode 100644 node_modules/node-expat/deps/libexpat/doc/xmlwf.1 delete mode 100644 node_modules/node-expat/deps/libexpat/doc/xmlwf.xml delete mode 100644 node_modules/node-expat/deps/libexpat/examples/elements.c delete mode 100644 node_modules/node-expat/deps/libexpat/examples/outline.c delete mode 100644 node_modules/node-expat/deps/libexpat/expat.pc.in delete mode 100644 node_modules/node-expat/deps/libexpat/expat_config.h delete mode 100755 node_modules/node-expat/deps/libexpat/expat_config.h.cmake delete mode 100644 node_modules/node-expat/deps/libexpat/expat_config.h.in delete mode 100644 node_modules/node-expat/deps/libexpat/lib/ascii.h delete mode 100644 node_modules/node-expat/deps/libexpat/lib/asciitab.h delete mode 100644 node_modules/node-expat/deps/libexpat/lib/expat.h delete mode 100644 node_modules/node-expat/deps/libexpat/lib/expat_external.h delete mode 100644 node_modules/node-expat/deps/libexpat/lib/iasciitab.h delete mode 100644 node_modules/node-expat/deps/libexpat/lib/internal.h delete mode 100644 node_modules/node-expat/deps/libexpat/lib/latin1tab.h delete mode 100644 node_modules/node-expat/deps/libexpat/lib/libexpat.def delete mode 100644 node_modules/node-expat/deps/libexpat/lib/libexpatw.def delete mode 100644 node_modules/node-expat/deps/libexpat/lib/nametab.h delete mode 100644 node_modules/node-expat/deps/libexpat/lib/siphash.h delete mode 100644 node_modules/node-expat/deps/libexpat/lib/utf8tab.h delete mode 100644 node_modules/node-expat/deps/libexpat/lib/winconfig.h delete mode 100644 node_modules/node-expat/deps/libexpat/lib/xmlparse.c delete mode 100644 node_modules/node-expat/deps/libexpat/lib/xmlrole.c delete mode 100644 node_modules/node-expat/deps/libexpat/lib/xmlrole.h delete mode 100644 node_modules/node-expat/deps/libexpat/lib/xmltok.c delete mode 100644 node_modules/node-expat/deps/libexpat/lib/xmltok.h delete mode 100644 node_modules/node-expat/deps/libexpat/lib/xmltok_impl.c delete mode 100644 node_modules/node-expat/deps/libexpat/lib/xmltok_impl.h delete mode 100644 node_modules/node-expat/deps/libexpat/lib/xmltok_ns.c delete mode 100644 node_modules/node-expat/deps/libexpat/libexpat.gyp delete mode 100644 node_modules/node-expat/deps/libexpat/m4/libtool.m4 delete mode 100644 node_modules/node-expat/deps/libexpat/m4/ltoptions.m4 delete mode 100644 node_modules/node-expat/deps/libexpat/m4/ltsugar.m4 delete mode 100644 node_modules/node-expat/deps/libexpat/m4/ltversion.m4 delete mode 100644 node_modules/node-expat/deps/libexpat/m4/lt~obsolete.m4 delete mode 100644 node_modules/node-expat/deps/libexpat/run.sh.in delete mode 100644 node_modules/node-expat/deps/libexpat/tests/README.txt delete mode 100644 node_modules/node-expat/deps/libexpat/tests/benchmark/README.txt delete mode 100644 node_modules/node-expat/deps/libexpat/tests/benchmark/benchmark.c delete mode 100644 node_modules/node-expat/deps/libexpat/tests/chardata.c delete mode 100644 node_modules/node-expat/deps/libexpat/tests/chardata.h delete mode 100644 node_modules/node-expat/deps/libexpat/tests/memcheck.c delete mode 100644 node_modules/node-expat/deps/libexpat/tests/memcheck.h delete mode 100644 node_modules/node-expat/deps/libexpat/tests/minicheck.c delete mode 100644 node_modules/node-expat/deps/libexpat/tests/minicheck.h delete mode 100644 node_modules/node-expat/deps/libexpat/tests/runtests.c delete mode 100644 node_modules/node-expat/deps/libexpat/tests/runtestspp.cpp delete mode 100755 node_modules/node-expat/deps/libexpat/tests/xmltest.sh delete mode 100644 node_modules/node-expat/deps/libexpat/win32/MANIFEST.txt delete mode 100644 node_modules/node-expat/deps/libexpat/win32/README.txt delete mode 100644 node_modules/node-expat/deps/libexpat/win32/expat.iss delete mode 100644 node_modules/node-expat/deps/libexpat/xmlwf/codepage.c delete mode 100644 node_modules/node-expat/deps/libexpat/xmlwf/codepage.h delete mode 100644 node_modules/node-expat/deps/libexpat/xmlwf/ct.c delete mode 100644 node_modules/node-expat/deps/libexpat/xmlwf/filemap.h delete mode 100644 node_modules/node-expat/deps/libexpat/xmlwf/readfilemap.c delete mode 100644 node_modules/node-expat/deps/libexpat/xmlwf/unixfilemap.c delete mode 100644 node_modules/node-expat/deps/libexpat/xmlwf/win32filemap.c delete mode 100644 node_modules/node-expat/deps/libexpat/xmlwf/xmlfile.c delete mode 100644 node_modules/node-expat/deps/libexpat/xmlwf/xmlfile.h delete mode 100644 node_modules/node-expat/deps/libexpat/xmlwf/xmlmime.c delete mode 100644 node_modules/node-expat/deps/libexpat/xmlwf/xmlmime.h delete mode 100644 node_modules/node-expat/deps/libexpat/xmlwf/xmltchar.h delete mode 100644 node_modules/node-expat/deps/libexpat/xmlwf/xmlurl.h delete mode 100644 node_modules/node-expat/deps/libexpat/xmlwf/xmlwf.c delete mode 100644 node_modules/node-expat/deps/libexpat/xmlwf/xmlwin32url.cxx delete mode 100644 node_modules/node-expat/lib/node-expat.js delete mode 100644 node_modules/node-expat/node-expat.cc delete mode 100644 node_modules/node-expat/package.json delete mode 100644 node_modules/object-assign/index.js delete mode 100644 node_modules/object-assign/license delete mode 100644 node_modules/object-assign/package.json delete mode 100644 node_modules/object-assign/readme.md delete mode 100644 node_modules/on-finished/HISTORY.md delete mode 100644 node_modules/on-finished/LICENSE delete mode 100644 node_modules/on-finished/README.md delete mode 100644 node_modules/on-finished/index.js delete mode 100644 node_modules/on-finished/package.json delete mode 100644 node_modules/on-headers/HISTORY.md delete mode 100644 node_modules/on-headers/LICENSE delete mode 100644 node_modules/on-headers/README.md delete mode 100644 node_modules/on-headers/index.js delete mode 100644 node_modules/on-headers/package.json delete mode 100644 node_modules/optimist/.travis.yml delete mode 100644 node_modules/optimist/LICENSE delete mode 100644 node_modules/optimist/example/bool.js delete mode 100644 node_modules/optimist/example/boolean_double.js delete mode 100644 node_modules/optimist/example/boolean_single.js delete mode 100644 node_modules/optimist/example/default_hash.js delete mode 100644 node_modules/optimist/example/default_singles.js delete mode 100644 node_modules/optimist/example/divide.js delete mode 100644 node_modules/optimist/example/line_count.js delete mode 100644 node_modules/optimist/example/line_count_options.js delete mode 100644 node_modules/optimist/example/line_count_wrap.js delete mode 100644 node_modules/optimist/example/nonopt.js delete mode 100644 node_modules/optimist/example/reflect.js delete mode 100644 node_modules/optimist/example/short.js delete mode 100644 node_modules/optimist/example/string.js delete mode 100644 node_modules/optimist/example/usage-options.js delete mode 100644 node_modules/optimist/example/xup.js delete mode 100644 node_modules/optimist/index.js delete mode 100644 node_modules/optimist/package.json delete mode 100644 node_modules/optimist/readme.markdown delete mode 100644 node_modules/optimist/test/_.js delete mode 100644 node_modules/optimist/test/_/argv.js delete mode 100755 node_modules/optimist/test/_/bin.js delete mode 100644 node_modules/optimist/test/parse.js delete mode 100644 node_modules/optimist/test/usage.js delete mode 100644 node_modules/parseurl/HISTORY.md delete mode 100644 node_modules/parseurl/LICENSE delete mode 100644 node_modules/parseurl/README.md delete mode 100644 node_modules/parseurl/index.js delete mode 100644 node_modules/parseurl/package.json delete mode 100644 node_modules/path-parse/.travis.yml delete mode 100644 node_modules/path-parse/LICENSE delete mode 100644 node_modules/path-parse/README.md delete mode 100644 node_modules/path-parse/index.js delete mode 100644 node_modules/path-parse/package.json delete mode 100644 node_modules/path-parse/test.js delete mode 100644 node_modules/path-to-regexp/History.md delete mode 100644 node_modules/path-to-regexp/LICENSE delete mode 100644 node_modules/path-to-regexp/Readme.md delete mode 100644 node_modules/path-to-regexp/index.js delete mode 100644 node_modules/path-to-regexp/package.json delete mode 100644 node_modules/promise/.jshintrc delete mode 100644 node_modules/promise/.npmignore delete mode 100644 node_modules/promise/LICENSE delete mode 100644 node_modules/promise/Readme.md delete mode 100644 node_modules/promise/core.js delete mode 100644 node_modules/promise/index.js delete mode 100644 node_modules/promise/lib/core.js delete mode 100644 node_modules/promise/lib/done.js delete mode 100644 node_modules/promise/lib/es6-extensions.js delete mode 100644 node_modules/promise/lib/node-extensions.js delete mode 100644 node_modules/promise/package.json delete mode 100644 node_modules/promise/polyfill-done.js delete mode 100644 node_modules/promise/polyfill.js delete mode 100644 node_modules/proxy-addr/HISTORY.md delete mode 100644 node_modules/proxy-addr/LICENSE delete mode 100644 node_modules/proxy-addr/README.md delete mode 100644 node_modules/proxy-addr/index.js delete mode 100644 node_modules/proxy-addr/package.json delete mode 100644 node_modules/pug-attrs/LICENSE delete mode 100644 node_modules/pug-attrs/README.md delete mode 100644 node_modules/pug-attrs/index.js delete mode 100644 node_modules/pug-attrs/node_modules/constantinople/.editorconfig delete mode 100644 node_modules/pug-attrs/node_modules/constantinople/.gitattributes delete mode 100644 node_modules/pug-attrs/node_modules/constantinople/.prettierrc delete mode 100644 node_modules/pug-attrs/node_modules/constantinople/.travis.yml delete mode 100644 node_modules/pug-attrs/node_modules/constantinople/LICENSE delete mode 100644 node_modules/pug-attrs/node_modules/constantinople/README.md delete mode 100644 node_modules/pug-attrs/node_modules/constantinople/lib/binaryOperation.d.ts delete mode 100644 node_modules/pug-attrs/node_modules/constantinople/lib/binaryOperation.js delete mode 100644 node_modules/pug-attrs/node_modules/constantinople/lib/index.d.ts delete mode 100644 node_modules/pug-attrs/node_modules/constantinople/lib/index.js delete mode 100644 node_modules/pug-attrs/node_modules/constantinople/package.json delete mode 100644 node_modules/pug-attrs/node_modules/constantinople/src/binaryOperation.ts delete mode 100644 node_modules/pug-attrs/node_modules/constantinople/src/index.ts delete mode 100644 node_modules/pug-attrs/node_modules/constantinople/test/index.js delete mode 100644 node_modules/pug-attrs/node_modules/constantinople/tsconfig.json delete mode 100644 node_modules/pug-attrs/package.json delete mode 100644 node_modules/pug-code-gen/HISTORY.md delete mode 100644 node_modules/pug-code-gen/LICENSE delete mode 100644 node_modules/pug-code-gen/README.md delete mode 100644 node_modules/pug-code-gen/index.js delete mode 100644 node_modules/pug-code-gen/node_modules/constantinople/.editorconfig delete mode 100644 node_modules/pug-code-gen/node_modules/constantinople/.gitattributes delete mode 100644 node_modules/pug-code-gen/node_modules/constantinople/.prettierrc delete mode 100644 node_modules/pug-code-gen/node_modules/constantinople/.travis.yml delete mode 100644 node_modules/pug-code-gen/node_modules/constantinople/LICENSE delete mode 100644 node_modules/pug-code-gen/node_modules/constantinople/README.md delete mode 100644 node_modules/pug-code-gen/node_modules/constantinople/lib/binaryOperation.d.ts delete mode 100644 node_modules/pug-code-gen/node_modules/constantinople/lib/binaryOperation.js delete mode 100644 node_modules/pug-code-gen/node_modules/constantinople/lib/index.d.ts delete mode 100644 node_modules/pug-code-gen/node_modules/constantinople/lib/index.js delete mode 100644 node_modules/pug-code-gen/node_modules/constantinople/package.json delete mode 100644 node_modules/pug-code-gen/node_modules/constantinople/src/binaryOperation.ts delete mode 100644 node_modules/pug-code-gen/node_modules/constantinople/src/index.ts delete mode 100644 node_modules/pug-code-gen/node_modules/constantinople/test/index.js delete mode 100644 node_modules/pug-code-gen/node_modules/constantinople/tsconfig.json delete mode 100644 node_modules/pug-code-gen/node_modules/void-elements/LICENSE delete mode 100644 node_modules/pug-code-gen/node_modules/void-elements/README.md delete mode 100644 node_modules/pug-code-gen/node_modules/void-elements/index.js delete mode 100644 node_modules/pug-code-gen/node_modules/void-elements/package.json delete mode 100644 node_modules/pug-code-gen/node_modules/with/.babelrc delete mode 100644 node_modules/pug-code-gen/node_modules/with/.github/workflows/rollingversions-canary.yml delete mode 100644 node_modules/pug-code-gen/node_modules/with/.github/workflows/rollingversions.yml delete mode 100644 node_modules/pug-code-gen/node_modules/with/.github/workflows/test.yml delete mode 100644 node_modules/pug-code-gen/node_modules/with/LICENSE delete mode 100644 node_modules/pug-code-gen/node_modules/with/README.md delete mode 100644 node_modules/pug-code-gen/node_modules/with/lib/globals.d.ts delete mode 100644 node_modules/pug-code-gen/node_modules/with/lib/globals.js delete mode 100644 node_modules/pug-code-gen/node_modules/with/lib/globals.js.map delete mode 100644 node_modules/pug-code-gen/node_modules/with/lib/index.d.ts delete mode 100644 node_modules/pug-code-gen/node_modules/with/lib/index.js delete mode 100644 node_modules/pug-code-gen/node_modules/with/lib/index.js.map delete mode 100644 node_modules/pug-code-gen/node_modules/with/lib/reference.d.ts delete mode 100644 node_modules/pug-code-gen/node_modules/with/lib/reference.js delete mode 100644 node_modules/pug-code-gen/node_modules/with/lib/reference.js.map delete mode 100644 node_modules/pug-code-gen/node_modules/with/package.json delete mode 100644 node_modules/pug-code-gen/node_modules/with/prettier.config.js delete mode 100644 node_modules/pug-code-gen/node_modules/with/src/globals.ts delete mode 100644 node_modules/pug-code-gen/node_modules/with/src/index.ts delete mode 100644 node_modules/pug-code-gen/node_modules/with/src/reference.ts delete mode 100644 node_modules/pug-code-gen/node_modules/with/tsconfig.json delete mode 100644 node_modules/pug-code-gen/node_modules/with/tslint.json delete mode 100644 node_modules/pug-code-gen/package.json delete mode 100644 node_modules/pug-error/LICENSE delete mode 100644 node_modules/pug-error/README.md delete mode 100644 node_modules/pug-error/index.js delete mode 100644 node_modules/pug-error/package.json delete mode 100644 node_modules/pug-filters/CHANGELOG.md delete mode 100644 node_modules/pug-filters/LICENSE delete mode 100644 node_modules/pug-filters/README.md delete mode 100644 node_modules/pug-filters/index.js delete mode 100644 node_modules/pug-filters/lib/handle-filters.js delete mode 100644 node_modules/pug-filters/lib/run-filter.js delete mode 100644 node_modules/pug-filters/node_modules/asap/CHANGES.md delete mode 100644 node_modules/pug-filters/node_modules/asap/LICENSE.md delete mode 100644 node_modules/pug-filters/node_modules/asap/README.md delete mode 100644 node_modules/pug-filters/node_modules/asap/asap.js delete mode 100644 node_modules/pug-filters/node_modules/asap/browser-asap.js delete mode 100644 node_modules/pug-filters/node_modules/asap/browser-raw.js delete mode 100644 node_modules/pug-filters/node_modules/asap/package.json delete mode 100644 node_modules/pug-filters/node_modules/asap/raw.js delete mode 100644 node_modules/pug-filters/node_modules/constantinople/.editorconfig delete mode 100644 node_modules/pug-filters/node_modules/constantinople/.gitattributes delete mode 100644 node_modules/pug-filters/node_modules/constantinople/.prettierrc delete mode 100644 node_modules/pug-filters/node_modules/constantinople/.travis.yml delete mode 100644 node_modules/pug-filters/node_modules/constantinople/LICENSE delete mode 100644 node_modules/pug-filters/node_modules/constantinople/README.md delete mode 100644 node_modules/pug-filters/node_modules/constantinople/lib/binaryOperation.d.ts delete mode 100644 node_modules/pug-filters/node_modules/constantinople/lib/binaryOperation.js delete mode 100644 node_modules/pug-filters/node_modules/constantinople/lib/index.d.ts delete mode 100644 node_modules/pug-filters/node_modules/constantinople/lib/index.js delete mode 100644 node_modules/pug-filters/node_modules/constantinople/package.json delete mode 100644 node_modules/pug-filters/node_modules/constantinople/src/binaryOperation.ts delete mode 100644 node_modules/pug-filters/node_modules/constantinople/src/index.ts delete mode 100644 node_modules/pug-filters/node_modules/constantinople/test/index.js delete mode 100644 node_modules/pug-filters/node_modules/constantinople/tsconfig.json delete mode 100644 node_modules/pug-filters/node_modules/jstransformer/CHANGELOG.md delete mode 100644 node_modules/pug-filters/node_modules/jstransformer/LICENSE.md delete mode 100644 node_modules/pug-filters/node_modules/jstransformer/README.md delete mode 100644 node_modules/pug-filters/node_modules/jstransformer/index.js delete mode 100644 node_modules/pug-filters/node_modules/jstransformer/package.json delete mode 100644 node_modules/pug-filters/node_modules/promise/.jshintrc delete mode 100644 node_modules/pug-filters/node_modules/promise/.npmignore delete mode 100644 node_modules/pug-filters/node_modules/promise/LICENSE delete mode 100644 node_modules/pug-filters/node_modules/promise/Readme.md delete mode 100644 node_modules/pug-filters/node_modules/promise/build.js delete mode 100644 node_modules/pug-filters/node_modules/promise/core.js delete mode 100644 node_modules/pug-filters/node_modules/promise/domains/core.js delete mode 100644 node_modules/pug-filters/node_modules/promise/domains/done.js delete mode 100644 node_modules/pug-filters/node_modules/promise/domains/es6-extensions.js delete mode 100644 node_modules/pug-filters/node_modules/promise/domains/finally.js delete mode 100644 node_modules/pug-filters/node_modules/promise/domains/index.js delete mode 100644 node_modules/pug-filters/node_modules/promise/domains/node-extensions.js delete mode 100644 node_modules/pug-filters/node_modules/promise/domains/rejection-tracking.js delete mode 100644 node_modules/pug-filters/node_modules/promise/domains/synchronous.js delete mode 100644 node_modules/pug-filters/node_modules/promise/index.d.ts delete mode 100644 node_modules/pug-filters/node_modules/promise/index.js delete mode 100644 node_modules/pug-filters/node_modules/promise/lib/core.js delete mode 100644 node_modules/pug-filters/node_modules/promise/lib/done.js delete mode 100644 node_modules/pug-filters/node_modules/promise/lib/es6-extensions.js delete mode 100644 node_modules/pug-filters/node_modules/promise/lib/finally.js delete mode 100644 node_modules/pug-filters/node_modules/promise/lib/index.js delete mode 100644 node_modules/pug-filters/node_modules/promise/lib/node-extensions.js delete mode 100644 node_modules/pug-filters/node_modules/promise/lib/rejection-tracking.js delete mode 100644 node_modules/pug-filters/node_modules/promise/lib/synchronous.js delete mode 100644 node_modules/pug-filters/node_modules/promise/package.json delete mode 100644 node_modules/pug-filters/node_modules/promise/polyfill-done.js delete mode 100644 node_modules/pug-filters/node_modules/promise/polyfill.js delete mode 100644 node_modules/pug-filters/node_modules/promise/setimmediate/core.js delete mode 100644 node_modules/pug-filters/node_modules/promise/setimmediate/done.js delete mode 100644 node_modules/pug-filters/node_modules/promise/setimmediate/es6-extensions.js delete mode 100644 node_modules/pug-filters/node_modules/promise/setimmediate/finally.js delete mode 100644 node_modules/pug-filters/node_modules/promise/setimmediate/index.js delete mode 100644 node_modules/pug-filters/node_modules/promise/setimmediate/node-extensions.js delete mode 100644 node_modules/pug-filters/node_modules/promise/setimmediate/rejection-tracking.js delete mode 100644 node_modules/pug-filters/node_modules/promise/setimmediate/synchronous.js delete mode 100644 node_modules/pug-filters/node_modules/promise/src/core.js delete mode 100644 node_modules/pug-filters/node_modules/promise/src/done.js delete mode 100644 node_modules/pug-filters/node_modules/promise/src/es6-extensions.js delete mode 100644 node_modules/pug-filters/node_modules/promise/src/finally.js delete mode 100644 node_modules/pug-filters/node_modules/promise/src/index.js delete mode 100644 node_modules/pug-filters/node_modules/promise/src/node-extensions.js delete mode 100644 node_modules/pug-filters/node_modules/promise/src/rejection-tracking.js delete mode 100644 node_modules/pug-filters/node_modules/promise/src/synchronous.js delete mode 100644 node_modules/pug-filters/package.json delete mode 100644 node_modules/pug-lexer/History.md delete mode 100644 node_modules/pug-lexer/LICENSE delete mode 100644 node_modules/pug-lexer/README.md delete mode 100644 node_modules/pug-lexer/index.js delete mode 100644 node_modules/pug-lexer/node_modules/character-parser/.npmignore delete mode 100644 node_modules/pug-lexer/node_modules/character-parser/LICENSE delete mode 100644 node_modules/pug-lexer/node_modules/character-parser/README.md delete mode 100644 node_modules/pug-lexer/node_modules/character-parser/index.js delete mode 100644 node_modules/pug-lexer/node_modules/character-parser/package.json delete mode 100644 node_modules/pug-lexer/package.json delete mode 100644 node_modules/pug-linker/HISTORY.md delete mode 100644 node_modules/pug-linker/LICENSE delete mode 100644 node_modules/pug-linker/README.md delete mode 100644 node_modules/pug-linker/index.js delete mode 100644 node_modules/pug-linker/package.json delete mode 100644 node_modules/pug-load/HISTORY.md delete mode 100644 node_modules/pug-load/LICENSE delete mode 100644 node_modules/pug-load/README.md delete mode 100644 node_modules/pug-load/index.js delete mode 100644 node_modules/pug-load/package.json delete mode 100644 node_modules/pug-parser/HISTORY.md delete mode 100644 node_modules/pug-parser/LICENSE delete mode 100644 node_modules/pug-parser/README.md delete mode 100644 node_modules/pug-parser/index.js delete mode 100644 node_modules/pug-parser/lib/inline-tags.js delete mode 100644 node_modules/pug-parser/package.json delete mode 100644 node_modules/pug-runtime/CHANGELOG.md delete mode 100644 node_modules/pug-runtime/LICENSE delete mode 100644 node_modules/pug-runtime/README.md delete mode 100644 node_modules/pug-runtime/build.js delete mode 100644 node_modules/pug-runtime/index.js delete mode 100644 node_modules/pug-runtime/lib/dependencies.js delete mode 100644 node_modules/pug-runtime/lib/internals.js delete mode 100644 node_modules/pug-runtime/lib/sources.js delete mode 100644 node_modules/pug-runtime/package.json delete mode 100644 node_modules/pug-runtime/wrap.js delete mode 100644 node_modules/pug-strip-comments/CHANGELOG.md delete mode 100644 node_modules/pug-strip-comments/LICENSE.md delete mode 100644 node_modules/pug-strip-comments/README.md delete mode 100644 node_modules/pug-strip-comments/index.js delete mode 100644 node_modules/pug-strip-comments/package.json delete mode 100644 node_modules/pug-walk/HISTORY.md delete mode 100644 node_modules/pug-walk/LICENSE delete mode 100644 node_modules/pug-walk/README.md delete mode 100644 node_modules/pug-walk/index.js delete mode 100644 node_modules/pug-walk/package.json delete mode 100644 node_modules/pug/History.md delete mode 100644 node_modules/pug/LICENSE delete mode 100644 node_modules/pug/README.md delete mode 100644 node_modules/pug/lib/index.js delete mode 100644 node_modules/pug/package.json delete mode 100644 node_modules/pug/register.js delete mode 100644 node_modules/punycode/LICENSE-MIT.txt delete mode 100644 node_modules/punycode/README.md delete mode 100644 node_modules/punycode/package.json delete mode 100644 node_modules/punycode/punycode.es6.js delete mode 100644 node_modules/punycode/punycode.js delete mode 100644 node_modules/qs/.editorconfig delete mode 100644 node_modules/qs/.eslintignore delete mode 100644 node_modules/qs/.eslintrc delete mode 100644 node_modules/qs/CHANGELOG.md delete mode 100644 node_modules/qs/LICENSE delete mode 100644 node_modules/qs/README.md delete mode 100644 node_modules/qs/dist/qs.js delete mode 100644 node_modules/qs/lib/formats.js delete mode 100644 node_modules/qs/lib/index.js delete mode 100644 node_modules/qs/lib/parse.js delete mode 100644 node_modules/qs/lib/stringify.js delete mode 100644 node_modules/qs/lib/utils.js delete mode 100644 node_modules/qs/package.json delete mode 100644 node_modules/qs/test/.eslintrc delete mode 100644 node_modules/qs/test/index.js delete mode 100644 node_modules/qs/test/parse.js delete mode 100644 node_modules/qs/test/stringify.js delete mode 100644 node_modules/qs/test/utils.js delete mode 100644 node_modules/range-parser/HISTORY.md delete mode 100644 node_modules/range-parser/LICENSE delete mode 100644 node_modules/range-parser/README.md delete mode 100644 node_modules/range-parser/index.js delete mode 100644 node_modules/range-parser/package.json delete mode 100644 node_modules/raw-body/HISTORY.md delete mode 100644 node_modules/raw-body/LICENSE delete mode 100644 node_modules/raw-body/README.md delete mode 100644 node_modules/raw-body/index.d.ts delete mode 100644 node_modules/raw-body/index.js delete mode 100644 node_modules/raw-body/node_modules/http-errors/HISTORY.md delete mode 100644 node_modules/raw-body/node_modules/http-errors/LICENSE delete mode 100644 node_modules/raw-body/node_modules/http-errors/README.md delete mode 100644 node_modules/raw-body/node_modules/http-errors/index.js delete mode 100644 node_modules/raw-body/node_modules/http-errors/package.json delete mode 100644 node_modules/raw-body/package.json delete mode 100644 node_modules/repeat-string/LICENSE delete mode 100644 node_modules/repeat-string/README.md delete mode 100644 node_modules/repeat-string/index.js delete mode 100644 node_modules/repeat-string/package.json delete mode 100644 node_modules/resolve/.editorconfig delete mode 100644 node_modules/resolve/.eslintignore delete mode 100644 node_modules/resolve/.eslintrc delete mode 100644 node_modules/resolve/LICENSE delete mode 100644 node_modules/resolve/SECURITY.md delete mode 100644 node_modules/resolve/appveyor.yml delete mode 100644 node_modules/resolve/example/async.js delete mode 100644 node_modules/resolve/example/sync.js delete mode 100644 node_modules/resolve/index.js delete mode 100644 node_modules/resolve/lib/async.js delete mode 100644 node_modules/resolve/lib/caller.js delete mode 100644 node_modules/resolve/lib/core.js delete mode 100644 node_modules/resolve/lib/core.json delete mode 100644 node_modules/resolve/lib/is-core.js delete mode 100644 node_modules/resolve/lib/node-modules-paths.js delete mode 100644 node_modules/resolve/lib/normalize-options.js delete mode 100644 node_modules/resolve/lib/sync.js delete mode 100644 node_modules/resolve/package.json delete mode 100644 node_modules/resolve/readme.markdown delete mode 100644 node_modules/resolve/test/.eslintrc delete mode 100644 node_modules/resolve/test/core.js delete mode 100644 node_modules/resolve/test/dotdot.js delete mode 100644 node_modules/resolve/test/dotdot/abc/index.js delete mode 100644 node_modules/resolve/test/dotdot/index.js delete mode 100644 node_modules/resolve/test/faulty_basedir.js delete mode 100644 node_modules/resolve/test/filter.js delete mode 100644 node_modules/resolve/test/filter_sync.js delete mode 100644 node_modules/resolve/test/mock.js delete mode 100644 node_modules/resolve/test/mock_sync.js delete mode 100644 node_modules/resolve/test/module_dir.js delete mode 100644 node_modules/resolve/test/module_dir/xmodules/aaa/index.js delete mode 100644 node_modules/resolve/test/module_dir/ymodules/aaa/index.js delete mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/main.js delete mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/package.json delete mode 100644 node_modules/resolve/test/node-modules-paths.js delete mode 100644 node_modules/resolve/test/node_path.js delete mode 100644 node_modules/resolve/test/node_path/x/aaa/index.js delete mode 100644 node_modules/resolve/test/node_path/x/ccc/index.js delete mode 100644 node_modules/resolve/test/node_path/y/bbb/index.js delete mode 100644 node_modules/resolve/test/node_path/y/ccc/index.js delete mode 100644 node_modules/resolve/test/nonstring.js delete mode 100644 node_modules/resolve/test/pathfilter.js delete mode 100644 node_modules/resolve/test/pathfilter/deep_ref/main.js delete mode 100644 node_modules/resolve/test/precedence.js delete mode 100644 node_modules/resolve/test/precedence/aaa.js delete mode 100644 node_modules/resolve/test/precedence/aaa/index.js delete mode 100644 node_modules/resolve/test/precedence/aaa/main.js delete mode 100644 node_modules/resolve/test/precedence/bbb.js delete mode 100644 node_modules/resolve/test/precedence/bbb/main.js delete mode 100644 node_modules/resolve/test/resolver.js delete mode 100644 node_modules/resolve/test/resolver/baz/doom.js delete mode 100644 node_modules/resolve/test/resolver/baz/package.json delete mode 100644 node_modules/resolve/test/resolver/baz/quux.js delete mode 100644 node_modules/resolve/test/resolver/browser_field/a.js delete mode 100644 node_modules/resolve/test/resolver/browser_field/b.js delete mode 100644 node_modules/resolve/test/resolver/browser_field/package.json delete mode 100644 node_modules/resolve/test/resolver/cup.coffee delete mode 100644 node_modules/resolve/test/resolver/dot_main/index.js delete mode 100644 node_modules/resolve/test/resolver/dot_main/package.json delete mode 100644 node_modules/resolve/test/resolver/dot_slash_main/index.js delete mode 100644 node_modules/resolve/test/resolver/dot_slash_main/package.json delete mode 100644 node_modules/resolve/test/resolver/foo.js delete mode 100644 node_modules/resolve/test/resolver/incorrect_main/index.js delete mode 100644 node_modules/resolve/test/resolver/incorrect_main/package.json delete mode 100644 node_modules/resolve/test/resolver/invalid_main/package.json delete mode 100644 node_modules/resolve/test/resolver/mug.coffee delete mode 100644 node_modules/resolve/test/resolver/mug.js delete mode 100644 node_modules/resolve/test/resolver/multirepo/lerna.json delete mode 100644 node_modules/resolve/test/resolver/multirepo/package.json delete mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js delete mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json delete mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js delete mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json delete mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js delete mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json delete mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js delete mode 100644 node_modules/resolve/test/resolver/other_path/lib/other-lib.js delete mode 100644 node_modules/resolve/test/resolver/other_path/root.js delete mode 100644 node_modules/resolve/test/resolver/quux/foo/index.js delete mode 100644 node_modules/resolve/test/resolver/same_names/foo.js delete mode 100644 node_modules/resolve/test/resolver/same_names/foo/index.js delete mode 100644 node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js delete mode 100644 node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep delete mode 100644 node_modules/resolve/test/resolver/symlinked/package/bar.js delete mode 100644 node_modules/resolve/test/resolver/symlinked/package/package.json delete mode 100644 node_modules/resolve/test/resolver/without_basedir/main.js delete mode 100644 node_modules/resolve/test/resolver_sync.js delete mode 100644 node_modules/resolve/test/shadowed_core.js delete mode 100644 node_modules/resolve/test/shadowed_core/node_modules/util/index.js delete mode 100644 node_modules/resolve/test/subdirs.js delete mode 100644 node_modules/resolve/test/symlinks.js delete mode 100644 node_modules/right-align/LICENSE delete mode 100644 node_modules/right-align/README.md delete mode 100644 node_modules/right-align/index.js delete mode 100644 node_modules/right-align/package.json delete mode 100644 node_modules/safe-buffer/LICENSE delete mode 100644 node_modules/safe-buffer/README.md delete mode 100644 node_modules/safe-buffer/index.d.ts delete mode 100644 node_modules/safe-buffer/index.js delete mode 100644 node_modules/safe-buffer/package.json delete mode 100644 node_modules/safer-buffer/LICENSE delete mode 100644 node_modules/safer-buffer/Porting-Buffer.md delete mode 100644 node_modules/safer-buffer/Readme.md delete mode 100644 node_modules/safer-buffer/dangerous.js delete mode 100644 node_modules/safer-buffer/package.json delete mode 100644 node_modules/safer-buffer/safer.js delete mode 100644 node_modules/safer-buffer/tests.js delete mode 100644 node_modules/send/HISTORY.md delete mode 100644 node_modules/send/LICENSE delete mode 100644 node_modules/send/README.md delete mode 100644 node_modules/send/index.js delete mode 100644 node_modules/send/node_modules/debug/.coveralls.yml delete mode 100644 node_modules/send/node_modules/debug/.eslintrc delete mode 100644 node_modules/send/node_modules/debug/.npmignore delete mode 100644 node_modules/send/node_modules/debug/.travis.yml delete mode 100644 node_modules/send/node_modules/debug/CHANGELOG.md delete mode 100644 node_modules/send/node_modules/debug/LICENSE delete mode 100644 node_modules/send/node_modules/debug/Makefile delete mode 100644 node_modules/send/node_modules/debug/README.md delete mode 100644 node_modules/send/node_modules/debug/component.json delete mode 100644 node_modules/send/node_modules/debug/karma.conf.js delete mode 100644 node_modules/send/node_modules/debug/node.js delete mode 100644 node_modules/send/node_modules/debug/package.json delete mode 100644 node_modules/send/node_modules/debug/src/browser.js delete mode 100644 node_modules/send/node_modules/debug/src/debug.js delete mode 100644 node_modules/send/node_modules/debug/src/index.js delete mode 100644 node_modules/send/node_modules/debug/src/inspector-log.js delete mode 100644 node_modules/send/node_modules/debug/src/node.js delete mode 100644 node_modules/send/node_modules/http-errors/HISTORY.md delete mode 100644 node_modules/send/node_modules/http-errors/LICENSE delete mode 100644 node_modules/send/node_modules/http-errors/README.md delete mode 100644 node_modules/send/node_modules/http-errors/index.js delete mode 100644 node_modules/send/node_modules/http-errors/package.json delete mode 100644 node_modules/send/package.json delete mode 100644 node_modules/serve-static/HISTORY.md delete mode 100644 node_modules/serve-static/LICENSE delete mode 100644 node_modules/serve-static/README.md delete mode 100644 node_modules/serve-static/index.js delete mode 100644 node_modules/serve-static/package.json delete mode 100644 node_modules/setprototypeof/LICENSE delete mode 100644 node_modules/setprototypeof/README.md delete mode 100644 node_modules/setprototypeof/index.d.ts delete mode 100644 node_modules/setprototypeof/index.js delete mode 100644 node_modules/setprototypeof/package.json delete mode 100644 node_modules/source-map/README.md delete mode 100644 node_modules/source-map/build/assert-shim.js delete mode 100644 node_modules/source-map/build/mini-require.js delete mode 100644 node_modules/source-map/build/prefix-source-map.jsm delete mode 100644 node_modules/source-map/build/prefix-utils.jsm delete mode 100644 node_modules/source-map/build/suffix-browser.js delete mode 100644 node_modules/source-map/build/suffix-source-map.jsm delete mode 100644 node_modules/source-map/build/suffix-utils.jsm delete mode 100644 node_modules/source-map/build/test-prefix.js delete mode 100644 node_modules/source-map/build/test-suffix.js delete mode 100644 node_modules/source-map/lib/source-map.js delete mode 100644 node_modules/source-map/lib/source-map/array-set.js delete mode 100644 node_modules/source-map/lib/source-map/base64-vlq.js delete mode 100644 node_modules/source-map/lib/source-map/base64.js delete mode 100644 node_modules/source-map/lib/source-map/binary-search.js delete mode 100644 node_modules/source-map/lib/source-map/mapping-list.js delete mode 100644 node_modules/source-map/lib/source-map/quick-sort.js delete mode 100644 node_modules/source-map/lib/source-map/source-map-consumer.js delete mode 100644 node_modules/source-map/lib/source-map/source-map-generator.js delete mode 100644 node_modules/source-map/lib/source-map/source-node.js delete mode 100644 node_modules/source-map/lib/source-map/util.js delete mode 100644 node_modules/source-map/package.json delete mode 100644 node_modules/statuses/HISTORY.md delete mode 100644 node_modules/statuses/LICENSE delete mode 100644 node_modules/statuses/README.md delete mode 100644 node_modules/statuses/codes.json delete mode 100644 node_modules/statuses/index.js delete mode 100644 node_modules/statuses/package.json delete mode 100644 node_modules/to-fast-properties/index.js delete mode 100644 node_modules/to-fast-properties/license delete mode 100644 node_modules/to-fast-properties/package.json delete mode 100644 node_modules/to-fast-properties/readme.md delete mode 100644 node_modules/token-stream/.npmignore delete mode 100644 node_modules/token-stream/.travis.yml delete mode 100644 node_modules/token-stream/HISTORY.md delete mode 100644 node_modules/token-stream/LICENSE delete mode 100644 node_modules/token-stream/README.md delete mode 100644 node_modules/token-stream/index.js delete mode 100644 node_modules/token-stream/package.json delete mode 100644 node_modules/token-stream/test/index.js delete mode 100755 node_modules/topo/LICENSE delete mode 100755 node_modules/topo/README.md delete mode 100755 node_modules/topo/lib/index.js delete mode 100644 node_modules/topo/node_modules/hoek/.npmignore delete mode 100644 node_modules/topo/node_modules/hoek/CHANGELOG.md delete mode 100644 node_modules/topo/node_modules/hoek/LICENSE delete mode 100755 node_modules/topo/node_modules/hoek/README.md delete mode 100755 node_modules/topo/node_modules/hoek/lib/deep-equal.js delete mode 100755 node_modules/topo/node_modules/hoek/lib/escape.js delete mode 100755 node_modules/topo/node_modules/hoek/lib/index.js delete mode 100644 node_modules/topo/node_modules/hoek/package.json delete mode 100755 node_modules/topo/package.json delete mode 100644 node_modules/transformers/.npmignore delete mode 100644 node_modules/transformers/README.md delete mode 100644 node_modules/transformers/history.md delete mode 100644 node_modules/transformers/lib/shared.js delete mode 100644 node_modules/transformers/lib/transformers.js delete mode 120000 node_modules/transformers/node_modules/.bin/uglifyjs delete mode 100644 node_modules/transformers/node_modules/is-promise/.npmignore delete mode 100644 node_modules/transformers/node_modules/is-promise/.travis.yml delete mode 100644 node_modules/transformers/node_modules/is-promise/LICENSE delete mode 100644 node_modules/transformers/node_modules/is-promise/index.js delete mode 100644 node_modules/transformers/node_modules/is-promise/package.json delete mode 100644 node_modules/transformers/node_modules/is-promise/readme.md delete mode 100644 node_modules/transformers/node_modules/promise/.npmignore delete mode 100644 node_modules/transformers/node_modules/promise/Readme.md delete mode 100644 node_modules/transformers/node_modules/promise/index.js delete mode 100644 node_modules/transformers/node_modules/promise/package.json delete mode 100644 node_modules/transformers/node_modules/source-map/.npmignore delete mode 100644 node_modules/transformers/node_modules/source-map/.travis.yml delete mode 100644 node_modules/transformers/node_modules/source-map/CHANGELOG.md delete mode 100644 node_modules/transformers/node_modules/source-map/LICENSE delete mode 100644 node_modules/transformers/node_modules/source-map/Makefile.dryice.js delete mode 100644 node_modules/transformers/node_modules/source-map/README.md delete mode 100644 node_modules/transformers/node_modules/source-map/build/assert-shim.js delete mode 100644 node_modules/transformers/node_modules/source-map/build/mini-require.js delete mode 100644 node_modules/transformers/node_modules/source-map/build/prefix-source-map.jsm delete mode 100644 node_modules/transformers/node_modules/source-map/build/prefix-utils.jsm delete mode 100644 node_modules/transformers/node_modules/source-map/build/suffix-browser.js delete mode 100644 node_modules/transformers/node_modules/source-map/build/suffix-source-map.jsm delete mode 100644 node_modules/transformers/node_modules/source-map/build/suffix-utils.jsm delete mode 100644 node_modules/transformers/node_modules/source-map/build/test-prefix.js delete mode 100644 node_modules/transformers/node_modules/source-map/build/test-suffix.js delete mode 100644 node_modules/transformers/node_modules/source-map/lib/source-map.js delete mode 100644 node_modules/transformers/node_modules/source-map/lib/source-map/array-set.js delete mode 100644 node_modules/transformers/node_modules/source-map/lib/source-map/base64-vlq.js delete mode 100644 node_modules/transformers/node_modules/source-map/lib/source-map/base64.js delete mode 100644 node_modules/transformers/node_modules/source-map/lib/source-map/binary-search.js delete mode 100644 node_modules/transformers/node_modules/source-map/lib/source-map/mapping-list.js delete mode 100644 node_modules/transformers/node_modules/source-map/lib/source-map/source-map-consumer.js delete mode 100644 node_modules/transformers/node_modules/source-map/lib/source-map/source-map-generator.js delete mode 100644 node_modules/transformers/node_modules/source-map/lib/source-map/source-node.js delete mode 100644 node_modules/transformers/node_modules/source-map/lib/source-map/util.js delete mode 100644 node_modules/transformers/node_modules/source-map/package.json delete mode 100755 node_modules/transformers/node_modules/source-map/test/run-tests.js delete mode 100644 node_modules/transformers/node_modules/source-map/test/source-map/test-api.js delete mode 100644 node_modules/transformers/node_modules/source-map/test/source-map/test-array-set.js delete mode 100644 node_modules/transformers/node_modules/source-map/test/source-map/test-base64-vlq.js delete mode 100644 node_modules/transformers/node_modules/source-map/test/source-map/test-base64.js delete mode 100644 node_modules/transformers/node_modules/source-map/test/source-map/test-binary-search.js delete mode 100644 node_modules/transformers/node_modules/source-map/test/source-map/test-dog-fooding.js delete mode 100644 node_modules/transformers/node_modules/source-map/test/source-map/test-source-map-consumer.js delete mode 100644 node_modules/transformers/node_modules/source-map/test/source-map/test-source-map-generator.js delete mode 100644 node_modules/transformers/node_modules/source-map/test/source-map/test-source-node.js delete mode 100644 node_modules/transformers/node_modules/source-map/test/source-map/test-util.js delete mode 100644 node_modules/transformers/node_modules/source-map/test/source-map/util.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/.npmignore delete mode 100644 node_modules/transformers/node_modules/uglify-js/README.md delete mode 100755 node_modules/transformers/node_modules/uglify-js/bin/uglifyjs delete mode 100644 node_modules/transformers/node_modules/uglify-js/lib/ast.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/lib/compress.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/lib/mozilla-ast.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/lib/output.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/lib/parse.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/lib/scope.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/lib/sourcemap.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/lib/transform.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/lib/utils.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/package.json delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/arrays.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/blocks.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/conditionals.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/dead-code.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/debugger.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/drop-unused.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/issue-105.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/issue-12.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/issue-22.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/issue-44.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/issue-59.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/labels.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/loops.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/properties.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/sequences.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/test/compress/switch.js delete mode 100755 node_modules/transformers/node_modules/uglify-js/test/run-tests.js delete mode 100644 node_modules/transformers/node_modules/uglify-js/tools/node.js delete mode 100644 node_modules/transformers/package.json delete mode 100644 node_modules/type-is/HISTORY.md delete mode 100644 node_modules/type-is/LICENSE delete mode 100644 node_modules/type-is/README.md delete mode 100644 node_modules/type-is/index.js delete mode 100644 node_modules/type-is/package.json delete mode 100644 node_modules/uglify-js/LICENSE delete mode 100644 node_modules/uglify-js/README.md delete mode 100644 node_modules/uglify-js/bin/extract-props.js delete mode 100755 node_modules/uglify-js/bin/uglifyjs delete mode 100644 node_modules/uglify-js/lib/ast.js delete mode 100644 node_modules/uglify-js/lib/compress.js delete mode 100644 node_modules/uglify-js/lib/mozilla-ast.js delete mode 100644 node_modules/uglify-js/lib/output.js delete mode 100644 node_modules/uglify-js/lib/parse.js delete mode 100644 node_modules/uglify-js/lib/propmangle.js delete mode 100644 node_modules/uglify-js/lib/scope.js delete mode 100644 node_modules/uglify-js/lib/sourcemap.js delete mode 100644 node_modules/uglify-js/lib/transform.js delete mode 100644 node_modules/uglify-js/lib/utils.js delete mode 100644 node_modules/uglify-js/node_modules/source-map/CHANGELOG.md delete mode 100644 node_modules/uglify-js/node_modules/source-map/LICENSE delete mode 100644 node_modules/uglify-js/node_modules/source-map/README.md delete mode 100644 node_modules/uglify-js/node_modules/source-map/dist/source-map.debug.js delete mode 100644 node_modules/uglify-js/node_modules/source-map/dist/source-map.js delete mode 100644 node_modules/uglify-js/node_modules/source-map/dist/source-map.min.js delete mode 100644 node_modules/uglify-js/node_modules/source-map/dist/source-map.min.js.map delete mode 100644 node_modules/uglify-js/node_modules/source-map/lib/array-set.js delete mode 100644 node_modules/uglify-js/node_modules/source-map/lib/base64-vlq.js delete mode 100644 node_modules/uglify-js/node_modules/source-map/lib/base64.js delete mode 100644 node_modules/uglify-js/node_modules/source-map/lib/binary-search.js delete mode 100644 node_modules/uglify-js/node_modules/source-map/lib/mapping-list.js delete mode 100644 node_modules/uglify-js/node_modules/source-map/lib/quick-sort.js delete mode 100644 node_modules/uglify-js/node_modules/source-map/lib/source-map-consumer.js delete mode 100644 node_modules/uglify-js/node_modules/source-map/lib/source-map-generator.js delete mode 100644 node_modules/uglify-js/node_modules/source-map/lib/source-node.js delete mode 100644 node_modules/uglify-js/node_modules/source-map/lib/util.js delete mode 100644 node_modules/uglify-js/node_modules/source-map/package.json delete mode 100644 node_modules/uglify-js/node_modules/source-map/source-map.js delete mode 100644 node_modules/uglify-js/package.json delete mode 100644 node_modules/uglify-js/tools/domprops.json delete mode 100644 node_modules/uglify-js/tools/exports.js delete mode 100644 node_modules/uglify-js/tools/node.js delete mode 100644 node_modules/uglify-js/tools/props.html delete mode 100644 node_modules/uglify-to-browserify/.npmignore delete mode 100644 node_modules/uglify-to-browserify/.travis.yml delete mode 100644 node_modules/uglify-to-browserify/LICENSE delete mode 100644 node_modules/uglify-to-browserify/README.md delete mode 100644 node_modules/uglify-to-browserify/index.js delete mode 100644 node_modules/uglify-to-browserify/package.json delete mode 100644 node_modules/uglify-to-browserify/test/index.js delete mode 100644 node_modules/unpipe/HISTORY.md delete mode 100644 node_modules/unpipe/LICENSE delete mode 100644 node_modules/unpipe/README.md delete mode 100644 node_modules/unpipe/index.js delete mode 100644 node_modules/unpipe/package.json delete mode 100644 node_modules/utils-merge/.npmignore delete mode 100644 node_modules/utils-merge/LICENSE delete mode 100644 node_modules/utils-merge/README.md delete mode 100644 node_modules/utils-merge/index.js delete mode 100644 node_modules/utils-merge/package.json delete mode 100644 node_modules/vary/HISTORY.md delete mode 100644 node_modules/vary/LICENSE delete mode 100644 node_modules/vary/README.md delete mode 100644 node_modules/vary/index.js delete mode 100644 node_modules/vary/package.json delete mode 100644 node_modules/void-elements/.gitattributes delete mode 100644 node_modules/void-elements/.npmignore delete mode 100644 node_modules/void-elements/.travis.yml delete mode 100644 node_modules/void-elements/LICENSE delete mode 100644 node_modules/void-elements/README.md delete mode 100644 node_modules/void-elements/index.js delete mode 100644 node_modules/void-elements/package.json delete mode 100644 node_modules/void-elements/pre-publish.js delete mode 100644 node_modules/void-elements/test/index.js delete mode 100644 node_modules/window-size/LICENSE-MIT delete mode 100644 node_modules/window-size/README.md delete mode 100644 node_modules/window-size/index.js delete mode 100644 node_modules/window-size/package.json delete mode 100644 node_modules/with/.npmignore delete mode 100644 node_modules/with/LICENSE delete mode 100644 node_modules/with/README.md delete mode 100644 node_modules/with/index.js delete mode 120000 node_modules/with/node_modules/.bin/acorn delete mode 100644 node_modules/with/node_modules/acorn/.editorconfig delete mode 100644 node_modules/with/node_modules/acorn/.gitattributes delete mode 100644 node_modules/with/node_modules/acorn/.npmignore delete mode 100644 node_modules/with/node_modules/acorn/.tern-project delete mode 100644 node_modules/with/node_modules/acorn/.travis.yml delete mode 100644 node_modules/with/node_modules/acorn/AUTHORS delete mode 100644 node_modules/with/node_modules/acorn/LICENSE delete mode 100644 node_modules/with/node_modules/acorn/README.md delete mode 100755 node_modules/with/node_modules/acorn/bin/acorn delete mode 100644 node_modules/with/node_modules/acorn/bin/build-acorn.js delete mode 100644 node_modules/with/node_modules/acorn/bin/generate-identifier-regex.js delete mode 100755 node_modules/with/node_modules/acorn/bin/prepublish.sh delete mode 100755 node_modules/with/node_modules/acorn/bin/update_authors.sh delete mode 100755 node_modules/with/node_modules/acorn/bin/without_eval delete mode 100644 node_modules/with/node_modules/acorn/dist/.keep delete mode 100644 node_modules/with/node_modules/acorn/dist/acorn.js delete mode 100644 node_modules/with/node_modules/acorn/dist/acorn_csp.js delete mode 100644 node_modules/with/node_modules/acorn/dist/acorn_loose.js delete mode 100644 node_modules/with/node_modules/acorn/dist/walk.js delete mode 100644 node_modules/with/node_modules/acorn/package.json delete mode 100755 node_modules/with/node_modules/acorn/src/expression.js delete mode 100644 node_modules/with/node_modules/acorn/src/identifier.js delete mode 100644 node_modules/with/node_modules/acorn/src/index.js delete mode 100755 node_modules/with/node_modules/acorn/src/location.js delete mode 100644 node_modules/with/node_modules/acorn/src/loose/acorn_loose.js delete mode 100644 node_modules/with/node_modules/acorn/src/loose/expression.js delete mode 100644 node_modules/with/node_modules/acorn/src/loose/index.js delete mode 100644 node_modules/with/node_modules/acorn/src/loose/parseutil.js delete mode 100644 node_modules/with/node_modules/acorn/src/loose/state.js delete mode 100644 node_modules/with/node_modules/acorn/src/loose/statement.js delete mode 100644 node_modules/with/node_modules/acorn/src/loose/tokenize.js delete mode 100755 node_modules/with/node_modules/acorn/src/lval.js delete mode 100755 node_modules/with/node_modules/acorn/src/node.js delete mode 100644 node_modules/with/node_modules/acorn/src/options.js delete mode 100644 node_modules/with/node_modules/acorn/src/parseutil.js delete mode 100644 node_modules/with/node_modules/acorn/src/state.js delete mode 100644 node_modules/with/node_modules/acorn/src/statement.js delete mode 100644 node_modules/with/node_modules/acorn/src/tokencontext.js delete mode 100644 node_modules/with/node_modules/acorn/src/tokenize.js delete mode 100644 node_modules/with/node_modules/acorn/src/tokentype.js delete mode 100644 node_modules/with/node_modules/acorn/src/util.js delete mode 100644 node_modules/with/node_modules/acorn/src/walk/index.js delete mode 100644 node_modules/with/node_modules/acorn/src/whitespace.js delete mode 100644 node_modules/with/package.json delete mode 100644 node_modules/wordwrap/LICENSE delete mode 100644 node_modules/wordwrap/README.markdown delete mode 100644 node_modules/wordwrap/example/center.js delete mode 100644 node_modules/wordwrap/example/meat.js delete mode 100644 node_modules/wordwrap/index.js delete mode 100644 node_modules/wordwrap/package.json delete mode 100644 node_modules/wordwrap/test/break.js delete mode 100644 node_modules/wordwrap/test/idleness.txt delete mode 100644 node_modules/wordwrap/test/wrap.js delete mode 100644 node_modules/xml2json/.editorconfig delete mode 100644 node_modules/xml2json/.npmignore delete mode 100644 node_modules/xml2json/.travis.yml delete mode 100644 node_modules/xml2json/AUTHORS delete mode 100644 node_modules/xml2json/README.md delete mode 100755 node_modules/xml2json/bin/xml2json delete mode 100644 node_modules/xml2json/example.js delete mode 100644 node_modules/xml2json/index.js delete mode 100644 node_modules/xml2json/lib/index.js delete mode 100644 node_modules/xml2json/lib/json2xml.js delete mode 100644 node_modules/xml2json/lib/sanitize.js delete mode 100644 node_modules/xml2json/lib/xml2json.js delete mode 100644 node_modules/xml2json/package-lock.json delete mode 100644 node_modules/xml2json/package.json delete mode 100644 node_modules/xml2json/t.js delete mode 100644 node_modules/xml2json/test/.npmignore delete mode 100644 node_modules/xml2json/test/coerce-overhead.js delete mode 100644 node_modules/xml2json/test/fixtures/alternate-text-node-A.json delete mode 100644 node_modules/xml2json/test/fixtures/alternate-text-node-A.xml delete mode 100644 node_modules/xml2json/test/fixtures/alternate-text-node-B.json delete mode 100644 node_modules/xml2json/test/fixtures/alternate-text-node-C.json delete mode 100644 node_modules/xml2json/test/fixtures/alternate-text-node-D.json delete mode 100644 node_modules/xml2json/test/fixtures/alternate-text-node-D.xml delete mode 100644 node_modules/xml2json/test/fixtures/array-notation.json delete mode 100644 node_modules/xml2json/test/fixtures/array-notation.xml delete mode 100644 node_modules/xml2json/test/fixtures/coerce.json delete mode 100644 node_modules/xml2json/test/fixtures/coerce.xml delete mode 100644 node_modules/xml2json/test/fixtures/domain-reversible.json delete mode 100644 node_modules/xml2json/test/fixtures/domain.json delete mode 100644 node_modules/xml2json/test/fixtures/domain.xml delete mode 100644 node_modules/xml2json/test/fixtures/forceArray.json delete mode 100644 node_modules/xml2json/test/fixtures/forceArray.xml delete mode 100644 node_modules/xml2json/test/fixtures/large.json delete mode 100644 node_modules/xml2json/test/fixtures/large.xml delete mode 100644 node_modules/xml2json/test/fixtures/null-properties-ignored.xml delete mode 100644 node_modules/xml2json/test/fixtures/null-properties-not-ignored.xml delete mode 100644 node_modules/xml2json/test/fixtures/null-properties.json delete mode 100644 node_modules/xml2json/test/fixtures/reorder.json delete mode 100644 node_modules/xml2json/test/fixtures/reorder.xml delete mode 100644 node_modules/xml2json/test/fixtures/spacetext.json delete mode 100644 node_modules/xml2json/test/fixtures/spacetext.xml delete mode 100644 node_modules/xml2json/test/fixtures/xmlsanitize.json delete mode 100644 node_modules/xml2json/test/fixtures/xmlsanitize.xml delete mode 100644 node_modules/xml2json/test/fixtures/xmlsanitize2.json delete mode 100644 node_modules/xml2json/test/fixtures/xmlsanitize2.xml delete mode 100644 node_modules/xml2json/test/fixtures/xmlsanitize3.json delete mode 100644 node_modules/xml2json/test/fixtures/xmlsanitize3.xml delete mode 100644 node_modules/xml2json/test/test-reorder.js delete mode 100644 node_modules/xml2json/test/test-space.js delete mode 100644 node_modules/xml2json/test/test-xmlsanitize.js delete mode 100644 node_modules/xml2json/test/test.js delete mode 100644 node_modules/yargs/CHANGELOG.md delete mode 100644 node_modules/yargs/LICENSE delete mode 100644 node_modules/yargs/README.md delete mode 100644 node_modules/yargs/completion.sh.hbs delete mode 100644 node_modules/yargs/index.js delete mode 100644 node_modules/yargs/lib/completion.js delete mode 100644 node_modules/yargs/lib/parser.js delete mode 100644 node_modules/yargs/lib/usage.js delete mode 100644 node_modules/yargs/lib/validation.js delete mode 100644 node_modules/yargs/package.json diff --git a/.gitignore b/.gitignore index 96f6fd4..b14f81e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ sources/ .idea +node_modules diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn deleted file mode 120000 index cf76760..0000000 --- a/node_modules/.bin/acorn +++ /dev/null @@ -1 +0,0 @@ -../acorn/bin/acorn \ No newline at end of file diff --git a/node_modules/.bin/cleancss b/node_modules/.bin/cleancss deleted file mode 120000 index 2a3439e..0000000 --- a/node_modules/.bin/cleancss +++ /dev/null @@ -1 +0,0 @@ -../clean-css/bin/cleancss \ No newline at end of file diff --git a/node_modules/.bin/jade b/node_modules/.bin/jade deleted file mode 120000 index 65a3bac..0000000 --- a/node_modules/.bin/jade +++ /dev/null @@ -1 +0,0 @@ -../jade/bin/jade.js \ No newline at end of file diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime deleted file mode 120000 index fbb7ee0..0000000 --- a/node_modules/.bin/mime +++ /dev/null @@ -1 +0,0 @@ -../mime/cli.js \ No newline at end of file diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp deleted file mode 120000 index 017896c..0000000 --- a/node_modules/.bin/mkdirp +++ /dev/null @@ -1 +0,0 @@ -../mkdirp/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/parser b/node_modules/.bin/parser deleted file mode 120000 index ce7bf97..0000000 --- a/node_modules/.bin/parser +++ /dev/null @@ -1 +0,0 @@ -../@babel/parser/bin/babel-parser.js \ No newline at end of file diff --git a/node_modules/.bin/uglifyjs b/node_modules/.bin/uglifyjs deleted file mode 120000 index fef3468..0000000 --- a/node_modules/.bin/uglifyjs +++ /dev/null @@ -1 +0,0 @@ -../uglify-js/bin/uglifyjs \ No newline at end of file diff --git a/node_modules/.bin/xml2json b/node_modules/.bin/xml2json deleted file mode 120000 index e9c9350..0000000 --- a/node_modules/.bin/xml2json +++ /dev/null @@ -1 +0,0 @@ -../xml2json/bin/xml2json \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/LICENSE b/node_modules/@babel/helper-validator-identifier/LICENSE deleted file mode 100644 index f31575e..0000000 --- a/node_modules/@babel/helper-validator-identifier/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie 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/@babel/helper-validator-identifier/README.md b/node_modules/@babel/helper-validator-identifier/README.md deleted file mode 100644 index 6733576..0000000 --- a/node_modules/@babel/helper-validator-identifier/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-validator-identifier - -> Validate identifier/keywords name - -See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/babel-helper-validator-identifier) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-validator-identifier -``` - -or using yarn: - -```sh -yarn add @babel/helper-validator-identifier --dev -``` diff --git a/node_modules/@babel/helper-validator-identifier/lib/identifier.js b/node_modules/@babel/helper-validator-identifier/lib/identifier.js deleted file mode 100644 index 51ec763..0000000 --- a/node_modules/@babel/helper-validator-identifier/lib/identifier.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isIdentifierStart = isIdentifierStart; -exports.isIdentifierChar = isIdentifierChar; -exports.isIdentifierName = isIdentifierName; -let 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-\u08c7\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\u0d04-\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-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\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-\uab69\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"; -let 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\u0b55-\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\u0d81-\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\u1abf\u1ac0\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\ua82c\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"; -const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; -const 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, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 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, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 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, 190, 0, 80, 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, 1237, 43, 8, 8952, 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, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; -const 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, 370, 1, 154, 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, 2, 11, 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, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 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, 82, 0, 12, 1, 19628, 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, 4759, 9, 787719, 239]; - -function isInAstralSet(code, set) { - let pos = 0x10000; - - for (let i = 0, length = set.length; i < length; i += 2) { - pos += set[i]; - if (pos > code) return false; - pos += set[i + 1]; - if (pos >= code) return true; - } - - return false; -} - -function isIdentifierStart(code) { - if (code < 65) return code === 36; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes); -} - -function isIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); -} - -function isIdentifierName(name) { - let isFirst = true; - - for (let _i = 0, _Array$from = Array.from(name); _i < _Array$from.length; _i++) { - const char = _Array$from[_i]; - const cp = char.codePointAt(0); - - if (isFirst) { - if (!isIdentifierStart(cp)) { - return false; - } - - isFirst = false; - } else if (!isIdentifierChar(cp)) { - return false; - } - } - - return !isFirst; -} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/lib/index.js b/node_modules/@babel/helper-validator-identifier/lib/index.js deleted file mode 100644 index 7b623c9..0000000 --- a/node_modules/@babel/helper-validator-identifier/lib/index.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "isIdentifierName", { - enumerable: true, - get: function () { - return _identifier.isIdentifierName; - } -}); -Object.defineProperty(exports, "isIdentifierChar", { - enumerable: true, - get: function () { - return _identifier.isIdentifierChar; - } -}); -Object.defineProperty(exports, "isIdentifierStart", { - enumerable: true, - get: function () { - return _identifier.isIdentifierStart; - } -}); -Object.defineProperty(exports, "isReservedWord", { - enumerable: true, - get: function () { - return _keyword.isReservedWord; - } -}); -Object.defineProperty(exports, "isStrictBindOnlyReservedWord", { - enumerable: true, - get: function () { - return _keyword.isStrictBindOnlyReservedWord; - } -}); -Object.defineProperty(exports, "isStrictBindReservedWord", { - enumerable: true, - get: function () { - return _keyword.isStrictBindReservedWord; - } -}); -Object.defineProperty(exports, "isStrictReservedWord", { - enumerable: true, - get: function () { - return _keyword.isStrictReservedWord; - } -}); -Object.defineProperty(exports, "isKeyword", { - enumerable: true, - get: function () { - return _keyword.isKeyword; - } -}); - -var _identifier = require("./identifier"); - -var _keyword = require("./keyword"); \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/lib/keyword.js b/node_modules/@babel/helper-validator-identifier/lib/keyword.js deleted file mode 100644 index 110cee4..0000000 --- a/node_modules/@babel/helper-validator-identifier/lib/keyword.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isReservedWord = isReservedWord; -exports.isStrictReservedWord = isStrictReservedWord; -exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; -exports.isStrictBindReservedWord = isStrictBindReservedWord; -exports.isKeyword = isKeyword; -const reservedWords = { - keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], - strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], - strictBind: ["eval", "arguments"] -}; -const keywords = new Set(reservedWords.keyword); -const reservedWordsStrictSet = new Set(reservedWords.strict); -const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); - -function isReservedWord(word, inModule) { - return inModule && word === "await" || word === "enum"; -} - -function isStrictReservedWord(word, inModule) { - return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); -} - -function isStrictBindOnlyReservedWord(word) { - return reservedWordsStrictBindSet.has(word); -} - -function isStrictBindReservedWord(word, inModule) { - return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); -} - -function isKeyword(word) { - return keywords.has(word); -} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/package.json b/node_modules/@babel/helper-validator-identifier/package.json deleted file mode 100644 index 9e50c70..0000000 --- a/node_modules/@babel/helper-validator-identifier/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "_from": "@babel/helper-validator-identifier@^7.12.11", - "_id": "@babel/helper-validator-identifier@7.12.11", - "_inBundle": false, - "_integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "_location": "/@babel/helper-validator-identifier", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@babel/helper-validator-identifier@^7.12.11", - "name": "@babel/helper-validator-identifier", - "escapedName": "@babel%2fhelper-validator-identifier", - "scope": "@babel", - "rawSpec": "^7.12.11", - "saveSpec": null, - "fetchSpec": "^7.12.11" - }, - "_requiredBy": [ - "/@babel/types" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "_shasum": "c9a1f021917dcb5ccf0d4e453e399022981fc9ed", - "_spec": "@babel/helper-validator-identifier@^7.12.11", - "_where": "/var/www/html/gtg2nodejs/node_modules/@babel/types", - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Validate identifier/keywords name", - "devDependencies": { - "charcodes": "^0.2.0", - "unicode-13.0.0": "^0.8.0" - }, - "exports": "./lib/index.js", - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "./lib/index.js", - "name": "@babel/helper-validator-identifier", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-validator-identifier" - }, - "version": "7.12.11" -} diff --git a/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js b/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js deleted file mode 100644 index 70b3715..0000000 --- a/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; - -// Always use the latest available version of Unicode! -// https://tc39.github.io/ecma262/#sec-conformance -const version = "13.0.0"; - -const start = require("unicode-" + - version + - "/Binary_Property/ID_Start/code-points.js").filter(function (ch) { - return ch > 0x7f; -}); -let last = -1; -const cont = [0x200c, 0x200d].concat( - require("unicode-" + - version + - "/Binary_Property/ID_Continue/code-points.js").filter(function (ch) { - return ch > 0x7f && search(start, ch, last + 1) == -1; - }) -); - -function search(arr, ch, starting) { - for (let i = starting; arr[i] <= ch && i < arr.length; last = i++) { - if (arr[i] === ch) return i; - } - return -1; -} - -function pad(str, width) { - while (str.length < width) str = "0" + str; - return str; -} - -function esc(code) { - const hex = code.toString(16); - if (hex.length <= 2) return "\\x" + pad(hex, 2); - else return "\\u" + pad(hex, 4); -} - -function generate(chars) { - const astral = []; - let re = ""; - for (let i = 0, at = 0x10000; i < chars.length; i++) { - const from = chars[i]; - let to = from; - while (i < chars.length - 1 && chars[i + 1] == to + 1) { - i++; - to++; - } - if (to <= 0xffff) { - if (from == to) re += esc(from); - else if (from + 1 == to) re += esc(from) + esc(to); - else re += esc(from) + "-" + esc(to); - } else { - astral.push(from - at, to - from); - at = to; - } - } - return { nonASCII: re, astral: astral }; -} - -const startData = generate(start); -const contData = generate(cont); - -console.log("/* prettier-ignore */"); -console.log('let nonASCIIidentifierStartChars = "' + startData.nonASCII + '";'); -console.log("/* prettier-ignore */"); -console.log('let nonASCIIidentifierChars = "' + contData.nonASCII + '";'); -console.log("/* prettier-ignore */"); -console.log( - "const astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";" -); -console.log("/* prettier-ignore */"); -console.log( - "const astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";" -); diff --git a/node_modules/@babel/parser/CHANGELOG.md b/node_modules/@babel/parser/CHANGELOG.md deleted file mode 100644 index b3840ac..0000000 --- a/node_modules/@babel/parser/CHANGELOG.md +++ /dev/null @@ -1,1073 +0,0 @@ -# Changelog - -> **Tags:** -> - :boom: [Breaking Change] -> - :eyeglasses: [Spec Compliance] -> - :rocket: [New Feature] -> - :bug: [Bug Fix] -> - :memo: [Documentation] -> - :house: [Internal] -> - :nail_care: [Polish] - -> Semver Policy: https://github.com/babel/babel/tree/main/packages/babel-parser#semver - -_Note: Gaps between patch versions are faulty, broken or test releases._ - -See the [Babel Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) for the pre-6.8.0 version Changelog. - -## 6.17.1 (2017-05-10) - -### :bug: Bug Fix - * Fix typo in flow spread operator error (Brian Ng) - * Fixed invalid number literal parsing ([#473](https://github.com/babel/babylon/pull/473)) (Alex Kuzmenko) - * Fix number parser ([#433](https://github.com/babel/babylon/pull/433)) (Alex Kuzmenko) - * Ensure non pattern shorthand props are checked for reserved words ([#479](https://github.com/babel/babylon/pull/479)) (Brian Ng) - * Remove jsx context when parsing arrow functions ([#475](https://github.com/babel/babylon/pull/475)) (Brian Ng) - * Allow super in class properties ([#499](https://github.com/babel/babylon/pull/499)) (Brian Ng) - * Allow flow class field to be named constructor ([#510](https://github.com/babel/babylon/pull/510)) (Brian Ng) - -## 6.17.0 (2017-04-20) - -### :bug: Bug Fix - * Cherry-pick #418 to 6.x ([#476](https://github.com/babel/babylon/pull/476)) (Sebastian McKenzie) - * Add support for invalid escapes in tagged templates ([#274](https://github.com/babel/babylon/pull/274)) (Kevin Gibbons) - * Throw error if new.target is used outside of a function ([#402](https://github.com/babel/babylon/pull/402)) (Brian Ng) - * Fix parsing of class properties ([#351](https://github.com/babel/babylon/pull/351)) (Kevin Gibbons) - * Fix parsing yield with dynamicImport ([#383](https://github.com/babel/babylon/pull/383)) (Brian Ng) - * Ensure consistent start args for parseParenItem ([#386](https://github.com/babel/babylon/pull/386)) (Brian Ng) - -## 7.0.0-beta.8 (2017-04-04) - -### New Feature -* Add support for flow type spread (#418) (Conrad Buck) -* Allow statics in flow interfaces (#427) (Brian Ng) - -### Bug Fix -* Fix predicate attachment to match flow parser (#428) (Brian Ng) -* Add extra.raw back to JSXText and JSXAttribute (#344) (Alex Rattray) -* Fix rest parameters with array and objects (#424) (Brian Ng) -* Fix number parser (#433) (Alex Kuzmenko) - -### Docs -* Fix CONTRIBUTING.md [skip ci] (#432) (Alex Kuzmenko) - -### Internal -* Use babel-register script when running babel smoke tests (#442) (Brian Ng) - -## 7.0.0-beta.7 (2017-03-22) - -### Spec Compliance -* Remove babylon plugin for template revision since it's stage-4 (#426) (Henry Zhu) - -### Bug Fix - -* Fix push-pop logic in flow (#405) (Daniel Tschinder) - -## 7.0.0-beta.6 (2017-03-21) - -### New Feature -* Add support for invalid escapes in tagged templates (#274) (Kevin Gibbons) - -### Polish -* Improves error message when super is called outside of constructor (#408) (Arshabh Kumar Agarwal) - -### Docs - -* [7.0] Moved value field in spec from ObjectMember to ObjectProperty as ObjectMethod's don't have it (#415) [skip ci] (James Browning) - -## 7.0.0-beta.5 (2017-03-21) - -### Bug Fix -* Throw error if new.target is used outside of a function (#402) (Brian Ng) -* Fix parsing of class properties (#351) (Kevin Gibbons) - -### Other - * Test runner: Detect extra property in 'actual' but not in 'expected'. (#407) (Andy) - * Optimize travis builds (#419) (Daniel Tschinder) - * Update codecov to 2.0 (#412) (Daniel Tschinder) - * Fix spec for ClassMethod: It doesn't have a function, it *is* a function. (#406) [skip ci] (Andy) - * Changed Non-existent RestPattern to RestElement which is what is actually parsed (#409) [skip ci] (James Browning) - * Upgrade flow to 0.41 (Daniel Tschinder) - * Fix watch command (#403) (Brian Ng) - * Update yarn lock (Daniel Tschinder) - * Fix watch command (#403) (Brian Ng) - * chore(package): update flow-bin to version 0.41.0 (#395) (greenkeeper[bot]) - * Add estree test for correct order of directives (Daniel Tschinder) - * Add DoExpression to spec (#364) (Alex Kuzmenko) - * Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci] (Sumedh Nimkarde) - * Explain how to run only one test (#389) [skip ci] (Aaron Ang) - - ## 7.0.0-beta.4 (2017-03-01) - -* Don't consume async when checking for async func decl (#377) (Brian Ng) -* add `ranges` option [skip ci] (Henry Zhu) -* Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) (Andrew Levine) - -## 7.0.0-beta.3 (2017-02-28) - -- [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384) -- Merge changes from 6.x - -## 7.0.0-beta.2 (2017-02-20) - -- estree: correctly change literals in all cases (#368) (Daniel Tschinder) - -## 7.0.0-beta.1 (2017-02-20) - -- Fix negative number literal typeannotations (#366) (Daniel Tschinder) -- Update contributing with more test info [skip ci] (#355) (Brian Ng) - -## 7.0.0-beta.0 (2017-02-15) - -- Reintroduce Variance node (#333) (Daniel Tschinder) -- Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) (Charles Pick) -- [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349) (Brandon Dail) -- chore(package): update ava to version 0.18.0 (#345) (greenkeeper[bot]) -- chore(package): update babel-plugin-istanbul to version 4.0.0 (#350) (greenkeeper[bot]) -- Change location of ObjectTypeIndexer to match flow (#228) (Daniel Tschinder) -- Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) (Toru Kobayashi) -- Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290) (Daniel Tschinder) -- Remove classConstructorCall plugin (#291) (Brian Ng) -- Update yarn.lock (Daniel Tschinder) -- Update cross-env to 3.x (Daniel Tschinder) -- [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284) (Sergey Rubanov) -- Remove `String.fromCodePoint` shim (#279) (Mathias Bynens) - -## 6.16.1 (2017-02-23) - -### :bug: Regression - -- Revert "Fix export default async function to be FunctionDeclaration" ([#375](https://github.com/babel/babylon/pull/375)) - -Need to modify Babel for this AST node change, so moving to 7.0. - -- Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" ([#376](https://github.com/babel/babylon/pull/376)) - -[react-native](https://github.com/facebook/react-native/issues/12542) broke with this so we reverted. - -## 6.16.0 (2017-02-23) - -### :rocket: New Feature - -***ESTree*** compatibility as plugin ([#277](https://github.com/babel/babylon/pull/277)) (Daniel Tschinder) - -We finally introduce a new compatibility layer for ESTree. To put babylon into ESTree-compatible mode the new plugin `estree` can be enabled. In this mode the parser will output an AST that is compliant to the specs of [ESTree](https://github.com/estree/estree/) - -We highly recommend everyone who uses babylon outside of babel to use this plugin. This will make it much easier for users to switch between different ESTree-compatible parsers. We so far tested several projects with different parsers and exchanged their parser to babylon and in nearly all cases it worked out of the box. Some other estree-compatible parsers include `acorn`, `esprima`, `espree`, `flow-parser`, etc. - -To enable `estree` mode simply add the plugin in the config: -```json -{ - "plugins": [ "estree" ] -} -``` - -If you want to migrate your project from non-ESTree mode to ESTree, have a look at our [Readme](https://github.com/babel/babylon/#output), where all deviations are mentioned. - -Add a parseExpression public method ([#213](https://github.com/babel/babylon/pull/213)) (jeromew) - -Babylon exports a new function to parse a single expression - -```js -import { parseExpression } from 'babylon'; - -const ast = parseExpression('x || y && z', options); -``` - -The returned AST will only consist of the expression. The options are the same as for `parse()` - -Add startLine option ([#346](https://github.com/babel/babylon/pull/346)) (Raphael Mu) - -A new option was added to babylon allowing to change the initial linenumber for the first line which is usually `1`. -Changing this for example to `100` will make line `1` of the input source to be marked as line `100`, line `2` as `101`, line `3` as `102`, ... - -Function predicate declaration ([#103](https://github.com/babel/babylon/pull/103)) (Panagiotis Vekris) - -Added support for function predicates which flow introduced in version 0.33.0 - -```js -declare function is_number(x: mixed): boolean %checks(typeof x === "number"); -``` - -Allow imports in declare module ([#315](https://github.com/babel/babylon/pull/315)) (Daniel Tschinder) - -Added support for imports within module declarations which flow introduced in version 0.37.0 - -```js -declare module "C" { - import type { DT } from "D"; - declare export type CT = { D: DT }; -} -``` - -### :eyeglasses: Spec Compliance - -Forbid semicolons after decorators in classes ([#352](https://github.com/babel/babylon/pull/352)) (Kevin Gibbons) - -This example now correctly throws an error when there is a semicolon after the decorator: - -```js -class A { -@a; -foo(){} -} -``` - -Keywords are not allowed as local specifier ([#307](https://github.com/babel/babylon/pull/307)) (Daniel Tschinder) - -Using keywords in imports is not allowed anymore: - -```js -import { default } from "foo"; -import { a as debugger } from "foo"; -``` - -Do not allow overwritting of primitive types ([#314](https://github.com/babel/babylon/pull/314)) (Daniel Tschinder) - -In flow it is now forbidden to overwrite the primitive types `"any"`, `"mixed"`, `"empty"`, `"bool"`, `"boolean"`, `"number"`, `"string"`, `"void"` and `"null"` with your own type declaration. - -Disallow import type { type a } from … ([#305](https://github.com/babel/babylon/pull/305)) (Daniel Tschinder) - -The following code now correctly throws an error - -```js -import type { type a } from "foo"; -``` - -Don't parse class properties without initializers when classProperties is disabled and Flow is enabled ([#300](https://github.com/babel/babylon/pull/300)) (Andrew Levine) - -Ensure that you enable the `classProperties` plugin in order to enable correct parsing of class properties. Prior to this version it was possible to parse them by enabling the `flow` plugin but this was not intended the behaviour. - -If you enable the flow plugin you can only define the type of the class properties, but not initialize them. - -Fix export default async function to be FunctionDeclaration ([#324](https://github.com/babel/babylon/pull/324)) (Daniel Tschinder) - -Parsing the following code now returns a `FunctionDeclaration` AST node instead of `FunctionExpression`. - -```js -export default async function bar() {}; -``` - -### :nail_care: Polish - -Improve error message on attempt to destructure named import ([#288](https://github.com/babel/babylon/pull/288)) (Brian Ng) - -### :bug: Bug Fix - -Fix negative number literal typeannotations ([#366](https://github.com/babel/babylon/pull/366)) (Daniel Tschinder) - -Ensure takeDecorators is called on exported class ([#358](https://github.com/babel/babylon/pull/358)) (Brian Ng) - -ESTree: correctly change literals in all cases ([#368](https://github.com/babel/babylon/pull/368)) (Daniel Tschinder) - -Correctly convert RestProperty to Assignable ([#339](https://github.com/babel/babylon/pull/339)) (Daniel Tschinder) - -Fix #321 by allowing question marks in type params ([#338](https://github.com/babel/babylon/pull/338)) (Daniel Tschinder) - -Fix #336 by correctly setting arrow-param ([#337](https://github.com/babel/babylon/pull/337)) (Daniel Tschinder) - -Fix parse error when destructuring `set` with default value ([#317](https://github.com/babel/babylon/pull/317)) (Brian Ng) - -Fix ObjectTypeCallProperty static ([#298](https://github.com/babel/babylon/pull/298)) (Dan Harper) - - -### :house: Internal - -Fix generator-method-with-computed-name spec ([#360](https://github.com/babel/babylon/pull/360)) (Alex Rattray) - -Fix flow type-parameter-declaration test with unintended semantic ([#361](https://github.com/babel/babylon/pull/361)) (Alex Rattray) - -Cleanup and splitup parser functions ([#295](https://github.com/babel/babylon/pull/295)) (Daniel Tschinder) - -chore(package): update flow-bin to version 0.38.0 ([#313](https://github.com/babel/babylon/pull/313)) (greenkeeper[bot]) - -Call inner function instead of 1:1 copy to plugin ([#294](https://github.com/babel/babylon/pull/294)) (Daniel Tschinder) - -Update eslint-config-babel to the latest version 🚀 ([#299](https://github.com/babel/babylon/pull/299)) (greenkeeper[bot]) - -Update eslint-config-babel to the latest version 🚀 ([#293](https://github.com/babel/babylon/pull/293)) (greenkeeper[bot]) - -devDeps: remove eslint-plugin-babel ([#292](https://github.com/babel/babylon/pull/292)) (Kai Cataldo) - -Correct indent eslint rule config ([#276](https://github.com/babel/babylon/pull/276)) (Daniel Tschinder) - -Fail tests that have expected.json and throws-option ([#285](https://github.com/babel/babylon/pull/285)) (Daniel Tschinder) - -### :memo: Documentation - -Update contributing with more test info [skip ci] ([#355](https://github.com/babel/babylon/pull/355)) (Brian Ng) - -Update API documentation ([#330](https://github.com/babel/babylon/pull/330)) (Timothy Gu) - -Added keywords to package.json ([#323](https://github.com/babel/babylon/pull/323)) (Dmytro) - -AST spec: fix casing of `RegExpLiteral` ([#318](https://github.com/babel/babylon/pull/318)) (Mathias Bynens) - -## 6.15.0 (2017-01-10) - -### :eyeglasses: Spec Compliance - -Add support for Flow shorthand import type ([#267](https://github.com/babel/babylon/pull/267)) (Jeff Morrison) - -This change implements flows new shorthand import syntax -and where previously you had to write this code: - -```js -import {someValue} from "blah"; -import type {someType} from "blah"; -import typeof {someOtherValue} from "blah"; -``` - -you can now write it like this: - -```js -import { - someValue, - type someType, - typeof someOtherValue, -} from "blah"; -``` - -For more information look at [this](https://github.com/facebook/flow/pull/2890) pull request. - -flow: allow leading pipes in all positions ([#256](https://github.com/babel/babylon/pull/256)) (Vladimir Kurchatkin) - -This change now allows a leading pipe everywhere types can be used: -```js -var f = (x): | 1 | 2 => 1; -``` - -Throw error when exporting non-declaration ([#241](https://github.com/babel/babylon/pull/241)) (Kai Cataldo) - -Previously babylon parsed the following exports, although they are not valid: -```js -export typeof foo; -export new Foo(); -export function() {}; -export for (;;); -export while(foo); -``` - -### :bug: Bug Fix - -Don't set inType flag when parsing property names ([#266](https://github.com/babel/babylon/pull/266)) (Vladimir Kurchatkin) - -This fixes parsing of this case: - -```js -const map = { - [age <= 17] : 'Too young' -}; -``` - -Fix source location for JSXEmptyExpression nodes (fixes #248) ([#249](https://github.com/babel/babylon/pull/249)) (James Long) - -The following case produced an invalid AST -```js -
{/* foo */}
-``` - -Use fromCodePoint to convert high value unicode entities ([#243](https://github.com/babel/babylon/pull/243)) (Ryan Duffy) - -When high value unicode entities (e.g. 💩) were used in the input source code they are now correctly encoded in the resulting AST. - -Rename folder to avoid Windows-illegal characters ([#281](https://github.com/babel/babylon/pull/281)) (Ryan Plant) - -Allow this.state.clone() when parsing decorators ([#262](https://github.com/babel/babylon/pull/262)) (Alex Rattray) - -### :house: Internal - -User external-helpers ([#254](https://github.com/babel/babylon/pull/254)) (Daniel Tschinder) - -Add watch script for dev ([#234](https://github.com/babel/babylon/pull/234)) (Kai Cataldo) - -Freeze current plugins list for "*" option, and remove from README.md ([#245](https://github.com/babel/babylon/pull/245)) (Andrew Levine) - -Prepare tests for multiple fixture runners. ([#240](https://github.com/babel/babylon/pull/240)) (Daniel Tschinder) - -Add some test coverage for decorators stage-0 plugin ([#250](https://github.com/babel/babylon/pull/250)) (Andrew Levine) - -Refactor tokenizer types file ([#263](https://github.com/babel/babylon/pull/263)) (Sven SAULEAU) - -Update eslint-config-babel to the latest version 🚀 ([#273](https://github.com/babel/babylon/pull/273)) (greenkeeper[bot]) - -chore(package): update rollup to version 0.41.0 ([#272](https://github.com/babel/babylon/pull/272)) (greenkeeper[bot]) - -chore(package): update flow-bin to version 0.37.0 ([#255](https://github.com/babel/babylon/pull/255)) (greenkeeper[bot]) - -## 6.14.1 (2016-11-17) - -### :bug: Bug Fix - -Allow `"plugins": ["*"]` ([#229](https://github.com/babel/babylon/pull/229)) (Daniel Tschinder) - -```js -{ - "plugins": ["*"] -} -``` - -Will include all parser plugins instead of specifying each one individually. Useful for tools like babel-eslint, jscodeshift, and ast-explorer. - -## 6.14.0 (2016-11-16) - -### :eyeglasses: Spec Compliance - -Throw error for reserved words `enum` and `await` ([#195](https://github.com/babel/babylon/pull/195)) (Kai Cataldo) - -[11.6.2.2 Future Reserved Words](http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words) - -Babylon will throw for more reserved words such as `enum` or `await` (in strict mode). - -``` -class enum {} // throws -class await {} // throws in strict mode (module) -``` - -Optional names for function types and object type indexers ([#197](https://github.com/babel/babylon/pull/197)) (Gabe Levi) - -So where you used to have to write - -```js -type A = (x: string, y: boolean) => number; -type B = (z: string) => number; -type C = { [key: string]: number }; -``` - -you can now write (with flow 0.34.0) - -```js -type A = (string, boolean) => number; -type B = string => number; -type C = { [string]: number }; -``` - -Parse flow nested array type annotations like `number[][]` ([#219](https://github.com/babel/babylon/pull/219)) (Bernhard Häussner) - -Supports these form now of specifying array types: - -```js -var a: number[][][][]; -var b: string[][]; -``` - -### :bug: Bug Fix - -Correctly eat semicolon at the end of `DelcareModuleExports` ([#223](https://github.com/babel/babylon/pull/223)) (Daniel Tschinder) - -``` -declare module "foo" { declare module.exports: number } -declare module "foo" { declare module.exports: number; } // also allowed now -``` - -### :house: Internal - - * Count Babel tests towards Babylon code coverage ([#182](https://github.com/babel/babylon/pull/182)) (Moti Zilberman) - * Fix strange line endings ([#214](https://github.com/babel/babylon/pull/214)) (Thomas Grainger) - * Add node 7 (Daniel Tschinder) - * chore(package): update flow-bin to version 0.34.0 ([#204](https://github.com/babel/babylon/pull/204)) (Greenkeeper) - -## v6.13.1 (2016-10-26) - -### :nail_care: Polish - -- Use rollup for bundling to speed up startup time ([#190](https://github.com/babel/babylon/pull/190)) ([@drewml](https://github.com/DrewML)) - -```js -const babylon = require('babylon'); -const ast = babylon.parse('var foo = "lol";'); -``` - -With that test case, there was a ~95ms savings by removing the need for node to build/traverse the dependency graph. - -**Without bundling** -![image](https://cloud.githubusercontent.com/assets/5233399/19420264/3133497e-93ad-11e6-9a6a-2da59c4f5c13.png) - -**With bundling** -![image](https://cloud.githubusercontent.com/assets/5233399/19420267/388f556e-93ad-11e6-813e-7c5c396be322.png) - -- add clean command [skip ci] ([#201](https://github.com/babel/babylon/pull/201)) (Henry Zhu) -- add ForAwaitStatement (async generator already added) [skip ci] ([#196](https://github.com/babel/babylon/pull/196)) (Henry Zhu) - -## v6.13.0 (2016-10-21) - -### :eyeglasses: Spec Compliance - -Property variance type annotations for Flow plugin ([#161](https://github.com/babel/babylon/pull/161)) (Sam Goldman) - -> See https://flowtype.org/docs/variance.html for more information - -```js -type T = { +p: T }; -interface T { -p: T }; -declare class T { +[k:K]: V }; -class T { -[k:K]: V }; -class C2 { +p: T = e }; -``` - -Raise error on duplicate definition of __proto__ ([#183](https://github.com/babel/babylon/pull/183)) (Moti Zilberman) - -```js -({ __proto__: 1, __proto__: 2 }) // Throws an error now -``` - -### :bug: Bug Fix - -Flow: Allow class properties to be named `static` ([#184](https://github.com/babel/babylon/pull/184)) (Moti Zilberman) - -```js -declare class A { - static: T; -} -``` - -Allow "async" as identifier for object literal property shorthand ([#187](https://github.com/babel/babylon/pull/187)) (Andrew Levine) - -```js -var foo = { async, bar }; -``` - -### :nail_care: Polish - -Fix flowtype and add inType to state ([#189](https://github.com/babel/babylon/pull/189)) (Daniel Tschinder) - -> This improves the performance slightly (because of hidden classes) - -### :house: Internal - -Fix .gitattributes line ending setting ([#191](https://github.com/babel/babylon/pull/191)) (Moti Zilberman) - -Increase test coverage ([#175](https://github.com/babel/babylon/pull/175) (Moti Zilberman) - -Readd missin .eslinignore for IDEs (Daniel Tschinder) - -Error on missing expected.json fixture in CI ([#188](https://github.com/babel/babylon/pull/188)) (Moti Zilberman) - -Add .gitattributes and .editorconfig for LF line endings ([#179](https://github.com/babel/babylon/pull/179)) (Moti Zilberman) - -Fixes two tests that are failing after the merge of #172 ([#177](https://github.com/babel/babylon/pull/177)) (Moti Zilberman) - -## v6.12.0 (2016-10-14) - -### :eyeglasses: Spec Compliance - -Implement import() syntax ([#163](https://github.com/babel/babylon/pull/163)) (Jordan Gensler) - -#### Dynamic Import - -- Proposal Repo: https://github.com/domenic/proposal-dynamic-import -- Championed by [@domenic](https://github.com/domenic) -- stage-2 -- [sept-28 tc39 notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-09/sept-28.md#113a-import) - -> This repository contains a proposal for adding a "function-like" import() module loading syntactic form to JavaScript - -```js -import(`./section-modules/${link.dataset.entryModule}.js`) -.then(module => { - module.loadPageInto(main); -}) -``` - -Add EmptyTypeAnnotation ([#171](https://github.com/babel/babylon/pull/171)) (Sam Goldman) - -#### EmptyTypeAnnotation - -Just wasn't covered before. - -```js -type T = empty; -``` - -### :bug: Bug Fix - -Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) - -```js -// was failing due to sparse array -export const { foo: [ ,, qux7 ] } = bar; -``` - -Allow keyword in Flow object declaration property names with type parameters ([#146](https://github.com/babel/babylon/pull/146)) (Dan Harper) - -```js -declare class X { - foobar(): void; - static foobar(): void; -} -``` - -Allow keyword in object/class property names with Flow type parameters ([#145](https://github.com/babel/babylon/pull/145)) (Dan Harper) - -```js -class Foo { - delete(item: T): T { - return item; - } -} -``` - -Allow typeAnnotations for yield expressions ([#174](https://github.com/babel/babylon/pull/174))) (Daniel Tschinder) - -```js -function *foo() { - const x = (yield 5: any); -} -``` - -### :nail_care: Polish - -Annotate more errors with expected token ([#172](https://github.com/babel/babylon/pull/172))) (Moti Zilberman) - -```js -// Unexpected token, expected ; (1:6) -{ set 1 } -``` - -### :house: Internal - -Remove kcheck ([#173](https://github.com/babel/babylon/pull/173))) (Daniel Tschinder) - -Also run flow, linting, babel tests on separate instances (add back node 0.10) - -## v6.11.6 (2016-10-12) - -### :bug: Bug Fix/Regression - -Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) - -```js -// was failing with `Cannot read property 'type' of null` because of null identifiers -export const { foo: [ ,, qux7 ] } = bar; -``` - -## v6.11.5 (2016-10-12) - -### :eyeglasses: Spec Compliance - -Fix: Check for duplicate named exports in exported destructuring assignments ([#144](https://github.com/babel/babylon/pull/144)) (Kai Cataldo) - -```js -// `foo` has already been exported. Exported identifiers must be unique. (2:20) -export function foo() {}; -export const { a: [{foo}] } = bar; -``` - -Fix: Check for duplicate named exports in exported rest elements/properties ([#164](https://github.com/babel/babylon/pull/164)) (Kai Cataldo) - -```js -// `foo` has already been exported. Exported identifiers must be unique. (2:22) -export const foo = 1; -export const [bar, ...foo] = baz; -``` - -### :bug: Bug Fix - -Fix: Allow identifier `async` for default param in arrow expression ([#165](https://github.com/babel/babylon/pull/165)) (Kai Cataldo) - -```js -// this is ok now -const test = ({async = true}) => {}; -``` - -### :nail_care: Polish - -Babylon will now print out the token it's expecting if there's a `SyntaxError` ([#150](https://github.com/babel/babylon/pull/150)) (Daniel Tschinder) - -```bash -# So in the case of a missing ending curly (`}`) -Module build failed: SyntaxError: Unexpected token, expected } (30:0) - 28 | } - 29 | -> 30 | - | ^ -``` - -## v6.11.4 (2016-10-03) - -Temporary rollback for erroring on trailing comma with spread (#154) (Henry Zhu) - -## v6.11.3 (2016-10-01) - -### :eyeglasses: Spec Compliance - -Add static errors for object rest (#149) ([@danez](https://github.com/danez)) - -> https://github.com/sebmarkbage/ecmascript-rest-spread - -Object rest copies the *rest* of properties from the right hand side `obj` starting from the left to right. - -```js -let { x, y, ...z } = { x: 1, y: 2, z: 3 }; -// x = 1 -// y = 2 -// z = { z: 3 } -``` - -#### New Syntax Errors: - -**SyntaxError**: The rest element has to be the last element when destructuring (1:10) -```bash -> 1 | let { ...x, y, z } = { x: 1, y: 2, z: 3}; - | ^ -# Previous behavior: -# x = { x: 1, y: 2, z: 3 } -# y = 2 -# z = 3 -``` - -Before, this was just a more verbose way of shallow copying `obj` since it doesn't actually do what you think. - -**SyntaxError**: Cannot have multiple rest elements when destructuring (1:13) - -```bash -> 1 | let { x, ...y, ...z } = { x: 1, y: 2, z: 3}; - | ^ -# Previous behavior: -# x = 1 -# y = { y: 2, z: 3 } -# z = { y: 2, z: 3 } -``` - -Before y and z would just be the same value anyway so there is no reason to need to have both. - -**SyntaxError**: A trailing comma is not permitted after the rest element (1:16) - -```js -let { x, y, ...z, } = obj; -``` - -The rationale for this is that the use case for trailing comma is that you can add something at the end without affecting the line above. Since a RestProperty always has to be the last property it doesn't make sense. - ---- - -get / set are valid property names in default assignment (#142) ([@jezell](https://github.com/jezell)) - -```js -// valid -function something({ set = null, get = null }) {} -``` - -## v6.11.2 (2016-09-23) - -### Bug Fix - -- [#139](https://github.com/babel/babylon/issues/139) Don't do the duplicate check if not an identifier (#140) @hzoo - -```js -// regression with duplicate export check -SyntaxError: ./typography.js: `undefined` has already been exported. Exported identifiers must be unique. (22:13) - 20 | - 21 | export const { rhythm } = typography; -> 22 | export const { TypographyStyle } = typography -``` - -Bail out for now, and make a change to account for destructuring in the next release. - -## 6.11.1 (2016-09-22) - -### Bug Fix -- [#137](https://github.com/babel/babylon/pull/137) - Fix a regression with duplicate exports - it was erroring on all keys in `Object.prototype`. @danez - -```javascript -export toString from './toString'; -``` - -```bash -`toString` has already been exported. Exported identifiers must be unique. (1:7) -> 1 | export toString from './toString'; - | ^ - 2 | -``` - -## 6.11.0 (2016-09-22) - -### Spec Compliance (will break CI) - -- Disallow duplicate named exports ([#107](https://github.com/babel/babylon/pull/107)) @kaicataldo - -```js -// Only one default export allowed per module. (2:9) -export default function() {}; -export { foo as default }; - -// Only one default export allowed per module. (2:0) -export default {}; -export default function() {}; - -// `Foo` has already been exported. Exported identifiers must be unique. (2:0) -export { Foo }; -export class Foo {}; -``` - -### New Feature (Syntax) - -- Add support for computed class property names ([#121](https://github.com/babel/babylon/pull/121)) @motiz88 - -```js -// AST -interface ClassProperty <: Node { - type: "ClassProperty"; - key: Identifier; - value: Expression; - computed: boolean; // added -} -``` - -```js -// with "plugins": ["classProperties"] -class Foo { - [x] - ['y'] -} - -class Bar { - [p] - [m] () {} -} - ``` - -### Bug Fix - -- Fix `static` property falling through in the declare class Flow AST ([#135](https://github.com/babel/babylon/pull/135)) @danharper - -```js -declare class X { - a: number; - static b: number; // static - c: number; // this was being marked as static in the AST as well -} -``` - -### Polish - -- Rephrase "assigning/binding to rvalue" errors to include context ([#119](https://github.com/babel/babylon/pull/119)) @motiz88 - -```js -// Used to error with: -// SyntaxError: Assigning to rvalue (1:0) - -// Now: -// Invalid left-hand side in assignment expression (1:0) -3 = 4 - -// Invalid left-hand side in for-in statement (1:5) -for (+i in {}); -``` - -### Internal - -- Fix call to `this.parseMaybeAssign` with correct arguments ([#133](https://github.com/babel/babylon/pull/133)) @danez -- Add semver note to changelog ([#131](https://github.com/babel/babylon/pull/131)) @hzoo - -## 6.10.0 (2016-09-19) - -> We plan to include some spec compliance bugs in patch versions. An example was the multiple default exports issue. - -### Spec Compliance - -* Implement ES2016 check for simple parameter list in strict mode ([#106](https://github.com/babel/babylon/pull/106)) (Timothy Gu) - -> It is a Syntax Error if ContainsUseStrict of FunctionBody is true and IsSimpleParameterList of FormalParameters is false. https://tc39.github.io/ecma262/2016/#sec-function-definitions-static-semantics-early-errors - -More Context: [tc39-notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-29.md#611-the-scope-of-use-strict-with-respect-to-destructuring-in-parameter-lists) - -For example: - -```js -// this errors because it uses destructuring and default parameters -// in a function with a "use strict" directive -function a([ option1, option2 ] = []) { - "use strict"; -} - ``` - -The solution would be to use a top level "use strict" or to remove the destructuring or default parameters when using a function + "use strict" or to. - -### New Feature - -* Exact object type annotations for Flow plugin ([#104](https://github.com/babel/babylon/pull/104)) (Basil Hosmer) - -Added to flow in https://github.com/facebook/flow/commit/c710c40aa2a115435098d6c0dfeaadb023cd39b8 - -Looks like: - -```js -var a : {| x: number, y: string |} = { x: 0, y: 'foo' }; -``` - -### Bug Fixes - -* Include `typeParameter` location in `ArrowFunctionExpression` ([#126](https://github.com/babel/babylon/pull/126)) (Daniel Tschinder) -* Error on invalid flow type annotation with default assignment ([#122](https://github.com/babel/babylon/pull/122)) (Dan Harper) -* Fix Flow return types on arrow functions ([#124](https://github.com/babel/babylon/pull/124)) (Dan Harper) - -### Misc - -* Add tests for export extensions ([#127](https://github.com/babel/babylon/pull/127)) (Daniel Tschinder) -* Fix Contributing guidelines [skip ci] (Daniel Tschinder) - -## 6.9.2 (2016-09-09) - -The only change is to remove the `babel-runtime` dependency by compiling with Babel's ES2015 loose mode. So using babylon standalone should be smaller. - -## 6.9.1 (2016-08-23) - -This release contains mainly small bugfixes but also updates babylons default mode to es2017. The features for `exponentiationOperator`, `asyncFunctions` and `trailingFunctionCommas` which previously needed to be activated via plugin are now enabled by default and the plugins are now no-ops. - -### Bug Fixes - -- Fix issues with default object params in async functions ([#96](https://github.com/babel/babylon/pull/96)) @danez -- Fix issues with flow-types and async function ([#95](https://github.com/babel/babylon/pull/95)) @danez -- Fix arrow functions with destructuring, types & default value ([#94](https://github.com/babel/babylon/pull/94)) @danharper -- Fix declare class with qualified type identifier ([#97](https://github.com/babel/babylon/pull/97)) @danez -- Remove exponentiationOperator, asyncFunctions, trailingFunctionCommas plugins and enable them by default ([#98](https://github.com/babel/babylon/pull/98)) @danez - -## 6.9.0 (2016-08-16) - -### New syntax support - -- Add JSX spread children ([#42](https://github.com/babel/babylon/pull/42)) @calebmer - -(Be aware that React is not going to support this syntax) - -```js -
- {...todos.map(todo => )} -
-``` - -- Add support for declare module.exports ([#72](https://github.com/babel/babylon/pull/72)) @danez - -```js -declare module "foo" { - declare module.exports: {} -} -``` - -### New Features - -- If supplied, attach filename property to comment node loc. ([#80](https://github.com/babel/babylon/pull/80)) @divmain -- Add identifier name to node loc field ([#90](https://github.com/babel/babylon/pull/90)) @kittens - -### Bug Fixes - -- Fix exponential operator to behave according to spec ([#75](https://github.com/babel/babylon/pull/75)) @danez -- Fix lookahead to not add comments to arrays which are not cloned ([#76](https://github.com/babel/babylon/pull/76)) @danez -- Fix accidental fall-through in Flow type parsing. ([#82](https://github.com/babel/babylon/pull/82)) @xiemaisi -- Only allow declares inside declare module ([#73](https://github.com/babel/babylon/pull/73)) @danez -- Small fix for parsing type parameter declarations ([#83](https://github.com/babel/babylon/pull/83)) @gabelevi -- Fix arrow param locations with flow types ([#57](https://github.com/babel/babylon/pull/57)) @danez -- Fixes SyntaxError position with flow optional type ([#65](https://github.com/babel/babylon/pull/65)) @danez - -### Internal - -- Add codecoverage to tests @danez -- Fix tests to not save expected output if we expect the test to fail @danez -- Make a shallow clone of babel for testing @danez -- chore(package): update cross-env to version 2.0.0 ([#77](https://github.com/babel/babylon/pull/77)) @greenkeeperio-bot -- chore(package): update ava to version 0.16.0 ([#86](https://github.com/babel/babylon/pull/86)) @greenkeeperio-bot -- chore(package): update babel-plugin-istanbul to version 2.0.0 ([#89](https://github.com/babel/babylon/pull/89)) @greenkeeperio-bot -- chore(package): update nyc to version 8.0.0 ([#88](https://github.com/babel/babylon/pull/88)) @greenkeeperio-bot - -## 6.8.4 (2016-07-06) - -### Bug Fixes - -- Fix the location of params, when flow and default value used ([#68](https://github.com/babel/babylon/pull/68)) @danez - -## 6.8.3 (2016-07-02) - -### Bug Fixes - -- Fix performance regression introduced in 6.8.2 with conditionals ([#63](https://github.com/babel/babylon/pull/63)) @danez - -## 6.8.2 (2016-06-24) - -### Bug Fixes - -- Fix parse error with yielding jsx elements in generators `function* it() { yield ; }` ([#31](https://github.com/babel/babylon/pull/31)) @eldereal -- When cloning nodes do not clone its comments ([#24](https://github.com/babel/babylon/pull/24)) @danez -- Fix parse errors when using arrow functions with an spread element and return type `(...props): void => {}` ([#10](https://github.com/babel/babylon/pull/10)) @danez -- Fix leading comments added from previous node ([#23](https://github.com/babel/babylon/pull/23)) @danez -- Fix parse errors with flow's optional arguments `(arg?) => {}` ([#19](https://github.com/babel/babylon/pull/19)) @danez -- Support negative numeric type literals @kittens -- Remove line terminator restriction after await keyword @kittens -- Remove grouped type arrow restriction as it seems flow no longer has it @kittens -- Fix parse error with generic methods that have the name `get` or `set` `class foo { get() {} }` ([#55](https://github.com/babel/babylon/pull/55)) @vkurchatkin -- Fix parse error with arrow functions that have flow type parameter declarations `(x: T): T => x;` ([#54](https://github.com/babel/babylon/pull/54)) @gabelevi - -### Documentation - -- Document AST differences from ESTree ([#41](https://github.com/babel/babylon/pull/41)) @nene -- Move ast spec from babel/babel ([#46](https://github.com/babel/babylon/pull/46)) @hzoo - -### Internal - -- Enable skipped tests ([#16](https://github.com/babel/babylon/pull/16)) @danez -- Add script to test latest version of babylon with babel ([#21](https://github.com/babel/babylon/pull/21)) @danez -- Upgrade test runner ava @kittens -- Add missing generate-identifier-regex script @kittens -- Rename parser context types @kittens -- Add node v6 to travis testing @hzoo -- Update to Unicode v9 ([#45](https://github.com/babel/babylon/pull/45)) @mathiasbynens - -## 6.8.1 (2016-06-06) - -### New Feature - -- Parse type parameter declarations with defaults like `type Foo = T` - -### Bug Fixes -- Type parameter declarations need 1 or more type parameters. -- The existential type `*` is not a valid type parameter. -- The existential type `*` is a primary type - -### Spec Compliance -- The param list for type parameter declarations now consists of `TypeParameter` nodes -- New `TypeParameter` AST Node (replaces using the `Identifier` node before) - -``` -interface TypeParameter <: Node { - bound: TypeAnnotation; - default: TypeAnnotation; - name: string; - variance: "plus" | "minus"; -} -``` - -## 6.8.0 (2016-05-02) - -#### New Feature - -##### Parse Method Parameter Decorators ([#12](https://github.com/babel/babylon/pull/12)) - -> [Method Parameter Decorators](https://goo.gl/8MmCMG) is now a TC39 [stage 0 proposal](https://github.com/tc39/ecma262/blob/master/stage0.md). - -Examples: - -```js -class Foo { - constructor(@foo() x, @bar({ a: 123 }) @baz() y) {} -} - -export default function func(@foo() x, @bar({ a: 123 }) @baz() y) {} - -var obj = { - method(@foo() x, @bar({ a: 123 }) @baz() y) {} -}; -``` - -##### Parse for-await statements (w/ `asyncGenerators` plugin) ([#17](https://github.com/babel/babylon/pull/17)) - -There is also a new node type, `ForAwaitStatement`. - -> [Async generators and for-await](https://github.com/tc39/proposal-async-iteration) are now a [stage 2 proposal](https://github.com/tc39/ecma262#current-proposals). - -Example: - -```js -async function f() { - for await (let x of y); -} -``` diff --git a/node_modules/@babel/parser/LICENSE b/node_modules/@babel/parser/LICENSE deleted file mode 100644 index d4c7fc5..0000000 --- a/node_modules/@babel/parser/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2012-2014 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/@babel/parser/README.md b/node_modules/@babel/parser/README.md deleted file mode 100644 index 513748c..0000000 --- a/node_modules/@babel/parser/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/parser - -> A JavaScript parser - -See our website [@babel/parser](https://babeljs.io/docs/en/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%20(babylon)%22+is%3Aopen) associated with this package. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/parser -``` - -or using yarn: - -```sh -yarn add @babel/parser --dev -``` diff --git a/node_modules/@babel/parser/bin/babel-parser.js b/node_modules/@babel/parser/bin/babel-parser.js deleted file mode 100755 index 3aca314..0000000 --- a/node_modules/@babel/parser/bin/babel-parser.js +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env node -/* eslint no-var: 0 */ - -var parser = require(".."); -var fs = require("fs"); - -var filename = process.argv[2]; -if (!filename) { - console.error("no filename specified"); -} else { - var file = fs.readFileSync(filename, "utf8"); - var ast = parser.parse(file); - - console.log(JSON.stringify(ast, null, " ")); -} diff --git a/node_modules/@babel/parser/lib/index.js b/node_modules/@babel/parser/lib/index.js deleted file mode 100644 index 72132f0..0000000 --- a/node_modules/@babel/parser/lib/index.js +++ /dev/null @@ -1,13937 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -const beforeExpr = true; -const startsExpr = true; -const isLoop = true; -const isAssign = true; -const prefix = true; -const postfix = true; -class TokenType { - constructor(label, conf = {}) { - this.label = void 0; - this.keyword = void 0; - this.beforeExpr = void 0; - this.startsExpr = void 0; - this.rightAssociative = void 0; - this.isLoop = void 0; - this.isAssign = void 0; - this.prefix = void 0; - this.postfix = void 0; - this.binop = void 0; - this.updateContext = void 0; - this.label = label; - this.keyword = conf.keyword; - this.beforeExpr = !!conf.beforeExpr; - this.startsExpr = !!conf.startsExpr; - this.rightAssociative = !!conf.rightAssociative; - this.isLoop = !!conf.isLoop; - this.isAssign = !!conf.isAssign; - this.prefix = !!conf.prefix; - this.postfix = !!conf.postfix; - this.binop = conf.binop != null ? conf.binop : null; - this.updateContext = null; - } - -} -const keywords = new Map(); - -function createKeyword(name, options = {}) { - options.keyword = name; - const token = new TokenType(name, options); - keywords.set(name, token); - return token; -} - -function createBinop(name, binop) { - return new TokenType(name, { - beforeExpr, - binop - }); -} - -const types = { - num: new TokenType("num", { - startsExpr - }), - bigint: new TokenType("bigint", { - startsExpr - }), - decimal: new TokenType("decimal", { - startsExpr - }), - regexp: new TokenType("regexp", { - startsExpr - }), - string: new TokenType("string", { - startsExpr - }), - name: new TokenType("name", { - startsExpr - }), - eof: new TokenType("eof"), - bracketL: new TokenType("[", { - beforeExpr, - startsExpr - }), - bracketHashL: new TokenType("#[", { - beforeExpr, - startsExpr - }), - bracketBarL: new TokenType("[|", { - beforeExpr, - startsExpr - }), - bracketR: new TokenType("]"), - bracketBarR: new TokenType("|]"), - braceL: new TokenType("{", { - beforeExpr, - startsExpr - }), - braceBarL: new TokenType("{|", { - beforeExpr, - startsExpr - }), - braceHashL: new TokenType("#{", { - beforeExpr, - startsExpr - }), - braceR: new TokenType("}"), - braceBarR: new TokenType("|}"), - parenL: new TokenType("(", { - beforeExpr, - startsExpr - }), - parenR: new TokenType(")"), - comma: new TokenType(",", { - beforeExpr - }), - semi: new TokenType(";", { - beforeExpr - }), - colon: new TokenType(":", { - beforeExpr - }), - doubleColon: new TokenType("::", { - beforeExpr - }), - dot: new TokenType("."), - question: new TokenType("?", { - beforeExpr - }), - questionDot: new TokenType("?."), - arrow: new TokenType("=>", { - beforeExpr - }), - template: new TokenType("template"), - ellipsis: new TokenType("...", { - beforeExpr - }), - backQuote: new TokenType("`", { - startsExpr - }), - dollarBraceL: new TokenType("${", { - beforeExpr, - startsExpr - }), - at: new TokenType("@"), - hash: new TokenType("#", { - startsExpr - }), - interpreterDirective: new TokenType("#!..."), - eq: new TokenType("=", { - beforeExpr, - isAssign - }), - assign: new TokenType("_=", { - beforeExpr, - isAssign - }), - incDec: new TokenType("++/--", { - prefix, - postfix, - startsExpr - }), - bang: new TokenType("!", { - beforeExpr, - prefix, - startsExpr - }), - tilde: new TokenType("~", { - beforeExpr, - prefix, - startsExpr - }), - pipeline: createBinop("|>", 0), - nullishCoalescing: createBinop("??", 1), - logicalOR: createBinop("||", 1), - logicalAND: createBinop("&&", 2), - bitwiseOR: createBinop("|", 3), - bitwiseXOR: createBinop("^", 4), - bitwiseAND: createBinop("&", 5), - equality: createBinop("==/!=/===/!==", 6), - relational: createBinop("/<=/>=", 7), - bitShift: createBinop("<>/>>>", 8), - plusMin: new TokenType("+/-", { - beforeExpr, - binop: 9, - prefix, - startsExpr - }), - modulo: new TokenType("%", { - beforeExpr, - binop: 10, - startsExpr - }), - star: new TokenType("*", { - binop: 10 - }), - slash: createBinop("/", 10), - exponent: new TokenType("**", { - beforeExpr, - binop: 11, - rightAssociative: true - }), - _break: createKeyword("break"), - _case: createKeyword("case", { - beforeExpr - }), - _catch: createKeyword("catch"), - _continue: createKeyword("continue"), - _debugger: createKeyword("debugger"), - _default: createKeyword("default", { - beforeExpr - }), - _do: createKeyword("do", { - isLoop, - beforeExpr - }), - _else: createKeyword("else", { - beforeExpr - }), - _finally: createKeyword("finally"), - _for: createKeyword("for", { - isLoop - }), - _function: createKeyword("function", { - startsExpr - }), - _if: createKeyword("if"), - _return: createKeyword("return", { - beforeExpr - }), - _switch: createKeyword("switch"), - _throw: createKeyword("throw", { - beforeExpr, - prefix, - startsExpr - }), - _try: createKeyword("try"), - _var: createKeyword("var"), - _const: createKeyword("const"), - _while: createKeyword("while", { - isLoop - }), - _with: createKeyword("with"), - _new: createKeyword("new", { - beforeExpr, - startsExpr - }), - _this: createKeyword("this", { - startsExpr - }), - _super: createKeyword("super", { - startsExpr - }), - _class: createKeyword("class", { - startsExpr - }), - _extends: createKeyword("extends", { - beforeExpr - }), - _export: createKeyword("export"), - _import: createKeyword("import", { - startsExpr - }), - _null: createKeyword("null", { - startsExpr - }), - _true: createKeyword("true", { - startsExpr - }), - _false: createKeyword("false", { - startsExpr - }), - _in: createKeyword("in", { - beforeExpr, - binop: 7 - }), - _instanceof: createKeyword("instanceof", { - beforeExpr, - binop: 7 - }), - _typeof: createKeyword("typeof", { - beforeExpr, - prefix, - startsExpr - }), - _void: createKeyword("void", { - beforeExpr, - prefix, - startsExpr - }), - _delete: createKeyword("delete", { - beforeExpr, - prefix, - startsExpr - }) -}; - -const lineBreak = /\r\n?|[\n\u2028\u2029]/; -const lineBreakG = new RegExp(lineBreak.source, "g"); -function isNewLine(code) { - switch (code) { - case 10: - case 13: - case 8232: - case 8233: - return true; - - default: - return false; - } -} -const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; -function isWhitespace(code) { - switch (code) { - case 0x0009: - case 0x000b: - case 0x000c: - case 32: - case 160: - case 5760: - case 0x2000: - case 0x2001: - case 0x2002: - case 0x2003: - case 0x2004: - case 0x2005: - case 0x2006: - case 0x2007: - case 0x2008: - case 0x2009: - case 0x200a: - case 0x202f: - case 0x205f: - case 0x3000: - case 0xfeff: - return true; - - default: - return false; - } -} - -class Position { - constructor(line, col) { - this.line = void 0; - this.column = void 0; - this.line = line; - this.column = col; - } - -} -class SourceLocation { - constructor(start, end) { - this.start = void 0; - this.end = void 0; - this.filename = void 0; - this.identifierName = void 0; - this.start = start; - this.end = end; - } - -} -function getLineInfo(input, offset) { - let line = 1; - let lineStart = 0; - let match; - lineBreakG.lastIndex = 0; - - while ((match = lineBreakG.exec(input)) && match.index < offset) { - line++; - lineStart = lineBreakG.lastIndex; - } - - return new Position(line, offset - lineStart); -} - -class BaseParser { - constructor() { - this.sawUnambiguousESM = false; - this.ambiguousScriptDifferentAst = false; - } - - hasPlugin(name) { - return this.plugins.has(name); - } - - getPluginOption(plugin, name) { - if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name]; - } - -} - -function last(stack) { - return stack[stack.length - 1]; -} - -class CommentsParser extends BaseParser { - addComment(comment) { - if (this.filename) comment.loc.filename = this.filename; - this.state.trailingComments.push(comment); - this.state.leadingComments.push(comment); - } - - adjustCommentsAfterTrailingComma(node, elements, takeAllComments) { - if (this.state.leadingComments.length === 0) { - return; - } - - let lastElement = null; - let i = elements.length; - - while (lastElement === null && i > 0) { - lastElement = elements[--i]; - } - - if (lastElement === null) { - return; - } - - for (let j = 0; j < this.state.leadingComments.length; j++) { - if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) { - this.state.leadingComments.splice(j, 1); - j--; - } - } - - const newTrailingComments = []; - - for (let i = 0; i < this.state.leadingComments.length; i++) { - const leadingComment = this.state.leadingComments[i]; - - if (leadingComment.end < node.end) { - newTrailingComments.push(leadingComment); - - if (!takeAllComments) { - this.state.leadingComments.splice(i, 1); - i--; - } - } else { - if (node.trailingComments === undefined) { - node.trailingComments = []; - } - - node.trailingComments.push(leadingComment); - } - } - - if (takeAllComments) this.state.leadingComments = []; - - if (newTrailingComments.length > 0) { - lastElement.trailingComments = newTrailingComments; - } else if (lastElement.trailingComments !== undefined) { - lastElement.trailingComments = []; - } - } - - processComment(node) { - if (node.type === "Program" && node.body.length > 0) return; - const stack = this.state.commentStack; - let firstChild, lastChild, trailingComments, i, j; - - if (this.state.trailingComments.length > 0) { - if (this.state.trailingComments[0].start >= node.end) { - trailingComments = this.state.trailingComments; - this.state.trailingComments = []; - } else { - this.state.trailingComments.length = 0; - } - } else if (stack.length > 0) { - const lastInStack = last(stack); - - if (lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) { - trailingComments = lastInStack.trailingComments; - delete lastInStack.trailingComments; - } - } - - if (stack.length > 0 && last(stack).start >= node.start) { - firstChild = stack.pop(); - } - - while (stack.length > 0 && last(stack).start >= node.start) { - lastChild = stack.pop(); - } - - if (!lastChild && firstChild) lastChild = firstChild; - - if (firstChild) { - switch (node.type) { - case "ObjectExpression": - this.adjustCommentsAfterTrailingComma(node, node.properties); - break; - - case "ObjectPattern": - this.adjustCommentsAfterTrailingComma(node, node.properties, true); - break; - - case "CallExpression": - this.adjustCommentsAfterTrailingComma(node, node.arguments); - break; - - case "ArrayExpression": - this.adjustCommentsAfterTrailingComma(node, node.elements); - break; - - case "ArrayPattern": - this.adjustCommentsAfterTrailingComma(node, node.elements, true); - break; - } - } else if (this.state.commentPreviousNode && (this.state.commentPreviousNode.type === "ImportSpecifier" && node.type !== "ImportSpecifier" || this.state.commentPreviousNode.type === "ExportSpecifier" && node.type !== "ExportSpecifier")) { - this.adjustCommentsAfterTrailingComma(node, [this.state.commentPreviousNode]); - } - - if (lastChild) { - if (lastChild.leadingComments) { - if (lastChild !== node && lastChild.leadingComments.length > 0 && last(lastChild.leadingComments).end <= node.start) { - node.leadingComments = lastChild.leadingComments; - delete lastChild.leadingComments; - } else { - for (i = lastChild.leadingComments.length - 2; i >= 0; --i) { - if (lastChild.leadingComments[i].end <= node.start) { - node.leadingComments = lastChild.leadingComments.splice(0, i + 1); - break; - } - } - } - } - } else if (this.state.leadingComments.length > 0) { - if (last(this.state.leadingComments).end <= node.start) { - if (this.state.commentPreviousNode) { - for (j = 0; j < this.state.leadingComments.length; j++) { - if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) { - this.state.leadingComments.splice(j, 1); - j--; - } - } - } - - if (this.state.leadingComments.length > 0) { - node.leadingComments = this.state.leadingComments; - this.state.leadingComments = []; - } - } else { - for (i = 0; i < this.state.leadingComments.length; i++) { - if (this.state.leadingComments[i].end > node.start) { - break; - } - } - - const leadingComments = this.state.leadingComments.slice(0, i); - - if (leadingComments.length) { - node.leadingComments = leadingComments; - } - - trailingComments = this.state.leadingComments.slice(i); - - if (trailingComments.length === 0) { - trailingComments = null; - } - } - } - - this.state.commentPreviousNode = node; - - if (trailingComments) { - if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) { - node.innerComments = trailingComments; - } else { - const firstTrailingCommentIndex = trailingComments.findIndex(comment => comment.end >= node.end); - - if (firstTrailingCommentIndex > 0) { - node.innerComments = trailingComments.slice(0, firstTrailingCommentIndex); - node.trailingComments = trailingComments.slice(firstTrailingCommentIndex); - } else { - node.trailingComments = trailingComments; - } - } - } - - stack.push(node); - } - -} - -const ErrorMessages = Object.freeze({ - AccessorIsGenerator: "A %0ter cannot be a generator", - ArgumentsInClass: "'arguments' is only allowed in functions and class methods", - AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block", - AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function", - AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block", - AwaitExpressionFormalParameter: "await is not allowed in async function parameters", - AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules", - AwaitNotInAsyncFunction: "'await' is only allowed within async functions", - BadGetterArity: "getter must not have any formal parameters", - BadSetterArity: "setter must have exactly one formal parameter", - BadSetterRestParameter: "setter function argument must not be a rest parameter", - ConstructorClassField: "Classes may not have a field named 'constructor'", - ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'", - ConstructorIsAccessor: "Class constructor may not be an accessor", - ConstructorIsAsync: "Constructor can't be an async function", - ConstructorIsGenerator: "Constructor can't be a generator", - DeclarationMissingInitializer: "%0 require an initialization value", - DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax", - DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", - DecoratorExportClass: "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.", - DecoratorSemicolon: "Decorators must not be followed by a semicolon", - DecoratorStaticBlock: "Decorators can't be used with a static block", - DeletePrivateField: "Deleting a private field is not allowed", - DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", - DuplicateConstructor: "Duplicate constructor in the same class", - DuplicateDefaultExport: "Only one default export allowed per module.", - DuplicateExport: "`%0` has already been exported. Exported identifiers must be unique.", - DuplicateProto: "Redefinition of __proto__ property", - DuplicateRegExpFlags: "Duplicate regular expression flag", - DuplicateStaticBlock: "Duplicate static block in the same class", - ElementAfterRest: "Rest element must be last element", - EscapedCharNotAnIdentifier: "Invalid Unicode escape", - ExportBindingIsString: "A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { '%0' as '%1' } from 'some-module'`?", - ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'", - ForInOfLoopInitializer: "%0 loop variable declaration may not have an initializer", - GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block", - IllegalBreakContinue: "Unsyntactic %0", - IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list", - IllegalReturn: "'return' outside of function", - ImportBindingIsString: 'A string literal cannot be used as an imported binding.\n- Did you mean `import { "%0" as foo }`?', - ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments", - ImportCallArity: "import() requires exactly %0", - ImportCallNotNewExpression: "Cannot use new with import(...)", - ImportCallSpreadArgument: "... is not allowed in import()", - ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: "module"'`, - ImportOutsideModule: `'import' and 'export' may appear only with 'sourceType: "module"'`, - InvalidBigIntLiteral: "Invalid BigIntLiteral", - InvalidCodePoint: "Code point out of bounds", - InvalidDecimal: "Invalid decimal", - InvalidDigit: "Expected number in radix %0", - InvalidEscapeSequence: "Bad character escape sequence", - InvalidEscapeSequenceTemplate: "Invalid escape sequence in template", - InvalidEscapedReservedWord: "Escape sequence in keyword %0", - InvalidIdentifier: "Invalid identifier %0", - InvalidLhs: "Invalid left-hand side in %0", - InvalidLhsBinding: "Binding invalid left-hand side in %0", - InvalidNumber: "Invalid number", - InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'", - InvalidOrUnexpectedToken: "Unexpected character '%0'", - InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern", - InvalidPrivateFieldResolution: "Private name #%0 is not defined", - InvalidPropertyBindingPattern: "Binding member expression", - InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions", - InvalidRestAssignmentPattern: "Invalid rest operator's argument", - LabelRedeclaration: "Label '%0' is already declared", - LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.", - LineTerminatorBeforeArrow: "No line break is allowed before '=>'", - MalformedRegExpFlags: "Invalid regular expression flag", - MissingClassName: "A class name is required", - MissingEqInAssignment: "Only '=' operator can be used for specifying default value.", - MissingSemicolon: "Missing semicolon", - MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX", - MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators", - ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`", - ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values", - ModuleAttributesWithDuplicateKeys: 'Duplicate key "%0" is not allowed in module attributes', - ModuleExportNameHasLoneSurrogate: "An export name cannot include a lone surrogate, found '\\u%0'", - ModuleExportUndefined: "Export '%0' is not defined", - MultipleDefaultsInSwitch: "Multiple default clauses", - NewlineAfterThrow: "Illegal newline after throw", - NoCatchOrFinally: "Missing catch or finally clause", - NumberIdentifier: "Identifier directly after number", - NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences", - ObsoleteAwaitStar: "await* has been removed from the async functions proposal. Use Promise.all() instead.", - OptionalChainingNoNew: "constructors in/after an Optional Chain are not allowed", - OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain", - ParamDupe: "Argument name clash", - PatternHasAccessor: "Object pattern can't contain getter or setter", - PatternHasMethod: "Object pattern can't contain methods", - PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized', - PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression", - PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression", - PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference", - PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding", - PrimaryTopicRequiresSmartPipeline: "Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option.", - PrivateInExpectedIn: "Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`)", - PrivateNameRedeclaration: "Duplicate private name #%0", - RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'", - RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'", - RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'", - RecordNoProto: "'__proto__' is not allowed in Record expressions", - RestTrailingComma: "Unexpected trailing comma after rest element", - SloppyFunction: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement", - StaticPrototype: "Classes may not have static property named prototype", - StrictDelete: "Deleting local variable in strict mode", - StrictEvalArguments: "Assigning to '%0' in strict mode", - StrictEvalArgumentsBinding: "Binding '%0' in strict mode", - StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block", - StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'", - StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode", - StrictWith: "'with' in strict mode", - SuperNotAllowed: "super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?", - SuperPrivateField: "Private fields can't be accessed on super", - TrailingDecorator: "Decorators must be attached to a class element", - TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'", - TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'", - TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'", - UnexpectedArgumentPlaceholder: "Unexpected argument placeholder", - UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal', - UnexpectedDigitAfterHash: "Unexpected digit after hash token", - UnexpectedImportExport: "'import' and 'export' may only appear at the top level", - UnexpectedKeyword: "Unexpected keyword '%0'", - UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration", - UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context", - UnexpectedNewTarget: "new.target can only be used in functions", - UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits", - UnexpectedPrivateField: "Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p).", - UnexpectedReservedWord: "Unexpected reserved word '%0'", - UnexpectedSuper: "super is only allowed in object methods and classes", - UnexpectedToken: "Unexpected token '%0'", - UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", - UnsupportedBind: "Binding should be performed on object property.", - UnsupportedDecoratorExport: "A decorated export must export a class declaration", - UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.", - UnsupportedImport: "import can only be used in import() or import.meta", - UnsupportedMetaProperty: "The only valid meta property for %0 is %0.%1", - UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters", - UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties", - UnsupportedSuper: "super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop])", - UnterminatedComment: "Unterminated comment", - UnterminatedRegExp: "Unterminated regular expression", - UnterminatedString: "Unterminated string constant", - UnterminatedTemplate: "Unterminated template", - VarRedeclaration: "Identifier '%0' has already been declared", - YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator", - YieldInParameter: "Yield expression is not allowed in formal parameters", - ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0" -}); - -class ParserError extends CommentsParser { - getLocationForPosition(pos) { - let loc; - if (pos === this.state.start) loc = this.state.startLoc;else if (pos === this.state.lastTokStart) loc = this.state.lastTokStartLoc;else if (pos === this.state.end) loc = this.state.endLoc;else if (pos === this.state.lastTokEnd) loc = this.state.lastTokEndLoc;else loc = getLineInfo(this.input, pos); - return loc; - } - - raise(pos, errorTemplate, ...params) { - return this.raiseWithData(pos, undefined, errorTemplate, ...params); - } - - raiseOverwrite(pos, errorTemplate, ...params) { - const loc = this.getLocationForPosition(pos); - const message = errorTemplate.replace(/%(\d+)/g, (_, i) => params[i]) + ` (${loc.line}:${loc.column})`; - - if (this.options.errorRecovery) { - const errors = this.state.errors; - - for (let i = errors.length - 1; i >= 0; i--) { - const error = errors[i]; - - if (error.pos === pos) { - return Object.assign(error, { - message - }); - } else if (error.pos < pos) { - break; - } - } - } - - return this._raise({ - loc, - pos - }, message); - } - - raiseWithData(pos, data, errorTemplate, ...params) { - const loc = this.getLocationForPosition(pos); - const message = errorTemplate.replace(/%(\d+)/g, (_, i) => params[i]) + ` (${loc.line}:${loc.column})`; - return this._raise(Object.assign({ - loc, - pos - }, data), message); - } - - _raise(errorContext, message) { - const err = new SyntaxError(message); - Object.assign(err, errorContext); - - if (this.options.errorRecovery) { - if (!this.isLookahead) this.state.errors.push(err); - return err; - } else { - throw err; - } - } - -} - -var estree = (superClass => class extends superClass { - estreeParseRegExpLiteral({ - pattern, - flags - }) { - let regex = null; - - try { - regex = new RegExp(pattern, flags); - } catch (e) {} - - const node = this.estreeParseLiteral(regex); - node.regex = { - pattern, - flags - }; - return node; - } - - estreeParseBigIntLiteral(value) { - let bigInt; - - try { - bigInt = BigInt(value); - } catch (_unused) { - bigInt = null; - } - - const node = this.estreeParseLiteral(bigInt); - node.bigint = String(node.value || value); - return node; - } - - estreeParseDecimalLiteral(value) { - const decimal = null; - const node = this.estreeParseLiteral(decimal); - node.decimal = String(node.value || value); - return node; - } - - estreeParseLiteral(value) { - return this.parseLiteral(value, "Literal"); - } - - directiveToStmt(directive) { - const directiveLiteral = directive.value; - const stmt = this.startNodeAt(directive.start, directive.loc.start); - const expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start); - expression.value = directiveLiteral.extra.expressionValue; - expression.raw = directiveLiteral.extra.raw; - stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end); - stmt.directive = directiveLiteral.extra.raw.slice(1, -1); - return this.finishNodeAt(stmt, "ExpressionStatement", directive.end, directive.loc.end); - } - - initFunction(node, isAsync) { - super.initFunction(node, isAsync); - node.expression = false; - } - - checkDeclaration(node) { - if (node != null && this.isObjectProperty(node)) { - this.checkDeclaration(node.value); - } else { - super.checkDeclaration(node); - } - } - - getObjectOrClassMethodParams(method) { - return method.value.params; - } - - isValidDirective(stmt) { - var _stmt$expression$extr; - - return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) == null ? void 0 : _stmt$expression$extr.parenthesized); - } - - stmtToDirective(stmt) { - const directive = super.stmtToDirective(stmt); - const value = stmt.expression.value; - this.addExtra(directive.value, "expressionValue", value); - return directive; - } - - parseBlockBody(node, ...args) { - super.parseBlockBody(node, ...args); - const directiveStatements = node.directives.map(d => this.directiveToStmt(d)); - node.body = directiveStatements.concat(node.body); - delete node.directives; - } - - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true); - - if (method.typeParameters) { - method.value.typeParameters = method.typeParameters; - delete method.typeParameters; - } - - classBody.body.push(method); - } - - parseExprAtom(refExpressionErrors) { - switch (this.state.type) { - case types.num: - case types.string: - return this.estreeParseLiteral(this.state.value); - - case types.regexp: - return this.estreeParseRegExpLiteral(this.state.value); - - case types.bigint: - return this.estreeParseBigIntLiteral(this.state.value); - - case types.decimal: - return this.estreeParseDecimalLiteral(this.state.value); - - case types._null: - return this.estreeParseLiteral(null); - - case types._true: - return this.estreeParseLiteral(true); - - case types._false: - return this.estreeParseLiteral(false); - - default: - return super.parseExprAtom(refExpressionErrors); - } - } - - parseMaybePrivateName(...args) { - const node = super.parseMaybePrivateName(...args); - - if (node.type === "PrivateName" && this.getPluginOption("estree", "classFeatures")) { - return this.convertPrivateNameToPrivateIdentifier(node); - } - - return node; - } - - convertPrivateNameToPrivateIdentifier(node) { - const name = super.getPrivateNameSV(node); - node = node; - delete node.id; - node.name = name; - node.type = "PrivateIdentifier"; - return node; - } - - isPrivateName(node) { - if (!this.getPluginOption("estree", "classFeatures")) { - return super.isPrivateName(node); - } - - return node.type === "PrivateIdentifier"; - } - - getPrivateNameSV(node) { - if (!this.getPluginOption("estree", "classFeatures")) { - return super.getPrivateNameSV(node); - } - - return node.name; - } - - parseLiteral(value, type, startPos, startLoc) { - const node = super.parseLiteral(value, type, startPos, startLoc); - node.raw = node.extra.raw; - delete node.extra; - return node; - } - - parseFunctionBody(node, allowExpression, isMethod = false) { - super.parseFunctionBody(node, allowExpression, isMethod); - node.expression = node.body.type !== "BlockStatement"; - } - - parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { - let funcNode = this.startNode(); - funcNode.kind = node.kind; - funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); - funcNode.type = "FunctionExpression"; - delete funcNode.kind; - node.value = funcNode; - - if (type === "ClassPrivateMethod") { - node.computed = false; - } - - type = "MethodDefinition"; - return this.finishNode(node, type); - } - - parseClassProperty(...args) { - const propertyNode = super.parseClassProperty(...args); - - if (this.getPluginOption("estree", "classFeatures")) { - propertyNode.type = "PropertyDefinition"; - } - - return propertyNode; - } - - parseClassPrivateProperty(...args) { - const propertyNode = super.parseClassPrivateProperty(...args); - - if (this.getPluginOption("estree", "classFeatures")) { - propertyNode.type = "PropertyDefinition"; - propertyNode.computed = false; - } - - return propertyNode; - } - - parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { - const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor); - - if (node) { - node.type = "Property"; - if (node.kind === "method") node.kind = "init"; - node.shorthand = false; - } - - return node; - } - - parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) { - const node = super.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors); - - if (node) { - node.kind = "init"; - node.type = "Property"; - } - - return node; - } - - toAssignable(node, isLHS = false) { - if (node != null && this.isObjectProperty(node)) { - this.toAssignable(node.value, isLHS); - return node; - } - - return super.toAssignable(node, isLHS); - } - - toAssignableObjectExpressionProp(prop, ...args) { - if (prop.kind === "get" || prop.kind === "set") { - this.raise(prop.key.start, ErrorMessages.PatternHasAccessor); - } else if (prop.method) { - this.raise(prop.key.start, ErrorMessages.PatternHasMethod); - } else { - super.toAssignableObjectExpressionProp(prop, ...args); - } - } - - finishCallExpression(node, optional) { - super.finishCallExpression(node, optional); - - if (node.callee.type === "Import") { - node.type = "ImportExpression"; - node.source = node.arguments[0]; - delete node.arguments; - delete node.callee; - } - - return node; - } - - toReferencedArguments(node) { - if (node.type === "ImportExpression") { - return; - } - - super.toReferencedArguments(node); - } - - parseExport(node) { - super.parseExport(node); - - switch (node.type) { - case "ExportAllDeclaration": - node.exported = null; - break; - - case "ExportNamedDeclaration": - if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") { - node.type = "ExportAllDeclaration"; - node.exported = node.specifiers[0].exported; - delete node.specifiers; - } - - break; - } - - return node; - } - - parseSubscript(base, startPos, startLoc, noCalls, state) { - const node = super.parseSubscript(base, startPos, startLoc, noCalls, state); - - if (state.optionalChainMember) { - if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") { - node.type = node.type.substring(8); - } - - if (state.stop) { - const chain = this.startNodeAtNode(node); - chain.expression = node; - return this.finishNode(chain, "ChainExpression"); - } - } else if (node.type === "MemberExpression" || node.type === "CallExpression") { - node.optional = false; - } - - return node; - } - - hasPropertyAsPrivateName(node) { - if (node.type === "ChainExpression") { - node = node.expression; - } - - return super.hasPropertyAsPrivateName(node); - } - - isOptionalChain(node) { - return node.type === "ChainExpression"; - } - - isObjectProperty(node) { - return node.type === "Property" && node.kind === "init" && !node.method; - } - - isObjectMethod(node) { - return node.method || node.kind === "get" || node.kind === "set"; - } - -}); - -class TokContext { - constructor(token, isExpr, preserveSpace, override) { - this.token = void 0; - this.isExpr = void 0; - this.preserveSpace = void 0; - this.override = void 0; - this.token = token; - this.isExpr = !!isExpr; - this.preserveSpace = !!preserveSpace; - this.override = override; - } - -} -const types$1 = { - braceStatement: new TokContext("{", false), - braceExpression: new TokContext("{", true), - recordExpression: new TokContext("#{", true), - templateQuasi: new TokContext("${", false), - parenStatement: new TokContext("(", false), - parenExpression: new TokContext("(", true), - template: new TokContext("`", true, true, p => p.readTmplToken()), - functionExpression: new TokContext("function", true), - functionStatement: new TokContext("function", false) -}; - -types.parenR.updateContext = types.braceR.updateContext = function () { - if (this.state.context.length === 1) { - this.state.exprAllowed = true; - return; - } - - let out = this.state.context.pop(); - - if (out === types$1.braceStatement && this.curContext().token === "function") { - out = this.state.context.pop(); - } - - this.state.exprAllowed = !out.isExpr; -}; - -types.name.updateContext = function (prevType) { - let allowed = false; - - if (prevType !== types.dot) { - if (this.state.value === "of" && !this.state.exprAllowed && prevType !== types._function && prevType !== types._class) { - allowed = true; - } - } - - this.state.exprAllowed = allowed; - - if (this.state.isIterator) { - this.state.isIterator = false; - } -}; - -types.braceL.updateContext = function (prevType) { - this.state.context.push(this.braceIsBlock(prevType) ? types$1.braceStatement : types$1.braceExpression); - this.state.exprAllowed = true; -}; - -types.dollarBraceL.updateContext = function () { - this.state.context.push(types$1.templateQuasi); - this.state.exprAllowed = true; -}; - -types.parenL.updateContext = function (prevType) { - const statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; - this.state.context.push(statementParens ? types$1.parenStatement : types$1.parenExpression); - this.state.exprAllowed = true; -}; - -types.incDec.updateContext = function () {}; - -types._function.updateContext = types._class.updateContext = function (prevType) { - if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && !(prevType === types._return && this.hasPrecedingLineBreak()) && !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) { - this.state.context.push(types$1.functionExpression); - } else { - this.state.context.push(types$1.functionStatement); - } - - this.state.exprAllowed = false; -}; - -types.backQuote.updateContext = function () { - if (this.curContext() === types$1.template) { - this.state.context.pop(); - } else { - this.state.context.push(types$1.template); - } - - this.state.exprAllowed = false; -}; - -types.braceHashL.updateContext = function () { - this.state.context.push(types$1.recordExpression); - this.state.exprAllowed = true; -}; - -let 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-\u08c7\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\u0d04-\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-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\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-\uab69\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"; -let 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\u0b55-\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\u0d81-\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\u1abf\u1ac0\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\ua82c\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"; -const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; -const 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, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 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, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 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, 190, 0, 80, 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, 1237, 43, 8, 8952, 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, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; -const 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, 370, 1, 154, 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, 2, 11, 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, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 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, 82, 0, 12, 1, 19628, 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, 4759, 9, 787719, 239]; - -function isInAstralSet(code, set) { - let pos = 0x10000; - - for (let i = 0, length = set.length; i < length; i += 2) { - pos += set[i]; - if (pos > code) return false; - pos += set[i + 1]; - if (pos >= code) return true; - } - - return false; -} - -function isIdentifierStart(code) { - if (code < 65) return code === 36; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes); -} -function isIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); -} - -const reservedWords = { - keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], - strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], - strictBind: ["eval", "arguments"] -}; -const keywords$1 = new Set(reservedWords.keyword); -const reservedWordsStrictSet = new Set(reservedWords.strict); -const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); -function isReservedWord(word, inModule) { - return inModule && word === "await" || word === "enum"; -} -function isStrictReservedWord(word, inModule) { - return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); -} -function isStrictBindOnlyReservedWord(word) { - return reservedWordsStrictBindSet.has(word); -} -function isStrictBindReservedWord(word, inModule) { - return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); -} -function isKeyword(word) { - return keywords$1.has(word); -} - -const keywordRelationalOperator = /^in(stanceof)?$/; -function isIteratorStart(current, next) { - return current === 64 && next === 64; -} - -const SCOPE_OTHER = 0b000000000, - SCOPE_PROGRAM = 0b000000001, - SCOPE_FUNCTION = 0b000000010, - SCOPE_ARROW = 0b000000100, - SCOPE_SIMPLE_CATCH = 0b000001000, - SCOPE_SUPER = 0b000010000, - SCOPE_DIRECT_SUPER = 0b000100000, - SCOPE_CLASS = 0b001000000, - SCOPE_STATIC_BLOCK = 0b010000000, - SCOPE_TS_MODULE = 0b100000000, - SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE; -const BIND_KIND_VALUE = 0b000000000001, - BIND_KIND_TYPE = 0b000000000010, - BIND_SCOPE_VAR = 0b000000000100, - BIND_SCOPE_LEXICAL = 0b000000001000, - BIND_SCOPE_FUNCTION = 0b000000010000, - BIND_FLAGS_NONE = 0b000001000000, - BIND_FLAGS_CLASS = 0b000010000000, - BIND_FLAGS_TS_ENUM = 0b000100000000, - BIND_FLAGS_TS_CONST_ENUM = 0b001000000000, - BIND_FLAGS_TS_EXPORT_ONLY = 0b010000000000, - BIND_FLAGS_FLOW_DECLARE_FN = 0b100000000000; -const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS, - BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0, - BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0, - BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0, - BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS, - BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0, - BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM, - BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, - BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE, - BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE, - BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM, - BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, - BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN; -const CLASS_ELEMENT_FLAG_STATIC = 0b100, - CLASS_ELEMENT_KIND_GETTER = 0b010, - CLASS_ELEMENT_KIND_SETTER = 0b001, - CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER; -const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC, - CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC, - CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER, - CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER, - CLASS_ELEMENT_OTHER = 0; - -class Scope { - constructor(flags) { - this.flags = void 0; - this.var = []; - this.lexical = []; - this.functions = []; - this.flags = flags; - } - -} -class ScopeHandler { - constructor(raise, inModule) { - this.scopeStack = []; - this.undefinedExports = new Map(); - this.undefinedPrivateNames = new Map(); - this.raise = raise; - this.inModule = inModule; - } - - get inFunction() { - return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0; - } - - get allowSuper() { - return (this.currentThisScope().flags & SCOPE_SUPER) > 0; - } - - get allowDirectSuper() { - return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0; - } - - get inClass() { - return (this.currentThisScope().flags & SCOPE_CLASS) > 0; - } - - get inStaticBlock() { - return (this.currentThisScope().flags & SCOPE_STATIC_BLOCK) > 0; - } - - get inNonArrowFunction() { - return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0; - } - - get treatFunctionsAsVar() { - return this.treatFunctionsAsVarInScope(this.currentScope()); - } - - createScope(flags) { - return new Scope(flags); - } - - enter(flags) { - this.scopeStack.push(this.createScope(flags)); - } - - exit() { - this.scopeStack.pop(); - } - - treatFunctionsAsVarInScope(scope) { - return !!(scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_PROGRAM); - } - - declareName(name, bindingType, pos) { - let scope = this.currentScope(); - - if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) { - this.checkRedeclarationInScope(scope, name, bindingType, pos); - - if (bindingType & BIND_SCOPE_FUNCTION) { - scope.functions.push(name); - } else { - scope.lexical.push(name); - } - - if (bindingType & BIND_SCOPE_LEXICAL) { - this.maybeExportDefined(scope, name); - } - } else if (bindingType & BIND_SCOPE_VAR) { - for (let i = this.scopeStack.length - 1; i >= 0; --i) { - scope = this.scopeStack[i]; - this.checkRedeclarationInScope(scope, name, bindingType, pos); - scope.var.push(name); - this.maybeExportDefined(scope, name); - if (scope.flags & SCOPE_VAR) break; - } - } - - if (this.inModule && scope.flags & SCOPE_PROGRAM) { - this.undefinedExports.delete(name); - } - } - - maybeExportDefined(scope, name) { - if (this.inModule && scope.flags & SCOPE_PROGRAM) { - this.undefinedExports.delete(name); - } - } - - checkRedeclarationInScope(scope, name, bindingType, pos) { - if (this.isRedeclaredInScope(scope, name, bindingType)) { - this.raise(pos, ErrorMessages.VarRedeclaration, name); - } - } - - isRedeclaredInScope(scope, name, bindingType) { - if (!(bindingType & BIND_KIND_VALUE)) return false; - - if (bindingType & BIND_SCOPE_LEXICAL) { - return scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; - } - - if (bindingType & BIND_SCOPE_FUNCTION) { - return scope.lexical.indexOf(name) > -1 || !this.treatFunctionsAsVarInScope(scope) && scope.var.indexOf(name) > -1; - } - - return scope.lexical.indexOf(name) > -1 && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.indexOf(name) > -1; - } - - checkLocalExport(id) { - if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1 && this.scopeStack[0].functions.indexOf(id.name) === -1) { - this.undefinedExports.set(id.name, id.start); - } - } - - currentScope() { - return this.scopeStack[this.scopeStack.length - 1]; - } - - currentVarScope() { - for (let i = this.scopeStack.length - 1;; i--) { - const scope = this.scopeStack[i]; - - if (scope.flags & SCOPE_VAR) { - return scope; - } - } - } - - currentThisScope() { - for (let i = this.scopeStack.length - 1;; i--) { - const scope = this.scopeStack[i]; - - if ((scope.flags & SCOPE_VAR || scope.flags & SCOPE_CLASS) && !(scope.flags & SCOPE_ARROW)) { - return scope; - } - } - } - -} - -class FlowScope extends Scope { - constructor(...args) { - super(...args); - this.declareFunctions = []; - } - -} - -class FlowScopeHandler extends ScopeHandler { - createScope(flags) { - return new FlowScope(flags); - } - - declareName(name, bindingType, pos) { - const scope = this.currentScope(); - - if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) { - this.checkRedeclarationInScope(scope, name, bindingType, pos); - this.maybeExportDefined(scope, name); - scope.declareFunctions.push(name); - return; - } - - super.declareName(...arguments); - } - - isRedeclaredInScope(scope, name, bindingType) { - if (super.isRedeclaredInScope(...arguments)) return true; - - if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) { - return !scope.declareFunctions.includes(name) && (scope.lexical.includes(name) || scope.functions.includes(name)); - } - - return false; - } - - checkLocalExport(id) { - if (this.scopeStack[0].declareFunctions.indexOf(id.name) === -1) { - super.checkLocalExport(id); - } - } - -} - -const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]); -const FlowErrors = Object.freeze({ - AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", - AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module", - AssignReservedType: "Cannot overwrite reserved type %0", - DeclareClassElement: "The `declare` modifier can only appear on class fields.", - DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.", - DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement", - EnumBooleanMemberNotInitialized: "Boolean enum members need to be initialized. Use either `%0 = true,` or `%0 = false,` in enum `%1`.", - EnumDuplicateMemberName: "Enum member names need to be unique, but the name `%0` has already been used before in enum `%1`.", - EnumInconsistentMemberValues: "Enum `%0` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.", - EnumInvalidExplicitType: "Enum type `%1` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.", - EnumInvalidExplicitTypeUnknownSupplied: "Supplied enum type is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.", - EnumInvalidMemberInitializerPrimaryType: "Enum `%0` has type `%2`, so the initializer of `%1` needs to be a %2 literal.", - EnumInvalidMemberInitializerSymbolType: "Symbol enum members cannot be initialized. Use `%1,` in enum `%0`.", - EnumInvalidMemberInitializerUnknownType: "The enum member initializer for `%1` needs to be a literal (either a boolean, number, or string) in enum `%0`.", - EnumInvalidMemberName: "Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `%0`, consider using `%1`, in enum `%2`.", - EnumNumberMemberNotInitialized: "Number enum members need to be initialized, e.g. `%1 = 1` in enum `%0`.", - EnumStringMemberInconsistentlyInitailized: "String enum members need to consistently either all use initializers, or use no initializers, in enum `%0`.", - GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", - ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements", - InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type", - InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions", - InexactVariance: "Explicit inexact syntax cannot have variance", - InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`", - MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", - NestedDeclareModule: "`declare module` cannot be used inside another `declare module`", - NestedFlowComment: "Cannot have a flow comment inside another flow comment", - OptionalBindingPattern: "A binding pattern parameter cannot be optional in an implementation signature.", - SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.", - SpreadVariance: "Spread properties cannot have variance", - ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.", - ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.", - ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.", - ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.", - ThisParamNoDefault: "The `this` parameter may not have a default value.", - TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`", - TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis", - UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object", - UnexpectedReservedType: "Unexpected reserved type %0", - UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new", - UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.", - UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions", - UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint"', - UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration", - UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`", - UnsupportedDeclareExportKind: "`declare export %0` is not supported. Use `%1` instead", - UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module", - UnterminatedFlowComment: "Unterminated flow-comment" -}); - -function isEsModuleType(bodyElement) { - return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration"); -} - -function hasTypeImportKind(node) { - return node.importKind === "type" || node.importKind === "typeof"; -} - -function isMaybeDefaultImport(state) { - return (state.type === types.name || !!state.type.keyword) && state.value !== "from"; -} - -const exportSuggestions = { - const: "declare export var", - let: "declare export var", - type: "export type", - interface: "export interface" -}; - -function partition(list, test) { - const list1 = []; - const list2 = []; - - for (let i = 0; i < list.length; i++) { - (test(list[i], i, list) ? list1 : list2).push(list[i]); - } - - return [list1, list2]; -} - -const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; -var flow = (superClass => { - var _temp; - - return _temp = class extends superClass { - constructor(...args) { - super(...args); - this.flowPragma = undefined; - } - - getScopeHandler() { - return FlowScopeHandler; - } - - shouldParseTypes() { - return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; - } - - shouldParseEnums() { - return !!this.getPluginOption("flow", "enums"); - } - - finishToken(type, val) { - if (type !== types.string && type !== types.semi && type !== types.interpreterDirective) { - if (this.flowPragma === undefined) { - this.flowPragma = null; - } - } - - return super.finishToken(type, val); - } - - addComment(comment) { - if (this.flowPragma === undefined) { - const matches = FLOW_PRAGMA_REGEX.exec(comment.value); - - if (!matches) ; else if (matches[1] === "flow") { - this.flowPragma = "flow"; - } else if (matches[1] === "noflow") { - this.flowPragma = "noflow"; - } else { - throw new Error("Unexpected flow pragma"); - } - } - - return super.addComment(comment); - } - - flowParseTypeInitialiser(tok) { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(tok || types.colon); - const type = this.flowParseType(); - this.state.inType = oldInType; - return type; - } - - flowParsePredicate() { - const node = this.startNode(); - const moduloLoc = this.state.startLoc; - const moduloPos = this.state.start; - this.expect(types.modulo); - const checksLoc = this.state.startLoc; - this.expectContextual("checks"); - - if (moduloLoc.line !== checksLoc.line || moduloLoc.column !== checksLoc.column - 1) { - this.raise(moduloPos, FlowErrors.UnexpectedSpaceBetweenModuloChecks); - } - - if (this.eat(types.parenL)) { - node.value = this.parseExpression(); - this.expect(types.parenR); - return this.finishNode(node, "DeclaredPredicate"); - } else { - return this.finishNode(node, "InferredPredicate"); - } - } - - flowParseTypeAndPredicateInitialiser() { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(types.colon); - let type = null; - let predicate = null; - - if (this.match(types.modulo)) { - this.state.inType = oldInType; - predicate = this.flowParsePredicate(); - } else { - type = this.flowParseType(); - this.state.inType = oldInType; - - if (this.match(types.modulo)) { - predicate = this.flowParsePredicate(); - } - } - - return [type, predicate]; - } - - flowParseDeclareClass(node) { - this.next(); - this.flowParseInterfaceish(node, true); - return this.finishNode(node, "DeclareClass"); - } - - flowParseDeclareFunction(node) { - this.next(); - const id = node.id = this.parseIdentifier(); - const typeNode = this.startNode(); - const typeContainer = this.startNode(); - - if (this.isRelational("<")) { - typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - typeNode.typeParameters = null; - } - - this.expect(types.parenL); - const tmp = this.flowParseFunctionTypeParams(); - typeNode.params = tmp.params; - typeNode.rest = tmp.rest; - typeNode.this = tmp._this; - this.expect(types.parenR); - [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); - id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); - this.resetEndLocation(id); - this.semicolon(); - this.scope.declareName(node.id.name, BIND_FLOW_DECLARE_FN, node.id.start); - return this.finishNode(node, "DeclareFunction"); - } - - flowParseDeclare(node, insideModule) { - if (this.match(types._class)) { - return this.flowParseDeclareClass(node); - } else if (this.match(types._function)) { - return this.flowParseDeclareFunction(node); - } else if (this.match(types._var)) { - return this.flowParseDeclareVariable(node); - } else if (this.eatContextual("module")) { - if (this.match(types.dot)) { - return this.flowParseDeclareModuleExports(node); - } else { - if (insideModule) { - this.raise(this.state.lastTokStart, FlowErrors.NestedDeclareModule); - } - - return this.flowParseDeclareModule(node); - } - } else if (this.isContextual("type")) { - return this.flowParseDeclareTypeAlias(node); - } else if (this.isContextual("opaque")) { - return this.flowParseDeclareOpaqueType(node); - } else if (this.isContextual("interface")) { - return this.flowParseDeclareInterface(node); - } else if (this.match(types._export)) { - return this.flowParseDeclareExportDeclaration(node, insideModule); - } else { - throw this.unexpected(); - } - } - - flowParseDeclareVariable(node) { - this.next(); - node.id = this.flowParseTypeAnnotatableIdentifier(true); - this.scope.declareName(node.id.name, BIND_VAR, node.id.start); - this.semicolon(); - return this.finishNode(node, "DeclareVariable"); - } - - flowParseDeclareModule(node) { - this.scope.enter(SCOPE_OTHER); - - if (this.match(types.string)) { - node.id = this.parseExprAtom(); - } else { - node.id = this.parseIdentifier(); - } - - const bodyNode = node.body = this.startNode(); - const body = bodyNode.body = []; - this.expect(types.braceL); - - while (!this.match(types.braceR)) { - let bodyNode = this.startNode(); - - if (this.match(types._import)) { - this.next(); - - if (!this.isContextual("type") && !this.match(types._typeof)) { - this.raise(this.state.lastTokStart, FlowErrors.InvalidNonTypeImportInDeclareModule); - } - - this.parseImport(bodyNode); - } else { - this.expectContextual("declare", FlowErrors.UnsupportedStatementInDeclareModule); - bodyNode = this.flowParseDeclare(bodyNode, true); - } - - body.push(bodyNode); - } - - this.scope.exit(); - this.expect(types.braceR); - this.finishNode(bodyNode, "BlockStatement"); - let kind = null; - let hasModuleExport = false; - body.forEach(bodyElement => { - if (isEsModuleType(bodyElement)) { - if (kind === "CommonJS") { - this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind); - } - - kind = "ES"; - } else if (bodyElement.type === "DeclareModuleExports") { - if (hasModuleExport) { - this.raise(bodyElement.start, FlowErrors.DuplicateDeclareModuleExports); - } - - if (kind === "ES") { - this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind); - } - - kind = "CommonJS"; - hasModuleExport = true; - } - }); - node.kind = kind || "CommonJS"; - return this.finishNode(node, "DeclareModule"); - } - - flowParseDeclareExportDeclaration(node, insideModule) { - this.expect(types._export); - - if (this.eat(types._default)) { - if (this.match(types._function) || this.match(types._class)) { - node.declaration = this.flowParseDeclare(this.startNode()); - } else { - node.declaration = this.flowParseType(); - this.semicolon(); - } - - node.default = true; - return this.finishNode(node, "DeclareExportDeclaration"); - } else { - if (this.match(types._const) || this.isLet() || (this.isContextual("type") || this.isContextual("interface")) && !insideModule) { - const label = this.state.value; - const suggestion = exportSuggestions[label]; - throw this.raise(this.state.start, FlowErrors.UnsupportedDeclareExportKind, label, suggestion); - } - - if (this.match(types._var) || this.match(types._function) || this.match(types._class) || this.isContextual("opaque")) { - node.declaration = this.flowParseDeclare(this.startNode()); - node.default = false; - return this.finishNode(node, "DeclareExportDeclaration"); - } else if (this.match(types.star) || this.match(types.braceL) || this.isContextual("interface") || this.isContextual("type") || this.isContextual("opaque")) { - node = this.parseExport(node); - - if (node.type === "ExportNamedDeclaration") { - node.type = "ExportDeclaration"; - node.default = false; - delete node.exportKind; - } - - node.type = "Declare" + node.type; - return node; - } - } - - throw this.unexpected(); - } - - flowParseDeclareModuleExports(node) { - this.next(); - this.expectContextual("exports"); - node.typeAnnotation = this.flowParseTypeAnnotation(); - this.semicolon(); - return this.finishNode(node, "DeclareModuleExports"); - } - - flowParseDeclareTypeAlias(node) { - this.next(); - this.flowParseTypeAlias(node); - node.type = "DeclareTypeAlias"; - return node; - } - - flowParseDeclareOpaqueType(node) { - this.next(); - this.flowParseOpaqueType(node, true); - node.type = "DeclareOpaqueType"; - return node; - } - - flowParseDeclareInterface(node) { - this.next(); - this.flowParseInterfaceish(node); - return this.finishNode(node, "DeclareInterface"); - } - - flowParseInterfaceish(node, isClass = false) { - node.id = this.flowParseRestrictedIdentifier(!isClass, true); - this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.start); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - - node.extends = []; - node.implements = []; - node.mixins = []; - - if (this.eat(types._extends)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (!isClass && this.eat(types.comma)); - } - - if (this.isContextual("mixins")) { - this.next(); - - do { - node.mixins.push(this.flowParseInterfaceExtends()); - } while (this.eat(types.comma)); - } - - if (this.isContextual("implements")) { - this.next(); - - do { - node.implements.push(this.flowParseInterfaceExtends()); - } while (this.eat(types.comma)); - } - - node.body = this.flowParseObjectType({ - allowStatic: isClass, - allowExact: false, - allowSpread: false, - allowProto: isClass, - allowInexact: false - }); - } - - flowParseInterfaceExtends() { - const node = this.startNode(); - node.id = this.flowParseQualifiedTypeIdentifier(); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } - - return this.finishNode(node, "InterfaceExtends"); - } - - flowParseInterface(node) { - this.flowParseInterfaceish(node); - return this.finishNode(node, "InterfaceDeclaration"); - } - - checkNotUnderscore(word) { - if (word === "_") { - this.raise(this.state.start, FlowErrors.UnexpectedReservedUnderscore); - } - } - - checkReservedType(word, startLoc, declaration) { - if (!reservedTypes.has(word)) return; - this.raise(startLoc, declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, word); - } - - flowParseRestrictedIdentifier(liberal, declaration) { - this.checkReservedType(this.state.value, this.state.start, declaration); - return this.parseIdentifier(liberal); - } - - flowParseTypeAlias(node) { - node.id = this.flowParseRestrictedIdentifier(false, true); - this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - - node.right = this.flowParseTypeInitialiser(types.eq); - this.semicolon(); - return this.finishNode(node, "TypeAlias"); - } - - flowParseOpaqueType(node, declare) { - this.expectContextual("type"); - node.id = this.flowParseRestrictedIdentifier(true, true); - this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - - node.supertype = null; - - if (this.match(types.colon)) { - node.supertype = this.flowParseTypeInitialiser(types.colon); - } - - node.impltype = null; - - if (!declare) { - node.impltype = this.flowParseTypeInitialiser(types.eq); - } - - this.semicolon(); - return this.finishNode(node, "OpaqueType"); - } - - flowParseTypeParameter(requireDefault = false) { - const nodeStart = this.state.start; - const node = this.startNode(); - const variance = this.flowParseVariance(); - const ident = this.flowParseTypeAnnotatableIdentifier(); - node.name = ident.name; - node.variance = variance; - node.bound = ident.typeAnnotation; - - if (this.match(types.eq)) { - this.eat(types.eq); - node.default = this.flowParseType(); - } else { - if (requireDefault) { - this.raise(nodeStart, FlowErrors.MissingTypeParamDefault); - } - } - - return this.finishNode(node, "TypeParameter"); - } - - flowParseTypeParameterDeclaration() { - const oldInType = this.state.inType; - const node = this.startNode(); - node.params = []; - this.state.inType = true; - - if (this.isRelational("<") || this.match(types.jsxTagStart)) { - this.next(); - } else { - this.unexpected(); - } - - let defaultRequired = false; - - do { - const typeParameter = this.flowParseTypeParameter(defaultRequired); - node.params.push(typeParameter); - - if (typeParameter.default) { - defaultRequired = true; - } - - if (!this.isRelational(">")) { - this.expect(types.comma); - } - } while (!this.isRelational(">")); - - this.expectRelational(">"); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterDeclaration"); - } - - flowParseTypeParameterInstantiation() { - const node = this.startNode(); - const oldInType = this.state.inType; - node.params = []; - this.state.inType = true; - this.expectRelational("<"); - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = false; - - while (!this.isRelational(">")) { - node.params.push(this.flowParseType()); - - if (!this.isRelational(">")) { - this.expect(types.comma); - } - } - - this.state.noAnonFunctionType = oldNoAnonFunctionType; - this.expectRelational(">"); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterInstantiation"); - } - - flowParseTypeParameterInstantiationCallOrNew() { - const node = this.startNode(); - const oldInType = this.state.inType; - node.params = []; - this.state.inType = true; - this.expectRelational("<"); - - while (!this.isRelational(">")) { - node.params.push(this.flowParseTypeOrImplicitInstantiation()); - - if (!this.isRelational(">")) { - this.expect(types.comma); - } - } - - this.expectRelational(">"); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterInstantiation"); - } - - flowParseInterfaceType() { - const node = this.startNode(); - this.expectContextual("interface"); - node.extends = []; - - if (this.eat(types._extends)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (this.eat(types.comma)); - } - - node.body = this.flowParseObjectType({ - allowStatic: false, - allowExact: false, - allowSpread: false, - allowProto: false, - allowInexact: false - }); - return this.finishNode(node, "InterfaceTypeAnnotation"); - } - - flowParseObjectPropertyKey() { - return this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true); - } - - flowParseObjectTypeIndexer(node, isStatic, variance) { - node.static = isStatic; - - if (this.lookahead().type === types.colon) { - node.id = this.flowParseObjectPropertyKey(); - node.key = this.flowParseTypeInitialiser(); - } else { - node.id = null; - node.key = this.flowParseType(); - } - - this.expect(types.bracketR); - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; - return this.finishNode(node, "ObjectTypeIndexer"); - } - - flowParseObjectTypeInternalSlot(node, isStatic) { - node.static = isStatic; - node.id = this.flowParseObjectPropertyKey(); - this.expect(types.bracketR); - this.expect(types.bracketR); - - if (this.isRelational("<") || this.match(types.parenL)) { - node.method = true; - node.optional = false; - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); - } else { - node.method = false; - - if (this.eat(types.question)) { - node.optional = true; - } - - node.value = this.flowParseTypeInitialiser(); - } - - return this.finishNode(node, "ObjectTypeInternalSlot"); - } - - flowParseObjectTypeMethodish(node) { - node.params = []; - node.rest = null; - node.typeParameters = null; - node.this = null; - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - this.expect(types.parenL); - - if (this.match(types._this)) { - node.this = this.flowParseFunctionTypeParam(true); - node.this.name = null; - - if (!this.match(types.parenR)) { - this.expect(types.comma); - } - } - - while (!this.match(types.parenR) && !this.match(types.ellipsis)) { - node.params.push(this.flowParseFunctionTypeParam(false)); - - if (!this.match(types.parenR)) { - this.expect(types.comma); - } - } - - if (this.eat(types.ellipsis)) { - node.rest = this.flowParseFunctionTypeParam(false); - } - - this.expect(types.parenR); - node.returnType = this.flowParseTypeInitialiser(); - return this.finishNode(node, "FunctionTypeAnnotation"); - } - - flowParseObjectTypeCallProperty(node, isStatic) { - const valueNode = this.startNode(); - node.static = isStatic; - node.value = this.flowParseObjectTypeMethodish(valueNode); - return this.finishNode(node, "ObjectTypeCallProperty"); - } - - flowParseObjectType({ - allowStatic, - allowExact, - allowSpread, - allowProto, - allowInexact - }) { - const oldInType = this.state.inType; - this.state.inType = true; - const nodeStart = this.startNode(); - nodeStart.callProperties = []; - nodeStart.properties = []; - nodeStart.indexers = []; - nodeStart.internalSlots = []; - let endDelim; - let exact; - let inexact = false; - - if (allowExact && this.match(types.braceBarL)) { - this.expect(types.braceBarL); - endDelim = types.braceBarR; - exact = true; - } else { - this.expect(types.braceL); - endDelim = types.braceR; - exact = false; - } - - nodeStart.exact = exact; - - while (!this.match(endDelim)) { - let isStatic = false; - let protoStart = null; - let inexactStart = null; - const node = this.startNode(); - - if (allowProto && this.isContextual("proto")) { - const lookahead = this.lookahead(); - - if (lookahead.type !== types.colon && lookahead.type !== types.question) { - this.next(); - protoStart = this.state.start; - allowStatic = false; - } - } - - if (allowStatic && this.isContextual("static")) { - const lookahead = this.lookahead(); - - if (lookahead.type !== types.colon && lookahead.type !== types.question) { - this.next(); - isStatic = true; - } - } - - const variance = this.flowParseVariance(); - - if (this.eat(types.bracketL)) { - if (protoStart != null) { - this.unexpected(protoStart); - } - - if (this.eat(types.bracketL)) { - if (variance) { - this.unexpected(variance.start); - } - - nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); - } else { - nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); - } - } else if (this.match(types.parenL) || this.isRelational("<")) { - if (protoStart != null) { - this.unexpected(protoStart); - } - - if (variance) { - this.unexpected(variance.start); - } - - nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); - } else { - let kind = "init"; - - if (this.isContextual("get") || this.isContextual("set")) { - const lookahead = this.lookahead(); - - if (lookahead.type === types.name || lookahead.type === types.string || lookahead.type === types.num) { - kind = this.state.value; - this.next(); - } - } - - const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact); - - if (propOrInexact === null) { - inexact = true; - inexactStart = this.state.lastTokStart; - } else { - nodeStart.properties.push(propOrInexact); - } - } - - this.flowObjectTypeSemicolon(); - - if (inexactStart && !this.match(types.braceR) && !this.match(types.braceBarR)) { - this.raise(inexactStart, FlowErrors.UnexpectedExplicitInexactInObject); - } - } - - this.expect(endDelim); - - if (allowSpread) { - nodeStart.inexact = inexact; - } - - const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); - this.state.inType = oldInType; - return out; - } - - flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact) { - if (this.eat(types.ellipsis)) { - const isInexactToken = this.match(types.comma) || this.match(types.semi) || this.match(types.braceR) || this.match(types.braceBarR); - - if (isInexactToken) { - if (!allowSpread) { - this.raise(this.state.lastTokStart, FlowErrors.InexactInsideNonObject); - } else if (!allowInexact) { - this.raise(this.state.lastTokStart, FlowErrors.InexactInsideExact); - } - - if (variance) { - this.raise(variance.start, FlowErrors.InexactVariance); - } - - return null; - } - - if (!allowSpread) { - this.raise(this.state.lastTokStart, FlowErrors.UnexpectedSpreadType); - } - - if (protoStart != null) { - this.unexpected(protoStart); - } - - if (variance) { - this.raise(variance.start, FlowErrors.SpreadVariance); - } - - node.argument = this.flowParseType(); - return this.finishNode(node, "ObjectTypeSpreadProperty"); - } else { - node.key = this.flowParseObjectPropertyKey(); - node.static = isStatic; - node.proto = protoStart != null; - node.kind = kind; - let optional = false; - - if (this.isRelational("<") || this.match(types.parenL)) { - node.method = true; - - if (protoStart != null) { - this.unexpected(protoStart); - } - - if (variance) { - this.unexpected(variance.start); - } - - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); - - if (kind === "get" || kind === "set") { - this.flowCheckGetterSetterParams(node); - } - - if (!allowSpread && node.key.name === "constructor" && node.value.this) { - this.raise(node.value.this.start, FlowErrors.ThisParamBannedInConstructor); - } - } else { - if (kind !== "init") this.unexpected(); - node.method = false; - - if (this.eat(types.question)) { - optional = true; - } - - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; - } - - node.optional = optional; - return this.finishNode(node, "ObjectTypeProperty"); - } - } - - flowCheckGetterSetterParams(property) { - const paramCount = property.kind === "get" ? 0 : 1; - const start = property.start; - const length = property.value.params.length + (property.value.rest ? 1 : 0); - - if (property.value.this) { - this.raise(property.value.this.start, property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam); - } - - if (length !== paramCount) { - if (property.kind === "get") { - this.raise(start, ErrorMessages.BadGetterArity); - } else { - this.raise(start, ErrorMessages.BadSetterArity); - } - } - - if (property.kind === "set" && property.value.rest) { - this.raise(start, ErrorMessages.BadSetterRestParameter); - } - } - - flowObjectTypeSemicolon() { - if (!this.eat(types.semi) && !this.eat(types.comma) && !this.match(types.braceR) && !this.match(types.braceBarR)) { - this.unexpected(); - } - } - - flowParseQualifiedTypeIdentifier(startPos, startLoc, id) { - startPos = startPos || this.state.start; - startLoc = startLoc || this.state.startLoc; - let node = id || this.flowParseRestrictedIdentifier(true); - - while (this.eat(types.dot)) { - const node2 = this.startNodeAt(startPos, startLoc); - node2.qualification = node; - node2.id = this.flowParseRestrictedIdentifier(true); - node = this.finishNode(node2, "QualifiedTypeIdentifier"); - } - - return node; - } - - flowParseGenericType(startPos, startLoc, id) { - const node = this.startNodeAt(startPos, startLoc); - node.typeParameters = null; - node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } - - return this.finishNode(node, "GenericTypeAnnotation"); - } - - flowParseTypeofType() { - const node = this.startNode(); - this.expect(types._typeof); - node.argument = this.flowParsePrimaryType(); - return this.finishNode(node, "TypeofTypeAnnotation"); - } - - flowParseTupleType() { - const node = this.startNode(); - node.types = []; - this.expect(types.bracketL); - - while (this.state.pos < this.length && !this.match(types.bracketR)) { - node.types.push(this.flowParseType()); - if (this.match(types.bracketR)) break; - this.expect(types.comma); - } - - this.expect(types.bracketR); - return this.finishNode(node, "TupleTypeAnnotation"); - } - - flowParseFunctionTypeParam(first) { - let name = null; - let optional = false; - let typeAnnotation = null; - const node = this.startNode(); - const lh = this.lookahead(); - const isThis = this.state.type === types._this; - - if (lh.type === types.colon || lh.type === types.question) { - if (isThis && !first) { - this.raise(node.start, FlowErrors.ThisParamMustBeFirst); - } - - name = this.parseIdentifier(isThis); - - if (this.eat(types.question)) { - optional = true; - - if (isThis) { - this.raise(node.start, FlowErrors.ThisParamMayNotBeOptional); - } - } - - typeAnnotation = this.flowParseTypeInitialiser(); - } else { - typeAnnotation = this.flowParseType(); - } - - node.name = name; - node.optional = optional; - node.typeAnnotation = typeAnnotation; - return this.finishNode(node, "FunctionTypeParam"); - } - - reinterpretTypeAsFunctionTypeParam(type) { - const node = this.startNodeAt(type.start, type.loc.start); - node.name = null; - node.optional = false; - node.typeAnnotation = type; - return this.finishNode(node, "FunctionTypeParam"); - } - - flowParseFunctionTypeParams(params = []) { - let rest = null; - let _this = null; - - if (this.match(types._this)) { - _this = this.flowParseFunctionTypeParam(true); - _this.name = null; - - if (!this.match(types.parenR)) { - this.expect(types.comma); - } - } - - while (!this.match(types.parenR) && !this.match(types.ellipsis)) { - params.push(this.flowParseFunctionTypeParam(false)); - - if (!this.match(types.parenR)) { - this.expect(types.comma); - } - } - - if (this.eat(types.ellipsis)) { - rest = this.flowParseFunctionTypeParam(false); - } - - return { - params, - rest, - _this - }; - } - - flowIdentToTypeAnnotation(startPos, startLoc, node, id) { - switch (id.name) { - case "any": - return this.finishNode(node, "AnyTypeAnnotation"); - - case "bool": - case "boolean": - return this.finishNode(node, "BooleanTypeAnnotation"); - - case "mixed": - return this.finishNode(node, "MixedTypeAnnotation"); - - case "empty": - return this.finishNode(node, "EmptyTypeAnnotation"); - - case "number": - return this.finishNode(node, "NumberTypeAnnotation"); - - case "string": - return this.finishNode(node, "StringTypeAnnotation"); - - case "symbol": - return this.finishNode(node, "SymbolTypeAnnotation"); - - default: - this.checkNotUnderscore(id.name); - return this.flowParseGenericType(startPos, startLoc, id); - } - } - - flowParsePrimaryType() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const node = this.startNode(); - let tmp; - let type; - let isGroupedType = false; - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - - switch (this.state.type) { - case types.name: - if (this.isContextual("interface")) { - return this.flowParseInterfaceType(); - } - - return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier()); - - case types.braceL: - return this.flowParseObjectType({ - allowStatic: false, - allowExact: false, - allowSpread: true, - allowProto: false, - allowInexact: true - }); - - case types.braceBarL: - return this.flowParseObjectType({ - allowStatic: false, - allowExact: true, - allowSpread: true, - allowProto: false, - allowInexact: false - }); - - case types.bracketL: - this.state.noAnonFunctionType = false; - type = this.flowParseTupleType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - return type; - - case types.relational: - if (this.state.value === "<") { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - this.expect(types.parenL); - tmp = this.flowParseFunctionTypeParams(); - node.params = tmp.params; - node.rest = tmp.rest; - node.this = tmp._this; - this.expect(types.parenR); - this.expect(types.arrow); - node.returnType = this.flowParseType(); - return this.finishNode(node, "FunctionTypeAnnotation"); - } - - break; - - case types.parenL: - this.next(); - - if (!this.match(types.parenR) && !this.match(types.ellipsis)) { - if (this.match(types.name) || this.match(types._this)) { - const token = this.lookahead().type; - isGroupedType = token !== types.question && token !== types.colon; - } else { - isGroupedType = true; - } - } - - if (isGroupedType) { - this.state.noAnonFunctionType = false; - type = this.flowParseType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - - if (this.state.noAnonFunctionType || !(this.match(types.comma) || this.match(types.parenR) && this.lookahead().type === types.arrow)) { - this.expect(types.parenR); - return type; - } else { - this.eat(types.comma); - } - } - - if (type) { - tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); - } else { - tmp = this.flowParseFunctionTypeParams(); - } - - node.params = tmp.params; - node.rest = tmp.rest; - node.this = tmp._this; - this.expect(types.parenR); - this.expect(types.arrow); - node.returnType = this.flowParseType(); - node.typeParameters = null; - return this.finishNode(node, "FunctionTypeAnnotation"); - - case types.string: - return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); - - case types._true: - case types._false: - node.value = this.match(types._true); - this.next(); - return this.finishNode(node, "BooleanLiteralTypeAnnotation"); - - case types.plusMin: - if (this.state.value === "-") { - this.next(); - - if (this.match(types.num)) { - return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start); - } - - if (this.match(types.bigint)) { - return this.parseLiteral(-this.state.value, "BigIntLiteralTypeAnnotation", node.start, node.loc.start); - } - - throw this.raise(this.state.start, FlowErrors.UnexpectedSubtractionOperand); - } - - throw this.unexpected(); - - case types.num: - return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); - - case types.bigint: - return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); - - case types._void: - this.next(); - return this.finishNode(node, "VoidTypeAnnotation"); - - case types._null: - this.next(); - return this.finishNode(node, "NullLiteralTypeAnnotation"); - - case types._this: - this.next(); - return this.finishNode(node, "ThisTypeAnnotation"); - - case types.star: - this.next(); - return this.finishNode(node, "ExistsTypeAnnotation"); - - default: - if (this.state.type.keyword === "typeof") { - return this.flowParseTypeofType(); - } else if (this.state.type.keyword) { - const label = this.state.type.label; - this.next(); - return super.createIdentifier(node, label); - } - - } - - throw this.unexpected(); - } - - flowParsePostfixType() { - const startPos = this.state.start, - startLoc = this.state.startLoc; - let type = this.flowParsePrimaryType(); - - while (this.match(types.bracketL) && !this.canInsertSemicolon()) { - const node = this.startNodeAt(startPos, startLoc); - node.elementType = type; - this.expect(types.bracketL); - this.expect(types.bracketR); - type = this.finishNode(node, "ArrayTypeAnnotation"); - } - - return type; - } - - flowParsePrefixType() { - const node = this.startNode(); - - if (this.eat(types.question)) { - node.typeAnnotation = this.flowParsePrefixType(); - return this.finishNode(node, "NullableTypeAnnotation"); - } else { - return this.flowParsePostfixType(); - } - } - - flowParseAnonFunctionWithoutParens() { - const param = this.flowParsePrefixType(); - - if (!this.state.noAnonFunctionType && this.eat(types.arrow)) { - const node = this.startNodeAt(param.start, param.loc.start); - node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; - node.rest = null; - node.returnType = this.flowParseType(); - node.typeParameters = null; - return this.finishNode(node, "FunctionTypeAnnotation"); - } - - return param; - } - - flowParseIntersectionType() { - const node = this.startNode(); - this.eat(types.bitwiseAND); - const type = this.flowParseAnonFunctionWithoutParens(); - node.types = [type]; - - while (this.eat(types.bitwiseAND)) { - node.types.push(this.flowParseAnonFunctionWithoutParens()); - } - - return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); - } - - flowParseUnionType() { - const node = this.startNode(); - this.eat(types.bitwiseOR); - const type = this.flowParseIntersectionType(); - node.types = [type]; - - while (this.eat(types.bitwiseOR)) { - node.types.push(this.flowParseIntersectionType()); - } - - return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); - } - - flowParseType() { - const oldInType = this.state.inType; - this.state.inType = true; - const type = this.flowParseUnionType(); - this.state.inType = oldInType; - this.state.exprAllowed = this.state.exprAllowed || this.state.noAnonFunctionType; - return type; - } - - flowParseTypeOrImplicitInstantiation() { - if (this.state.type === types.name && this.state.value === "_") { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const node = this.parseIdentifier(); - return this.flowParseGenericType(startPos, startLoc, node); - } else { - return this.flowParseType(); - } - } - - flowParseTypeAnnotation() { - const node = this.startNode(); - node.typeAnnotation = this.flowParseTypeInitialiser(); - return this.finishNode(node, "TypeAnnotation"); - } - - flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { - const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); - - if (this.match(types.colon)) { - ident.typeAnnotation = this.flowParseTypeAnnotation(); - this.resetEndLocation(ident); - } - - return ident; - } - - typeCastToParameter(node) { - node.expression.typeAnnotation = node.typeAnnotation; - this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end); - return node.expression; - } - - flowParseVariance() { - let variance = null; - - if (this.match(types.plusMin)) { - variance = this.startNode(); - - if (this.state.value === "+") { - variance.kind = "plus"; - } else { - variance.kind = "minus"; - } - - this.next(); - this.finishNode(variance, "Variance"); - } - - return variance; - } - - parseFunctionBody(node, allowExpressionBody, isMethod = false) { - if (allowExpressionBody) { - return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); - } - - return super.parseFunctionBody(node, false, isMethod); - } - - parseFunctionBodyAndFinish(node, type, isMethod = false) { - if (this.match(types.colon)) { - const typeNode = this.startNode(); - [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; - } - - super.parseFunctionBodyAndFinish(node, type, isMethod); - } - - parseStatement(context, topLevel) { - if (this.state.strict && this.match(types.name) && this.state.value === "interface") { - const lookahead = this.lookahead(); - - if (lookahead.type === types.name || isKeyword(lookahead.value)) { - const node = this.startNode(); - this.next(); - return this.flowParseInterface(node); - } - } else if (this.shouldParseEnums() && this.isContextual("enum")) { - const node = this.startNode(); - this.next(); - return this.flowParseEnumDeclaration(node); - } - - const stmt = super.parseStatement(context, topLevel); - - if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { - this.flowPragma = null; - } - - return stmt; - } - - parseExpressionStatement(node, expr) { - if (expr.type === "Identifier") { - if (expr.name === "declare") { - if (this.match(types._class) || this.match(types.name) || this.match(types._function) || this.match(types._var) || this.match(types._export)) { - return this.flowParseDeclare(node); - } - } else if (this.match(types.name)) { - if (expr.name === "interface") { - return this.flowParseInterface(node); - } else if (expr.name === "type") { - return this.flowParseTypeAlias(node); - } else if (expr.name === "opaque") { - return this.flowParseOpaqueType(node, false); - } - } - } - - return super.parseExpressionStatement(node, expr); - } - - shouldParseExportDeclaration() { - return this.isContextual("type") || this.isContextual("interface") || this.isContextual("opaque") || this.shouldParseEnums() && this.isContextual("enum") || super.shouldParseExportDeclaration(); - } - - isExportDefaultSpecifier() { - if (this.match(types.name) && (this.state.value === "type" || this.state.value === "interface" || this.state.value === "opaque" || this.shouldParseEnums() && this.state.value === "enum")) { - return false; - } - - return super.isExportDefaultSpecifier(); - } - - parseExportDefaultExpression() { - if (this.shouldParseEnums() && this.isContextual("enum")) { - const node = this.startNode(); - this.next(); - return this.flowParseEnumDeclaration(node); - } - - return super.parseExportDefaultExpression(); - } - - parseConditional(expr, startPos, startLoc, refNeedsArrowPos) { - if (!this.match(types.question)) return expr; - - if (refNeedsArrowPos) { - const result = this.tryParse(() => super.parseConditional(expr, startPos, startLoc)); - - if (!result.node) { - refNeedsArrowPos.start = result.error.pos || this.state.start; - return expr; - } - - if (result.error) this.state = result.failState; - return result.node; - } - - this.expect(types.question); - const state = this.state.clone(); - const originalNoArrowAt = this.state.noArrowAt; - const node = this.startNodeAt(startPos, startLoc); - let { - consequent, - failed - } = this.tryParseConditionalConsequent(); - let [valid, invalid] = this.getArrowLikeExpressions(consequent); - - if (failed || invalid.length > 0) { - const noArrowAt = [...originalNoArrowAt]; - - if (invalid.length > 0) { - this.state = state; - this.state.noArrowAt = noArrowAt; - - for (let i = 0; i < invalid.length; i++) { - noArrowAt.push(invalid[i].start); - } - - ({ - consequent, - failed - } = this.tryParseConditionalConsequent()); - [valid, invalid] = this.getArrowLikeExpressions(consequent); - } - - if (failed && valid.length > 1) { - this.raise(state.start, FlowErrors.AmbiguousConditionalArrow); - } - - if (failed && valid.length === 1) { - this.state = state; - this.state.noArrowAt = noArrowAt.concat(valid[0].start); - ({ - consequent, - failed - } = this.tryParseConditionalConsequent()); - } - } - - this.getArrowLikeExpressions(consequent, true); - this.state.noArrowAt = originalNoArrowAt; - this.expect(types.colon); - node.test = expr; - node.consequent = consequent; - node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined, undefined)); - return this.finishNode(node, "ConditionalExpression"); - } - - tryParseConditionalConsequent() { - this.state.noArrowParamsConversionAt.push(this.state.start); - const consequent = this.parseMaybeAssignAllowIn(); - const failed = !this.match(types.colon); - this.state.noArrowParamsConversionAt.pop(); - return { - consequent, - failed - }; - } - - getArrowLikeExpressions(node, disallowInvalid) { - const stack = [node]; - const arrows = []; - - while (stack.length !== 0) { - const node = stack.pop(); - - if (node.type === "ArrowFunctionExpression") { - if (node.typeParameters || !node.returnType) { - this.finishArrowValidation(node); - } else { - arrows.push(node); - } - - stack.push(node.body); - } else if (node.type === "ConditionalExpression") { - stack.push(node.consequent); - stack.push(node.alternate); - } - } - - if (disallowInvalid) { - arrows.forEach(node => this.finishArrowValidation(node)); - return [arrows, []]; - } - - return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); - } - - finishArrowValidation(node) { - var _node$extra; - - this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingComma, false); - this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW); - super.checkParams(node, false, true); - this.scope.exit(); - } - - forwardNoArrowParamsConversionAt(node, parse) { - let result; - - if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - this.state.noArrowParamsConversionAt.push(this.state.start); - result = parse(); - this.state.noArrowParamsConversionAt.pop(); - } else { - result = parse(); - } - - return result; - } - - parseParenItem(node, startPos, startLoc) { - node = super.parseParenItem(node, startPos, startLoc); - - if (this.eat(types.question)) { - node.optional = true; - this.resetEndLocation(node); - } - - if (this.match(types.colon)) { - const typeCastNode = this.startNodeAt(startPos, startLoc); - typeCastNode.expression = node; - typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); - return this.finishNode(typeCastNode, "TypeCastExpression"); - } - - return node; - } - - assertModuleNodeAllowed(node) { - if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { - return; - } - - super.assertModuleNodeAllowed(node); - } - - parseExport(node) { - const decl = super.parseExport(node); - - if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") { - decl.exportKind = decl.exportKind || "value"; - } - - return decl; - } - - parseExportDeclaration(node) { - if (this.isContextual("type")) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - - if (this.match(types.braceL)) { - node.specifiers = this.parseExportSpecifiers(); - this.parseExportFrom(node); - return null; - } else { - return this.flowParseTypeAlias(declarationNode); - } - } else if (this.isContextual("opaque")) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseOpaqueType(declarationNode, false); - } else if (this.isContextual("interface")) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseInterface(declarationNode); - } else if (this.shouldParseEnums() && this.isContextual("enum")) { - node.exportKind = "value"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseEnumDeclaration(declarationNode); - } else { - return super.parseExportDeclaration(node); - } - } - - eatExportStar(node) { - if (super.eatExportStar(...arguments)) return true; - - if (this.isContextual("type") && this.lookahead().type === types.star) { - node.exportKind = "type"; - this.next(); - this.next(); - return true; - } - - return false; - } - - maybeParseExportNamespaceSpecifier(node) { - const pos = this.state.start; - const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); - - if (hasNamespace && node.exportKind === "type") { - this.unexpected(pos); - } - - return hasNamespace; - } - - parseClassId(node, isStatement, optionalId) { - super.parseClassId(node, isStatement, optionalId); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - } - - parseClassMember(classBody, member, state) { - const pos = this.state.start; - - if (this.isContextual("declare")) { - if (this.parseClassMemberFromModifier(classBody, member)) { - return; - } - - member.declare = true; - } - - super.parseClassMember(classBody, member, state); - - if (member.declare) { - if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") { - this.raise(pos, FlowErrors.DeclareClassElement); - } else if (member.value) { - this.raise(member.value.start, FlowErrors.DeclareClassFieldInitializer); - } - } - } - - getTokenFromCode(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (code === 123 && next === 124) { - return this.finishOp(types.braceBarL, 2); - } else if (this.state.inType && (code === 62 || code === 60)) { - return this.finishOp(types.relational, 1); - } else if (this.state.inType && code === 63) { - return this.finishOp(types.question, 1); - } else if (isIteratorStart(code, next)) { - this.state.isIterator = true; - return super.readWord(); - } else { - return super.getTokenFromCode(code); - } - } - - isAssignable(node, isBinding) { - switch (node.type) { - case "Identifier": - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - return true; - - case "ObjectExpression": - { - const last = node.properties.length - 1; - return node.properties.every((prop, i) => { - return prop.type !== "ObjectMethod" && (i === last || prop.type === "SpreadElement") && this.isAssignable(prop); - }); - } - - case "ObjectProperty": - return this.isAssignable(node.value); - - case "SpreadElement": - return this.isAssignable(node.argument); - - case "ArrayExpression": - return node.elements.every(element => this.isAssignable(element)); - - case "AssignmentExpression": - return node.operator === "="; - - case "ParenthesizedExpression": - case "TypeCastExpression": - return this.isAssignable(node.expression); - - case "MemberExpression": - case "OptionalMemberExpression": - return !isBinding; - - default: - return false; - } - } - - toAssignable(node, isLHS = false) { - if (node.type === "TypeCastExpression") { - return super.toAssignable(this.typeCastToParameter(node), isLHS); - } else { - return super.toAssignable(node, isLHS); - } - } - - toAssignableList(exprList, trailingCommaPos, isLHS) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - - if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { - exprList[i] = this.typeCastToParameter(expr); - } - } - - return super.toAssignableList(exprList, trailingCommaPos, isLHS); - } - - toReferencedList(exprList, isParenthesizedExpr) { - for (let i = 0; i < exprList.length; i++) { - var _expr$extra; - - const expr = exprList[i]; - - if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) == null ? void 0 : _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { - this.raise(expr.typeAnnotation.start, FlowErrors.TypeCastInPattern); - } - } - - return exprList; - } - - parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { - const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); - - if (canBePattern && !this.state.maybeInArrowParameters) { - this.toReferencedList(node.elements); - } - - return node; - } - - checkLVal(expr, ...args) { - if (expr.type !== "TypeCastExpression") { - return super.checkLVal(expr, ...args); - } - } - - parseClassProperty(node) { - if (this.match(types.colon)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } - - return super.parseClassProperty(node); - } - - parseClassPrivateProperty(node) { - if (this.match(types.colon)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } - - return super.parseClassPrivateProperty(node); - } - - isClassMethod() { - return this.isRelational("<") || super.isClassMethod(); - } - - isClassProperty() { - return this.match(types.colon) || super.isClassProperty(); - } - - isNonstaticConstructor(method) { - return !this.match(types.colon) && super.isNonstaticConstructor(method); - } - - isThisParam(param) { - return param.type === "Identifier" && param.name === "this"; - } - - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - if (method.variance) { - this.unexpected(method.variance.start); - } - - delete method.variance; - - if (this.isRelational("<")) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); - - if (method.params && isConstructor) { - const params = method.params; - - if (params.length > 0 && this.isThisParam(params[0])) { - this.raise(method.start, FlowErrors.ThisParamBannedInConstructor); - } - } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) { - const params = method.value.params; - - if (params.length > 0 && this.isThisParam(params[0])) { - this.raise(method.start, FlowErrors.ThisParamBannedInConstructor); - } - } - } - - pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { - if (method.variance) { - this.unexpected(method.variance.start); - } - - delete method.variance; - - if (this.isRelational("<")) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); - } - - parseClassSuper(node) { - super.parseClassSuper(node); - - if (node.superClass && this.isRelational("<")) { - node.superTypeParameters = this.flowParseTypeParameterInstantiation(); - } - - if (this.isContextual("implements")) { - this.next(); - const implemented = node.implements = []; - - do { - const node = this.startNode(); - node.id = this.flowParseRestrictedIdentifier(true); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } - - implemented.push(this.finishNode(node, "ClassImplements")); - } while (this.eat(types.comma)); - } - } - - checkGetterSetterParams(method) { - super.checkGetterSetterParams(method); - const params = this.getObjectOrClassMethodParams(method); - - if (params.length > 0) { - const param = params[0]; - - if (this.isThisParam(param) && method.kind === "get") { - this.raise(param.start, FlowErrors.GetterMayNotHaveThisParam); - } else if (this.isThisParam(param)) { - this.raise(param.start, FlowErrors.SetterMayNotHaveThisParam); - } - } - } - - parsePropertyName(node, isPrivateNameAllowed) { - const variance = this.flowParseVariance(); - const key = super.parsePropertyName(node, isPrivateNameAllowed); - node.variance = variance; - return key; - } - - parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { - if (prop.variance) { - this.unexpected(prop.variance.start); - } - - delete prop.variance; - let typeParameters; - - if (this.isRelational("<") && !isAccessor) { - typeParameters = this.flowParseTypeParameterDeclaration(); - if (!this.match(types.parenL)) this.unexpected(); - } - - super.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); - - if (typeParameters) { - (prop.value || prop).typeParameters = typeParameters; - } - } - - parseAssignableListItemTypes(param) { - if (this.eat(types.question)) { - if (param.type !== "Identifier") { - this.raise(param.start, FlowErrors.OptionalBindingPattern); - } - - if (this.isThisParam(param)) { - this.raise(param.start, FlowErrors.ThisParamMayNotBeOptional); - } - - param.optional = true; - } - - if (this.match(types.colon)) { - param.typeAnnotation = this.flowParseTypeAnnotation(); - } else if (this.isThisParam(param)) { - this.raise(param.start, FlowErrors.ThisParamAnnotationRequired); - } - - if (this.match(types.eq) && this.isThisParam(param)) { - this.raise(param.start, FlowErrors.ThisParamNoDefault); - } - - this.resetEndLocation(param); - return param; - } - - parseMaybeDefault(startPos, startLoc, left) { - const node = super.parseMaybeDefault(startPos, startLoc, left); - - if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(node.typeAnnotation.start, FlowErrors.TypeBeforeInitializer); - } - - return node; - } - - shouldParseDefaultImport(node) { - if (!hasTypeImportKind(node)) { - return super.shouldParseDefaultImport(node); - } - - return isMaybeDefaultImport(this.state); - } - - parseImportSpecifierLocal(node, specifier, type, contextDescription) { - specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); - this.checkLVal(specifier.local, contextDescription, BIND_LEXICAL); - node.specifiers.push(this.finishNode(specifier, type)); - } - - maybeParseDefaultImportSpecifier(node) { - node.importKind = "value"; - let kind = null; - - if (this.match(types._typeof)) { - kind = "typeof"; - } else if (this.isContextual("type")) { - kind = "type"; - } - - if (kind) { - const lh = this.lookahead(); - - if (kind === "type" && lh.type === types.star) { - this.unexpected(lh.start); - } - - if (isMaybeDefaultImport(lh) || lh.type === types.braceL || lh.type === types.star) { - this.next(); - node.importKind = kind; - } - } - - return super.maybeParseDefaultImportSpecifier(node); - } - - parseImportSpecifier(node) { - const specifier = this.startNode(); - const firstIdentLoc = this.state.start; - const firstIdent = this.parseModuleExportName(); - let specifierTypeKind = null; - - if (firstIdent.type === "Identifier") { - if (firstIdent.name === "type") { - specifierTypeKind = "type"; - } else if (firstIdent.name === "typeof") { - specifierTypeKind = "typeof"; - } - } - - let isBinding = false; - - if (this.isContextual("as") && !this.isLookaheadContextual("as")) { - const as_ident = this.parseIdentifier(true); - - if (specifierTypeKind !== null && !this.match(types.name) && !this.state.type.keyword) { - specifier.imported = as_ident; - specifier.importKind = specifierTypeKind; - specifier.local = as_ident.__clone(); - } else { - specifier.imported = firstIdent; - specifier.importKind = null; - specifier.local = this.parseIdentifier(); - } - } else if (specifierTypeKind !== null && (this.match(types.name) || this.state.type.keyword)) { - specifier.imported = this.parseIdentifier(true); - specifier.importKind = specifierTypeKind; - - if (this.eatContextual("as")) { - specifier.local = this.parseIdentifier(); - } else { - isBinding = true; - specifier.local = specifier.imported.__clone(); - } - } else { - if (firstIdent.type === "StringLiteral") { - throw this.raise(specifier.start, ErrorMessages.ImportBindingIsString, firstIdent.value); - } - - isBinding = true; - specifier.imported = firstIdent; - specifier.importKind = null; - specifier.local = specifier.imported.__clone(); - } - - const nodeIsTypeImport = hasTypeImportKind(node); - const specifierIsTypeImport = hasTypeImportKind(specifier); - - if (nodeIsTypeImport && specifierIsTypeImport) { - this.raise(firstIdentLoc, FlowErrors.ImportTypeShorthandOnlyInPureImport); - } - - if (nodeIsTypeImport || specifierIsTypeImport) { - this.checkReservedType(specifier.local.name, specifier.local.start, true); - } - - if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) { - this.checkReservedWord(specifier.local.name, specifier.start, true, true); - } - - this.checkLVal(specifier.local, "import specifier", BIND_LEXICAL); - node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); - } - - parseBindingAtom() { - switch (this.state.type) { - case types._this: - return this.parseIdentifier(true); - - default: - return super.parseBindingAtom(); - } - } - - parseFunctionParams(node, allowModifiers) { - const kind = node.kind; - - if (kind !== "get" && kind !== "set" && this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - super.parseFunctionParams(node, allowModifiers); - } - - parseVarId(decl, kind) { - super.parseVarId(decl, kind); - - if (this.match(types.colon)) { - decl.id.typeAnnotation = this.flowParseTypeAnnotation(); - this.resetEndLocation(decl.id); - } - } - - parseAsyncArrowFromCallExpression(node, call) { - if (this.match(types.colon)) { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - node.returnType = this.flowParseTypeAnnotation(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - } - - return super.parseAsyncArrowFromCallExpression(node, call); - } - - shouldParseAsyncArrow() { - return this.match(types.colon) || super.shouldParseAsyncArrow(); - } - - parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos) { - var _jsx; - - let state = null; - let jsx; - - if (this.hasPlugin("jsx") && (this.match(types.jsxTagStart) || this.isRelational("<"))) { - state = this.state.clone(); - jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos), state); - if (!jsx.error) return jsx.node; - const { - context - } = this.state; - - if (context[context.length - 1] === types$1.j_oTag) { - context.length -= 2; - } else if (context[context.length - 1] === types$1.j_expr) { - context.length -= 1; - } - } - - if (((_jsx = jsx) == null ? void 0 : _jsx.error) || this.isRelational("<")) { - var _jsx2, _jsx3; - - state = state || this.state.clone(); - let typeParameters; - const arrow = this.tryParse(abort => { - var _arrowExpression$extr; - - typeParameters = this.flowParseTypeParameterDeclaration(); - const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { - const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos); - this.resetStartLocationFromNode(result, typeParameters); - return result; - }); - - if (arrowExpression.type !== "ArrowFunctionExpression" && ((_arrowExpression$extr = arrowExpression.extra) == null ? void 0 : _arrowExpression$extr.parenthesized)) { - abort(); - } - - const expr = this.maybeUnwrapTypeCastExpression(arrowExpression); - expr.typeParameters = typeParameters; - this.resetStartLocationFromNode(expr, typeParameters); - return arrowExpression; - }, state); - let arrowExpression = null; - - if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { - if (!arrow.error && !arrow.aborted) { - if (arrow.node.async) { - this.raise(typeParameters.start, FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction); - } - - return arrow.node; - } - - arrowExpression = arrow.node; - } - - if ((_jsx2 = jsx) == null ? void 0 : _jsx2.node) { - this.state = jsx.failState; - return jsx.node; - } - - if (arrowExpression) { - this.state = arrow.failState; - return arrowExpression; - } - - if ((_jsx3 = jsx) == null ? void 0 : _jsx3.thrown) throw jsx.error; - if (arrow.thrown) throw arrow.error; - throw this.raise(typeParameters.start, FlowErrors.UnexpectedTokenAfterTypeParameter); - } - - return super.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos); - } - - parseArrow(node) { - if (this.match(types.colon)) { - const result = this.tryParse(() => { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - const typeNode = this.startNode(); - [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - if (this.canInsertSemicolon()) this.unexpected(); - if (!this.match(types.arrow)) this.unexpected(); - return typeNode; - }); - if (result.thrown) return null; - if (result.error) this.state = result.failState; - node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null; - } - - return super.parseArrow(node); - } - - shouldParseArrow() { - return this.match(types.colon) || super.shouldParseArrow(); - } - - setArrowFunctionParameters(node, params) { - if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - node.params = params; - } else { - super.setArrowFunctionParameters(node, params); - } - } - - checkParams(node, allowDuplicates, isArrowFunction) { - if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - return; - } - - for (let i = 0; i < node.params.length; i++) { - if (this.isThisParam(node.params[i]) && i > 0) { - this.raise(node.params[i].start, FlowErrors.ThisParamMustBeFirst); - } - } - - return super.checkParams(...arguments); - } - - parseParenAndDistinguishExpression(canBeArrow) { - return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1); - } - - parseSubscripts(base, startPos, startLoc, noCalls) { - if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startPos) !== -1) { - this.next(); - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - node.arguments = this.parseCallExpressionArguments(types.parenR, false); - base = this.finishNode(node, "CallExpression"); - } else if (base.type === "Identifier" && base.name === "async" && this.isRelational("<")) { - const state = this.state.clone(); - const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startPos, startLoc) || abort(), state); - if (!arrow.error && !arrow.aborted) return arrow.node; - const result = this.tryParse(() => super.parseSubscripts(base, startPos, startLoc, noCalls), state); - if (result.node && !result.error) return result.node; - - if (arrow.node) { - this.state = arrow.failState; - return arrow.node; - } - - if (result.node) { - this.state = result.failState; - return result.node; - } - - throw arrow.error || result.error; - } - - return super.parseSubscripts(base, startPos, startLoc, noCalls); - } - - parseSubscript(base, startPos, startLoc, noCalls, subscriptState) { - if (this.match(types.questionDot) && this.isLookaheadToken_lt()) { - subscriptState.optionalChainMember = true; - - if (noCalls) { - subscriptState.stop = true; - return base; - } - - this.next(); - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - node.typeArguments = this.flowParseTypeParameterInstantiation(); - this.expect(types.parenL); - node.arguments = this.parseCallExpressionArguments(types.parenR, false); - node.optional = true; - return this.finishCallExpression(node, true); - } else if (!noCalls && this.shouldParseTypes() && this.isRelational("<")) { - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - const result = this.tryParse(() => { - node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); - this.expect(types.parenL); - node.arguments = this.parseCallExpressionArguments(types.parenR, false); - if (subscriptState.optionalChainMember) node.optional = false; - return this.finishCallExpression(node, subscriptState.optionalChainMember); - }); - - if (result.node) { - if (result.error) this.state = result.failState; - return result.node; - } - } - - return super.parseSubscript(base, startPos, startLoc, noCalls, subscriptState); - } - - parseNewArguments(node) { - let targs = null; - - if (this.shouldParseTypes() && this.isRelational("<")) { - targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; - } - - node.typeArguments = targs; - super.parseNewArguments(node); - } - - parseAsyncArrowWithTypeParameters(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - this.parseFunctionParams(node); - if (!this.parseArrow(node)) return; - return this.parseArrowExpression(node, undefined, true); - } - - readToken_mult_modulo(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (code === 42 && next === 47 && this.state.hasFlowComment) { - this.state.hasFlowComment = false; - this.state.pos += 2; - this.nextToken(); - return; - } - - super.readToken_mult_modulo(code); - } - - readToken_pipe_amp(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (code === 124 && next === 125) { - this.finishOp(types.braceBarR, 2); - return; - } - - super.readToken_pipe_amp(code); - } - - parseTopLevel(file, program) { - const fileNode = super.parseTopLevel(file, program); - - if (this.state.hasFlowComment) { - this.raise(this.state.pos, FlowErrors.UnterminatedFlowComment); - } - - return fileNode; - } - - skipBlockComment() { - if (this.hasPlugin("flowComments") && this.skipFlowComment()) { - if (this.state.hasFlowComment) { - this.unexpected(null, FlowErrors.NestedFlowComment); - } - - this.hasFlowCommentCompletion(); - this.state.pos += this.skipFlowComment(); - this.state.hasFlowComment = true; - return; - } - - if (this.state.hasFlowComment) { - const end = this.input.indexOf("*-/", this.state.pos += 2); - - if (end === -1) { - throw this.raise(this.state.pos - 2, ErrorMessages.UnterminatedComment); - } - - this.state.pos = end + 3; - return; - } - - super.skipBlockComment(); - } - - skipFlowComment() { - const { - pos - } = this.state; - let shiftToFirstNonWhiteSpace = 2; - - while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { - shiftToFirstNonWhiteSpace++; - } - - const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); - const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); - - if (ch2 === 58 && ch3 === 58) { - return shiftToFirstNonWhiteSpace + 2; - } - - if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { - return shiftToFirstNonWhiteSpace + 12; - } - - if (ch2 === 58 && ch3 !== 58) { - return shiftToFirstNonWhiteSpace; - } - - return false; - } - - hasFlowCommentCompletion() { - const end = this.input.indexOf("*/", this.state.pos); - - if (end === -1) { - throw this.raise(this.state.pos, ErrorMessages.UnterminatedComment); - } - } - - flowEnumErrorBooleanMemberNotInitialized(pos, { - enumName, - memberName - }) { - this.raise(pos, FlowErrors.EnumBooleanMemberNotInitialized, memberName, enumName); - } - - flowEnumErrorInvalidMemberName(pos, { - enumName, - memberName - }) { - const suggestion = memberName[0].toUpperCase() + memberName.slice(1); - this.raise(pos, FlowErrors.EnumInvalidMemberName, memberName, suggestion, enumName); - } - - flowEnumErrorDuplicateMemberName(pos, { - enumName, - memberName - }) { - this.raise(pos, FlowErrors.EnumDuplicateMemberName, memberName, enumName); - } - - flowEnumErrorInconsistentMemberValues(pos, { - enumName - }) { - this.raise(pos, FlowErrors.EnumInconsistentMemberValues, enumName); - } - - flowEnumErrorInvalidExplicitType(pos, { - enumName, - suppliedType - }) { - return this.raise(pos, suppliedType === null ? FlowErrors.EnumInvalidExplicitTypeUnknownSupplied : FlowErrors.EnumInvalidExplicitType, enumName, suppliedType); - } - - flowEnumErrorInvalidMemberInitializer(pos, { - enumName, - explicitType, - memberName - }) { - let message = null; - - switch (explicitType) { - case "boolean": - case "number": - case "string": - message = FlowErrors.EnumInvalidMemberInitializerPrimaryType; - break; - - case "symbol": - message = FlowErrors.EnumInvalidMemberInitializerSymbolType; - break; - - default: - message = FlowErrors.EnumInvalidMemberInitializerUnknownType; - } - - return this.raise(pos, message, enumName, memberName, explicitType); - } - - flowEnumErrorNumberMemberNotInitialized(pos, { - enumName, - memberName - }) { - this.raise(pos, FlowErrors.EnumNumberMemberNotInitialized, enumName, memberName); - } - - flowEnumErrorStringMemberInconsistentlyInitailized(pos, { - enumName - }) { - this.raise(pos, FlowErrors.EnumStringMemberInconsistentlyInitailized, enumName); - } - - flowEnumMemberInit() { - const startPos = this.state.start; - - const endOfInit = () => this.match(types.comma) || this.match(types.braceR); - - switch (this.state.type) { - case types.num: - { - const literal = this.parseLiteral(this.state.value, "NumericLiteral"); - - if (endOfInit()) { - return { - type: "number", - pos: literal.start, - value: literal - }; - } - - return { - type: "invalid", - pos: startPos - }; - } - - case types.string: - { - const literal = this.parseLiteral(this.state.value, "StringLiteral"); - - if (endOfInit()) { - return { - type: "string", - pos: literal.start, - value: literal - }; - } - - return { - type: "invalid", - pos: startPos - }; - } - - case types._true: - case types._false: - { - const literal = this.parseBooleanLiteral(); - - if (endOfInit()) { - return { - type: "boolean", - pos: literal.start, - value: literal - }; - } - - return { - type: "invalid", - pos: startPos - }; - } - - default: - return { - type: "invalid", - pos: startPos - }; - } - } - - flowEnumMemberRaw() { - const pos = this.state.start; - const id = this.parseIdentifier(true); - const init = this.eat(types.eq) ? this.flowEnumMemberInit() : { - type: "none", - pos - }; - return { - id, - init - }; - } - - flowEnumCheckExplicitTypeMismatch(pos, context, expectedType) { - const { - explicitType - } = context; - - if (explicitType === null) { - return; - } - - if (explicitType !== expectedType) { - this.flowEnumErrorInvalidMemberInitializer(pos, context); - } - } - - flowEnumMembers({ - enumName, - explicitType - }) { - const seenNames = new Set(); - const members = { - booleanMembers: [], - numberMembers: [], - stringMembers: [], - defaultedMembers: [] - }; - let hasUnknownMembers = false; - - while (!this.match(types.braceR)) { - if (this.eat(types.ellipsis)) { - hasUnknownMembers = true; - break; - } - - const memberNode = this.startNode(); - const { - id, - init - } = this.flowEnumMemberRaw(); - const memberName = id.name; - - if (memberName === "") { - continue; - } - - if (/^[a-z]/.test(memberName)) { - this.flowEnumErrorInvalidMemberName(id.start, { - enumName, - memberName - }); - } - - if (seenNames.has(memberName)) { - this.flowEnumErrorDuplicateMemberName(id.start, { - enumName, - memberName - }); - } - - seenNames.add(memberName); - const context = { - enumName, - explicitType, - memberName - }; - memberNode.id = id; - - switch (init.type) { - case "boolean": - { - this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "boolean"); - memberNode.init = init.value; - members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); - break; - } - - case "number": - { - this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "number"); - memberNode.init = init.value; - members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); - break; - } - - case "string": - { - this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "string"); - memberNode.init = init.value; - members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); - break; - } - - case "invalid": - { - throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context); - } - - case "none": - { - switch (explicitType) { - case "boolean": - this.flowEnumErrorBooleanMemberNotInitialized(init.pos, context); - break; - - case "number": - this.flowEnumErrorNumberMemberNotInitialized(init.pos, context); - break; - - default: - members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); - } - } - } - - if (!this.match(types.braceR)) { - this.expect(types.comma); - } - } - - return { - members, - hasUnknownMembers - }; - } - - flowEnumStringMembers(initializedMembers, defaultedMembers, { - enumName - }) { - if (initializedMembers.length === 0) { - return defaultedMembers; - } else if (defaultedMembers.length === 0) { - return initializedMembers; - } else if (defaultedMembers.length > initializedMembers.length) { - for (let _i = 0; _i < initializedMembers.length; _i++) { - const member = initializedMembers[_i]; - this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, { - enumName - }); - } - - return defaultedMembers; - } else { - for (let _i2 = 0; _i2 < defaultedMembers.length; _i2++) { - const member = defaultedMembers[_i2]; - this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, { - enumName - }); - } - - return initializedMembers; - } - } - - flowEnumParseExplicitType({ - enumName - }) { - if (this.eatContextual("of")) { - if (!this.match(types.name)) { - throw this.flowEnumErrorInvalidExplicitType(this.state.start, { - enumName, - suppliedType: null - }); - } - - const { - value - } = this.state; - this.next(); - - if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { - this.flowEnumErrorInvalidExplicitType(this.state.start, { - enumName, - suppliedType: value - }); - } - - return value; - } - - return null; - } - - flowEnumBody(node, { - enumName, - nameLoc - }) { - const explicitType = this.flowEnumParseExplicitType({ - enumName - }); - this.expect(types.braceL); - const { - members, - hasUnknownMembers - } = this.flowEnumMembers({ - enumName, - explicitType - }); - node.hasUnknownMembers = hasUnknownMembers; - - switch (explicitType) { - case "boolean": - node.explicitType = true; - node.members = members.booleanMembers; - this.expect(types.braceR); - return this.finishNode(node, "EnumBooleanBody"); - - case "number": - node.explicitType = true; - node.members = members.numberMembers; - this.expect(types.braceR); - return this.finishNode(node, "EnumNumberBody"); - - case "string": - node.explicitType = true; - node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { - enumName - }); - this.expect(types.braceR); - return this.finishNode(node, "EnumStringBody"); - - case "symbol": - node.members = members.defaultedMembers; - this.expect(types.braceR); - return this.finishNode(node, "EnumSymbolBody"); - - default: - { - const empty = () => { - node.members = []; - this.expect(types.braceR); - return this.finishNode(node, "EnumStringBody"); - }; - - node.explicitType = false; - const boolsLen = members.booleanMembers.length; - const numsLen = members.numberMembers.length; - const strsLen = members.stringMembers.length; - const defaultedLen = members.defaultedMembers.length; - - if (!boolsLen && !numsLen && !strsLen && !defaultedLen) { - return empty(); - } else if (!boolsLen && !numsLen) { - node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { - enumName - }); - this.expect(types.braceR); - return this.finishNode(node, "EnumStringBody"); - } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) { - for (let _i3 = 0, _members$defaultedMem = members.defaultedMembers; _i3 < _members$defaultedMem.length; _i3++) { - const member = _members$defaultedMem[_i3]; - this.flowEnumErrorBooleanMemberNotInitialized(member.start, { - enumName, - memberName: member.id.name - }); - } - - node.members = members.booleanMembers; - this.expect(types.braceR); - return this.finishNode(node, "EnumBooleanBody"); - } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) { - for (let _i4 = 0, _members$defaultedMem2 = members.defaultedMembers; _i4 < _members$defaultedMem2.length; _i4++) { - const member = _members$defaultedMem2[_i4]; - this.flowEnumErrorNumberMemberNotInitialized(member.start, { - enumName, - memberName: member.id.name - }); - } - - node.members = members.numberMembers; - this.expect(types.braceR); - return this.finishNode(node, "EnumNumberBody"); - } else { - this.flowEnumErrorInconsistentMemberValues(nameLoc, { - enumName - }); - return empty(); - } - } - } - } - - flowParseEnumDeclaration(node) { - const id = this.parseIdentifier(); - node.id = id; - node.body = this.flowEnumBody(this.startNode(), { - enumName: id.name, - nameLoc: id.start - }); - return this.finishNode(node, "EnumDeclaration"); - } - - updateContext(prevType) { - if (this.match(types.name) && this.state.value === "of" && prevType === types.name && this.input.slice(this.state.lastTokStart, this.state.lastTokEnd) === "interface") { - this.state.exprAllowed = false; - } else { - super.updateContext(prevType); - } - } - - isLookaheadToken_lt() { - const next = this.nextTokenStart(); - - if (this.input.charCodeAt(next) === 60) { - const afterNext = this.input.charCodeAt(next + 1); - return afterNext !== 60 && afterNext !== 61; - } - - return false; - } - - maybeUnwrapTypeCastExpression(node) { - return node.type === "TypeCastExpression" ? node.expression : node; - } - - }, _temp; -}); - -const entities = { - quot: "\u0022", - amp: "&", - apos: "\u0027", - lt: "<", - gt: ">", - nbsp: "\u00A0", - iexcl: "\u00A1", - cent: "\u00A2", - pound: "\u00A3", - curren: "\u00A4", - yen: "\u00A5", - brvbar: "\u00A6", - sect: "\u00A7", - uml: "\u00A8", - copy: "\u00A9", - ordf: "\u00AA", - laquo: "\u00AB", - not: "\u00AC", - shy: "\u00AD", - reg: "\u00AE", - macr: "\u00AF", - deg: "\u00B0", - plusmn: "\u00B1", - sup2: "\u00B2", - sup3: "\u00B3", - acute: "\u00B4", - micro: "\u00B5", - para: "\u00B6", - middot: "\u00B7", - cedil: "\u00B8", - sup1: "\u00B9", - ordm: "\u00BA", - raquo: "\u00BB", - frac14: "\u00BC", - frac12: "\u00BD", - frac34: "\u00BE", - iquest: "\u00BF", - Agrave: "\u00C0", - Aacute: "\u00C1", - Acirc: "\u00C2", - Atilde: "\u00C3", - Auml: "\u00C4", - Aring: "\u00C5", - AElig: "\u00C6", - Ccedil: "\u00C7", - Egrave: "\u00C8", - Eacute: "\u00C9", - Ecirc: "\u00CA", - Euml: "\u00CB", - Igrave: "\u00CC", - Iacute: "\u00CD", - Icirc: "\u00CE", - Iuml: "\u00CF", - ETH: "\u00D0", - Ntilde: "\u00D1", - Ograve: "\u00D2", - Oacute: "\u00D3", - Ocirc: "\u00D4", - Otilde: "\u00D5", - Ouml: "\u00D6", - times: "\u00D7", - Oslash: "\u00D8", - Ugrave: "\u00D9", - Uacute: "\u00DA", - Ucirc: "\u00DB", - Uuml: "\u00DC", - Yacute: "\u00DD", - THORN: "\u00DE", - szlig: "\u00DF", - agrave: "\u00E0", - aacute: "\u00E1", - acirc: "\u00E2", - atilde: "\u00E3", - auml: "\u00E4", - aring: "\u00E5", - aelig: "\u00E6", - ccedil: "\u00E7", - egrave: "\u00E8", - eacute: "\u00E9", - ecirc: "\u00EA", - euml: "\u00EB", - igrave: "\u00EC", - iacute: "\u00ED", - icirc: "\u00EE", - iuml: "\u00EF", - eth: "\u00F0", - ntilde: "\u00F1", - ograve: "\u00F2", - oacute: "\u00F3", - ocirc: "\u00F4", - otilde: "\u00F5", - ouml: "\u00F6", - divide: "\u00F7", - oslash: "\u00F8", - ugrave: "\u00F9", - uacute: "\u00FA", - ucirc: "\u00FB", - uuml: "\u00FC", - yacute: "\u00FD", - thorn: "\u00FE", - yuml: "\u00FF", - OElig: "\u0152", - oelig: "\u0153", - Scaron: "\u0160", - scaron: "\u0161", - Yuml: "\u0178", - fnof: "\u0192", - circ: "\u02C6", - tilde: "\u02DC", - Alpha: "\u0391", - Beta: "\u0392", - Gamma: "\u0393", - Delta: "\u0394", - Epsilon: "\u0395", - Zeta: "\u0396", - Eta: "\u0397", - Theta: "\u0398", - Iota: "\u0399", - Kappa: "\u039A", - Lambda: "\u039B", - Mu: "\u039C", - Nu: "\u039D", - Xi: "\u039E", - Omicron: "\u039F", - Pi: "\u03A0", - Rho: "\u03A1", - Sigma: "\u03A3", - Tau: "\u03A4", - Upsilon: "\u03A5", - Phi: "\u03A6", - Chi: "\u03A7", - Psi: "\u03A8", - Omega: "\u03A9", - alpha: "\u03B1", - beta: "\u03B2", - gamma: "\u03B3", - delta: "\u03B4", - epsilon: "\u03B5", - zeta: "\u03B6", - eta: "\u03B7", - theta: "\u03B8", - iota: "\u03B9", - kappa: "\u03BA", - lambda: "\u03BB", - mu: "\u03BC", - nu: "\u03BD", - xi: "\u03BE", - omicron: "\u03BF", - pi: "\u03C0", - rho: "\u03C1", - sigmaf: "\u03C2", - sigma: "\u03C3", - tau: "\u03C4", - upsilon: "\u03C5", - phi: "\u03C6", - chi: "\u03C7", - psi: "\u03C8", - omega: "\u03C9", - thetasym: "\u03D1", - upsih: "\u03D2", - piv: "\u03D6", - ensp: "\u2002", - emsp: "\u2003", - thinsp: "\u2009", - zwnj: "\u200C", - zwj: "\u200D", - lrm: "\u200E", - rlm: "\u200F", - ndash: "\u2013", - mdash: "\u2014", - lsquo: "\u2018", - rsquo: "\u2019", - sbquo: "\u201A", - ldquo: "\u201C", - rdquo: "\u201D", - bdquo: "\u201E", - dagger: "\u2020", - Dagger: "\u2021", - bull: "\u2022", - hellip: "\u2026", - permil: "\u2030", - prime: "\u2032", - Prime: "\u2033", - lsaquo: "\u2039", - rsaquo: "\u203A", - oline: "\u203E", - frasl: "\u2044", - euro: "\u20AC", - image: "\u2111", - weierp: "\u2118", - real: "\u211C", - trade: "\u2122", - alefsym: "\u2135", - larr: "\u2190", - uarr: "\u2191", - rarr: "\u2192", - darr: "\u2193", - harr: "\u2194", - crarr: "\u21B5", - lArr: "\u21D0", - uArr: "\u21D1", - rArr: "\u21D2", - dArr: "\u21D3", - hArr: "\u21D4", - forall: "\u2200", - part: "\u2202", - exist: "\u2203", - empty: "\u2205", - nabla: "\u2207", - isin: "\u2208", - notin: "\u2209", - ni: "\u220B", - prod: "\u220F", - sum: "\u2211", - minus: "\u2212", - lowast: "\u2217", - radic: "\u221A", - prop: "\u221D", - infin: "\u221E", - ang: "\u2220", - and: "\u2227", - or: "\u2228", - cap: "\u2229", - cup: "\u222A", - int: "\u222B", - there4: "\u2234", - sim: "\u223C", - cong: "\u2245", - asymp: "\u2248", - ne: "\u2260", - equiv: "\u2261", - le: "\u2264", - ge: "\u2265", - sub: "\u2282", - sup: "\u2283", - nsub: "\u2284", - sube: "\u2286", - supe: "\u2287", - oplus: "\u2295", - otimes: "\u2297", - perp: "\u22A5", - sdot: "\u22C5", - lceil: "\u2308", - rceil: "\u2309", - lfloor: "\u230A", - rfloor: "\u230B", - lang: "\u2329", - rang: "\u232A", - loz: "\u25CA", - spades: "\u2660", - clubs: "\u2663", - hearts: "\u2665", - diams: "\u2666" -}; - -const HEX_NUMBER = /^[\da-fA-F]+$/; -const DECIMAL_NUMBER = /^\d+$/; -const JsxErrors = Object.freeze({ - AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression", - MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>", - MissingClosingTagElement: "Expected corresponding JSX closing tag for <%0>", - UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", - UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text", - UnterminatedJsxContent: "Unterminated JSX contents", - UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?" -}); -types$1.j_oTag = new TokContext("...", true, true); -types.jsxName = new TokenType("jsxName"); -types.jsxText = new TokenType("jsxText", { - beforeExpr: true -}); -types.jsxTagStart = new TokenType("jsxTagStart", { - startsExpr: true -}); -types.jsxTagEnd = new TokenType("jsxTagEnd"); - -types.jsxTagStart.updateContext = function () { - this.state.context.push(types$1.j_expr); - this.state.context.push(types$1.j_oTag); - this.state.exprAllowed = false; -}; - -types.jsxTagEnd.updateContext = function (prevType) { - const out = this.state.context.pop(); - - if (out === types$1.j_oTag && prevType === types.slash || out === types$1.j_cTag) { - this.state.context.pop(); - this.state.exprAllowed = this.curContext() === types$1.j_expr; - } else { - this.state.exprAllowed = true; - } -}; - -function isFragment(object) { - return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false; -} - -function getQualifiedJSXName(object) { - if (object.type === "JSXIdentifier") { - return object.name; - } - - if (object.type === "JSXNamespacedName") { - return object.namespace.name + ":" + object.name.name; - } - - if (object.type === "JSXMemberExpression") { - return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); - } - - throw new Error("Node had unexpected type: " + object.type); -} - -var jsx = (superClass => class extends superClass { - jsxReadToken() { - let out = ""; - let chunkStart = this.state.pos; - - for (;;) { - if (this.state.pos >= this.length) { - throw this.raise(this.state.start, JsxErrors.UnterminatedJsxContent); - } - - const ch = this.input.charCodeAt(this.state.pos); - - switch (ch) { - case 60: - case 123: - if (this.state.pos === this.state.start) { - if (ch === 60 && this.state.exprAllowed) { - ++this.state.pos; - return this.finishToken(types.jsxTagStart); - } - - return super.getTokenFromCode(ch); - } - - out += this.input.slice(chunkStart, this.state.pos); - return this.finishToken(types.jsxText, out); - - case 38: - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); - chunkStart = this.state.pos; - break; - - case 62: - case 125: - - default: - if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadNewLine(true); - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - - } - } - } - - jsxReadNewLine(normalizeCRLF) { - const ch = this.input.charCodeAt(this.state.pos); - let out; - ++this.state.pos; - - if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { - ++this.state.pos; - out = normalizeCRLF ? "\n" : "\r\n"; - } else { - out = String.fromCharCode(ch); - } - - ++this.state.curLine; - this.state.lineStart = this.state.pos; - return out; - } - - jsxReadString(quote) { - let out = ""; - let chunkStart = ++this.state.pos; - - for (;;) { - if (this.state.pos >= this.length) { - throw this.raise(this.state.start, ErrorMessages.UnterminatedString); - } - - const ch = this.input.charCodeAt(this.state.pos); - if (ch === quote) break; - - if (ch === 38) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); - chunkStart = this.state.pos; - } else if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadNewLine(false); - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - } - - out += this.input.slice(chunkStart, this.state.pos++); - return this.finishToken(types.string, out); - } - - jsxReadEntity() { - let str = ""; - let count = 0; - let entity; - let ch = this.input[this.state.pos]; - const startPos = ++this.state.pos; - - while (this.state.pos < this.length && count++ < 10) { - ch = this.input[this.state.pos++]; - - if (ch === ";") { - if (str[0] === "#") { - if (str[1] === "x") { - str = str.substr(2); - - if (HEX_NUMBER.test(str)) { - entity = String.fromCodePoint(parseInt(str, 16)); - } - } else { - str = str.substr(1); - - if (DECIMAL_NUMBER.test(str)) { - entity = String.fromCodePoint(parseInt(str, 10)); - } - } - } else { - entity = entities[str]; - } - - break; - } - - str += ch; - } - - if (!entity) { - this.state.pos = startPos; - return "&"; - } - - return entity; - } - - jsxReadWord() { - let ch; - const start = this.state.pos; - - do { - ch = this.input.charCodeAt(++this.state.pos); - } while (isIdentifierChar(ch) || ch === 45); - - return this.finishToken(types.jsxName, this.input.slice(start, this.state.pos)); - } - - jsxParseIdentifier() { - const node = this.startNode(); - - if (this.match(types.jsxName)) { - node.name = this.state.value; - } else if (this.state.type.keyword) { - node.name = this.state.type.keyword; - } else { - this.unexpected(); - } - - this.next(); - return this.finishNode(node, "JSXIdentifier"); - } - - jsxParseNamespacedName() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const name = this.jsxParseIdentifier(); - if (!this.eat(types.colon)) return name; - const node = this.startNodeAt(startPos, startLoc); - node.namespace = name; - node.name = this.jsxParseIdentifier(); - return this.finishNode(node, "JSXNamespacedName"); - } - - jsxParseElementName() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let node = this.jsxParseNamespacedName(); - - if (node.type === "JSXNamespacedName") { - return node; - } - - while (this.eat(types.dot)) { - const newNode = this.startNodeAt(startPos, startLoc); - newNode.object = node; - newNode.property = this.jsxParseIdentifier(); - node = this.finishNode(newNode, "JSXMemberExpression"); - } - - return node; - } - - jsxParseAttributeValue() { - let node; - - switch (this.state.type) { - case types.braceL: - node = this.startNode(); - this.next(); - node = this.jsxParseExpressionContainer(node); - - if (node.expression.type === "JSXEmptyExpression") { - this.raise(node.start, JsxErrors.AttributeIsEmpty); - } - - return node; - - case types.jsxTagStart: - case types.string: - return this.parseExprAtom(); - - default: - throw this.raise(this.state.start, JsxErrors.UnsupportedJsxValue); - } - } - - jsxParseEmptyExpression() { - const node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc); - return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc); - } - - jsxParseSpreadChild(node) { - this.next(); - node.expression = this.parseExpression(); - this.expect(types.braceR); - return this.finishNode(node, "JSXSpreadChild"); - } - - jsxParseExpressionContainer(node) { - if (this.match(types.braceR)) { - node.expression = this.jsxParseEmptyExpression(); - } else { - const expression = this.parseExpression(); - node.expression = expression; - } - - this.expect(types.braceR); - return this.finishNode(node, "JSXExpressionContainer"); - } - - jsxParseAttribute() { - const node = this.startNode(); - - if (this.eat(types.braceL)) { - this.expect(types.ellipsis); - node.argument = this.parseMaybeAssignAllowIn(); - this.expect(types.braceR); - return this.finishNode(node, "JSXSpreadAttribute"); - } - - node.name = this.jsxParseNamespacedName(); - node.value = this.eat(types.eq) ? this.jsxParseAttributeValue() : null; - return this.finishNode(node, "JSXAttribute"); - } - - jsxParseOpeningElementAt(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - - if (this.match(types.jsxTagEnd)) { - this.expect(types.jsxTagEnd); - return this.finishNode(node, "JSXOpeningFragment"); - } - - node.name = this.jsxParseElementName(); - return this.jsxParseOpeningElementAfterName(node); - } - - jsxParseOpeningElementAfterName(node) { - const attributes = []; - - while (!this.match(types.slash) && !this.match(types.jsxTagEnd)) { - attributes.push(this.jsxParseAttribute()); - } - - node.attributes = attributes; - node.selfClosing = this.eat(types.slash); - this.expect(types.jsxTagEnd); - return this.finishNode(node, "JSXOpeningElement"); - } - - jsxParseClosingElementAt(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - - if (this.match(types.jsxTagEnd)) { - this.expect(types.jsxTagEnd); - return this.finishNode(node, "JSXClosingFragment"); - } - - node.name = this.jsxParseElementName(); - this.expect(types.jsxTagEnd); - return this.finishNode(node, "JSXClosingElement"); - } - - jsxParseElementAt(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - const children = []; - const openingElement = this.jsxParseOpeningElementAt(startPos, startLoc); - let closingElement = null; - - if (!openingElement.selfClosing) { - contents: for (;;) { - switch (this.state.type) { - case types.jsxTagStart: - startPos = this.state.start; - startLoc = this.state.startLoc; - this.next(); - - if (this.eat(types.slash)) { - closingElement = this.jsxParseClosingElementAt(startPos, startLoc); - break contents; - } - - children.push(this.jsxParseElementAt(startPos, startLoc)); - break; - - case types.jsxText: - children.push(this.parseExprAtom()); - break; - - case types.braceL: - { - const node = this.startNode(); - this.next(); - - if (this.match(types.ellipsis)) { - children.push(this.jsxParseSpreadChild(node)); - } else { - children.push(this.jsxParseExpressionContainer(node)); - } - - break; - } - - default: - throw this.unexpected(); - } - } - - if (isFragment(openingElement) && !isFragment(closingElement)) { - this.raise(closingElement.start, JsxErrors.MissingClosingTagFragment); - } else if (!isFragment(openingElement) && isFragment(closingElement)) { - this.raise(closingElement.start, JsxErrors.MissingClosingTagElement, getQualifiedJSXName(openingElement.name)); - } else if (!isFragment(openingElement) && !isFragment(closingElement)) { - if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { - this.raise(closingElement.start, JsxErrors.MissingClosingTagElement, getQualifiedJSXName(openingElement.name)); - } - } - } - - if (isFragment(openingElement)) { - node.openingFragment = openingElement; - node.closingFragment = closingElement; - } else { - node.openingElement = openingElement; - node.closingElement = closingElement; - } - - node.children = children; - - if (this.isRelational("<")) { - throw this.raise(this.state.start, JsxErrors.UnwrappedAdjacentJSXElements); - } - - return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); - } - - jsxParseElement() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - this.next(); - return this.jsxParseElementAt(startPos, startLoc); - } - - parseExprAtom(refExpressionErrors) { - if (this.match(types.jsxText)) { - return this.parseLiteral(this.state.value, "JSXText"); - } else if (this.match(types.jsxTagStart)) { - return this.jsxParseElement(); - } else if (this.isRelational("<") && this.input.charCodeAt(this.state.pos) !== 33) { - this.finishToken(types.jsxTagStart); - return this.jsxParseElement(); - } else { - return super.parseExprAtom(refExpressionErrors); - } - } - - getTokenFromCode(code) { - if (this.state.inPropertyName) return super.getTokenFromCode(code); - const context = this.curContext(); - - if (context === types$1.j_expr) { - return this.jsxReadToken(); - } - - if (context === types$1.j_oTag || context === types$1.j_cTag) { - if (isIdentifierStart(code)) { - return this.jsxReadWord(); - } - - if (code === 62) { - ++this.state.pos; - return this.finishToken(types.jsxTagEnd); - } - - if ((code === 34 || code === 39) && context === types$1.j_oTag) { - return this.jsxReadString(code); - } - } - - if (code === 60 && this.state.exprAllowed && this.input.charCodeAt(this.state.pos + 1) !== 33) { - ++this.state.pos; - return this.finishToken(types.jsxTagStart); - } - - return super.getTokenFromCode(code); - } - - updateContext(prevType) { - if (this.match(types.braceL)) { - const curContext = this.curContext(); - - if (curContext === types$1.j_oTag) { - this.state.context.push(types$1.braceExpression); - } else if (curContext === types$1.j_expr) { - this.state.context.push(types$1.templateQuasi); - } else { - super.updateContext(prevType); - } - - this.state.exprAllowed = true; - } else if (this.match(types.slash) && prevType === types.jsxTagStart) { - this.state.context.length -= 2; - this.state.context.push(types$1.j_cTag); - this.state.exprAllowed = false; - } else { - return super.updateContext(prevType); - } - } - -}); - -class TypeScriptScope extends Scope { - constructor(...args) { - super(...args); - this.types = []; - this.enums = []; - this.constEnums = []; - this.classes = []; - this.exportOnlyBindings = []; - } - -} - -class TypeScriptScopeHandler extends ScopeHandler { - createScope(flags) { - return new TypeScriptScope(flags); - } - - declareName(name, bindingType, pos) { - const scope = this.currentScope(); - - if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) { - this.maybeExportDefined(scope, name); - scope.exportOnlyBindings.push(name); - return; - } - - super.declareName(...arguments); - - if (bindingType & BIND_KIND_TYPE) { - if (!(bindingType & BIND_KIND_VALUE)) { - this.checkRedeclarationInScope(scope, name, bindingType, pos); - this.maybeExportDefined(scope, name); - } - - scope.types.push(name); - } - - if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.push(name); - if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.push(name); - if (bindingType & BIND_FLAGS_CLASS) scope.classes.push(name); - } - - isRedeclaredInScope(scope, name, bindingType) { - if (scope.enums.indexOf(name) > -1) { - if (bindingType & BIND_FLAGS_TS_ENUM) { - const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM); - const wasConst = scope.constEnums.indexOf(name) > -1; - return isConst !== wasConst; - } - - return true; - } - - if (bindingType & BIND_FLAGS_CLASS && scope.classes.indexOf(name) > -1) { - if (scope.lexical.indexOf(name) > -1) { - return !!(bindingType & BIND_KIND_VALUE); - } else { - return false; - } - } - - if (bindingType & BIND_KIND_TYPE && scope.types.indexOf(name) > -1) { - return true; - } - - return super.isRedeclaredInScope(...arguments); - } - - checkLocalExport(id) { - if (this.scopeStack[0].types.indexOf(id.name) === -1 && this.scopeStack[0].exportOnlyBindings.indexOf(id.name) === -1) { - super.checkLocalExport(id); - } - } - -} - -const PARAM = 0b0000, - PARAM_YIELD = 0b0001, - PARAM_AWAIT = 0b0010, - PARAM_RETURN = 0b0100, - PARAM_IN = 0b1000; -class ProductionParameterHandler { - constructor() { - this.stacks = []; - } - - enter(flags) { - this.stacks.push(flags); - } - - exit() { - this.stacks.pop(); - } - - currentFlags() { - return this.stacks[this.stacks.length - 1]; - } - - get hasAwait() { - return (this.currentFlags() & PARAM_AWAIT) > 0; - } - - get hasYield() { - return (this.currentFlags() & PARAM_YIELD) > 0; - } - - get hasReturn() { - return (this.currentFlags() & PARAM_RETURN) > 0; - } - - get hasIn() { - return (this.currentFlags() & PARAM_IN) > 0; - } - -} -function functionFlags(isAsync, isGenerator) { - return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0); -} - -function nonNull(x) { - if (x == null) { - throw new Error(`Unexpected ${x} value.`); - } - - return x; -} - -function assert(x) { - if (!x) { - throw new Error("Assert fail"); - } -} - -const TSErrors = Object.freeze({ - ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier", - ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier", - ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", - DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.", - DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.", - DuplicateModifier: "Duplicate modifier: '%0'", - DuplicateAccessibilityModifier: "Accessibility modifier already seen.", - EmptyHeritageClauseType: "'%0' list cannot be empty.", - EmptyTypeArguments: "Type argument list cannot be empty.", - EmptyTypeParameters: "Type parameter list cannot be empty.", - ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.", - IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier", - IndexSignatureHasAccessibility: "Index signatures cannot have an accessibility modifier ('%0')", - IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier", - IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier", - InvalidModifierOnTypeMember: "'%0' modifier cannot appear on a type member.", - InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", - MixedLabeledAndUnlabeledElements: "Tuple members must all have names or all not have names.", - NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.", - NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.", - OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", - PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", - PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.", - PrivateElementHasAccessibility: "Private elements cannot have an accessibility modifier ('%0')", - ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.", - TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`", - UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", - UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", - UnexpectedTypeAnnotation: "Did not expect a type annotation here.", - UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", - UnsupportedImportTypeArgument: "Argument in a type import must be a string literal", - UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", - UnsupportedSignatureParameterKind: "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got %0" -}); - -function keywordTypeFromName(value) { - switch (value) { - case "any": - return "TSAnyKeyword"; - - case "boolean": - return "TSBooleanKeyword"; - - case "bigint": - return "TSBigIntKeyword"; - - case "never": - return "TSNeverKeyword"; - - case "number": - return "TSNumberKeyword"; - - case "object": - return "TSObjectKeyword"; - - case "string": - return "TSStringKeyword"; - - case "symbol": - return "TSSymbolKeyword"; - - case "undefined": - return "TSUndefinedKeyword"; - - case "unknown": - return "TSUnknownKeyword"; - - default: - return undefined; - } -} - -function tsIsAccessModifier(modifier) { - return modifier === "private" || modifier === "public" || modifier === "protected"; -} - -var typescript = (superClass => class extends superClass { - getScopeHandler() { - return TypeScriptScopeHandler; - } - - tsIsIdentifier() { - return this.match(types.name); - } - - tsNextTokenCanFollowModifier() { - this.next(); - return (this.match(types.bracketL) || this.match(types.braceL) || this.match(types.star) || this.match(types.ellipsis) || this.match(types.hash) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak(); - } - - tsParseModifier(allowedModifiers) { - if (!this.match(types.name)) { - return undefined; - } - - const modifier = this.state.value; - - if (allowedModifiers.indexOf(modifier) !== -1 && this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) { - return modifier; - } - - return undefined; - } - - tsParseModifiers(modified, allowedModifiers, disallowedModifiers, errorTemplate) { - for (;;) { - const startPos = this.state.start; - const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : [])); - if (!modifier) break; - - if (tsIsAccessModifier(modifier)) { - if (modified.accessibility) { - this.raise(startPos, TSErrors.DuplicateAccessibilityModifier); - } else { - modified.accessibility = modifier; - } - } else { - if (Object.hasOwnProperty.call(modified, modifier)) { - this.raise(startPos, TSErrors.DuplicateModifier, modifier); - } - - modified[modifier] = true; - } - - if (disallowedModifiers == null ? void 0 : disallowedModifiers.includes(modifier)) { - this.raise(startPos, errorTemplate, modifier); - } - } - } - - tsIsListTerminator(kind) { - switch (kind) { - case "EnumMembers": - case "TypeMembers": - return this.match(types.braceR); - - case "HeritageClauseElement": - return this.match(types.braceL); - - case "TupleElementTypes": - return this.match(types.bracketR); - - case "TypeParametersOrArguments": - return this.isRelational(">"); - } - - throw new Error("Unreachable"); - } - - tsParseList(kind, parseElement) { - const result = []; - - while (!this.tsIsListTerminator(kind)) { - result.push(parseElement()); - } - - return result; - } - - tsParseDelimitedList(kind, parseElement) { - return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true)); - } - - tsParseDelimitedListWorker(kind, parseElement, expectSuccess) { - const result = []; - - for (;;) { - if (this.tsIsListTerminator(kind)) { - break; - } - - const element = parseElement(); - - if (element == null) { - return undefined; - } - - result.push(element); - - if (this.eat(types.comma)) { - continue; - } - - if (this.tsIsListTerminator(kind)) { - break; - } - - if (expectSuccess) { - this.expect(types.comma); - } - - return undefined; - } - - return result; - } - - tsParseBracketedList(kind, parseElement, bracket, skipFirstToken) { - if (!skipFirstToken) { - if (bracket) { - this.expect(types.bracketL); - } else { - this.expectRelational("<"); - } - } - - const result = this.tsParseDelimitedList(kind, parseElement); - - if (bracket) { - this.expect(types.bracketR); - } else { - this.expectRelational(">"); - } - - return result; - } - - tsParseImportType() { - const node = this.startNode(); - this.expect(types._import); - this.expect(types.parenL); - - if (!this.match(types.string)) { - this.raise(this.state.start, TSErrors.UnsupportedImportTypeArgument); - } - - node.argument = this.parseExprAtom(); - this.expect(types.parenR); - - if (this.eat(types.dot)) { - node.qualifier = this.tsParseEntityName(true); - } - - if (this.isRelational("<")) { - node.typeParameters = this.tsParseTypeArguments(); - } - - return this.finishNode(node, "TSImportType"); - } - - tsParseEntityName(allowReservedWords) { - let entity = this.parseIdentifier(); - - while (this.eat(types.dot)) { - const node = this.startNodeAtNode(entity); - node.left = entity; - node.right = this.parseIdentifier(allowReservedWords); - entity = this.finishNode(node, "TSQualifiedName"); - } - - return entity; - } - - tsParseTypeReference() { - const node = this.startNode(); - node.typeName = this.tsParseEntityName(false); - - if (!this.hasPrecedingLineBreak() && this.isRelational("<")) { - node.typeParameters = this.tsParseTypeArguments(); - } - - return this.finishNode(node, "TSTypeReference"); - } - - tsParseThisTypePredicate(lhs) { - this.next(); - const node = this.startNodeAtNode(lhs); - node.parameterName = lhs; - node.typeAnnotation = this.tsParseTypeAnnotation(false); - node.asserts = false; - return this.finishNode(node, "TSTypePredicate"); - } - - tsParseThisTypeNode() { - const node = this.startNode(); - this.next(); - return this.finishNode(node, "TSThisType"); - } - - tsParseTypeQuery() { - const node = this.startNode(); - this.expect(types._typeof); - - if (this.match(types._import)) { - node.exprName = this.tsParseImportType(); - } else { - node.exprName = this.tsParseEntityName(true); - } - - return this.finishNode(node, "TSTypeQuery"); - } - - tsParseTypeParameter() { - const node = this.startNode(); - node.name = this.parseIdentifierName(node.start); - node.constraint = this.tsEatThenParseType(types._extends); - node.default = this.tsEatThenParseType(types.eq); - return this.finishNode(node, "TSTypeParameter"); - } - - tsTryParseTypeParameters() { - if (this.isRelational("<")) { - return this.tsParseTypeParameters(); - } - } - - tsParseTypeParameters() { - const node = this.startNode(); - - if (this.isRelational("<") || this.match(types.jsxTagStart)) { - this.next(); - } else { - this.unexpected(); - } - - node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this), false, true); - - if (node.params.length === 0) { - this.raise(node.start, TSErrors.EmptyTypeParameters); - } - - return this.finishNode(node, "TSTypeParameterDeclaration"); - } - - tsTryNextParseConstantContext() { - if (this.lookahead().type === types._const) { - this.next(); - return this.tsParseTypeReference(); - } - - return null; - } - - tsFillSignature(returnToken, signature) { - const returnTokenRequired = returnToken === types.arrow; - signature.typeParameters = this.tsTryParseTypeParameters(); - this.expect(types.parenL); - signature.parameters = this.tsParseBindingListForSignature(); - - if (returnTokenRequired) { - signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken); - } else if (this.match(returnToken)) { - signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken); - } - } - - tsParseBindingListForSignature() { - return this.parseBindingList(types.parenR, 41).map(pattern => { - if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") { - this.raise(pattern.start, TSErrors.UnsupportedSignatureParameterKind, pattern.type); - } - - return pattern; - }); - } - - tsParseTypeMemberSemicolon() { - if (!this.eat(types.comma)) { - this.semicolon(); - } - } - - tsParseSignatureMember(kind, node) { - this.tsFillSignature(types.colon, node); - this.tsParseTypeMemberSemicolon(); - return this.finishNode(node, kind); - } - - tsIsUnambiguouslyIndexSignature() { - this.next(); - return this.eat(types.name) && this.match(types.colon); - } - - tsTryParseIndexSignature(node) { - if (!(this.match(types.bracketL) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) { - return undefined; - } - - this.expect(types.bracketL); - const id = this.parseIdentifier(); - id.typeAnnotation = this.tsParseTypeAnnotation(); - this.resetEndLocation(id); - this.expect(types.bracketR); - node.parameters = [id]; - const type = this.tsTryParseTypeAnnotation(); - if (type) node.typeAnnotation = type; - this.tsParseTypeMemberSemicolon(); - return this.finishNode(node, "TSIndexSignature"); - } - - tsParsePropertyOrMethodSignature(node, readonly) { - if (this.eat(types.question)) node.optional = true; - const nodeAny = node; - - if (this.match(types.parenL) || this.isRelational("<")) { - if (readonly) { - this.raise(node.start, TSErrors.ReadonlyForMethodSignature); - } - - const method = nodeAny; - this.tsFillSignature(types.colon, method); - this.tsParseTypeMemberSemicolon(); - return this.finishNode(method, "TSMethodSignature"); - } else { - const property = nodeAny; - if (readonly) property.readonly = true; - const type = this.tsTryParseTypeAnnotation(); - if (type) property.typeAnnotation = type; - this.tsParseTypeMemberSemicolon(); - return this.finishNode(property, "TSPropertySignature"); - } - } - - tsParseTypeMember() { - const node = this.startNode(); - - if (this.match(types.parenL) || this.isRelational("<")) { - return this.tsParseSignatureMember("TSCallSignatureDeclaration", node); - } - - if (this.match(types._new)) { - const id = this.startNode(); - this.next(); - - if (this.match(types.parenL) || this.isRelational("<")) { - return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node); - } else { - node.key = this.createIdentifier(id, "new"); - return this.tsParsePropertyOrMethodSignature(node, false); - } - } - - this.tsParseModifiers(node, ["readonly"], ["declare", "abstract", "private", "protected", "public", "static"], TSErrors.InvalidModifierOnTypeMember); - const idx = this.tsTryParseIndexSignature(node); - - if (idx) { - return idx; - } - - this.parsePropertyName(node, false); - return this.tsParsePropertyOrMethodSignature(node, !!node.readonly); - } - - tsParseTypeLiteral() { - const node = this.startNode(); - node.members = this.tsParseObjectTypeMembers(); - return this.finishNode(node, "TSTypeLiteral"); - } - - tsParseObjectTypeMembers() { - this.expect(types.braceL); - const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); - this.expect(types.braceR); - return members; - } - - tsIsStartOfMappedType() { - this.next(); - - if (this.eat(types.plusMin)) { - return this.isContextual("readonly"); - } - - if (this.isContextual("readonly")) { - this.next(); - } - - if (!this.match(types.bracketL)) { - return false; - } - - this.next(); - - if (!this.tsIsIdentifier()) { - return false; - } - - this.next(); - return this.match(types._in); - } - - tsParseMappedTypeParameter() { - const node = this.startNode(); - node.name = this.parseIdentifierName(node.start); - node.constraint = this.tsExpectThenParseType(types._in); - return this.finishNode(node, "TSTypeParameter"); - } - - tsParseMappedType() { - const node = this.startNode(); - this.expect(types.braceL); - - if (this.match(types.plusMin)) { - node.readonly = this.state.value; - this.next(); - this.expectContextual("readonly"); - } else if (this.eatContextual("readonly")) { - node.readonly = true; - } - - this.expect(types.bracketL); - node.typeParameter = this.tsParseMappedTypeParameter(); - node.nameType = this.eatContextual("as") ? this.tsParseType() : null; - this.expect(types.bracketR); - - if (this.match(types.plusMin)) { - node.optional = this.state.value; - this.next(); - this.expect(types.question); - } else if (this.eat(types.question)) { - node.optional = true; - } - - node.typeAnnotation = this.tsTryParseType(); - this.semicolon(); - this.expect(types.braceR); - return this.finishNode(node, "TSMappedType"); - } - - tsParseTupleType() { - const node = this.startNode(); - node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false); - let seenOptionalElement = false; - let labeledElements = null; - node.elementTypes.forEach(elementNode => { - var _labeledElements; - - let { - type - } = elementNode; - - if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) { - this.raise(elementNode.start, TSErrors.OptionalTypeBeforeRequired); - } - - seenOptionalElement = seenOptionalElement || type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType"; - - if (type === "TSRestType") { - elementNode = elementNode.typeAnnotation; - type = elementNode.type; - } - - const isLabeled = type === "TSNamedTupleMember"; - labeledElements = (_labeledElements = labeledElements) != null ? _labeledElements : isLabeled; - - if (labeledElements !== isLabeled) { - this.raise(elementNode.start, TSErrors.MixedLabeledAndUnlabeledElements); - } - }); - return this.finishNode(node, "TSTupleType"); - } - - tsParseTupleElementType() { - const { - start: startPos, - startLoc - } = this.state; - const rest = this.eat(types.ellipsis); - let type = this.tsParseType(); - const optional = this.eat(types.question); - const labeled = this.eat(types.colon); - - if (labeled) { - const labeledNode = this.startNodeAtNode(type); - labeledNode.optional = optional; - - if (type.type === "TSTypeReference" && !type.typeParameters && type.typeName.type === "Identifier") { - labeledNode.label = type.typeName; - } else { - this.raise(type.start, TSErrors.InvalidTupleMemberLabel); - labeledNode.label = type; - } - - labeledNode.elementType = this.tsParseType(); - type = this.finishNode(labeledNode, "TSNamedTupleMember"); - } else if (optional) { - const optionalTypeNode = this.startNodeAtNode(type); - optionalTypeNode.typeAnnotation = type; - type = this.finishNode(optionalTypeNode, "TSOptionalType"); - } - - if (rest) { - const restNode = this.startNodeAt(startPos, startLoc); - restNode.typeAnnotation = type; - type = this.finishNode(restNode, "TSRestType"); - } - - return type; - } - - tsParseParenthesizedType() { - const node = this.startNode(); - this.expect(types.parenL); - node.typeAnnotation = this.tsParseType(); - this.expect(types.parenR); - return this.finishNode(node, "TSParenthesizedType"); - } - - tsParseFunctionOrConstructorType(type, abstract) { - const node = this.startNode(); - - if (type === "TSConstructorType") { - node.abstract = !!abstract; - if (abstract) this.next(); - this.next(); - } - - this.tsFillSignature(types.arrow, node); - return this.finishNode(node, type); - } - - tsParseLiteralTypeNode() { - const node = this.startNode(); - - node.literal = (() => { - switch (this.state.type) { - case types.num: - case types.bigint: - case types.string: - case types._true: - case types._false: - return this.parseExprAtom(); - - default: - throw this.unexpected(); - } - })(); - - return this.finishNode(node, "TSLiteralType"); - } - - tsParseTemplateLiteralType() { - const node = this.startNode(); - node.literal = this.parseTemplate(false); - return this.finishNode(node, "TSLiteralType"); - } - - parseTemplateSubstitution() { - if (this.state.inType) return this.tsParseType(); - return super.parseTemplateSubstitution(); - } - - tsParseThisTypeOrThisTypePredicate() { - const thisKeyword = this.tsParseThisTypeNode(); - - if (this.isContextual("is") && !this.hasPrecedingLineBreak()) { - return this.tsParseThisTypePredicate(thisKeyword); - } else { - return thisKeyword; - } - } - - tsParseNonArrayType() { - switch (this.state.type) { - case types.name: - case types._void: - case types._null: - { - const type = this.match(types._void) ? "TSVoidKeyword" : this.match(types._null) ? "TSNullKeyword" : keywordTypeFromName(this.state.value); - - if (type !== undefined && this.lookaheadCharCode() !== 46) { - const node = this.startNode(); - this.next(); - return this.finishNode(node, type); - } - - return this.tsParseTypeReference(); - } - - case types.string: - case types.num: - case types.bigint: - case types._true: - case types._false: - return this.tsParseLiteralTypeNode(); - - case types.plusMin: - if (this.state.value === "-") { - const node = this.startNode(); - const nextToken = this.lookahead(); - - if (nextToken.type !== types.num && nextToken.type !== types.bigint) { - throw this.unexpected(); - } - - node.literal = this.parseMaybeUnary(); - return this.finishNode(node, "TSLiteralType"); - } - - break; - - case types._this: - return this.tsParseThisTypeOrThisTypePredicate(); - - case types._typeof: - return this.tsParseTypeQuery(); - - case types._import: - return this.tsParseImportType(); - - case types.braceL: - return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral(); - - case types.bracketL: - return this.tsParseTupleType(); - - case types.parenL: - return this.tsParseParenthesizedType(); - - case types.backQuote: - return this.tsParseTemplateLiteralType(); - } - - throw this.unexpected(); - } - - tsParseArrayTypeOrHigher() { - let type = this.tsParseNonArrayType(); - - while (!this.hasPrecedingLineBreak() && this.eat(types.bracketL)) { - if (this.match(types.bracketR)) { - const node = this.startNodeAtNode(type); - node.elementType = type; - this.expect(types.bracketR); - type = this.finishNode(node, "TSArrayType"); - } else { - const node = this.startNodeAtNode(type); - node.objectType = type; - node.indexType = this.tsParseType(); - this.expect(types.bracketR); - type = this.finishNode(node, "TSIndexedAccessType"); - } - } - - return type; - } - - tsParseTypeOperator(operator) { - const node = this.startNode(); - this.expectContextual(operator); - node.operator = operator; - node.typeAnnotation = this.tsParseTypeOperatorOrHigher(); - - if (operator === "readonly") { - this.tsCheckTypeAnnotationForReadOnly(node); - } - - return this.finishNode(node, "TSTypeOperator"); - } - - tsCheckTypeAnnotationForReadOnly(node) { - switch (node.typeAnnotation.type) { - case "TSTupleType": - case "TSArrayType": - return; - - default: - this.raise(node.start, TSErrors.UnexpectedReadonly); - } - } - - tsParseInferType() { - const node = this.startNode(); - this.expectContextual("infer"); - const typeParameter = this.startNode(); - typeParameter.name = this.parseIdentifierName(typeParameter.start); - node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); - return this.finishNode(node, "TSInferType"); - } - - tsParseTypeOperatorOrHigher() { - const operator = ["keyof", "unique", "readonly"].find(kw => this.isContextual(kw)); - return operator ? this.tsParseTypeOperator(operator) : this.isContextual("infer") ? this.tsParseInferType() : this.tsParseArrayTypeOrHigher(); - } - - tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) { - const node = this.startNode(); - const hasLeadingOperator = this.eat(operator); - const types = []; - - do { - types.push(parseConstituentType()); - } while (this.eat(operator)); - - if (types.length === 1 && !hasLeadingOperator) { - return types[0]; - } - - node.types = types; - return this.finishNode(node, kind); - } - - tsParseIntersectionTypeOrHigher() { - return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), types.bitwiseAND); - } - - tsParseUnionTypeOrHigher() { - return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), types.bitwiseOR); - } - - tsIsStartOfFunctionType() { - if (this.isRelational("<")) { - return true; - } - - return this.match(types.parenL) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this)); - } - - tsSkipParameterStart() { - if (this.match(types.name) || this.match(types._this)) { - this.next(); - return true; - } - - if (this.match(types.braceL)) { - let braceStackCounter = 1; - this.next(); - - while (braceStackCounter > 0) { - if (this.match(types.braceL)) { - ++braceStackCounter; - } else if (this.match(types.braceR)) { - --braceStackCounter; - } - - this.next(); - } - - return true; - } - - if (this.match(types.bracketL)) { - let braceStackCounter = 1; - this.next(); - - while (braceStackCounter > 0) { - if (this.match(types.bracketL)) { - ++braceStackCounter; - } else if (this.match(types.bracketR)) { - --braceStackCounter; - } - - this.next(); - } - - return true; - } - - return false; - } - - tsIsUnambiguouslyStartOfFunctionType() { - this.next(); - - if (this.match(types.parenR) || this.match(types.ellipsis)) { - return true; - } - - if (this.tsSkipParameterStart()) { - if (this.match(types.colon) || this.match(types.comma) || this.match(types.question) || this.match(types.eq)) { - return true; - } - - if (this.match(types.parenR)) { - this.next(); - - if (this.match(types.arrow)) { - return true; - } - } - } - - return false; - } - - tsParseTypeOrTypePredicateAnnotation(returnToken) { - return this.tsInType(() => { - const t = this.startNode(); - this.expect(returnToken); - const node = this.startNode(); - const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); - - if (asserts && this.match(types._this)) { - let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); - - if (thisTypePredicate.type === "TSThisType") { - node.parameterName = thisTypePredicate; - node.asserts = true; - thisTypePredicate = this.finishNode(node, "TSTypePredicate"); - } else { - this.resetStartLocationFromNode(thisTypePredicate, node); - thisTypePredicate.asserts = true; - } - - t.typeAnnotation = thisTypePredicate; - return this.finishNode(t, "TSTypeAnnotation"); - } - - const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); - - if (!typePredicateVariable) { - if (!asserts) { - return this.tsParseTypeAnnotation(false, t); - } - - node.parameterName = this.parseIdentifier(); - node.asserts = asserts; - t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); - return this.finishNode(t, "TSTypeAnnotation"); - } - - const type = this.tsParseTypeAnnotation(false); - node.parameterName = typePredicateVariable; - node.typeAnnotation = type; - node.asserts = asserts; - t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); - return this.finishNode(t, "TSTypeAnnotation"); - }); - } - - tsTryParseTypeOrTypePredicateAnnotation() { - return this.match(types.colon) ? this.tsParseTypeOrTypePredicateAnnotation(types.colon) : undefined; - } - - tsTryParseTypeAnnotation() { - return this.match(types.colon) ? this.tsParseTypeAnnotation() : undefined; - } - - tsTryParseType() { - return this.tsEatThenParseType(types.colon); - } - - tsParseTypePredicatePrefix() { - const id = this.parseIdentifier(); - - if (this.isContextual("is") && !this.hasPrecedingLineBreak()) { - this.next(); - return id; - } - } - - tsParseTypePredicateAsserts() { - if (!this.match(types.name) || this.state.value !== "asserts" || this.hasPrecedingLineBreak()) { - return false; - } - - const containsEsc = this.state.containsEsc; - this.next(); - - if (!this.match(types.name) && !this.match(types._this)) { - return false; - } - - if (containsEsc) { - this.raise(this.state.lastTokStart, ErrorMessages.InvalidEscapedReservedWord, "asserts"); - } - - return true; - } - - tsParseTypeAnnotation(eatColon = true, t = this.startNode()) { - this.tsInType(() => { - if (eatColon) this.expect(types.colon); - t.typeAnnotation = this.tsParseType(); - }); - return this.finishNode(t, "TSTypeAnnotation"); - } - - tsParseType() { - assert(this.state.inType); - const type = this.tsParseNonConditionalType(); - - if (this.hasPrecedingLineBreak() || !this.eat(types._extends)) { - return type; - } - - const node = this.startNodeAtNode(type); - node.checkType = type; - node.extendsType = this.tsParseNonConditionalType(); - this.expect(types.question); - node.trueType = this.tsParseType(); - this.expect(types.colon); - node.falseType = this.tsParseType(); - return this.finishNode(node, "TSConditionalType"); - } - - isAbstractConstructorSignature() { - return this.isContextual("abstract") && this.lookahead().type === types._new; - } - - tsParseNonConditionalType() { - if (this.tsIsStartOfFunctionType()) { - return this.tsParseFunctionOrConstructorType("TSFunctionType"); - } - - if (this.match(types._new)) { - return this.tsParseFunctionOrConstructorType("TSConstructorType"); - } else if (this.isAbstractConstructorSignature()) { - return this.tsParseFunctionOrConstructorType("TSConstructorType", true); - } - - return this.tsParseUnionTypeOrHigher(); - } - - tsParseTypeAssertion() { - const node = this.startNode(); - - const _const = this.tsTryNextParseConstantContext(); - - node.typeAnnotation = _const || this.tsNextThenParseType(); - this.expectRelational(">"); - node.expression = this.parseMaybeUnary(); - return this.finishNode(node, "TSTypeAssertion"); - } - - tsParseHeritageClause(descriptor) { - const originalStart = this.state.start; - const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", this.tsParseExpressionWithTypeArguments.bind(this)); - - if (!delimitedList.length) { - this.raise(originalStart, TSErrors.EmptyHeritageClauseType, descriptor); - } - - return delimitedList; - } - - tsParseExpressionWithTypeArguments() { - const node = this.startNode(); - node.expression = this.tsParseEntityName(false); - - if (this.isRelational("<")) { - node.typeParameters = this.tsParseTypeArguments(); - } - - return this.finishNode(node, "TSExpressionWithTypeArguments"); - } - - tsParseInterfaceDeclaration(node) { - node.id = this.parseIdentifier(); - this.checkLVal(node.id, "typescript interface declaration", BIND_TS_INTERFACE); - node.typeParameters = this.tsTryParseTypeParameters(); - - if (this.eat(types._extends)) { - node.extends = this.tsParseHeritageClause("extends"); - } - - const body = this.startNode(); - body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)); - node.body = this.finishNode(body, "TSInterfaceBody"); - return this.finishNode(node, "TSInterfaceDeclaration"); - } - - tsParseTypeAliasDeclaration(node) { - node.id = this.parseIdentifier(); - this.checkLVal(node.id, "typescript type alias", BIND_TS_TYPE); - node.typeParameters = this.tsTryParseTypeParameters(); - node.typeAnnotation = this.tsInType(() => { - this.expect(types.eq); - - if (this.isContextual("intrinsic") && this.lookahead().type !== types.dot) { - const node = this.startNode(); - this.next(); - return this.finishNode(node, "TSIntrinsicKeyword"); - } - - return this.tsParseType(); - }); - this.semicolon(); - return this.finishNode(node, "TSTypeAliasDeclaration"); - } - - tsInNoContext(cb) { - const oldContext = this.state.context; - this.state.context = [oldContext[0]]; - - try { - return cb(); - } finally { - this.state.context = oldContext; - } - } - - tsInType(cb) { - const oldInType = this.state.inType; - this.state.inType = true; - - try { - return cb(); - } finally { - this.state.inType = oldInType; - } - } - - tsEatThenParseType(token) { - return !this.match(token) ? undefined : this.tsNextThenParseType(); - } - - tsExpectThenParseType(token) { - return this.tsDoThenParseType(() => this.expect(token)); - } - - tsNextThenParseType() { - return this.tsDoThenParseType(() => this.next()); - } - - tsDoThenParseType(cb) { - return this.tsInType(() => { - cb(); - return this.tsParseType(); - }); - } - - tsParseEnumMember() { - const node = this.startNode(); - node.id = this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true); - - if (this.eat(types.eq)) { - node.initializer = this.parseMaybeAssignAllowIn(); - } - - return this.finishNode(node, "TSEnumMember"); - } - - tsParseEnumDeclaration(node, isConst) { - if (isConst) node.const = true; - node.id = this.parseIdentifier(); - this.checkLVal(node.id, "typescript enum declaration", isConst ? BIND_TS_CONST_ENUM : BIND_TS_ENUM); - this.expect(types.braceL); - node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); - this.expect(types.braceR); - return this.finishNode(node, "TSEnumDeclaration"); - } - - tsParseModuleBlock() { - const node = this.startNode(); - this.scope.enter(SCOPE_OTHER); - this.expect(types.braceL); - this.parseBlockOrModuleBlockBody(node.body = [], undefined, true, types.braceR); - this.scope.exit(); - return this.finishNode(node, "TSModuleBlock"); - } - - tsParseModuleOrNamespaceDeclaration(node, nested = false) { - node.id = this.parseIdentifier(); - - if (!nested) { - this.checkLVal(node.id, "module or namespace declaration", BIND_TS_NAMESPACE); - } - - if (this.eat(types.dot)) { - const inner = this.startNode(); - this.tsParseModuleOrNamespaceDeclaration(inner, true); - node.body = inner; - } else { - this.scope.enter(SCOPE_TS_MODULE); - this.prodParam.enter(PARAM); - node.body = this.tsParseModuleBlock(); - this.prodParam.exit(); - this.scope.exit(); - } - - return this.finishNode(node, "TSModuleDeclaration"); - } - - tsParseAmbientExternalModuleDeclaration(node) { - if (this.isContextual("global")) { - node.global = true; - node.id = this.parseIdentifier(); - } else if (this.match(types.string)) { - node.id = this.parseExprAtom(); - } else { - this.unexpected(); - } - - if (this.match(types.braceL)) { - this.scope.enter(SCOPE_TS_MODULE); - this.prodParam.enter(PARAM); - node.body = this.tsParseModuleBlock(); - this.prodParam.exit(); - this.scope.exit(); - } else { - this.semicolon(); - } - - return this.finishNode(node, "TSModuleDeclaration"); - } - - tsParseImportEqualsDeclaration(node, isExport) { - node.isExport = isExport || false; - node.id = this.parseIdentifier(); - this.checkLVal(node.id, "import equals declaration", BIND_LEXICAL); - this.expect(types.eq); - node.moduleReference = this.tsParseModuleReference(); - this.semicolon(); - return this.finishNode(node, "TSImportEqualsDeclaration"); - } - - tsIsExternalModuleReference() { - return this.isContextual("require") && this.lookaheadCharCode() === 40; - } - - tsParseModuleReference() { - return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false); - } - - tsParseExternalModuleReference() { - const node = this.startNode(); - this.expectContextual("require"); - this.expect(types.parenL); - - if (!this.match(types.string)) { - throw this.unexpected(); - } - - node.expression = this.parseExprAtom(); - this.expect(types.parenR); - return this.finishNode(node, "TSExternalModuleReference"); - } - - tsLookAhead(f) { - const state = this.state.clone(); - const res = f(); - this.state = state; - return res; - } - - tsTryParseAndCatch(f) { - const result = this.tryParse(abort => f() || abort()); - if (result.aborted || !result.node) return undefined; - if (result.error) this.state = result.failState; - return result.node; - } - - tsTryParse(f) { - const state = this.state.clone(); - const result = f(); - - if (result !== undefined && result !== false) { - return result; - } else { - this.state = state; - return undefined; - } - } - - tsTryParseDeclare(nany) { - if (this.isLineTerminator()) { - return; - } - - let starttype = this.state.type; - let kind; - - if (this.isContextual("let")) { - starttype = types._var; - kind = "let"; - } - - return this.tsInDeclareContext(() => { - switch (starttype) { - case types._function: - nany.declare = true; - return this.parseFunctionStatement(nany, false, true); - - case types._class: - nany.declare = true; - return this.parseClass(nany, true, false); - - case types._const: - if (this.match(types._const) && this.isLookaheadContextual("enum")) { - this.expect(types._const); - this.expectContextual("enum"); - return this.tsParseEnumDeclaration(nany, true); - } - - case types._var: - kind = kind || this.state.value; - return this.parseVarStatement(nany, kind); - - case types.name: - { - const value = this.state.value; - - if (value === "global") { - return this.tsParseAmbientExternalModuleDeclaration(nany); - } else { - return this.tsParseDeclaration(nany, value, true); - } - } - } - }); - } - - tsTryParseExportDeclaration() { - return this.tsParseDeclaration(this.startNode(), this.state.value, true); - } - - tsParseExpressionStatement(node, expr) { - switch (expr.name) { - case "declare": - { - const declaration = this.tsTryParseDeclare(node); - - if (declaration) { - declaration.declare = true; - return declaration; - } - - break; - } - - case "global": - if (this.match(types.braceL)) { - this.scope.enter(SCOPE_TS_MODULE); - this.prodParam.enter(PARAM); - const mod = node; - mod.global = true; - mod.id = expr; - mod.body = this.tsParseModuleBlock(); - this.scope.exit(); - this.prodParam.exit(); - return this.finishNode(mod, "TSModuleDeclaration"); - } - - break; - - default: - return this.tsParseDeclaration(node, expr.name, false); - } - } - - tsParseDeclaration(node, value, next) { - switch (value) { - case "abstract": - if (this.tsCheckLineTerminator(next) && (this.match(types._class) || this.match(types.name))) { - return this.tsParseAbstractDeclaration(node); - } - - break; - - case "enum": - if (next || this.match(types.name)) { - if (next) this.next(); - return this.tsParseEnumDeclaration(node, false); - } - - break; - - case "interface": - if (this.tsCheckLineTerminator(next) && this.match(types.name)) { - return this.tsParseInterfaceDeclaration(node); - } - - break; - - case "module": - if (this.tsCheckLineTerminator(next)) { - if (this.match(types.string)) { - return this.tsParseAmbientExternalModuleDeclaration(node); - } else if (this.match(types.name)) { - return this.tsParseModuleOrNamespaceDeclaration(node); - } - } - - break; - - case "namespace": - if (this.tsCheckLineTerminator(next) && this.match(types.name)) { - return this.tsParseModuleOrNamespaceDeclaration(node); - } - - break; - - case "type": - if (this.tsCheckLineTerminator(next) && this.match(types.name)) { - return this.tsParseTypeAliasDeclaration(node); - } - - break; - } - } - - tsCheckLineTerminator(next) { - if (next) { - if (this.hasFollowingLineBreak()) return false; - this.next(); - return true; - } - - return !this.isLineTerminator(); - } - - tsTryParseGenericAsyncArrowFunction(startPos, startLoc) { - if (!this.isRelational("<")) { - return undefined; - } - - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - this.state.maybeInArrowParameters = true; - const res = this.tsTryParseAndCatch(() => { - const node = this.startNodeAt(startPos, startLoc); - node.typeParameters = this.tsParseTypeParameters(); - super.parseFunctionParams(node); - node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation(); - this.expect(types.arrow); - return node; - }); - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - - if (!res) { - return undefined; - } - - return this.parseArrowExpression(res, null, true); - } - - tsParseTypeArguments() { - const node = this.startNode(); - node.params = this.tsInType(() => this.tsInNoContext(() => { - this.expectRelational("<"); - return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this)); - })); - - if (node.params.length === 0) { - this.raise(node.start, TSErrors.EmptyTypeArguments); - } - - this.state.exprAllowed = false; - this.expectRelational(">"); - return this.finishNode(node, "TSTypeParameterInstantiation"); - } - - tsIsDeclarationStart() { - if (this.match(types.name)) { - switch (this.state.value) { - case "abstract": - case "declare": - case "enum": - case "interface": - case "module": - case "namespace": - case "type": - return true; - } - } - - return false; - } - - isExportDefaultSpecifier() { - if (this.tsIsDeclarationStart()) return false; - return super.isExportDefaultSpecifier(); - } - - parseAssignableListItem(allowModifiers, decorators) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let accessibility; - let readonly = false; - - if (allowModifiers !== undefined) { - accessibility = this.parseAccessModifier(); - readonly = !!this.tsParseModifier(["readonly"]); - - if (allowModifiers === false && (accessibility || readonly)) { - this.raise(startPos, TSErrors.UnexpectedParameterModifier); - } - } - - const left = this.parseMaybeDefault(); - this.parseAssignableListItemTypes(left); - const elt = this.parseMaybeDefault(left.start, left.loc.start, left); - - if (accessibility || readonly) { - const pp = this.startNodeAt(startPos, startLoc); - - if (decorators.length) { - pp.decorators = decorators; - } - - if (accessibility) pp.accessibility = accessibility; - if (readonly) pp.readonly = readonly; - - if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { - this.raise(pp.start, TSErrors.UnsupportedParameterPropertyKind); - } - - pp.parameter = elt; - return this.finishNode(pp, "TSParameterProperty"); - } - - if (decorators.length) { - left.decorators = decorators; - } - - return elt; - } - - parseFunctionBodyAndFinish(node, type, isMethod = false) { - if (this.match(types.colon)) { - node.returnType = this.tsParseTypeOrTypePredicateAnnotation(types.colon); - } - - const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" ? "TSDeclareMethod" : undefined; - - if (bodilessType && !this.match(types.braceL) && this.isLineTerminator()) { - this.finishNode(node, bodilessType); - return; - } - - if (bodilessType === "TSDeclareFunction" && this.state.isDeclareContext) { - this.raise(node.start, TSErrors.DeclareFunctionHasImplementation); - - if (node.declare) { - super.parseFunctionBodyAndFinish(node, bodilessType, isMethod); - return; - } - } - - super.parseFunctionBodyAndFinish(node, type, isMethod); - } - - registerFunctionStatementId(node) { - if (!node.body && node.id) { - this.checkLVal(node.id, "function name", BIND_TS_AMBIENT); - } else { - super.registerFunctionStatementId(...arguments); - } - } - - tsCheckForInvalidTypeCasts(items) { - items.forEach(node => { - if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") { - this.raise(node.typeAnnotation.start, TSErrors.UnexpectedTypeAnnotation); - } - }); - } - - toReferencedList(exprList, isInParens) { - this.tsCheckForInvalidTypeCasts(exprList); - return exprList; - } - - parseArrayLike(...args) { - const node = super.parseArrayLike(...args); - - if (node.type === "ArrayExpression") { - this.tsCheckForInvalidTypeCasts(node.elements); - } - - return node; - } - - parseSubscript(base, startPos, startLoc, noCalls, state) { - if (!this.hasPrecedingLineBreak() && this.match(types.bang)) { - this.state.exprAllowed = false; - this.next(); - const nonNullExpression = this.startNodeAt(startPos, startLoc); - nonNullExpression.expression = base; - return this.finishNode(nonNullExpression, "TSNonNullExpression"); - } - - if (this.isRelational("<")) { - const result = this.tsTryParseAndCatch(() => { - if (!noCalls && this.atPossibleAsyncArrow(base)) { - const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startPos, startLoc); - - if (asyncArrowFn) { - return asyncArrowFn; - } - } - - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - const typeArguments = this.tsParseTypeArguments(); - - if (typeArguments) { - if (!noCalls && this.eat(types.parenL)) { - node.arguments = this.parseCallExpressionArguments(types.parenR, false); - this.tsCheckForInvalidTypeCasts(node.arguments); - node.typeParameters = typeArguments; - - if (state.optionalChainMember) { - node.optional = false; - } - - return this.finishCallExpression(node, state.optionalChainMember); - } else if (this.match(types.backQuote)) { - const result = this.parseTaggedTemplateExpression(base, startPos, startLoc, state); - result.typeParameters = typeArguments; - return result; - } - } - - this.unexpected(); - }); - if (result) return result; - } - - return super.parseSubscript(base, startPos, startLoc, noCalls, state); - } - - parseNewArguments(node) { - if (this.isRelational("<")) { - const typeParameters = this.tsTryParseAndCatch(() => { - const args = this.tsParseTypeArguments(); - if (!this.match(types.parenL)) this.unexpected(); - return args; - }); - - if (typeParameters) { - node.typeParameters = typeParameters; - } - } - - super.parseNewArguments(node); - } - - parseExprOp(left, leftStartPos, leftStartLoc, minPrec) { - if (nonNull(types._in.binop) > minPrec && !this.hasPrecedingLineBreak() && this.isContextual("as")) { - const node = this.startNodeAt(leftStartPos, leftStartLoc); - node.expression = left; - - const _const = this.tsTryNextParseConstantContext(); - - if (_const) { - node.typeAnnotation = _const; - } else { - node.typeAnnotation = this.tsNextThenParseType(); - } - - this.finishNode(node, "TSAsExpression"); - this.reScan_lt_gt(); - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec); - } - - return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec); - } - - checkReservedWord(word, startLoc, checkKeywords, isBinding) {} - - checkDuplicateExports() {} - - parseImport(node) { - if (this.match(types.name) || this.match(types.star) || this.match(types.braceL)) { - const ahead = this.lookahead(); - - if (this.match(types.name) && ahead.type === types.eq) { - return this.tsParseImportEqualsDeclaration(node); - } - - if (this.isContextual("type") && ahead.type !== types.comma && !(ahead.type === types.name && ahead.value === "from")) { - node.importKind = "type"; - this.next(); - } - } - - if (!node.importKind) { - node.importKind = "value"; - } - - const importNode = super.parseImport(node); - - if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") { - this.raise(importNode.start, "A type-only import can specify a default import or named bindings, but not both."); - } - - return importNode; - } - - parseExport(node) { - if (this.match(types._import)) { - this.expect(types._import); - return this.tsParseImportEqualsDeclaration(node, true); - } else if (this.eat(types.eq)) { - const assign = node; - assign.expression = this.parseExpression(); - this.semicolon(); - return this.finishNode(assign, "TSExportAssignment"); - } else if (this.eatContextual("as")) { - const decl = node; - this.expectContextual("namespace"); - decl.id = this.parseIdentifier(); - this.semicolon(); - return this.finishNode(decl, "TSNamespaceExportDeclaration"); - } else { - if (this.isContextual("type") && this.lookahead().type === types.braceL) { - this.next(); - node.exportKind = "type"; - } else { - node.exportKind = "value"; - } - - return super.parseExport(node); - } - } - - isAbstractClass() { - return this.isContextual("abstract") && this.lookahead().type === types._class; - } - - parseExportDefaultExpression() { - if (this.isAbstractClass()) { - const cls = this.startNode(); - this.next(); - cls.abstract = true; - this.parseClass(cls, true, true); - return cls; - } - - if (this.state.value === "interface") { - const result = this.tsParseDeclaration(this.startNode(), this.state.value, true); - if (result) return result; - } - - return super.parseExportDefaultExpression(); - } - - parseStatementContent(context, topLevel) { - if (this.state.type === types._const) { - const ahead = this.lookahead(); - - if (ahead.type === types.name && ahead.value === "enum") { - const node = this.startNode(); - this.expect(types._const); - this.expectContextual("enum"); - return this.tsParseEnumDeclaration(node, true); - } - } - - return super.parseStatementContent(context, topLevel); - } - - parseAccessModifier() { - return this.tsParseModifier(["public", "protected", "private"]); - } - - parseClassMember(classBody, member, state) { - this.tsParseModifiers(member, ["declare", "private", "public", "protected"]); - - const callParseClassMember = () => { - super.parseClassMember(classBody, member, state); - }; - - if (member.declare) { - this.tsInDeclareContext(callParseClassMember); - } else { - callParseClassMember(); - } - } - - parseClassMemberWithIsStatic(classBody, member, state, isStatic) { - this.tsParseModifiers(member, ["abstract", "readonly", "declare"]); - const idx = this.tsTryParseIndexSignature(member); - - if (idx) { - classBody.body.push(idx); - - if (member.abstract) { - this.raise(member.start, TSErrors.IndexSignatureHasAbstract); - } - - if (isStatic) { - this.raise(member.start, TSErrors.IndexSignatureHasStatic); - } - - if (member.accessibility) { - this.raise(member.start, TSErrors.IndexSignatureHasAccessibility, member.accessibility); - } - - if (member.declare) { - this.raise(member.start, TSErrors.IndexSignatureHasDeclare); - } - - return; - } - - if (!this.state.inAbstractClass && member.abstract) { - this.raise(member.start, TSErrors.NonAbstractClassHasAbstractMethod); - } - - super.parseClassMemberWithIsStatic(classBody, member, state, isStatic); - } - - parsePostMemberNameModifiers(methodOrProp) { - const optional = this.eat(types.question); - if (optional) methodOrProp.optional = true; - - if (methodOrProp.readonly && this.match(types.parenL)) { - this.raise(methodOrProp.start, TSErrors.ClassMethodHasReadonly); - } - - if (methodOrProp.declare && this.match(types.parenL)) { - this.raise(methodOrProp.start, TSErrors.ClassMethodHasDeclare); - } - } - - parseExpressionStatement(node, expr) { - const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr) : undefined; - return decl || super.parseExpressionStatement(node, expr); - } - - shouldParseExportDeclaration() { - if (this.tsIsDeclarationStart()) return true; - return super.shouldParseExportDeclaration(); - } - - parseConditional(expr, startPos, startLoc, refNeedsArrowPos) { - if (!refNeedsArrowPos || !this.match(types.question)) { - return super.parseConditional(expr, startPos, startLoc, refNeedsArrowPos); - } - - const result = this.tryParse(() => super.parseConditional(expr, startPos, startLoc)); - - if (!result.node) { - refNeedsArrowPos.start = result.error.pos || this.state.start; - return expr; - } - - if (result.error) this.state = result.failState; - return result.node; - } - - parseParenItem(node, startPos, startLoc) { - node = super.parseParenItem(node, startPos, startLoc); - - if (this.eat(types.question)) { - node.optional = true; - this.resetEndLocation(node); - } - - if (this.match(types.colon)) { - const typeCastNode = this.startNodeAt(startPos, startLoc); - typeCastNode.expression = node; - typeCastNode.typeAnnotation = this.tsParseTypeAnnotation(); - return this.finishNode(typeCastNode, "TSTypeCastExpression"); - } - - return node; - } - - parseExportDeclaration(node) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const isDeclare = this.eatContextual("declare"); - - if (isDeclare && (this.isContextual("declare") || !this.shouldParseExportDeclaration())) { - throw this.raise(this.state.start, TSErrors.ExpectedAmbientAfterExportDeclare); - } - - let declaration; - - if (this.match(types.name)) { - declaration = this.tsTryParseExportDeclaration(); - } - - if (!declaration) { - declaration = super.parseExportDeclaration(node); - } - - if (declaration && (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare)) { - node.exportKind = "type"; - } - - if (declaration && isDeclare) { - this.resetStartLocation(declaration, startPos, startLoc); - declaration.declare = true; - } - - return declaration; - } - - parseClassId(node, isStatement, optionalId) { - if ((!isStatement || optionalId) && this.isContextual("implements")) { - return; - } - - super.parseClassId(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS); - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) node.typeParameters = typeParameters; - } - - parseClassPropertyAnnotation(node) { - if (!node.optional && this.eat(types.bang)) { - node.definite = true; - } - - const type = this.tsTryParseTypeAnnotation(); - if (type) node.typeAnnotation = type; - } - - parseClassProperty(node) { - this.parseClassPropertyAnnotation(node); - - if (this.state.isDeclareContext && this.match(types.eq)) { - this.raise(this.state.start, TSErrors.DeclareClassFieldHasInitializer); - } - - return super.parseClassProperty(node); - } - - parseClassPrivateProperty(node) { - if (node.abstract) { - this.raise(node.start, TSErrors.PrivateElementHasAbstract); - } - - if (node.accessibility) { - this.raise(node.start, TSErrors.PrivateElementHasAccessibility, node.accessibility); - } - - this.parseClassPropertyAnnotation(node); - return super.parseClassPrivateProperty(node); - } - - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - const typeParameters = this.tsTryParseTypeParameters(); - - if (typeParameters && isConstructor) { - this.raise(typeParameters.start, TSErrors.ConstructorHasTypeParameters); - } - - if (typeParameters) method.typeParameters = typeParameters; - super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); - } - - pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) method.typeParameters = typeParameters; - super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); - } - - parseClassSuper(node) { - super.parseClassSuper(node); - - if (node.superClass && this.isRelational("<")) { - node.superTypeParameters = this.tsParseTypeArguments(); - } - - if (this.eatContextual("implements")) { - node.implements = this.tsParseHeritageClause("implements"); - } - } - - parseObjPropValue(prop, ...args) { - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) prop.typeParameters = typeParameters; - super.parseObjPropValue(prop, ...args); - } - - parseFunctionParams(node, allowModifiers) { - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) node.typeParameters = typeParameters; - super.parseFunctionParams(node, allowModifiers); - } - - parseVarId(decl, kind) { - super.parseVarId(decl, kind); - - if (decl.id.type === "Identifier" && this.eat(types.bang)) { - decl.definite = true; - } - - const type = this.tsTryParseTypeAnnotation(); - - if (type) { - decl.id.typeAnnotation = type; - this.resetEndLocation(decl.id); - } - } - - parseAsyncArrowFromCallExpression(node, call) { - if (this.match(types.colon)) { - node.returnType = this.tsParseTypeAnnotation(); - } - - return super.parseAsyncArrowFromCallExpression(node, call); - } - - parseMaybeAssign(...args) { - var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2, _jsx4, _typeCast3; - - let state; - let jsx; - let typeCast; - - if (this.hasPlugin("jsx") && (this.match(types.jsxTagStart) || this.isRelational("<"))) { - state = this.state.clone(); - jsx = this.tryParse(() => super.parseMaybeAssign(...args), state); - if (!jsx.error) return jsx.node; - const { - context - } = this.state; - - if (context[context.length - 1] === types$1.j_oTag) { - context.length -= 2; - } else if (context[context.length - 1] === types$1.j_expr) { - context.length -= 1; - } - } - - if (!((_jsx = jsx) == null ? void 0 : _jsx.error) && !this.isRelational("<")) { - return super.parseMaybeAssign(...args); - } - - let typeParameters; - state = state || this.state.clone(); - const arrow = this.tryParse(abort => { - var _typeParameters; - - typeParameters = this.tsParseTypeParameters(); - const expr = super.parseMaybeAssign(...args); - - if (expr.type !== "ArrowFunctionExpression" || expr.extra && expr.extra.parenthesized) { - abort(); - } - - if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) { - this.resetStartLocationFromNode(expr, typeParameters); - } - - expr.typeParameters = typeParameters; - return expr; - }, state); - if (!arrow.error && !arrow.aborted) return arrow.node; - - if (!jsx) { - assert(!this.hasPlugin("jsx")); - typeCast = this.tryParse(() => super.parseMaybeAssign(...args), state); - if (!typeCast.error) return typeCast.node; - } - - if ((_jsx2 = jsx) == null ? void 0 : _jsx2.node) { - this.state = jsx.failState; - return jsx.node; - } - - if (arrow.node) { - this.state = arrow.failState; - return arrow.node; - } - - if ((_typeCast = typeCast) == null ? void 0 : _typeCast.node) { - this.state = typeCast.failState; - return typeCast.node; - } - - if ((_jsx3 = jsx) == null ? void 0 : _jsx3.thrown) throw jsx.error; - if (arrow.thrown) throw arrow.error; - if ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.thrown) throw typeCast.error; - throw ((_jsx4 = jsx) == null ? void 0 : _jsx4.error) || arrow.error || ((_typeCast3 = typeCast) == null ? void 0 : _typeCast3.error); - } - - parseMaybeUnary(refExpressionErrors) { - if (!this.hasPlugin("jsx") && this.isRelational("<")) { - return this.tsParseTypeAssertion(); - } else { - return super.parseMaybeUnary(refExpressionErrors); - } - } - - parseArrow(node) { - if (this.match(types.colon)) { - const result = this.tryParse(abort => { - const returnType = this.tsParseTypeOrTypePredicateAnnotation(types.colon); - if (this.canInsertSemicolon() || !this.match(types.arrow)) abort(); - return returnType; - }); - if (result.aborted) return; - - if (!result.thrown) { - if (result.error) this.state = result.failState; - node.returnType = result.node; - } - } - - return super.parseArrow(node); - } - - parseAssignableListItemTypes(param) { - if (this.eat(types.question)) { - if (param.type !== "Identifier" && !this.state.isDeclareContext && !this.state.inType) { - this.raise(param.start, TSErrors.PatternIsOptional); - } - - param.optional = true; - } - - const type = this.tsTryParseTypeAnnotation(); - if (type) param.typeAnnotation = type; - this.resetEndLocation(param); - return param; - } - - toAssignable(node, isLHS = false) { - switch (node.type) { - case "TSTypeCastExpression": - return super.toAssignable(this.typeCastToParameter(node), isLHS); - - case "TSParameterProperty": - return super.toAssignable(node, isLHS); - - case "TSAsExpression": - case "TSNonNullExpression": - case "TSTypeAssertion": - node.expression = this.toAssignable(node.expression, isLHS); - return node; - - default: - return super.toAssignable(node, isLHS); - } - } - - checkLVal(expr, contextDescription, ...args) { - switch (expr.type) { - case "TSTypeCastExpression": - return; - - case "TSParameterProperty": - this.checkLVal(expr.parameter, "parameter property", ...args); - return; - - case "TSAsExpression": - case "TSNonNullExpression": - case "TSTypeAssertion": - this.checkLVal(expr.expression, contextDescription, ...args); - return; - - default: - super.checkLVal(expr, contextDescription, ...args); - return; - } - } - - parseBindingAtom() { - switch (this.state.type) { - case types._this: - return this.parseIdentifier(true); - - default: - return super.parseBindingAtom(); - } - } - - parseMaybeDecoratorArguments(expr) { - if (this.isRelational("<")) { - const typeArguments = this.tsParseTypeArguments(); - - if (this.match(types.parenL)) { - const call = super.parseMaybeDecoratorArguments(expr); - call.typeParameters = typeArguments; - return call; - } - - this.unexpected(this.state.start, types.parenL); - } - - return super.parseMaybeDecoratorArguments(expr); - } - - isClassMethod() { - return this.isRelational("<") || super.isClassMethod(); - } - - isClassProperty() { - return this.match(types.bang) || this.match(types.colon) || super.isClassProperty(); - } - - parseMaybeDefault(...args) { - const node = super.parseMaybeDefault(...args); - - if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(node.typeAnnotation.start, TSErrors.TypeAnnotationAfterAssign); - } - - return node; - } - - getTokenFromCode(code) { - if (this.state.inType && (code === 62 || code === 60)) { - return this.finishOp(types.relational, 1); - } else { - return super.getTokenFromCode(code); - } - } - - reScan_lt_gt() { - if (this.match(types.relational)) { - const code = this.input.charCodeAt(this.state.start); - - if (code === 60 || code === 62) { - this.state.pos -= 1; - this.readToken_lt_gt(code); - } - } - } - - toAssignableList(exprList) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - if (!expr) continue; - - switch (expr.type) { - case "TSTypeCastExpression": - exprList[i] = this.typeCastToParameter(expr); - break; - - case "TSAsExpression": - case "TSTypeAssertion": - if (!this.state.maybeInArrowParameters) { - exprList[i] = this.typeCastToParameter(expr); - } else { - this.raise(expr.start, TSErrors.UnexpectedTypeCastInParameter); - } - - break; - } - } - - return super.toAssignableList(...arguments); - } - - typeCastToParameter(node) { - node.expression.typeAnnotation = node.typeAnnotation; - this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end); - return node.expression; - } - - shouldParseArrow() { - return this.match(types.colon) || super.shouldParseArrow(); - } - - shouldParseAsyncArrow() { - return this.match(types.colon) || super.shouldParseAsyncArrow(); - } - - canHaveLeadingDecorator() { - return super.canHaveLeadingDecorator() || this.isAbstractClass(); - } - - jsxParseOpeningElementAfterName(node) { - if (this.isRelational("<")) { - const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArguments()); - if (typeArguments) node.typeParameters = typeArguments; - } - - return super.jsxParseOpeningElementAfterName(node); - } - - getGetterSetterExpectedParamCount(method) { - const baseCount = super.getGetterSetterExpectedParamCount(method); - const params = this.getObjectOrClassMethodParams(method); - const firstParam = params[0]; - const hasContextParam = firstParam && firstParam.type === "Identifier" && firstParam.name === "this"; - return hasContextParam ? baseCount + 1 : baseCount; - } - - parseCatchClauseParam() { - const param = super.parseCatchClauseParam(); - const type = this.tsTryParseTypeAnnotation(); - - if (type) { - param.typeAnnotation = type; - this.resetEndLocation(param); - } - - return param; - } - - tsInDeclareContext(cb) { - const oldIsDeclareContext = this.state.isDeclareContext; - this.state.isDeclareContext = true; - - try { - return cb(); - } finally { - this.state.isDeclareContext = oldIsDeclareContext; - } - } - - parseClass(node, ...args) { - const oldInAbstractClass = this.state.inAbstractClass; - this.state.inAbstractClass = !!node.abstract; - - try { - return super.parseClass(node, ...args); - } finally { - this.state.inAbstractClass = oldInAbstractClass; - } - } - - tsParseAbstractDeclaration(node) { - if (this.match(types._class)) { - node.abstract = true; - return this.parseClass(node, true, false); - } else if (this.isContextual("interface")) { - if (!this.hasFollowingLineBreak()) { - node.abstract = true; - this.raise(node.start, TSErrors.NonClassMethodPropertyHasAbstractModifer); - this.next(); - return this.tsParseInterfaceDeclaration(node); - } - } else { - this.unexpected(null, types._class); - } - } - -}); - -types.placeholder = new TokenType("%%", { - startsExpr: true -}); -var placeholders = (superClass => class extends superClass { - parsePlaceholder(expectedNode) { - if (this.match(types.placeholder)) { - const node = this.startNode(); - this.next(); - this.assertNoSpace("Unexpected space in placeholder."); - node.name = super.parseIdentifier(true); - this.assertNoSpace("Unexpected space in placeholder."); - this.expect(types.placeholder); - return this.finishPlaceholder(node, expectedNode); - } - } - - finishPlaceholder(node, expectedNode) { - const isFinished = !!(node.expectedNode && node.type === "Placeholder"); - node.expectedNode = expectedNode; - return isFinished ? node : this.finishNode(node, "Placeholder"); - } - - getTokenFromCode(code) { - if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) { - return this.finishOp(types.placeholder, 2); - } - - return super.getTokenFromCode(...arguments); - } - - parseExprAtom() { - return this.parsePlaceholder("Expression") || super.parseExprAtom(...arguments); - } - - parseIdentifier() { - return this.parsePlaceholder("Identifier") || super.parseIdentifier(...arguments); - } - - checkReservedWord(word) { - if (word !== undefined) super.checkReservedWord(...arguments); - } - - parseBindingAtom() { - return this.parsePlaceholder("Pattern") || super.parseBindingAtom(...arguments); - } - - checkLVal(expr) { - if (expr.type !== "Placeholder") super.checkLVal(...arguments); - } - - toAssignable(node) { - if (node && node.type === "Placeholder" && node.expectedNode === "Expression") { - node.expectedNode = "Pattern"; - return node; - } - - return super.toAssignable(...arguments); - } - - isLet(context) { - if (super.isLet(context)) { - return true; - } - - if (!this.isContextual("let")) { - return false; - } - - if (context) return false; - const nextToken = this.lookahead(); - - if (nextToken.type === types.placeholder) { - return true; - } - - return false; - } - - verifyBreakContinue(node) { - if (node.label && node.label.type === "Placeholder") return; - super.verifyBreakContinue(...arguments); - } - - parseExpressionStatement(node, expr) { - if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) { - return super.parseExpressionStatement(...arguments); - } - - if (this.match(types.colon)) { - const stmt = node; - stmt.label = this.finishPlaceholder(expr, "Identifier"); - this.next(); - stmt.body = this.parseStatement("label"); - return this.finishNode(stmt, "LabeledStatement"); - } - - this.semicolon(); - node.name = expr.name; - return this.finishPlaceholder(node, "Statement"); - } - - parseBlock() { - return this.parsePlaceholder("BlockStatement") || super.parseBlock(...arguments); - } - - parseFunctionId() { - return this.parsePlaceholder("Identifier") || super.parseFunctionId(...arguments); - } - - parseClass(node, isStatement, optionalId) { - const type = isStatement ? "ClassDeclaration" : "ClassExpression"; - this.next(); - this.takeDecorators(node); - const oldStrict = this.state.strict; - const placeholder = this.parsePlaceholder("Identifier"); - - if (placeholder) { - if (this.match(types._extends) || this.match(types.placeholder) || this.match(types.braceL)) { - node.id = placeholder; - } else if (optionalId || !isStatement) { - node.id = null; - node.body = this.finishPlaceholder(placeholder, "ClassBody"); - return this.finishNode(node, type); - } else { - this.unexpected(null, "A class name is required"); - } - } else { - this.parseClassId(node, isStatement, optionalId); - } - - this.parseClassSuper(node); - node.body = this.parsePlaceholder("ClassBody") || this.parseClassBody(!!node.superClass, oldStrict); - return this.finishNode(node, type); - } - - parseExport(node) { - const placeholder = this.parsePlaceholder("Identifier"); - if (!placeholder) return super.parseExport(...arguments); - - if (!this.isContextual("from") && !this.match(types.comma)) { - node.specifiers = []; - node.source = null; - node.declaration = this.finishPlaceholder(placeholder, "Declaration"); - return this.finishNode(node, "ExportNamedDeclaration"); - } - - this.expectPlugin("exportDefaultFrom"); - const specifier = this.startNode(); - specifier.exported = placeholder; - node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; - return super.parseExport(node); - } - - isExportDefaultSpecifier() { - if (this.match(types._default)) { - const next = this.nextTokenStart(); - - if (this.isUnparsedContextual(next, "from")) { - if (this.input.startsWith(types.placeholder.label, this.nextTokenStartSince(next + 4))) { - return true; - } - } - } - - return super.isExportDefaultSpecifier(); - } - - maybeParseExportDefaultSpecifier(node) { - if (node.specifiers && node.specifiers.length > 0) { - return true; - } - - return super.maybeParseExportDefaultSpecifier(...arguments); - } - - checkExport(node) { - const { - specifiers - } = node; - - if (specifiers == null ? void 0 : specifiers.length) { - node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder"); - } - - super.checkExport(node); - node.specifiers = specifiers; - } - - parseImport(node) { - const placeholder = this.parsePlaceholder("Identifier"); - if (!placeholder) return super.parseImport(...arguments); - node.specifiers = []; - - if (!this.isContextual("from") && !this.match(types.comma)) { - node.source = this.finishPlaceholder(placeholder, "StringLiteral"); - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); - } - - const specifier = this.startNodeAtNode(placeholder); - specifier.local = placeholder; - this.finishNode(specifier, "ImportDefaultSpecifier"); - node.specifiers.push(specifier); - - if (this.eat(types.comma)) { - const hasStarImport = this.maybeParseStarImportSpecifier(node); - if (!hasStarImport) this.parseNamedImportSpecifiers(node); - } - - this.expectContextual("from"); - node.source = this.parseImportSource(); - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); - } - - parseImportSource() { - return this.parsePlaceholder("StringLiteral") || super.parseImportSource(...arguments); - } - -}); - -var v8intrinsic = (superClass => class extends superClass { - parseV8Intrinsic() { - if (this.match(types.modulo)) { - const v8IntrinsicStart = this.state.start; - const node = this.startNode(); - this.eat(types.modulo); - - if (this.match(types.name)) { - const name = this.parseIdentifierName(this.state.start); - const identifier = this.createIdentifier(node, name); - identifier.type = "V8IntrinsicIdentifier"; - - if (this.match(types.parenL)) { - return identifier; - } - } - - this.unexpected(v8IntrinsicStart); - } - } - - parseExprAtom() { - return this.parseV8Intrinsic() || super.parseExprAtom(...arguments); - } - -}); - -function hasPlugin(plugins, name) { - return plugins.some(plugin => { - if (Array.isArray(plugin)) { - return plugin[0] === name; - } else { - return plugin === name; - } - }); -} -function getPluginOption(plugins, name, option) { - const plugin = plugins.find(plugin => { - if (Array.isArray(plugin)) { - return plugin[0] === name; - } else { - return plugin === name; - } - }); - - if (plugin && Array.isArray(plugin)) { - return plugin[1][option]; - } - - return null; -} -const PIPELINE_PROPOSALS = ["minimal", "smart", "fsharp"]; -const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"]; -function validatePlugins(plugins) { - if (hasPlugin(plugins, "decorators")) { - if (hasPlugin(plugins, "decorators-legacy")) { - throw new Error("Cannot use the decorators and decorators-legacy plugin together"); - } - - const decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport"); - - if (decoratorsBeforeExport == null) { - throw new Error("The 'decorators' plugin requires a 'decoratorsBeforeExport' option," + " whose value must be a boolean. If you are migrating from" + " Babylon/Babel 6 or want to use the old decorators proposal, you" + " should use the 'decorators-legacy' plugin instead of 'decorators'."); - } else if (typeof decoratorsBeforeExport !== "boolean") { - throw new Error("'decoratorsBeforeExport' must be a boolean."); - } - } - - if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) { - throw new Error("Cannot combine flow and typescript plugins."); - } - - if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) { - throw new Error("Cannot combine placeholders and v8intrinsic plugins."); - } - - if (hasPlugin(plugins, "pipelineOperator") && !PIPELINE_PROPOSALS.includes(getPluginOption(plugins, "pipelineOperator", "proposal"))) { - throw new Error("'pipelineOperator' requires 'proposal' option whose value should be one of: " + PIPELINE_PROPOSALS.map(p => `'${p}'`).join(", ")); - } - - if (hasPlugin(plugins, "moduleAttributes")) { - if (hasPlugin(plugins, "importAssertions")) { - throw new Error("Cannot combine importAssertions and moduleAttributes plugins."); - } - - const moduleAttributesVerionPluginOption = getPluginOption(plugins, "moduleAttributes", "version"); - - if (moduleAttributesVerionPluginOption !== "may-2020") { - throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'."); - } - } - - if (hasPlugin(plugins, "recordAndTuple") && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, "recordAndTuple", "syntaxType"))) { - throw new Error("'recordAndTuple' requires 'syntaxType' option whose value should be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", ")); - } -} -const mixinPlugins = { - estree, - jsx, - flow, - typescript, - v8intrinsic, - placeholders -}; -const mixinPluginNames = Object.keys(mixinPlugins); - -const defaultOptions = { - sourceType: "script", - sourceFilename: undefined, - startLine: 1, - allowAwaitOutsideFunction: false, - allowReturnOutsideFunction: false, - allowImportExportEverywhere: false, - allowSuperOutsideMethod: false, - allowUndeclaredExports: false, - plugins: [], - strictMode: null, - ranges: false, - tokens: false, - createParenthesizedExpressions: false, - errorRecovery: false -}; -function getOptions(opts) { - const options = {}; - - for (let _i = 0, _Object$keys = Object.keys(defaultOptions); _i < _Object$keys.length; _i++) { - const key = _Object$keys[_i]; - options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key]; - } - - return options; -} - -class State { - constructor() { - this.strict = void 0; - this.curLine = void 0; - this.startLoc = void 0; - this.endLoc = void 0; - this.errors = []; - this.potentialArrowAt = -1; - this.noArrowAt = []; - this.noArrowParamsConversionAt = []; - this.maybeInArrowParameters = false; - this.inPipeline = false; - this.inType = false; - this.noAnonFunctionType = false; - this.inPropertyName = false; - this.hasFlowComment = false; - this.isIterator = false; - this.isDeclareContext = false; - this.inAbstractClass = false; - this.topicContext = { - maxNumOfResolvableTopics: 0, - maxTopicIndex: null - }; - this.soloAwait = false; - this.inFSharpPipelineDirectBody = false; - this.labels = []; - this.decoratorStack = [[]]; - this.comments = []; - this.trailingComments = []; - this.leadingComments = []; - this.commentStack = []; - this.commentPreviousNode = null; - this.pos = 0; - this.lineStart = 0; - this.type = types.eof; - this.value = null; - this.start = 0; - this.end = 0; - this.lastTokEndLoc = null; - this.lastTokStartLoc = null; - this.lastTokStart = 0; - this.lastTokEnd = 0; - this.context = [types$1.braceStatement]; - this.exprAllowed = true; - this.containsEsc = false; - this.strictErrors = new Map(); - this.exportedIdentifiers = []; - this.tokensLength = 0; - } - - init(options) { - this.strict = options.strictMode === false ? false : options.sourceType === "module"; - this.curLine = options.startLine; - this.startLoc = this.endLoc = this.curPosition(); - } - - curPosition() { - return new Position(this.curLine, this.pos - this.lineStart); - } - - clone(skipArrays) { - const state = new State(); - const keys = Object.keys(this); - - for (let i = 0, length = keys.length; i < length; i++) { - const key = keys[i]; - let val = this[key]; - - if (!skipArrays && Array.isArray(val)) { - val = val.slice(); - } - - state[key] = val; - } - - return state; - } - -} - -var _isDigit = function isDigit(code) { - return code >= 48 && code <= 57; -}; -const VALID_REGEX_FLAGS = new Set(["g", "m", "s", "i", "y", "u"]); -const forbiddenNumericSeparatorSiblings = { - decBinOct: [46, 66, 69, 79, 95, 98, 101, 111], - hex: [46, 88, 95, 120] -}; -const allowedNumericSeparatorSiblings = {}; -allowedNumericSeparatorSiblings.bin = [48, 49]; -allowedNumericSeparatorSiblings.oct = [...allowedNumericSeparatorSiblings.bin, 50, 51, 52, 53, 54, 55]; -allowedNumericSeparatorSiblings.dec = [...allowedNumericSeparatorSiblings.oct, 56, 57]; -allowedNumericSeparatorSiblings.hex = [...allowedNumericSeparatorSiblings.dec, 65, 66, 67, 68, 69, 70, 97, 98, 99, 100, 101, 102]; -class Token { - constructor(state) { - this.type = state.type; - this.value = state.value; - this.start = state.start; - this.end = state.end; - this.loc = new SourceLocation(state.startLoc, state.endLoc); - } - -} -class Tokenizer extends ParserError { - constructor(options, input) { - super(); - this.isLookahead = void 0; - this.tokens = []; - this.state = new State(); - this.state.init(options); - this.input = input; - this.length = input.length; - this.isLookahead = false; - } - - pushToken(token) { - this.tokens.length = this.state.tokensLength; - this.tokens.push(token); - ++this.state.tokensLength; - } - - next() { - if (!this.isLookahead) { - this.checkKeywordEscapes(); - - if (this.options.tokens) { - this.pushToken(new Token(this.state)); - } - } - - this.state.lastTokEnd = this.state.end; - this.state.lastTokStart = this.state.start; - this.state.lastTokEndLoc = this.state.endLoc; - this.state.lastTokStartLoc = this.state.startLoc; - this.nextToken(); - } - - eat(type) { - if (this.match(type)) { - this.next(); - return true; - } else { - return false; - } - } - - match(type) { - return this.state.type === type; - } - - lookahead() { - const old = this.state; - this.state = old.clone(true); - this.isLookahead = true; - this.next(); - this.isLookahead = false; - const curr = this.state; - this.state = old; - return curr; - } - - nextTokenStart() { - return this.nextTokenStartSince(this.state.pos); - } - - nextTokenStartSince(pos) { - skipWhiteSpace.lastIndex = pos; - const skip = skipWhiteSpace.exec(this.input); - return pos + skip[0].length; - } - - lookaheadCharCode() { - return this.input.charCodeAt(this.nextTokenStart()); - } - - setStrict(strict) { - this.state.strict = strict; - - if (strict) { - this.state.strictErrors.forEach((message, pos) => this.raise(pos, message)); - this.state.strictErrors.clear(); - } - } - - curContext() { - return this.state.context[this.state.context.length - 1]; - } - - nextToken() { - const curContext = this.curContext(); - if (!(curContext == null ? void 0 : curContext.preserveSpace)) this.skipSpace(); - this.state.start = this.state.pos; - this.state.startLoc = this.state.curPosition(); - - if (this.state.pos >= this.length) { - this.finishToken(types.eof); - return; - } - - const override = curContext == null ? void 0 : curContext.override; - - if (override) { - override(this); - } else { - this.getTokenFromCode(this.input.codePointAt(this.state.pos)); - } - } - - pushComment(block, text, start, end, startLoc, endLoc) { - const comment = { - type: block ? "CommentBlock" : "CommentLine", - value: text, - start: start, - end: end, - loc: new SourceLocation(startLoc, endLoc) - }; - if (this.options.tokens) this.pushToken(comment); - this.state.comments.push(comment); - this.addComment(comment); - } - - skipBlockComment() { - const startLoc = this.state.curPosition(); - const start = this.state.pos; - const end = this.input.indexOf("*/", this.state.pos + 2); - if (end === -1) throw this.raise(start, ErrorMessages.UnterminatedComment); - this.state.pos = end + 2; - lineBreakG.lastIndex = start; - let match; - - while ((match = lineBreakG.exec(this.input)) && match.index < this.state.pos) { - ++this.state.curLine; - this.state.lineStart = match.index + match[0].length; - } - - if (this.isLookahead) return; - this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition()); - } - - skipLineComment(startSkip) { - const start = this.state.pos; - const startLoc = this.state.curPosition(); - let ch = this.input.charCodeAt(this.state.pos += startSkip); - - if (this.state.pos < this.length) { - while (!isNewLine(ch) && ++this.state.pos < this.length) { - ch = this.input.charCodeAt(this.state.pos); - } - } - - if (this.isLookahead) return; - this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition()); - } - - skipSpace() { - loop: while (this.state.pos < this.length) { - const ch = this.input.charCodeAt(this.state.pos); - - switch (ch) { - case 32: - case 160: - case 9: - ++this.state.pos; - break; - - case 13: - if (this.input.charCodeAt(this.state.pos + 1) === 10) { - ++this.state.pos; - } - - case 10: - case 8232: - case 8233: - ++this.state.pos; - ++this.state.curLine; - this.state.lineStart = this.state.pos; - break; - - case 47: - switch (this.input.charCodeAt(this.state.pos + 1)) { - case 42: - this.skipBlockComment(); - break; - - case 47: - this.skipLineComment(2); - break; - - default: - break loop; - } - - break; - - default: - if (isWhitespace(ch)) { - ++this.state.pos; - } else { - break loop; - } - - } - } - } - - finishToken(type, val) { - this.state.end = this.state.pos; - this.state.endLoc = this.state.curPosition(); - const prevType = this.state.type; - this.state.type = type; - this.state.value = val; - if (!this.isLookahead) this.updateContext(prevType); - } - - readToken_numberSign() { - if (this.state.pos === 0 && this.readToken_interpreter()) { - return; - } - - const nextPos = this.state.pos + 1; - const next = this.input.charCodeAt(nextPos); - - if (next >= 48 && next <= 57) { - throw this.raise(this.state.pos, ErrorMessages.UnexpectedDigitAfterHash); - } - - if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) { - this.expectPlugin("recordAndTuple"); - - if (this.getPluginOption("recordAndTuple", "syntaxType") !== "hash") { - throw this.raise(this.state.pos, next === 123 ? ErrorMessages.RecordExpressionHashIncorrectStartSyntaxType : ErrorMessages.TupleExpressionHashIncorrectStartSyntaxType); - } - - if (next === 123) { - this.finishToken(types.braceHashL); - } else { - this.finishToken(types.bracketHashL); - } - - this.state.pos += 2; - } else { - this.finishOp(types.hash, 1); - } - } - - readToken_dot() { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next >= 48 && next <= 57) { - this.readNumber(true); - return; - } - - if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) { - this.state.pos += 3; - this.finishToken(types.ellipsis); - } else { - ++this.state.pos; - this.finishToken(types.dot); - } - } - - readToken_slash() { - if (this.state.exprAllowed && !this.state.inType) { - ++this.state.pos; - this.readRegexp(); - return; - } - - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 61) { - this.finishOp(types.assign, 2); - } else { - this.finishOp(types.slash, 1); - } - } - - readToken_interpreter() { - if (this.state.pos !== 0 || this.length < 2) return false; - let ch = this.input.charCodeAt(this.state.pos + 1); - if (ch !== 33) return false; - const start = this.state.pos; - this.state.pos += 1; - - while (!isNewLine(ch) && ++this.state.pos < this.length) { - ch = this.input.charCodeAt(this.state.pos); - } - - const value = this.input.slice(start + 2, this.state.pos); - this.finishToken(types.interpreterDirective, value); - return true; - } - - readToken_mult_modulo(code) { - let type = code === 42 ? types.star : types.modulo; - let width = 1; - let next = this.input.charCodeAt(this.state.pos + 1); - const exprAllowed = this.state.exprAllowed; - - if (code === 42 && next === 42) { - width++; - next = this.input.charCodeAt(this.state.pos + 2); - type = types.exponent; - } - - if (next === 61 && !exprAllowed) { - width++; - type = types.assign; - } - - this.finishOp(type, width); - } - - readToken_pipe_amp(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === code) { - if (this.input.charCodeAt(this.state.pos + 2) === 61) { - this.finishOp(types.assign, 3); - } else { - this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2); - } - - return; - } - - if (code === 124) { - if (next === 62) { - this.finishOp(types.pipeline, 2); - return; - } - - if (this.hasPlugin("recordAndTuple") && next === 125) { - if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(this.state.pos, ErrorMessages.RecordExpressionBarIncorrectEndSyntaxType); - } - - this.finishOp(types.braceBarR, 2); - return; - } - - if (this.hasPlugin("recordAndTuple") && next === 93) { - if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(this.state.pos, ErrorMessages.TupleExpressionBarIncorrectEndSyntaxType); - } - - this.finishOp(types.bracketBarR, 2); - return; - } - } - - if (next === 61) { - this.finishOp(types.assign, 2); - return; - } - - this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1); - } - - readToken_caret() { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 61) { - this.finishOp(types.assign, 2); - } else { - this.finishOp(types.bitwiseXOR, 1); - } - } - - readToken_plus_min(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === code) { - if (next === 45 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 62 && (this.state.lastTokEnd === 0 || this.hasPrecedingLineBreak())) { - this.skipLineComment(3); - this.skipSpace(); - this.nextToken(); - return; - } - - this.finishOp(types.incDec, 2); - return; - } - - if (next === 61) { - this.finishOp(types.assign, 2); - } else { - this.finishOp(types.plusMin, 1); - } - } - - readToken_lt_gt(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - let size = 1; - - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2; - - if (this.input.charCodeAt(this.state.pos + size) === 61) { - this.finishOp(types.assign, size + 1); - return; - } - - this.finishOp(types.bitShift, size); - return; - } - - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) { - this.skipLineComment(4); - this.skipSpace(); - this.nextToken(); - return; - } - - if (next === 61) { - size = 2; - } - - this.finishOp(types.relational, size); - } - - readToken_eq_excl(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 61) { - this.finishOp(types.equality, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2); - return; - } - - if (code === 61 && next === 62) { - this.state.pos += 2; - this.finishToken(types.arrow); - return; - } - - this.finishOp(code === 61 ? types.eq : types.bang, 1); - } - - readToken_question() { - const next = this.input.charCodeAt(this.state.pos + 1); - const next2 = this.input.charCodeAt(this.state.pos + 2); - - if (next === 63) { - if (next2 === 61) { - this.finishOp(types.assign, 3); - } else { - this.finishOp(types.nullishCoalescing, 2); - } - } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) { - this.state.pos += 2; - this.finishToken(types.questionDot); - } else { - ++this.state.pos; - this.finishToken(types.question); - } - } - - getTokenFromCode(code) { - switch (code) { - case 46: - this.readToken_dot(); - return; - - case 40: - ++this.state.pos; - this.finishToken(types.parenL); - return; - - case 41: - ++this.state.pos; - this.finishToken(types.parenR); - return; - - case 59: - ++this.state.pos; - this.finishToken(types.semi); - return; - - case 44: - ++this.state.pos; - this.finishToken(types.comma); - return; - - case 91: - if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { - if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(this.state.pos, ErrorMessages.TupleExpressionBarIncorrectStartSyntaxType); - } - - this.finishToken(types.bracketBarL); - this.state.pos += 2; - } else { - ++this.state.pos; - this.finishToken(types.bracketL); - } - - return; - - case 93: - ++this.state.pos; - this.finishToken(types.bracketR); - return; - - case 123: - if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { - if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(this.state.pos, ErrorMessages.RecordExpressionBarIncorrectStartSyntaxType); - } - - this.finishToken(types.braceBarL); - this.state.pos += 2; - } else { - ++this.state.pos; - this.finishToken(types.braceL); - } - - return; - - case 125: - ++this.state.pos; - this.finishToken(types.braceR); - return; - - case 58: - if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) { - this.finishOp(types.doubleColon, 2); - } else { - ++this.state.pos; - this.finishToken(types.colon); - } - - return; - - case 63: - this.readToken_question(); - return; - - case 96: - ++this.state.pos; - this.finishToken(types.backQuote); - return; - - case 48: - { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 120 || next === 88) { - this.readRadixNumber(16); - return; - } - - if (next === 111 || next === 79) { - this.readRadixNumber(8); - return; - } - - if (next === 98 || next === 66) { - this.readRadixNumber(2); - return; - } - } - - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - this.readNumber(false); - return; - - case 34: - case 39: - this.readString(code); - return; - - case 47: - this.readToken_slash(); - return; - - case 37: - case 42: - this.readToken_mult_modulo(code); - return; - - case 124: - case 38: - this.readToken_pipe_amp(code); - return; - - case 94: - this.readToken_caret(); - return; - - case 43: - case 45: - this.readToken_plus_min(code); - return; - - case 60: - case 62: - this.readToken_lt_gt(code); - return; - - case 61: - case 33: - this.readToken_eq_excl(code); - return; - - case 126: - this.finishOp(types.tilde, 1); - return; - - case 64: - ++this.state.pos; - this.finishToken(types.at); - return; - - case 35: - this.readToken_numberSign(); - return; - - case 92: - this.readWord(); - return; - - default: - if (isIdentifierStart(code)) { - this.readWord(); - return; - } - - } - - throw this.raise(this.state.pos, ErrorMessages.InvalidOrUnexpectedToken, String.fromCodePoint(code)); - } - - finishOp(type, size) { - const str = this.input.slice(this.state.pos, this.state.pos + size); - this.state.pos += size; - this.finishToken(type, str); - } - - readRegexp() { - const start = this.state.pos; - let escaped, inClass; - - for (;;) { - if (this.state.pos >= this.length) { - throw this.raise(start, ErrorMessages.UnterminatedRegExp); - } - - const ch = this.input.charAt(this.state.pos); - - if (lineBreak.test(ch)) { - throw this.raise(start, ErrorMessages.UnterminatedRegExp); - } - - if (escaped) { - escaped = false; - } else { - if (ch === "[") { - inClass = true; - } else if (ch === "]" && inClass) { - inClass = false; - } else if (ch === "/" && !inClass) { - break; - } - - escaped = ch === "\\"; - } - - ++this.state.pos; - } - - const content = this.input.slice(start, this.state.pos); - ++this.state.pos; - let mods = ""; - - while (this.state.pos < this.length) { - const char = this.input[this.state.pos]; - const charCode = this.input.codePointAt(this.state.pos); - - if (VALID_REGEX_FLAGS.has(char)) { - if (mods.indexOf(char) > -1) { - this.raise(this.state.pos + 1, ErrorMessages.DuplicateRegExpFlags); - } - } else if (isIdentifierChar(charCode) || charCode === 92) { - this.raise(this.state.pos + 1, ErrorMessages.MalformedRegExpFlags); - } else { - break; - } - - ++this.state.pos; - mods += char; - } - - this.finishToken(types.regexp, { - pattern: content, - flags: mods - }); - } - - readInt(radix, len, forceLen, allowNumSeparator = true) { - const start = this.state.pos; - const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct; - const allowedSiblings = radix === 16 ? allowedNumericSeparatorSiblings.hex : radix === 10 ? allowedNumericSeparatorSiblings.dec : radix === 8 ? allowedNumericSeparatorSiblings.oct : allowedNumericSeparatorSiblings.bin; - let invalid = false; - let total = 0; - - for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { - const code = this.input.charCodeAt(this.state.pos); - let val; - - if (code === 95) { - const prev = this.input.charCodeAt(this.state.pos - 1); - const next = this.input.charCodeAt(this.state.pos + 1); - - if (allowedSiblings.indexOf(next) === -1) { - this.raise(this.state.pos, ErrorMessages.UnexpectedNumericSeparator); - } else if (forbiddenSiblings.indexOf(prev) > -1 || forbiddenSiblings.indexOf(next) > -1 || Number.isNaN(next)) { - this.raise(this.state.pos, ErrorMessages.UnexpectedNumericSeparator); - } - - if (!allowNumSeparator) { - this.raise(this.state.pos, ErrorMessages.NumericSeparatorInEscapeSequence); - } - - ++this.state.pos; - continue; - } - - if (code >= 97) { - val = code - 97 + 10; - } else if (code >= 65) { - val = code - 65 + 10; - } else if (_isDigit(code)) { - val = code - 48; - } else { - val = Infinity; - } - - if (val >= radix) { - if (this.options.errorRecovery && val <= 9) { - val = 0; - this.raise(this.state.start + i + 2, ErrorMessages.InvalidDigit, radix); - } else if (forceLen) { - val = 0; - invalid = true; - } else { - break; - } - } - - ++this.state.pos; - total = total * radix + val; - } - - if (this.state.pos === start || len != null && this.state.pos - start !== len || invalid) { - return null; - } - - return total; - } - - readRadixNumber(radix) { - const start = this.state.pos; - let isBigInt = false; - this.state.pos += 2; - const val = this.readInt(radix); - - if (val == null) { - this.raise(this.state.start + 2, ErrorMessages.InvalidDigit, radix); - } - - const next = this.input.charCodeAt(this.state.pos); - - if (next === 110) { - ++this.state.pos; - isBigInt = true; - } else if (next === 109) { - throw this.raise(start, ErrorMessages.InvalidDecimal); - } - - if (isIdentifierStart(this.input.codePointAt(this.state.pos))) { - throw this.raise(this.state.pos, ErrorMessages.NumberIdentifier); - } - - if (isBigInt) { - const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, ""); - this.finishToken(types.bigint, str); - return; - } - - this.finishToken(types.num, val); - } - - readNumber(startsWithDot) { - const start = this.state.pos; - let isFloat = false; - let isBigInt = false; - let isDecimal = false; - let hasExponent = false; - let isOctal = false; - - if (!startsWithDot && this.readInt(10) === null) { - this.raise(start, ErrorMessages.InvalidNumber); - } - - const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48; - - if (hasLeadingZero) { - const integer = this.input.slice(start, this.state.pos); - this.recordStrictModeErrors(start, ErrorMessages.StrictOctalLiteral); - - if (!this.state.strict) { - const underscorePos = integer.indexOf("_"); - - if (underscorePos > 0) { - this.raise(underscorePos + start, ErrorMessages.ZeroDigitNumericSeparator); - } - } - - isOctal = hasLeadingZero && !/[89]/.test(integer); - } - - let next = this.input.charCodeAt(this.state.pos); - - if (next === 46 && !isOctal) { - ++this.state.pos; - this.readInt(10); - isFloat = true; - next = this.input.charCodeAt(this.state.pos); - } - - if ((next === 69 || next === 101) && !isOctal) { - next = this.input.charCodeAt(++this.state.pos); - - if (next === 43 || next === 45) { - ++this.state.pos; - } - - if (this.readInt(10) === null) { - this.raise(start, ErrorMessages.InvalidOrMissingExponent); - } - - isFloat = true; - hasExponent = true; - next = this.input.charCodeAt(this.state.pos); - } - - if (next === 110) { - if (isFloat || hasLeadingZero) { - this.raise(start, ErrorMessages.InvalidBigIntLiteral); - } - - ++this.state.pos; - isBigInt = true; - } - - if (next === 109) { - this.expectPlugin("decimal", this.state.pos); - - if (hasExponent || hasLeadingZero) { - this.raise(start, ErrorMessages.InvalidDecimal); - } - - ++this.state.pos; - isDecimal = true; - } - - if (isIdentifierStart(this.input.codePointAt(this.state.pos))) { - throw this.raise(this.state.pos, ErrorMessages.NumberIdentifier); - } - - const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, ""); - - if (isBigInt) { - this.finishToken(types.bigint, str); - return; - } - - if (isDecimal) { - this.finishToken(types.decimal, str); - return; - } - - const val = isOctal ? parseInt(str, 8) : parseFloat(str); - this.finishToken(types.num, val); - } - - readCodePoint(throwOnInvalid) { - const ch = this.input.charCodeAt(this.state.pos); - let code; - - if (ch === 123) { - const codePos = ++this.state.pos; - code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, true, throwOnInvalid); - ++this.state.pos; - - if (code !== null && code > 0x10ffff) { - if (throwOnInvalid) { - this.raise(codePos, ErrorMessages.InvalidCodePoint); - } else { - return null; - } - } - } else { - code = this.readHexChar(4, false, throwOnInvalid); - } - - return code; - } - - readString(quote) { - let out = "", - chunkStart = ++this.state.pos; - - for (;;) { - if (this.state.pos >= this.length) { - throw this.raise(this.state.start, ErrorMessages.UnterminatedString); - } - - const ch = this.input.charCodeAt(this.state.pos); - if (ch === quote) break; - - if (ch === 92) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.readEscapedChar(false); - chunkStart = this.state.pos; - } else if (ch === 8232 || ch === 8233) { - ++this.state.pos; - ++this.state.curLine; - this.state.lineStart = this.state.pos; - } else if (isNewLine(ch)) { - throw this.raise(this.state.start, ErrorMessages.UnterminatedString); - } else { - ++this.state.pos; - } - } - - out += this.input.slice(chunkStart, this.state.pos++); - this.finishToken(types.string, out); - } - - readTmplToken() { - let out = "", - chunkStart = this.state.pos, - containsInvalid = false; - - for (;;) { - if (this.state.pos >= this.length) { - throw this.raise(this.state.start, ErrorMessages.UnterminatedTemplate); - } - - const ch = this.input.charCodeAt(this.state.pos); - - if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) { - if (this.state.pos === this.state.start && this.match(types.template)) { - if (ch === 36) { - this.state.pos += 2; - this.finishToken(types.dollarBraceL); - return; - } else { - ++this.state.pos; - this.finishToken(types.backQuote); - return; - } - } - - out += this.input.slice(chunkStart, this.state.pos); - this.finishToken(types.template, containsInvalid ? null : out); - return; - } - - if (ch === 92) { - out += this.input.slice(chunkStart, this.state.pos); - const escaped = this.readEscapedChar(true); - - if (escaped === null) { - containsInvalid = true; - } else { - out += escaped; - } - - chunkStart = this.state.pos; - } else if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - ++this.state.pos; - - switch (ch) { - case 13: - if (this.input.charCodeAt(this.state.pos) === 10) { - ++this.state.pos; - } - - case 10: - out += "\n"; - break; - - default: - out += String.fromCharCode(ch); - break; - } - - ++this.state.curLine; - this.state.lineStart = this.state.pos; - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - } - } - - recordStrictModeErrors(pos, message) { - if (this.state.strict && !this.state.strictErrors.has(pos)) { - this.raise(pos, message); - } else { - this.state.strictErrors.set(pos, message); - } - } - - readEscapedChar(inTemplate) { - const throwOnInvalid = !inTemplate; - const ch = this.input.charCodeAt(++this.state.pos); - ++this.state.pos; - - switch (ch) { - case 110: - return "\n"; - - case 114: - return "\r"; - - case 120: - { - const code = this.readHexChar(2, false, throwOnInvalid); - return code === null ? null : String.fromCharCode(code); - } - - case 117: - { - const code = this.readCodePoint(throwOnInvalid); - return code === null ? null : String.fromCodePoint(code); - } - - case 116: - return "\t"; - - case 98: - return "\b"; - - case 118: - return "\u000b"; - - case 102: - return "\f"; - - case 13: - if (this.input.charCodeAt(this.state.pos) === 10) { - ++this.state.pos; - } - - case 10: - this.state.lineStart = this.state.pos; - ++this.state.curLine; - - case 8232: - case 8233: - return ""; - - case 56: - case 57: - if (inTemplate) { - return null; - } else { - this.recordStrictModeErrors(this.state.pos - 1, ErrorMessages.StrictNumericEscape); - } - - default: - if (ch >= 48 && ch <= 55) { - const codePos = this.state.pos - 1; - const match = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/); - let octalStr = match[0]; - let octal = parseInt(octalStr, 8); - - if (octal > 255) { - octalStr = octalStr.slice(0, -1); - octal = parseInt(octalStr, 8); - } - - this.state.pos += octalStr.length - 1; - const next = this.input.charCodeAt(this.state.pos); - - if (octalStr !== "0" || next === 56 || next === 57) { - if (inTemplate) { - return null; - } else { - this.recordStrictModeErrors(codePos, ErrorMessages.StrictNumericEscape); - } - } - - return String.fromCharCode(octal); - } - - return String.fromCharCode(ch); - } - } - - readHexChar(len, forceLen, throwOnInvalid) { - const codePos = this.state.pos; - const n = this.readInt(16, len, forceLen, false); - - if (n === null) { - if (throwOnInvalid) { - this.raise(codePos, ErrorMessages.InvalidEscapeSequence); - } else { - this.state.pos = codePos - 1; - } - } - - return n; - } - - readWord1() { - let word = ""; - this.state.containsEsc = false; - const start = this.state.pos; - let chunkStart = this.state.pos; - - while (this.state.pos < this.length) { - const ch = this.input.codePointAt(this.state.pos); - - if (isIdentifierChar(ch)) { - this.state.pos += ch <= 0xffff ? 1 : 2; - } else if (this.state.isIterator && ch === 64) { - ++this.state.pos; - } else if (ch === 92) { - this.state.containsEsc = true; - word += this.input.slice(chunkStart, this.state.pos); - const escStart = this.state.pos; - const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar; - - if (this.input.charCodeAt(++this.state.pos) !== 117) { - this.raise(this.state.pos, ErrorMessages.MissingUnicodeEscape); - continue; - } - - ++this.state.pos; - const esc = this.readCodePoint(true); - - if (esc !== null) { - if (!identifierCheck(esc)) { - this.raise(escStart, ErrorMessages.EscapedCharNotAnIdentifier); - } - - word += String.fromCodePoint(esc); - } - - chunkStart = this.state.pos; - } else { - break; - } - } - - return word + this.input.slice(chunkStart, this.state.pos); - } - - isIterator(word) { - return word === "@@iterator" || word === "@@asyncIterator"; - } - - readWord() { - const word = this.readWord1(); - const type = keywords.get(word) || types.name; - - if (this.state.isIterator && (!this.isIterator(word) || !this.state.inType)) { - this.raise(this.state.pos, ErrorMessages.InvalidIdentifier, word); - } - - this.finishToken(type, word); - } - - checkKeywordEscapes() { - const kw = this.state.type.keyword; - - if (kw && this.state.containsEsc) { - this.raise(this.state.start, ErrorMessages.InvalidEscapedReservedWord, kw); - } - } - - braceIsBlock(prevType) { - const parent = this.curContext(); - - if (parent === types$1.functionExpression || parent === types$1.functionStatement) { - return true; - } - - if (prevType === types.colon && (parent === types$1.braceStatement || parent === types$1.braceExpression)) { - return !parent.isExpr; - } - - if (prevType === types._return || prevType === types.name && this.state.exprAllowed) { - return this.hasPrecedingLineBreak(); - } - - 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.braceStatement; - } - - if (prevType === types._var || prevType === types._const || prevType === types.name) { - return false; - } - - if (prevType === types.relational) { - return true; - } - - return !this.state.exprAllowed; - } - - updateContext(prevType) { - const type = this.state.type; - let update; - - if (type.keyword && (prevType === types.dot || prevType === types.questionDot)) { - this.state.exprAllowed = false; - } else if (update = type.updateContext) { - update.call(this, prevType); - } else { - this.state.exprAllowed = type.beforeExpr; - } - } - -} - -class ClassScope { - constructor() { - this.privateNames = new Set(); - this.loneAccessors = new Map(); - this.undefinedPrivateNames = new Map(); - } - -} -class ClassScopeHandler { - constructor(raise) { - this.stack = []; - this.undefinedPrivateNames = new Map(); - this.raise = raise; - } - - current() { - return this.stack[this.stack.length - 1]; - } - - enter() { - this.stack.push(new ClassScope()); - } - - exit() { - const oldClassScope = this.stack.pop(); - const current = this.current(); - - for (let _i = 0, _Array$from = Array.from(oldClassScope.undefinedPrivateNames); _i < _Array$from.length; _i++) { - const [name, pos] = _Array$from[_i]; - - if (current) { - if (!current.undefinedPrivateNames.has(name)) { - current.undefinedPrivateNames.set(name, pos); - } - } else { - this.raise(pos, ErrorMessages.InvalidPrivateFieldResolution, name); - } - } - } - - declarePrivateName(name, elementType, pos) { - const classScope = this.current(); - let redefined = classScope.privateNames.has(name); - - if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) { - const accessor = redefined && classScope.loneAccessors.get(name); - - if (accessor) { - const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC; - const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC; - const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR; - const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR; - redefined = oldKind === newKind || oldStatic !== newStatic; - if (!redefined) classScope.loneAccessors.delete(name); - } else if (!redefined) { - classScope.loneAccessors.set(name, elementType); - } - } - - if (redefined) { - this.raise(pos, ErrorMessages.PrivateNameRedeclaration, name); - } - - classScope.privateNames.add(name); - classScope.undefinedPrivateNames.delete(name); - } - - usePrivateName(name, pos) { - let classScope; - - for (let _i2 = 0, _this$stack = this.stack; _i2 < _this$stack.length; _i2++) { - classScope = _this$stack[_i2]; - if (classScope.privateNames.has(name)) return; - } - - if (classScope) { - classScope.undefinedPrivateNames.set(name, pos); - } else { - this.raise(pos, ErrorMessages.InvalidPrivateFieldResolution, name); - } - } - -} - -const kExpression = 0, - kMaybeArrowParameterDeclaration = 1, - kMaybeAsyncArrowParameterDeclaration = 2, - kParameterDeclaration = 3; - -class ExpressionScope { - constructor(type = kExpression) { - this.type = void 0; - this.type = type; - } - - canBeArrowParameterDeclaration() { - return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration; - } - - isCertainlyParameterDeclaration() { - return this.type === kParameterDeclaration; - } - -} - -class ArrowHeadParsingScope extends ExpressionScope { - constructor(type) { - super(type); - this.errors = new Map(); - } - - recordDeclarationError(pos, message) { - this.errors.set(pos, message); - } - - clearDeclarationError(pos) { - this.errors.delete(pos); - } - - iterateErrors(iterator) { - this.errors.forEach(iterator); - } - -} - -class ExpressionScopeHandler { - constructor(raise) { - this.stack = [new ExpressionScope()]; - this.raise = raise; - } - - enter(scope) { - this.stack.push(scope); - } - - exit() { - this.stack.pop(); - } - - recordParameterInitializerError(pos, message) { - const { - stack - } = this; - let i = stack.length - 1; - let scope = stack[i]; - - while (!scope.isCertainlyParameterDeclaration()) { - if (scope.canBeArrowParameterDeclaration()) { - scope.recordDeclarationError(pos, message); - } else { - return; - } - - scope = stack[--i]; - } - - this.raise(pos, message); - } - - recordParenthesizedIdentifierError(pos, message) { - const { - stack - } = this; - const scope = stack[stack.length - 1]; - - if (scope.isCertainlyParameterDeclaration()) { - this.raise(pos, message); - } else if (scope.canBeArrowParameterDeclaration()) { - scope.recordDeclarationError(pos, message); - } else { - return; - } - } - - recordAsyncArrowParametersError(pos, message) { - const { - stack - } = this; - let i = stack.length - 1; - let scope = stack[i]; - - while (scope.canBeArrowParameterDeclaration()) { - if (scope.type === kMaybeAsyncArrowParameterDeclaration) { - scope.recordDeclarationError(pos, message); - } - - scope = stack[--i]; - } - } - - validateAsPattern() { - const { - stack - } = this; - const currentScope = stack[stack.length - 1]; - if (!currentScope.canBeArrowParameterDeclaration()) return; - currentScope.iterateErrors((message, pos) => { - this.raise(pos, message); - let i = stack.length - 2; - let scope = stack[i]; - - while (scope.canBeArrowParameterDeclaration()) { - scope.clearDeclarationError(pos); - scope = stack[--i]; - } - }); - } - -} -function newParameterDeclarationScope() { - return new ExpressionScope(kParameterDeclaration); -} -function newArrowHeadScope() { - return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration); -} -function newAsyncArrowScope() { - return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration); -} -function newExpressionScope() { - return new ExpressionScope(); -} - -class UtilParser extends Tokenizer { - addExtra(node, key, val) { - if (!node) return; - const extra = node.extra = node.extra || {}; - extra[key] = val; - } - - isRelational(op) { - return this.match(types.relational) && this.state.value === op; - } - - expectRelational(op) { - if (this.isRelational(op)) { - this.next(); - } else { - this.unexpected(null, types.relational); - } - } - - isContextual(name) { - return this.match(types.name) && this.state.value === name && !this.state.containsEsc; - } - - isUnparsedContextual(nameStart, name) { - const nameEnd = nameStart + name.length; - return this.input.slice(nameStart, nameEnd) === name && (nameEnd === this.input.length || !isIdentifierChar(this.input.charCodeAt(nameEnd))); - } - - isLookaheadContextual(name) { - const next = this.nextTokenStart(); - return this.isUnparsedContextual(next, name); - } - - eatContextual(name) { - return this.isContextual(name) && this.eat(types.name); - } - - expectContextual(name, message) { - if (!this.eatContextual(name)) this.unexpected(null, message); - } - - canInsertSemicolon() { - return this.match(types.eof) || this.match(types.braceR) || this.hasPrecedingLineBreak(); - } - - hasPrecedingLineBreak() { - return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); - } - - hasFollowingLineBreak() { - return lineBreak.test(this.input.slice(this.state.end, this.nextTokenStart())); - } - - isLineTerminator() { - return this.eat(types.semi) || this.canInsertSemicolon(); - } - - semicolon(allowAsi = true) { - if (allowAsi ? this.isLineTerminator() : this.eat(types.semi)) return; - this.raise(this.state.lastTokEnd, ErrorMessages.MissingSemicolon); - } - - expect(type, pos) { - this.eat(type) || this.unexpected(pos, type); - } - - assertNoSpace(message = "Unexpected space.") { - if (this.state.start > this.state.lastTokEnd) { - this.raise(this.state.lastTokEnd, message); - } - } - - unexpected(pos, messageOrType = "Unexpected token") { - if (typeof messageOrType !== "string") { - messageOrType = `Unexpected token, expected "${messageOrType.label}"`; - } - - throw this.raise(pos != null ? pos : this.state.start, messageOrType); - } - - expectPlugin(name, pos) { - if (!this.hasPlugin(name)) { - throw this.raiseWithData(pos != null ? pos : this.state.start, { - missingPlugin: [name] - }, `This experimental syntax requires enabling the parser plugin: '${name}'`); - } - - return true; - } - - expectOnePlugin(names, pos) { - if (!names.some(n => this.hasPlugin(n))) { - throw this.raiseWithData(pos != null ? pos : this.state.start, { - missingPlugin: names - }, `This experimental syntax requires enabling one of the following parser plugin(s): '${names.join(", ")}'`); - } - } - - tryParse(fn, oldState = this.state.clone()) { - const abortSignal = { - node: null - }; - - try { - const node = fn((node = null) => { - abortSignal.node = node; - throw abortSignal; - }); - - if (this.state.errors.length > oldState.errors.length) { - const failState = this.state; - this.state = oldState; - return { - node, - error: failState.errors[oldState.errors.length], - thrown: false, - aborted: false, - failState - }; - } - - return { - node, - error: null, - thrown: false, - aborted: false, - failState: null - }; - } catch (error) { - const failState = this.state; - this.state = oldState; - - if (error instanceof SyntaxError) { - return { - node: null, - error, - thrown: true, - aborted: false, - failState - }; - } - - if (error === abortSignal) { - return { - node: abortSignal.node, - error: null, - thrown: false, - aborted: true, - failState - }; - } - - throw error; - } - } - - checkExpressionErrors(refExpressionErrors, andThrow) { - if (!refExpressionErrors) return false; - const { - shorthandAssign, - doubleProto - } = refExpressionErrors; - if (!andThrow) return shorthandAssign >= 0 || doubleProto >= 0; - - if (shorthandAssign >= 0) { - this.unexpected(shorthandAssign); - } - - if (doubleProto >= 0) { - this.raise(doubleProto, ErrorMessages.DuplicateProto); - } - } - - isLiteralPropertyName() { - return this.match(types.name) || !!this.state.type.keyword || this.match(types.string) || this.match(types.num) || this.match(types.bigint) || this.match(types.decimal); - } - - isPrivateName(node) { - return node.type === "PrivateName"; - } - - getPrivateNameSV(node) { - return node.id.name; - } - - hasPropertyAsPrivateName(node) { - return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property); - } - - isOptionalChain(node) { - return node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression"; - } - - isObjectProperty(node) { - return node.type === "ObjectProperty"; - } - - isObjectMethod(node) { - return node.type === "ObjectMethod"; - } - - initializeScopes(inModule = this.options.sourceType === "module") { - const oldLabels = this.state.labels; - this.state.labels = []; - const oldExportedIdentifiers = this.state.exportedIdentifiers; - this.state.exportedIdentifiers = []; - const oldInModule = this.inModule; - this.inModule = inModule; - const oldScope = this.scope; - const ScopeHandler = this.getScopeHandler(); - this.scope = new ScopeHandler(this.raise.bind(this), this.inModule); - const oldProdParam = this.prodParam; - this.prodParam = new ProductionParameterHandler(); - const oldClassScope = this.classScope; - this.classScope = new ClassScopeHandler(this.raise.bind(this)); - const oldExpressionScope = this.expressionScope; - this.expressionScope = new ExpressionScopeHandler(this.raise.bind(this)); - return () => { - this.state.labels = oldLabels; - this.state.exportedIdentifiers = oldExportedIdentifiers; - this.inModule = oldInModule; - this.scope = oldScope; - this.prodParam = oldProdParam; - this.classScope = oldClassScope; - this.expressionScope = oldExpressionScope; - }; - } - - enterInitialScopes() { - let paramFlags = PARAM; - - if (this.hasPlugin("topLevelAwait") && this.inModule) { - paramFlags |= PARAM_AWAIT; - } - - this.scope.enter(SCOPE_PROGRAM); - this.prodParam.enter(paramFlags); - } - -} -class ExpressionErrors { - constructor() { - this.shorthandAssign = -1; - this.doubleProto = -1; - } - -} - -class Node { - constructor(parser, pos, loc) { - this.type = void 0; - this.start = void 0; - this.end = void 0; - this.loc = void 0; - this.range = void 0; - this.leadingComments = void 0; - this.trailingComments = void 0; - this.innerComments = void 0; - this.extra = void 0; - this.type = ""; - this.start = pos; - this.end = 0; - this.loc = new SourceLocation(loc); - if (parser == null ? void 0 : parser.options.ranges) this.range = [pos, 0]; - if (parser == null ? void 0 : parser.filename) this.loc.filename = parser.filename; - } - - __clone() { - const newNode = new Node(); - const keys = Object.keys(this); - - for (let i = 0, length = keys.length; i < length; i++) { - const key = keys[i]; - - if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") { - newNode[key] = this[key]; - } - } - - return newNode; - } - -} - -class NodeUtils extends UtilParser { - startNode() { - return new Node(this, this.state.start, this.state.startLoc); - } - - startNodeAt(pos, loc) { - return new Node(this, pos, loc); - } - - startNodeAtNode(type) { - return this.startNodeAt(type.start, type.loc.start); - } - - finishNode(node, type) { - return this.finishNodeAt(node, type, this.state.lastTokEnd, this.state.lastTokEndLoc); - } - - finishNodeAt(node, type, pos, loc) { - - node.type = type; - node.end = pos; - node.loc.end = loc; - if (this.options.ranges) node.range[1] = pos; - this.processComment(node); - return node; - } - - resetStartLocation(node, start, startLoc) { - node.start = start; - node.loc.start = startLoc; - if (this.options.ranges) node.range[0] = start; - } - - resetEndLocation(node, end = this.state.lastTokEnd, endLoc = this.state.lastTokEndLoc) { - node.end = end; - node.loc.end = endLoc; - if (this.options.ranges) node.range[1] = end; - } - - resetStartLocationFromNode(node, locationNode) { - this.resetStartLocation(node, locationNode.start, locationNode.loc.start); - } - -} - -const unwrapParenthesizedExpression = node => { - return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node; -}; - -class LValParser extends NodeUtils { - toAssignable(node, isLHS = false) { - var _node$extra, _node$extra3; - - let parenthesized = undefined; - - if (node.type === "ParenthesizedExpression" || ((_node$extra = node.extra) == null ? void 0 : _node$extra.parenthesized)) { - parenthesized = unwrapParenthesizedExpression(node); - - if (isLHS) { - if (parenthesized.type === "Identifier") { - this.expressionScope.recordParenthesizedIdentifierError(node.start, ErrorMessages.InvalidParenthesizedAssignment); - } else if (parenthesized.type !== "MemberExpression") { - this.raise(node.start, ErrorMessages.InvalidParenthesizedAssignment); - } - } else { - this.raise(node.start, ErrorMessages.InvalidParenthesizedAssignment); - } - } - - switch (node.type) { - case "Identifier": - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - break; - - case "ObjectExpression": - node.type = "ObjectPattern"; - - for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) { - var _node$extra2; - - const prop = node.properties[i]; - const isLast = i === last; - this.toAssignableObjectExpressionProp(prop, isLast, isLHS); - - if (isLast && prop.type === "RestElement" && ((_node$extra2 = node.extra) == null ? void 0 : _node$extra2.trailingComma)) { - this.raiseRestNotLast(node.extra.trailingComma); - } - } - - break; - - case "ObjectProperty": - this.toAssignable(node.value, isLHS); - break; - - case "SpreadElement": - { - this.checkToRestConversion(node); - node.type = "RestElement"; - const arg = node.argument; - this.toAssignable(arg, isLHS); - break; - } - - case "ArrayExpression": - node.type = "ArrayPattern"; - this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingComma, isLHS); - break; - - case "AssignmentExpression": - if (node.operator !== "=") { - this.raise(node.left.end, ErrorMessages.MissingEqInAssignment); - } - - node.type = "AssignmentPattern"; - delete node.operator; - this.toAssignable(node.left, isLHS); - break; - - case "ParenthesizedExpression": - this.toAssignable(parenthesized, isLHS); - break; - } - - return node; - } - - toAssignableObjectExpressionProp(prop, isLast, isLHS) { - if (prop.type === "ObjectMethod") { - const error = prop.kind === "get" || prop.kind === "set" ? ErrorMessages.PatternHasAccessor : ErrorMessages.PatternHasMethod; - this.raise(prop.key.start, error); - } else if (prop.type === "SpreadElement" && !isLast) { - this.raiseRestNotLast(prop.start); - } else { - this.toAssignable(prop, isLHS); - } - } - - toAssignableList(exprList, trailingCommaPos, isLHS) { - let end = exprList.length; - - if (end) { - const last = exprList[end - 1]; - - if ((last == null ? void 0 : last.type) === "RestElement") { - --end; - } else if ((last == null ? void 0 : last.type) === "SpreadElement") { - last.type = "RestElement"; - let arg = last.argument; - this.toAssignable(arg, isLHS); - arg = unwrapParenthesizedExpression(arg); - - if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern" && arg.type !== "ObjectPattern") { - this.unexpected(arg.start); - } - - if (trailingCommaPos) { - this.raiseTrailingCommaAfterRest(trailingCommaPos); - } - - --end; - } - } - - for (let i = 0; i < end; i++) { - const elt = exprList[i]; - - if (elt) { - this.toAssignable(elt, isLHS); - - if (elt.type === "RestElement") { - this.raiseRestNotLast(elt.start); - } - } - } - - return exprList; - } - - toReferencedList(exprList, isParenthesizedExpr) { - return exprList; - } - - toReferencedListDeep(exprList, isParenthesizedExpr) { - this.toReferencedList(exprList, isParenthesizedExpr); - - for (let _i = 0; _i < exprList.length; _i++) { - const expr = exprList[_i]; - - if ((expr == null ? void 0 : expr.type) === "ArrayExpression") { - this.toReferencedListDeep(expr.elements); - } - } - } - - parseSpread(refExpressionErrors, refNeedsArrowPos) { - const node = this.startNode(); - this.next(); - node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined, refNeedsArrowPos); - return this.finishNode(node, "SpreadElement"); - } - - parseRestBinding() { - const node = this.startNode(); - this.next(); - node.argument = this.parseBindingAtom(); - return this.finishNode(node, "RestElement"); - } - - parseBindingAtom() { - switch (this.state.type) { - case types.bracketL: - { - const node = this.startNode(); - this.next(); - node.elements = this.parseBindingList(types.bracketR, 93, true); - return this.finishNode(node, "ArrayPattern"); - } - - case types.braceL: - return this.parseObjectLike(types.braceR, true); - } - - return this.parseIdentifier(); - } - - parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) { - const elts = []; - let first = true; - - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(types.comma); - } - - if (allowEmpty && this.match(types.comma)) { - elts.push(null); - } else if (this.eat(close)) { - break; - } else if (this.match(types.ellipsis)) { - elts.push(this.parseAssignableListItemTypes(this.parseRestBinding())); - this.checkCommaAfterRest(closeCharCode); - this.expect(close); - break; - } else { - const decorators = []; - - if (this.match(types.at) && this.hasPlugin("decorators")) { - this.raise(this.state.start, ErrorMessages.UnsupportedParameterDecorator); - } - - while (this.match(types.at)) { - decorators.push(this.parseDecorator()); - } - - elts.push(this.parseAssignableListItem(allowModifiers, decorators)); - } - } - - return elts; - } - - parseAssignableListItem(allowModifiers, decorators) { - const left = this.parseMaybeDefault(); - this.parseAssignableListItemTypes(left); - const elt = this.parseMaybeDefault(left.start, left.loc.start, left); - - if (decorators.length) { - left.decorators = decorators; - } - - return elt; - } - - parseAssignableListItemTypes(param) { - return param; - } - - parseMaybeDefault(startPos, startLoc, left) { - var _startLoc, _startPos, _left; - - startLoc = (_startLoc = startLoc) != null ? _startLoc : this.state.startLoc; - startPos = (_startPos = startPos) != null ? _startPos : this.state.start; - left = (_left = left) != null ? _left : this.parseBindingAtom(); - if (!this.eat(types.eq)) return left; - const node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.right = this.parseMaybeAssignAllowIn(); - return this.finishNode(node, "AssignmentPattern"); - } - - checkLVal(expr, contextDescription, bindingType = BIND_NONE, checkClashes, disallowLetBinding, strictModeChanged = false) { - switch (expr.type) { - case "Identifier": - { - const { - name - } = expr; - - if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(name, this.inModule) : isStrictBindOnlyReservedWord(name))) { - this.raise(expr.start, bindingType === BIND_NONE ? ErrorMessages.StrictEvalArguments : ErrorMessages.StrictEvalArgumentsBinding, name); - } - - if (checkClashes) { - if (checkClashes.has(name)) { - this.raise(expr.start, ErrorMessages.ParamDupe); - } else { - checkClashes.add(name); - } - } - - if (disallowLetBinding && name === "let") { - this.raise(expr.start, ErrorMessages.LetInLexicalBinding); - } - - if (!(bindingType & BIND_NONE)) { - this.scope.declareName(name, bindingType, expr.start); - } - - break; - } - - case "MemberExpression": - if (bindingType !== BIND_NONE) { - this.raise(expr.start, ErrorMessages.InvalidPropertyBindingPattern); - } - - break; - - case "ObjectPattern": - for (let _i2 = 0, _expr$properties = expr.properties; _i2 < _expr$properties.length; _i2++) { - let prop = _expr$properties[_i2]; - if (this.isObjectProperty(prop)) prop = prop.value;else if (this.isObjectMethod(prop)) continue; - this.checkLVal(prop, "object destructuring pattern", bindingType, checkClashes, disallowLetBinding); - } - - break; - - case "ArrayPattern": - for (let _i3 = 0, _expr$elements = expr.elements; _i3 < _expr$elements.length; _i3++) { - const elem = _expr$elements[_i3]; - - if (elem) { - this.checkLVal(elem, "array destructuring pattern", bindingType, checkClashes, disallowLetBinding); - } - } - - break; - - case "AssignmentPattern": - this.checkLVal(expr.left, "assignment pattern", bindingType, checkClashes); - break; - - case "RestElement": - this.checkLVal(expr.argument, "rest element", bindingType, checkClashes); - break; - - case "ParenthesizedExpression": - this.checkLVal(expr.expression, "parenthesized expression", bindingType, checkClashes); - break; - - default: - { - this.raise(expr.start, bindingType === BIND_NONE ? ErrorMessages.InvalidLhs : ErrorMessages.InvalidLhsBinding, contextDescription); - } - } - } - - checkToRestConversion(node) { - if (node.argument.type !== "Identifier" && node.argument.type !== "MemberExpression") { - this.raise(node.argument.start, ErrorMessages.InvalidRestAssignmentPattern); - } - } - - checkCommaAfterRest(close) { - if (this.match(types.comma)) { - if (this.lookaheadCharCode() === close) { - this.raiseTrailingCommaAfterRest(this.state.start); - } else { - this.raiseRestNotLast(this.state.start); - } - } - } - - raiseRestNotLast(pos) { - throw this.raise(pos, ErrorMessages.ElementAfterRest); - } - - raiseTrailingCommaAfterRest(pos) { - this.raise(pos, ErrorMessages.RestTrailingComma); - } - -} - -class ExpressionParser extends LValParser { - checkProto(prop, isRecord, protoRef, refExpressionErrors) { - if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) { - return; - } - - const key = prop.key; - const name = key.type === "Identifier" ? key.name : key.value; - - if (name === "__proto__") { - if (isRecord) { - this.raise(key.start, ErrorMessages.RecordNoProto); - return; - } - - if (protoRef.used) { - if (refExpressionErrors) { - if (refExpressionErrors.doubleProto === -1) { - refExpressionErrors.doubleProto = key.start; - } - } else { - this.raise(key.start, ErrorMessages.DuplicateProto); - } - } - - protoRef.used = true; - } - } - - shouldExitDescending(expr, potentialArrowAt) { - return expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt; - } - - getExpression() { - let paramFlags = PARAM; - - if (this.hasPlugin("topLevelAwait") && this.inModule) { - paramFlags |= PARAM_AWAIT; - } - - this.scope.enter(SCOPE_PROGRAM); - this.prodParam.enter(paramFlags); - this.nextToken(); - const expr = this.parseExpression(); - - if (!this.match(types.eof)) { - this.unexpected(); - } - - expr.comments = this.state.comments; - expr.errors = this.state.errors; - return expr; - } - - parseExpression(disallowIn, refExpressionErrors) { - if (disallowIn) { - return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)); - } - - return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors)); - } - - parseExpressionBase(refExpressionErrors) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const expr = this.parseMaybeAssign(refExpressionErrors); - - if (this.match(types.comma)) { - const node = this.startNodeAt(startPos, startLoc); - node.expressions = [expr]; - - while (this.eat(types.comma)) { - node.expressions.push(this.parseMaybeAssign(refExpressionErrors)); - } - - this.toReferencedList(node.expressions); - return this.finishNode(node, "SequenceExpression"); - } - - return expr; - } - - parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse, refNeedsArrowPos) { - return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos)); - } - - parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse, refNeedsArrowPos) { - return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos)); - } - - parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - - if (this.isContextual("yield")) { - if (this.prodParam.hasYield) { - this.state.exprAllowed = true; - let left = this.parseYield(); - - if (afterLeftParse) { - left = afterLeftParse.call(this, left, startPos, startLoc); - } - - return left; - } - } - - let ownExpressionErrors; - - if (refExpressionErrors) { - ownExpressionErrors = false; - } else { - refExpressionErrors = new ExpressionErrors(); - ownExpressionErrors = true; - } - - if (this.match(types.parenL) || this.match(types.name)) { - this.state.potentialArrowAt = this.state.start; - } - - let left = this.parseMaybeConditional(refExpressionErrors, refNeedsArrowPos); - - if (afterLeftParse) { - left = afterLeftParse.call(this, left, startPos, startLoc); - } - - if (this.state.type.isAssign) { - const node = this.startNodeAt(startPos, startLoc); - const operator = this.state.value; - node.operator = operator; - - if (this.match(types.eq)) { - node.left = this.toAssignable(left, true); - refExpressionErrors.doubleProto = -1; - } else { - node.left = left; - } - - if (refExpressionErrors.shorthandAssign >= node.left.start) { - refExpressionErrors.shorthandAssign = -1; - } - - this.checkLVal(left, "assignment expression"); - this.next(); - node.right = this.parseMaybeAssign(); - return this.finishNode(node, "AssignmentExpression"); - } else if (ownExpressionErrors) { - this.checkExpressionErrors(refExpressionErrors, true); - } - - return left; - } - - parseMaybeConditional(refExpressionErrors, refNeedsArrowPos) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseExprOps(refExpressionErrors); - - if (this.shouldExitDescending(expr, potentialArrowAt)) { - return expr; - } - - return this.parseConditional(expr, startPos, startLoc, refNeedsArrowPos); - } - - parseConditional(expr, startPos, startLoc, refNeedsArrowPos) { - if (this.eat(types.question)) { - const node = this.startNodeAt(startPos, startLoc); - node.test = expr; - node.consequent = this.parseMaybeAssignAllowIn(); - this.expect(types.colon); - node.alternate = this.parseMaybeAssign(); - return this.finishNode(node, "ConditionalExpression"); - } - - return expr; - } - - parseExprOps(refExpressionErrors) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseMaybeUnary(refExpressionErrors); - - if (this.shouldExitDescending(expr, potentialArrowAt)) { - return expr; - } - - return this.parseExprOp(expr, startPos, startLoc, -1); - } - - parseExprOp(left, leftStartPos, leftStartLoc, minPrec) { - let prec = this.state.type.binop; - - if (prec != null && (this.prodParam.hasIn || !this.match(types._in))) { - if (prec > minPrec) { - const op = this.state.type; - - if (op === types.pipeline) { - this.expectPlugin("pipelineOperator"); - - if (this.state.inFSharpPipelineDirectBody) { - return left; - } - - this.state.inPipeline = true; - this.checkPipelineAtInfixOperator(left, leftStartPos); - } - - const node = this.startNodeAt(leftStartPos, leftStartLoc); - node.left = left; - node.operator = this.state.value; - - if (op === types.exponent && left.type === "UnaryExpression" && (this.options.createParenthesizedExpressions || !(left.extra && left.extra.parenthesized))) { - this.raise(left.argument.start, ErrorMessages.UnexpectedTokenUnaryExponentiation); - } - - const logical = op === types.logicalOR || op === types.logicalAND; - const coalesce = op === types.nullishCoalescing; - - if (coalesce) { - prec = types.logicalAND.binop; - } - - this.next(); - - if (op === types.pipeline && this.getPluginOption("pipelineOperator", "proposal") === "minimal") { - if (this.match(types.name) && this.state.value === "await" && this.prodParam.hasAwait) { - throw this.raise(this.state.start, ErrorMessages.UnexpectedAwaitAfterPipelineBody); - } - } - - node.right = this.parseExprOpRightExpr(op, prec); - this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression"); - const nextOp = this.state.type; - - if (coalesce && (nextOp === types.logicalOR || nextOp === types.logicalAND) || logical && nextOp === types.nullishCoalescing) { - throw this.raise(this.state.start, ErrorMessages.MixingCoalesceWithLogical); - } - - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec); - } - } - - return left; - } - - parseExprOpRightExpr(op, prec) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - - switch (op) { - case types.pipeline: - switch (this.getPluginOption("pipelineOperator", "proposal")) { - case "smart": - return this.withTopicPermittingContext(() => { - return this.parseSmartPipelineBody(this.parseExprOpBaseRightExpr(op, prec), startPos, startLoc); - }); - - case "fsharp": - return this.withSoloAwaitPermittingContext(() => { - return this.parseFSharpPipelineBody(prec); - }); - } - - default: - return this.parseExprOpBaseRightExpr(op, prec); - } - } - - parseExprOpBaseRightExpr(op, prec) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - return this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec); - } - - parseMaybeUnary(refExpressionErrors) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const isAwait = this.isContextual("await"); - - if (isAwait && this.isAwaitAllowed()) { - this.next(); - return this.parseAwait(startPos, startLoc); - } - - if (this.isContextual("module") && this.lookaheadCharCode() === 123 && !this.hasFollowingLineBreak()) { - return this.parseModuleExpression(); - } - - const update = this.match(types.incDec); - const node = this.startNode(); - - if (this.state.type.prefix) { - node.operator = this.state.value; - node.prefix = true; - - if (this.match(types._throw)) { - this.expectPlugin("throwExpressions"); - } - - const isDelete = this.match(types._delete); - this.next(); - node.argument = this.parseMaybeUnary(); - this.checkExpressionErrors(refExpressionErrors, true); - - if (this.state.strict && isDelete) { - const arg = node.argument; - - if (arg.type === "Identifier") { - this.raise(node.start, ErrorMessages.StrictDelete); - } else if (this.hasPropertyAsPrivateName(arg)) { - this.raise(node.start, ErrorMessages.DeletePrivateField); - } - } - - if (!update) { - return this.finishNode(node, "UnaryExpression"); - } - } - - const expr = this.parseUpdate(node, update, refExpressionErrors); - - if (isAwait) { - const startsExpr = this.hasPlugin("v8intrinsic") ? this.state.type.startsExpr : this.state.type.startsExpr && !this.match(types.modulo); - - if (startsExpr && !this.isAmbiguousAwait()) { - this.raiseOverwrite(startPos, this.hasPlugin("topLevelAwait") ? ErrorMessages.AwaitNotInAsyncContext : ErrorMessages.AwaitNotInAsyncFunction); - return this.parseAwait(startPos, startLoc); - } - } - - return expr; - } - - parseUpdate(node, update, refExpressionErrors) { - if (update) { - this.checkLVal(node.argument, "prefix operation"); - return this.finishNode(node, "UpdateExpression"); - } - - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let expr = this.parseExprSubscripts(refExpressionErrors); - if (this.checkExpressionErrors(refExpressionErrors, false)) return expr; - - while (this.state.type.postfix && !this.canInsertSemicolon()) { - const node = this.startNodeAt(startPos, startLoc); - node.operator = this.state.value; - node.prefix = false; - node.argument = expr; - this.checkLVal(expr, "postfix operation"); - this.next(); - expr = this.finishNode(node, "UpdateExpression"); - } - - return expr; - } - - parseExprSubscripts(refExpressionErrors) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseExprAtom(refExpressionErrors); - - if (this.shouldExitDescending(expr, potentialArrowAt)) { - return expr; - } - - return this.parseSubscripts(expr, startPos, startLoc); - } - - parseSubscripts(base, startPos, startLoc, noCalls) { - const state = { - optionalChainMember: false, - maybeAsyncArrow: this.atPossibleAsyncArrow(base), - stop: false - }; - - do { - base = this.parseSubscript(base, startPos, startLoc, noCalls, state); - state.maybeAsyncArrow = false; - } while (!state.stop); - - return base; - } - - parseSubscript(base, startPos, startLoc, noCalls, state) { - if (!noCalls && this.eat(types.doubleColon)) { - return this.parseBind(base, startPos, startLoc, noCalls, state); - } else if (this.match(types.backQuote)) { - return this.parseTaggedTemplateExpression(base, startPos, startLoc, state); - } - - let optional = false; - - if (this.match(types.questionDot)) { - if (noCalls && this.lookaheadCharCode() === 40) { - state.stop = true; - return base; - } - - state.optionalChainMember = optional = true; - this.next(); - } - - if (!noCalls && this.match(types.parenL)) { - return this.parseCoverCallAndAsyncArrowHead(base, startPos, startLoc, state, optional); - } else if (optional || this.match(types.bracketL) || this.eat(types.dot)) { - return this.parseMember(base, startPos, startLoc, state, optional); - } else { - state.stop = true; - return base; - } - } - - parseMember(base, startPos, startLoc, state, optional) { - const node = this.startNodeAt(startPos, startLoc); - const computed = this.eat(types.bracketL); - node.object = base; - node.computed = computed; - const property = computed ? this.parseExpression() : this.parseMaybePrivateName(true); - - if (this.isPrivateName(property)) { - if (node.object.type === "Super") { - this.raise(startPos, ErrorMessages.SuperPrivateField); - } - - this.classScope.usePrivateName(this.getPrivateNameSV(property), property.start); - } - - node.property = property; - - if (computed) { - this.expect(types.bracketR); - } - - if (state.optionalChainMember) { - node.optional = optional; - return this.finishNode(node, "OptionalMemberExpression"); - } else { - return this.finishNode(node, "MemberExpression"); - } - } - - parseBind(base, startPos, startLoc, noCalls, state) { - const node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.callee = this.parseNoCallExpr(); - state.stop = true; - return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls); - } - - parseCoverCallAndAsyncArrowHead(base, startPos, startLoc, state, optional) { - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - this.state.maybeInArrowParameters = true; - this.next(); - let node = this.startNodeAt(startPos, startLoc); - node.callee = base; - - if (state.maybeAsyncArrow) { - this.expressionScope.enter(newAsyncArrowScope()); - } - - if (state.optionalChainMember) { - node.optional = optional; - } - - if (optional) { - node.arguments = this.parseCallExpressionArguments(types.parenR, false); - } else { - node.arguments = this.parseCallExpressionArguments(types.parenR, state.maybeAsyncArrow, base.type === "Import", base.type !== "Super", node); - } - - this.finishCallExpression(node, state.optionalChainMember); - - if (state.maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) { - state.stop = true; - this.expressionScope.validateAsPattern(); - this.expressionScope.exit(); - node = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); - } else { - if (state.maybeAsyncArrow) { - this.expressionScope.exit(); - } - - this.toReferencedArguments(node); - } - - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - return node; - } - - toReferencedArguments(node, isParenthesizedExpr) { - this.toReferencedListDeep(node.arguments, isParenthesizedExpr); - } - - parseTaggedTemplateExpression(base, startPos, startLoc, state) { - const node = this.startNodeAt(startPos, startLoc); - node.tag = base; - node.quasi = this.parseTemplate(true); - - if (state.optionalChainMember) { - this.raise(startPos, ErrorMessages.OptionalChainingNoTemplate); - } - - return this.finishNode(node, "TaggedTemplateExpression"); - } - - atPossibleAsyncArrow(base) { - return base.type === "Identifier" && base.name === "async" && this.state.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt; - } - - finishCallExpression(node, optional) { - if (node.callee.type === "Import") { - if (node.arguments.length === 2) { - if (!this.hasPlugin("moduleAttributes")) { - this.expectPlugin("importAssertions"); - } - } - - if (node.arguments.length === 0 || node.arguments.length > 2) { - this.raise(node.start, ErrorMessages.ImportCallArity, this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? "one or two arguments" : "one argument"); - } else { - for (let _i = 0, _node$arguments = node.arguments; _i < _node$arguments.length; _i++) { - const arg = _node$arguments[_i]; - - if (arg.type === "SpreadElement") { - this.raise(arg.start, ErrorMessages.ImportCallSpreadArgument); - } - } - } - } - - return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression"); - } - - parseCallExpressionArguments(close, possibleAsyncArrow, dynamicImport, allowPlaceholder, nodeForExtra) { - const elts = []; - let first = true; - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = false; - - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(types.comma); - - if (this.match(close)) { - if (dynamicImport && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) { - this.raise(this.state.lastTokStart, ErrorMessages.ImportCallArgumentTrailingComma); - } - - if (nodeForExtra) { - this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart); - } - - this.next(); - break; - } - } - - elts.push(this.parseExprListItem(false, possibleAsyncArrow ? new ExpressionErrors() : undefined, possibleAsyncArrow ? { - start: 0 - } : undefined, allowPlaceholder)); - } - - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - return elts; - } - - shouldParseAsyncArrow() { - return this.match(types.arrow) && !this.canInsertSemicolon(); - } - - parseAsyncArrowFromCallExpression(node, call) { - var _call$extra; - - this.expect(types.arrow); - this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingComma); - return node; - } - - parseNoCallExpr() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); - } - - parseExprAtom(refExpressionErrors) { - if (this.state.type === types.slash) this.readRegexp(); - const canBeArrow = this.state.potentialArrowAt === this.state.start; - let node; - - switch (this.state.type) { - case types._super: - return this.parseSuper(); - - case types._import: - node = this.startNode(); - this.next(); - - if (this.match(types.dot)) { - return this.parseImportMetaProperty(node); - } - - if (!this.match(types.parenL)) { - this.raise(this.state.lastTokStart, ErrorMessages.UnsupportedImport); - } - - return this.finishNode(node, "Import"); - - case types._this: - node = this.startNode(); - this.next(); - return this.finishNode(node, "ThisExpression"); - - case types.name: - { - const containsEsc = this.state.containsEsc; - const id = this.parseIdentifier(); - - if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) { - if (this.match(types._function)) { - const last = this.state.context.length - 1; - - if (this.state.context[last] !== types$1.functionStatement) { - throw new Error("Internal error"); - } - - this.state.context[last] = types$1.functionExpression; - this.next(); - return this.parseFunction(this.startNodeAtNode(id), undefined, true); - } else if (this.match(types.name)) { - return this.parseAsyncArrowUnaryFunction(id); - } - } - - if (canBeArrow && this.match(types.arrow) && !this.canInsertSemicolon()) { - this.next(); - return this.parseArrowExpression(this.startNodeAtNode(id), [id], false); - } - - return id; - } - - case types._do: - { - return this.parseDo(); - } - - case types.regexp: - { - const value = this.state.value; - node = this.parseLiteral(value.value, "RegExpLiteral"); - node.pattern = value.pattern; - node.flags = value.flags; - return node; - } - - case types.num: - return this.parseLiteral(this.state.value, "NumericLiteral"); - - case types.bigint: - return this.parseLiteral(this.state.value, "BigIntLiteral"); - - case types.decimal: - return this.parseLiteral(this.state.value, "DecimalLiteral"); - - case types.string: - return this.parseLiteral(this.state.value, "StringLiteral"); - - case types._null: - node = this.startNode(); - this.next(); - return this.finishNode(node, "NullLiteral"); - - case types._true: - case types._false: - return this.parseBooleanLiteral(); - - case types.parenL: - return this.parseParenAndDistinguishExpression(canBeArrow); - - case types.bracketBarL: - case types.bracketHashL: - { - return this.parseArrayLike(this.state.type === types.bracketBarL ? types.bracketBarR : types.bracketR, false, true, refExpressionErrors); - } - - case types.bracketL: - { - return this.parseArrayLike(types.bracketR, true, false, refExpressionErrors); - } - - case types.braceBarL: - case types.braceHashL: - { - return this.parseObjectLike(this.state.type === types.braceBarL ? types.braceBarR : types.braceR, false, true, refExpressionErrors); - } - - case types.braceL: - { - return this.parseObjectLike(types.braceR, false, false, refExpressionErrors); - } - - case types._function: - return this.parseFunctionOrFunctionSent(); - - case types.at: - this.parseDecorators(); - - case types._class: - node = this.startNode(); - this.takeDecorators(node); - return this.parseClass(node, false); - - case types._new: - return this.parseNewOrNewTarget(); - - case types.backQuote: - return this.parseTemplate(false); - - case types.doubleColon: - { - node = this.startNode(); - this.next(); - node.object = null; - const callee = node.callee = this.parseNoCallExpr(); - - if (callee.type === "MemberExpression") { - return this.finishNode(node, "BindExpression"); - } else { - throw this.raise(callee.start, ErrorMessages.UnsupportedBind); - } - } - - case types.hash: - { - if (this.state.inPipeline) { - node = this.startNode(); - - if (this.getPluginOption("pipelineOperator", "proposal") !== "smart") { - this.raise(node.start, ErrorMessages.PrimaryTopicRequiresSmartPipeline); - } - - this.next(); - - if (!this.primaryTopicReferenceIsAllowedInCurrentTopicContext()) { - this.raise(node.start, ErrorMessages.PrimaryTopicNotAllowed); - } - - this.registerTopicReference(); - return this.finishNode(node, "PipelinePrimaryTopicReference"); - } - - const nextCh = this.input.codePointAt(this.state.end); - - if (isIdentifierStart(nextCh) || nextCh === 92) { - const start = this.state.start; - node = this.parseMaybePrivateName(true); - - if (this.match(types._in)) { - this.expectPlugin("privateIn"); - this.classScope.usePrivateName(this.getPrivateNameSV(node), node.start); - } else if (this.hasPlugin("privateIn")) { - this.raise(this.state.start, ErrorMessages.PrivateInExpectedIn, this.getPrivateNameSV(node)); - } else { - throw this.unexpected(start); - } - - return node; - } - } - - case types.relational: - { - if (this.state.value === "<") { - const lookaheadCh = this.input.codePointAt(this.nextTokenStart()); - - if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) { - this.expectOnePlugin(["jsx", "flow", "typescript"]); - } - } - } - - default: - throw this.unexpected(); - } - } - - parseAsyncArrowUnaryFunction(id) { - const node = this.startNodeAtNode(id); - this.prodParam.enter(functionFlags(true, this.prodParam.hasYield)); - const params = [this.parseIdentifier()]; - this.prodParam.exit(); - - if (this.hasPrecedingLineBreak()) { - this.raise(this.state.pos, ErrorMessages.LineTerminatorBeforeArrow); - } - - this.expect(types.arrow); - this.parseArrowExpression(node, params, true); - return node; - } - - parseDo() { - this.expectPlugin("doExpressions"); - const node = this.startNode(); - this.next(); - const oldLabels = this.state.labels; - this.state.labels = []; - node.body = this.parseBlock(); - this.state.labels = oldLabels; - return this.finishNode(node, "DoExpression"); - } - - parseSuper() { - const node = this.startNode(); - this.next(); - - if (this.match(types.parenL) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) { - this.raise(node.start, ErrorMessages.SuperNotAllowed); - } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) { - this.raise(node.start, ErrorMessages.UnexpectedSuper); - } - - if (!this.match(types.parenL) && !this.match(types.bracketL) && !this.match(types.dot)) { - this.raise(node.start, ErrorMessages.UnsupportedSuper); - } - - return this.finishNode(node, "Super"); - } - - parseBooleanLiteral() { - const node = this.startNode(); - node.value = this.match(types._true); - this.next(); - return this.finishNode(node, "BooleanLiteral"); - } - - parseMaybePrivateName(isPrivateNameAllowed) { - const isPrivate = this.match(types.hash); - - if (isPrivate) { - this.expectOnePlugin(["classPrivateProperties", "classPrivateMethods"]); - - if (!isPrivateNameAllowed) { - this.raise(this.state.pos, ErrorMessages.UnexpectedPrivateField); - } - - const node = this.startNode(); - this.next(); - this.assertNoSpace("Unexpected space between # and identifier"); - node.id = this.parseIdentifier(true); - return this.finishNode(node, "PrivateName"); - } else { - return this.parseIdentifier(true); - } - } - - parseFunctionOrFunctionSent() { - const node = this.startNode(); - this.next(); - - if (this.prodParam.hasYield && this.match(types.dot)) { - const meta = this.createIdentifier(this.startNodeAtNode(node), "function"); - this.next(); - return this.parseMetaProperty(node, meta, "sent"); - } - - return this.parseFunction(node); - } - - parseMetaProperty(node, meta, propertyName) { - node.meta = meta; - - if (meta.name === "function" && propertyName === "sent") { - if (this.isContextual(propertyName)) { - this.expectPlugin("functionSent"); - } else if (!this.hasPlugin("functionSent")) { - this.unexpected(); - } - } - - const containsEsc = this.state.containsEsc; - node.property = this.parseIdentifier(true); - - if (node.property.name !== propertyName || containsEsc) { - this.raise(node.property.start, ErrorMessages.UnsupportedMetaProperty, meta.name, propertyName); - } - - return this.finishNode(node, "MetaProperty"); - } - - parseImportMetaProperty(node) { - const id = this.createIdentifier(this.startNodeAtNode(node), "import"); - this.next(); - - if (this.isContextual("meta")) { - if (!this.inModule) { - this.raiseWithData(id.start, { - code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" - }, ErrorMessages.ImportMetaOutsideModule); - } - - this.sawUnambiguousESM = true; - } - - return this.parseMetaProperty(node, id, "meta"); - } - - parseLiteral(value, type, startPos, startLoc) { - startPos = startPos || this.state.start; - startLoc = startLoc || this.state.startLoc; - const node = this.startNodeAt(startPos, startLoc); - this.addExtra(node, "rawValue", value); - this.addExtra(node, "raw", this.input.slice(startPos, this.state.end)); - node.value = value; - this.next(); - return this.finishNode(node, type); - } - - parseParenAndDistinguishExpression(canBeArrow) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let val; - this.next(); - this.expressionScope.enter(newArrowHeadScope()); - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.maybeInArrowParameters = true; - this.state.inFSharpPipelineDirectBody = false; - const innerStartPos = this.state.start; - const innerStartLoc = this.state.startLoc; - const exprList = []; - const refExpressionErrors = new ExpressionErrors(); - const refNeedsArrowPos = { - start: 0 - }; - let first = true; - let spreadStart; - let optionalCommaStart; - - while (!this.match(types.parenR)) { - if (first) { - first = false; - } else { - this.expect(types.comma, refNeedsArrowPos.start || null); - - if (this.match(types.parenR)) { - optionalCommaStart = this.state.start; - break; - } - } - - if (this.match(types.ellipsis)) { - const spreadNodeStartPos = this.state.start; - const spreadNodeStartLoc = this.state.startLoc; - spreadStart = this.state.start; - exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartPos, spreadNodeStartLoc)); - this.checkCommaAfterRest(41); - break; - } else { - exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem, refNeedsArrowPos)); - } - } - - const innerEndPos = this.state.lastTokEnd; - const innerEndLoc = this.state.lastTokEndLoc; - this.expect(types.parenR); - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - let arrowNode = this.startNodeAt(startPos, startLoc); - - if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) { - this.expressionScope.validateAsPattern(); - this.expressionScope.exit(); - this.parseArrowExpression(arrowNode, exprList, false); - return arrowNode; - } - - this.expressionScope.exit(); - - if (!exprList.length) { - this.unexpected(this.state.lastTokStart); - } - - if (optionalCommaStart) this.unexpected(optionalCommaStart); - if (spreadStart) this.unexpected(spreadStart); - this.checkExpressionErrors(refExpressionErrors, true); - if (refNeedsArrowPos.start) this.unexpected(refNeedsArrowPos.start); - this.toReferencedListDeep(exprList, true); - - if (exprList.length > 1) { - val = this.startNodeAt(innerStartPos, innerStartLoc); - val.expressions = exprList; - this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); - } else { - val = exprList[0]; - } - - if (!this.options.createParenthesizedExpressions) { - this.addExtra(val, "parenthesized", true); - this.addExtra(val, "parenStart", startPos); - return val; - } - - const parenExpression = this.startNodeAt(startPos, startLoc); - parenExpression.expression = val; - this.finishNode(parenExpression, "ParenthesizedExpression"); - return parenExpression; - } - - shouldParseArrow() { - return !this.canInsertSemicolon(); - } - - parseArrow(node) { - if (this.eat(types.arrow)) { - return node; - } - } - - parseParenItem(node, startPos, startLoc) { - return node; - } - - parseNewOrNewTarget() { - const node = this.startNode(); - this.next(); - - if (this.match(types.dot)) { - const meta = this.createIdentifier(this.startNodeAtNode(node), "new"); - this.next(); - const metaProp = this.parseMetaProperty(node, meta, "target"); - - if (!this.scope.inNonArrowFunction && !this.scope.inClass) { - let error = ErrorMessages.UnexpectedNewTarget; - - if (this.hasPlugin("classProperties")) { - error += " or class properties"; - } - - this.raise(metaProp.start, error); - } - - return metaProp; - } - - return this.parseNew(node); - } - - parseNew(node) { - node.callee = this.parseNoCallExpr(); - - if (node.callee.type === "Import") { - this.raise(node.callee.start, ErrorMessages.ImportCallNotNewExpression); - } else if (this.isOptionalChain(node.callee)) { - this.raise(this.state.lastTokEnd, ErrorMessages.OptionalChainingNoNew); - } else if (this.eat(types.questionDot)) { - this.raise(this.state.start, ErrorMessages.OptionalChainingNoNew); - } - - this.parseNewArguments(node); - return this.finishNode(node, "NewExpression"); - } - - parseNewArguments(node) { - if (this.eat(types.parenL)) { - const args = this.parseExprList(types.parenR); - this.toReferencedList(args); - node.arguments = args; - } else { - node.arguments = []; - } - } - - parseTemplateElement(isTagged) { - const elem = this.startNode(); - - if (this.state.value === null) { - if (!isTagged) { - this.raise(this.state.start + 1, ErrorMessages.InvalidEscapeSequenceTemplate); - } - } - - elem.value = { - raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"), - cooked: this.state.value - }; - this.next(); - elem.tail = this.match(types.backQuote); - return this.finishNode(elem, "TemplateElement"); - } - - parseTemplate(isTagged) { - const node = this.startNode(); - this.next(); - node.expressions = []; - let curElt = this.parseTemplateElement(isTagged); - node.quasis = [curElt]; - - while (!curElt.tail) { - this.expect(types.dollarBraceL); - node.expressions.push(this.parseTemplateSubstitution()); - this.expect(types.braceR); - node.quasis.push(curElt = this.parseTemplateElement(isTagged)); - } - - this.next(); - return this.finishNode(node, "TemplateLiteral"); - } - - parseTemplateSubstitution() { - return this.parseExpression(); - } - - parseObjectLike(close, isPattern, isRecord, refExpressionErrors) { - if (isRecord) { - this.expectPlugin("recordAndTuple"); - } - - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = false; - const propHash = Object.create(null); - let first = true; - const node = this.startNode(); - node.properties = []; - this.next(); - - while (!this.match(close)) { - if (first) { - first = false; - } else { - this.expect(types.comma); - - if (this.match(close)) { - this.addExtra(node, "trailingComma", this.state.lastTokStart); - break; - } - } - - const prop = this.parsePropertyDefinition(isPattern, refExpressionErrors); - - if (!isPattern) { - this.checkProto(prop, isRecord, propHash, refExpressionErrors); - } - - if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") { - this.raise(prop.start, ErrorMessages.InvalidRecordProperty); - } - - if (prop.shorthand) { - this.addExtra(prop, "shorthand", true); - } - - node.properties.push(prop); - } - - this.state.exprAllowed = false; - this.next(); - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - let type = "ObjectExpression"; - - if (isPattern) { - type = "ObjectPattern"; - } else if (isRecord) { - type = "RecordExpression"; - } - - return this.finishNode(node, type); - } - - maybeAsyncOrAccessorProp(prop) { - return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(types.bracketL) || this.match(types.star)); - } - - parsePropertyDefinition(isPattern, refExpressionErrors) { - let decorators = []; - - if (this.match(types.at)) { - if (this.hasPlugin("decorators")) { - this.raise(this.state.start, ErrorMessages.UnsupportedPropertyDecorator); - } - - while (this.match(types.at)) { - decorators.push(this.parseDecorator()); - } - } - - const prop = this.startNode(); - let isGenerator = false; - let isAsync = false; - let isAccessor = false; - let startPos; - let startLoc; - - if (this.match(types.ellipsis)) { - if (decorators.length) this.unexpected(); - - if (isPattern) { - this.next(); - prop.argument = this.parseIdentifier(); - this.checkCommaAfterRest(125); - return this.finishNode(prop, "RestElement"); - } - - return this.parseSpread(); - } - - if (decorators.length) { - prop.decorators = decorators; - decorators = []; - } - - prop.method = false; - - if (isPattern || refExpressionErrors) { - startPos = this.state.start; - startLoc = this.state.startLoc; - } - - if (!isPattern) { - isGenerator = this.eat(types.star); - } - - const containsEsc = this.state.containsEsc; - const key = this.parsePropertyName(prop, false); - - if (!isPattern && !isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) { - const keyName = key.name; - - if (keyName === "async" && !this.hasPrecedingLineBreak()) { - isAsync = true; - isGenerator = this.eat(types.star); - this.parsePropertyName(prop, false); - } - - if (keyName === "get" || keyName === "set") { - isAccessor = true; - prop.kind = keyName; - - if (this.match(types.star)) { - isGenerator = true; - this.raise(this.state.pos, ErrorMessages.AccessorIsGenerator, keyName); - this.next(); - } - - this.parsePropertyName(prop, false); - } - } - - this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); - return prop; - } - - getGetterSetterExpectedParamCount(method) { - return method.kind === "get" ? 0 : 1; - } - - getObjectOrClassMethodParams(method) { - return method.params; - } - - checkGetterSetterParams(method) { - var _params; - - const paramCount = this.getGetterSetterExpectedParamCount(method); - const params = this.getObjectOrClassMethodParams(method); - const start = method.start; - - if (params.length !== paramCount) { - if (method.kind === "get") { - this.raise(start, ErrorMessages.BadGetterArity); - } else { - this.raise(start, ErrorMessages.BadSetterArity); - } - } - - if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") { - this.raise(start, ErrorMessages.BadSetterRestParameter); - } - } - - parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { - if (isAccessor) { - this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod"); - this.checkGetterSetterParams(prop); - return prop; - } - - if (isAsync || isGenerator || this.match(types.parenL)) { - if (isPattern) this.unexpected(); - prop.kind = "method"; - prop.method = true; - return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod"); - } - } - - parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) { - prop.shorthand = false; - - if (this.eat(types.colon)) { - prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors); - return this.finishNode(prop, "ObjectProperty"); - } - - if (!prop.computed && prop.key.type === "Identifier") { - this.checkReservedWord(prop.key.name, prop.key.start, true, false); - - if (isPattern) { - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); - } else if (this.match(types.eq) && refExpressionErrors) { - if (refExpressionErrors.shorthandAssign === -1) { - refExpressionErrors.shorthandAssign = this.state.start; - } - - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); - } else { - prop.value = prop.key.__clone(); - } - - prop.shorthand = true; - return this.finishNode(prop, "ObjectProperty"); - } - } - - parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { - const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors); - if (!node) this.unexpected(); - return node; - } - - parsePropertyName(prop, isPrivateNameAllowed) { - if (this.eat(types.bracketL)) { - prop.computed = true; - prop.key = this.parseMaybeAssignAllowIn(); - this.expect(types.bracketR); - } else { - const oldInPropertyName = this.state.inPropertyName; - this.state.inPropertyName = true; - prop.key = this.match(types.num) || this.match(types.string) || this.match(types.bigint) || this.match(types.decimal) ? this.parseExprAtom() : this.parseMaybePrivateName(isPrivateNameAllowed); - - if (!this.isPrivateName(prop.key)) { - prop.computed = false; - } - - this.state.inPropertyName = oldInPropertyName; - } - - return prop.key; - } - - initFunction(node, isAsync) { - node.id = null; - node.generator = false; - node.async = !!isAsync; - } - - parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { - this.initFunction(node, isAsync); - node.generator = !!isGenerator; - const allowModifiers = isConstructor; - this.scope.enter(SCOPE_FUNCTION | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); - this.prodParam.enter(functionFlags(isAsync, node.generator)); - this.parseFunctionParams(node, allowModifiers); - this.parseFunctionBodyAndFinish(node, type, true); - this.prodParam.exit(); - this.scope.exit(); - return node; - } - - parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { - if (isTuple) { - this.expectPlugin("recordAndTuple"); - } - - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = false; - const node = this.startNode(); - this.next(); - node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node); - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression"); - } - - parseArrowExpression(node, params, isAsync, trailingCommaPos) { - this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW); - let flags = functionFlags(isAsync, false); - - if (!this.match(types.bracketL) && this.prodParam.hasIn) { - flags |= PARAM_IN; - } - - this.prodParam.enter(flags); - this.initFunction(node, isAsync); - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - - if (params) { - this.state.maybeInArrowParameters = true; - this.setArrowFunctionParameters(node, params, trailingCommaPos); - } - - this.state.maybeInArrowParameters = false; - this.parseFunctionBody(node, true); - this.prodParam.exit(); - this.scope.exit(); - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - return this.finishNode(node, "ArrowFunctionExpression"); - } - - setArrowFunctionParameters(node, params, trailingCommaPos) { - node.params = this.toAssignableList(params, trailingCommaPos, false); - } - - parseFunctionBodyAndFinish(node, type, isMethod = false) { - this.parseFunctionBody(node, false, isMethod); - this.finishNode(node, type); - } - - parseFunctionBody(node, allowExpression, isMethod = false) { - const isExpression = allowExpression && !this.match(types.braceL); - this.expressionScope.enter(newExpressionScope()); - - if (isExpression) { - node.body = this.parseMaybeAssign(); - this.checkParams(node, false, allowExpression, false); - } else { - const oldStrict = this.state.strict; - const oldLabels = this.state.labels; - this.state.labels = []; - this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN); - node.body = this.parseBlock(true, false, hasStrictModeDirective => { - const nonSimple = !this.isSimpleParamList(node.params); - - if (hasStrictModeDirective && nonSimple) { - const errorPos = (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.end : node.start; - this.raise(errorPos, ErrorMessages.IllegalLanguageModeDirective); - } - - const strictModeChanged = !oldStrict && this.state.strict; - this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged); - - if (this.state.strict && node.id) { - this.checkLVal(node.id, "function name", BIND_OUTSIDE, undefined, undefined, strictModeChanged); - } - }); - this.prodParam.exit(); - this.expressionScope.exit(); - this.state.labels = oldLabels; - } - } - - isSimpleParamList(params) { - for (let i = 0, len = params.length; i < len; i++) { - if (params[i].type !== "Identifier") return false; - } - - return true; - } - - checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { - const checkClashes = new Set(); - - for (let _i2 = 0, _node$params = node.params; _i2 < _node$params.length; _i2++) { - const param = _node$params[_i2]; - this.checkLVal(param, "function parameter list", BIND_VAR, allowDuplicates ? null : checkClashes, undefined, strictModeChanged); - } - } - - parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) { - const elts = []; - let first = true; - - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(types.comma); - - if (this.match(close)) { - if (nodeForExtra) { - this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart); - } - - this.next(); - break; - } - } - - elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors)); - } - - return elts; - } - - parseExprListItem(allowEmpty, refExpressionErrors, refNeedsArrowPos, allowPlaceholder) { - let elt; - - if (this.match(types.comma)) { - if (!allowEmpty) { - this.raise(this.state.pos, ErrorMessages.UnexpectedToken, ","); - } - - elt = null; - } else if (this.match(types.ellipsis)) { - const spreadNodeStartPos = this.state.start; - const spreadNodeStartLoc = this.state.startLoc; - elt = this.parseParenItem(this.parseSpread(refExpressionErrors, refNeedsArrowPos), spreadNodeStartPos, spreadNodeStartLoc); - } else if (this.match(types.question)) { - this.expectPlugin("partialApplication"); - - if (!allowPlaceholder) { - this.raise(this.state.start, ErrorMessages.UnexpectedArgumentPlaceholder); - } - - const node = this.startNode(); - this.next(); - elt = this.finishNode(node, "ArgumentPlaceholder"); - } else { - elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem, refNeedsArrowPos); - } - - return elt; - } - - parseIdentifier(liberal) { - const node = this.startNode(); - const name = this.parseIdentifierName(node.start, liberal); - return this.createIdentifier(node, name); - } - - createIdentifier(node, name) { - node.name = name; - node.loc.identifierName = name; - return this.finishNode(node, "Identifier"); - } - - parseIdentifierName(pos, liberal) { - let name; - const { - start, - type - } = this.state; - - if (type === types.name) { - name = this.state.value; - } else if (type.keyword) { - name = type.keyword; - const curContext = this.curContext(); - - if ((type === types._class || type === types._function) && (curContext === types$1.functionStatement || curContext === types$1.functionExpression)) { - this.state.context.pop(); - } - } else { - throw this.unexpected(); - } - - if (liberal) { - this.state.type = types.name; - } else { - this.checkReservedWord(name, start, !!type.keyword, false); - } - - this.next(); - return name; - } - - checkReservedWord(word, startLoc, checkKeywords, isBinding) { - if (this.prodParam.hasYield && word === "yield") { - this.raise(startLoc, ErrorMessages.YieldBindingIdentifier); - return; - } - - if (word === "await") { - if (this.prodParam.hasAwait) { - this.raise(startLoc, ErrorMessages.AwaitBindingIdentifier); - return; - } else if (this.scope.inStaticBlock && !this.scope.inNonArrowFunction) { - this.raise(startLoc, ErrorMessages.AwaitBindingIdentifierInStaticBlock); - return; - } else { - this.expressionScope.recordAsyncArrowParametersError(startLoc, ErrorMessages.AwaitBindingIdentifier); - } - } - - if (this.scope.inClass && !this.scope.inNonArrowFunction && word === "arguments") { - this.raise(startLoc, ErrorMessages.ArgumentsInClass); - return; - } - - if (checkKeywords && isKeyword(word)) { - this.raise(startLoc, ErrorMessages.UnexpectedKeyword, word); - return; - } - - const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord; - - if (reservedTest(word, this.inModule)) { - this.raise(startLoc, ErrorMessages.UnexpectedReservedWord, word); - } - } - - isAwaitAllowed() { - if (this.prodParam.hasAwait) return true; - - if (this.options.allowAwaitOutsideFunction && !this.scope.inFunction) { - return true; - } - - return false; - } - - parseAwait(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - this.expressionScope.recordParameterInitializerError(node.start, ErrorMessages.AwaitExpressionFormalParameter); - - if (this.eat(types.star)) { - this.raise(node.start, ErrorMessages.ObsoleteAwaitStar); - } - - if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) { - if (this.isAmbiguousAwait()) { - this.ambiguousScriptDifferentAst = true; - } else { - this.sawUnambiguousESM = true; - } - } - - if (!this.state.soloAwait) { - node.argument = this.parseMaybeUnary(); - } - - return this.finishNode(node, "AwaitExpression"); - } - - isAmbiguousAwait() { - return this.hasPrecedingLineBreak() || this.match(types.plusMin) || this.match(types.parenL) || this.match(types.bracketL) || this.match(types.backQuote) || this.match(types.regexp) || this.match(types.slash) || this.hasPlugin("v8intrinsic") && this.match(types.modulo); - } - - parseYield() { - const node = this.startNode(); - this.expressionScope.recordParameterInitializerError(node.start, ErrorMessages.YieldInParameter); - this.next(); - - if (this.match(types.semi) || !this.match(types.star) && !this.state.type.startsExpr || this.hasPrecedingLineBreak()) { - node.delegate = false; - node.argument = null; - } else { - node.delegate = this.eat(types.star); - node.argument = this.parseMaybeAssign(); - } - - return this.finishNode(node, "YieldExpression"); - } - - checkPipelineAtInfixOperator(left, leftStartPos) { - if (this.getPluginOption("pipelineOperator", "proposal") === "smart") { - if (left.type === "SequenceExpression") { - this.raise(leftStartPos, ErrorMessages.PipelineHeadSequenceExpression); - } - } - } - - parseSmartPipelineBody(childExpression, startPos, startLoc) { - this.checkSmartPipelineBodyEarlyErrors(childExpression, startPos); - return this.parseSmartPipelineBodyInStyle(childExpression, startPos, startLoc); - } - - checkSmartPipelineBodyEarlyErrors(childExpression, startPos) { - if (this.match(types.arrow)) { - throw this.raise(this.state.start, ErrorMessages.PipelineBodyNoArrow); - } else if (childExpression.type === "SequenceExpression") { - this.raise(startPos, ErrorMessages.PipelineBodySequenceExpression); - } - } - - parseSmartPipelineBodyInStyle(childExpression, startPos, startLoc) { - const bodyNode = this.startNodeAt(startPos, startLoc); - const isSimpleReference = this.isSimpleReference(childExpression); - - if (isSimpleReference) { - bodyNode.callee = childExpression; - } else { - if (!this.topicReferenceWasUsedInCurrentTopicContext()) { - this.raise(startPos, ErrorMessages.PipelineTopicUnused); - } - - bodyNode.expression = childExpression; - } - - return this.finishNode(bodyNode, isSimpleReference ? "PipelineBareFunction" : "PipelineTopicExpression"); - } - - isSimpleReference(expression) { - switch (expression.type) { - case "MemberExpression": - return !expression.computed && this.isSimpleReference(expression.object); - - case "Identifier": - return true; - - default: - return false; - } - } - - withTopicPermittingContext(callback) { - const outerContextTopicState = this.state.topicContext; - this.state.topicContext = { - maxNumOfResolvableTopics: 1, - maxTopicIndex: null - }; - - try { - return callback(); - } finally { - this.state.topicContext = outerContextTopicState; - } - } - - withTopicForbiddingContext(callback) { - const outerContextTopicState = this.state.topicContext; - this.state.topicContext = { - maxNumOfResolvableTopics: 0, - maxTopicIndex: null - }; - - try { - return callback(); - } finally { - this.state.topicContext = outerContextTopicState; - } - } - - withSoloAwaitPermittingContext(callback) { - const outerContextSoloAwaitState = this.state.soloAwait; - this.state.soloAwait = true; - - try { - return callback(); - } finally { - this.state.soloAwait = outerContextSoloAwaitState; - } - } - - allowInAnd(callback) { - const flags = this.prodParam.currentFlags(); - const prodParamToSet = PARAM_IN & ~flags; - - if (prodParamToSet) { - this.prodParam.enter(flags | PARAM_IN); - - try { - return callback(); - } finally { - this.prodParam.exit(); - } - } - - return callback(); - } - - disallowInAnd(callback) { - const flags = this.prodParam.currentFlags(); - const prodParamToClear = PARAM_IN & flags; - - if (prodParamToClear) { - this.prodParam.enter(flags & ~PARAM_IN); - - try { - return callback(); - } finally { - this.prodParam.exit(); - } - } - - return callback(); - } - - registerTopicReference() { - this.state.topicContext.maxTopicIndex = 0; - } - - primaryTopicReferenceIsAllowedInCurrentTopicContext() { - return this.state.topicContext.maxNumOfResolvableTopics >= 1; - } - - topicReferenceWasUsedInCurrentTopicContext() { - return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0; - } - - parseFSharpPipelineBody(prec) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - this.state.potentialArrowAt = this.state.start; - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = true; - const ret = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, prec); - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - return ret; - } - - parseModuleExpression() { - this.expectPlugin("moduleBlocks"); - const node = this.startNode(); - this.next(); - this.eat(types.braceL); - const revertScopes = this.initializeScopes(true); - this.enterInitialScopes(); - const program = this.startNode(); - - try { - node.body = this.parseProgram(program, types.braceR, "module"); - } finally { - revertScopes(); - } - - this.eat(types.braceR); - return this.finishNode(node, "ModuleExpression"); - } - -} - -const loopLabel = { - kind: "loop" -}, - switchLabel = { - kind: "switch" -}; -const FUNC_NO_FLAGS = 0b000, - FUNC_STATEMENT = 0b001, - FUNC_HANGING_STATEMENT = 0b010, - FUNC_NULLABLE_ID = 0b100; -const loneSurrogate = /[\uD800-\uDFFF]/u; -class StatementParser extends ExpressionParser { - parseTopLevel(file, program) { - file.program = this.parseProgram(program); - file.comments = this.state.comments; - if (this.options.tokens) file.tokens = this.tokens; - return this.finishNode(file, "File"); - } - - parseProgram(program, end = types.eof, sourceType = this.options.sourceType) { - program.sourceType = sourceType; - program.interpreter = this.parseInterpreterDirective(); - this.parseBlockBody(program, true, true, end); - - if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) { - for (let _i = 0, _Array$from = Array.from(this.scope.undefinedExports); _i < _Array$from.length; _i++) { - const [name] = _Array$from[_i]; - const pos = this.scope.undefinedExports.get(name); - this.raise(pos, ErrorMessages.ModuleExportUndefined, name); - } - } - - return this.finishNode(program, "Program"); - } - - stmtToDirective(stmt) { - const expr = stmt.expression; - const directiveLiteral = this.startNodeAt(expr.start, expr.loc.start); - const directive = this.startNodeAt(stmt.start, stmt.loc.start); - const raw = this.input.slice(expr.start, expr.end); - const val = directiveLiteral.value = raw.slice(1, -1); - this.addExtra(directiveLiteral, "raw", raw); - this.addExtra(directiveLiteral, "rawValue", val); - directive.value = this.finishNodeAt(directiveLiteral, "DirectiveLiteral", expr.end, expr.loc.end); - return this.finishNodeAt(directive, "Directive", stmt.end, stmt.loc.end); - } - - parseInterpreterDirective() { - if (!this.match(types.interpreterDirective)) { - return null; - } - - const node = this.startNode(); - node.value = this.state.value; - this.next(); - return this.finishNode(node, "InterpreterDirective"); - } - - isLet(context) { - if (!this.isContextual("let")) { - return false; - } - - const next = this.nextTokenStart(); - const nextCh = this.input.charCodeAt(next); - if (nextCh === 91) return true; - if (context) return false; - if (nextCh === 123) return true; - - if (isIdentifierStart(nextCh)) { - let pos = next + 1; - - while (isIdentifierChar(this.input.charCodeAt(pos))) { - ++pos; - } - - const ident = this.input.slice(next, pos); - if (!keywordRelationalOperator.test(ident)) return true; - } - - return false; - } - - parseStatement(context, topLevel) { - if (this.match(types.at)) { - this.parseDecorators(true); - } - - return this.parseStatementContent(context, topLevel); - } - - parseStatementContent(context, topLevel) { - let starttype = this.state.type; - const node = this.startNode(); - let kind; - - if (this.isLet(context)) { - starttype = types._var; - kind = "let"; - } - - 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: - if (this.lookaheadCharCode() === 46) break; - - if (context) { - if (this.state.strict) { - this.raise(this.state.start, ErrorMessages.StrictFunction); - } else if (context !== "if" && context !== "label") { - this.raise(this.state.start, ErrorMessages.SloppyFunction); - } - } - - 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.state.value; - - if (context && kind !== "var") { - this.raise(this.state.start, ErrorMessages.UnexpectedLexicalDeclaration); - } - - 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(); - - case types.semi: - return this.parseEmptyStatement(node); - - case types._import: - { - const nextTokenCharCode = this.lookaheadCharCode(); - - if (nextTokenCharCode === 40 || nextTokenCharCode === 46) { - break; - } - } - - case types._export: - { - if (!this.options.allowImportExportEverywhere && !topLevel) { - this.raise(this.state.start, ErrorMessages.UnexpectedImportExport); - } - - this.next(); - let result; - - if (starttype === types._import) { - result = this.parseImport(node); - - if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) { - this.sawUnambiguousESM = true; - } - } else { - result = this.parseExport(node); - - if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") { - this.sawUnambiguousESM = true; - } - } - - this.assertModuleNodeAllowed(node); - return result; - } - - default: - { - if (this.isAsyncFunction()) { - if (context) { - this.raise(this.state.start, ErrorMessages.AsyncFunctionInSingleStatementContext); - } - - this.next(); - return this.parseFunctionStatement(node, true, !context); - } - } - } - - const maybeName = this.state.value; - const 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); - } - } - - assertModuleNodeAllowed(node) { - if (!this.options.allowImportExportEverywhere && !this.inModule) { - this.raiseWithData(node.start, { - code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" - }, ErrorMessages.ImportOutsideModule); - } - } - - takeDecorators(node) { - const decorators = this.state.decoratorStack[this.state.decoratorStack.length - 1]; - - if (decorators.length) { - node.decorators = decorators; - this.resetStartLocationFromNode(node, decorators[0]); - this.state.decoratorStack[this.state.decoratorStack.length - 1] = []; - } - } - - canHaveLeadingDecorator() { - return this.match(types._class); - } - - parseDecorators(allowExport) { - const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1]; - - while (this.match(types.at)) { - const decorator = this.parseDecorator(); - currentContextDecorators.push(decorator); - } - - if (this.match(types._export)) { - if (!allowExport) { - this.unexpected(); - } - - if (this.hasPlugin("decorators") && !this.getPluginOption("decorators", "decoratorsBeforeExport")) { - this.raise(this.state.start, ErrorMessages.DecoratorExportClass); - } - } else if (!this.canHaveLeadingDecorator()) { - throw this.raise(this.state.start, ErrorMessages.UnexpectedLeadingDecorator); - } - } - - parseDecorator() { - this.expectOnePlugin(["decorators-legacy", "decorators"]); - const node = this.startNode(); - this.next(); - - if (this.hasPlugin("decorators")) { - this.state.decoratorStack.push([]); - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let expr; - - if (this.eat(types.parenL)) { - expr = this.parseExpression(); - this.expect(types.parenR); - } else { - expr = this.parseIdentifier(false); - - while (this.eat(types.dot)) { - const node = this.startNodeAt(startPos, startLoc); - node.object = expr; - node.property = this.parseIdentifier(true); - node.computed = false; - expr = this.finishNode(node, "MemberExpression"); - } - } - - node.expression = this.parseMaybeDecoratorArguments(expr); - this.state.decoratorStack.pop(); - } else { - node.expression = this.parseExprSubscripts(); - } - - return this.finishNode(node, "Decorator"); - } - - parseMaybeDecoratorArguments(expr) { - if (this.eat(types.parenL)) { - const node = this.startNodeAtNode(expr); - node.callee = expr; - node.arguments = this.parseCallExpressionArguments(types.parenR, false); - this.toReferencedList(node.arguments); - return this.finishNode(node, "CallExpression"); - } - - return expr; - } - - parseBreakContinueStatement(node, keyword) { - const isBreak = keyword === "break"; - this.next(); - - if (this.isLineTerminator()) { - node.label = null; - } else { - node.label = this.parseIdentifier(); - this.semicolon(); - } - - this.verifyBreakContinue(node, keyword); - return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); - } - - verifyBreakContinue(node, keyword) { - const isBreak = keyword === "break"; - let i; - - for (i = 0; i < this.state.labels.length; ++i) { - const lab = this.state.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.state.labels.length) { - this.raise(node.start, ErrorMessages.IllegalBreakContinue, keyword); - } - } - - parseDebuggerStatement(node) { - this.next(); - this.semicolon(); - return this.finishNode(node, "DebuggerStatement"); - } - - parseHeaderExpression() { - this.expect(types.parenL); - const val = this.parseExpression(); - this.expect(types.parenR); - return val; - } - - parseDoStatement(node) { - this.next(); - this.state.labels.push(loopLabel); - node.body = this.withTopicForbiddingContext(() => this.parseStatement("do")); - this.state.labels.pop(); - this.expect(types._while); - node.test = this.parseHeaderExpression(); - this.eat(types.semi); - return this.finishNode(node, "DoWhileStatement"); - } - - parseForStatement(node) { - this.next(); - this.state.labels.push(loopLabel); - let awaitAt = -1; - - if (this.isAwaitAllowed() && this.eatContextual("await")) { - awaitAt = this.state.lastTokStart; - } - - this.scope.enter(SCOPE_OTHER); - this.expect(types.parenL); - - if (this.match(types.semi)) { - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - - return this.parseFor(node, null); - } - - const isLet = this.isLet(); - - if (this.match(types._var) || this.match(types._const) || isLet) { - const init = this.startNode(); - const kind = isLet ? "let" : this.state.value; - this.next(); - this.parseVar(init, true, kind); - this.finishNode(init, "VariableDeclaration"); - - if ((this.match(types._in) || this.isContextual("of")) && init.declarations.length === 1) { - return this.parseForIn(node, init, awaitAt); - } - - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - - return this.parseFor(node, init); - } - - const refExpressionErrors = new ExpressionErrors(); - const init = this.parseExpression(true, refExpressionErrors); - - if (this.match(types._in) || this.isContextual("of")) { - this.toAssignable(init, true); - const description = this.isContextual("of") ? "for-of statement" : "for-in statement"; - this.checkLVal(init, description); - return this.parseForIn(node, init, awaitAt); - } else { - this.checkExpressionErrors(refExpressionErrors, true); - } - - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - - return this.parseFor(node, init); - } - - parseFunctionStatement(node, isAsync, declarationPosition) { - this.next(); - return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), isAsync); - } - - parseIfStatement(node) { - this.next(); - node.test = this.parseHeaderExpression(); - node.consequent = this.parseStatement("if"); - node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; - return this.finishNode(node, "IfStatement"); - } - - parseReturnStatement(node) { - if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) { - this.raise(this.state.start, ErrorMessages.IllegalReturn); - } - - this.next(); - - if (this.isLineTerminator()) { - node.argument = null; - } else { - node.argument = this.parseExpression(); - this.semicolon(); - } - - return this.finishNode(node, "ReturnStatement"); - } - - parseSwitchStatement(node) { - this.next(); - node.discriminant = this.parseHeaderExpression(); - const cases = node.cases = []; - this.expect(types.braceL); - this.state.labels.push(switchLabel); - this.scope.enter(SCOPE_OTHER); - let cur; - - for (let sawDefault; !this.match(types.braceR);) { - if (this.match(types._case) || this.match(types._default)) { - const isCase = this.match(types._case); - if (cur) this.finishNode(cur, "SwitchCase"); - cases.push(cur = this.startNode()); - cur.consequent = []; - this.next(); - - if (isCase) { - cur.test = this.parseExpression(); - } else { - if (sawDefault) { - this.raise(this.state.lastTokStart, ErrorMessages.MultipleDefaultsInSwitch); - } - - sawDefault = true; - cur.test = null; - } - - this.expect(types.colon); - } else { - if (cur) { - cur.consequent.push(this.parseStatement(null)); - } else { - this.unexpected(); - } - } - } - - this.scope.exit(); - if (cur) this.finishNode(cur, "SwitchCase"); - this.next(); - this.state.labels.pop(); - return this.finishNode(node, "SwitchStatement"); - } - - parseThrowStatement(node) { - this.next(); - - if (this.hasPrecedingLineBreak()) { - this.raise(this.state.lastTokEnd, ErrorMessages.NewlineAfterThrow); - } - - node.argument = this.parseExpression(); - this.semicolon(); - return this.finishNode(node, "ThrowStatement"); - } - - parseCatchClauseParam() { - const param = this.parseBindingAtom(); - const simple = param.type === "Identifier"; - this.scope.enter(simple ? SCOPE_SIMPLE_CATCH : 0); - this.checkLVal(param, "catch clause", BIND_LEXICAL); - return param; - } - - parseTryStatement(node) { - this.next(); - node.block = this.parseBlock(); - node.handler = null; - - if (this.match(types._catch)) { - const clause = this.startNode(); - this.next(); - - if (this.match(types.parenL)) { - this.expect(types.parenL); - clause.param = this.parseCatchClauseParam(); - this.expect(types.parenR); - } else { - clause.param = null; - this.scope.enter(SCOPE_OTHER); - } - - clause.body = this.withTopicForbiddingContext(() => this.parseBlock(false, false)); - this.scope.exit(); - node.handler = this.finishNode(clause, "CatchClause"); - } - - node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; - - if (!node.handler && !node.finalizer) { - this.raise(node.start, ErrorMessages.NoCatchOrFinally); - } - - return this.finishNode(node, "TryStatement"); - } - - parseVarStatement(node, kind) { - this.next(); - this.parseVar(node, false, kind); - this.semicolon(); - return this.finishNode(node, "VariableDeclaration"); - } - - parseWhileStatement(node) { - this.next(); - node.test = this.parseHeaderExpression(); - this.state.labels.push(loopLabel); - node.body = this.withTopicForbiddingContext(() => this.parseStatement("while")); - this.state.labels.pop(); - return this.finishNode(node, "WhileStatement"); - } - - parseWithStatement(node) { - if (this.state.strict) { - this.raise(this.state.start, ErrorMessages.StrictWith); - } - - this.next(); - node.object = this.parseHeaderExpression(); - node.body = this.withTopicForbiddingContext(() => this.parseStatement("with")); - return this.finishNode(node, "WithStatement"); - } - - parseEmptyStatement(node) { - this.next(); - return this.finishNode(node, "EmptyStatement"); - } - - parseLabeledStatement(node, maybeName, expr, context) { - for (let _i2 = 0, _this$state$labels = this.state.labels; _i2 < _this$state$labels.length; _i2++) { - const label = _this$state$labels[_i2]; - - if (label.name === maybeName) { - this.raise(expr.start, ErrorMessages.LabelRedeclaration, maybeName); - } - } - - const kind = this.state.type.isLoop ? "loop" : this.match(types._switch) ? "switch" : null; - - for (let i = this.state.labels.length - 1; i >= 0; i--) { - const label = this.state.labels[i]; - - if (label.statementStart === node.start) { - label.statementStart = this.state.start; - label.kind = kind; - } else { - break; - } - } - - this.state.labels.push({ - name: maybeName, - kind: kind, - statementStart: this.state.start - }); - node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); - this.state.labels.pop(); - node.label = expr; - return this.finishNode(node, "LabeledStatement"); - } - - parseExpressionStatement(node, expr) { - node.expression = expr; - this.semicolon(); - return this.finishNode(node, "ExpressionStatement"); - } - - parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) { - const node = this.startNode(); - - if (allowDirectives) { - this.state.strictErrors.clear(); - } - - this.expect(types.braceL); - - if (createNewLexicalScope) { - this.scope.enter(SCOPE_OTHER); - } - - this.parseBlockBody(node, allowDirectives, false, types.braceR, afterBlockParse); - - if (createNewLexicalScope) { - this.scope.exit(); - } - - return this.finishNode(node, "BlockStatement"); - } - - isValidDirective(stmt) { - return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized; - } - - parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { - const body = node.body = []; - const directives = node.directives = []; - this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse); - } - - parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) { - const oldStrict = this.state.strict; - let hasStrictModeDirective = false; - let parsedNonDirective = false; - - while (!this.match(end)) { - const stmt = this.parseStatement(null, topLevel); - - if (directives && !parsedNonDirective) { - if (this.isValidDirective(stmt)) { - const directive = this.stmtToDirective(stmt); - directives.push(directive); - - if (!hasStrictModeDirective && directive.value.value === "use strict") { - hasStrictModeDirective = true; - this.setStrict(true); - } - - continue; - } - - parsedNonDirective = true; - this.state.strictErrors.clear(); - } - - body.push(stmt); - } - - if (afterBlockParse) { - afterBlockParse.call(this, hasStrictModeDirective); - } - - if (!oldStrict) { - this.setStrict(false); - } - - this.next(); - } - - parseFor(node, init) { - node.init = init; - this.semicolon(false); - node.test = this.match(types.semi) ? null : this.parseExpression(); - this.semicolon(false); - node.update = this.match(types.parenR) ? null : this.parseExpression(); - this.expect(types.parenR); - node.body = this.withTopicForbiddingContext(() => this.parseStatement("for")); - this.scope.exit(); - this.state.labels.pop(); - return this.finishNode(node, "ForStatement"); - } - - parseForIn(node, init, awaitAt) { - const isForIn = this.match(types._in); - this.next(); - - if (isForIn) { - if (awaitAt > -1) this.unexpected(awaitAt); - } else { - node.await = awaitAt > -1; - } - - if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { - this.raise(init.start, ErrorMessages.ForInOfLoopInitializer, isForIn ? "for-in" : "for-of"); - } else if (init.type === "AssignmentPattern") { - this.raise(init.start, ErrorMessages.InvalidLhs, "for-loop"); - } - - node.left = init; - node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn(); - this.expect(types.parenR); - node.body = this.withTopicForbiddingContext(() => this.parseStatement("for")); - this.scope.exit(); - this.state.labels.pop(); - return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); - } - - parseVar(node, isFor, kind) { - const declarations = node.declarations = []; - const isTypescript = this.hasPlugin("typescript"); - node.kind = kind; - - for (;;) { - const decl = this.startNode(); - this.parseVarId(decl, kind); - - if (this.eat(types.eq)) { - decl.init = isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn(); - } else { - if (kind === "const" && !(this.match(types._in) || this.isContextual("of"))) { - if (!isTypescript) { - this.raise(this.state.lastTokEnd, ErrorMessages.DeclarationMissingInitializer, "Const declarations"); - } - } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(types._in) || this.isContextual("of")))) { - this.raise(this.state.lastTokEnd, ErrorMessages.DeclarationMissingInitializer, "Complex binding patterns"); - } - - decl.init = null; - } - - declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(types.comma)) break; - } - - return node; - } - - parseVarId(decl, kind) { - decl.id = this.parseBindingAtom(); - this.checkLVal(decl.id, "variable declaration", kind === "var" ? BIND_VAR : BIND_LEXICAL, undefined, kind !== "var"); - } - - parseFunction(node, statement = FUNC_NO_FLAGS, isAsync = false) { - const isStatement = statement & FUNC_STATEMENT; - const isHangingStatement = statement & FUNC_HANGING_STATEMENT; - const requireId = !!isStatement && !(statement & FUNC_NULLABLE_ID); - this.initFunction(node, isAsync); - - if (this.match(types.star) && isHangingStatement) { - this.raise(this.state.start, ErrorMessages.GeneratorInSingleStatementContext); - } - - node.generator = this.eat(types.star); - - if (isStatement) { - node.id = this.parseFunctionId(requireId); - } - - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - this.state.maybeInArrowParameters = false; - this.scope.enter(SCOPE_FUNCTION); - this.prodParam.enter(functionFlags(isAsync, node.generator)); - - if (!isStatement) { - node.id = this.parseFunctionId(); - } - - this.parseFunctionParams(node, false); - this.withTopicForbiddingContext(() => { - this.parseFunctionBodyAndFinish(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); - }); - this.prodParam.exit(); - this.scope.exit(); - - if (isStatement && !isHangingStatement) { - this.registerFunctionStatementId(node); - } - - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - return node; - } - - parseFunctionId(requireId) { - return requireId || this.match(types.name) ? this.parseIdentifier() : null; - } - - parseFunctionParams(node, allowModifiers) { - this.expect(types.parenL); - this.expressionScope.enter(newParameterDeclarationScope()); - node.params = this.parseBindingList(types.parenR, 41, false, allowModifiers); - this.expressionScope.exit(); - } - - registerFunctionStatementId(node) { - if (!node.id) return; - this.scope.declareName(node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.start); - } - - parseClass(node, isStatement, optionalId) { - this.next(); - this.takeDecorators(node); - const oldStrict = this.state.strict; - this.state.strict = true; - this.parseClassId(node, isStatement, optionalId); - this.parseClassSuper(node); - node.body = this.parseClassBody(!!node.superClass, oldStrict); - return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); - } - - isClassProperty() { - return this.match(types.eq) || this.match(types.semi) || this.match(types.braceR); - } - - isClassMethod() { - return this.match(types.parenL); - } - - isNonstaticConstructor(method) { - return !method.computed && !method.static && (method.key.name === "constructor" || method.key.value === "constructor"); - } - - parseClassBody(constructorAllowsSuper, oldStrict) { - this.classScope.enter(); - const state = { - constructorAllowsSuper, - hadConstructor: false, - hadStaticBlock: false - }; - let decorators = []; - const classBody = this.startNode(); - classBody.body = []; - this.expect(types.braceL); - this.withTopicForbiddingContext(() => { - while (!this.match(types.braceR)) { - if (this.eat(types.semi)) { - if (decorators.length > 0) { - throw this.raise(this.state.lastTokEnd, ErrorMessages.DecoratorSemicolon); - } - - continue; - } - - if (this.match(types.at)) { - decorators.push(this.parseDecorator()); - continue; - } - - const member = this.startNode(); - - if (decorators.length) { - member.decorators = decorators; - this.resetStartLocationFromNode(member, decorators[0]); - decorators = []; - } - - this.parseClassMember(classBody, member, state); - - if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) { - this.raise(member.start, ErrorMessages.DecoratorConstructor); - } - } - }); - this.state.strict = oldStrict; - this.next(); - - if (decorators.length) { - throw this.raise(this.state.start, ErrorMessages.TrailingDecorator); - } - - this.classScope.exit(); - return this.finishNode(classBody, "ClassBody"); - } - - parseClassMemberFromModifier(classBody, member) { - const key = this.parseIdentifier(true); - - if (this.isClassMethod()) { - const method = member; - method.kind = "method"; - method.computed = false; - method.key = key; - method.static = false; - this.pushClassMethod(classBody, method, false, false, false, false); - return true; - } else if (this.isClassProperty()) { - const prop = member; - prop.computed = false; - prop.key = key; - prop.static = false; - classBody.body.push(this.parseClassProperty(prop)); - return true; - } - - return false; - } - - parseClassMember(classBody, member, state) { - const isStatic = this.isContextual("static"); - - if (isStatic) { - if (this.parseClassMemberFromModifier(classBody, member)) { - return; - } - - if (this.eat(types.braceL)) { - this.parseClassStaticBlock(classBody, member, state); - return; - } - } - - this.parseClassMemberWithIsStatic(classBody, member, state, isStatic); - } - - parseClassMemberWithIsStatic(classBody, member, state, isStatic) { - const publicMethod = member; - const privateMethod = member; - const publicProp = member; - const privateProp = member; - const method = publicMethod; - const publicMember = publicMethod; - member.static = isStatic; - - if (this.eat(types.star)) { - method.kind = "method"; - this.parseClassElementName(method); - - if (this.isPrivateName(method.key)) { - this.pushClassPrivateMethod(classBody, privateMethod, true, false); - return; - } - - if (this.isNonstaticConstructor(publicMethod)) { - this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsGenerator); - } - - this.pushClassMethod(classBody, publicMethod, true, false, false, false); - return; - } - - const containsEsc = this.state.containsEsc; - const key = this.parseClassElementName(member); - const isPrivate = this.isPrivateName(key); - const isSimple = key.type === "Identifier"; - const maybeQuestionTokenStart = this.state.start; - this.parsePostMemberNameModifiers(publicMember); - - if (this.isClassMethod()) { - method.kind = "method"; - - if (isPrivate) { - this.pushClassPrivateMethod(classBody, privateMethod, false, false); - return; - } - - const isConstructor = this.isNonstaticConstructor(publicMethod); - let allowsDirectSuper = false; - - if (isConstructor) { - publicMethod.kind = "constructor"; - - if (state.hadConstructor && !this.hasPlugin("typescript")) { - this.raise(key.start, ErrorMessages.DuplicateConstructor); - } - - state.hadConstructor = true; - allowsDirectSuper = state.constructorAllowsSuper; - } - - this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper); - } else if (this.isClassProperty()) { - if (isPrivate) { - this.pushClassPrivateProperty(classBody, privateProp); - } else { - this.pushClassProperty(classBody, publicProp); - } - } else if (isSimple && key.name === "async" && !containsEsc && !this.isLineTerminator()) { - const isGenerator = this.eat(types.star); - - if (publicMember.optional) { - this.unexpected(maybeQuestionTokenStart); - } - - method.kind = "method"; - this.parseClassElementName(method); - this.parsePostMemberNameModifiers(publicMember); - - if (this.isPrivateName(method.key)) { - this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true); - } else { - if (this.isNonstaticConstructor(publicMethod)) { - this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsAsync); - } - - this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false); - } - } else if (isSimple && (key.name === "get" || key.name === "set") && !containsEsc && !(this.match(types.star) && this.isLineTerminator())) { - method.kind = key.name; - this.parseClassElementName(publicMethod); - - if (this.isPrivateName(method.key)) { - this.pushClassPrivateMethod(classBody, privateMethod, false, false); - } else { - if (this.isNonstaticConstructor(publicMethod)) { - this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsAccessor); - } - - this.pushClassMethod(classBody, publicMethod, false, false, false, false); - } - - this.checkGetterSetterParams(publicMethod); - } else if (this.isLineTerminator()) { - if (isPrivate) { - this.pushClassPrivateProperty(classBody, privateProp); - } else { - this.pushClassProperty(classBody, publicProp); - } - } else { - this.unexpected(); - } - } - - parseClassElementName(member) { - const key = this.parsePropertyName(member, true); - - if (!member.computed && member.static && (key.name === "prototype" || key.value === "prototype")) { - this.raise(key.start, ErrorMessages.StaticPrototype); - } - - if (this.isPrivateName(key) && this.getPrivateNameSV(key) === "constructor") { - this.raise(key.start, ErrorMessages.ConstructorClassPrivateField); - } - - return key; - } - - parseClassStaticBlock(classBody, member, state) { - var _member$decorators; - - this.expectPlugin("classStaticBlock", member.start); - this.scope.enter(SCOPE_CLASS | SCOPE_STATIC_BLOCK | SCOPE_SUPER); - const oldLabels = this.state.labels; - this.state.labels = []; - this.prodParam.enter(PARAM); - const body = member.body = []; - this.parseBlockOrModuleBlockBody(body, undefined, false, types.braceR); - this.prodParam.exit(); - this.scope.exit(); - this.state.labels = oldLabels; - classBody.body.push(this.finishNode(member, "StaticBlock")); - - if (state.hadStaticBlock) { - this.raise(member.start, ErrorMessages.DuplicateStaticBlock); - } - - if ((_member$decorators = member.decorators) == null ? void 0 : _member$decorators.length) { - this.raise(member.start, ErrorMessages.DecoratorStaticBlock); - } - - state.hadStaticBlock = true; - } - - pushClassProperty(classBody, prop) { - if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) { - this.raise(prop.key.start, ErrorMessages.ConstructorClassField); - } - - classBody.body.push(this.parseClassProperty(prop)); - } - - pushClassPrivateProperty(classBody, prop) { - this.expectPlugin("classPrivateProperties", prop.key.start); - const node = this.parseClassPrivateProperty(prop); - classBody.body.push(node); - this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.start); - } - - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true)); - } - - pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { - this.expectPlugin("classPrivateMethods", method.key.start); - const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true); - classBody.body.push(node); - const kind = node.kind === "get" ? node.static ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" ? node.static ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER; - this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.start); - } - - parsePostMemberNameModifiers(methodOrProp) {} - - parseClassPrivateProperty(node) { - this.parseInitializer(node); - this.semicolon(); - return this.finishNode(node, "ClassPrivateProperty"); - } - - parseClassProperty(node) { - if (!node.typeAnnotation || this.match(types.eq)) { - this.expectPlugin("classProperties"); - } - - this.parseInitializer(node); - this.semicolon(); - return this.finishNode(node, "ClassProperty"); - } - - parseInitializer(node) { - this.scope.enter(SCOPE_CLASS | SCOPE_SUPER); - this.expressionScope.enter(newExpressionScope()); - this.prodParam.enter(PARAM); - node.value = this.eat(types.eq) ? this.parseMaybeAssignAllowIn() : null; - this.expressionScope.exit(); - this.prodParam.exit(); - this.scope.exit(); - } - - parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS) { - if (this.match(types.name)) { - node.id = this.parseIdentifier(); - - if (isStatement) { - this.checkLVal(node.id, "class name", bindingType); - } - } else { - if (optionalId || !isStatement) { - node.id = null; - } else { - this.unexpected(null, ErrorMessages.MissingClassName); - } - } - } - - parseClassSuper(node) { - node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null; - } - - parseExport(node) { - const hasDefault = this.maybeParseExportDefaultSpecifier(node); - const parseAfterDefault = !hasDefault || this.eat(types.comma); - const hasStar = parseAfterDefault && this.eatExportStar(node); - const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node); - const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(types.comma)); - const isFromRequired = hasDefault || hasStar; - - if (hasStar && !hasNamespace) { - if (hasDefault) this.unexpected(); - this.parseExportFrom(node, true); - return this.finishNode(node, "ExportAllDeclaration"); - } - - const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node); - - if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers || hasNamespace && parseAfterNamespace && !hasSpecifiers) { - throw this.unexpected(null, types.braceL); - } - - let hasDeclaration; - - if (isFromRequired || hasSpecifiers) { - hasDeclaration = false; - this.parseExportFrom(node, isFromRequired); - } else { - hasDeclaration = this.maybeParseExportDeclaration(node); - } - - if (isFromRequired || hasSpecifiers || hasDeclaration) { - this.checkExport(node, true, false, !!node.source); - return this.finishNode(node, "ExportNamedDeclaration"); - } - - if (this.eat(types._default)) { - node.declaration = this.parseExportDefaultExpression(); - this.checkExport(node, true, true); - return this.finishNode(node, "ExportDefaultDeclaration"); - } - - throw this.unexpected(null, types.braceL); - } - - eatExportStar(node) { - return this.eat(types.star); - } - - maybeParseExportDefaultSpecifier(node) { - if (this.isExportDefaultSpecifier()) { - this.expectPlugin("exportDefaultFrom"); - const specifier = this.startNode(); - specifier.exported = this.parseIdentifier(true); - node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; - return true; - } - - return false; - } - - maybeParseExportNamespaceSpecifier(node) { - if (this.isContextual("as")) { - if (!node.specifiers) node.specifiers = []; - const specifier = this.startNodeAt(this.state.lastTokStart, this.state.lastTokStartLoc); - this.next(); - specifier.exported = this.parseModuleExportName(); - node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); - return true; - } - - return false; - } - - maybeParseExportNamedSpecifiers(node) { - if (this.match(types.braceL)) { - if (!node.specifiers) node.specifiers = []; - node.specifiers.push(...this.parseExportSpecifiers()); - node.source = null; - node.declaration = null; - return true; - } - - return false; - } - - maybeParseExportDeclaration(node) { - if (this.shouldParseExportDeclaration()) { - node.specifiers = []; - node.source = null; - node.declaration = this.parseExportDeclaration(node); - return true; - } - - return false; - } - - isAsyncFunction() { - if (!this.isContextual("async")) return false; - const next = this.nextTokenStart(); - return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, "function"); - } - - parseExportDefaultExpression() { - const expr = this.startNode(); - const isAsync = this.isAsyncFunction(); - - if (this.match(types._function) || isAsync) { - this.next(); - - if (isAsync) { - this.next(); - } - - return this.parseFunction(expr, FUNC_STATEMENT | FUNC_NULLABLE_ID, isAsync); - } else if (this.match(types._class)) { - return this.parseClass(expr, true, true); - } else if (this.match(types.at)) { - if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport")) { - this.raise(this.state.start, ErrorMessages.DecoratorBeforeExport); - } - - this.parseDecorators(false); - return this.parseClass(expr, true, true); - } else if (this.match(types._const) || this.match(types._var) || this.isLet()) { - throw this.raise(this.state.start, ErrorMessages.UnsupportedDefaultExport); - } else { - const res = this.parseMaybeAssignAllowIn(); - this.semicolon(); - return res; - } - } - - parseExportDeclaration(node) { - return this.parseStatement(null); - } - - isExportDefaultSpecifier() { - if (this.match(types.name)) { - const value = this.state.value; - - if (value === "async" && !this.state.containsEsc || value === "let") { - return false; - } - - if ((value === "type" || value === "interface") && !this.state.containsEsc) { - const l = this.lookahead(); - - if (l.type === types.name && l.value !== "from" || l.type === types.braceL) { - this.expectOnePlugin(["flow", "typescript"]); - return false; - } - } - } else if (!this.match(types._default)) { - return false; - } - - const next = this.nextTokenStart(); - const hasFrom = this.isUnparsedContextual(next, "from"); - - if (this.input.charCodeAt(next) === 44 || this.match(types.name) && hasFrom) { - return true; - } - - if (this.match(types._default) && hasFrom) { - const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4)); - return nextAfterFrom === 34 || nextAfterFrom === 39; - } - - return false; - } - - parseExportFrom(node, expect) { - if (this.eatContextual("from")) { - node.source = this.parseImportSource(); - this.checkExport(node); - const assertions = this.maybeParseImportAssertions(); - - if (assertions) { - node.assertions = assertions; - } - } else { - if (expect) { - this.unexpected(); - } else { - node.source = null; - } - } - - this.semicolon(); - } - - shouldParseExportDeclaration() { - if (this.match(types.at)) { - this.expectOnePlugin(["decorators", "decorators-legacy"]); - - if (this.hasPlugin("decorators")) { - if (this.getPluginOption("decorators", "decoratorsBeforeExport")) { - this.unexpected(this.state.start, ErrorMessages.DecoratorBeforeExport); - } else { - return true; - } - } - } - - return this.state.type.keyword === "var" || this.state.type.keyword === "const" || this.state.type.keyword === "function" || this.state.type.keyword === "class" || this.isLet() || this.isAsyncFunction(); - } - - checkExport(node, checkNames, isDefault, isFrom) { - if (checkNames) { - if (isDefault) { - this.checkDuplicateExports(node, "default"); - - if (this.hasPlugin("exportDefaultFrom")) { - var _declaration$extra; - - const declaration = node.declaration; - - if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) == null ? void 0 : _declaration$extra.parenthesized)) { - this.raise(declaration.start, ErrorMessages.ExportDefaultFromAsIdentifier); - } - } - } else if (node.specifiers && node.specifiers.length) { - for (let _i3 = 0, _node$specifiers = node.specifiers; _i3 < _node$specifiers.length; _i3++) { - const specifier = _node$specifiers[_i3]; - const { - exported - } = specifier; - const exportedName = exported.type === "Identifier" ? exported.name : exported.value; - this.checkDuplicateExports(specifier, exportedName); - - if (!isFrom && specifier.local) { - const { - local - } = specifier; - - if (local.type === "StringLiteral") { - this.raise(specifier.start, ErrorMessages.ExportBindingIsString, local.value, exportedName); - } else { - this.checkReservedWord(local.name, local.start, true, false); - this.scope.checkLocalExport(local); - } - } - } - } else if (node.declaration) { - if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") { - const id = node.declaration.id; - if (!id) throw new Error("Assertion failure"); - this.checkDuplicateExports(node, id.name); - } else if (node.declaration.type === "VariableDeclaration") { - for (let _i4 = 0, _node$declaration$dec = node.declaration.declarations; _i4 < _node$declaration$dec.length; _i4++) { - const declaration = _node$declaration$dec[_i4]; - this.checkDeclaration(declaration.id); - } - } - } - } - - const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1]; - - if (currentContextDecorators.length) { - throw this.raise(node.start, ErrorMessages.UnsupportedDecoratorExport); - } - } - - checkDeclaration(node) { - if (node.type === "Identifier") { - this.checkDuplicateExports(node, node.name); - } else if (node.type === "ObjectPattern") { - for (let _i5 = 0, _node$properties = node.properties; _i5 < _node$properties.length; _i5++) { - const prop = _node$properties[_i5]; - this.checkDeclaration(prop); - } - } else if (node.type === "ArrayPattern") { - for (let _i6 = 0, _node$elements = node.elements; _i6 < _node$elements.length; _i6++) { - const elem = _node$elements[_i6]; - - if (elem) { - this.checkDeclaration(elem); - } - } - } else if (node.type === "ObjectProperty") { - this.checkDeclaration(node.value); - } else if (node.type === "RestElement") { - this.checkDeclaration(node.argument); - } else if (node.type === "AssignmentPattern") { - this.checkDeclaration(node.left); - } - } - - checkDuplicateExports(node, name) { - if (this.state.exportedIdentifiers.indexOf(name) > -1) { - this.raise(node.start, name === "default" ? ErrorMessages.DuplicateDefaultExport : ErrorMessages.DuplicateExport, name); - } - - this.state.exportedIdentifiers.push(name); - } - - parseExportSpecifiers() { - const nodes = []; - let first = true; - this.expect(types.braceL); - - while (!this.eat(types.braceR)) { - if (first) { - first = false; - } else { - this.expect(types.comma); - if (this.eat(types.braceR)) break; - } - - const node = this.startNode(); - node.local = this.parseModuleExportName(); - node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local.__clone(); - nodes.push(this.finishNode(node, "ExportSpecifier")); - } - - return nodes; - } - - parseModuleExportName() { - if (this.match(types.string)) { - this.expectPlugin("moduleStringNames"); - const result = this.parseLiteral(this.state.value, "StringLiteral"); - const surrogate = result.value.match(loneSurrogate); - - if (surrogate) { - this.raise(result.start, ErrorMessages.ModuleExportNameHasLoneSurrogate, surrogate[0].charCodeAt(0).toString(16)); - } - - return result; - } - - return this.parseIdentifier(true); - } - - parseImport(node) { - node.specifiers = []; - - if (!this.match(types.string)) { - const hasDefault = this.maybeParseDefaultImportSpecifier(node); - const parseNext = !hasDefault || this.eat(types.comma); - const hasStar = parseNext && this.maybeParseStarImportSpecifier(node); - if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node); - this.expectContextual("from"); - } - - node.source = this.parseImportSource(); - const assertions = this.maybeParseImportAssertions(); - - if (assertions) { - node.assertions = assertions; - } else { - const attributes = this.maybeParseModuleAttributes(); - - if (attributes) { - node.attributes = attributes; - } - } - - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); - } - - parseImportSource() { - if (!this.match(types.string)) this.unexpected(); - return this.parseExprAtom(); - } - - shouldParseDefaultImport(node) { - return this.match(types.name); - } - - parseImportSpecifierLocal(node, specifier, type, contextDescription) { - specifier.local = this.parseIdentifier(); - this.checkLVal(specifier.local, contextDescription, BIND_LEXICAL); - node.specifiers.push(this.finishNode(specifier, type)); - } - - parseAssertEntries() { - const attrs = []; - const attrNames = new Set(); - - do { - if (this.match(types.braceR)) { - break; - } - - const node = this.startNode(); - const keyName = this.state.value; - - if (this.match(types.string)) { - node.key = this.parseLiteral(keyName, "StringLiteral"); - } else { - node.key = this.parseIdentifier(true); - } - - this.expect(types.colon); - - if (keyName !== "type") { - this.raise(node.key.start, ErrorMessages.ModuleAttributeDifferentFromType, keyName); - } - - if (attrNames.has(keyName)) { - this.raise(node.key.start, ErrorMessages.ModuleAttributesWithDuplicateKeys, keyName); - } - - attrNames.add(keyName); - - if (!this.match(types.string)) { - throw this.unexpected(this.state.start, ErrorMessages.ModuleAttributeInvalidValue); - } - - node.value = this.parseLiteral(this.state.value, "StringLiteral"); - this.finishNode(node, "ImportAttribute"); - attrs.push(node); - } while (this.eat(types.comma)); - - return attrs; - } - - maybeParseModuleAttributes() { - if (this.match(types._with) && !this.hasPrecedingLineBreak()) { - this.expectPlugin("moduleAttributes"); - this.next(); - } else { - if (this.hasPlugin("moduleAttributes")) return []; - return null; - } - - const attrs = []; - const attributes = new Set(); - - do { - const node = this.startNode(); - node.key = this.parseIdentifier(true); - - if (node.key.name !== "type") { - this.raise(node.key.start, ErrorMessages.ModuleAttributeDifferentFromType, node.key.name); - } - - if (attributes.has(node.key.name)) { - this.raise(node.key.start, ErrorMessages.ModuleAttributesWithDuplicateKeys, node.key.name); - } - - attributes.add(node.key.name); - this.expect(types.colon); - - if (!this.match(types.string)) { - throw this.unexpected(this.state.start, ErrorMessages.ModuleAttributeInvalidValue); - } - - node.value = this.parseLiteral(this.state.value, "StringLiteral"); - this.finishNode(node, "ImportAttribute"); - attrs.push(node); - } while (this.eat(types.comma)); - - return attrs; - } - - maybeParseImportAssertions() { - if (this.isContextual("assert") && !this.hasPrecedingLineBreak()) { - this.expectPlugin("importAssertions"); - this.next(); - } else { - if (this.hasPlugin("importAssertions")) return []; - return null; - } - - this.eat(types.braceL); - const attrs = this.parseAssertEntries(); - this.eat(types.braceR); - return attrs; - } - - maybeParseDefaultImportSpecifier(node) { - if (this.shouldParseDefaultImport(node)) { - this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier", "default import specifier"); - return true; - } - - return false; - } - - maybeParseStarImportSpecifier(node) { - if (this.match(types.star)) { - const specifier = this.startNode(); - this.next(); - this.expectContextual("as"); - this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier", "import namespace specifier"); - return true; - } - - return false; - } - - parseNamedImportSpecifiers(node) { - let first = true; - this.expect(types.braceL); - - while (!this.eat(types.braceR)) { - if (first) { - first = false; - } else { - if (this.eat(types.colon)) { - throw this.raise(this.state.start, ErrorMessages.DestructureNamedImport); - } - - this.expect(types.comma); - if (this.eat(types.braceR)) break; - } - - this.parseImportSpecifier(node); - } - } - - parseImportSpecifier(node) { - const specifier = this.startNode(); - specifier.imported = this.parseModuleExportName(); - - if (this.eatContextual("as")) { - specifier.local = this.parseIdentifier(); - } else { - const { - imported - } = specifier; - - if (imported.type === "StringLiteral") { - throw this.raise(specifier.start, ErrorMessages.ImportBindingIsString, imported.value); - } - - this.checkReservedWord(imported.name, specifier.start, true, true); - specifier.local = imported.__clone(); - } - - this.checkLVal(specifier.local, "import specifier", BIND_LEXICAL); - node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); - } - -} - -class Parser extends StatementParser { - constructor(options, input) { - options = getOptions(options); - super(options, input); - this.options = options; - this.initializeScopes(); - this.plugins = pluginsMap(this.options.plugins); - this.filename = options.sourceFilename; - } - - getScopeHandler() { - return ScopeHandler; - } - - parse() { - this.enterInitialScopes(); - const file = this.startNode(); - const program = this.startNode(); - this.nextToken(); - file.errors = null; - this.parseTopLevel(file, program); - file.errors = this.state.errors; - return file; - } - -} - -function pluginsMap(plugins) { - const pluginMap = new Map(); - - for (let _i = 0; _i < plugins.length; _i++) { - const plugin = plugins[_i]; - const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}]; - if (!pluginMap.has(name)) pluginMap.set(name, options || {}); - } - - return pluginMap; -} - -function parse(input, options) { - var _options; - - if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") { - options = Object.assign({}, options); - - try { - options.sourceType = "module"; - const parser = getParser(options, input); - const ast = parser.parse(); - - if (parser.sawUnambiguousESM) { - return ast; - } - - if (parser.ambiguousScriptDifferentAst) { - try { - options.sourceType = "script"; - return getParser(options, input).parse(); - } catch (_unused) {} - } else { - ast.program.sourceType = "script"; - } - - return ast; - } catch (moduleError) { - try { - options.sourceType = "script"; - return getParser(options, input).parse(); - } catch (_unused2) {} - - throw moduleError; - } - } else { - return getParser(options, input).parse(); - } -} -function parseExpression(input, options) { - const parser = getParser(options, input); - - if (parser.options.strictMode) { - parser.state.strict = true; - } - - return parser.getExpression(); -} - -function getParser(options, input) { - let cls = Parser; - - if (options == null ? void 0 : options.plugins) { - validatePlugins(options.plugins); - cls = getParserClass(options.plugins); - } - - return new cls(options, input); -} - -const parserClassCache = {}; - -function getParserClass(pluginsFromOptions) { - const pluginList = mixinPluginNames.filter(name => hasPlugin(pluginsFromOptions, name)); - const key = pluginList.join("/"); - let cls = parserClassCache[key]; - - if (!cls) { - cls = Parser; - - for (let _i = 0; _i < pluginList.length; _i++) { - const plugin = pluginList[_i]; - cls = mixinPlugins[plugin](cls); - } - - parserClassCache[key] = cls; - } - - return cls; -} - -exports.parse = parse; -exports.parseExpression = parseExpression; -exports.tokTypes = types; -//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/parser/lib/index.js.map b/node_modules/@babel/parser/lib/index.js.map deleted file mode 100644 index ad8b602..0000000 --- a/node_modules/@babel/parser/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../src/tokenizer/types.js","../src/util/whitespace.js","../src/util/location.js","../src/parser/base.js","../src/parser/comments.js","../src/parser/error-message.js","../src/parser/error.js","../src/plugins/estree.js","../src/tokenizer/context.js","../../babel-helper-validator-identifier/src/identifier.ts","../../babel-helper-validator-identifier/src/keyword.ts","../src/util/identifier.js","../src/util/scopeflags.js","../src/util/scope.js","../src/plugins/flow/scope.js","../src/plugins/flow/index.js","../src/plugins/jsx/xhtml.js","../src/plugins/jsx/index.js","../src/plugins/typescript/scope.js","../src/util/production-parameter.js","../src/plugins/typescript/index.js","../src/plugins/placeholders.js","../src/plugins/v8intrinsic.js","../src/plugin-utils.js","../src/options.js","../src/tokenizer/state.js","../src/tokenizer/index.js","../src/util/class-scope.js","../src/util/expression-scope.js","../src/parser/util.js","../src/parser/node.js","../src/parser/lval.js","../src/parser/expression.js","../src/parser/statement.js","../src/parser/index.js","../src/index.js"],"sourcesContent":["// @flow\n\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between regular\n// expressions and divisions. It is set on all token types that can\n// be followed by an expression (thus, a slash after them would be a\n// regular expression).\n\n// The `startsExpr` property is used to determine whether an expression\n// may be the “argument” subexpression of a `yield` expression or\n// `yield` statement. It is set on all token types that may be at the\n// start of a subexpression.\n\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\n\ntype TokenOptions = {\n keyword?: string,\n beforeExpr?: boolean,\n startsExpr?: boolean,\n rightAssociative?: boolean,\n isLoop?: boolean,\n isAssign?: boolean,\n prefix?: boolean,\n postfix?: boolean,\n binop?: ?number,\n};\n\nexport class TokenType {\n label: string;\n keyword: ?string;\n beforeExpr: boolean;\n startsExpr: boolean;\n rightAssociative: boolean;\n isLoop: boolean;\n isAssign: boolean;\n prefix: boolean;\n postfix: boolean;\n binop: ?number;\n updateContext: ?(prevType: TokenType) => void;\n\n constructor(label: string, conf: TokenOptions = {}) {\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n this.updateContext = null;\n }\n}\n\nexport const keywords = new Map();\n\nfunction createKeyword(name: string, options: TokenOptions = {}): TokenType {\n options.keyword = name;\n const token = new TokenType(name, options);\n keywords.set(name, token);\n return token;\n}\n\nfunction createBinop(name: string, binop: number) {\n return new TokenType(name, { beforeExpr, binop });\n}\n\nexport const types: { [name: string]: TokenType } = {\n num: new TokenType(\"num\", { startsExpr }),\n bigint: new TokenType(\"bigint\", { startsExpr }),\n decimal: new TokenType(\"decimal\", { startsExpr }),\n regexp: new TokenType(\"regexp\", { startsExpr }),\n string: new TokenType(\"string\", { startsExpr }),\n name: new TokenType(\"name\", { startsExpr }),\n eof: new TokenType(\"eof\"),\n\n // Punctuation token types.\n bracketL: new TokenType(\"[\", { beforeExpr, startsExpr }),\n bracketHashL: new TokenType(\"#[\", { beforeExpr, startsExpr }),\n bracketBarL: new TokenType(\"[|\", { beforeExpr, startsExpr }),\n bracketR: new TokenType(\"]\"),\n bracketBarR: new TokenType(\"|]\"),\n braceL: new TokenType(\"{\", { beforeExpr, startsExpr }),\n braceBarL: new TokenType(\"{|\", { beforeExpr, startsExpr }),\n braceHashL: new TokenType(\"#{\", { beforeExpr, startsExpr }),\n braceR: new TokenType(\"}\"),\n braceBarR: new TokenType(\"|}\"),\n parenL: new TokenType(\"(\", { beforeExpr, startsExpr }),\n parenR: new TokenType(\")\"),\n comma: new TokenType(\",\", { beforeExpr }),\n semi: new TokenType(\";\", { beforeExpr }),\n colon: new TokenType(\":\", { beforeExpr }),\n doubleColon: new TokenType(\"::\", { beforeExpr }),\n dot: new TokenType(\".\"),\n question: new TokenType(\"?\", { beforeExpr }),\n questionDot: new TokenType(\"?.\"),\n arrow: new TokenType(\"=>\", { beforeExpr }),\n template: new TokenType(\"template\"),\n ellipsis: new TokenType(\"...\", { beforeExpr }),\n backQuote: new TokenType(\"`\", { startsExpr }),\n dollarBraceL: new TokenType(\"${\", { beforeExpr, startsExpr }),\n at: new TokenType(\"@\"),\n hash: new TokenType(\"#\", { startsExpr }),\n\n // Special hashbang token.\n interpreterDirective: new TokenType(\"#!...\"),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n eq: new TokenType(\"=\", { beforeExpr, isAssign }),\n assign: new TokenType(\"_=\", { beforeExpr, isAssign }),\n incDec: new TokenType(\"++/--\", { prefix, postfix, startsExpr }),\n bang: new TokenType(\"!\", { beforeExpr, prefix, startsExpr }),\n tilde: new TokenType(\"~\", { beforeExpr, prefix, startsExpr }),\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n relational: createBinop(\"/<=/>=\", 7),\n bitShift: createBinop(\"<>/>>>\", 8),\n plusMin: new TokenType(\"+/-\", { beforeExpr, binop: 9, prefix, startsExpr }),\n // startsExpr: required by v8intrinsic plugin\n modulo: new TokenType(\"%\", { beforeExpr, binop: 10, startsExpr }),\n // unset `beforeExpr` as it can be `function *`\n star: new TokenType(\"*\", { binop: 10 }),\n slash: createBinop(\"/\", 10),\n exponent: new TokenType(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true,\n }),\n\n // Keywords\n // Don't forget to update packages/babel-helper-validator-identifier/src/keyword.js\n // when new keywords are added\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", { beforeExpr }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", { beforeExpr }),\n _do: createKeyword(\"do\", { isLoop, beforeExpr }),\n _else: createKeyword(\"else\", { beforeExpr }),\n _finally: createKeyword(\"finally\"),\n _for: createKeyword(\"for\", { isLoop }),\n _function: createKeyword(\"function\", { startsExpr }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", { beforeExpr }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", { beforeExpr, prefix, startsExpr }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _while: createKeyword(\"while\", { isLoop }),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", { beforeExpr, startsExpr }),\n _this: createKeyword(\"this\", { startsExpr }),\n _super: createKeyword(\"super\", { startsExpr }),\n _class: createKeyword(\"class\", { startsExpr }),\n _extends: createKeyword(\"extends\", { beforeExpr }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", { startsExpr }),\n _null: createKeyword(\"null\", { startsExpr }),\n _true: createKeyword(\"true\", { startsExpr }),\n _false: createKeyword(\"false\", { startsExpr }),\n _in: createKeyword(\"in\", { beforeExpr, binop: 7 }),\n _instanceof: createKeyword(\"instanceof\", { beforeExpr, binop: 7 }),\n _typeof: createKeyword(\"typeof\", { beforeExpr, prefix, startsExpr }),\n _void: createKeyword(\"void\", { beforeExpr, prefix, startsExpr }),\n _delete: createKeyword(\"delete\", { beforeExpr, prefix, startsExpr }),\n};\n","// @flow\n\nimport * as charCodes from \"charcodes\";\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\nexport const lineBreak = /\\r\\n?|[\\n\\u2028\\u2029]/;\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n// https://tc39.github.io/ecma262/#sec-line-terminators\nexport function isNewLine(code: number): boolean {\n switch (code) {\n case charCodes.lineFeed:\n case charCodes.carriageReturn:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return true;\n\n default:\n return false;\n }\n}\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\n// https://tc39.github.io/ecma262/#sec-white-space\nexport function isWhitespace(code: number): boolean {\n switch (code) {\n case 0x0009: // CHARACTER TABULATION\n case 0x000b: // LINE TABULATION\n case 0x000c: // FORM FEED\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.oghamSpaceMark:\n case 0x2000: // EN QUAD\n case 0x2001: // EM QUAD\n case 0x2002: // EN SPACE\n case 0x2003: // EM SPACE\n case 0x2004: // THREE-PER-EM SPACE\n case 0x2005: // FOUR-PER-EM SPACE\n case 0x2006: // SIX-PER-EM SPACE\n case 0x2007: // FIGURE SPACE\n case 0x2008: // PUNCTUATION SPACE\n case 0x2009: // THIN SPACE\n case 0x200a: // HAIR SPACE\n case 0x202f: // NARROW NO-BREAK SPACE\n case 0x205f: // MEDIUM MATHEMATICAL SPACE\n case 0x3000: // IDEOGRAPHIC SPACE\n case 0xfeff: // ZERO WIDTH NO-BREAK SPACE\n return true;\n\n default:\n return false;\n }\n}\n","// @flow\n\nimport { lineBreakG } from \"./whitespace\";\n\nexport type Pos = {\n start: number,\n};\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n line: number;\n column: number;\n\n constructor(line: number, col: number) {\n this.line = line;\n this.column = col;\n }\n}\n\nexport class SourceLocation {\n start: Position;\n end: Position;\n filename: string;\n identifierName: ?string;\n\n constructor(start: Position, end?: Position) {\n this.start = start;\n // $FlowIgnore (may start as null, but initialized later)\n this.end = end;\n }\n}\n\n// The `getLineInfo` function is mostly useful when the\n// `locations` option is off (for performance reasons) and you\n// want to find the line/column position for a given character\n// offset. `input` should be the code string that the offset refers\n// into.\n\nexport function getLineInfo(input: string, offset: number): Position {\n let line = 1;\n let lineStart = 0;\n let match;\n lineBreakG.lastIndex = 0;\n while ((match = lineBreakG.exec(input)) && match.index < offset) {\n line++;\n lineStart = lineBreakG.lastIndex;\n }\n\n return new Position(line, offset - lineStart);\n}\n","// @flow\n\nimport type { Options } from \"../options\";\nimport type State from \"../tokenizer/state\";\nimport type { PluginsMap } from \"./index\";\nimport type ScopeHandler from \"../util/scope\";\nimport type ExpressionScopeHandler from \"../util/expression-scope\";\nimport type ClassScopeHandler from \"../util/class-scope\";\nimport type ProductionParameterHandler from \"../util/production-parameter\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n declare options: Options;\n declare inModule: boolean;\n declare scope: ScopeHandler<*>;\n declare classScope: ClassScopeHandler;\n declare prodParam: ProductionParameterHandler;\n declare expressionScope: ExpressionScopeHandler;\n declare plugins: PluginsMap;\n declare filename: ?string;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n declare state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n declare input: string;\n declare length: number;\n\n hasPlugin(name: string): boolean {\n return this.plugins.has(name);\n }\n\n getPluginOption(plugin: string, name: string) {\n // $FlowIssue\n if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name];\n }\n}\n","// @flow\n\n/**\n * Based on the comment attachment algorithm used in espree and estraverse.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport BaseParser from \"./base\";\nimport type { Comment, Node } from \"../types\";\n\nfunction last(stack: $ReadOnlyArray): T {\n return stack[stack.length - 1];\n}\n\nexport default class CommentsParser extends BaseParser {\n addComment(comment: Comment): void {\n if (this.filename) comment.loc.filename = this.filename;\n this.state.trailingComments.push(comment);\n this.state.leadingComments.push(comment);\n }\n\n adjustCommentsAfterTrailingComma(\n node: Node,\n elements: (Node | null)[],\n // When the current node is followed by a token which hasn't a respective AST node, we\n // need to take all the trailing comments to prevent them from being attached to an\n // unrelated node. e.g. in\n // var { x } /* cmt */ = { y }\n // we don't want /* cmt */ to be attached to { y }.\n // On the other hand, in\n // fn(x) [new line] /* cmt */ [new line] y\n // /* cmt */ is both a trailing comment of fn(x) and a leading comment of y\n takeAllComments?: boolean,\n ) {\n if (this.state.leadingComments.length === 0) {\n return;\n }\n\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null) {\n return;\n }\n\n for (let j = 0; j < this.state.leadingComments.length; j++) {\n if (\n this.state.leadingComments[j].end < this.state.commentPreviousNode.end\n ) {\n this.state.leadingComments.splice(j, 1);\n j--;\n }\n }\n\n const newTrailingComments = [];\n for (let i = 0; i < this.state.leadingComments.length; i++) {\n const leadingComment = this.state.leadingComments[i];\n if (leadingComment.end < node.end) {\n newTrailingComments.push(leadingComment);\n\n // Perf: we don't need to splice if we are going to reset the array anyway\n if (!takeAllComments) {\n this.state.leadingComments.splice(i, 1);\n i--;\n }\n } else {\n if (node.trailingComments === undefined) {\n node.trailingComments = [];\n }\n node.trailingComments.push(leadingComment);\n }\n }\n if (takeAllComments) this.state.leadingComments = [];\n\n if (newTrailingComments.length > 0) {\n lastElement.trailingComments = newTrailingComments;\n } else if (lastElement.trailingComments !== undefined) {\n lastElement.trailingComments = [];\n }\n }\n\n processComment(node: Node): void {\n if (node.type === \"Program\" && node.body.length > 0) return;\n\n const stack = this.state.commentStack;\n\n let firstChild, lastChild, trailingComments, i, j;\n\n if (this.state.trailingComments.length > 0) {\n // If the first comment in trailingComments comes after the\n // current node, then we're good - all comments in the array will\n // come after the node and so it's safe to add them as official\n // trailingComments.\n if (this.state.trailingComments[0].start >= node.end) {\n trailingComments = this.state.trailingComments;\n this.state.trailingComments = [];\n } else {\n // Otherwise, if the first comment doesn't come after the\n // current node, that means we have a mix of leading and trailing\n // comments in the array and that leadingComments contains the\n // same items as trailingComments. Reset trailingComments to\n // zero items and we'll handle this by evaluating leadingComments\n // later.\n this.state.trailingComments.length = 0;\n }\n } else if (stack.length > 0) {\n const lastInStack = last(stack);\n if (\n lastInStack.trailingComments &&\n lastInStack.trailingComments[0].start >= node.end\n ) {\n trailingComments = lastInStack.trailingComments;\n delete lastInStack.trailingComments;\n }\n }\n\n // Eating the stack.\n if (stack.length > 0 && last(stack).start >= node.start) {\n firstChild = stack.pop();\n }\n\n while (stack.length > 0 && last(stack).start >= node.start) {\n lastChild = stack.pop();\n }\n\n if (!lastChild && firstChild) lastChild = firstChild;\n\n // Adjust comments that follow a trailing comma on the last element in a\n // comma separated list of nodes to be the trailing comments on the last\n // element\n if (firstChild) {\n switch (node.type) {\n case \"ObjectExpression\":\n this.adjustCommentsAfterTrailingComma(node, node.properties);\n break;\n case \"ObjectPattern\":\n this.adjustCommentsAfterTrailingComma(node, node.properties, true);\n break;\n case \"CallExpression\":\n this.adjustCommentsAfterTrailingComma(node, node.arguments);\n break;\n case \"ArrayExpression\":\n this.adjustCommentsAfterTrailingComma(node, node.elements);\n break;\n case \"ArrayPattern\":\n this.adjustCommentsAfterTrailingComma(node, node.elements, true);\n break;\n }\n } else if (\n this.state.commentPreviousNode &&\n ((this.state.commentPreviousNode.type === \"ImportSpecifier\" &&\n node.type !== \"ImportSpecifier\") ||\n (this.state.commentPreviousNode.type === \"ExportSpecifier\" &&\n node.type !== \"ExportSpecifier\"))\n ) {\n this.adjustCommentsAfterTrailingComma(node, [\n this.state.commentPreviousNode,\n ]);\n }\n\n if (lastChild) {\n if (lastChild.leadingComments) {\n if (\n lastChild !== node &&\n lastChild.leadingComments.length > 0 &&\n last(lastChild.leadingComments).end <= node.start\n ) {\n node.leadingComments = lastChild.leadingComments;\n delete lastChild.leadingComments;\n } else {\n // A leading comment for an anonymous class had been stolen by its first ClassMethod,\n // so this takes back the leading comment.\n // See also: https://github.com/eslint/espree/issues/158\n for (i = lastChild.leadingComments.length - 2; i >= 0; --i) {\n if (lastChild.leadingComments[i].end <= node.start) {\n node.leadingComments = lastChild.leadingComments.splice(0, i + 1);\n break;\n }\n }\n }\n }\n } else if (this.state.leadingComments.length > 0) {\n if (last(this.state.leadingComments).end <= node.start) {\n if (this.state.commentPreviousNode) {\n for (j = 0; j < this.state.leadingComments.length; j++) {\n if (\n this.state.leadingComments[j].end <\n this.state.commentPreviousNode.end\n ) {\n this.state.leadingComments.splice(j, 1);\n j--;\n }\n }\n }\n if (this.state.leadingComments.length > 0) {\n node.leadingComments = this.state.leadingComments;\n this.state.leadingComments = [];\n }\n } else {\n // https://github.com/eslint/espree/issues/2\n //\n // In special cases, such as return (without a value) and\n // debugger, all comments will end up as leadingComments and\n // will otherwise be eliminated. This step runs when the\n // commentStack is empty and there are comments left\n // in leadingComments.\n //\n // This loop figures out the stopping point between the actual\n // leading and trailing comments by finding the location of the\n // first comment that comes after the given node.\n for (i = 0; i < this.state.leadingComments.length; i++) {\n if (this.state.leadingComments[i].end > node.start) {\n break;\n }\n }\n\n // Split the array based on the location of the first comment\n // that comes after the node. Keep in mind that this could\n // result in an empty array, and if so, the array must be\n // deleted.\n const leadingComments = this.state.leadingComments.slice(0, i);\n\n if (leadingComments.length) {\n node.leadingComments = leadingComments;\n }\n\n // Similarly, trailing comments are attached later. The variable\n // must be reset to null if there are no trailing comments.\n trailingComments = this.state.leadingComments.slice(i);\n if (trailingComments.length === 0) {\n trailingComments = null;\n }\n }\n }\n\n this.state.commentPreviousNode = node;\n\n if (trailingComments) {\n if (\n trailingComments.length &&\n trailingComments[0].start >= node.start &&\n last(trailingComments).end <= node.end\n ) {\n node.innerComments = trailingComments;\n } else {\n // TrailingComments maybe contain innerComments\n const firstTrailingCommentIndex = trailingComments.findIndex(\n comment => comment.end >= node.end,\n );\n\n if (firstTrailingCommentIndex > 0) {\n node.innerComments = trailingComments.slice(\n 0,\n firstTrailingCommentIndex,\n );\n node.trailingComments = trailingComments.slice(\n firstTrailingCommentIndex,\n );\n } else {\n node.trailingComments = trailingComments;\n }\n }\n }\n\n stack.push(node);\n }\n}\n","// @flow\n/* eslint sort-keys: \"error\" */\n\n/**\n * @module parser/error-message\n */\n\n// The Errors key follows https://cs.chromium.org/chromium/src/v8/src/common/message-template.h unless it does not exist\nexport const ErrorMessages = Object.freeze({\n AccessorIsGenerator: \"A %0ter cannot be a generator\",\n ArgumentsInClass:\n \"'arguments' is only allowed in functions and class methods\",\n AsyncFunctionInSingleStatementContext:\n \"Async functions can only be declared at the top level or inside a block\",\n AwaitBindingIdentifier:\n \"Can not use 'await' as identifier inside an async function\",\n AwaitBindingIdentifierInStaticBlock:\n \"Can not use 'await' as identifier inside a static block\",\n AwaitExpressionFormalParameter:\n \"await is not allowed in async function parameters\",\n AwaitNotInAsyncContext:\n \"'await' is only allowed within async functions and at the top levels of modules\",\n AwaitNotInAsyncFunction: \"'await' is only allowed within async functions\",\n BadGetterArity: \"getter must not have any formal parameters\",\n BadSetterArity: \"setter must have exactly one formal parameter\",\n BadSetterRestParameter:\n \"setter function argument must not be a rest parameter\",\n ConstructorClassField: \"Classes may not have a field named 'constructor'\",\n ConstructorClassPrivateField:\n \"Classes may not have a private field named '#constructor'\",\n ConstructorIsAccessor: \"Class constructor may not be an accessor\",\n ConstructorIsAsync: \"Constructor can't be an async function\",\n ConstructorIsGenerator: \"Constructor can't be a generator\",\n DeclarationMissingInitializer: \"%0 require an initialization value\",\n DecoratorBeforeExport:\n \"Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax\",\n DecoratorConstructor:\n \"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?\",\n DecoratorExportClass:\n \"Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.\",\n DecoratorSemicolon: \"Decorators must not be followed by a semicolon\",\n DecoratorStaticBlock: \"Decorators can't be used with a static block\",\n DeletePrivateField: \"Deleting a private field is not allowed\",\n DestructureNamedImport:\n \"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\",\n DuplicateConstructor: \"Duplicate constructor in the same class\",\n DuplicateDefaultExport: \"Only one default export allowed per module.\",\n DuplicateExport:\n \"`%0` has already been exported. Exported identifiers must be unique.\",\n DuplicateProto: \"Redefinition of __proto__ property\",\n DuplicateRegExpFlags: \"Duplicate regular expression flag\",\n DuplicateStaticBlock: \"Duplicate static block in the same class\",\n ElementAfterRest: \"Rest element must be last element\",\n EscapedCharNotAnIdentifier: \"Invalid Unicode escape\",\n ExportBindingIsString:\n \"A string literal cannot be used as an exported binding without `from`.\\n- Did you mean `export { '%0' as '%1' } from 'some-module'`?\",\n ExportDefaultFromAsIdentifier:\n \"'from' is not allowed as an identifier after 'export default'\",\n ForInOfLoopInitializer:\n \"%0 loop variable declaration may not have an initializer\",\n GeneratorInSingleStatementContext:\n \"Generators can only be declared at the top level or inside a block\",\n IllegalBreakContinue: \"Unsyntactic %0\",\n IllegalLanguageModeDirective:\n \"Illegal 'use strict' directive in function with non-simple parameter list\",\n IllegalReturn: \"'return' outside of function\",\n ImportBindingIsString:\n 'A string literal cannot be used as an imported binding.\\n- Did you mean `import { \"%0\" as foo }`?',\n ImportCallArgumentTrailingComma:\n \"Trailing comma is disallowed inside import(...) arguments\",\n ImportCallArity: \"import() requires exactly %0\",\n ImportCallNotNewExpression: \"Cannot use new with import(...)\",\n ImportCallSpreadArgument: \"... is not allowed in import()\",\n ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: \"module\"'`,\n ImportOutsideModule: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n InvalidBigIntLiteral: \"Invalid BigIntLiteral\",\n InvalidCodePoint: \"Code point out of bounds\",\n InvalidDecimal: \"Invalid decimal\",\n InvalidDigit: \"Expected number in radix %0\",\n InvalidEscapeSequence: \"Bad character escape sequence\",\n InvalidEscapeSequenceTemplate: \"Invalid escape sequence in template\",\n InvalidEscapedReservedWord: \"Escape sequence in keyword %0\",\n InvalidIdentifier: \"Invalid identifier %0\",\n InvalidLhs: \"Invalid left-hand side in %0\",\n InvalidLhsBinding: \"Binding invalid left-hand side in %0\",\n InvalidNumber: \"Invalid number\",\n InvalidOrMissingExponent:\n \"Floating-point numbers require a valid exponent after the 'e'\",\n InvalidOrUnexpectedToken: \"Unexpected character '%0'\",\n InvalidParenthesizedAssignment: \"Invalid parenthesized assignment pattern\",\n InvalidPrivateFieldResolution: \"Private name #%0 is not defined\",\n InvalidPropertyBindingPattern: \"Binding member expression\",\n InvalidRecordProperty:\n \"Only properties and spread elements are allowed in record definitions\",\n InvalidRestAssignmentPattern: \"Invalid rest operator's argument\",\n LabelRedeclaration: \"Label '%0' is already declared\",\n LetInLexicalBinding:\n \"'let' is not allowed to be used as a name in 'let' or 'const' declarations.\",\n LineTerminatorBeforeArrow: \"No line break is allowed before '=>'\",\n MalformedRegExpFlags: \"Invalid regular expression flag\",\n MissingClassName: \"A class name is required\",\n MissingEqInAssignment:\n \"Only '=' operator can be used for specifying default value.\",\n MissingSemicolon: \"Missing semicolon\",\n MissingUnicodeEscape: \"Expecting Unicode escape sequence \\\\uXXXX\",\n MixingCoalesceWithLogical:\n \"Nullish coalescing operator(??) requires parens when mixing with logical operators\",\n ModuleAttributeDifferentFromType:\n \"The only accepted module attribute is `type`\",\n ModuleAttributeInvalidValue:\n \"Only string literals are allowed as module attribute values\",\n ModuleAttributesWithDuplicateKeys:\n 'Duplicate key \"%0\" is not allowed in module attributes',\n ModuleExportNameHasLoneSurrogate:\n \"An export name cannot include a lone surrogate, found '\\\\u%0'\",\n ModuleExportUndefined: \"Export '%0' is not defined\",\n MultipleDefaultsInSwitch: \"Multiple default clauses\",\n NewlineAfterThrow: \"Illegal newline after throw\",\n NoCatchOrFinally: \"Missing catch or finally clause\",\n NumberIdentifier: \"Identifier directly after number\",\n NumericSeparatorInEscapeSequence:\n \"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences\",\n ObsoleteAwaitStar:\n \"await* has been removed from the async functions proposal. Use Promise.all() instead.\",\n OptionalChainingNoNew:\n \"constructors in/after an Optional Chain are not allowed\",\n OptionalChainingNoTemplate:\n \"Tagged Template Literals are not allowed in optionalChain\",\n ParamDupe: \"Argument name clash\",\n PatternHasAccessor: \"Object pattern can't contain getter or setter\",\n PatternHasMethod: \"Object pattern can't contain methods\",\n PipelineBodyNoArrow:\n 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized',\n PipelineBodySequenceExpression:\n \"Pipeline body may not be a comma-separated sequence expression\",\n PipelineHeadSequenceExpression:\n \"Pipeline head should not be a comma-separated sequence expression\",\n PipelineTopicUnused:\n \"Pipeline is in topic style but does not use topic reference\",\n PrimaryTopicNotAllowed:\n \"Topic reference was used in a lexical context without topic binding\",\n PrimaryTopicRequiresSmartPipeline:\n \"Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option.\",\n PrivateInExpectedIn:\n \"Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`)\",\n PrivateNameRedeclaration: \"Duplicate private name #%0\",\n RecordExpressionBarIncorrectEndSyntaxType:\n \"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'\",\n RecordExpressionBarIncorrectStartSyntaxType:\n \"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'\",\n RecordExpressionHashIncorrectStartSyntaxType:\n \"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'\",\n RecordNoProto: \"'__proto__' is not allowed in Record expressions\",\n RestTrailingComma: \"Unexpected trailing comma after rest element\",\n SloppyFunction:\n \"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement\",\n StaticPrototype: \"Classes may not have static property named prototype\",\n StrictDelete: \"Deleting local variable in strict mode\",\n StrictEvalArguments: \"Assigning to '%0' in strict mode\",\n StrictEvalArgumentsBinding: \"Binding '%0' in strict mode\",\n StrictFunction:\n \"In strict mode code, functions can only be declared at top level or inside a block\",\n StrictNumericEscape: \"The only valid numeric escape in strict mode is '\\\\0'\",\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode\",\n StrictWith: \"'with' in strict mode\",\n SuperNotAllowed:\n \"super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?\",\n SuperPrivateField: \"Private fields can't be accessed on super\",\n TrailingDecorator: \"Decorators must be attached to a class element\",\n TupleExpressionBarIncorrectEndSyntaxType:\n \"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'\",\n TupleExpressionBarIncorrectStartSyntaxType:\n \"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'\",\n TupleExpressionHashIncorrectStartSyntaxType:\n \"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'\",\n UnexpectedArgumentPlaceholder: \"Unexpected argument placeholder\",\n UnexpectedAwaitAfterPipelineBody:\n 'Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal',\n UnexpectedDigitAfterHash: \"Unexpected digit after hash token\",\n UnexpectedImportExport:\n \"'import' and 'export' may only appear at the top level\",\n UnexpectedKeyword: \"Unexpected keyword '%0'\",\n UnexpectedLeadingDecorator:\n \"Leading decorators must be attached to a class declaration\",\n UnexpectedLexicalDeclaration:\n \"Lexical declaration cannot appear in a single-statement context\",\n UnexpectedNewTarget: \"new.target can only be used in functions\",\n UnexpectedNumericSeparator:\n \"A numeric separator is only allowed between two digits\",\n UnexpectedPrivateField:\n \"Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\\n or a property of member expression (i.e. this.#p).\",\n UnexpectedReservedWord: \"Unexpected reserved word '%0'\",\n UnexpectedSuper: \"super is only allowed in object methods and classes\",\n UnexpectedToken: \"Unexpected token '%0'\",\n UnexpectedTokenUnaryExponentiation:\n \"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.\",\n UnsupportedBind: \"Binding should be performed on object property.\",\n UnsupportedDecoratorExport:\n \"A decorated export must export a class declaration\",\n UnsupportedDefaultExport:\n \"Only expressions, functions or classes are allowed as the `default` export.\",\n UnsupportedImport: \"import can only be used in import() or import.meta\",\n UnsupportedMetaProperty: \"The only valid meta property for %0 is %0.%1\",\n UnsupportedParameterDecorator:\n \"Decorators cannot be used to decorate parameters\",\n UnsupportedPropertyDecorator:\n \"Decorators cannot be used to decorate object literal properties\",\n UnsupportedSuper:\n \"super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop])\",\n UnterminatedComment: \"Unterminated comment\",\n UnterminatedRegExp: \"Unterminated regular expression\",\n UnterminatedString: \"Unterminated string constant\",\n UnterminatedTemplate: \"Unterminated template\",\n VarRedeclaration: \"Identifier '%0' has already been declared\",\n YieldBindingIdentifier:\n \"Can not use 'yield' as identifier inside a generator\",\n YieldInParameter: \"Yield expression is not allowed in formal parameters\",\n ZeroDigitNumericSeparator:\n \"Numeric separator can not be used after leading 0\",\n});\n","// @flow\n/* eslint sort-keys: \"error\" */\nimport { getLineInfo, type Position } from \"../util/location\";\nimport CommentsParser from \"./comments\";\n\n// This function is used to raise exceptions on parse errors. It\n// takes an offset integer (into the current `input`) to indicate\n// the location of the error, attaches the position to the end\n// of the error message, and then raises a `SyntaxError` with that\n// message.\n\ntype ErrorContext = {\n pos: number,\n loc: Position,\n missingPlugin?: Array,\n code?: string,\n};\n\nexport type ParsingError = SyntaxError & ErrorContext;\n\nexport { ErrorMessages as Errors } from \"./error-message\";\n\nexport default class ParserError extends CommentsParser {\n // Forward-declaration: defined in tokenizer/index.js\n /*::\n +isLookahead: boolean;\n */\n\n getLocationForPosition(pos: number): Position {\n let loc;\n if (pos === this.state.start) loc = this.state.startLoc;\n else if (pos === this.state.lastTokStart) loc = this.state.lastTokStartLoc;\n else if (pos === this.state.end) loc = this.state.endLoc;\n else if (pos === this.state.lastTokEnd) loc = this.state.lastTokEndLoc;\n else loc = getLineInfo(this.input, pos);\n\n return loc;\n }\n\n raise(pos: number, errorTemplate: string, ...params: any): Error | empty {\n return this.raiseWithData(pos, undefined, errorTemplate, ...params);\n }\n\n /**\n * Raise a parsing error on given position pos. If errorRecovery is true,\n * it will first search current errors and overwrite the error thrown on the exact\n * position before with the new error message. If errorRecovery is false, it\n * fallbacks to `raise`.\n *\n * @param {number} pos\n * @param {string} errorTemplate\n * @param {...any} params\n * @returns {(Error | empty)}\n * @memberof ParserError\n */\n raiseOverwrite(\n pos: number,\n errorTemplate: string,\n ...params: any\n ): Error | empty {\n const loc = this.getLocationForPosition(pos);\n const message =\n errorTemplate.replace(/%(\\d+)/g, (_, i: number) => params[i]) +\n ` (${loc.line}:${loc.column})`;\n if (this.options.errorRecovery) {\n const errors = this.state.errors;\n for (let i = errors.length - 1; i >= 0; i--) {\n const error = errors[i];\n if (error.pos === pos) {\n return Object.assign(error, { message });\n } else if (error.pos < pos) {\n break;\n }\n }\n }\n return this._raise({ loc, pos }, message);\n }\n\n raiseWithData(\n pos: number,\n data?: {\n missingPlugin?: Array,\n code?: string,\n },\n errorTemplate: string,\n ...params: any\n ): Error | empty {\n const loc = this.getLocationForPosition(pos);\n const message =\n errorTemplate.replace(/%(\\d+)/g, (_, i: number) => params[i]) +\n ` (${loc.line}:${loc.column})`;\n return this._raise(Object.assign(({ loc, pos }: Object), data), message);\n }\n\n _raise(errorContext: ErrorContext, message: string): Error | empty {\n // $FlowIgnore\n const err: SyntaxError & ErrorContext = new SyntaxError(message);\n Object.assign(err, errorContext);\n if (this.options.errorRecovery) {\n if (!this.isLookahead) this.state.errors.push(err);\n return err;\n } else {\n throw err;\n }\n }\n}\n","// @flow\n\nimport { types as tt, TokenType } from \"../tokenizer/types\";\nimport type Parser from \"../parser\";\nimport type { ExpressionErrors } from \"../parser/util\";\nimport * as N from \"../types\";\nimport type { Position } from \"../util/location\";\nimport { Errors } from \"../parser/error\";\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n estreeParseRegExpLiteral({ pattern, flags }: N.RegExpLiteral): N.Node {\n let regex = null;\n try {\n regex = new RegExp(pattern, flags);\n } catch (e) {\n // In environments that don't support these flags value will\n // be null as the regex can't be represented natively.\n }\n const node = this.estreeParseLiteral(regex);\n node.regex = { pattern, flags };\n\n return node;\n }\n\n estreeParseBigIntLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/es2020.md#bigintliteral\n let bigInt;\n try {\n // $FlowIgnore\n bigInt = BigInt(value);\n } catch {\n bigInt = null;\n }\n const node = this.estreeParseLiteral(bigInt);\n node.bigint = String(node.value || value);\n\n return node;\n }\n\n estreeParseDecimalLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/experimental/decimal.md\n // todo: use BigDecimal when node supports it.\n const decimal = null;\n const node = this.estreeParseLiteral(decimal);\n node.decimal = String(node.value || value);\n\n return node;\n }\n\n estreeParseLiteral(value: any): N.Node {\n return this.parseLiteral(value, \"Literal\");\n }\n\n directiveToStmt(directive: N.Directive): N.ExpressionStatement {\n const directiveLiteral = directive.value;\n\n const stmt = this.startNodeAt(directive.start, directive.loc.start);\n const expression = this.startNodeAt(\n directiveLiteral.start,\n directiveLiteral.loc.start,\n );\n\n expression.value = directiveLiteral.extra.expressionValue;\n expression.raw = directiveLiteral.extra.raw;\n\n stmt.expression = this.finishNodeAt(\n expression,\n \"Literal\",\n directiveLiteral.end,\n directiveLiteral.loc.end,\n );\n stmt.directive = directiveLiteral.extra.raw.slice(1, -1);\n\n return this.finishNodeAt(\n stmt,\n \"ExpressionStatement\",\n directive.end,\n directive.loc.end,\n );\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n initFunction(\n node: N.BodilessFunctionOrMethodBase,\n isAsync: ?boolean,\n ): void {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n\n checkDeclaration(node: N.Pattern | N.ObjectProperty): void {\n if (node != null && this.isObjectProperty(node)) {\n this.checkDeclaration(((node: any): N.EstreeProperty).value);\n } else {\n super.checkDeclaration(node);\n }\n }\n\n getObjectOrClassMethodParams(method: N.ObjectMethod | N.ClassMethod) {\n return ((method: any): N.EstreeProperty | N.EstreeMethodDefinition).value\n .params;\n }\n\n isValidDirective(stmt: N.Statement): boolean {\n return (\n stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"Literal\" &&\n typeof stmt.expression.value === \"string\" &&\n !stmt.expression.extra?.parenthesized\n );\n }\n\n stmtToDirective(stmt: N.Statement): N.Directive {\n const directive = super.stmtToDirective(stmt);\n const value = stmt.expression.value;\n\n // Record the expression value as in estree mode we want\n // the stmt to have the real value e.g. (\"use strict\") and\n // not the raw value e.g. (\"use\\\\x20strict\")\n this.addExtra(directive.value, \"expressionValue\", value);\n\n return directive;\n }\n\n parseBlockBody(\n node: N.BlockStatementLike,\n ...args: [?boolean, boolean, TokenType, void | (boolean => void)]\n ): void {\n super.parseBlockBody(node, ...args);\n\n const directiveStatements = node.directives.map(d =>\n this.directiveToStmt(d),\n );\n node.body = directiveStatements.concat(node.body);\n // $FlowIgnore - directives isn't optional in the type definition\n delete node.directives;\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n this.parseMethod(\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n \"ClassMethod\",\n true,\n );\n if (method.typeParameters) {\n // $FlowIgnore\n method.value.typeParameters = method.typeParameters;\n delete method.typeParameters;\n }\n classBody.body.push(method);\n }\n\n parseExprAtom(refExpressionErrors?: ?ExpressionErrors): N.Expression {\n switch (this.state.type) {\n case tt.num:\n case tt.string:\n return this.estreeParseLiteral(this.state.value);\n\n case tt.regexp:\n return this.estreeParseRegExpLiteral(this.state.value);\n\n case tt.bigint:\n return this.estreeParseBigIntLiteral(this.state.value);\n\n case tt.decimal:\n return this.estreeParseDecimalLiteral(this.state.value);\n\n case tt._null:\n return this.estreeParseLiteral(null);\n\n case tt._true:\n return this.estreeParseLiteral(true);\n\n case tt._false:\n return this.estreeParseLiteral(false);\n\n default:\n return super.parseExprAtom(refExpressionErrors);\n }\n }\n\n parseMaybePrivateName(...args: [boolean]): any {\n const node = super.parseMaybePrivateName(...args);\n if (\n node.type === \"PrivateName\" &&\n this.getPluginOption(\"estree\", \"classFeatures\")\n ) {\n return this.convertPrivateNameToPrivateIdentifier(node);\n }\n return node;\n }\n\n convertPrivateNameToPrivateIdentifier(\n node: N.PrivateName,\n ): N.EstreePrivateIdentifier {\n const name = super.getPrivateNameSV(node);\n node = (node: any);\n delete node.id;\n node.name = name;\n node.type = \"PrivateIdentifier\";\n return node;\n }\n\n isPrivateName(node: N.Node): boolean {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.isPrivateName(node);\n }\n return node.type === \"PrivateIdentifier\";\n }\n\n getPrivateNameSV(node: N.Node): string {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.getPrivateNameSV(node);\n }\n return node.name;\n }\n\n parseLiteral(\n value: any,\n type: /*T[\"kind\"]*/ string,\n startPos?: number,\n startLoc?: Position,\n ): T {\n const node = super.parseLiteral(value, type, startPos, startLoc);\n node.raw = node.extra.raw;\n delete node.extra;\n\n return node;\n }\n\n parseFunctionBody(\n node: N.Function,\n allowExpression: ?boolean,\n isMethod?: boolean = false,\n ): void {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n parseMethod(\n node: T,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: string,\n inClassScope: boolean = false,\n ): T {\n let funcNode = this.startNode();\n funcNode.kind = node.kind; // provide kind, so super method correctly sets state\n funcNode = super.parseMethod(\n funcNode,\n isGenerator,\n isAsync,\n isConstructor,\n allowDirectSuper,\n type,\n inClassScope,\n );\n funcNode.type = \"FunctionExpression\";\n delete funcNode.kind;\n // $FlowIgnore\n node.value = funcNode;\n if (type === \"ClassPrivateMethod\") {\n // $FlowIgnore\n node.computed = false;\n }\n type = \"MethodDefinition\";\n return this.finishNode(node, type);\n }\n\n parseClassProperty(...args: [N.ClassProperty]): any {\n const propertyNode = (super.parseClassProperty(...args): any);\n if (this.getPluginOption(\"estree\", \"classFeatures\")) {\n propertyNode.type = \"PropertyDefinition\";\n }\n return (propertyNode: N.EstreePropertyDefinition);\n }\n\n parseClassPrivateProperty(...args: [N.ClassPrivateProperty]): any {\n const propertyNode = (super.parseClassPrivateProperty(...args): any);\n if (this.getPluginOption(\"estree\", \"classFeatures\")) {\n propertyNode.type = \"PropertyDefinition\";\n propertyNode.computed = false;\n }\n return (propertyNode: N.EstreePropertyDefinition);\n }\n\n parseObjectMethod(\n prop: N.ObjectMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n ): ?N.ObjectMethod {\n const node: N.EstreeProperty = (super.parseObjectMethod(\n prop,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n ): any);\n\n if (node) {\n node.type = \"Property\";\n if (((node: any): N.ClassMethod).kind === \"method\") node.kind = \"init\";\n node.shorthand = false;\n }\n\n return (node: any);\n }\n\n parseObjectProperty(\n prop: N.ObjectProperty,\n startPos: ?number,\n startLoc: ?Position,\n isPattern: boolean,\n refExpressionErrors: ?ExpressionErrors,\n ): ?N.ObjectProperty {\n const node: N.EstreeProperty = (super.parseObjectProperty(\n prop,\n startPos,\n startLoc,\n isPattern,\n refExpressionErrors,\n ): any);\n\n if (node) {\n node.kind = \"init\";\n node.type = \"Property\";\n }\n\n return (node: any);\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): N.Node {\n if (node != null && this.isObjectProperty(node)) {\n this.toAssignable(node.value, isLHS);\n\n return node;\n }\n\n return super.toAssignable(node, isLHS);\n }\n\n toAssignableObjectExpressionProp(prop: N.Node, ...args) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n this.raise(prop.key.start, Errors.PatternHasAccessor);\n } else if (prop.method) {\n this.raise(prop.key.start, Errors.PatternHasMethod);\n } else {\n super.toAssignableObjectExpressionProp(prop, ...args);\n }\n }\n\n finishCallExpression(\n node: T,\n optional: boolean,\n ): N.Expression {\n super.finishCallExpression(node, optional);\n\n if (node.callee.type === \"Import\") {\n ((node: N.Node): N.EstreeImportExpression).type = \"ImportExpression\";\n ((node: N.Node): N.EstreeImportExpression).source = node.arguments[0];\n // $FlowIgnore - arguments isn't optional in the type definition\n delete node.arguments;\n // $FlowIgnore - callee isn't optional in the type definition\n delete node.callee;\n }\n\n return node;\n }\n\n toReferencedArguments(\n node:\n | N.CallExpression\n | N.OptionalCallExpression\n | N.EstreeImportExpression,\n /* isParenthesizedExpr?: boolean, */\n ) {\n // ImportExpressions do not have an arguments array.\n if (node.type === \"ImportExpression\") {\n return;\n }\n\n super.toReferencedArguments(node);\n }\n\n parseExport(node: N.Node) {\n super.parseExport(node);\n\n switch (node.type) {\n case \"ExportAllDeclaration\":\n node.exported = null;\n break;\n\n case \"ExportNamedDeclaration\":\n if (\n node.specifiers.length === 1 &&\n node.specifiers[0].type === \"ExportNamespaceSpecifier\"\n ) {\n node.type = \"ExportAllDeclaration\";\n node.exported = node.specifiers[0].exported;\n delete node.specifiers;\n }\n\n break;\n }\n\n return node;\n }\n\n parseSubscript(\n base: N.Expression,\n startPos: number,\n startLoc: Position,\n noCalls: ?boolean,\n state: N.ParseSubscriptState,\n ) {\n const node = super.parseSubscript(\n base,\n startPos,\n startLoc,\n noCalls,\n state,\n );\n\n if (state.optionalChainMember) {\n // https://github.com/estree/estree/blob/master/es2020.md#chainexpression\n if (\n node.type === \"OptionalMemberExpression\" ||\n node.type === \"OptionalCallExpression\"\n ) {\n node.type = node.type.substring(8); // strip Optional prefix\n }\n if (state.stop) {\n const chain = this.startNodeAtNode(node);\n chain.expression = node;\n return this.finishNode(chain, \"ChainExpression\");\n }\n } else if (\n node.type === \"MemberExpression\" ||\n node.type === \"CallExpression\"\n ) {\n node.optional = false;\n }\n\n return node;\n }\n\n hasPropertyAsPrivateName(node: N.Node): boolean {\n if (node.type === \"ChainExpression\") {\n node = node.expression;\n }\n return super.hasPropertyAsPrivateName(node);\n }\n\n isOptionalChain(node: N.Node): boolean {\n return node.type === \"ChainExpression\";\n }\n\n isObjectProperty(node: N.Node): boolean {\n return node.type === \"Property\" && node.kind === \"init\" && !node.method;\n }\n\n isObjectMethod(node: N.Node): boolean {\n return node.method || node.kind === \"get\" || node.kind === \"set\";\n }\n };\n","// @flow\n\n// The algorithm used to determine whether a regexp can appear at a\n// given point in the program is loosely based on sweet.js' approach.\n// See https://github.com/mozilla/sweet.js/wiki/design\n\nimport { types as tt } from \"./types\";\n\nexport class TokContext {\n constructor(\n token: string,\n isExpr?: boolean,\n preserveSpace?: boolean,\n override?: ?Function, // Takes a Tokenizer as a this-parameter, and returns void.\n ) {\n this.token = token;\n this.isExpr = !!isExpr;\n this.preserveSpace = !!preserveSpace;\n this.override = override;\n }\n\n token: string;\n isExpr: boolean;\n preserveSpace: boolean;\n override: ?Function;\n}\n\nexport const types: {\n [key: string]: TokContext,\n} = {\n braceStatement: new TokContext(\"{\", false),\n braceExpression: new TokContext(\"{\", true),\n recordExpression: new TokContext(\"#{\", true),\n templateQuasi: new TokContext(\"${\", false),\n parenStatement: new TokContext(\"(\", false),\n parenExpression: new TokContext(\"(\", true),\n template: new TokContext(\"`\", true, true, p => p.readTmplToken()),\n functionExpression: new TokContext(\"function\", true),\n functionStatement: new TokContext(\"function\", false),\n};\n\n// Token-specific context update code\n// Note that we should avoid accessing `this.prodParam` in context update,\n// because it is executed immediately when last token is consumed, which may be\n// before `this.prodParam` is updated. e.g.\n// ```\n// function *g() { () => yield / 2 }\n// ```\n// When `=>` is eaten, the context update of `yield` is executed, however,\n// `this.prodParam` still has `[Yield]` production because it is not yet updated\n\ntt.parenR.updateContext = tt.braceR.updateContext = function () {\n if (this.state.context.length === 1) {\n this.state.exprAllowed = true;\n return;\n }\n\n let out = this.state.context.pop();\n if (out === types.braceStatement && this.curContext().token === \"function\") {\n out = this.state.context.pop();\n }\n\n this.state.exprAllowed = !out.isExpr;\n};\n\ntt.name.updateContext = function (prevType) {\n let allowed = false;\n if (prevType !== tt.dot) {\n if (\n this.state.value === \"of\" &&\n !this.state.exprAllowed &&\n prevType !== tt._function &&\n prevType !== tt._class\n ) {\n allowed = true;\n }\n }\n this.state.exprAllowed = allowed;\n\n if (this.state.isIterator) {\n this.state.isIterator = false;\n }\n};\n\ntt.braceL.updateContext = function (prevType) {\n this.state.context.push(\n this.braceIsBlock(prevType) ? types.braceStatement : types.braceExpression,\n );\n this.state.exprAllowed = true;\n};\n\ntt.dollarBraceL.updateContext = function () {\n this.state.context.push(types.templateQuasi);\n this.state.exprAllowed = true;\n};\n\ntt.parenL.updateContext = function (prevType) {\n const statementParens =\n prevType === tt._if ||\n prevType === tt._for ||\n prevType === tt._with ||\n prevType === tt._while;\n this.state.context.push(\n statementParens ? types.parenStatement : types.parenExpression,\n );\n this.state.exprAllowed = true;\n};\n\ntt.incDec.updateContext = function () {\n // tokExprAllowed stays unchanged\n};\n\ntt._function.updateContext = tt._class.updateContext = function (prevType) {\n if (\n prevType.beforeExpr &&\n prevType !== tt.semi &&\n prevType !== tt._else &&\n !(prevType === tt._return && this.hasPrecedingLineBreak()) &&\n !(\n (prevType === tt.colon || prevType === tt.braceL) &&\n this.curContext() === types.b_stat\n )\n ) {\n this.state.context.push(types.functionExpression);\n } else {\n this.state.context.push(types.functionStatement);\n }\n\n this.state.exprAllowed = false;\n};\n\ntt.backQuote.updateContext = function () {\n if (this.curContext() === types.template) {\n this.state.context.pop();\n } else {\n this.state.context.push(types.template);\n }\n this.state.exprAllowed = false;\n};\n\n// we don't need to update context for tt.braceBarL because we do not pop context for tt.braceBarR\ntt.braceHashL.updateContext = function () {\n this.state.context.push(types.recordExpression);\n this.state.exprAllowed = true; /* tt.braceHashL.beforeExpr */\n};\n","import * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.js`.\n\n/* prettier-ignore */\nlet 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-\\u08c7\\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\\u0d04-\\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-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\u9ffc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7bf\\ua7c2-\\ua7ca\\ua7f5-\\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-\\uab69\\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\";\n/* prettier-ignore */\nlet 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\\u0b55-\\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\\u0d81-\\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\\u1abf\\u1ac0\\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\\ua82c\\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\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.js`.\n/* prettier-ignore */\n/* prettier-ignore */\nconst 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,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,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,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,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,190,0,80,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,1237,43,8,8952,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,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938];\n/* prettier-ignore */\nconst 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,370,1,154,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,2,11,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,71,5,2,1,3,3,2,0,2,1,13,9,120,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,82,0,12,1,19628,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,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (const char of Array.from(name)) {\n const cp = char.codePointAt(0);\n if (isFirst) {\n if (!isIdentifierStart(cp)) {\n return false;\n }\n isFirst = false;\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n","const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n","/* eslint max-len: 0 */\n\n// @flow\n\nimport * as charCodes from \"charcodes\";\n\nexport {\n isIdentifierStart,\n isIdentifierChar,\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/;\n\n// Test whether a current state character code and next character code is @\n\nexport function isIteratorStart(current: number, next: number): boolean {\n return current === charCodes.atSign && next === charCodes.atSign;\n}\n","// @flow\n\n// Each scope gets a bitset that may contain these flags\n// prettier-ignore\nexport const SCOPE_OTHER = 0b000000000,\n SCOPE_PROGRAM = 0b000000001,\n SCOPE_FUNCTION = 0b000000010,\n SCOPE_ARROW = 0b000000100,\n SCOPE_SIMPLE_CATCH = 0b000001000,\n SCOPE_SUPER = 0b000010000,\n SCOPE_DIRECT_SUPER = 0b000100000,\n SCOPE_CLASS = 0b001000000,\n SCOPE_STATIC_BLOCK = 0b010000000,\n SCOPE_TS_MODULE = 0b100000000,\n SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE;\n\nexport type ScopeFlags =\n | typeof SCOPE_OTHER\n | typeof SCOPE_PROGRAM\n | typeof SCOPE_FUNCTION\n | typeof SCOPE_VAR\n | typeof SCOPE_ARROW\n | typeof SCOPE_SIMPLE_CATCH\n | typeof SCOPE_SUPER\n | typeof SCOPE_DIRECT_SUPER\n | typeof SCOPE_CLASS\n | typeof SCOPE_STATIC_BLOCK;\n\n// These flags are meant to be _only_ used inside the Scope class (or subclasses).\n// prettier-ignore\nexport const BIND_KIND_VALUE = 0b000000_0000_01,\n BIND_KIND_TYPE = 0b000000_0000_10,\n // Used in checkLVal and declareName to determine the type of a binding\n BIND_SCOPE_VAR = 0b000000_0001_00, // Var-style binding\n BIND_SCOPE_LEXICAL = 0b000000_0010_00, // Let- or const-style binding\n BIND_SCOPE_FUNCTION = 0b000000_0100_00, // Function declaration\n BIND_SCOPE_OUTSIDE = 0b000000_1000_00, // Special case for function names as\n // bound inside the function\n // Misc flags\n BIND_FLAGS_NONE = 0b000001_0000_00,\n BIND_FLAGS_CLASS = 0b000010_0000_00,\n BIND_FLAGS_TS_ENUM = 0b000100_0000_00,\n BIND_FLAGS_TS_CONST_ENUM = 0b001000_0000_00,\n BIND_FLAGS_TS_EXPORT_ONLY = 0b010000_0000_00,\n BIND_FLAGS_FLOW_DECLARE_FN = 0b100000_0000_00;\n\n// These flags are meant to be _only_ used by Scope consumers\n// prettier-ignore\n/* = is value? | is type? | scope | misc flags */\nexport const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS ,\n BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0 ,\n BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0 ,\n BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0 ,\n BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS ,\n BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0 ,\n BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM,\n BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n // These bindings don't introduce anything in the scope. They are used for assignments and\n // function expressions IDs.\n BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE ,\n BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE ,\n\n BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM,\n BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n\n BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN;\n\nexport type BindingTypes =\n | typeof BIND_NONE\n | typeof BIND_OUTSIDE\n | typeof BIND_VAR\n | typeof BIND_LEXICAL\n | typeof BIND_CLASS\n | typeof BIND_FUNCTION\n | typeof BIND_TS_INTERFACE\n | typeof BIND_TS_TYPE\n | typeof BIND_TS_ENUM\n | typeof BIND_TS_AMBIENT\n | typeof BIND_TS_NAMESPACE;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_FLAG_STATIC = 0b1_00,\n CLASS_ELEMENT_KIND_GETTER = 0b0_10,\n CLASS_ELEMENT_KIND_SETTER = 0b0_01,\n CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,\n CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,\n CLASS_ELEMENT_OTHER = 0;\n\nexport type ClassElementTypes =\n | typeof CLASS_ELEMENT_STATIC_GETTER\n | typeof CLASS_ELEMENT_STATIC_SETTER\n | typeof CLASS_ELEMENT_INSTANCE_GETTER\n | typeof CLASS_ELEMENT_INSTANCE_SETTER\n | typeof CLASS_ELEMENT_OTHER;\n","// @flow\nimport {\n SCOPE_ARROW,\n SCOPE_DIRECT_SUPER,\n SCOPE_FUNCTION,\n SCOPE_SIMPLE_CATCH,\n SCOPE_SUPER,\n SCOPE_PROGRAM,\n SCOPE_VAR,\n SCOPE_CLASS,\n SCOPE_STATIC_BLOCK,\n BIND_SCOPE_FUNCTION,\n BIND_SCOPE_VAR,\n BIND_SCOPE_LEXICAL,\n BIND_KIND_VALUE,\n type ScopeFlags,\n type BindingTypes,\n} from \"./scopeflags\";\nimport * as N from \"../types\";\nimport { Errors } from \"../parser/error\";\n\n// Start an AST node, attaching a start offset.\nexport class Scope {\n flags: ScopeFlags;\n // A list of var-declared names in the current lexical scope\n var: string[] = [];\n // A list of lexically-declared names in the current lexical scope\n lexical: string[] = [];\n // A list of lexically-declared FunctionDeclaration names in the current lexical scope\n functions: string[] = [];\n\n constructor(flags: ScopeFlags) {\n this.flags = flags;\n }\n}\n\ntype raiseFunction = (number, string, ...any) => void;\n\n// The functions in this module keep track of declared variables in the\n// current scope in order to detect duplicate variable names.\nexport default class ScopeHandler {\n scopeStack: Array = [];\n declare raise: raiseFunction;\n declare inModule: boolean;\n undefinedExports: Map = new Map();\n undefinedPrivateNames: Map = new Map();\n\n constructor(raise: raiseFunction, inModule: boolean) {\n this.raise = raise;\n this.inModule = inModule;\n }\n\n get inFunction() {\n return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;\n }\n get allowSuper() {\n return (this.currentThisScope().flags & SCOPE_SUPER) > 0;\n }\n get allowDirectSuper() {\n return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0;\n }\n get inClass() {\n return (this.currentThisScope().flags & SCOPE_CLASS) > 0;\n }\n get inStaticBlock() {\n return (this.currentThisScope().flags & SCOPE_STATIC_BLOCK) > 0;\n }\n get inNonArrowFunction() {\n return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0;\n }\n get treatFunctionsAsVar() {\n return this.treatFunctionsAsVarInScope(this.currentScope());\n }\n\n createScope(flags: ScopeFlags): Scope {\n return new Scope(flags);\n }\n // This method will be overwritten by subclasses\n /*:: +createScope: (flags: ScopeFlags) => IScope; */\n\n enter(flags: ScopeFlags) {\n this.scopeStack.push(this.createScope(flags));\n }\n\n exit() {\n this.scopeStack.pop();\n }\n\n // The spec says:\n // > At the top level of a function, or script, function declarations are\n // > treated like var declarations rather than like lexical declarations.\n treatFunctionsAsVarInScope(scope: IScope): boolean {\n return !!(\n scope.flags & SCOPE_FUNCTION ||\n (!this.inModule && scope.flags & SCOPE_PROGRAM)\n );\n }\n\n declareName(name: string, bindingType: BindingTypes, pos: number) {\n let scope = this.currentScope();\n if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n\n if (bindingType & BIND_SCOPE_FUNCTION) {\n scope.functions.push(name);\n } else {\n scope.lexical.push(name);\n }\n\n if (bindingType & BIND_SCOPE_LEXICAL) {\n this.maybeExportDefined(scope, name);\n }\n } else if (bindingType & BIND_SCOPE_VAR) {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n scope = this.scopeStack[i];\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n scope.var.push(name);\n this.maybeExportDefined(scope, name);\n\n if (scope.flags & SCOPE_VAR) break;\n }\n }\n if (this.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n maybeExportDefined(scope: IScope, name: string) {\n if (this.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n checkRedeclarationInScope(\n scope: IScope,\n name: string,\n bindingType: BindingTypes,\n pos: number,\n ) {\n if (this.isRedeclaredInScope(scope, name, bindingType)) {\n this.raise(pos, Errors.VarRedeclaration, name);\n }\n }\n\n isRedeclaredInScope(\n scope: IScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (!(bindingType & BIND_KIND_VALUE)) return false;\n\n if (bindingType & BIND_SCOPE_LEXICAL) {\n return (\n scope.lexical.indexOf(name) > -1 ||\n scope.functions.indexOf(name) > -1 ||\n scope.var.indexOf(name) > -1\n );\n }\n\n if (bindingType & BIND_SCOPE_FUNCTION) {\n return (\n scope.lexical.indexOf(name) > -1 ||\n (!this.treatFunctionsAsVarInScope(scope) &&\n scope.var.indexOf(name) > -1)\n );\n }\n\n return (\n (scope.lexical.indexOf(name) > -1 &&\n !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical[0] === name)) ||\n (!this.treatFunctionsAsVarInScope(scope) &&\n scope.functions.indexOf(name) > -1)\n );\n }\n\n checkLocalExport(id: N.Identifier) {\n if (\n this.scopeStack[0].lexical.indexOf(id.name) === -1 &&\n this.scopeStack[0].var.indexOf(id.name) === -1 &&\n // In strict mode, scope.functions will always be empty.\n // Modules are strict by default, but the `scriptMode` option\n // can overwrite this behavior.\n this.scopeStack[0].functions.indexOf(id.name) === -1\n ) {\n this.undefinedExports.set(id.name, id.start);\n }\n }\n\n currentScope(): IScope {\n return this.scopeStack[this.scopeStack.length - 1];\n }\n\n // $FlowIgnore\n currentVarScope(): IScope {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const scope = this.scopeStack[i];\n if (scope.flags & SCOPE_VAR) {\n return scope;\n }\n }\n }\n\n // Could be useful for `arguments`, `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\n // $FlowIgnore\n currentThisScope(): IScope {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const scope = this.scopeStack[i];\n if (\n (scope.flags & SCOPE_VAR || scope.flags & SCOPE_CLASS) &&\n !(scope.flags & SCOPE_ARROW)\n ) {\n return scope;\n }\n }\n }\n}\n","// @flow\n\nimport ScopeHandler, { Scope } from \"../../util/scope\";\nimport {\n BIND_FLAGS_FLOW_DECLARE_FN,\n type ScopeFlags,\n type BindingTypes,\n} from \"../../util/scopeflags\";\nimport * as N from \"../../types\";\n\n// Reference implementation: https://github.com/facebook/flow/blob/23aeb2a2ef6eb4241ce178fde5d8f17c5f747fb5/src/typing/env.ml#L536-L584\nclass FlowScope extends Scope {\n // declare function foo(): type;\n declareFunctions: string[] = [];\n}\n\nexport default class FlowScopeHandler extends ScopeHandler {\n createScope(flags: ScopeFlags): FlowScope {\n return new FlowScope(flags);\n }\n\n declareName(name: string, bindingType: BindingTypes, pos: number) {\n const scope = this.currentScope();\n if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n this.maybeExportDefined(scope, name);\n scope.declareFunctions.push(name);\n return;\n }\n\n super.declareName(...arguments);\n }\n\n isRedeclaredInScope(\n scope: FlowScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (super.isRedeclaredInScope(...arguments)) return true;\n\n if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {\n return (\n !scope.declareFunctions.includes(name) &&\n (scope.lexical.includes(name) || scope.functions.includes(name))\n );\n }\n\n return false;\n }\n\n checkLocalExport(id: N.Identifier) {\n if (this.scopeStack[0].declareFunctions.indexOf(id.name) === -1) {\n super.checkLocalExport(id);\n }\n }\n}\n","// @flow\n\n/*:: declare var invariant; */\n\n// Error messages are colocated with the plugin.\n/* eslint-disable @babel/development-internal/dry-error-messages */\n\nimport type Parser from \"../../parser\";\nimport { types as tt, type TokenType } from \"../../tokenizer/types\";\nimport * as N from \"../../types\";\nimport type { Pos, Position } from \"../../util/location\";\nimport type State from \"../../tokenizer/state\";\nimport { types as tc } from \"../../tokenizer/context\";\nimport * as charCodes from \"charcodes\";\nimport { isIteratorStart, isKeyword } from \"../../util/identifier\";\nimport FlowScopeHandler from \"./scope\";\nimport {\n type BindingTypes,\n BIND_LEXICAL,\n BIND_VAR,\n BIND_FUNCTION,\n BIND_FLOW_DECLARE_FN,\n SCOPE_ARROW,\n SCOPE_FUNCTION,\n SCOPE_OTHER,\n} from \"../../util/scopeflags\";\nimport type { ExpressionErrors } from \"../../parser/util\";\nimport { Errors } from \"../../parser/error\";\n\nconst reservedTypes = new Set([\n \"_\",\n \"any\",\n \"bool\",\n \"boolean\",\n \"empty\",\n \"extends\",\n \"false\",\n \"interface\",\n \"mixed\",\n \"null\",\n \"number\",\n \"static\",\n \"string\",\n \"true\",\n \"typeof\",\n \"void\",\n]);\n\n/* eslint sort-keys: \"error\" */\n// The Errors key follows https://github.com/facebook/flow/blob/master/src/parser/parse_error.ml unless it does not exist\nconst FlowErrors = Object.freeze({\n AmbiguousConditionalArrow:\n \"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.\",\n AmbiguousDeclareModuleKind:\n \"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module\",\n AssignReservedType: \"Cannot overwrite reserved type %0\",\n DeclareClassElement:\n \"The `declare` modifier can only appear on class fields.\",\n DeclareClassFieldInitializer:\n \"Initializers are not allowed in fields with the `declare` modifier.\",\n DuplicateDeclareModuleExports: \"Duplicate `declare module.exports` statement\",\n EnumBooleanMemberNotInitialized:\n \"Boolean enum members need to be initialized. Use either `%0 = true,` or `%0 = false,` in enum `%1`.\",\n EnumDuplicateMemberName:\n \"Enum member names need to be unique, but the name `%0` has already been used before in enum `%1`.\",\n EnumInconsistentMemberValues:\n \"Enum `%0` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.\",\n EnumInvalidExplicitType:\n \"Enum type `%1` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.\",\n EnumInvalidExplicitTypeUnknownSupplied:\n \"Supplied enum type is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.\",\n EnumInvalidMemberInitializerPrimaryType:\n \"Enum `%0` has type `%2`, so the initializer of `%1` needs to be a %2 literal.\",\n EnumInvalidMemberInitializerSymbolType:\n \"Symbol enum members cannot be initialized. Use `%1,` in enum `%0`.\",\n EnumInvalidMemberInitializerUnknownType:\n \"The enum member initializer for `%1` needs to be a literal (either a boolean, number, or string) in enum `%0`.\",\n EnumInvalidMemberName:\n \"Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `%0`, consider using `%1`, in enum `%2`.\",\n EnumNumberMemberNotInitialized:\n \"Number enum members need to be initialized, e.g. `%1 = 1` in enum `%0`.\",\n EnumStringMemberInconsistentlyInitailized:\n \"String enum members need to consistently either all use initializers, or use no initializers, in enum `%0`.\",\n GetterMayNotHaveThisParam: \"A getter cannot have a `this` parameter.\",\n ImportTypeShorthandOnlyInPureImport:\n \"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements\",\n InexactInsideExact:\n \"Explicit inexact syntax cannot appear inside an explicit exact object type\",\n InexactInsideNonObject:\n \"Explicit inexact syntax cannot appear in class or interface definitions\",\n InexactVariance: \"Explicit inexact syntax cannot have variance\",\n InvalidNonTypeImportInDeclareModule:\n \"Imports within a `declare module` body must always be `import type` or `import typeof`\",\n MissingTypeParamDefault:\n \"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.\",\n NestedDeclareModule:\n \"`declare module` cannot be used inside another `declare module`\",\n NestedFlowComment: \"Cannot have a flow comment inside another flow comment\",\n OptionalBindingPattern:\n \"A binding pattern parameter cannot be optional in an implementation signature.\",\n SetterMayNotHaveThisParam: \"A setter cannot have a `this` parameter.\",\n SpreadVariance: \"Spread properties cannot have variance\",\n ThisParamAnnotationRequired:\n \"A type annotation is required for the `this` parameter.\",\n ThisParamBannedInConstructor:\n \"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.\",\n ThisParamMayNotBeOptional: \"The `this` parameter cannot be optional.\",\n ThisParamMustBeFirst:\n \"The `this` parameter must be the first function parameter.\",\n ThisParamNoDefault: \"The `this` parameter may not have a default value.\",\n TypeBeforeInitializer:\n \"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`\",\n TypeCastInPattern:\n \"The type cast expression is expected to be wrapped with parenthesis\",\n UnexpectedExplicitInexactInObject:\n \"Explicit inexact syntax must appear at the end of an inexact object\",\n UnexpectedReservedType: \"Unexpected reserved type %0\",\n UnexpectedReservedUnderscore:\n \"`_` is only allowed as a type argument to call or new\",\n UnexpectedSpaceBetweenModuloChecks:\n \"Spaces between `%` and `checks` are not allowed here.\",\n UnexpectedSpreadType:\n \"Spread operator cannot appear in class or interface definitions\",\n UnexpectedSubtractionOperand:\n 'Unexpected token, expected \"number\" or \"bigint\"',\n UnexpectedTokenAfterTypeParameter:\n \"Expected an arrow function after this type parameter declaration\",\n UnexpectedTypeParameterBeforeAsyncArrowFunction:\n \"Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`\",\n UnsupportedDeclareExportKind:\n \"`declare export %0` is not supported. Use `%1` instead\",\n UnsupportedStatementInDeclareModule:\n \"Only declares and type imports are allowed inside declare module\",\n UnterminatedFlowComment: \"Unterminated flow-comment\",\n});\n/* eslint-disable sort-keys */\n\nfunction isEsModuleType(bodyElement: N.Node): boolean {\n return (\n bodyElement.type === \"DeclareExportAllDeclaration\" ||\n (bodyElement.type === \"DeclareExportDeclaration\" &&\n (!bodyElement.declaration ||\n (bodyElement.declaration.type !== \"TypeAlias\" &&\n bodyElement.declaration.type !== \"InterfaceDeclaration\")))\n );\n}\n\nfunction hasTypeImportKind(node: N.Node): boolean {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n}\n\nfunction isMaybeDefaultImport(state: State): boolean {\n return (\n (state.type === tt.name || !!state.type.keyword) && state.value !== \"from\"\n );\n}\n\nconst exportSuggestions = {\n const: \"declare export var\",\n let: \"declare export var\",\n type: \"export type\",\n interface: \"export interface\",\n};\n\n// Like Array#filter, but returns a tuple [ acceptedElements, discardedElements ]\nfunction partition(\n list: T[],\n test: (T, number, T[]) => ?boolean,\n): [T[], T[]] {\n const list1 = [];\n const list2 = [];\n for (let i = 0; i < list.length; i++) {\n (test(list[i], i, list) ? list1 : list2).push(list[i]);\n }\n return [list1, list2];\n}\n\nconst FLOW_PRAGMA_REGEX = /\\*?\\s*@((?:no)?flow)\\b/;\n\n// Flow enums types\ntype EnumExplicitType = null | \"boolean\" | \"number\" | \"string\" | \"symbol\";\ntype EnumContext = {|\n enumName: string,\n explicitType: EnumExplicitType,\n memberName: string,\n|};\ntype EnumMemberInit =\n | {| type: \"number\", pos: number, value: N.Node |}\n | {| type: \"string\", pos: number, value: N.Node |}\n | {| type: \"boolean\", pos: number, value: N.Node |}\n | {| type: \"invalid\", pos: number |}\n | {| type: \"none\", pos: number |};\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n // The value of the @flow/@noflow pragma. Initially undefined, transitions\n // to \"@flow\" or \"@noflow\" if we see a pragma. Transitions to null if we are\n // past the initial comment.\n flowPragma: void | null | \"flow\" | \"noflow\" = undefined;\n\n getScopeHandler(): Class {\n return FlowScopeHandler;\n }\n\n shouldParseTypes(): boolean {\n return this.getPluginOption(\"flow\", \"all\") || this.flowPragma === \"flow\";\n }\n\n shouldParseEnums(): boolean {\n return !!this.getPluginOption(\"flow\", \"enums\");\n }\n\n finishToken(type: TokenType, val: any): void {\n if (\n type !== tt.string &&\n type !== tt.semi &&\n type !== tt.interpreterDirective\n ) {\n if (this.flowPragma === undefined) {\n this.flowPragma = null;\n }\n }\n return super.finishToken(type, val);\n }\n\n addComment(comment: N.Comment): void {\n if (this.flowPragma === undefined) {\n // Try to parse a flow pragma.\n const matches = FLOW_PRAGMA_REGEX.exec(comment.value);\n if (!matches) {\n // do nothing\n } else if (matches[1] === \"flow\") {\n this.flowPragma = \"flow\";\n } else if (matches[1] === \"noflow\") {\n this.flowPragma = \"noflow\";\n } else {\n throw new Error(\"Unexpected flow pragma\");\n }\n }\n return super.addComment(comment);\n }\n\n flowParseTypeInitialiser(tok?: TokenType): N.FlowType {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(tok || tt.colon);\n\n const type = this.flowParseType();\n this.state.inType = oldInType;\n return type;\n }\n\n flowParsePredicate(): N.FlowType {\n const node = this.startNode();\n const moduloLoc = this.state.startLoc;\n const moduloPos = this.state.start;\n this.expect(tt.modulo);\n const checksLoc = this.state.startLoc;\n this.expectContextual(\"checks\");\n // Force '%' and 'checks' to be adjacent\n if (\n moduloLoc.line !== checksLoc.line ||\n moduloLoc.column !== checksLoc.column - 1\n ) {\n this.raise(moduloPos, FlowErrors.UnexpectedSpaceBetweenModuloChecks);\n }\n if (this.eat(tt.parenL)) {\n node.value = this.parseExpression();\n this.expect(tt.parenR);\n return this.finishNode(node, \"DeclaredPredicate\");\n } else {\n return this.finishNode(node, \"InferredPredicate\");\n }\n }\n\n flowParseTypeAndPredicateInitialiser(): [?N.FlowType, ?N.FlowPredicate] {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(tt.colon);\n let type = null;\n let predicate = null;\n if (this.match(tt.modulo)) {\n this.state.inType = oldInType;\n predicate = this.flowParsePredicate();\n } else {\n type = this.flowParseType();\n this.state.inType = oldInType;\n if (this.match(tt.modulo)) {\n predicate = this.flowParsePredicate();\n }\n }\n return [type, predicate];\n }\n\n flowParseDeclareClass(node: N.FlowDeclareClass): N.FlowDeclareClass {\n this.next();\n this.flowParseInterfaceish(node, /*isClass*/ true);\n return this.finishNode(node, \"DeclareClass\");\n }\n\n flowParseDeclareFunction(\n node: N.FlowDeclareFunction,\n ): N.FlowDeclareFunction {\n this.next();\n\n const id = (node.id = this.parseIdentifier());\n\n const typeNode = this.startNode();\n const typeContainer = this.startNode();\n\n if (this.isRelational(\"<\")) {\n typeNode.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n typeNode.typeParameters = null;\n }\n\n this.expect(tt.parenL);\n const tmp = this.flowParseFunctionTypeParams();\n typeNode.params = tmp.params;\n typeNode.rest = tmp.rest;\n typeNode.this = tmp._this;\n this.expect(tt.parenR);\n\n [\n // $FlowFixMe (destructuring not supported yet)\n typeNode.returnType,\n // $FlowFixMe (destructuring not supported yet)\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser();\n\n typeContainer.typeAnnotation = this.finishNode(\n typeNode,\n \"FunctionTypeAnnotation\",\n );\n\n id.typeAnnotation = this.finishNode(typeContainer, \"TypeAnnotation\");\n\n this.resetEndLocation(id);\n this.semicolon();\n\n this.scope.declareName(node.id.name, BIND_FLOW_DECLARE_FN, node.id.start);\n\n return this.finishNode(node, \"DeclareFunction\");\n }\n\n flowParseDeclare(\n node: N.FlowDeclare,\n insideModule?: boolean,\n ): N.FlowDeclare {\n if (this.match(tt._class)) {\n return this.flowParseDeclareClass(node);\n } else if (this.match(tt._function)) {\n return this.flowParseDeclareFunction(node);\n } else if (this.match(tt._var)) {\n return this.flowParseDeclareVariable(node);\n } else if (this.eatContextual(\"module\")) {\n if (this.match(tt.dot)) {\n return this.flowParseDeclareModuleExports(node);\n } else {\n if (insideModule) {\n this.raise(this.state.lastTokStart, FlowErrors.NestedDeclareModule);\n }\n return this.flowParseDeclareModule(node);\n }\n } else if (this.isContextual(\"type\")) {\n return this.flowParseDeclareTypeAlias(node);\n } else if (this.isContextual(\"opaque\")) {\n return this.flowParseDeclareOpaqueType(node);\n } else if (this.isContextual(\"interface\")) {\n return this.flowParseDeclareInterface(node);\n } else if (this.match(tt._export)) {\n return this.flowParseDeclareExportDeclaration(node, insideModule);\n } else {\n throw this.unexpected();\n }\n }\n\n flowParseDeclareVariable(\n node: N.FlowDeclareVariable,\n ): N.FlowDeclareVariable {\n this.next();\n node.id = this.flowParseTypeAnnotatableIdentifier(\n /*allowPrimitiveOverride*/ true,\n );\n this.scope.declareName(node.id.name, BIND_VAR, node.id.start);\n this.semicolon();\n return this.finishNode(node, \"DeclareVariable\");\n }\n\n flowParseDeclareModule(node: N.FlowDeclareModule): N.FlowDeclareModule {\n this.scope.enter(SCOPE_OTHER);\n\n if (this.match(tt.string)) {\n node.id = this.parseExprAtom();\n } else {\n node.id = this.parseIdentifier();\n }\n\n const bodyNode = (node.body = this.startNode());\n const body = (bodyNode.body = []);\n this.expect(tt.braceL);\n while (!this.match(tt.braceR)) {\n let bodyNode = this.startNode();\n\n if (this.match(tt._import)) {\n this.next();\n if (!this.isContextual(\"type\") && !this.match(tt._typeof)) {\n this.raise(\n this.state.lastTokStart,\n FlowErrors.InvalidNonTypeImportInDeclareModule,\n );\n }\n this.parseImport(bodyNode);\n } else {\n this.expectContextual(\n \"declare\",\n FlowErrors.UnsupportedStatementInDeclareModule,\n );\n\n bodyNode = this.flowParseDeclare(bodyNode, true);\n }\n\n body.push(bodyNode);\n }\n\n this.scope.exit();\n\n this.expect(tt.braceR);\n\n this.finishNode(bodyNode, \"BlockStatement\");\n\n let kind = null;\n let hasModuleExport = false;\n body.forEach(bodyElement => {\n if (isEsModuleType(bodyElement)) {\n if (kind === \"CommonJS\") {\n this.raise(\n bodyElement.start,\n FlowErrors.AmbiguousDeclareModuleKind,\n );\n }\n kind = \"ES\";\n } else if (bodyElement.type === \"DeclareModuleExports\") {\n if (hasModuleExport) {\n this.raise(\n bodyElement.start,\n FlowErrors.DuplicateDeclareModuleExports,\n );\n }\n if (kind === \"ES\") {\n this.raise(\n bodyElement.start,\n FlowErrors.AmbiguousDeclareModuleKind,\n );\n }\n kind = \"CommonJS\";\n hasModuleExport = true;\n }\n });\n\n node.kind = kind || \"CommonJS\";\n return this.finishNode(node, \"DeclareModule\");\n }\n\n flowParseDeclareExportDeclaration(\n node: N.FlowDeclareExportDeclaration,\n insideModule: ?boolean,\n ): N.FlowDeclareExportDeclaration {\n this.expect(tt._export);\n\n if (this.eat(tt._default)) {\n if (this.match(tt._function) || this.match(tt._class)) {\n // declare export default class ...\n // declare export default function ...\n node.declaration = this.flowParseDeclare(this.startNode());\n } else {\n // declare export default [type];\n node.declaration = this.flowParseType();\n this.semicolon();\n }\n node.default = true;\n\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else {\n if (\n this.match(tt._const) ||\n this.isLet() ||\n ((this.isContextual(\"type\") || this.isContextual(\"interface\")) &&\n !insideModule)\n ) {\n const label = this.state.value;\n const suggestion = exportSuggestions[label];\n\n throw this.raise(\n this.state.start,\n FlowErrors.UnsupportedDeclareExportKind,\n label,\n suggestion,\n );\n }\n\n if (\n this.match(tt._var) || // declare export var ...\n this.match(tt._function) || // declare export function ...\n this.match(tt._class) || // declare export class ...\n this.isContextual(\"opaque\") // declare export opaque ..\n ) {\n node.declaration = this.flowParseDeclare(this.startNode());\n node.default = false;\n\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else if (\n this.match(tt.star) || // declare export * from ''\n this.match(tt.braceL) || // declare export {} ...\n this.isContextual(\"interface\") || // declare export interface ...\n this.isContextual(\"type\") || // declare export type ...\n this.isContextual(\"opaque\") // declare export opaque type ...\n ) {\n node = this.parseExport(node);\n if (node.type === \"ExportNamedDeclaration\") {\n // flow does not support the ExportNamedDeclaration\n // $FlowIgnore\n node.type = \"ExportDeclaration\";\n // $FlowFixMe\n node.default = false;\n delete node.exportKind;\n }\n\n // $FlowIgnore\n node.type = \"Declare\" + node.type;\n\n return node;\n }\n }\n\n throw this.unexpected();\n }\n\n flowParseDeclareModuleExports(\n node: N.FlowDeclareModuleExports,\n ): N.FlowDeclareModuleExports {\n this.next();\n this.expectContextual(\"exports\");\n node.typeAnnotation = this.flowParseTypeAnnotation();\n this.semicolon();\n\n return this.finishNode(node, \"DeclareModuleExports\");\n }\n\n flowParseDeclareTypeAlias(\n node: N.FlowDeclareTypeAlias,\n ): N.FlowDeclareTypeAlias {\n this.next();\n this.flowParseTypeAlias(node);\n // Don't do finishNode as we don't want to process comments twice\n node.type = \"DeclareTypeAlias\";\n return node;\n }\n\n flowParseDeclareOpaqueType(\n node: N.FlowDeclareOpaqueType,\n ): N.FlowDeclareOpaqueType {\n this.next();\n this.flowParseOpaqueType(node, true);\n // Don't do finishNode as we don't want to process comments twice\n node.type = \"DeclareOpaqueType\";\n return node;\n }\n\n flowParseDeclareInterface(\n node: N.FlowDeclareInterface,\n ): N.FlowDeclareInterface {\n this.next();\n this.flowParseInterfaceish(node);\n return this.finishNode(node, \"DeclareInterface\");\n }\n\n // Interfaces\n\n flowParseInterfaceish(\n node: N.FlowDeclare,\n isClass?: boolean = false,\n ): void {\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ !isClass,\n /* declaration */ true,\n );\n\n this.scope.declareName(\n node.id.name,\n isClass ? BIND_FUNCTION : BIND_LEXICAL,\n node.id.start,\n );\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.extends = [];\n node.implements = [];\n node.mixins = [];\n\n if (this.eat(tt._extends)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (!isClass && this.eat(tt.comma));\n }\n\n if (this.isContextual(\"mixins\")) {\n this.next();\n do {\n node.mixins.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n\n if (this.isContextual(\"implements\")) {\n this.next();\n do {\n node.implements.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n\n node.body = this.flowParseObjectType({\n allowStatic: isClass,\n allowExact: false,\n allowSpread: false,\n allowProto: isClass,\n allowInexact: false,\n });\n }\n\n flowParseInterfaceExtends(): N.FlowInterfaceExtends {\n const node = this.startNode();\n\n node.id = this.flowParseQualifiedTypeIdentifier();\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n\n return this.finishNode(node, \"InterfaceExtends\");\n }\n\n flowParseInterface(node: N.FlowInterface): N.FlowInterface {\n this.flowParseInterfaceish(node);\n return this.finishNode(node, \"InterfaceDeclaration\");\n }\n\n checkNotUnderscore(word: string) {\n if (word === \"_\") {\n this.raise(this.state.start, FlowErrors.UnexpectedReservedUnderscore);\n }\n }\n\n checkReservedType(word: string, startLoc: number, declaration?: boolean) {\n if (!reservedTypes.has(word)) return;\n\n this.raise(\n startLoc,\n declaration\n ? FlowErrors.AssignReservedType\n : FlowErrors.UnexpectedReservedType,\n word,\n );\n }\n\n flowParseRestrictedIdentifier(\n liberal?: boolean,\n declaration?: boolean,\n ): N.Identifier {\n this.checkReservedType(this.state.value, this.state.start, declaration);\n return this.parseIdentifier(liberal);\n }\n\n // Type aliases\n\n flowParseTypeAlias(node: N.FlowTypeAlias): N.FlowTypeAlias {\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ false,\n /* declaration */ true,\n );\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.right = this.flowParseTypeInitialiser(tt.eq);\n this.semicolon();\n\n return this.finishNode(node, \"TypeAlias\");\n }\n\n flowParseOpaqueType(\n node: N.FlowOpaqueType,\n declare: boolean,\n ): N.FlowOpaqueType {\n this.expectContextual(\"type\");\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ true,\n /* declaration */ true,\n );\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n // Parse the supertype\n node.supertype = null;\n if (this.match(tt.colon)) {\n node.supertype = this.flowParseTypeInitialiser(tt.colon);\n }\n\n node.impltype = null;\n if (!declare) {\n node.impltype = this.flowParseTypeInitialiser(tt.eq);\n }\n this.semicolon();\n\n return this.finishNode(node, \"OpaqueType\");\n }\n\n // Type annotations\n\n flowParseTypeParameter(requireDefault?: boolean = false): N.TypeParameter {\n const nodeStart = this.state.start;\n\n const node = this.startNode();\n\n const variance = this.flowParseVariance();\n\n const ident = this.flowParseTypeAnnotatableIdentifier();\n node.name = ident.name;\n node.variance = variance;\n node.bound = ident.typeAnnotation;\n\n if (this.match(tt.eq)) {\n this.eat(tt.eq);\n node.default = this.flowParseType();\n } else {\n if (requireDefault) {\n this.raise(nodeStart, FlowErrors.MissingTypeParamDefault);\n }\n }\n\n return this.finishNode(node, \"TypeParameter\");\n }\n\n flowParseTypeParameterDeclaration(): N.TypeParameterDeclaration {\n const oldInType = this.state.inType;\n const node = this.startNode();\n node.params = [];\n\n this.state.inType = true;\n\n // istanbul ignore else: this condition is already checked at all call sites\n if (this.isRelational(\"<\") || this.match(tt.jsxTagStart)) {\n this.next();\n } else {\n this.unexpected();\n }\n\n let defaultRequired = false;\n\n do {\n const typeParameter = this.flowParseTypeParameter(defaultRequired);\n\n node.params.push(typeParameter);\n\n if (typeParameter.default) {\n defaultRequired = true;\n }\n\n if (!this.isRelational(\">\")) {\n this.expect(tt.comma);\n }\n } while (!this.isRelational(\">\"));\n this.expectRelational(\">\");\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterDeclaration\");\n }\n\n flowParseTypeParameterInstantiation(): N.TypeParameterInstantiation {\n const node = this.startNode();\n const oldInType = this.state.inType;\n node.params = [];\n\n this.state.inType = true;\n\n this.expectRelational(\"<\");\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = false;\n while (!this.isRelational(\">\")) {\n node.params.push(this.flowParseType());\n if (!this.isRelational(\">\")) {\n this.expect(tt.comma);\n }\n }\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n this.expectRelational(\">\");\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n\n flowParseTypeParameterInstantiationCallOrNew(): N.TypeParameterInstantiation {\n const node = this.startNode();\n const oldInType = this.state.inType;\n node.params = [];\n\n this.state.inType = true;\n\n this.expectRelational(\"<\");\n while (!this.isRelational(\">\")) {\n node.params.push(this.flowParseTypeOrImplicitInstantiation());\n if (!this.isRelational(\">\")) {\n this.expect(tt.comma);\n }\n }\n this.expectRelational(\">\");\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n\n flowParseInterfaceType(): N.FlowInterfaceType {\n const node = this.startNode();\n this.expectContextual(\"interface\");\n\n node.extends = [];\n if (this.eat(tt._extends)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n\n node.body = this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: false,\n allowProto: false,\n allowInexact: false,\n });\n\n return this.finishNode(node, \"InterfaceTypeAnnotation\");\n }\n\n flowParseObjectPropertyKey(): N.Expression {\n return this.match(tt.num) || this.match(tt.string)\n ? this.parseExprAtom()\n : this.parseIdentifier(true);\n }\n\n flowParseObjectTypeIndexer(\n node: N.FlowObjectTypeIndexer,\n isStatic: boolean,\n variance: ?N.FlowVariance,\n ): N.FlowObjectTypeIndexer {\n node.static = isStatic;\n\n // Note: bracketL has already been consumed\n if (this.lookahead().type === tt.colon) {\n node.id = this.flowParseObjectPropertyKey();\n node.key = this.flowParseTypeInitialiser();\n } else {\n node.id = null;\n node.key = this.flowParseType();\n }\n this.expect(tt.bracketR);\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n\n return this.finishNode(node, \"ObjectTypeIndexer\");\n }\n\n flowParseObjectTypeInternalSlot(\n node: N.FlowObjectTypeInternalSlot,\n isStatic: boolean,\n ): N.FlowObjectTypeInternalSlot {\n node.static = isStatic;\n // Note: both bracketL have already been consumed\n node.id = this.flowParseObjectPropertyKey();\n this.expect(tt.bracketR);\n this.expect(tt.bracketR);\n if (this.isRelational(\"<\") || this.match(tt.parenL)) {\n node.method = true;\n node.optional = false;\n node.value = this.flowParseObjectTypeMethodish(\n this.startNodeAt(node.start, node.loc.start),\n );\n } else {\n node.method = false;\n if (this.eat(tt.question)) {\n node.optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n }\n return this.finishNode(node, \"ObjectTypeInternalSlot\");\n }\n\n flowParseObjectTypeMethodish(\n node: N.FlowFunctionTypeAnnotation,\n ): N.FlowFunctionTypeAnnotation {\n node.params = [];\n node.rest = null;\n node.typeParameters = null;\n node.this = null;\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n this.expect(tt.parenL);\n if (this.match(tt._this)) {\n node.this = this.flowParseFunctionTypeParam(/* first */ true);\n // match Flow parser behavior\n node.this.name = null;\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n node.params.push(this.flowParseFunctionTypeParam(false));\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n\n if (this.eat(tt.ellipsis)) {\n node.rest = this.flowParseFunctionTypeParam(false);\n }\n this.expect(tt.parenR);\n node.returnType = this.flowParseTypeInitialiser();\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n\n flowParseObjectTypeCallProperty(\n node: N.FlowObjectTypeCallProperty,\n isStatic: boolean,\n ): N.FlowObjectTypeCallProperty {\n const valueNode = this.startNode();\n node.static = isStatic;\n node.value = this.flowParseObjectTypeMethodish(valueNode);\n return this.finishNode(node, \"ObjectTypeCallProperty\");\n }\n\n flowParseObjectType({\n allowStatic,\n allowExact,\n allowSpread,\n allowProto,\n allowInexact,\n }: {\n allowStatic: boolean,\n allowExact: boolean,\n allowSpread: boolean,\n allowProto: boolean,\n allowInexact: boolean,\n }): N.FlowObjectTypeAnnotation {\n const oldInType = this.state.inType;\n this.state.inType = true;\n\n const nodeStart = this.startNode();\n\n nodeStart.callProperties = [];\n nodeStart.properties = [];\n nodeStart.indexers = [];\n nodeStart.internalSlots = [];\n\n let endDelim;\n let exact;\n let inexact = false;\n if (allowExact && this.match(tt.braceBarL)) {\n this.expect(tt.braceBarL);\n endDelim = tt.braceBarR;\n exact = true;\n } else {\n this.expect(tt.braceL);\n endDelim = tt.braceR;\n exact = false;\n }\n\n nodeStart.exact = exact;\n\n while (!this.match(endDelim)) {\n let isStatic = false;\n let protoStart: ?number = null;\n let inexactStart: ?number = null;\n const node = this.startNode();\n\n if (allowProto && this.isContextual(\"proto\")) {\n const lookahead = this.lookahead();\n\n if (lookahead.type !== tt.colon && lookahead.type !== tt.question) {\n this.next();\n protoStart = this.state.start;\n allowStatic = false;\n }\n }\n\n if (allowStatic && this.isContextual(\"static\")) {\n const lookahead = this.lookahead();\n\n // static is a valid identifier name\n if (lookahead.type !== tt.colon && lookahead.type !== tt.question) {\n this.next();\n isStatic = true;\n }\n }\n\n const variance = this.flowParseVariance();\n\n if (this.eat(tt.bracketL)) {\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n if (this.eat(tt.bracketL)) {\n if (variance) {\n this.unexpected(variance.start);\n }\n nodeStart.internalSlots.push(\n this.flowParseObjectTypeInternalSlot(node, isStatic),\n );\n } else {\n nodeStart.indexers.push(\n this.flowParseObjectTypeIndexer(node, isStatic, variance),\n );\n }\n } else if (this.match(tt.parenL) || this.isRelational(\"<\")) {\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n if (variance) {\n this.unexpected(variance.start);\n }\n nodeStart.callProperties.push(\n this.flowParseObjectTypeCallProperty(node, isStatic),\n );\n } else {\n let kind = \"init\";\n\n if (this.isContextual(\"get\") || this.isContextual(\"set\")) {\n const lookahead = this.lookahead();\n if (\n lookahead.type === tt.name ||\n lookahead.type === tt.string ||\n lookahead.type === tt.num\n ) {\n kind = this.state.value;\n this.next();\n }\n }\n\n const propOrInexact = this.flowParseObjectTypeProperty(\n node,\n isStatic,\n protoStart,\n variance,\n kind,\n allowSpread,\n allowInexact ?? !exact,\n );\n\n if (propOrInexact === null) {\n inexact = true;\n inexactStart = this.state.lastTokStart;\n } else {\n nodeStart.properties.push(propOrInexact);\n }\n }\n\n this.flowObjectTypeSemicolon();\n\n if (\n inexactStart &&\n !this.match(tt.braceR) &&\n !this.match(tt.braceBarR)\n ) {\n this.raise(\n inexactStart,\n FlowErrors.UnexpectedExplicitInexactInObject,\n );\n }\n }\n\n this.expect(endDelim);\n\n /* The inexact flag should only be added on ObjectTypeAnnotations that\n * are not the body of an interface, declare interface, or declare class.\n * Since spreads are only allowed in object types, checking that is\n * sufficient here.\n */\n if (allowSpread) {\n nodeStart.inexact = inexact;\n }\n\n const out = this.finishNode(nodeStart, \"ObjectTypeAnnotation\");\n\n this.state.inType = oldInType;\n\n return out;\n }\n\n flowParseObjectTypeProperty(\n node: N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty,\n isStatic: boolean,\n protoStart: ?number,\n variance: ?N.FlowVariance,\n kind: string,\n allowSpread: boolean,\n allowInexact: boolean,\n ): (N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty) | null {\n if (this.eat(tt.ellipsis)) {\n const isInexactToken =\n this.match(tt.comma) ||\n this.match(tt.semi) ||\n this.match(tt.braceR) ||\n this.match(tt.braceBarR);\n\n if (isInexactToken) {\n if (!allowSpread) {\n this.raise(\n this.state.lastTokStart,\n FlowErrors.InexactInsideNonObject,\n );\n } else if (!allowInexact) {\n this.raise(this.state.lastTokStart, FlowErrors.InexactInsideExact);\n }\n if (variance) {\n this.raise(variance.start, FlowErrors.InexactVariance);\n }\n\n return null;\n }\n\n if (!allowSpread) {\n this.raise(this.state.lastTokStart, FlowErrors.UnexpectedSpreadType);\n }\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n if (variance) {\n this.raise(variance.start, FlowErrors.SpreadVariance);\n }\n\n node.argument = this.flowParseType();\n return this.finishNode(node, \"ObjectTypeSpreadProperty\");\n } else {\n node.key = this.flowParseObjectPropertyKey();\n node.static = isStatic;\n node.proto = protoStart != null;\n node.kind = kind;\n\n let optional = false;\n if (this.isRelational(\"<\") || this.match(tt.parenL)) {\n // This is a method property\n node.method = true;\n\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n if (variance) {\n this.unexpected(variance.start);\n }\n\n node.value = this.flowParseObjectTypeMethodish(\n this.startNodeAt(node.start, node.loc.start),\n );\n if (kind === \"get\" || kind === \"set\") {\n this.flowCheckGetterSetterParams(node);\n }\n /** Declared classes/interfaces do not allow spread */\n if (\n !allowSpread &&\n node.key.name === \"constructor\" &&\n node.value.this\n ) {\n this.raise(\n node.value.this.start,\n FlowErrors.ThisParamBannedInConstructor,\n );\n }\n } else {\n if (kind !== \"init\") this.unexpected();\n\n node.method = false;\n\n if (this.eat(tt.question)) {\n optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n }\n\n node.optional = optional;\n\n return this.finishNode(node, \"ObjectTypeProperty\");\n }\n }\n\n // This is similar to checkGetterSetterParams, but as\n // @babel/parser uses non estree properties we cannot reuse it here\n flowCheckGetterSetterParams(\n property: N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty,\n ): void {\n const paramCount = property.kind === \"get\" ? 0 : 1;\n const start = property.start;\n const length =\n property.value.params.length + (property.value.rest ? 1 : 0);\n\n if (property.value.this) {\n this.raise(\n property.value.this.start,\n property.kind === \"get\"\n ? FlowErrors.GetterMayNotHaveThisParam\n : FlowErrors.SetterMayNotHaveThisParam,\n );\n }\n\n if (length !== paramCount) {\n if (property.kind === \"get\") {\n this.raise(start, Errors.BadGetterArity);\n } else {\n this.raise(start, Errors.BadSetterArity);\n }\n }\n\n if (property.kind === \"set\" && property.value.rest) {\n this.raise(start, Errors.BadSetterRestParameter);\n }\n }\n\n flowObjectTypeSemicolon(): void {\n if (\n !this.eat(tt.semi) &&\n !this.eat(tt.comma) &&\n !this.match(tt.braceR) &&\n !this.match(tt.braceBarR)\n ) {\n this.unexpected();\n }\n }\n\n flowParseQualifiedTypeIdentifier(\n startPos?: number,\n startLoc?: Position,\n id?: N.Identifier,\n ): N.FlowQualifiedTypeIdentifier {\n startPos = startPos || this.state.start;\n startLoc = startLoc || this.state.startLoc;\n let node = id || this.flowParseRestrictedIdentifier(true);\n\n while (this.eat(tt.dot)) {\n const node2 = this.startNodeAt(startPos, startLoc);\n node2.qualification = node;\n node2.id = this.flowParseRestrictedIdentifier(true);\n node = this.finishNode(node2, \"QualifiedTypeIdentifier\");\n }\n\n return node;\n }\n\n flowParseGenericType(\n startPos: number,\n startLoc: Position,\n id: N.Identifier,\n ): N.FlowGenericTypeAnnotation {\n const node = this.startNodeAt(startPos, startLoc);\n\n node.typeParameters = null;\n node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n }\n\n return this.finishNode(node, \"GenericTypeAnnotation\");\n }\n\n flowParseTypeofType(): N.FlowTypeofTypeAnnotation {\n const node = this.startNode();\n this.expect(tt._typeof);\n node.argument = this.flowParsePrimaryType();\n return this.finishNode(node, \"TypeofTypeAnnotation\");\n }\n\n flowParseTupleType(): N.FlowTupleTypeAnnotation {\n const node = this.startNode();\n node.types = [];\n this.expect(tt.bracketL);\n // We allow trailing commas\n while (this.state.pos < this.length && !this.match(tt.bracketR)) {\n node.types.push(this.flowParseType());\n if (this.match(tt.bracketR)) break;\n this.expect(tt.comma);\n }\n this.expect(tt.bracketR);\n return this.finishNode(node, \"TupleTypeAnnotation\");\n }\n\n flowParseFunctionTypeParam(first: boolean): N.FlowFunctionTypeParam {\n let name = null;\n let optional = false;\n let typeAnnotation = null;\n const node = this.startNode();\n const lh = this.lookahead();\n const isThis = this.state.type === tt._this;\n\n if (lh.type === tt.colon || lh.type === tt.question) {\n if (isThis && !first) {\n this.raise(node.start, FlowErrors.ThisParamMustBeFirst);\n }\n name = this.parseIdentifier(isThis);\n if (this.eat(tt.question)) {\n optional = true;\n if (isThis) {\n this.raise(node.start, FlowErrors.ThisParamMayNotBeOptional);\n }\n }\n typeAnnotation = this.flowParseTypeInitialiser();\n } else {\n typeAnnotation = this.flowParseType();\n }\n node.name = name;\n node.optional = optional;\n node.typeAnnotation = typeAnnotation;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n\n reinterpretTypeAsFunctionTypeParam(\n type: N.FlowType,\n ): N.FlowFunctionTypeParam {\n const node = this.startNodeAt(type.start, type.loc.start);\n node.name = null;\n node.optional = false;\n node.typeAnnotation = type;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n\n flowParseFunctionTypeParams(\n params: N.FlowFunctionTypeParam[] = [],\n ): {\n params: N.FlowFunctionTypeParam[],\n rest: ?N.FlowFunctionTypeParam,\n _this: ?N.FlowFunctionTypeParam,\n } {\n let rest: ?N.FlowFunctionTypeParam = null;\n let _this: ?N.FlowFunctionTypeParam = null;\n if (this.match(tt._this)) {\n _this = this.flowParseFunctionTypeParam(/* first */ true);\n // match Flow parser behavior\n _this.name = null;\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n params.push(this.flowParseFunctionTypeParam(false));\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n if (this.eat(tt.ellipsis)) {\n rest = this.flowParseFunctionTypeParam(false);\n }\n return { params, rest, _this };\n }\n\n flowIdentToTypeAnnotation(\n startPos: number,\n startLoc: Position,\n node: N.FlowTypeAnnotation,\n id: N.Identifier,\n ): N.FlowTypeAnnotation {\n switch (id.name) {\n case \"any\":\n return this.finishNode(node, \"AnyTypeAnnotation\");\n\n case \"bool\":\n case \"boolean\":\n return this.finishNode(node, \"BooleanTypeAnnotation\");\n\n case \"mixed\":\n return this.finishNode(node, \"MixedTypeAnnotation\");\n\n case \"empty\":\n return this.finishNode(node, \"EmptyTypeAnnotation\");\n\n case \"number\":\n return this.finishNode(node, \"NumberTypeAnnotation\");\n\n case \"string\":\n return this.finishNode(node, \"StringTypeAnnotation\");\n\n case \"symbol\":\n return this.finishNode(node, \"SymbolTypeAnnotation\");\n\n default:\n this.checkNotUnderscore(id.name);\n return this.flowParseGenericType(startPos, startLoc, id);\n }\n }\n\n // The parsing of types roughly parallels the parsing of expressions, and\n // primary types are kind of like primary expressions...they're the\n // primitives with which other types are constructed.\n flowParsePrimaryType(): N.FlowTypeAnnotation {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const node = this.startNode();\n let tmp;\n let type;\n let isGroupedType = false;\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n\n switch (this.state.type) {\n case tt.name:\n if (this.isContextual(\"interface\")) {\n return this.flowParseInterfaceType();\n }\n\n return this.flowIdentToTypeAnnotation(\n startPos,\n startLoc,\n node,\n this.parseIdentifier(),\n );\n\n case tt.braceL:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: true,\n allowProto: false,\n allowInexact: true,\n });\n\n case tt.braceBarL:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: true,\n allowSpread: true,\n allowProto: false,\n allowInexact: false,\n });\n\n case tt.bracketL:\n this.state.noAnonFunctionType = false;\n type = this.flowParseTupleType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n return type;\n\n case tt.relational:\n if (this.state.value === \"<\") {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n this.expect(tt.parenL);\n tmp = this.flowParseFunctionTypeParams();\n node.params = tmp.params;\n node.rest = tmp.rest;\n node.this = tmp._this;\n this.expect(tt.parenR);\n\n this.expect(tt.arrow);\n\n node.returnType = this.flowParseType();\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n break;\n\n case tt.parenL:\n this.next();\n\n // Check to see if this is actually a grouped type\n if (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n if (this.match(tt.name) || this.match(tt._this)) {\n const token = this.lookahead().type;\n isGroupedType = token !== tt.question && token !== tt.colon;\n } else {\n isGroupedType = true;\n }\n }\n\n if (isGroupedType) {\n this.state.noAnonFunctionType = false;\n type = this.flowParseType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n // A `,` or a `) =>` means this is an anonymous function type\n if (\n this.state.noAnonFunctionType ||\n !(\n this.match(tt.comma) ||\n (this.match(tt.parenR) && this.lookahead().type === tt.arrow)\n )\n ) {\n this.expect(tt.parenR);\n return type;\n } else {\n // Eat a comma if there is one\n this.eat(tt.comma);\n }\n }\n\n if (type) {\n tmp = this.flowParseFunctionTypeParams([\n this.reinterpretTypeAsFunctionTypeParam(type),\n ]);\n } else {\n tmp = this.flowParseFunctionTypeParams();\n }\n\n node.params = tmp.params;\n node.rest = tmp.rest;\n node.this = tmp._this;\n\n this.expect(tt.parenR);\n\n this.expect(tt.arrow);\n\n node.returnType = this.flowParseType();\n\n node.typeParameters = null;\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n\n case tt.string:\n return this.parseLiteral(\n this.state.value,\n \"StringLiteralTypeAnnotation\",\n );\n\n case tt._true:\n case tt._false:\n node.value = this.match(tt._true);\n this.next();\n return this.finishNode(node, \"BooleanLiteralTypeAnnotation\");\n\n case tt.plusMin:\n if (this.state.value === \"-\") {\n this.next();\n if (this.match(tt.num)) {\n return this.parseLiteral(\n -this.state.value,\n \"NumberLiteralTypeAnnotation\",\n node.start,\n node.loc.start,\n );\n }\n\n if (this.match(tt.bigint)) {\n return this.parseLiteral(\n -this.state.value,\n \"BigIntLiteralTypeAnnotation\",\n node.start,\n node.loc.start,\n );\n }\n\n throw this.raise(\n this.state.start,\n FlowErrors.UnexpectedSubtractionOperand,\n );\n }\n\n throw this.unexpected();\n case tt.num:\n return this.parseLiteral(\n this.state.value,\n \"NumberLiteralTypeAnnotation\",\n );\n\n case tt.bigint:\n return this.parseLiteral(\n this.state.value,\n \"BigIntLiteralTypeAnnotation\",\n );\n\n case tt._void:\n this.next();\n return this.finishNode(node, \"VoidTypeAnnotation\");\n\n case tt._null:\n this.next();\n return this.finishNode(node, \"NullLiteralTypeAnnotation\");\n\n case tt._this:\n this.next();\n return this.finishNode(node, \"ThisTypeAnnotation\");\n\n case tt.star:\n this.next();\n return this.finishNode(node, \"ExistsTypeAnnotation\");\n\n default:\n if (this.state.type.keyword === \"typeof\") {\n return this.flowParseTypeofType();\n } else if (this.state.type.keyword) {\n const label = this.state.type.label;\n this.next();\n return super.createIdentifier(node, label);\n }\n }\n\n throw this.unexpected();\n }\n\n flowParsePostfixType(): N.FlowTypeAnnotation {\n const startPos = this.state.start,\n startLoc = this.state.startLoc;\n let type = this.flowParsePrimaryType();\n while (this.match(tt.bracketL) && !this.canInsertSemicolon()) {\n const node = this.startNodeAt(startPos, startLoc);\n node.elementType = type;\n this.expect(tt.bracketL);\n this.expect(tt.bracketR);\n type = this.finishNode(node, \"ArrayTypeAnnotation\");\n }\n return type;\n }\n\n flowParsePrefixType(): N.FlowTypeAnnotation {\n const node = this.startNode();\n if (this.eat(tt.question)) {\n node.typeAnnotation = this.flowParsePrefixType();\n return this.finishNode(node, \"NullableTypeAnnotation\");\n } else {\n return this.flowParsePostfixType();\n }\n }\n\n flowParseAnonFunctionWithoutParens(): N.FlowTypeAnnotation {\n const param = this.flowParsePrefixType();\n if (!this.state.noAnonFunctionType && this.eat(tt.arrow)) {\n // TODO: This should be a type error. Passing in a SourceLocation, and it expects a Position.\n const node = this.startNodeAt(param.start, param.loc.start);\n node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];\n node.rest = null;\n node.returnType = this.flowParseType();\n node.typeParameters = null;\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n return param;\n }\n\n flowParseIntersectionType(): N.FlowTypeAnnotation {\n const node = this.startNode();\n this.eat(tt.bitwiseAND);\n const type = this.flowParseAnonFunctionWithoutParens();\n node.types = [type];\n while (this.eat(tt.bitwiseAND)) {\n node.types.push(this.flowParseAnonFunctionWithoutParens());\n }\n return node.types.length === 1\n ? type\n : this.finishNode(node, \"IntersectionTypeAnnotation\");\n }\n\n flowParseUnionType(): N.FlowTypeAnnotation {\n const node = this.startNode();\n this.eat(tt.bitwiseOR);\n const type = this.flowParseIntersectionType();\n node.types = [type];\n while (this.eat(tt.bitwiseOR)) {\n node.types.push(this.flowParseIntersectionType());\n }\n return node.types.length === 1\n ? type\n : this.finishNode(node, \"UnionTypeAnnotation\");\n }\n\n flowParseType(): N.FlowTypeAnnotation {\n const oldInType = this.state.inType;\n this.state.inType = true;\n const type = this.flowParseUnionType();\n this.state.inType = oldInType;\n // Ensure that a brace after a function generic type annotation is a\n // statement, except in arrow functions (noAnonFunctionType)\n this.state.exprAllowed =\n this.state.exprAllowed || this.state.noAnonFunctionType;\n return type;\n }\n\n flowParseTypeOrImplicitInstantiation(): N.FlowTypeAnnotation {\n if (this.state.type === tt.name && this.state.value === \"_\") {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const node = this.parseIdentifier();\n return this.flowParseGenericType(startPos, startLoc, node);\n } else {\n return this.flowParseType();\n }\n }\n\n flowParseTypeAnnotation(): N.FlowTypeAnnotation {\n const node = this.startNode();\n node.typeAnnotation = this.flowParseTypeInitialiser();\n return this.finishNode(node, \"TypeAnnotation\");\n }\n\n flowParseTypeAnnotatableIdentifier(\n allowPrimitiveOverride?: boolean,\n ): N.Identifier {\n const ident = allowPrimitiveOverride\n ? this.parseIdentifier()\n : this.flowParseRestrictedIdentifier();\n if (this.match(tt.colon)) {\n ident.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(ident);\n }\n return ident;\n }\n\n typeCastToParameter(node: N.Node): N.Node {\n node.expression.typeAnnotation = node.typeAnnotation;\n\n this.resetEndLocation(\n node.expression,\n node.typeAnnotation.end,\n node.typeAnnotation.loc.end,\n );\n\n return node.expression;\n }\n\n flowParseVariance(): ?N.FlowVariance {\n let variance = null;\n if (this.match(tt.plusMin)) {\n variance = this.startNode();\n if (this.state.value === \"+\") {\n variance.kind = \"plus\";\n } else {\n variance.kind = \"minus\";\n }\n this.next();\n this.finishNode(variance, \"Variance\");\n }\n return variance;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n parseFunctionBody(\n node: N.Function,\n allowExpressionBody: ?boolean,\n isMethod?: boolean = false,\n ): void {\n if (allowExpressionBody) {\n return this.forwardNoArrowParamsConversionAt(node, () =>\n super.parseFunctionBody(node, true, isMethod),\n );\n }\n\n return super.parseFunctionBody(node, false, isMethod);\n }\n\n parseFunctionBodyAndFinish(\n node: N.BodilessFunctionOrMethodBase,\n type: string,\n isMethod?: boolean = false,\n ): void {\n if (this.match(tt.colon)) {\n const typeNode = this.startNode();\n\n [\n // $FlowFixMe (destructuring not supported yet)\n typeNode.typeAnnotation,\n // $FlowFixMe (destructuring not supported yet)\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser();\n\n node.returnType = typeNode.typeAnnotation\n ? this.finishNode(typeNode, \"TypeAnnotation\")\n : null;\n }\n\n super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n\n // interfaces and enums\n parseStatement(context: ?string, topLevel?: boolean): N.Statement {\n // strict mode handling of `interface` since it's a reserved word\n if (\n this.state.strict &&\n this.match(tt.name) &&\n this.state.value === \"interface\"\n ) {\n const lookahead = this.lookahead();\n if (lookahead.type === tt.name || isKeyword(lookahead.value)) {\n const node = this.startNode();\n this.next();\n return this.flowParseInterface(node);\n }\n } else if (this.shouldParseEnums() && this.isContextual(\"enum\")) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n const stmt = super.parseStatement(context, topLevel);\n // We will parse a flow pragma in any comment before the first statement.\n if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {\n this.flowPragma = null;\n }\n return stmt;\n }\n\n // declares, interfaces and type aliases\n parseExpressionStatement(\n node: N.ExpressionStatement,\n expr: N.Expression,\n ): N.ExpressionStatement {\n if (expr.type === \"Identifier\") {\n if (expr.name === \"declare\") {\n if (\n this.match(tt._class) ||\n this.match(tt.name) ||\n this.match(tt._function) ||\n this.match(tt._var) ||\n this.match(tt._export)\n ) {\n return this.flowParseDeclare(node);\n }\n } else if (this.match(tt.name)) {\n if (expr.name === \"interface\") {\n return this.flowParseInterface(node);\n } else if (expr.name === \"type\") {\n return this.flowParseTypeAlias(node);\n } else if (expr.name === \"opaque\") {\n return this.flowParseOpaqueType(node, false);\n }\n }\n }\n\n return super.parseExpressionStatement(node, expr);\n }\n\n // export type\n shouldParseExportDeclaration(): boolean {\n return (\n this.isContextual(\"type\") ||\n this.isContextual(\"interface\") ||\n this.isContextual(\"opaque\") ||\n (this.shouldParseEnums() && this.isContextual(\"enum\")) ||\n super.shouldParseExportDeclaration()\n );\n }\n\n isExportDefaultSpecifier(): boolean {\n if (\n this.match(tt.name) &&\n (this.state.value === \"type\" ||\n this.state.value === \"interface\" ||\n this.state.value === \"opaque\" ||\n (this.shouldParseEnums() && this.state.value === \"enum\"))\n ) {\n return false;\n }\n\n return super.isExportDefaultSpecifier();\n }\n\n parseExportDefaultExpression(): N.Expression | N.Declaration {\n if (this.shouldParseEnums() && this.isContextual(\"enum\")) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n return super.parseExportDefaultExpression();\n }\n\n parseConditional(\n expr: N.Expression,\n startPos: number,\n startLoc: Position,\n refNeedsArrowPos?: ?Pos,\n ): N.Expression {\n if (!this.match(tt.question)) return expr;\n\n // only use the expensive \"tryParse\" method if there is a question mark\n // and if we come from inside parens\n if (refNeedsArrowPos) {\n const result = this.tryParse(() =>\n super.parseConditional(expr, startPos, startLoc),\n );\n\n if (!result.node) {\n // $FlowIgnore\n refNeedsArrowPos.start = result.error.pos || this.state.start;\n return expr;\n }\n\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n this.expect(tt.question);\n const state = this.state.clone();\n const originalNoArrowAt = this.state.noArrowAt;\n const node = this.startNodeAt(startPos, startLoc);\n let { consequent, failed } = this.tryParseConditionalConsequent();\n let [valid, invalid] = this.getArrowLikeExpressions(consequent);\n\n if (failed || invalid.length > 0) {\n const noArrowAt = [...originalNoArrowAt];\n\n if (invalid.length > 0) {\n this.state = state;\n this.state.noArrowAt = noArrowAt;\n\n for (let i = 0; i < invalid.length; i++) {\n noArrowAt.push(invalid[i].start);\n }\n\n ({ consequent, failed } = this.tryParseConditionalConsequent());\n [valid, invalid] = this.getArrowLikeExpressions(consequent);\n }\n\n if (failed && valid.length > 1) {\n // if there are two or more possible correct ways of parsing, throw an\n // error.\n // e.g. Source: a ? (b): c => (d): e => f\n // Result 1: a ? b : (c => ((d): e => f))\n // Result 2: a ? ((b): c => d) : (e => f)\n this.raise(state.start, FlowErrors.AmbiguousConditionalArrow);\n }\n\n if (failed && valid.length === 1) {\n this.state = state;\n this.state.noArrowAt = noArrowAt.concat(valid[0].start);\n ({ consequent, failed } = this.tryParseConditionalConsequent());\n }\n }\n\n this.getArrowLikeExpressions(consequent, true);\n\n this.state.noArrowAt = originalNoArrowAt;\n this.expect(tt.colon);\n\n node.test = expr;\n node.consequent = consequent;\n node.alternate = this.forwardNoArrowParamsConversionAt(node, () =>\n this.parseMaybeAssign(undefined, undefined, undefined),\n );\n\n return this.finishNode(node, \"ConditionalExpression\");\n }\n\n tryParseConditionalConsequent(): {\n consequent: N.Expression,\n failed: boolean,\n } {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n\n const consequent = this.parseMaybeAssignAllowIn();\n const failed = !this.match(tt.colon);\n\n this.state.noArrowParamsConversionAt.pop();\n\n return { consequent, failed };\n }\n\n // Given an expression, walks through out its arrow functions whose body is\n // an expression and through out conditional expressions. It returns every\n // function which has been parsed with a return type but could have been\n // parenthesized expressions.\n // These functions are separated into two arrays: one containing the ones\n // whose parameters can be converted to assignable lists, one containing the\n // others.\n getArrowLikeExpressions(\n node: N.Expression,\n disallowInvalid?: boolean,\n ): [N.ArrowFunctionExpression[], N.ArrowFunctionExpression[]] {\n const stack = [node];\n const arrows: N.ArrowFunctionExpression[] = [];\n\n while (stack.length !== 0) {\n const node = stack.pop();\n if (node.type === \"ArrowFunctionExpression\") {\n if (node.typeParameters || !node.returnType) {\n // This is an arrow expression without ambiguity, so check its parameters\n this.finishArrowValidation(node);\n } else {\n arrows.push(node);\n }\n stack.push(node.body);\n } else if (node.type === \"ConditionalExpression\") {\n stack.push(node.consequent);\n stack.push(node.alternate);\n }\n }\n\n if (disallowInvalid) {\n arrows.forEach(node => this.finishArrowValidation(node));\n return [arrows, []];\n }\n\n return partition(arrows, node =>\n node.params.every(param => this.isAssignable(param, true)),\n );\n }\n\n finishArrowValidation(node: N.ArrowFunctionExpression) {\n this.toAssignableList(\n // node.params is Expression[] instead of $ReadOnlyArray because it\n // has not been converted yet.\n ((node.params: any): N.Expression[]),\n node.extra?.trailingComma,\n /* isLHS */ false,\n );\n // Enter scope, as checkParams defines bindings\n this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);\n // Use super's method to force the parameters to be checked\n super.checkParams(node, false, true);\n this.scope.exit();\n }\n\n forwardNoArrowParamsConversionAt(node: N.Node, parse: () => T): T {\n let result: T;\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n result = parse();\n this.state.noArrowParamsConversionAt.pop();\n } else {\n result = parse();\n }\n\n return result;\n }\n\n parseParenItem(\n node: N.Expression,\n startPos: number,\n startLoc: Position,\n ): N.Expression {\n node = super.parseParenItem(node, startPos, startLoc);\n if (this.eat(tt.question)) {\n node.optional = true;\n // Include questionmark in location of node\n // Don't use this.finishNode() as otherwise we might process comments twice and\n // include already consumed parens\n this.resetEndLocation(node);\n }\n\n if (this.match(tt.colon)) {\n const typeCastNode = this.startNodeAt(startPos, startLoc);\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();\n\n return this.finishNode(typeCastNode, \"TypeCastExpression\");\n }\n\n return node;\n }\n\n assertModuleNodeAllowed(node: N.Node) {\n if (\n (node.type === \"ImportDeclaration\" &&\n (node.importKind === \"type\" || node.importKind === \"typeof\")) ||\n (node.type === \"ExportNamedDeclaration\" &&\n node.exportKind === \"type\") ||\n (node.type === \"ExportAllDeclaration\" && node.exportKind === \"type\")\n ) {\n // Allow Flowtype imports and exports in all conditions because\n // Flow itself does not care about 'sourceType'.\n return;\n }\n\n super.assertModuleNodeAllowed(node);\n }\n\n parseExport(node: N.Node): N.AnyExport {\n const decl = super.parseExport(node);\n if (\n decl.type === \"ExportNamedDeclaration\" ||\n decl.type === \"ExportAllDeclaration\"\n ) {\n decl.exportKind = decl.exportKind || \"value\";\n }\n return decl;\n }\n\n parseExportDeclaration(node: N.ExportNamedDeclaration): ?N.Declaration {\n if (this.isContextual(\"type\")) {\n node.exportKind = \"type\";\n\n const declarationNode = this.startNode();\n this.next();\n\n if (this.match(tt.braceL)) {\n // export type { foo, bar };\n node.specifiers = this.parseExportSpecifiers();\n this.parseExportFrom(node);\n return null;\n } else {\n // export type Foo = Bar;\n return this.flowParseTypeAlias(declarationNode);\n }\n } else if (this.isContextual(\"opaque\")) {\n node.exportKind = \"type\";\n\n const declarationNode = this.startNode();\n this.next();\n // export opaque type Foo = Bar;\n return this.flowParseOpaqueType(declarationNode, false);\n } else if (this.isContextual(\"interface\")) {\n node.exportKind = \"type\";\n const declarationNode = this.startNode();\n this.next();\n return this.flowParseInterface(declarationNode);\n } else if (this.shouldParseEnums() && this.isContextual(\"enum\")) {\n node.exportKind = \"value\";\n const declarationNode = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(declarationNode);\n } else {\n return super.parseExportDeclaration(node);\n }\n }\n\n eatExportStar(node: N.Node): boolean {\n if (super.eatExportStar(...arguments)) return true;\n\n if (this.isContextual(\"type\") && this.lookahead().type === tt.star) {\n node.exportKind = \"type\";\n this.next();\n this.next();\n return true;\n }\n\n return false;\n }\n\n maybeParseExportNamespaceSpecifier(node: N.Node): boolean {\n const pos = this.state.start;\n const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);\n if (hasNamespace && node.exportKind === \"type\") {\n this.unexpected(pos);\n }\n return hasNamespace;\n }\n\n parseClassId(node: N.Class, isStatement: boolean, optionalId: ?boolean) {\n super.parseClassId(node, isStatement, optionalId);\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n }\n\n parseClassMember(\n classBody: N.ClassBody,\n member: any,\n state: N.ParseClassMemberState,\n ): void {\n const pos = this.state.start;\n if (this.isContextual(\"declare\")) {\n if (this.parseClassMemberFromModifier(classBody, member)) {\n // 'declare' is a class element name\n return;\n }\n\n member.declare = true;\n }\n\n super.parseClassMember(classBody, member, state);\n\n if (member.declare) {\n if (\n member.type !== \"ClassProperty\" &&\n member.type !== \"ClassPrivateProperty\" &&\n member.type !== \"PropertyDefinition\" // Used by estree plugin\n ) {\n this.raise(pos, FlowErrors.DeclareClassElement);\n } else if (member.value) {\n this.raise(\n member.value.start,\n FlowErrors.DeclareClassFieldInitializer,\n );\n }\n }\n }\n\n // ensure that inside flow types, we bypass the jsx parser plugin\n getTokenFromCode(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (code === charCodes.leftCurlyBrace && next === charCodes.verticalBar) {\n return this.finishOp(tt.braceBarL, 2);\n } else if (\n this.state.inType &&\n (code === charCodes.greaterThan || code === charCodes.lessThan)\n ) {\n return this.finishOp(tt.relational, 1);\n } else if (this.state.inType && code === charCodes.questionMark) {\n // allow double nullable types in Flow: ??string\n return this.finishOp(tt.question, 1);\n } else if (isIteratorStart(code, next)) {\n this.state.isIterator = true;\n return super.readWord();\n } else {\n return super.getTokenFromCode(code);\n }\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n switch (node.type) {\n case \"Identifier\":\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n return true;\n\n case \"ObjectExpression\": {\n const last = node.properties.length - 1;\n return node.properties.every((prop, i) => {\n return (\n prop.type !== \"ObjectMethod\" &&\n (i === last || prop.type === \"SpreadElement\") &&\n this.isAssignable(prop)\n );\n });\n }\n\n case \"ObjectProperty\":\n return this.isAssignable(node.value);\n\n case \"SpreadElement\":\n return this.isAssignable(node.argument);\n\n case \"ArrayExpression\":\n return node.elements.every(element => this.isAssignable(element));\n\n case \"AssignmentExpression\":\n return node.operator === \"=\";\n\n case \"ParenthesizedExpression\":\n case \"TypeCastExpression\":\n return this.isAssignable(node.expression);\n\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n return !isBinding;\n\n default:\n return false;\n }\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): N.Node {\n if (node.type === \"TypeCastExpression\") {\n return super.toAssignable(this.typeCastToParameter(node), isLHS);\n } else {\n return super.toAssignable(node, isLHS);\n }\n }\n\n // turn type casts that we found in function parameter head into type annotated params\n toAssignableList(\n exprList: N.Expression[],\n trailingCommaPos?: ?number,\n isLHS: boolean,\n ): $ReadOnlyArray {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (expr?.type === \"TypeCastExpression\") {\n exprList[i] = this.typeCastToParameter(expr);\n }\n }\n return super.toAssignableList(exprList, trailingCommaPos, isLHS);\n }\n\n // this is a list of nodes, from something like a call expression, we need to filter the\n // type casts that we've found that are illegal in this context\n toReferencedList(\n exprList: $ReadOnlyArray,\n isParenthesizedExpr?: boolean,\n ): $ReadOnlyArray {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (\n expr &&\n expr.type === \"TypeCastExpression\" &&\n !expr.extra?.parenthesized &&\n (exprList.length > 1 || !isParenthesizedExpr)\n ) {\n this.raise(expr.typeAnnotation.start, FlowErrors.TypeCastInPattern);\n }\n }\n\n return exprList;\n }\n\n parseArrayLike(\n close: TokenType,\n canBePattern: boolean,\n isTuple: boolean,\n refExpressionErrors: ?ExpressionErrors,\n ): N.ArrayExpression | N.TupleExpression {\n const node = super.parseArrayLike(\n close,\n canBePattern,\n isTuple,\n refExpressionErrors,\n );\n\n // This could be an array pattern:\n // ([a: string, b: string]) => {}\n // In this case, we don't have to call toReferencedList. We will\n // call it, if needed, when we are sure that it is a parenthesized\n // expression by calling toReferencedListDeep.\n if (canBePattern && !this.state.maybeInArrowParameters) {\n this.toReferencedList(node.elements);\n }\n\n return node;\n }\n\n checkLVal(\n expr: N.Expression,\n ...args:\n | [string, BindingTypes | void]\n | [\n string,\n BindingTypes | void,\n ?Set,\n boolean | void,\n boolean | void,\n ]\n ): void {\n if (expr.type !== \"TypeCastExpression\") {\n return super.checkLVal(expr, ...args);\n }\n }\n\n // parse class property type annotations\n parseClassProperty(node: N.ClassProperty): N.ClassProperty {\n if (this.match(tt.colon)) {\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassProperty(node);\n }\n\n parseClassPrivateProperty(\n node: N.ClassPrivateProperty,\n ): N.ClassPrivateProperty {\n if (this.match(tt.colon)) {\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassPrivateProperty(node);\n }\n\n // determine whether or not we're currently in the position where a class method would appear\n isClassMethod(): boolean {\n return this.isRelational(\"<\") || super.isClassMethod();\n }\n\n // determine whether or not we're currently in the position where a class property would appear\n isClassProperty(): boolean {\n return this.match(tt.colon) || super.isClassProperty();\n }\n\n isNonstaticConstructor(method: N.ClassMethod | N.ClassProperty): boolean {\n return !this.match(tt.colon) && super.isNonstaticConstructor(method);\n }\n\n // determine whether a parameter is a this param\n isThisParam(param) {\n return param.type === \"Identifier\" && param.name === \"this\";\n }\n\n // parse type parameters for class methods\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n if ((method: $FlowFixMe).variance) {\n this.unexpected((method: $FlowFixMe).variance.start);\n }\n delete (method: $FlowFixMe).variance;\n if (this.isRelational(\"<\")) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n super.pushClassMethod(\n classBody,\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n );\n\n if (method.params && isConstructor) {\n const params = method.params;\n if (params.length > 0 && this.isThisParam(params[0])) {\n this.raise(method.start, FlowErrors.ThisParamBannedInConstructor);\n }\n // estree support\n } else if (\n // $FlowFixMe flow does not know about the face that estree can replace ClassMethod with MethodDefinition\n method.type === \"MethodDefinition\" &&\n isConstructor &&\n method.value.params\n ) {\n const params = method.value.params;\n if (params.length > 0 && this.isThisParam(params[0])) {\n this.raise(method.start, FlowErrors.ThisParamBannedInConstructor);\n }\n }\n }\n\n pushClassPrivateMethod(\n classBody: N.ClassBody,\n method: N.ClassPrivateMethod,\n isGenerator: boolean,\n isAsync: boolean,\n ): void {\n if ((method: $FlowFixMe).variance) {\n this.unexpected((method: $FlowFixMe).variance.start);\n }\n delete (method: $FlowFixMe).variance;\n if (this.isRelational(\"<\")) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n\n // parse a the super class type parameters and implements\n parseClassSuper(node: N.Class): void {\n super.parseClassSuper(node);\n if (node.superClass && this.isRelational(\"<\")) {\n node.superTypeParameters = this.flowParseTypeParameterInstantiation();\n }\n if (this.isContextual(\"implements\")) {\n this.next();\n const implemented: N.FlowClassImplements[] = (node.implements = []);\n do {\n const node = this.startNode();\n node.id = this.flowParseRestrictedIdentifier(/*liberal*/ true);\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n implemented.push(this.finishNode(node, \"ClassImplements\"));\n } while (this.eat(tt.comma));\n }\n }\n\n checkGetterSetterParams(method: N.ObjectMethod | N.ClassMethod): void {\n super.checkGetterSetterParams(method);\n const params = this.getObjectOrClassMethodParams(method);\n if (params.length > 0) {\n const param = params[0];\n if (this.isThisParam(param) && method.kind === \"get\") {\n this.raise(param.start, FlowErrors.GetterMayNotHaveThisParam);\n } else if (this.isThisParam(param)) {\n this.raise(param.start, FlowErrors.SetterMayNotHaveThisParam);\n }\n }\n }\n\n parsePropertyName(\n node: N.ObjectOrClassMember | N.ClassMember | N.TsNamedTypeElementBase,\n isPrivateNameAllowed: boolean,\n ): N.Identifier {\n const variance = this.flowParseVariance();\n const key = super.parsePropertyName(node, isPrivateNameAllowed);\n // $FlowIgnore (\"variance\" not defined on TsNamedTypeElementBase)\n node.variance = variance;\n return key;\n }\n\n // parse type parameters for object method shorthand\n parseObjPropValue(\n prop: N.ObjectMember,\n startPos: ?number,\n startLoc: ?Position,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n refExpressionErrors: ?ExpressionErrors,\n ): void {\n if ((prop: $FlowFixMe).variance) {\n this.unexpected((prop: $FlowFixMe).variance.start);\n }\n delete (prop: $FlowFixMe).variance;\n\n let typeParameters;\n\n // method shorthand\n if (this.isRelational(\"<\") && !isAccessor) {\n typeParameters = this.flowParseTypeParameterDeclaration();\n if (!this.match(tt.parenL)) this.unexpected();\n }\n\n super.parseObjPropValue(\n prop,\n startPos,\n startLoc,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n refExpressionErrors,\n );\n\n // add typeParameters if we found them\n if (typeParameters) {\n (prop.value || prop).typeParameters = typeParameters;\n }\n }\n\n parseAssignableListItemTypes(param: N.Pattern): N.Pattern {\n if (this.eat(tt.question)) {\n if (param.type !== \"Identifier\") {\n this.raise(param.start, FlowErrors.OptionalBindingPattern);\n }\n if (this.isThisParam(param)) {\n this.raise(param.start, FlowErrors.ThisParamMayNotBeOptional);\n }\n\n ((param: any): N.Identifier).optional = true;\n }\n if (this.match(tt.colon)) {\n param.typeAnnotation = this.flowParseTypeAnnotation();\n } else if (this.isThisParam(param)) {\n this.raise(param.start, FlowErrors.ThisParamAnnotationRequired);\n }\n\n if (this.match(tt.eq) && this.isThisParam(param)) {\n this.raise(param.start, FlowErrors.ThisParamNoDefault);\n }\n\n this.resetEndLocation(param);\n return param;\n }\n\n parseMaybeDefault(\n startPos?: ?number,\n startLoc?: ?Position,\n left?: ?N.Pattern,\n ): N.Pattern {\n const node = super.parseMaybeDefault(startPos, startLoc, left);\n\n if (\n node.type === \"AssignmentPattern\" &&\n node.typeAnnotation &&\n node.right.start < node.typeAnnotation.start\n ) {\n this.raise(node.typeAnnotation.start, FlowErrors.TypeBeforeInitializer);\n }\n\n return node;\n }\n\n shouldParseDefaultImport(node: N.ImportDeclaration): boolean {\n if (!hasTypeImportKind(node)) {\n return super.shouldParseDefaultImport(node);\n }\n\n return isMaybeDefaultImport(this.state);\n }\n\n parseImportSpecifierLocal(\n node: N.ImportDeclaration,\n specifier: N.Node,\n type: string,\n contextDescription: string,\n ): void {\n specifier.local = hasTypeImportKind(node)\n ? this.flowParseRestrictedIdentifier(\n /* liberal */ true,\n /* declaration */ true,\n )\n : this.parseIdentifier();\n\n this.checkLVal(specifier.local, contextDescription, BIND_LEXICAL);\n node.specifiers.push(this.finishNode(specifier, type));\n }\n\n // parse typeof and type imports\n maybeParseDefaultImportSpecifier(node: N.ImportDeclaration): boolean {\n node.importKind = \"value\";\n\n let kind = null;\n if (this.match(tt._typeof)) {\n kind = \"typeof\";\n } else if (this.isContextual(\"type\")) {\n kind = \"type\";\n }\n if (kind) {\n const lh = this.lookahead();\n\n // import type * is not allowed\n if (kind === \"type\" && lh.type === tt.star) {\n this.unexpected(lh.start);\n }\n\n if (\n isMaybeDefaultImport(lh) ||\n lh.type === tt.braceL ||\n lh.type === tt.star\n ) {\n this.next();\n node.importKind = kind;\n }\n }\n\n return super.maybeParseDefaultImportSpecifier(node);\n }\n\n // parse import-type/typeof shorthand\n parseImportSpecifier(node: N.ImportDeclaration): void {\n const specifier = this.startNode();\n const firstIdentLoc = this.state.start;\n const firstIdent = this.parseModuleExportName();\n\n let specifierTypeKind = null;\n if (firstIdent.type === \"Identifier\") {\n if (firstIdent.name === \"type\") {\n specifierTypeKind = \"type\";\n } else if (firstIdent.name === \"typeof\") {\n specifierTypeKind = \"typeof\";\n }\n }\n\n let isBinding = false;\n if (this.isContextual(\"as\") && !this.isLookaheadContextual(\"as\")) {\n const as_ident = this.parseIdentifier(true);\n if (\n specifierTypeKind !== null &&\n !this.match(tt.name) &&\n !this.state.type.keyword\n ) {\n // `import {type as ,` or `import {type as }`\n specifier.imported = as_ident;\n specifier.importKind = specifierTypeKind;\n specifier.local = as_ident.__clone();\n } else {\n // `import {type as foo`\n specifier.imported = firstIdent;\n specifier.importKind = null;\n specifier.local = this.parseIdentifier();\n }\n } else if (\n specifierTypeKind !== null &&\n (this.match(tt.name) || this.state.type.keyword)\n ) {\n // `import {type foo`\n specifier.imported = this.parseIdentifier(true);\n specifier.importKind = specifierTypeKind;\n if (this.eatContextual(\"as\")) {\n specifier.local = this.parseIdentifier();\n } else {\n isBinding = true;\n specifier.local = specifier.imported.__clone();\n }\n } else {\n if (firstIdent.type === \"StringLiteral\") {\n throw this.raise(\n specifier.start,\n Errors.ImportBindingIsString,\n firstIdent.value,\n );\n }\n isBinding = true;\n specifier.imported = firstIdent;\n specifier.importKind = null;\n specifier.local = specifier.imported.__clone();\n }\n\n const nodeIsTypeImport = hasTypeImportKind(node);\n const specifierIsTypeImport = hasTypeImportKind(specifier);\n\n if (nodeIsTypeImport && specifierIsTypeImport) {\n this.raise(\n firstIdentLoc,\n FlowErrors.ImportTypeShorthandOnlyInPureImport,\n );\n }\n\n if (nodeIsTypeImport || specifierIsTypeImport) {\n this.checkReservedType(\n specifier.local.name,\n specifier.local.start,\n /* declaration */ true,\n );\n }\n\n if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) {\n this.checkReservedWord(\n specifier.local.name,\n specifier.start,\n true,\n true,\n );\n }\n\n this.checkLVal(specifier.local, \"import specifier\", BIND_LEXICAL);\n node.specifiers.push(this.finishNode(specifier, \"ImportSpecifier\"));\n }\n\n parseBindingAtom(): N.Pattern {\n switch (this.state.type) {\n case tt._this:\n // \"this\" may be the name of a parameter, so allow it.\n return this.parseIdentifier(/* liberal */ true);\n default:\n return super.parseBindingAtom();\n }\n }\n\n // parse function type parameters - function foo() {}\n parseFunctionParams(node: N.Function, allowModifiers?: boolean): void {\n // $FlowFixMe\n const kind = node.kind;\n if (kind !== \"get\" && kind !== \"set\" && this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n super.parseFunctionParams(node, allowModifiers);\n }\n\n // parse flow type annotations on variable declarator heads - let foo: string = bar\n parseVarId(\n decl: N.VariableDeclarator,\n kind: \"var\" | \"let\" | \"const\",\n ): void {\n super.parseVarId(decl, kind);\n if (this.match(tt.colon)) {\n decl.id.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(decl.id); // set end position to end of type\n }\n }\n\n // parse the return type of an async arrow function - let foo = (async (): number => {});\n parseAsyncArrowFromCallExpression(\n node: N.ArrowFunctionExpression,\n call: N.CallExpression,\n ): N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n node.returnType = this.flowParseTypeAnnotation();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n }\n\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n // todo description\n shouldParseAsyncArrow(): boolean {\n return this.match(tt.colon) || super.shouldParseAsyncArrow();\n }\n\n // We need to support type parameter declarations for arrow functions. This\n // is tricky. There are three situations we need to handle\n //\n // 1. This is either JSX or an arrow function. We'll try JSX first. If that\n // fails, we'll try an arrow function. If that fails, we'll throw the JSX\n // error.\n // 2. This is an arrow function. We'll parse the type parameter declaration,\n // parse the rest, make sure the rest is an arrow function, and go from\n // there\n // 3. This is neither. Just call the super method\n parseMaybeAssign(\n refExpressionErrors?: ?ExpressionErrors,\n afterLeftParse?: Function,\n refNeedsArrowPos?: ?Pos,\n ): N.Expression {\n let state = null;\n\n let jsx;\n\n if (\n this.hasPlugin(\"jsx\") &&\n (this.match(tt.jsxTagStart) || this.isRelational(\"<\"))\n ) {\n state = this.state.clone();\n\n jsx = this.tryParse(\n () =>\n super.parseMaybeAssign(\n refExpressionErrors,\n afterLeftParse,\n refNeedsArrowPos,\n ),\n state,\n );\n /*:: invariant(!jsx.aborted) */\n\n if (!jsx.error) return jsx.node;\n\n // Remove `tc.j_expr` and `tc.j_oTag` from context added\n // by parsing `jsxTagStart` to stop the JSX plugin from\n // messing with the tokens\n const { context } = this.state;\n if (context[context.length - 1] === tc.j_oTag) {\n context.length -= 2;\n } else if (context[context.length - 1] === tc.j_expr) {\n context.length -= 1;\n }\n }\n\n if (jsx?.error || this.isRelational(\"<\")) {\n state = state || this.state.clone();\n\n let typeParameters;\n\n const arrow = this.tryParse(abort => {\n typeParameters = this.flowParseTypeParameterDeclaration();\n\n const arrowExpression = this.forwardNoArrowParamsConversionAt(\n typeParameters,\n () => {\n const result = super.parseMaybeAssign(\n refExpressionErrors,\n afterLeftParse,\n refNeedsArrowPos,\n );\n\n this.resetStartLocationFromNode(result, typeParameters);\n\n return result;\n },\n );\n\n // (() => {}: any);\n if (\n arrowExpression.type !== \"ArrowFunctionExpression\" &&\n arrowExpression.extra?.parenthesized\n ) {\n abort();\n }\n\n // The above can return a TypeCastExpression when the arrow\n // expression is not wrapped in parens. See also `this.parseParenItem`.\n const expr = this.maybeUnwrapTypeCastExpression(arrowExpression);\n expr.typeParameters = typeParameters;\n this.resetStartLocationFromNode(expr, typeParameters);\n\n return arrowExpression;\n }, state);\n\n let arrowExpression: ?(\n | N.ArrowFunctionExpression\n | N.TypeCastExpression\n ) = null;\n\n if (\n arrow.node &&\n this.maybeUnwrapTypeCastExpression(arrow.node).type ===\n \"ArrowFunctionExpression\"\n ) {\n if (!arrow.error && !arrow.aborted) {\n // async () => {}\n if (arrow.node.async) {\n /*:: invariant(typeParameters) */\n this.raise(\n typeParameters.start,\n FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction,\n );\n }\n\n return arrow.node;\n }\n\n arrowExpression = arrow.node;\n }\n\n // If we are here, both JSX and Flow parsing attempts failed.\n // Give the precedence to the JSX error, except if JSX had an\n // unrecoverable error while Flow didn't.\n // If the error is recoverable, we can only re-report it if there is\n // a node we can return.\n\n if (jsx?.node) {\n /*:: invariant(jsx.failState) */\n this.state = jsx.failState;\n return jsx.node;\n }\n\n if (arrowExpression) {\n /*:: invariant(arrow.failState) */\n this.state = arrow.failState;\n return arrowExpression;\n }\n\n if (jsx?.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n\n /*:: invariant(typeParameters) */\n throw this.raise(\n typeParameters.start,\n FlowErrors.UnexpectedTokenAfterTypeParameter,\n );\n }\n\n return super.parseMaybeAssign(\n refExpressionErrors,\n afterLeftParse,\n refNeedsArrowPos,\n );\n }\n\n // handle return types for arrow functions\n parseArrow(node: N.ArrowFunctionExpression): ?N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n const result = this.tryParse(() => {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n\n const typeNode = this.startNode();\n\n [\n // $FlowFixMe (destructuring not supported yet)\n typeNode.typeAnnotation,\n // $FlowFixMe (destructuring not supported yet)\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser();\n\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n if (this.canInsertSemicolon()) this.unexpected();\n if (!this.match(tt.arrow)) this.unexpected();\n\n return typeNode;\n });\n\n if (result.thrown) return null;\n /*:: invariant(result.node) */\n\n if (result.error) this.state = result.failState;\n\n // assign after it is clear it is an arrow\n node.returnType = result.node.typeAnnotation\n ? this.finishNode(result.node, \"TypeAnnotation\")\n : null;\n }\n\n return super.parseArrow(node);\n }\n\n shouldParseArrow(): boolean {\n return this.match(tt.colon) || super.shouldParseArrow();\n }\n\n setArrowFunctionParameters(\n node: N.ArrowFunctionExpression,\n params: N.Expression[],\n ): void {\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n node.params = params;\n } else {\n super.setArrowFunctionParameters(node, params);\n }\n }\n\n checkParams(\n node: N.Function,\n allowDuplicates: boolean,\n isArrowFunction: ?boolean,\n ): void {\n if (\n isArrowFunction &&\n this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1\n ) {\n return;\n }\n\n // ensure the `this` param is first, if it exists\n for (let i = 0; i < node.params.length; i++) {\n if (this.isThisParam(node.params[i]) && i > 0) {\n this.raise(node.params[i].start, FlowErrors.ThisParamMustBeFirst);\n }\n }\n\n return super.checkParams(...arguments);\n }\n\n parseParenAndDistinguishExpression(canBeArrow: boolean): N.Expression {\n return super.parseParenAndDistinguishExpression(\n canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1,\n );\n }\n\n parseSubscripts(\n base: N.Expression,\n startPos: number,\n startLoc: Position,\n noCalls?: ?boolean,\n ): N.Expression {\n if (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.state.noArrowAt.indexOf(startPos) !== -1\n ) {\n this.next();\n\n const node = this.startNodeAt(startPos, startLoc);\n node.callee = base;\n node.arguments = this.parseCallExpressionArguments(tt.parenR, false);\n base = this.finishNode(node, \"CallExpression\");\n } else if (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.isRelational(\"<\")\n ) {\n const state = this.state.clone();\n const arrow = this.tryParse(\n abort =>\n this.parseAsyncArrowWithTypeParameters(startPos, startLoc) ||\n abort(),\n state,\n );\n\n if (!arrow.error && !arrow.aborted) return arrow.node;\n\n const result = this.tryParse(\n () => super.parseSubscripts(base, startPos, startLoc, noCalls),\n state,\n );\n\n if (result.node && !result.error) return result.node;\n\n if (arrow.node) {\n this.state = arrow.failState;\n return arrow.node;\n }\n\n if (result.node) {\n this.state = result.failState;\n return result.node;\n }\n\n throw arrow.error || result.error;\n }\n\n return super.parseSubscripts(base, startPos, startLoc, noCalls);\n }\n\n parseSubscript(\n base: N.Expression,\n startPos: number,\n startLoc: Position,\n noCalls: ?boolean,\n subscriptState: N.ParseSubscriptState,\n ): N.Expression {\n if (this.match(tt.questionDot) && this.isLookaheadToken_lt()) {\n subscriptState.optionalChainMember = true;\n if (noCalls) {\n subscriptState.stop = true;\n return base;\n }\n this.next();\n const node: N.OptionalCallExpression = this.startNodeAt(\n startPos,\n startLoc,\n );\n node.callee = base;\n node.typeArguments = this.flowParseTypeParameterInstantiation();\n this.expect(tt.parenL);\n // $FlowFixMe\n node.arguments = this.parseCallExpressionArguments(tt.parenR, false);\n node.optional = true;\n return this.finishCallExpression(node, /* optional */ true);\n } else if (\n !noCalls &&\n this.shouldParseTypes() &&\n this.isRelational(\"<\")\n ) {\n const node = this.startNodeAt(startPos, startLoc);\n node.callee = base;\n\n const result = this.tryParse(() => {\n node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();\n this.expect(tt.parenL);\n node.arguments = this.parseCallExpressionArguments(tt.parenR, false);\n if (subscriptState.optionalChainMember) node.optional = false;\n return this.finishCallExpression(\n node,\n subscriptState.optionalChainMember,\n );\n });\n\n if (result.node) {\n if (result.error) this.state = result.failState;\n return result.node;\n }\n }\n\n return super.parseSubscript(\n base,\n startPos,\n startLoc,\n noCalls,\n subscriptState,\n );\n }\n\n parseNewArguments(node: N.NewExpression): void {\n let targs = null;\n if (this.shouldParseTypes() && this.isRelational(\"<\")) {\n targs = this.tryParse(() =>\n this.flowParseTypeParameterInstantiationCallOrNew(),\n ).node;\n }\n node.typeArguments = targs;\n\n super.parseNewArguments(node);\n }\n\n parseAsyncArrowWithTypeParameters(\n startPos: number,\n startLoc: Position,\n ): ?N.ArrowFunctionExpression {\n const node = this.startNodeAt(startPos, startLoc);\n this.parseFunctionParams(node);\n if (!this.parseArrow(node)) return;\n return this.parseArrowExpression(\n node,\n /* params */ undefined,\n /* isAsync */ true,\n );\n }\n\n readToken_mult_modulo(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (\n code === charCodes.asterisk &&\n next === charCodes.slash &&\n this.state.hasFlowComment\n ) {\n this.state.hasFlowComment = false;\n this.state.pos += 2;\n this.nextToken();\n return;\n }\n\n super.readToken_mult_modulo(code);\n }\n\n readToken_pipe_amp(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (\n code === charCodes.verticalBar &&\n next === charCodes.rightCurlyBrace\n ) {\n // '|}'\n this.finishOp(tt.braceBarR, 2);\n return;\n }\n\n super.readToken_pipe_amp(code);\n }\n\n parseTopLevel(file: N.File, program: N.Program): N.File {\n const fileNode = super.parseTopLevel(file, program);\n if (this.state.hasFlowComment) {\n this.raise(this.state.pos, FlowErrors.UnterminatedFlowComment);\n }\n return fileNode;\n }\n\n skipBlockComment(): void {\n if (this.hasPlugin(\"flowComments\") && this.skipFlowComment()) {\n if (this.state.hasFlowComment) {\n this.unexpected(null, FlowErrors.NestedFlowComment);\n }\n this.hasFlowCommentCompletion();\n this.state.pos += this.skipFlowComment();\n this.state.hasFlowComment = true;\n return;\n }\n\n if (this.state.hasFlowComment) {\n const end = this.input.indexOf(\"*-/\", (this.state.pos += 2));\n if (end === -1) {\n throw this.raise(this.state.pos - 2, Errors.UnterminatedComment);\n }\n this.state.pos = end + 3;\n return;\n }\n\n super.skipBlockComment();\n }\n\n skipFlowComment(): number | boolean {\n const { pos } = this.state;\n let shiftToFirstNonWhiteSpace = 2;\n while (\n [charCodes.space, charCodes.tab].includes(\n this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace),\n )\n ) {\n shiftToFirstNonWhiteSpace++;\n }\n\n const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);\n const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);\n\n if (ch2 === charCodes.colon && ch3 === charCodes.colon) {\n return shiftToFirstNonWhiteSpace + 2; // check for /*::\n }\n if (\n this.input.slice(\n shiftToFirstNonWhiteSpace + pos,\n shiftToFirstNonWhiteSpace + pos + 12,\n ) === \"flow-include\"\n ) {\n return shiftToFirstNonWhiteSpace + 12; // check for /*flow-include\n }\n if (ch2 === charCodes.colon && ch3 !== charCodes.colon) {\n return shiftToFirstNonWhiteSpace; // check for /*:, advance up to :\n }\n return false;\n }\n\n hasFlowCommentCompletion(): void {\n const end = this.input.indexOf(\"*/\", this.state.pos);\n if (end === -1) {\n throw this.raise(this.state.pos, Errors.UnterminatedComment);\n }\n }\n\n // Flow enum parsing\n\n flowEnumErrorBooleanMemberNotInitialized(\n pos: number,\n { enumName, memberName }: { enumName: string, memberName: string },\n ): void {\n this.raise(\n pos,\n FlowErrors.EnumBooleanMemberNotInitialized,\n memberName,\n enumName,\n );\n }\n\n flowEnumErrorInvalidMemberName(\n pos: number,\n { enumName, memberName }: { enumName: string, memberName: string },\n ): void {\n const suggestion = memberName[0].toUpperCase() + memberName.slice(1);\n this.raise(\n pos,\n FlowErrors.EnumInvalidMemberName,\n memberName,\n suggestion,\n enumName,\n );\n }\n\n flowEnumErrorDuplicateMemberName(\n pos: number,\n { enumName, memberName }: { enumName: string, memberName: string },\n ): void {\n this.raise(pos, FlowErrors.EnumDuplicateMemberName, memberName, enumName);\n }\n\n flowEnumErrorInconsistentMemberValues(\n pos: number,\n { enumName }: { enumName: string },\n ): void {\n this.raise(pos, FlowErrors.EnumInconsistentMemberValues, enumName);\n }\n\n flowEnumErrorInvalidExplicitType(\n pos: number,\n {\n enumName,\n suppliedType,\n }: { enumName: string, suppliedType: null | string },\n ) {\n return this.raise(\n pos,\n suppliedType === null\n ? FlowErrors.EnumInvalidExplicitTypeUnknownSupplied\n : FlowErrors.EnumInvalidExplicitType,\n enumName,\n suppliedType,\n );\n }\n\n flowEnumErrorInvalidMemberInitializer(\n pos: number,\n { enumName, explicitType, memberName }: EnumContext,\n ) {\n let message = null;\n switch (explicitType) {\n case \"boolean\":\n case \"number\":\n case \"string\":\n message = FlowErrors.EnumInvalidMemberInitializerPrimaryType;\n break;\n case \"symbol\":\n message = FlowErrors.EnumInvalidMemberInitializerSymbolType;\n break;\n default:\n // null\n message = FlowErrors.EnumInvalidMemberInitializerUnknownType;\n }\n return this.raise(pos, message, enumName, memberName, explicitType);\n }\n\n flowEnumErrorNumberMemberNotInitialized(\n pos: number,\n { enumName, memberName }: { enumName: string, memberName: string },\n ): void {\n this.raise(\n pos,\n FlowErrors.EnumNumberMemberNotInitialized,\n enumName,\n memberName,\n );\n }\n\n flowEnumErrorStringMemberInconsistentlyInitailized(\n pos: number,\n { enumName }: { enumName: string },\n ): void {\n this.raise(\n pos,\n FlowErrors.EnumStringMemberInconsistentlyInitailized,\n enumName,\n );\n }\n\n flowEnumMemberInit(): EnumMemberInit {\n const startPos = this.state.start;\n const endOfInit = () => this.match(tt.comma) || this.match(tt.braceR);\n switch (this.state.type) {\n case tt.num: {\n const literal = this.parseLiteral(this.state.value, \"NumericLiteral\");\n if (endOfInit()) {\n return { type: \"number\", pos: literal.start, value: literal };\n }\n return { type: \"invalid\", pos: startPos };\n }\n case tt.string: {\n const literal = this.parseLiteral(this.state.value, \"StringLiteral\");\n if (endOfInit()) {\n return { type: \"string\", pos: literal.start, value: literal };\n }\n return { type: \"invalid\", pos: startPos };\n }\n case tt._true:\n case tt._false: {\n const literal = this.parseBooleanLiteral();\n if (endOfInit()) {\n return {\n type: \"boolean\",\n pos: literal.start,\n value: literal,\n };\n }\n return { type: \"invalid\", pos: startPos };\n }\n default:\n return { type: \"invalid\", pos: startPos };\n }\n }\n\n flowEnumMemberRaw(): { id: N.Node, init: EnumMemberInit } {\n const pos = this.state.start;\n const id = this.parseIdentifier(true);\n const init = this.eat(tt.eq)\n ? this.flowEnumMemberInit()\n : { type: \"none\", pos };\n return { id, init };\n }\n\n flowEnumCheckExplicitTypeMismatch(\n pos: number,\n context: EnumContext,\n expectedType: EnumExplicitType,\n ): void {\n const { explicitType } = context;\n if (explicitType === null) {\n return;\n }\n if (explicitType !== expectedType) {\n this.flowEnumErrorInvalidMemberInitializer(pos, context);\n }\n }\n\n flowEnumMembers({\n enumName,\n explicitType,\n }: {\n enumName: string,\n explicitType: EnumExplicitType,\n }): {|\n members: {|\n booleanMembers: Array,\n numberMembers: Array,\n stringMembers: Array,\n defaultedMembers: Array,\n |},\n hasUnknownMembers: boolean,\n |} {\n const seenNames = new Set();\n const members = {\n booleanMembers: [],\n numberMembers: [],\n stringMembers: [],\n defaultedMembers: [],\n };\n let hasUnknownMembers = false;\n while (!this.match(tt.braceR)) {\n if (this.eat(tt.ellipsis)) {\n hasUnknownMembers = true;\n break;\n }\n const memberNode = this.startNode();\n const { id, init } = this.flowEnumMemberRaw();\n const memberName = id.name;\n if (memberName === \"\") {\n continue;\n }\n if (/^[a-z]/.test(memberName)) {\n this.flowEnumErrorInvalidMemberName(id.start, {\n enumName,\n memberName,\n });\n }\n if (seenNames.has(memberName)) {\n this.flowEnumErrorDuplicateMemberName(id.start, {\n enumName,\n memberName,\n });\n }\n seenNames.add(memberName);\n const context = { enumName, explicitType, memberName };\n memberNode.id = id;\n switch (init.type) {\n case \"boolean\": {\n this.flowEnumCheckExplicitTypeMismatch(\n init.pos,\n context,\n \"boolean\",\n );\n memberNode.init = init.value;\n members.booleanMembers.push(\n this.finishNode(memberNode, \"EnumBooleanMember\"),\n );\n break;\n }\n case \"number\": {\n this.flowEnumCheckExplicitTypeMismatch(init.pos, context, \"number\");\n memberNode.init = init.value;\n members.numberMembers.push(\n this.finishNode(memberNode, \"EnumNumberMember\"),\n );\n break;\n }\n case \"string\": {\n this.flowEnumCheckExplicitTypeMismatch(init.pos, context, \"string\");\n memberNode.init = init.value;\n members.stringMembers.push(\n this.finishNode(memberNode, \"EnumStringMember\"),\n );\n break;\n }\n case \"invalid\": {\n throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context);\n }\n case \"none\": {\n switch (explicitType) {\n case \"boolean\":\n this.flowEnumErrorBooleanMemberNotInitialized(\n init.pos,\n context,\n );\n break;\n case \"number\":\n this.flowEnumErrorNumberMemberNotInitialized(init.pos, context);\n break;\n default:\n members.defaultedMembers.push(\n this.finishNode(memberNode, \"EnumDefaultedMember\"),\n );\n }\n }\n }\n\n if (!this.match(tt.braceR)) {\n this.expect(tt.comma);\n }\n }\n return { members, hasUnknownMembers };\n }\n\n flowEnumStringMembers(\n initializedMembers: Array,\n defaultedMembers: Array,\n { enumName }: { enumName: string },\n ): Array {\n if (initializedMembers.length === 0) {\n return defaultedMembers;\n } else if (defaultedMembers.length === 0) {\n return initializedMembers;\n } else if (defaultedMembers.length > initializedMembers.length) {\n for (const member of initializedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitailized(\n member.start,\n { enumName },\n );\n }\n return defaultedMembers;\n } else {\n for (const member of defaultedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitailized(\n member.start,\n { enumName },\n );\n }\n return initializedMembers;\n }\n }\n\n flowEnumParseExplicitType({\n enumName,\n }: {\n enumName: string,\n }): EnumExplicitType {\n if (this.eatContextual(\"of\")) {\n if (!this.match(tt.name)) {\n throw this.flowEnumErrorInvalidExplicitType(this.state.start, {\n enumName,\n suppliedType: null,\n });\n }\n\n const { value } = this.state;\n this.next();\n\n if (\n value !== \"boolean\" &&\n value !== \"number\" &&\n value !== \"string\" &&\n value !== \"symbol\"\n ) {\n this.flowEnumErrorInvalidExplicitType(this.state.start, {\n enumName,\n suppliedType: value,\n });\n }\n\n return value;\n }\n return null;\n }\n\n flowEnumBody(node: N.Node, { enumName, nameLoc }): N.Node {\n const explicitType = this.flowEnumParseExplicitType({ enumName });\n this.expect(tt.braceL);\n const { members, hasUnknownMembers } = this.flowEnumMembers({\n enumName,\n explicitType,\n });\n node.hasUnknownMembers = hasUnknownMembers;\n\n switch (explicitType) {\n case \"boolean\":\n node.explicitType = true;\n node.members = members.booleanMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n case \"number\":\n node.explicitType = true;\n node.members = members.numberMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n case \"string\":\n node.explicitType = true;\n node.members = this.flowEnumStringMembers(\n members.stringMembers,\n members.defaultedMembers,\n { enumName },\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n case \"symbol\":\n node.members = members.defaultedMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumSymbolBody\");\n default: {\n // `explicitType` is `null`\n const empty = () => {\n node.members = [];\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n };\n node.explicitType = false;\n\n const boolsLen = members.booleanMembers.length;\n const numsLen = members.numberMembers.length;\n const strsLen = members.stringMembers.length;\n const defaultedLen = members.defaultedMembers.length;\n\n if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {\n return empty();\n } else if (!boolsLen && !numsLen) {\n node.members = this.flowEnumStringMembers(\n members.stringMembers,\n members.defaultedMembers,\n { enumName },\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorBooleanMemberNotInitialized(member.start, {\n enumName,\n memberName: member.id.name,\n });\n }\n node.members = members.booleanMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorNumberMemberNotInitialized(member.start, {\n enumName,\n memberName: member.id.name,\n });\n }\n node.members = members.numberMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n } else {\n this.flowEnumErrorInconsistentMemberValues(nameLoc, { enumName });\n return empty();\n }\n }\n }\n }\n\n flowParseEnumDeclaration(node: N.Node): N.Node {\n const id = this.parseIdentifier();\n node.id = id;\n node.body = this.flowEnumBody(this.startNode(), {\n enumName: id.name,\n nameLoc: id.start,\n });\n return this.finishNode(node, \"EnumDeclaration\");\n }\n\n updateContext(prevType: TokenType): void {\n if (\n this.match(tt.name) &&\n this.state.value === \"of\" &&\n prevType === tt.name &&\n this.input.slice(this.state.lastTokStart, this.state.lastTokEnd) ===\n \"interface\"\n ) {\n this.state.exprAllowed = false;\n } else {\n super.updateContext(prevType);\n }\n }\n\n // check if the next token is a tt.relation(\"<\")\n isLookaheadToken_lt(): boolean {\n const next = this.nextTokenStart();\n if (this.input.charCodeAt(next) === charCodes.lessThan) {\n const afterNext = this.input.charCodeAt(next + 1);\n return (\n afterNext !== charCodes.lessThan && afterNext !== charCodes.equalsTo\n );\n }\n return false;\n }\n\n maybeUnwrapTypeCastExpression(node: N.Node) {\n return node.type === \"TypeCastExpression\" ? node.expression : node;\n }\n };\n","// @flow\n\nconst entities: { [name: string]: string } = {\n quot: \"\\u0022\",\n amp: \"&\",\n apos: \"\\u0027\",\n lt: \"<\",\n gt: \">\",\n nbsp: \"\\u00A0\",\n iexcl: \"\\u00A1\",\n cent: \"\\u00A2\",\n pound: \"\\u00A3\",\n curren: \"\\u00A4\",\n yen: \"\\u00A5\",\n brvbar: \"\\u00A6\",\n sect: \"\\u00A7\",\n uml: \"\\u00A8\",\n copy: \"\\u00A9\",\n ordf: \"\\u00AA\",\n laquo: \"\\u00AB\",\n not: \"\\u00AC\",\n shy: \"\\u00AD\",\n reg: \"\\u00AE\",\n macr: \"\\u00AF\",\n deg: \"\\u00B0\",\n plusmn: \"\\u00B1\",\n sup2: \"\\u00B2\",\n sup3: \"\\u00B3\",\n acute: \"\\u00B4\",\n micro: \"\\u00B5\",\n para: \"\\u00B6\",\n middot: \"\\u00B7\",\n cedil: \"\\u00B8\",\n sup1: \"\\u00B9\",\n ordm: \"\\u00BA\",\n raquo: \"\\u00BB\",\n frac14: \"\\u00BC\",\n frac12: \"\\u00BD\",\n frac34: \"\\u00BE\",\n iquest: \"\\u00BF\",\n Agrave: \"\\u00C0\",\n Aacute: \"\\u00C1\",\n Acirc: \"\\u00C2\",\n Atilde: \"\\u00C3\",\n Auml: \"\\u00C4\",\n Aring: \"\\u00C5\",\n AElig: \"\\u00C6\",\n Ccedil: \"\\u00C7\",\n Egrave: \"\\u00C8\",\n Eacute: \"\\u00C9\",\n Ecirc: \"\\u00CA\",\n Euml: \"\\u00CB\",\n Igrave: \"\\u00CC\",\n Iacute: \"\\u00CD\",\n Icirc: \"\\u00CE\",\n Iuml: \"\\u00CF\",\n ETH: \"\\u00D0\",\n Ntilde: \"\\u00D1\",\n Ograve: \"\\u00D2\",\n Oacute: \"\\u00D3\",\n Ocirc: \"\\u00D4\",\n Otilde: \"\\u00D5\",\n Ouml: \"\\u00D6\",\n times: \"\\u00D7\",\n Oslash: \"\\u00D8\",\n Ugrave: \"\\u00D9\",\n Uacute: \"\\u00DA\",\n Ucirc: \"\\u00DB\",\n Uuml: \"\\u00DC\",\n Yacute: \"\\u00DD\",\n THORN: \"\\u00DE\",\n szlig: \"\\u00DF\",\n agrave: \"\\u00E0\",\n aacute: \"\\u00E1\",\n acirc: \"\\u00E2\",\n atilde: \"\\u00E3\",\n auml: \"\\u00E4\",\n aring: \"\\u00E5\",\n aelig: \"\\u00E6\",\n ccedil: \"\\u00E7\",\n egrave: \"\\u00E8\",\n eacute: \"\\u00E9\",\n ecirc: \"\\u00EA\",\n euml: \"\\u00EB\",\n igrave: \"\\u00EC\",\n iacute: \"\\u00ED\",\n icirc: \"\\u00EE\",\n iuml: \"\\u00EF\",\n eth: \"\\u00F0\",\n ntilde: \"\\u00F1\",\n ograve: \"\\u00F2\",\n oacute: \"\\u00F3\",\n ocirc: \"\\u00F4\",\n otilde: \"\\u00F5\",\n ouml: \"\\u00F6\",\n divide: \"\\u00F7\",\n oslash: \"\\u00F8\",\n ugrave: \"\\u00F9\",\n uacute: \"\\u00FA\",\n ucirc: \"\\u00FB\",\n uuml: \"\\u00FC\",\n yacute: \"\\u00FD\",\n thorn: \"\\u00FE\",\n yuml: \"\\u00FF\",\n OElig: \"\\u0152\",\n oelig: \"\\u0153\",\n Scaron: \"\\u0160\",\n scaron: \"\\u0161\",\n Yuml: \"\\u0178\",\n fnof: \"\\u0192\",\n circ: \"\\u02C6\",\n tilde: \"\\u02DC\",\n Alpha: \"\\u0391\",\n Beta: \"\\u0392\",\n Gamma: \"\\u0393\",\n Delta: \"\\u0394\",\n Epsilon: \"\\u0395\",\n Zeta: \"\\u0396\",\n Eta: \"\\u0397\",\n Theta: \"\\u0398\",\n Iota: \"\\u0399\",\n Kappa: \"\\u039A\",\n Lambda: \"\\u039B\",\n Mu: \"\\u039C\",\n Nu: \"\\u039D\",\n Xi: \"\\u039E\",\n Omicron: \"\\u039F\",\n Pi: \"\\u03A0\",\n Rho: \"\\u03A1\",\n Sigma: \"\\u03A3\",\n Tau: \"\\u03A4\",\n Upsilon: \"\\u03A5\",\n Phi: \"\\u03A6\",\n Chi: \"\\u03A7\",\n Psi: \"\\u03A8\",\n Omega: \"\\u03A9\",\n alpha: \"\\u03B1\",\n beta: \"\\u03B2\",\n gamma: \"\\u03B3\",\n delta: \"\\u03B4\",\n epsilon: \"\\u03B5\",\n zeta: \"\\u03B6\",\n eta: \"\\u03B7\",\n theta: \"\\u03B8\",\n iota: \"\\u03B9\",\n kappa: \"\\u03BA\",\n lambda: \"\\u03BB\",\n mu: \"\\u03BC\",\n nu: \"\\u03BD\",\n xi: \"\\u03BE\",\n omicron: \"\\u03BF\",\n pi: \"\\u03C0\",\n rho: \"\\u03C1\",\n sigmaf: \"\\u03C2\",\n sigma: \"\\u03C3\",\n tau: \"\\u03C4\",\n upsilon: \"\\u03C5\",\n phi: \"\\u03C6\",\n chi: \"\\u03C7\",\n psi: \"\\u03C8\",\n omega: \"\\u03C9\",\n thetasym: \"\\u03D1\",\n upsih: \"\\u03D2\",\n piv: \"\\u03D6\",\n ensp: \"\\u2002\",\n emsp: \"\\u2003\",\n thinsp: \"\\u2009\",\n zwnj: \"\\u200C\",\n zwj: \"\\u200D\",\n lrm: \"\\u200E\",\n rlm: \"\\u200F\",\n ndash: \"\\u2013\",\n mdash: \"\\u2014\",\n lsquo: \"\\u2018\",\n rsquo: \"\\u2019\",\n sbquo: \"\\u201A\",\n ldquo: \"\\u201C\",\n rdquo: \"\\u201D\",\n bdquo: \"\\u201E\",\n dagger: \"\\u2020\",\n Dagger: \"\\u2021\",\n bull: \"\\u2022\",\n hellip: \"\\u2026\",\n permil: \"\\u2030\",\n prime: \"\\u2032\",\n Prime: \"\\u2033\",\n lsaquo: \"\\u2039\",\n rsaquo: \"\\u203A\",\n oline: \"\\u203E\",\n frasl: \"\\u2044\",\n euro: \"\\u20AC\",\n image: \"\\u2111\",\n weierp: \"\\u2118\",\n real: \"\\u211C\",\n trade: \"\\u2122\",\n alefsym: \"\\u2135\",\n larr: \"\\u2190\",\n uarr: \"\\u2191\",\n rarr: \"\\u2192\",\n darr: \"\\u2193\",\n harr: \"\\u2194\",\n crarr: \"\\u21B5\",\n lArr: \"\\u21D0\",\n uArr: \"\\u21D1\",\n rArr: \"\\u21D2\",\n dArr: \"\\u21D3\",\n hArr: \"\\u21D4\",\n forall: \"\\u2200\",\n part: \"\\u2202\",\n exist: \"\\u2203\",\n empty: \"\\u2205\",\n nabla: \"\\u2207\",\n isin: \"\\u2208\",\n notin: \"\\u2209\",\n ni: \"\\u220B\",\n prod: \"\\u220F\",\n sum: \"\\u2211\",\n minus: \"\\u2212\",\n lowast: \"\\u2217\",\n radic: \"\\u221A\",\n prop: \"\\u221D\",\n infin: \"\\u221E\",\n ang: \"\\u2220\",\n and: \"\\u2227\",\n or: \"\\u2228\",\n cap: \"\\u2229\",\n cup: \"\\u222A\",\n int: \"\\u222B\",\n there4: \"\\u2234\",\n sim: \"\\u223C\",\n cong: \"\\u2245\",\n asymp: \"\\u2248\",\n ne: \"\\u2260\",\n equiv: \"\\u2261\",\n le: \"\\u2264\",\n ge: \"\\u2265\",\n sub: \"\\u2282\",\n sup: \"\\u2283\",\n nsub: \"\\u2284\",\n sube: \"\\u2286\",\n supe: \"\\u2287\",\n oplus: \"\\u2295\",\n otimes: \"\\u2297\",\n perp: \"\\u22A5\",\n sdot: \"\\u22C5\",\n lceil: \"\\u2308\",\n rceil: \"\\u2309\",\n lfloor: \"\\u230A\",\n rfloor: \"\\u230B\",\n lang: \"\\u2329\",\n rang: \"\\u232A\",\n loz: \"\\u25CA\",\n spades: \"\\u2660\",\n clubs: \"\\u2663\",\n hearts: \"\\u2665\",\n diams: \"\\u2666\",\n};\nexport default entities;\n","// @flow\n\n// Error messages are colocated with the plugin.\n/* eslint-disable @babel/development-internal/dry-error-messages */\n\nimport * as charCodes from \"charcodes\";\n\nimport XHTMLEntities from \"./xhtml\";\nimport type Parser from \"../../parser\";\nimport type { ExpressionErrors } from \"../../parser/util\";\nimport { TokenType, types as tt } from \"../../tokenizer/types\";\nimport { TokContext, types as tc } from \"../../tokenizer/context\";\nimport * as N from \"../../types\";\nimport { isIdentifierChar, isIdentifierStart } from \"../../util/identifier\";\nimport type { Position } from \"../../util/location\";\nimport { isNewLine } from \"../../util/whitespace\";\nimport { Errors } from \"../../parser/error\";\n\nconst HEX_NUMBER = /^[\\da-fA-F]+$/;\nconst DECIMAL_NUMBER = /^\\d+$/;\n\nconst JsxErrors = Object.freeze({\n AttributeIsEmpty:\n \"JSX attributes must only be assigned a non-empty expression\",\n MissingClosingTagFragment: \"Expected corresponding JSX closing tag for <>\",\n MissingClosingTagElement: \"Expected corresponding JSX closing tag for <%0>\",\n UnexpectedSequenceExpression:\n \"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?\",\n UnsupportedJsxValue:\n \"JSX value should be either an expression or a quoted JSX text\",\n UnterminatedJsxContent: \"Unterminated JSX contents\",\n UnwrappedAdjacentJSXElements:\n \"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?\",\n});\n\n// Be aware that this file is always executed and not only when the plugin is enabled.\n// Therefore this contexts and tokens do always exist.\ntc.j_oTag = new TokContext(\"...\", true, true);\n\ntt.jsxName = new TokenType(\"jsxName\");\ntt.jsxText = new TokenType(\"jsxText\", { beforeExpr: true });\ntt.jsxTagStart = new TokenType(\"jsxTagStart\", { startsExpr: true });\ntt.jsxTagEnd = new TokenType(\"jsxTagEnd\");\n\ntt.jsxTagStart.updateContext = function () {\n this.state.context.push(tc.j_expr); // treat as beginning of JSX expression\n this.state.context.push(tc.j_oTag); // start opening tag context\n this.state.exprAllowed = false;\n};\n\ntt.jsxTagEnd.updateContext = function (prevType) {\n const out = this.state.context.pop();\n if ((out === tc.j_oTag && prevType === tt.slash) || out === tc.j_cTag) {\n this.state.context.pop();\n this.state.exprAllowed = this.curContext() === tc.j_expr;\n } else {\n this.state.exprAllowed = true;\n }\n};\n\nfunction isFragment(object: ?N.JSXElement): boolean {\n return object\n ? object.type === \"JSXOpeningFragment\" ||\n object.type === \"JSXClosingFragment\"\n : false;\n}\n\n// Transforms JSX element name to string.\n\nfunction getQualifiedJSXName(\n object: N.JSXIdentifier | N.JSXNamespacedName | N.JSXMemberExpression,\n): string {\n if (object.type === \"JSXIdentifier\") {\n return object.name;\n }\n\n if (object.type === \"JSXNamespacedName\") {\n return object.namespace.name + \":\" + object.name.name;\n }\n\n if (object.type === \"JSXMemberExpression\") {\n return (\n getQualifiedJSXName(object.object) +\n \".\" +\n getQualifiedJSXName(object.property)\n );\n }\n\n // istanbul ignore next\n throw new Error(\"Node had unexpected type: \" + object.type);\n}\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n // Reads inline JSX contents token.\n\n jsxReadToken(): void {\n let out = \"\";\n let chunkStart = this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(this.state.start, JsxErrors.UnterminatedJsxContent);\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n\n switch (ch) {\n case charCodes.lessThan:\n case charCodes.leftCurlyBrace:\n if (this.state.pos === this.state.start) {\n if (ch === charCodes.lessThan && this.state.exprAllowed) {\n ++this.state.pos;\n return this.finishToken(tt.jsxTagStart);\n }\n return super.getTokenFromCode(ch);\n }\n out += this.input.slice(chunkStart, this.state.pos);\n return this.finishToken(tt.jsxText, out);\n\n case charCodes.ampersand:\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n break;\n\n case charCodes.greaterThan:\n case charCodes.rightCurlyBrace:\n if (process.env.BABEL_8_BREAKING) {\n const htmlEntity =\n ch === charCodes.rightCurlyBrace ? \"}\" : \">\";\n const char = this.input[this.state.pos];\n this.raise(\n this.state.pos,\n `Unexpected token \\`${char}\\`. Did you mean \\`${htmlEntity}\\` or \\`{'${char}'}\\`?`,\n );\n }\n /* falls through */\n\n default:\n if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(true);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n }\n }\n\n jsxReadNewLine(normalizeCRLF: boolean): string {\n const ch = this.input.charCodeAt(this.state.pos);\n let out;\n ++this.state.pos;\n if (\n ch === charCodes.carriageReturn &&\n this.input.charCodeAt(this.state.pos) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n out = normalizeCRLF ? \"\\n\" : \"\\r\\n\";\n } else {\n out = String.fromCharCode(ch);\n }\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n\n return out;\n }\n\n jsxReadString(quote: number): void {\n let out = \"\";\n let chunkStart = ++this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(this.state.start, Errors.UnterminatedString);\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n if (ch === quote) break;\n if (ch === charCodes.ampersand) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n } else if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(false);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n out += this.input.slice(chunkStart, this.state.pos++);\n return this.finishToken(tt.string, out);\n }\n\n jsxReadEntity(): string {\n let str = \"\";\n let count = 0;\n let entity;\n let ch = this.input[this.state.pos];\n\n const startPos = ++this.state.pos;\n while (this.state.pos < this.length && count++ < 10) {\n ch = this.input[this.state.pos++];\n if (ch === \";\") {\n if (str[0] === \"#\") {\n if (str[1] === \"x\") {\n str = str.substr(2);\n if (HEX_NUMBER.test(str)) {\n entity = String.fromCodePoint(parseInt(str, 16));\n }\n } else {\n str = str.substr(1);\n if (DECIMAL_NUMBER.test(str)) {\n entity = String.fromCodePoint(parseInt(str, 10));\n }\n }\n } else {\n entity = XHTMLEntities[str];\n }\n break;\n }\n str += ch;\n }\n if (!entity) {\n this.state.pos = startPos;\n return \"&\";\n }\n return entity;\n }\n\n // Read a JSX identifier (valid tag or attribute name).\n //\n // Optimized version since JSX identifiers can\"t contain\n // escape characters and so can be read as single slice.\n // Also assumes that first character was already checked\n // by isIdentifierStart in readToken.\n\n jsxReadWord(): void {\n let ch;\n const start = this.state.pos;\n do {\n ch = this.input.charCodeAt(++this.state.pos);\n } while (isIdentifierChar(ch) || ch === charCodes.dash);\n return this.finishToken(\n tt.jsxName,\n this.input.slice(start, this.state.pos),\n );\n }\n\n // Parse next token as JSX identifier\n\n jsxParseIdentifier(): N.JSXIdentifier {\n const node = this.startNode();\n if (this.match(tt.jsxName)) {\n node.name = this.state.value;\n } else if (this.state.type.keyword) {\n node.name = this.state.type.keyword;\n } else {\n this.unexpected();\n }\n this.next();\n return this.finishNode(node, \"JSXIdentifier\");\n }\n\n // Parse namespaced identifier.\n\n jsxParseNamespacedName(): N.JSXNamespacedName {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const name = this.jsxParseIdentifier();\n if (!this.eat(tt.colon)) return name;\n\n const node = this.startNodeAt(startPos, startLoc);\n node.namespace = name;\n node.name = this.jsxParseIdentifier();\n return this.finishNode(node, \"JSXNamespacedName\");\n }\n\n // Parses element name in any form - namespaced, member\n // or single identifier.\n\n jsxParseElementName():\n | N.JSXIdentifier\n | N.JSXNamespacedName\n | N.JSXMemberExpression {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n let node = this.jsxParseNamespacedName();\n if (node.type === \"JSXNamespacedName\") {\n return node;\n }\n while (this.eat(tt.dot)) {\n const newNode = this.startNodeAt(startPos, startLoc);\n newNode.object = node;\n newNode.property = this.jsxParseIdentifier();\n node = this.finishNode(newNode, \"JSXMemberExpression\");\n }\n return node;\n }\n\n // Parses any type of JSX attribute value.\n\n jsxParseAttributeValue(): N.Expression {\n let node;\n switch (this.state.type) {\n case tt.braceL:\n node = this.startNode();\n this.next();\n node = this.jsxParseExpressionContainer(node);\n if (node.expression.type === \"JSXEmptyExpression\") {\n this.raise(node.start, JsxErrors.AttributeIsEmpty);\n }\n return node;\n\n case tt.jsxTagStart:\n case tt.string:\n return this.parseExprAtom();\n\n default:\n throw this.raise(this.state.start, JsxErrors.UnsupportedJsxValue);\n }\n }\n\n // JSXEmptyExpression is unique type since it doesn't actually parse anything,\n // and so it should start at the end of last read token (left brace) and finish\n // at the beginning of the next one (right brace).\n\n jsxParseEmptyExpression(): N.JSXEmptyExpression {\n const node = this.startNodeAt(\n this.state.lastTokEnd,\n this.state.lastTokEndLoc,\n );\n return this.finishNodeAt(\n node,\n \"JSXEmptyExpression\",\n this.state.start,\n this.state.startLoc,\n );\n }\n\n // Parse JSX spread child\n\n jsxParseSpreadChild(node: N.JSXSpreadChild): N.JSXSpreadChild {\n this.next(); // ellipsis\n node.expression = this.parseExpression();\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"JSXSpreadChild\");\n }\n\n // Parses JSX expression enclosed into curly brackets.\n\n jsxParseExpressionContainer(\n node: N.JSXExpressionContainer,\n ): N.JSXExpressionContainer {\n if (this.match(tt.braceR)) {\n node.expression = this.jsxParseEmptyExpression();\n } else {\n const expression = this.parseExpression();\n\n if (process.env.BABEL_8_BREAKING) {\n if (\n expression.type === \"SequenceExpression\" &&\n !expression.extra?.parenthesized\n ) {\n this.raise(\n expression.expressions[1].start,\n JsxErrors.UnexpectedSequenceExpression,\n );\n }\n }\n\n node.expression = expression;\n }\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"JSXExpressionContainer\");\n }\n\n // Parses following JSX attribute name-value pair.\n\n jsxParseAttribute(): N.JSXAttribute {\n const node = this.startNode();\n if (this.eat(tt.braceL)) {\n this.expect(tt.ellipsis);\n node.argument = this.parseMaybeAssignAllowIn();\n this.expect(tt.braceR);\n return this.finishNode(node, \"JSXSpreadAttribute\");\n }\n node.name = this.jsxParseNamespacedName();\n node.value = this.eat(tt.eq) ? this.jsxParseAttributeValue() : null;\n return this.finishNode(node, \"JSXAttribute\");\n }\n\n // Parses JSX opening tag starting after \"<\".\n\n jsxParseOpeningElementAt(\n startPos: number,\n startLoc: Position,\n ): N.JSXOpeningElement {\n const node = this.startNodeAt(startPos, startLoc);\n if (this.match(tt.jsxTagEnd)) {\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXOpeningFragment\");\n }\n node.name = this.jsxParseElementName();\n return this.jsxParseOpeningElementAfterName(node);\n }\n\n jsxParseOpeningElementAfterName(\n node: N.JSXOpeningElement,\n ): N.JSXOpeningElement {\n const attributes: N.JSXAttribute[] = [];\n while (!this.match(tt.slash) && !this.match(tt.jsxTagEnd)) {\n attributes.push(this.jsxParseAttribute());\n }\n node.attributes = attributes;\n node.selfClosing = this.eat(tt.slash);\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXOpeningElement\");\n }\n\n // Parses JSX closing tag starting after \" JSX open tag -> ... anymore\n this.state.context.push(tc.j_cTag); // reconsider as closing tag context\n this.state.exprAllowed = false;\n } else {\n return super.updateContext(prevType);\n }\n }\n };\n","// @flow\n\nimport ScopeHandler, { Scope } from \"../../util/scope\";\nimport {\n BIND_KIND_TYPE,\n BIND_FLAGS_TS_ENUM,\n BIND_FLAGS_TS_CONST_ENUM,\n BIND_FLAGS_TS_EXPORT_ONLY,\n BIND_KIND_VALUE,\n BIND_FLAGS_CLASS,\n type ScopeFlags,\n type BindingTypes,\n} from \"../../util/scopeflags\";\nimport * as N from \"../../types\";\n\nclass TypeScriptScope extends Scope {\n types: string[] = [];\n\n // enums (which are also in .types)\n enums: string[] = [];\n\n // const enums (which are also in .enums and .types)\n constEnums: string[] = [];\n\n // classes (which are also in .lexical) and interface (which are also in .types)\n classes: string[] = [];\n\n // namespaces and ambient functions (or classes) are too difficult to track,\n // especially without type analysis.\n // We need to track them anyway, to avoid \"X is not defined\" errors\n // when exporting them.\n exportOnlyBindings: string[] = [];\n}\n\n// See https://github.com/babel/babel/pull/9766#discussion_r268920730 for an\n// explanation of how typescript handles scope.\n\nexport default class TypeScriptScopeHandler extends ScopeHandler {\n createScope(flags: ScopeFlags): TypeScriptScope {\n return new TypeScriptScope(flags);\n }\n\n declareName(name: string, bindingType: BindingTypes, pos: number) {\n const scope = this.currentScope();\n if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {\n this.maybeExportDefined(scope, name);\n scope.exportOnlyBindings.push(name);\n return;\n }\n\n super.declareName(...arguments);\n\n if (bindingType & BIND_KIND_TYPE) {\n if (!(bindingType & BIND_KIND_VALUE)) {\n // \"Value\" bindings have already been registered by the superclass.\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n this.maybeExportDefined(scope, name);\n }\n scope.types.push(name);\n }\n if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.push(name);\n if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.push(name);\n if (bindingType & BIND_FLAGS_CLASS) scope.classes.push(name);\n }\n\n isRedeclaredInScope(\n scope: TypeScriptScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (scope.enums.indexOf(name) > -1) {\n if (bindingType & BIND_FLAGS_TS_ENUM) {\n // Enums can be merged with other enums if they are both\n // const or both non-const.\n const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);\n const wasConst = scope.constEnums.indexOf(name) > -1;\n return isConst !== wasConst;\n }\n return true;\n }\n if (bindingType & BIND_FLAGS_CLASS && scope.classes.indexOf(name) > -1) {\n if (scope.lexical.indexOf(name) > -1) {\n // Classes can be merged with interfaces\n return !!(bindingType & BIND_KIND_VALUE);\n } else {\n // Interface can be merged with other classes or interfaces\n return false;\n }\n }\n if (bindingType & BIND_KIND_TYPE && scope.types.indexOf(name) > -1) {\n return true;\n }\n\n return super.isRedeclaredInScope(...arguments);\n }\n\n checkLocalExport(id: N.Identifier) {\n if (\n this.scopeStack[0].types.indexOf(id.name) === -1 &&\n this.scopeStack[0].exportOnlyBindings.indexOf(id.name) === -1\n ) {\n super.checkLocalExport(id);\n }\n }\n}\n","// @flow\nexport const PARAM = 0b0000, // Initial Parameter flags\n PARAM_YIELD = 0b0001, // track [Yield] production parameter\n PARAM_AWAIT = 0b0010, // track [Await] production parameter\n PARAM_RETURN = 0b0100, // track [Return] production parameter\n PARAM_IN = 0b1000; // track [In] production parameter\n\n// ProductionParameterHandler is a stack fashioned production parameter tracker\n// https://tc39.es/ecma262/#sec-grammar-notation\n// The tracked parameters are defined above.\n//\n// Whenever [+Await]/[+Yield] appears in the right-hand sides of a production,\n// we must enter a new tracking stack. For example when parsing\n//\n// AsyncFunctionDeclaration [Yield, Await]:\n// async [no LineTerminator here] function BindingIdentifier[?Yield, ?Await]\n// ( FormalParameters[~Yield, +Await] ) { AsyncFunctionBody }\n//\n// we must follow such process:\n//\n// 1. parse async keyword\n// 2. parse function keyword\n// 3. parse bindingIdentifier <= inherit current parameters: [?Await]\n// 4. enter new stack with (PARAM_AWAIT)\n// 5. parse formal parameters <= must have [Await] parameter [+Await]\n// 6. parse function body\n// 7. exit current stack\n\nexport type ParamKind =\n | typeof PARAM\n | typeof PARAM_AWAIT\n | typeof PARAM_IN\n | typeof PARAM_RETURN\n | typeof PARAM_YIELD;\n\nexport default class ProductionParameterHandler {\n stacks: Array = [];\n enter(flags: ParamKind) {\n this.stacks.push(flags);\n }\n\n exit() {\n this.stacks.pop();\n }\n\n currentFlags(): ParamKind {\n return this.stacks[this.stacks.length - 1];\n }\n\n get hasAwait(): boolean {\n return (this.currentFlags() & PARAM_AWAIT) > 0;\n }\n\n get hasYield(): boolean {\n return (this.currentFlags() & PARAM_YIELD) > 0;\n }\n\n get hasReturn(): boolean {\n return (this.currentFlags() & PARAM_RETURN) > 0;\n }\n\n get hasIn(): boolean {\n return (this.currentFlags() & PARAM_IN) > 0;\n }\n}\n\nexport function functionFlags(\n isAsync: boolean,\n isGenerator: boolean,\n): ParamKind {\n return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);\n}\n","// @flow\n\n/*:: declare var invariant; */\n\n// Error messages are colocated with the plugin.\n/* eslint-disable @babel/development-internal/dry-error-messages */\n\nimport type { TokenType } from \"../../tokenizer/types\";\nimport type State from \"../../tokenizer/state\";\nimport { types as tt } from \"../../tokenizer/types\";\nimport { types as ct } from \"../../tokenizer/context\";\nimport * as N from \"../../types\";\nimport type { Pos, Position } from \"../../util/location\";\nimport type Parser from \"../../parser\";\nimport {\n type BindingTypes,\n SCOPE_TS_MODULE,\n SCOPE_OTHER,\n BIND_TS_ENUM,\n BIND_TS_CONST_ENUM,\n BIND_TS_TYPE,\n BIND_TS_INTERFACE,\n BIND_TS_AMBIENT,\n BIND_TS_NAMESPACE,\n BIND_CLASS,\n BIND_LEXICAL,\n} from \"../../util/scopeflags\";\nimport TypeScriptScopeHandler from \"./scope\";\nimport * as charCodes from \"charcodes\";\nimport type { ExpressionErrors } from \"../../parser/util\";\nimport { PARAM } from \"../../util/production-parameter\";\nimport { Errors } from \"../../parser/error\";\n\ntype TsModifier =\n | \"readonly\"\n | \"abstract\"\n | \"declare\"\n | \"static\"\n | N.Accessibility;\n\nfunction nonNull(x: ?T): T {\n if (x == null) {\n // $FlowIgnore\n throw new Error(`Unexpected ${x} value.`);\n }\n return x;\n}\n\nfunction assert(x: boolean): void {\n if (!x) {\n throw new Error(\"Assert fail\");\n }\n}\n\ntype ParsingContext =\n | \"EnumMembers\"\n | \"HeritageClauseElement\"\n | \"TupleElementTypes\"\n | \"TypeMembers\"\n | \"TypeParametersOrArguments\";\n\nconst TSErrors = Object.freeze({\n ClassMethodHasDeclare: \"Class methods cannot have the 'declare' modifier\",\n ClassMethodHasReadonly: \"Class methods cannot have the 'readonly' modifier\",\n ConstructorHasTypeParameters:\n \"Type parameters cannot appear on a constructor declaration.\",\n DeclareClassFieldHasInitializer:\n \"Initializers are not allowed in ambient contexts.\",\n DeclareFunctionHasImplementation:\n \"An implementation cannot be declared in ambient contexts.\",\n DuplicateModifier: \"Duplicate modifier: '%0'\",\n DuplicateAccessibilityModifier: \"Accessibility modifier already seen.\",\n EmptyHeritageClauseType: \"'%0' list cannot be empty.\",\n EmptyTypeArguments: \"Type argument list cannot be empty.\",\n EmptyTypeParameters: \"Type parameter list cannot be empty.\",\n ExpectedAmbientAfterExportDeclare:\n \"'export declare' must be followed by an ambient declaration.\",\n IndexSignatureHasAbstract:\n \"Index signatures cannot have the 'abstract' modifier\",\n IndexSignatureHasAccessibility:\n \"Index signatures cannot have an accessibility modifier ('%0')\",\n IndexSignatureHasStatic: \"Index signatures cannot have the 'static' modifier\",\n IndexSignatureHasDeclare:\n \"Index signatures cannot have the 'declare' modifier\",\n InvalidModifierOnTypeMember: \"'%0' modifier cannot appear on a type member.\",\n InvalidTupleMemberLabel:\n \"Tuple members must be labeled with a simple identifier.\",\n MixedLabeledAndUnlabeledElements:\n \"Tuple members must all have names or all not have names.\",\n NonAbstractClassHasAbstractMethod:\n \"Abstract methods can only appear within an abstract class.\",\n NonClassMethodPropertyHasAbstractModifer:\n \"'abstract' modifier can only appear on a class, method, or property declaration.\",\n OptionalTypeBeforeRequired:\n \"A required element cannot follow an optional element.\",\n PatternIsOptional:\n \"A binding pattern parameter cannot be optional in an implementation signature.\",\n PrivateElementHasAbstract:\n \"Private elements cannot have the 'abstract' modifier.\",\n PrivateElementHasAccessibility:\n \"Private elements cannot have an accessibility modifier ('%0')\",\n ReadonlyForMethodSignature:\n \"'readonly' modifier can only appear on a property declaration or index signature.\",\n TypeAnnotationAfterAssign:\n \"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`\",\n UnexpectedParameterModifier:\n \"A parameter property is only allowed in a constructor implementation.\",\n UnexpectedReadonly:\n \"'readonly' type modifier is only permitted on array and tuple literal types.\",\n UnexpectedTypeAnnotation: \"Did not expect a type annotation here.\",\n UnexpectedTypeCastInParameter: \"Unexpected type cast in parameter position.\",\n UnsupportedImportTypeArgument:\n \"Argument in a type import must be a string literal\",\n UnsupportedParameterPropertyKind:\n \"A parameter property may not be declared using a binding pattern.\",\n UnsupportedSignatureParameterKind:\n \"Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got %0\",\n});\n\n// Doesn't handle \"void\" or \"null\" because those are keywords, not identifiers.\n// It also doesn't handle \"intrinsic\", since usually it's not a keyword.\nfunction keywordTypeFromName(\n value: string,\n): N.TsKeywordTypeType | typeof undefined {\n switch (value) {\n case \"any\":\n return \"TSAnyKeyword\";\n case \"boolean\":\n return \"TSBooleanKeyword\";\n case \"bigint\":\n return \"TSBigIntKeyword\";\n case \"never\":\n return \"TSNeverKeyword\";\n case \"number\":\n return \"TSNumberKeyword\";\n case \"object\":\n return \"TSObjectKeyword\";\n case \"string\":\n return \"TSStringKeyword\";\n case \"symbol\":\n return \"TSSymbolKeyword\";\n case \"undefined\":\n return \"TSUndefinedKeyword\";\n case \"unknown\":\n return \"TSUnknownKeyword\";\n default:\n return undefined;\n }\n}\n\nfunction tsIsAccessModifier(modifier: string): boolean %checks {\n return (\n modifier === \"private\" || modifier === \"public\" || modifier === \"protected\"\n );\n}\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n getScopeHandler(): Class {\n return TypeScriptScopeHandler;\n }\n\n tsIsIdentifier(): boolean {\n // TODO: actually a bit more complex in TypeScript, but shouldn't matter.\n // See https://github.com/Microsoft/TypeScript/issues/15008\n return this.match(tt.name);\n }\n\n tsNextTokenCanFollowModifier() {\n // Note: TypeScript's implementation is much more complicated because\n // more things are considered modifiers there.\n // This implementation only handles modifiers not handled by @babel/parser itself. And \"static\".\n // TODO: Would be nice to avoid lookahead. Want a hasLineBreakUpNext() method...\n this.next();\n return (\n (this.match(tt.bracketL) ||\n this.match(tt.braceL) ||\n this.match(tt.star) ||\n this.match(tt.ellipsis) ||\n this.match(tt.hash) ||\n this.isLiteralPropertyName()) &&\n !this.hasPrecedingLineBreak()\n );\n }\n\n /** Parses a modifier matching one the given modifier names. */\n tsParseModifier(allowedModifiers: T[]): ?T {\n if (!this.match(tt.name)) {\n return undefined;\n }\n\n const modifier = this.state.value;\n if (\n allowedModifiers.indexOf(modifier) !== -1 &&\n this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))\n ) {\n return modifier;\n }\n return undefined;\n }\n\n /** Parses a list of modifiers, in any order.\n * If you need a specific order, you must call this function multiple times:\n * this.tsParseModifiers(node, [\"public\"]);\n * this.tsParseModifiers(node, [\"abstract\", \"readonly\"]);\n */\n tsParseModifiers(\n modified: {\n [key: TsModifier]: ?true,\n accessibility?: N.Accessibility,\n },\n allowedModifiers: TsModifier[],\n disallowedModifiers?: TsModifier[],\n errorTemplate?: string,\n ): void {\n for (;;) {\n const startPos = this.state.start;\n const modifier: ?TsModifier = this.tsParseModifier(\n allowedModifiers.concat(disallowedModifiers ?? []),\n );\n\n if (!modifier) break;\n\n if (tsIsAccessModifier(modifier)) {\n if (modified.accessibility) {\n this.raise(startPos, TSErrors.DuplicateAccessibilityModifier);\n } else {\n modified.accessibility = modifier;\n }\n } else {\n if (Object.hasOwnProperty.call(modified, modifier)) {\n this.raise(startPos, TSErrors.DuplicateModifier, modifier);\n }\n modified[modifier] = true;\n }\n\n if (disallowedModifiers?.includes(modifier)) {\n this.raise(\n startPos,\n // $FlowIgnore\n errorTemplate,\n modifier,\n );\n }\n }\n }\n\n tsIsListTerminator(kind: ParsingContext): boolean {\n switch (kind) {\n case \"EnumMembers\":\n case \"TypeMembers\":\n return this.match(tt.braceR);\n case \"HeritageClauseElement\":\n return this.match(tt.braceL);\n case \"TupleElementTypes\":\n return this.match(tt.bracketR);\n case \"TypeParametersOrArguments\":\n return this.isRelational(\">\");\n }\n\n throw new Error(\"Unreachable\");\n }\n\n tsParseList(kind: ParsingContext, parseElement: () => T): T[] {\n const result: T[] = [];\n while (!this.tsIsListTerminator(kind)) {\n // Skipping \"parseListElement\" from the TS source since that's just for error handling.\n result.push(parseElement());\n }\n return result;\n }\n\n tsParseDelimitedList(\n kind: ParsingContext,\n parseElement: () => T,\n ): T[] {\n return nonNull(\n this.tsParseDelimitedListWorker(\n kind,\n parseElement,\n /* expectSuccess */ true,\n ),\n );\n }\n\n /**\n * If !expectSuccess, returns undefined instead of failing to parse.\n * If expectSuccess, parseElement should always return a defined value.\n */\n tsParseDelimitedListWorker(\n kind: ParsingContext,\n parseElement: () => ?T,\n expectSuccess: boolean,\n ): ?(T[]) {\n const result = [];\n\n for (;;) {\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n\n const element = parseElement();\n if (element == null) {\n return undefined;\n }\n result.push(element);\n\n if (this.eat(tt.comma)) {\n continue;\n }\n\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n\n if (expectSuccess) {\n // This will fail with an error about a missing comma\n this.expect(tt.comma);\n }\n return undefined;\n }\n\n return result;\n }\n\n tsParseBracketedList(\n kind: ParsingContext,\n parseElement: () => T,\n bracket: boolean,\n skipFirstToken: boolean,\n ): T[] {\n if (!skipFirstToken) {\n if (bracket) {\n this.expect(tt.bracketL);\n } else {\n this.expectRelational(\"<\");\n }\n }\n\n const result = this.tsParseDelimitedList(kind, parseElement);\n\n if (bracket) {\n this.expect(tt.bracketR);\n } else {\n this.expectRelational(\">\");\n }\n\n return result;\n }\n\n tsParseImportType(): N.TsImportType {\n const node: N.TsImportType = this.startNode();\n this.expect(tt._import);\n this.expect(tt.parenL);\n if (!this.match(tt.string)) {\n this.raise(this.state.start, TSErrors.UnsupportedImportTypeArgument);\n }\n\n // For compatibility to estree we cannot call parseLiteral directly here\n node.argument = this.parseExprAtom();\n this.expect(tt.parenR);\n\n if (this.eat(tt.dot)) {\n node.qualifier = this.tsParseEntityName(/* allowReservedWords */ true);\n }\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSImportType\");\n }\n\n tsParseEntityName(allowReservedWords: boolean): N.TsEntityName {\n let entity: N.TsEntityName = this.parseIdentifier();\n while (this.eat(tt.dot)) {\n const node: N.TsQualifiedName = this.startNodeAtNode(entity);\n node.left = entity;\n node.right = this.parseIdentifier(allowReservedWords);\n entity = this.finishNode(node, \"TSQualifiedName\");\n }\n return entity;\n }\n\n tsParseTypeReference(): N.TsTypeReference {\n const node: N.TsTypeReference = this.startNode();\n node.typeName = this.tsParseEntityName(/* allowReservedWords */ false);\n if (!this.hasPrecedingLineBreak() && this.isRelational(\"<\")) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSTypeReference\");\n }\n\n tsParseThisTypePredicate(lhs: N.TsThisType): N.TsTypePredicate {\n this.next();\n const node: N.TsTypePredicate = this.startNodeAtNode(lhs);\n node.parameterName = lhs;\n node.typeAnnotation = this.tsParseTypeAnnotation(/* eatColon */ false);\n node.asserts = false;\n return this.finishNode(node, \"TSTypePredicate\");\n }\n\n tsParseThisTypeNode(): N.TsThisType {\n const node: N.TsThisType = this.startNode();\n this.next();\n return this.finishNode(node, \"TSThisType\");\n }\n\n tsParseTypeQuery(): N.TsTypeQuery {\n const node: N.TsTypeQuery = this.startNode();\n this.expect(tt._typeof);\n if (this.match(tt._import)) {\n node.exprName = this.tsParseImportType();\n } else {\n node.exprName = this.tsParseEntityName(/* allowReservedWords */ true);\n }\n return this.finishNode(node, \"TSTypeQuery\");\n }\n\n tsParseTypeParameter(): N.TsTypeParameter {\n const node: N.TsTypeParameter = this.startNode();\n node.name = this.parseIdentifierName(node.start);\n node.constraint = this.tsEatThenParseType(tt._extends);\n node.default = this.tsEatThenParseType(tt.eq);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n\n tsTryParseTypeParameters(): ?N.TsTypeParameterDeclaration {\n if (this.isRelational(\"<\")) {\n return this.tsParseTypeParameters();\n }\n }\n\n tsParseTypeParameters() {\n const node: N.TsTypeParameterDeclaration = this.startNode();\n\n if (this.isRelational(\"<\") || this.match(tt.jsxTagStart)) {\n this.next();\n } else {\n this.unexpected();\n }\n\n node.params = this.tsParseBracketedList(\n \"TypeParametersOrArguments\",\n this.tsParseTypeParameter.bind(this),\n /* bracket */ false,\n /* skipFirstToken */ true,\n );\n if (node.params.length === 0) {\n this.raise(node.start, TSErrors.EmptyTypeParameters);\n }\n return this.finishNode(node, \"TSTypeParameterDeclaration\");\n }\n\n tsTryNextParseConstantContext(): ?N.TsTypeReference {\n if (this.lookahead().type === tt._const) {\n this.next();\n return this.tsParseTypeReference();\n }\n return null;\n }\n\n // Note: In TypeScript implementation we must provide `yieldContext` and `awaitContext`,\n // but here it's always false, because this is only used for types.\n tsFillSignature(\n returnToken: TokenType,\n signature: N.TsSignatureDeclaration,\n ): void {\n // Arrow fns *must* have return token (`=>`). Normal functions can omit it.\n const returnTokenRequired = returnToken === tt.arrow;\n signature.typeParameters = this.tsTryParseTypeParameters();\n this.expect(tt.parenL);\n signature.parameters = this.tsParseBindingListForSignature();\n if (returnTokenRequired) {\n signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(\n returnToken,\n );\n } else if (this.match(returnToken)) {\n signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(\n returnToken,\n );\n }\n }\n\n tsParseBindingListForSignature(): $ReadOnlyArray<\n N.Identifier | N.RestElement | N.ObjectPattern | N.ArrayPattern,\n > {\n return this.parseBindingList(tt.parenR, charCodes.rightParenthesis).map(\n pattern => {\n if (\n pattern.type !== \"Identifier\" &&\n pattern.type !== \"RestElement\" &&\n pattern.type !== \"ObjectPattern\" &&\n pattern.type !== \"ArrayPattern\"\n ) {\n this.raise(\n pattern.start,\n TSErrors.UnsupportedSignatureParameterKind,\n pattern.type,\n );\n }\n return (pattern: any);\n },\n );\n }\n\n tsParseTypeMemberSemicolon(): void {\n if (!this.eat(tt.comma)) {\n this.semicolon();\n }\n }\n\n tsParseSignatureMember(\n kind: \"TSCallSignatureDeclaration\" | \"TSConstructSignatureDeclaration\",\n node: N.TsCallSignatureDeclaration | N.TsConstructSignatureDeclaration,\n ): N.TsCallSignatureDeclaration | N.TsConstructSignatureDeclaration {\n this.tsFillSignature(tt.colon, node);\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, kind);\n }\n\n tsIsUnambiguouslyIndexSignature() {\n this.next(); // Skip '{'\n return this.eat(tt.name) && this.match(tt.colon);\n }\n\n tsTryParseIndexSignature(node: N.Node): ?N.TsIndexSignature {\n if (\n !(\n this.match(tt.bracketL) &&\n this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))\n )\n ) {\n return undefined;\n }\n\n this.expect(tt.bracketL);\n const id = this.parseIdentifier();\n id.typeAnnotation = this.tsParseTypeAnnotation();\n this.resetEndLocation(id); // set end position to end of type\n\n this.expect(tt.bracketR);\n node.parameters = [id];\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, \"TSIndexSignature\");\n }\n\n tsParsePropertyOrMethodSignature(\n node: N.TsPropertySignature | N.TsMethodSignature,\n readonly: boolean,\n ): N.TsPropertySignature | N.TsMethodSignature {\n if (this.eat(tt.question)) node.optional = true;\n const nodeAny: any = node;\n\n if (this.match(tt.parenL) || this.isRelational(\"<\")) {\n if (readonly) {\n this.raise(node.start, TSErrors.ReadonlyForMethodSignature);\n }\n const method: N.TsMethodSignature = nodeAny;\n this.tsFillSignature(tt.colon, method);\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(method, \"TSMethodSignature\");\n } else {\n const property: N.TsPropertySignature = nodeAny;\n if (readonly) property.readonly = true;\n const type = this.tsTryParseTypeAnnotation();\n if (type) property.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(property, \"TSPropertySignature\");\n }\n }\n\n tsParseTypeMember(): N.TsTypeElement {\n const node: any = this.startNode();\n\n if (this.match(tt.parenL) || this.isRelational(\"<\")) {\n return this.tsParseSignatureMember(\"TSCallSignatureDeclaration\", node);\n }\n\n if (this.match(tt._new)) {\n const id: N.Identifier = this.startNode();\n this.next();\n if (this.match(tt.parenL) || this.isRelational(\"<\")) {\n return this.tsParseSignatureMember(\n \"TSConstructSignatureDeclaration\",\n node,\n );\n } else {\n node.key = this.createIdentifier(id, \"new\");\n return this.tsParsePropertyOrMethodSignature(node, false);\n }\n }\n\n this.tsParseModifiers(\n node,\n [\"readonly\"],\n [\"declare\", \"abstract\", \"private\", \"protected\", \"public\", \"static\"],\n TSErrors.InvalidModifierOnTypeMember,\n );\n\n const idx = this.tsTryParseIndexSignature(node);\n if (idx) {\n return idx;\n }\n\n this.parsePropertyName(node, /* isPrivateNameAllowed */ false);\n return this.tsParsePropertyOrMethodSignature(node, !!node.readonly);\n }\n\n tsParseTypeLiteral(): N.TsTypeLiteral {\n const node: N.TsTypeLiteral = this.startNode();\n node.members = this.tsParseObjectTypeMembers();\n return this.finishNode(node, \"TSTypeLiteral\");\n }\n\n tsParseObjectTypeMembers(): $ReadOnlyArray {\n this.expect(tt.braceL);\n const members = this.tsParseList(\n \"TypeMembers\",\n this.tsParseTypeMember.bind(this),\n );\n this.expect(tt.braceR);\n return members;\n }\n\n tsIsStartOfMappedType(): boolean {\n this.next();\n if (this.eat(tt.plusMin)) {\n return this.isContextual(\"readonly\");\n }\n if (this.isContextual(\"readonly\")) {\n this.next();\n }\n if (!this.match(tt.bracketL)) {\n return false;\n }\n this.next();\n if (!this.tsIsIdentifier()) {\n return false;\n }\n this.next();\n return this.match(tt._in);\n }\n\n tsParseMappedTypeParameter(): N.TsTypeParameter {\n const node: N.TsTypeParameter = this.startNode();\n node.name = this.parseIdentifierName(node.start);\n node.constraint = this.tsExpectThenParseType(tt._in);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n\n tsParseMappedType(): N.TsMappedType {\n const node: N.TsMappedType = this.startNode();\n\n this.expect(tt.braceL);\n\n if (this.match(tt.plusMin)) {\n node.readonly = this.state.value;\n this.next();\n this.expectContextual(\"readonly\");\n } else if (this.eatContextual(\"readonly\")) {\n node.readonly = true;\n }\n\n this.expect(tt.bracketL);\n node.typeParameter = this.tsParseMappedTypeParameter();\n node.nameType = this.eatContextual(\"as\") ? this.tsParseType() : null;\n\n this.expect(tt.bracketR);\n\n if (this.match(tt.plusMin)) {\n node.optional = this.state.value;\n this.next();\n this.expect(tt.question);\n } else if (this.eat(tt.question)) {\n node.optional = true;\n }\n\n node.typeAnnotation = this.tsTryParseType();\n this.semicolon();\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"TSMappedType\");\n }\n\n tsParseTupleType(): N.TsTupleType {\n const node: N.TsTupleType = this.startNode();\n node.elementTypes = this.tsParseBracketedList(\n \"TupleElementTypes\",\n this.tsParseTupleElementType.bind(this),\n /* bracket */ true,\n /* skipFirstToken */ false,\n );\n\n // Validate the elementTypes to ensure that no mandatory elements\n // follow optional elements\n let seenOptionalElement = false;\n let labeledElements = null;\n node.elementTypes.forEach(elementNode => {\n let { type } = elementNode;\n\n if (\n seenOptionalElement &&\n type !== \"TSRestType\" &&\n type !== \"TSOptionalType\" &&\n !(type === \"TSNamedTupleMember\" && elementNode.optional)\n ) {\n this.raise(elementNode.start, TSErrors.OptionalTypeBeforeRequired);\n }\n\n // Flow doesn't support ||=\n seenOptionalElement =\n seenOptionalElement ||\n (type === \"TSNamedTupleMember\" && elementNode.optional) ||\n type === \"TSOptionalType\";\n\n // When checking labels, check the argument of the spread operator\n if (type === \"TSRestType\") {\n elementNode = elementNode.typeAnnotation;\n type = elementNode.type;\n }\n\n const isLabeled = type === \"TSNamedTupleMember\";\n // Flow doesn't support ??=\n labeledElements = labeledElements ?? isLabeled;\n if (labeledElements !== isLabeled) {\n this.raise(\n elementNode.start,\n TSErrors.MixedLabeledAndUnlabeledElements,\n );\n }\n });\n\n return this.finishNode(node, \"TSTupleType\");\n }\n\n tsParseTupleElementType(): N.TsType | N.TsNamedTupleMember {\n // parses `...TsType[]`\n\n const { start: startPos, startLoc } = this.state;\n\n const rest = this.eat(tt.ellipsis);\n let type = this.tsParseType();\n const optional = this.eat(tt.question);\n const labeled = this.eat(tt.colon);\n\n if (labeled) {\n const labeledNode: N.TsNamedTupleMember = this.startNodeAtNode(type);\n labeledNode.optional = optional;\n\n if (\n type.type === \"TSTypeReference\" &&\n !type.typeParameters &&\n type.typeName.type === \"Identifier\"\n ) {\n labeledNode.label = (type.typeName: N.Identifier);\n } else {\n this.raise(type.start, TSErrors.InvalidTupleMemberLabel);\n // This produces an invalid AST, but at least we don't drop\n // nodes representing the invalid source.\n // $FlowIgnore\n labeledNode.label = type;\n }\n\n labeledNode.elementType = this.tsParseType();\n type = this.finishNode(labeledNode, \"TSNamedTupleMember\");\n } else if (optional) {\n const optionalTypeNode: N.TsOptionalType = this.startNodeAtNode(type);\n optionalTypeNode.typeAnnotation = type;\n type = this.finishNode(optionalTypeNode, \"TSOptionalType\");\n }\n\n if (rest) {\n const restNode: N.TsRestType = this.startNodeAt(startPos, startLoc);\n restNode.typeAnnotation = type;\n type = this.finishNode(restNode, \"TSRestType\");\n }\n\n return type;\n }\n\n tsParseParenthesizedType(): N.TsParenthesizedType {\n const node = this.startNode();\n this.expect(tt.parenL);\n node.typeAnnotation = this.tsParseType();\n this.expect(tt.parenR);\n return this.finishNode(node, \"TSParenthesizedType\");\n }\n\n tsParseFunctionOrConstructorType(\n type: \"TSFunctionType\" | \"TSConstructorType\",\n abstract?: boolean,\n ): N.TsFunctionOrConstructorType {\n const node: N.TsFunctionOrConstructorType = this.startNode();\n if (type === \"TSConstructorType\") {\n // $FlowIgnore\n node.abstract = !!abstract;\n if (abstract) this.next();\n this.next(); // eat `new`\n }\n this.tsFillSignature(tt.arrow, node);\n return this.finishNode(node, type);\n }\n\n tsParseLiteralTypeNode(): N.TsLiteralType {\n const node: N.TsLiteralType = this.startNode();\n node.literal = (() => {\n switch (this.state.type) {\n case tt.num:\n case tt.bigint:\n case tt.string:\n case tt._true:\n case tt._false:\n // For compatibility to estree we cannot call parseLiteral directly here\n return this.parseExprAtom();\n default:\n throw this.unexpected();\n }\n })();\n return this.finishNode(node, \"TSLiteralType\");\n }\n\n tsParseTemplateLiteralType(): N.TsType {\n const node: N.TsLiteralType = this.startNode();\n node.literal = this.parseTemplate(false);\n return this.finishNode(node, \"TSLiteralType\");\n }\n\n parseTemplateSubstitution(): N.TsType {\n if (this.state.inType) return this.tsParseType();\n return super.parseTemplateSubstitution();\n }\n\n tsParseThisTypeOrThisTypePredicate(): N.TsThisType | N.TsTypePredicate {\n const thisKeyword = this.tsParseThisTypeNode();\n if (this.isContextual(\"is\") && !this.hasPrecedingLineBreak()) {\n return this.tsParseThisTypePredicate(thisKeyword);\n } else {\n return thisKeyword;\n }\n }\n\n tsParseNonArrayType(): N.TsType {\n switch (this.state.type) {\n case tt.name:\n case tt._void:\n case tt._null: {\n const type = this.match(tt._void)\n ? \"TSVoidKeyword\"\n : this.match(tt._null)\n ? \"TSNullKeyword\"\n : keywordTypeFromName(this.state.value);\n if (\n type !== undefined &&\n this.lookaheadCharCode() !== charCodes.dot\n ) {\n const node: N.TsKeywordType = this.startNode();\n this.next();\n return this.finishNode(node, type);\n }\n return this.tsParseTypeReference();\n }\n case tt.string:\n case tt.num:\n case tt.bigint:\n case tt._true:\n case tt._false:\n return this.tsParseLiteralTypeNode();\n case tt.plusMin:\n if (this.state.value === \"-\") {\n const node: N.TsLiteralType = this.startNode();\n const nextToken = this.lookahead();\n if (nextToken.type !== tt.num && nextToken.type !== tt.bigint) {\n throw this.unexpected();\n }\n node.literal = this.parseMaybeUnary();\n return this.finishNode(node, \"TSLiteralType\");\n }\n break;\n case tt._this:\n return this.tsParseThisTypeOrThisTypePredicate();\n case tt._typeof:\n return this.tsParseTypeQuery();\n case tt._import:\n return this.tsParseImportType();\n case tt.braceL:\n return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))\n ? this.tsParseMappedType()\n : this.tsParseTypeLiteral();\n case tt.bracketL:\n return this.tsParseTupleType();\n case tt.parenL:\n if (process.env.BABEL_8_BREAKING) {\n if (!this.options.createParenthesizedExpressions) {\n const startPos = this.state.start;\n this.next();\n const type = this.tsParseType();\n this.expect(tt.parenR);\n this.addExtra(type, \"parenthesized\", true);\n this.addExtra(type, \"parenStart\", startPos);\n return type;\n }\n }\n\n return this.tsParseParenthesizedType();\n case tt.backQuote:\n return this.tsParseTemplateLiteralType();\n }\n\n throw this.unexpected();\n }\n\n tsParseArrayTypeOrHigher(): N.TsType {\n let type = this.tsParseNonArrayType();\n while (!this.hasPrecedingLineBreak() && this.eat(tt.bracketL)) {\n if (this.match(tt.bracketR)) {\n const node: N.TsArrayType = this.startNodeAtNode(type);\n node.elementType = type;\n this.expect(tt.bracketR);\n type = this.finishNode(node, \"TSArrayType\");\n } else {\n const node: N.TsIndexedAccessType = this.startNodeAtNode(type);\n node.objectType = type;\n node.indexType = this.tsParseType();\n this.expect(tt.bracketR);\n type = this.finishNode(node, \"TSIndexedAccessType\");\n }\n }\n return type;\n }\n\n tsParseTypeOperator(\n operator: \"keyof\" | \"unique\" | \"readonly\",\n ): N.TsTypeOperator {\n const node: N.TsTypeOperator = this.startNode();\n this.expectContextual(operator);\n node.operator = operator;\n node.typeAnnotation = this.tsParseTypeOperatorOrHigher();\n\n if (operator === \"readonly\") {\n this.tsCheckTypeAnnotationForReadOnly(node);\n }\n\n return this.finishNode(node, \"TSTypeOperator\");\n }\n\n tsCheckTypeAnnotationForReadOnly(node: N.Node) {\n switch (node.typeAnnotation.type) {\n case \"TSTupleType\":\n case \"TSArrayType\":\n return;\n default:\n this.raise(node.start, TSErrors.UnexpectedReadonly);\n }\n }\n\n tsParseInferType(): N.TsInferType {\n const node = this.startNode();\n this.expectContextual(\"infer\");\n const typeParameter = this.startNode();\n typeParameter.name = this.parseIdentifierName(typeParameter.start);\n node.typeParameter = this.finishNode(typeParameter, \"TSTypeParameter\");\n return this.finishNode(node, \"TSInferType\");\n }\n\n tsParseTypeOperatorOrHigher(): N.TsType {\n const operator = [\"keyof\", \"unique\", \"readonly\"].find(kw =>\n this.isContextual(kw),\n );\n return operator\n ? this.tsParseTypeOperator(operator)\n : this.isContextual(\"infer\")\n ? this.tsParseInferType()\n : this.tsParseArrayTypeOrHigher();\n }\n\n tsParseUnionOrIntersectionType(\n kind: \"TSUnionType\" | \"TSIntersectionType\",\n parseConstituentType: () => N.TsType,\n operator: TokenType,\n ): N.TsType {\n const node: N.TsUnionType | N.TsIntersectionType = this.startNode();\n const hasLeadingOperator = this.eat(operator);\n const types = [];\n do {\n types.push(parseConstituentType());\n } while (this.eat(operator));\n if (types.length === 1 && !hasLeadingOperator) {\n return types[0];\n }\n node.types = types;\n return this.finishNode(node, kind);\n }\n\n tsParseIntersectionTypeOrHigher(): N.TsType {\n return this.tsParseUnionOrIntersectionType(\n \"TSIntersectionType\",\n this.tsParseTypeOperatorOrHigher.bind(this),\n tt.bitwiseAND,\n );\n }\n\n tsParseUnionTypeOrHigher() {\n return this.tsParseUnionOrIntersectionType(\n \"TSUnionType\",\n this.tsParseIntersectionTypeOrHigher.bind(this),\n tt.bitwiseOR,\n );\n }\n\n tsIsStartOfFunctionType() {\n if (this.isRelational(\"<\")) {\n return true;\n }\n return (\n this.match(tt.parenL) &&\n this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))\n );\n }\n\n tsSkipParameterStart(): boolean {\n if (this.match(tt.name) || this.match(tt._this)) {\n this.next();\n return true;\n }\n\n if (this.match(tt.braceL)) {\n let braceStackCounter = 1;\n this.next();\n\n while (braceStackCounter > 0) {\n if (this.match(tt.braceL)) {\n ++braceStackCounter;\n } else if (this.match(tt.braceR)) {\n --braceStackCounter;\n }\n this.next();\n }\n return true;\n }\n\n if (this.match(tt.bracketL)) {\n let braceStackCounter = 1;\n this.next();\n\n while (braceStackCounter > 0) {\n if (this.match(tt.bracketL)) {\n ++braceStackCounter;\n } else if (this.match(tt.bracketR)) {\n --braceStackCounter;\n }\n this.next();\n }\n return true;\n }\n\n return false;\n }\n\n tsIsUnambiguouslyStartOfFunctionType(): boolean {\n this.next();\n if (this.match(tt.parenR) || this.match(tt.ellipsis)) {\n // ( )\n // ( ...\n return true;\n }\n if (this.tsSkipParameterStart()) {\n if (\n this.match(tt.colon) ||\n this.match(tt.comma) ||\n this.match(tt.question) ||\n this.match(tt.eq)\n ) {\n // ( xxx :\n // ( xxx ,\n // ( xxx ?\n // ( xxx =\n return true;\n }\n if (this.match(tt.parenR)) {\n this.next();\n if (this.match(tt.arrow)) {\n // ( xxx ) =>\n return true;\n }\n }\n }\n return false;\n }\n\n tsParseTypeOrTypePredicateAnnotation(\n returnToken: TokenType,\n ): N.TsTypeAnnotation {\n return this.tsInType(() => {\n const t: N.TsTypeAnnotation = this.startNode();\n this.expect(returnToken);\n\n const node = this.startNode();\n\n const asserts = !!this.tsTryParse(\n this.tsParseTypePredicateAsserts.bind(this),\n );\n\n if (asserts && this.match(tt._this)) {\n // When asserts is false, thisKeyword is handled by tsParseNonArrayType\n // : asserts this is type\n let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();\n // if it turns out to be a `TSThisType`, wrap it with `TSTypePredicate`\n // : asserts this\n if (thisTypePredicate.type === \"TSThisType\") {\n node.parameterName = (thisTypePredicate: N.TsThisType);\n node.asserts = true;\n thisTypePredicate = this.finishNode(node, \"TSTypePredicate\");\n } else {\n this.resetStartLocationFromNode(thisTypePredicate, node);\n (thisTypePredicate: N.TsTypePredicate).asserts = true;\n }\n t.typeAnnotation = thisTypePredicate;\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n const typePredicateVariable =\n this.tsIsIdentifier() &&\n this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));\n\n if (!typePredicateVariable) {\n if (!asserts) {\n // : type\n return this.tsParseTypeAnnotation(/* eatColon */ false, t);\n }\n\n // : asserts foo\n node.parameterName = this.parseIdentifier();\n node.asserts = asserts;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n // : asserts foo is type\n const type = this.tsParseTypeAnnotation(/* eatColon */ false);\n node.parameterName = typePredicateVariable;\n node.typeAnnotation = type;\n node.asserts = asserts;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n });\n }\n\n tsTryParseTypeOrTypePredicateAnnotation(): ?N.TsTypeAnnotation {\n return this.match(tt.colon)\n ? this.tsParseTypeOrTypePredicateAnnotation(tt.colon)\n : undefined;\n }\n\n tsTryParseTypeAnnotation(): ?N.TsTypeAnnotation {\n return this.match(tt.colon) ? this.tsParseTypeAnnotation() : undefined;\n }\n\n tsTryParseType(): ?N.TsType {\n return this.tsEatThenParseType(tt.colon);\n }\n\n tsParseTypePredicatePrefix(): ?N.Identifier {\n const id = this.parseIdentifier();\n if (this.isContextual(\"is\") && !this.hasPrecedingLineBreak()) {\n this.next();\n return id;\n }\n }\n\n tsParseTypePredicateAsserts(): boolean {\n if (\n !this.match(tt.name) ||\n this.state.value !== \"asserts\" ||\n this.hasPrecedingLineBreak()\n ) {\n return false;\n }\n const containsEsc = this.state.containsEsc;\n this.next();\n if (!this.match(tt.name) && !this.match(tt._this)) {\n return false;\n }\n\n if (containsEsc) {\n this.raise(\n this.state.lastTokStart,\n Errors.InvalidEscapedReservedWord,\n \"asserts\",\n );\n }\n\n return true;\n }\n\n tsParseTypeAnnotation(\n eatColon = true,\n t: N.TsTypeAnnotation = this.startNode(),\n ): N.TsTypeAnnotation {\n this.tsInType(() => {\n if (eatColon) this.expect(tt.colon);\n t.typeAnnotation = this.tsParseType();\n });\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n /** Be sure to be in a type context before calling this, using `tsInType`. */\n tsParseType(): N.TsType {\n // Need to set `state.inType` so that we don't parse JSX in a type context.\n assert(this.state.inType);\n const type = this.tsParseNonConditionalType();\n if (this.hasPrecedingLineBreak() || !this.eat(tt._extends)) {\n return type;\n }\n const node: N.TsConditionalType = this.startNodeAtNode(type);\n node.checkType = type;\n node.extendsType = this.tsParseNonConditionalType();\n this.expect(tt.question);\n node.trueType = this.tsParseType();\n this.expect(tt.colon);\n node.falseType = this.tsParseType();\n return this.finishNode(node, \"TSConditionalType\");\n }\n\n isAbstractConstructorSignature(): boolean {\n return this.isContextual(\"abstract\") && this.lookahead().type === tt._new;\n }\n\n tsParseNonConditionalType(): N.TsType {\n if (this.tsIsStartOfFunctionType()) {\n return this.tsParseFunctionOrConstructorType(\"TSFunctionType\");\n }\n if (this.match(tt._new)) {\n // As in `new () => Date`\n return this.tsParseFunctionOrConstructorType(\"TSConstructorType\");\n } else if (this.isAbstractConstructorSignature()) {\n // As in `abstract new () => Date`\n return this.tsParseFunctionOrConstructorType(\n \"TSConstructorType\",\n /* abstract */ true,\n );\n }\n return this.tsParseUnionTypeOrHigher();\n }\n\n tsParseTypeAssertion(): N.TsTypeAssertion {\n const node: N.TsTypeAssertion = this.startNode();\n const _const = this.tsTryNextParseConstantContext();\n node.typeAnnotation = _const || this.tsNextThenParseType();\n this.expectRelational(\">\");\n node.expression = this.parseMaybeUnary();\n return this.finishNode(node, \"TSTypeAssertion\");\n }\n\n tsParseHeritageClause(\n descriptor: string,\n ): $ReadOnlyArray {\n const originalStart = this.state.start;\n\n const delimitedList = this.tsParseDelimitedList(\n \"HeritageClauseElement\",\n this.tsParseExpressionWithTypeArguments.bind(this),\n );\n\n if (!delimitedList.length) {\n this.raise(originalStart, TSErrors.EmptyHeritageClauseType, descriptor);\n }\n\n return delimitedList;\n }\n\n tsParseExpressionWithTypeArguments(): N.TsExpressionWithTypeArguments {\n const node: N.TsExpressionWithTypeArguments = this.startNode();\n // Note: TS uses parseLeftHandSideExpressionOrHigher,\n // then has grammar errors later if it's not an EntityName.\n node.expression = this.tsParseEntityName(/* allowReservedWords */ false);\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n\n return this.finishNode(node, \"TSExpressionWithTypeArguments\");\n }\n\n tsParseInterfaceDeclaration(\n node: N.TsInterfaceDeclaration,\n ): N.TsInterfaceDeclaration {\n node.id = this.parseIdentifier();\n this.checkLVal(\n node.id,\n \"typescript interface declaration\",\n BIND_TS_INTERFACE,\n );\n node.typeParameters = this.tsTryParseTypeParameters();\n if (this.eat(tt._extends)) {\n node.extends = this.tsParseHeritageClause(\"extends\");\n }\n const body: N.TSInterfaceBody = this.startNode();\n body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));\n node.body = this.finishNode(body, \"TSInterfaceBody\");\n return this.finishNode(node, \"TSInterfaceDeclaration\");\n }\n\n tsParseTypeAliasDeclaration(\n node: N.TsTypeAliasDeclaration,\n ): N.TsTypeAliasDeclaration {\n node.id = this.parseIdentifier();\n this.checkLVal(node.id, \"typescript type alias\", BIND_TS_TYPE);\n\n node.typeParameters = this.tsTryParseTypeParameters();\n node.typeAnnotation = this.tsInType(() => {\n this.expect(tt.eq);\n\n if (\n this.isContextual(\"intrinsic\") &&\n this.lookahead().type !== tt.dot\n ) {\n const node: N.TsKeywordType = this.startNode();\n this.next();\n return this.finishNode(node, \"TSIntrinsicKeyword\");\n }\n\n return this.tsParseType();\n });\n\n this.semicolon();\n return this.finishNode(node, \"TSTypeAliasDeclaration\");\n }\n\n tsInNoContext(cb: () => T): T {\n const oldContext = this.state.context;\n this.state.context = [oldContext[0]];\n try {\n return cb();\n } finally {\n this.state.context = oldContext;\n }\n }\n\n /**\n * Runs `cb` in a type context.\n * This should be called one token *before* the first type token,\n * so that the call to `next()` is run in type context.\n */\n tsInType(cb: () => T): T {\n const oldInType = this.state.inType;\n this.state.inType = true;\n try {\n return cb();\n } finally {\n this.state.inType = oldInType;\n }\n }\n\n tsEatThenParseType(token: TokenType): N.TsType | typeof undefined {\n return !this.match(token) ? undefined : this.tsNextThenParseType();\n }\n\n tsExpectThenParseType(token: TokenType): N.TsType {\n return this.tsDoThenParseType(() => this.expect(token));\n }\n\n tsNextThenParseType(): N.TsType {\n return this.tsDoThenParseType(() => this.next());\n }\n\n tsDoThenParseType(cb: () => void): N.TsType {\n return this.tsInType(() => {\n cb();\n return this.tsParseType();\n });\n }\n\n tsParseEnumMember(): N.TsEnumMember {\n const node: N.TsEnumMember = this.startNode();\n // Computed property names are grammar errors in an enum, so accept just string literal or identifier.\n node.id = this.match(tt.string)\n ? this.parseExprAtom()\n : this.parseIdentifier(/* liberal */ true);\n if (this.eat(tt.eq)) {\n node.initializer = this.parseMaybeAssignAllowIn();\n }\n return this.finishNode(node, \"TSEnumMember\");\n }\n\n tsParseEnumDeclaration(\n node: N.TsEnumDeclaration,\n isConst: boolean,\n ): N.TsEnumDeclaration {\n if (isConst) node.const = true;\n node.id = this.parseIdentifier();\n this.checkLVal(\n node.id,\n \"typescript enum declaration\",\n isConst ? BIND_TS_CONST_ENUM : BIND_TS_ENUM,\n );\n\n this.expect(tt.braceL);\n node.members = this.tsParseDelimitedList(\n \"EnumMembers\",\n this.tsParseEnumMember.bind(this),\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"TSEnumDeclaration\");\n }\n\n tsParseModuleBlock(): N.TsModuleBlock {\n const node: N.TsModuleBlock = this.startNode();\n this.scope.enter(SCOPE_OTHER);\n\n this.expect(tt.braceL);\n // Inside of a module block is considered \"top-level\", meaning it can have imports and exports.\n this.parseBlockOrModuleBlockBody(\n (node.body = []),\n /* directives */ undefined,\n /* topLevel */ true,\n /* end */ tt.braceR,\n );\n this.scope.exit();\n return this.finishNode(node, \"TSModuleBlock\");\n }\n\n tsParseModuleOrNamespaceDeclaration(\n node: N.TsModuleDeclaration,\n nested?: boolean = false,\n ): N.TsModuleDeclaration {\n node.id = this.parseIdentifier();\n\n if (!nested) {\n this.checkLVal(\n node.id,\n \"module or namespace declaration\",\n BIND_TS_NAMESPACE,\n );\n }\n\n if (this.eat(tt.dot)) {\n const inner = this.startNode();\n this.tsParseModuleOrNamespaceDeclaration(inner, true);\n node.body = inner;\n } else {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n }\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n\n tsParseAmbientExternalModuleDeclaration(\n node: N.TsModuleDeclaration,\n ): N.TsModuleDeclaration {\n if (this.isContextual(\"global\")) {\n node.global = true;\n node.id = this.parseIdentifier();\n } else if (this.match(tt.string)) {\n node.id = this.parseExprAtom();\n } else {\n this.unexpected();\n }\n if (this.match(tt.braceL)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n } else {\n this.semicolon();\n }\n\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n\n tsParseImportEqualsDeclaration(\n node: N.TsImportEqualsDeclaration,\n isExport?: boolean,\n ): N.TsImportEqualsDeclaration {\n node.isExport = isExport || false;\n node.id = this.parseIdentifier();\n this.checkLVal(node.id, \"import equals declaration\", BIND_LEXICAL);\n this.expect(tt.eq);\n node.moduleReference = this.tsParseModuleReference();\n this.semicolon();\n return this.finishNode(node, \"TSImportEqualsDeclaration\");\n }\n\n tsIsExternalModuleReference(): boolean {\n return (\n this.isContextual(\"require\") &&\n this.lookaheadCharCode() === charCodes.leftParenthesis\n );\n }\n\n tsParseModuleReference(): N.TsModuleReference {\n return this.tsIsExternalModuleReference()\n ? this.tsParseExternalModuleReference()\n : this.tsParseEntityName(/* allowReservedWords */ false);\n }\n\n tsParseExternalModuleReference(): N.TsExternalModuleReference {\n const node: N.TsExternalModuleReference = this.startNode();\n this.expectContextual(\"require\");\n this.expect(tt.parenL);\n if (!this.match(tt.string)) {\n throw this.unexpected();\n }\n // For compatibility to estree we cannot call parseLiteral directly here\n node.expression = this.parseExprAtom();\n this.expect(tt.parenR);\n return this.finishNode(node, \"TSExternalModuleReference\");\n }\n\n // Utilities\n\n tsLookAhead(f: () => T): T {\n const state = this.state.clone();\n const res = f();\n this.state = state;\n return res;\n }\n\n tsTryParseAndCatch(f: () => T): ?T {\n const result = this.tryParse(abort => f() || abort());\n\n if (result.aborted || !result.node) return undefined;\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n tsTryParse(f: () => ?T): ?T {\n const state = this.state.clone();\n const result = f();\n if (result !== undefined && result !== false) {\n return result;\n } else {\n this.state = state;\n return undefined;\n }\n }\n\n tsTryParseDeclare(nany: any): ?N.Declaration {\n if (this.isLineTerminator()) {\n return;\n }\n let starttype = this.state.type;\n let kind;\n\n if (this.isContextual(\"let\")) {\n starttype = tt._var;\n kind = \"let\";\n }\n\n return this.tsInDeclareContext(() => {\n switch (starttype) {\n case tt._function:\n nany.declare = true;\n return this.parseFunctionStatement(\n nany,\n /* async */ false,\n /* declarationPosition */ true,\n );\n case tt._class:\n // While this is also set by tsParseExpressionStatement, we need to set it\n // before parsing the class declaration to now how to register it in the scope.\n nany.declare = true;\n return this.parseClass(\n nany,\n /* isStatement */ true,\n /* optionalId */ false,\n );\n case tt._const:\n if (this.match(tt._const) && this.isLookaheadContextual(\"enum\")) {\n // `const enum = 0;` not allowed because \"enum\" is a strict mode reserved word.\n this.expect(tt._const);\n this.expectContextual(\"enum\");\n return this.tsParseEnumDeclaration(nany, /* isConst */ true);\n }\n // falls through\n case tt._var:\n kind = kind || this.state.value;\n return this.parseVarStatement(nany, kind);\n case tt.name: {\n const value = this.state.value;\n if (value === \"global\") {\n return this.tsParseAmbientExternalModuleDeclaration(nany);\n } else {\n return this.tsParseDeclaration(nany, value, /* next */ true);\n }\n }\n }\n });\n }\n\n // Note: this won't be called unless the keyword is allowed in `shouldParseExportDeclaration`.\n tsTryParseExportDeclaration(): ?N.Declaration {\n return this.tsParseDeclaration(\n this.startNode(),\n this.state.value,\n /* next */ true,\n );\n }\n\n tsParseExpressionStatement(node: any, expr: N.Identifier): ?N.Declaration {\n switch (expr.name) {\n case \"declare\": {\n const declaration = this.tsTryParseDeclare(node);\n if (declaration) {\n declaration.declare = true;\n return declaration;\n }\n break;\n }\n case \"global\":\n // `global { }` (with no `declare`) may appear inside an ambient module declaration.\n // Would like to use tsParseAmbientExternalModuleDeclaration here, but already ran past \"global\".\n if (this.match(tt.braceL)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n const mod: N.TsModuleDeclaration = node;\n mod.global = true;\n mod.id = expr;\n mod.body = this.tsParseModuleBlock();\n this.scope.exit();\n this.prodParam.exit();\n return this.finishNode(mod, \"TSModuleDeclaration\");\n }\n break;\n\n default:\n return this.tsParseDeclaration(node, expr.name, /* next */ false);\n }\n }\n\n // Common to tsTryParseDeclare, tsTryParseExportDeclaration, and tsParseExpressionStatement.\n tsParseDeclaration(\n node: any,\n value: string,\n next: boolean,\n ): ?N.Declaration {\n // no declaration apart from enum can be followed by a line break.\n switch (value) {\n case \"abstract\":\n if (\n this.tsCheckLineTerminator(next) &&\n (this.match(tt._class) || this.match(tt.name))\n ) {\n return this.tsParseAbstractDeclaration(node);\n }\n break;\n\n case \"enum\":\n if (next || this.match(tt.name)) {\n if (next) this.next();\n return this.tsParseEnumDeclaration(node, /* isConst */ false);\n }\n break;\n\n case \"interface\":\n if (this.tsCheckLineTerminator(next) && this.match(tt.name)) {\n return this.tsParseInterfaceDeclaration(node);\n }\n break;\n\n case \"module\":\n if (this.tsCheckLineTerminator(next)) {\n if (this.match(tt.string)) {\n return this.tsParseAmbientExternalModuleDeclaration(node);\n } else if (this.match(tt.name)) {\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n }\n break;\n\n case \"namespace\":\n if (this.tsCheckLineTerminator(next) && this.match(tt.name)) {\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n break;\n\n case \"type\":\n if (this.tsCheckLineTerminator(next) && this.match(tt.name)) {\n return this.tsParseTypeAliasDeclaration(node);\n }\n break;\n }\n }\n\n tsCheckLineTerminator(next: boolean) {\n if (next) {\n if (this.hasFollowingLineBreak()) return false;\n this.next();\n return true;\n }\n return !this.isLineTerminator();\n }\n\n tsTryParseGenericAsyncArrowFunction(\n startPos: number,\n startLoc: Position,\n ): ?N.ArrowFunctionExpression {\n if (!this.isRelational(\"<\")) {\n return undefined;\n }\n\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n this.state.maybeInArrowParameters = true;\n\n const res: ?N.ArrowFunctionExpression = this.tsTryParseAndCatch(() => {\n const node: N.ArrowFunctionExpression = this.startNodeAt(\n startPos,\n startLoc,\n );\n node.typeParameters = this.tsParseTypeParameters();\n // Don't use overloaded parseFunctionParams which would look for \"<\" again.\n super.parseFunctionParams(node);\n node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();\n this.expect(tt.arrow);\n return node;\n });\n\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n\n if (!res) {\n return undefined;\n }\n\n return this.parseArrowExpression(\n res,\n /* params are already set */ null,\n /* async */ true,\n );\n }\n\n tsParseTypeArguments(): N.TsTypeParameterInstantiation {\n const node = this.startNode();\n node.params = this.tsInType(() =>\n // Temporarily remove a JSX parsing context, which makes us scan different tokens.\n this.tsInNoContext(() => {\n this.expectRelational(\"<\");\n return this.tsParseDelimitedList(\n \"TypeParametersOrArguments\",\n this.tsParseType.bind(this),\n );\n }),\n );\n if (node.params.length === 0) {\n this.raise(node.start, TSErrors.EmptyTypeArguments);\n }\n // This reads the next token after the `>` too, so do this in the enclosing context.\n // But be sure not to parse a regex in the jsx expression ` />`, so set exprAllowed = false\n this.state.exprAllowed = false;\n this.expectRelational(\">\");\n return this.finishNode(node, \"TSTypeParameterInstantiation\");\n }\n\n tsIsDeclarationStart(): boolean {\n if (this.match(tt.name)) {\n switch (this.state.value) {\n case \"abstract\":\n case \"declare\":\n case \"enum\":\n case \"interface\":\n case \"module\":\n case \"namespace\":\n case \"type\":\n return true;\n }\n }\n\n return false;\n }\n\n // ======================================================\n // OVERRIDES\n // ======================================================\n\n isExportDefaultSpecifier(): boolean {\n if (this.tsIsDeclarationStart()) return false;\n return super.isExportDefaultSpecifier();\n }\n\n parseAssignableListItem(\n allowModifiers: ?boolean,\n decorators: N.Decorator[],\n ): N.Pattern | N.TSParameterProperty {\n // Store original location/position to include modifiers in range\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n\n let accessibility: ?N.Accessibility;\n let readonly = false;\n if (allowModifiers !== undefined) {\n accessibility = this.parseAccessModifier();\n readonly = !!this.tsParseModifier([\"readonly\"]);\n if (allowModifiers === false && (accessibility || readonly)) {\n this.raise(startPos, TSErrors.UnexpectedParameterModifier);\n }\n }\n\n const left = this.parseMaybeDefault();\n this.parseAssignableListItemTypes(left);\n const elt = this.parseMaybeDefault(left.start, left.loc.start, left);\n if (accessibility || readonly) {\n const pp: N.TSParameterProperty = this.startNodeAt(startPos, startLoc);\n if (decorators.length) {\n pp.decorators = decorators;\n }\n if (accessibility) pp.accessibility = accessibility;\n if (readonly) pp.readonly = readonly;\n if (elt.type !== \"Identifier\" && elt.type !== \"AssignmentPattern\") {\n this.raise(pp.start, TSErrors.UnsupportedParameterPropertyKind);\n }\n pp.parameter = ((elt: any): N.Identifier | N.AssignmentPattern);\n return this.finishNode(pp, \"TSParameterProperty\");\n }\n\n if (decorators.length) {\n left.decorators = decorators;\n }\n\n return elt;\n }\n\n parseFunctionBodyAndFinish(\n node: N.BodilessFunctionOrMethodBase,\n type: string,\n isMethod?: boolean = false,\n ): void {\n if (this.match(tt.colon)) {\n node.returnType = this.tsParseTypeOrTypePredicateAnnotation(tt.colon);\n }\n\n const bodilessType =\n type === \"FunctionDeclaration\"\n ? \"TSDeclareFunction\"\n : type === \"ClassMethod\"\n ? \"TSDeclareMethod\"\n : undefined;\n if (bodilessType && !this.match(tt.braceL) && this.isLineTerminator()) {\n this.finishNode(node, bodilessType);\n return;\n }\n if (bodilessType === \"TSDeclareFunction\" && this.state.isDeclareContext) {\n this.raise(node.start, TSErrors.DeclareFunctionHasImplementation);\n if (\n // $FlowIgnore\n node.declare\n ) {\n super.parseFunctionBodyAndFinish(node, bodilessType, isMethod);\n return;\n }\n }\n\n super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n\n registerFunctionStatementId(node: N.Function): void {\n if (!node.body && node.id) {\n // Function ids are validated after parsing their body.\n // For bodyless function, we need to do it here.\n this.checkLVal(node.id, \"function name\", BIND_TS_AMBIENT);\n } else {\n super.registerFunctionStatementId(...arguments);\n }\n }\n\n tsCheckForInvalidTypeCasts(items: $ReadOnlyArray) {\n items.forEach(node => {\n if (node?.type === \"TSTypeCastExpression\") {\n this.raise(\n node.typeAnnotation.start,\n TSErrors.UnexpectedTypeAnnotation,\n );\n }\n });\n }\n\n toReferencedList(\n exprList: $ReadOnlyArray,\n isInParens?: boolean, // eslint-disable-line no-unused-vars\n ): $ReadOnlyArray {\n // Handles invalid scenarios like: `f(a:b)`, `(a:b);`, and `(a:b,c:d)`.\n //\n // Note that `f(a:b)` goes through a different path and is handled\n // in `parseSubscript` directly.\n this.tsCheckForInvalidTypeCasts(exprList);\n return exprList;\n }\n\n parseArrayLike(...args): N.ArrayExpression | N.TupleExpression {\n const node = super.parseArrayLike(...args);\n\n if (node.type === \"ArrayExpression\") {\n this.tsCheckForInvalidTypeCasts(node.elements);\n }\n\n return node;\n }\n\n parseSubscript(\n base: N.Expression,\n startPos: number,\n startLoc: Position,\n noCalls: ?boolean,\n state: N.ParseSubscriptState,\n ): N.Expression {\n if (!this.hasPrecedingLineBreak() && this.match(tt.bang)) {\n this.state.exprAllowed = false;\n this.next();\n\n const nonNullExpression: N.TsNonNullExpression = this.startNodeAt(\n startPos,\n startLoc,\n );\n nonNullExpression.expression = base;\n return this.finishNode(nonNullExpression, \"TSNonNullExpression\");\n }\n\n if (this.isRelational(\"<\")) {\n // tsTryParseAndCatch is expensive, so avoid if not necessary.\n // There are number of things we are going to \"maybe\" parse, like type arguments on\n // tagged template expressions. If any of them fail, walk it back and continue.\n const result = this.tsTryParseAndCatch(() => {\n if (!noCalls && this.atPossibleAsyncArrow(base)) {\n // Almost certainly this is a generic async function `async () => ...\n // But it might be a call with a type argument `async();`\n const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(\n startPos,\n startLoc,\n );\n if (asyncArrowFn) {\n return asyncArrowFn;\n }\n }\n\n const node: N.CallExpression = this.startNodeAt(startPos, startLoc);\n node.callee = base;\n\n const typeArguments = this.tsParseTypeArguments();\n\n if (typeArguments) {\n if (!noCalls && this.eat(tt.parenL)) {\n // possibleAsync always false here, because we would have handled it above.\n // $FlowIgnore (won't be any undefined arguments)\n node.arguments = this.parseCallExpressionArguments(\n tt.parenR,\n /* possibleAsync */ false,\n );\n\n // Handles invalid case: `f(a:b)`\n this.tsCheckForInvalidTypeCasts(node.arguments);\n\n node.typeParameters = typeArguments;\n if (state.optionalChainMember) {\n // $FlowIgnore\n node.optional = false;\n }\n return this.finishCallExpression(node, state.optionalChainMember);\n } else if (this.match(tt.backQuote)) {\n const result = this.parseTaggedTemplateExpression(\n base,\n startPos,\n startLoc,\n state,\n );\n result.typeParameters = typeArguments;\n return result;\n }\n }\n\n this.unexpected();\n });\n\n if (result) return result;\n }\n\n return super.parseSubscript(base, startPos, startLoc, noCalls, state);\n }\n\n parseNewArguments(node: N.NewExpression): void {\n if (this.isRelational(\"<\")) {\n // tsTryParseAndCatch is expensive, so avoid if not necessary.\n // 99% certain this is `new C();`. But may be `new C < T;`, which is also legal.\n const typeParameters = this.tsTryParseAndCatch(() => {\n const args = this.tsParseTypeArguments();\n if (!this.match(tt.parenL)) this.unexpected();\n return args;\n });\n if (typeParameters) {\n node.typeParameters = typeParameters;\n }\n }\n\n super.parseNewArguments(node);\n }\n\n parseExprOp(\n left: N.Expression,\n leftStartPos: number,\n leftStartLoc: Position,\n minPrec: number,\n ) {\n if (\n nonNull(tt._in.binop) > minPrec &&\n !this.hasPrecedingLineBreak() &&\n this.isContextual(\"as\")\n ) {\n const node: N.TsAsExpression = this.startNodeAt(\n leftStartPos,\n leftStartLoc,\n );\n node.expression = left;\n const _const = this.tsTryNextParseConstantContext();\n if (_const) {\n node.typeAnnotation = _const;\n } else {\n node.typeAnnotation = this.tsNextThenParseType();\n }\n this.finishNode(node, \"TSAsExpression\");\n // rescan `<`, `>` because they were scanned when this.state.inType was true\n this.reScan_lt_gt();\n return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec);\n }\n\n return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec);\n }\n\n checkReservedWord(\n word: string, // eslint-disable-line no-unused-vars\n startLoc: number, // eslint-disable-line no-unused-vars\n checkKeywords: boolean, // eslint-disable-line no-unused-vars\n // eslint-disable-next-line no-unused-vars\n isBinding: boolean,\n ): void {\n // Don't bother checking for TypeScript code.\n // Strict mode words may be allowed as in `declare namespace N { const static: number; }`.\n // And we have a type checker anyway, so don't bother having the parser do it.\n }\n\n /*\n Don't bother doing this check in TypeScript code because:\n 1. We may have a nested export statement with the same name:\n export const x = 0;\n export namespace N {\n export const x = 1;\n }\n 2. We have a type checker to warn us about this sort of thing.\n */\n checkDuplicateExports() {}\n\n parseImport(node: N.Node): N.AnyImport {\n if (this.match(tt.name) || this.match(tt.star) || this.match(tt.braceL)) {\n const ahead = this.lookahead();\n\n if (this.match(tt.name) && ahead.type === tt.eq) {\n return this.tsParseImportEqualsDeclaration(node);\n }\n\n if (\n this.isContextual(\"type\") &&\n // import type, { a } from \"b\";\n ahead.type !== tt.comma &&\n // import type from \"a\";\n !(ahead.type === tt.name && ahead.value === \"from\")\n ) {\n node.importKind = \"type\";\n this.next();\n }\n }\n\n if (!node.importKind) {\n node.importKind = \"value\";\n }\n\n const importNode = super.parseImport(node);\n /*:: invariant(importNode.type !== \"TSImportEqualsDeclaration\") */\n\n // `import type` can only be used on imports with named imports or with a\n // default import - but not both\n if (\n importNode.importKind === \"type\" &&\n importNode.specifiers.length > 1 &&\n importNode.specifiers[0].type === \"ImportDefaultSpecifier\"\n ) {\n this.raise(\n importNode.start,\n \"A type-only import can specify a default import or named bindings, but not both.\",\n );\n }\n\n return importNode;\n }\n\n parseExport(node: N.Node): N.AnyExport {\n if (this.match(tt._import)) {\n // `export import A = B;`\n this.expect(tt._import);\n return this.tsParseImportEqualsDeclaration(node, /* isExport */ true);\n } else if (this.eat(tt.eq)) {\n // `export = x;`\n const assign: N.TsExportAssignment = node;\n assign.expression = this.parseExpression();\n this.semicolon();\n return this.finishNode(assign, \"TSExportAssignment\");\n } else if (this.eatContextual(\"as\")) {\n // `export as namespace A;`\n const decl: N.TsNamespaceExportDeclaration = node;\n // See `parseNamespaceExportDeclaration` in TypeScript's own parser\n this.expectContextual(\"namespace\");\n decl.id = this.parseIdentifier();\n this.semicolon();\n return this.finishNode(decl, \"TSNamespaceExportDeclaration\");\n } else {\n if (this.isContextual(\"type\") && this.lookahead().type === tt.braceL) {\n this.next();\n node.exportKind = \"type\";\n } else {\n node.exportKind = \"value\";\n }\n\n return super.parseExport(node);\n }\n }\n\n isAbstractClass(): boolean {\n return (\n this.isContextual(\"abstract\") && this.lookahead().type === tt._class\n );\n }\n\n parseExportDefaultExpression(): N.Expression | N.Declaration {\n if (this.isAbstractClass()) {\n const cls = this.startNode();\n this.next(); // Skip \"abstract\"\n cls.abstract = true;\n this.parseClass(cls, true, true);\n return cls;\n }\n\n // export default interface allowed in:\n // https://github.com/Microsoft/TypeScript/pull/16040\n if (this.state.value === \"interface\") {\n const result = this.tsParseDeclaration(\n this.startNode(),\n this.state.value,\n true,\n );\n\n if (result) return result;\n }\n\n return super.parseExportDefaultExpression();\n }\n\n parseStatementContent(context: ?string, topLevel: ?boolean): N.Statement {\n if (this.state.type === tt._const) {\n const ahead = this.lookahead();\n if (ahead.type === tt.name && ahead.value === \"enum\") {\n const node: N.TsEnumDeclaration = this.startNode();\n this.expect(tt._const);\n this.expectContextual(\"enum\");\n return this.tsParseEnumDeclaration(node, /* isConst */ true);\n }\n }\n return super.parseStatementContent(context, topLevel);\n }\n\n parseAccessModifier(): ?N.Accessibility {\n return this.tsParseModifier([\"public\", \"protected\", \"private\"]);\n }\n\n parseClassMember(\n classBody: N.ClassBody,\n member: any,\n state: N.ParseClassMemberState,\n ): void {\n this.tsParseModifiers(member, [\n \"declare\",\n \"private\",\n \"public\",\n \"protected\",\n ]);\n\n const callParseClassMember = () => {\n super.parseClassMember(classBody, member, state);\n };\n if (member.declare) {\n this.tsInDeclareContext(callParseClassMember);\n } else {\n callParseClassMember();\n }\n }\n\n parseClassMemberWithIsStatic(\n classBody: N.ClassBody,\n member: N.ClassMember | N.TsIndexSignature,\n state: N.ParseClassMemberState,\n isStatic: boolean,\n ): void {\n this.tsParseModifiers(member, [\"abstract\", \"readonly\", \"declare\"]);\n\n const idx = this.tsTryParseIndexSignature(member);\n if (idx) {\n classBody.body.push(idx);\n\n if ((member: any).abstract) {\n this.raise(member.start, TSErrors.IndexSignatureHasAbstract);\n }\n if (isStatic) {\n this.raise(member.start, TSErrors.IndexSignatureHasStatic);\n }\n if ((member: any).accessibility) {\n this.raise(\n member.start,\n TSErrors.IndexSignatureHasAccessibility,\n (member: any).accessibility,\n );\n }\n if ((member: any).declare) {\n this.raise(member.start, TSErrors.IndexSignatureHasDeclare);\n }\n\n return;\n }\n\n if (!this.state.inAbstractClass && (member: any).abstract) {\n this.raise(member.start, TSErrors.NonAbstractClassHasAbstractMethod);\n }\n\n /*:: invariant(member.type !== \"TSIndexSignature\") */\n\n super.parseClassMemberWithIsStatic(classBody, member, state, isStatic);\n }\n\n parsePostMemberNameModifiers(\n methodOrProp: N.ClassMethod | N.ClassProperty | N.ClassPrivateProperty,\n ): void {\n const optional = this.eat(tt.question);\n if (optional) methodOrProp.optional = true;\n\n if ((methodOrProp: any).readonly && this.match(tt.parenL)) {\n this.raise(methodOrProp.start, TSErrors.ClassMethodHasReadonly);\n }\n\n if ((methodOrProp: any).declare && this.match(tt.parenL)) {\n this.raise(methodOrProp.start, TSErrors.ClassMethodHasDeclare);\n }\n }\n\n // Note: The reason we do this in `parseExpressionStatement` and not `parseStatement`\n // is that e.g. `type()` is valid JS, so we must try parsing that first.\n // If it's really a type, we will parse `type` as the statement, and can correct it here\n // by parsing the rest.\n parseExpressionStatement(\n node: N.ExpressionStatement,\n expr: N.Expression,\n ): N.Statement {\n const decl =\n expr.type === \"Identifier\"\n ? this.tsParseExpressionStatement(node, expr)\n : undefined;\n return decl || super.parseExpressionStatement(node, expr);\n }\n\n // export type\n // Should be true for anything parsed by `tsTryParseExportDeclaration`.\n shouldParseExportDeclaration(): boolean {\n if (this.tsIsDeclarationStart()) return true;\n return super.shouldParseExportDeclaration();\n }\n\n // An apparent conditional expression could actually be an optional parameter in an arrow function.\n parseConditional(\n expr: N.Expression,\n startPos: number,\n startLoc: Position,\n refNeedsArrowPos?: ?Pos,\n ): N.Expression {\n // only do the expensive clone if there is a question mark\n // and if we come from inside parens\n if (!refNeedsArrowPos || !this.match(tt.question)) {\n return super.parseConditional(\n expr,\n startPos,\n startLoc,\n refNeedsArrowPos,\n );\n }\n\n const result = this.tryParse(() =>\n super.parseConditional(expr, startPos, startLoc),\n );\n\n if (!result.node) {\n // $FlowIgnore\n refNeedsArrowPos.start = result.error.pos || this.state.start;\n return expr;\n }\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n // Note: These \"type casts\" are *not* valid TS expressions.\n // But we parse them here and change them when completing the arrow function.\n parseParenItem(\n node: N.Expression,\n startPos: number,\n startLoc: Position,\n ): N.Expression {\n node = super.parseParenItem(node, startPos, startLoc);\n if (this.eat(tt.question)) {\n node.optional = true;\n // Include questionmark in location of node\n // Don't use this.finishNode() as otherwise we might process comments twice and\n // include already consumed parens\n this.resetEndLocation(node);\n }\n\n if (this.match(tt.colon)) {\n const typeCastNode: N.TsTypeCastExpression = this.startNodeAt(\n startPos,\n startLoc,\n );\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();\n\n return this.finishNode(typeCastNode, \"TSTypeCastExpression\");\n }\n\n return node;\n }\n\n parseExportDeclaration(node: N.ExportNamedDeclaration): ?N.Declaration {\n // Store original location/position\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n\n // \"export declare\" is equivalent to just \"export\".\n const isDeclare = this.eatContextual(\"declare\");\n\n if (\n isDeclare &&\n (this.isContextual(\"declare\") || !this.shouldParseExportDeclaration())\n ) {\n throw this.raise(\n this.state.start,\n TSErrors.ExpectedAmbientAfterExportDeclare,\n );\n }\n\n let declaration: ?N.Declaration;\n\n if (this.match(tt.name)) {\n declaration = this.tsTryParseExportDeclaration();\n }\n if (!declaration) {\n declaration = super.parseExportDeclaration(node);\n }\n if (\n declaration &&\n (declaration.type === \"TSInterfaceDeclaration\" ||\n declaration.type === \"TSTypeAliasDeclaration\" ||\n isDeclare)\n ) {\n node.exportKind = \"type\";\n }\n\n if (declaration && isDeclare) {\n // Reset location to include `declare` in range\n this.resetStartLocation(declaration, startPos, startLoc);\n\n declaration.declare = true;\n }\n\n return declaration;\n }\n\n parseClassId(\n node: N.Class,\n isStatement: boolean,\n optionalId: ?boolean,\n ): void {\n if ((!isStatement || optionalId) && this.isContextual(\"implements\")) {\n return;\n }\n\n super.parseClassId(\n node,\n isStatement,\n optionalId,\n (node: any).declare ? BIND_TS_AMBIENT : BIND_CLASS,\n );\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) node.typeParameters = typeParameters;\n }\n\n parseClassPropertyAnnotation(\n node: N.ClassProperty | N.ClassPrivateProperty,\n ): void {\n if (!node.optional && this.eat(tt.bang)) {\n node.definite = true;\n }\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n }\n\n parseClassProperty(node: N.ClassProperty): N.ClassProperty {\n this.parseClassPropertyAnnotation(node);\n\n if (this.state.isDeclareContext && this.match(tt.eq)) {\n this.raise(this.state.start, TSErrors.DeclareClassFieldHasInitializer);\n }\n\n return super.parseClassProperty(node);\n }\n\n parseClassPrivateProperty(\n node: N.ClassPrivateProperty,\n ): N.ClassPrivateProperty {\n // $FlowIgnore\n if (node.abstract) {\n this.raise(node.start, TSErrors.PrivateElementHasAbstract);\n }\n\n // $FlowIgnore\n if (node.accessibility) {\n this.raise(\n node.start,\n TSErrors.PrivateElementHasAccessibility,\n node.accessibility,\n );\n }\n\n this.parseClassPropertyAnnotation(node);\n return super.parseClassPrivateProperty(node);\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters && isConstructor) {\n this.raise(typeParameters.start, TSErrors.ConstructorHasTypeParameters);\n }\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassMethod(\n classBody,\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n );\n }\n\n pushClassPrivateMethod(\n classBody: N.ClassBody,\n method: N.ClassPrivateMethod,\n isGenerator: boolean,\n isAsync: boolean,\n ): void {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n\n parseClassSuper(node: N.Class): void {\n super.parseClassSuper(node);\n if (node.superClass && this.isRelational(\"<\")) {\n node.superTypeParameters = this.tsParseTypeArguments();\n }\n if (this.eatContextual(\"implements\")) {\n node.implements = this.tsParseHeritageClause(\"implements\");\n }\n }\n\n parseObjPropValue(prop: N.ObjectMember, ...args): void {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) prop.typeParameters = typeParameters;\n\n super.parseObjPropValue(prop, ...args);\n }\n\n parseFunctionParams(node: N.Function, allowModifiers?: boolean): void {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) node.typeParameters = typeParameters;\n super.parseFunctionParams(node, allowModifiers);\n }\n\n // `let x: number;`\n parseVarId(\n decl: N.VariableDeclarator,\n kind: \"var\" | \"let\" | \"const\",\n ): void {\n super.parseVarId(decl, kind);\n if (decl.id.type === \"Identifier\" && this.eat(tt.bang)) {\n decl.definite = true;\n }\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) {\n decl.id.typeAnnotation = type;\n this.resetEndLocation(decl.id); // set end position to end of type\n }\n }\n\n // parse the return type of an async arrow function - let foo = (async (): number => {});\n parseAsyncArrowFromCallExpression(\n node: N.ArrowFunctionExpression,\n call: N.CallExpression,\n ): N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n node.returnType = this.tsParseTypeAnnotation();\n }\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n parseMaybeAssign(...args): N.Expression {\n // Note: When the JSX plugin is on, type assertions (` x`) aren't valid syntax.\n\n let state: ?State;\n let jsx;\n let typeCast;\n\n if (\n this.hasPlugin(\"jsx\") &&\n (this.match(tt.jsxTagStart) || this.isRelational(\"<\"))\n ) {\n // Prefer to parse JSX if possible. But may be an arrow fn.\n state = this.state.clone();\n\n jsx = this.tryParse(() => super.parseMaybeAssign(...args), state);\n /*:: invariant(!jsx.aborted) */\n\n if (!jsx.error) return jsx.node;\n\n // Remove `tc.j_expr` and `tc.j_oTag` from context added\n // by parsing `jsxTagStart` to stop the JSX plugin from\n // messing with the tokens\n const { context } = this.state;\n if (context[context.length - 1] === ct.j_oTag) {\n context.length -= 2;\n } else if (context[context.length - 1] === ct.j_expr) {\n context.length -= 1;\n }\n }\n\n if (!jsx?.error && !this.isRelational(\"<\")) {\n return super.parseMaybeAssign(...args);\n }\n\n // Either way, we're looking at a '<': tt.jsxTagStart or relational.\n\n let typeParameters: N.TsTypeParameterDeclaration;\n state = state || this.state.clone();\n\n const arrow = this.tryParse(abort => {\n // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`.\n typeParameters = this.tsParseTypeParameters();\n const expr = super.parseMaybeAssign(...args);\n\n if (\n expr.type !== \"ArrowFunctionExpression\" ||\n (expr.extra && expr.extra.parenthesized)\n ) {\n abort();\n }\n\n // Correct TypeScript code should have at least 1 type parameter, but don't crash on bad code.\n if (typeParameters?.params.length !== 0) {\n this.resetStartLocationFromNode(expr, typeParameters);\n }\n expr.typeParameters = typeParameters;\n return expr;\n }, state);\n\n if (!arrow.error && !arrow.aborted) return arrow.node;\n\n if (!jsx) {\n // Try parsing a type cast instead of an arrow function.\n // This will never happen outside of JSX.\n // (Because in JSX the '<' should be a jsxTagStart and not a relational.\n assert(!this.hasPlugin(\"jsx\"));\n\n // This will start with a type assertion (via parseMaybeUnary).\n // But don't directly call `this.tsParseTypeAssertion` because we want to handle any binary after it.\n typeCast = this.tryParse(() => super.parseMaybeAssign(...args), state);\n /*:: invariant(!typeCast.aborted) */\n if (!typeCast.error) return typeCast.node;\n }\n\n if (jsx?.node) {\n /*:: invariant(jsx.failState) */\n this.state = jsx.failState;\n return jsx.node;\n }\n\n if (arrow.node) {\n /*:: invariant(arrow.failState) */\n this.state = arrow.failState;\n return arrow.node;\n }\n\n if (typeCast?.node) {\n /*:: invariant(typeCast.failState) */\n this.state = typeCast.failState;\n return typeCast.node;\n }\n\n if (jsx?.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n if (typeCast?.thrown) throw typeCast.error;\n\n throw jsx?.error || arrow.error || typeCast?.error;\n }\n\n // Handle type assertions\n parseMaybeUnary(refExpressionErrors?: ?ExpressionErrors): N.Expression {\n if (!this.hasPlugin(\"jsx\") && this.isRelational(\"<\")) {\n return this.tsParseTypeAssertion();\n } else {\n return super.parseMaybeUnary(refExpressionErrors);\n }\n }\n\n parseArrow(node: N.ArrowFunctionExpression): ?N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n // This is different from how the TS parser does it.\n // TS uses lookahead. The Babel Parser parses it as a parenthesized expression and converts.\n\n const result = this.tryParse(abort => {\n const returnType = this.tsParseTypeOrTypePredicateAnnotation(\n tt.colon,\n );\n if (this.canInsertSemicolon() || !this.match(tt.arrow)) abort();\n return returnType;\n });\n\n if (result.aborted) return;\n\n if (!result.thrown) {\n if (result.error) this.state = result.failState;\n node.returnType = result.node;\n }\n }\n\n return super.parseArrow(node);\n }\n\n // Allow type annotations inside of a parameter list.\n parseAssignableListItemTypes(param: N.Pattern) {\n if (this.eat(tt.question)) {\n if (\n param.type !== \"Identifier\" &&\n !this.state.isDeclareContext &&\n !this.state.inType\n ) {\n this.raise(param.start, TSErrors.PatternIsOptional);\n }\n\n ((param: any): N.Identifier).optional = true;\n }\n const type = this.tsTryParseTypeAnnotation();\n if (type) param.typeAnnotation = type;\n this.resetEndLocation(param);\n\n return param;\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): N.Node {\n switch (node.type) {\n case \"TSTypeCastExpression\":\n return super.toAssignable(this.typeCastToParameter(node), isLHS);\n case \"TSParameterProperty\":\n return super.toAssignable(node, isLHS);\n case \"TSAsExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n node.expression = this.toAssignable(node.expression, isLHS);\n return node;\n default:\n return super.toAssignable(node, isLHS);\n }\n }\n\n checkLVal(\n expr: N.Expression,\n contextDescription: string,\n ...args:\n | [BindingTypes | void]\n | [BindingTypes | void, ?Set, boolean | void, boolean | void]\n ): void {\n switch (expr.type) {\n case \"TSTypeCastExpression\":\n // Allow \"typecasts\" to appear on the left of assignment expressions,\n // because it may be in an arrow function.\n // e.g. `const f = (foo: number = 0) => foo;`\n return;\n case \"TSParameterProperty\":\n this.checkLVal(expr.parameter, \"parameter property\", ...args);\n return;\n case \"TSAsExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n this.checkLVal(expr.expression, contextDescription, ...args);\n return;\n default:\n super.checkLVal(expr, contextDescription, ...args);\n return;\n }\n }\n\n parseBindingAtom(): N.Pattern {\n switch (this.state.type) {\n case tt._this:\n // \"this\" may be the name of a parameter, so allow it.\n return this.parseIdentifier(/* liberal */ true);\n default:\n return super.parseBindingAtom();\n }\n }\n\n parseMaybeDecoratorArguments(expr: N.Expression): N.Expression {\n if (this.isRelational(\"<\")) {\n const typeArguments = this.tsParseTypeArguments();\n\n if (this.match(tt.parenL)) {\n const call = super.parseMaybeDecoratorArguments(expr);\n call.typeParameters = typeArguments;\n return call;\n }\n\n this.unexpected(this.state.start, tt.parenL);\n }\n\n return super.parseMaybeDecoratorArguments(expr);\n }\n\n // === === === === === === === === === === === === === === === ===\n // Note: All below methods are duplicates of something in flow.js.\n // Not sure what the best way to combine these is.\n // === === === === === === === === === === === === === === === ===\n\n isClassMethod(): boolean {\n return this.isRelational(\"<\") || super.isClassMethod();\n }\n\n isClassProperty(): boolean {\n return (\n this.match(tt.bang) || this.match(tt.colon) || super.isClassProperty()\n );\n }\n\n parseMaybeDefault(...args): N.Pattern {\n const node = super.parseMaybeDefault(...args);\n\n if (\n node.type === \"AssignmentPattern\" &&\n node.typeAnnotation &&\n node.right.start < node.typeAnnotation.start\n ) {\n this.raise(\n node.typeAnnotation.start,\n TSErrors.TypeAnnotationAfterAssign,\n );\n }\n\n return node;\n }\n\n // ensure that inside types, we bypass the jsx parser plugin\n getTokenFromCode(code: number): void {\n if (\n this.state.inType &&\n (code === charCodes.greaterThan || code === charCodes.lessThan)\n ) {\n return this.finishOp(tt.relational, 1);\n } else {\n return super.getTokenFromCode(code);\n }\n }\n\n // used after we have finished parsing types\n reScan_lt_gt() {\n if (this.match(tt.relational)) {\n const code = this.input.charCodeAt(this.state.start);\n if (code === charCodes.lessThan || code === charCodes.greaterThan) {\n this.state.pos -= 1;\n this.readToken_lt_gt(code);\n }\n }\n }\n\n toAssignableList(exprList: N.Expression[]): $ReadOnlyArray {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (!expr) continue;\n switch (expr.type) {\n case \"TSTypeCastExpression\":\n exprList[i] = this.typeCastToParameter(expr);\n break;\n case \"TSAsExpression\":\n case \"TSTypeAssertion\":\n if (!this.state.maybeInArrowParameters) {\n exprList[i] = this.typeCastToParameter(expr);\n } else {\n this.raise(expr.start, TSErrors.UnexpectedTypeCastInParameter);\n }\n break;\n }\n }\n return super.toAssignableList(...arguments);\n }\n\n typeCastToParameter(node: N.TsTypeCastExpression): N.Node {\n node.expression.typeAnnotation = node.typeAnnotation;\n\n this.resetEndLocation(\n node.expression,\n node.typeAnnotation.end,\n node.typeAnnotation.loc.end,\n );\n\n return node.expression;\n }\n\n shouldParseArrow() {\n return this.match(tt.colon) || super.shouldParseArrow();\n }\n\n shouldParseAsyncArrow(): boolean {\n return this.match(tt.colon) || super.shouldParseAsyncArrow();\n }\n\n canHaveLeadingDecorator() {\n // Avoid unnecessary lookahead in checking for abstract class unless needed!\n return super.canHaveLeadingDecorator() || this.isAbstractClass();\n }\n\n jsxParseOpeningElementAfterName(\n node: N.JSXOpeningElement,\n ): N.JSXOpeningElement {\n if (this.isRelational(\"<\")) {\n const typeArguments = this.tsTryParseAndCatch(() =>\n this.tsParseTypeArguments(),\n );\n if (typeArguments) node.typeParameters = typeArguments;\n }\n return super.jsxParseOpeningElementAfterName(node);\n }\n\n getGetterSetterExpectedParamCount(\n method: N.ObjectMethod | N.ClassMethod,\n ): number {\n const baseCount = super.getGetterSetterExpectedParamCount(method);\n const params = this.getObjectOrClassMethodParams(method);\n const firstParam = params[0];\n const hasContextParam =\n firstParam &&\n firstParam.type === \"Identifier\" &&\n firstParam.name === \"this\";\n\n return hasContextParam ? baseCount + 1 : baseCount;\n }\n\n parseCatchClauseParam(): N.Pattern {\n const param = super.parseCatchClauseParam();\n const type = this.tsTryParseTypeAnnotation();\n\n if (type) {\n param.typeAnnotation = type;\n this.resetEndLocation(param);\n }\n\n return param;\n }\n\n tsInDeclareContext(cb: () => T): T {\n const oldIsDeclareContext = this.state.isDeclareContext;\n this.state.isDeclareContext = true;\n try {\n return cb();\n } finally {\n this.state.isDeclareContext = oldIsDeclareContext;\n }\n }\n\n parseClass(node: T, ...args: any[]): T {\n const oldInAbstractClass = this.state.inAbstractClass;\n this.state.inAbstractClass = !!(node: any).abstract;\n try {\n return super.parseClass(node, ...args);\n } finally {\n this.state.inAbstractClass = oldInAbstractClass;\n }\n }\n\n tsParseAbstractDeclaration(\n node: any,\n ): N.ClassDeclaration | N.TsInterfaceDeclaration | typeof undefined {\n if (this.match(tt._class)) {\n node.abstract = true;\n return this.parseClass(\n (node: N.ClassDeclaration),\n /* isStatement */ true,\n /* optionalId */ false,\n );\n } else if (this.isContextual(\"interface\")) {\n // for invalid abstract interface\n\n // To avoid\n // abstract interface\n // Foo {}\n if (!this.hasFollowingLineBreak()) {\n node.abstract = true;\n this.raise(\n node.start,\n TSErrors.NonClassMethodPropertyHasAbstractModifer,\n );\n this.next();\n return this.tsParseInterfaceDeclaration(\n (node: N.TsInterfaceDeclaration),\n );\n }\n } else {\n this.unexpected(null, tt._class);\n }\n }\n };\n","// @flow\n\nimport * as charCodes from \"charcodes\";\n\nimport { types as tt, TokenType } from \"../tokenizer/types\";\nimport type Parser from \"../parser\";\nimport * as N from \"../types\";\n\ntt.placeholder = new TokenType(\"%%\", { startsExpr: true });\n\nexport type PlaceholderTypes =\n | \"Identifier\"\n | \"StringLiteral\"\n | \"Expression\"\n | \"Statement\"\n | \"Declaration\"\n | \"BlockStatement\"\n | \"ClassBody\"\n | \"Pattern\";\n\n// $PropertyType doesn't support enums. Use a fake \"switch\" (GetPlaceholderNode)\n//type MaybePlaceholder = $PropertyType | N.Placeholder;\n\ntype _Switch = $Call<\n (\n $ElementType<$ElementType, 0>,\n ) => $ElementType<$ElementType, 1>,\n Value,\n>;\ntype $Switch = _Switch;\n\ntype NodeOf = $Switch<\n T,\n [\n [\"Identifier\", N.Identifier],\n [\"StringLiteral\", N.StringLiteral],\n [\"Expression\", N.Expression],\n [\"Statement\", N.Statement],\n [\"Declaration\", N.Declaration],\n [\"BlockStatement\", N.BlockStatement],\n [\"ClassBody\", N.ClassBody],\n [\"Pattern\", N.Pattern],\n ],\n>;\n\n// Placeholder breaks everything, because its type is incompatible with\n// the substituted nodes.\ntype MaybePlaceholder = NodeOf; // | Placeholder\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n parsePlaceholder(\n expectedNode: T,\n ): /*?N.Placeholder*/ ?MaybePlaceholder {\n if (this.match(tt.placeholder)) {\n const node = this.startNode();\n this.next();\n this.assertNoSpace(\"Unexpected space in placeholder.\");\n\n // We can't use this.parseIdentifier because\n // we don't want nested placeholders.\n node.name = super.parseIdentifier(/* liberal */ true);\n\n this.assertNoSpace(\"Unexpected space in placeholder.\");\n this.expect(tt.placeholder);\n return this.finishPlaceholder(node, expectedNode);\n }\n }\n\n finishPlaceholder(\n node: N.Node,\n expectedNode: T,\n ): /*N.Placeholder*/ MaybePlaceholder {\n const isFinished = !!(node.expectedNode && node.type === \"Placeholder\");\n node.expectedNode = expectedNode;\n\n return isFinished ? node : this.finishNode(node, \"Placeholder\");\n }\n\n /* ============================================================ *\n * tokenizer/index.js *\n * ============================================================ */\n\n getTokenFromCode(code: number) {\n if (\n code === charCodes.percentSign &&\n this.input.charCodeAt(this.state.pos + 1) === charCodes.percentSign\n ) {\n return this.finishOp(tt.placeholder, 2);\n }\n\n return super.getTokenFromCode(...arguments);\n }\n\n /* ============================================================ *\n * parser/expression.js *\n * ============================================================ */\n\n parseExprAtom(): MaybePlaceholder<\"Expression\"> {\n return (\n this.parsePlaceholder(\"Expression\") || super.parseExprAtom(...arguments)\n );\n }\n\n parseIdentifier(): MaybePlaceholder<\"Identifier\"> {\n // NOTE: This function only handles identifiers outside of\n // expressions and binding patterns, since they are already\n // handled by the parseExprAtom and parseBindingAtom functions.\n // This is needed, for example, to parse \"class %%NAME%% {}\".\n return (\n this.parsePlaceholder(\"Identifier\") ||\n super.parseIdentifier(...arguments)\n );\n }\n\n checkReservedWord(word: string): void {\n // Sometimes we call #checkReservedWord(node.name), expecting\n // that node is an Identifier. If it is a Placeholder, name\n // will be undefined.\n if (word !== undefined) super.checkReservedWord(...arguments);\n }\n\n /* ============================================================ *\n * parser/lval.js *\n * ============================================================ */\n\n parseBindingAtom(): MaybePlaceholder<\"Pattern\"> {\n return (\n this.parsePlaceholder(\"Pattern\") || super.parseBindingAtom(...arguments)\n );\n }\n\n checkLVal(expr: N.Expression): void {\n if (expr.type !== \"Placeholder\") super.checkLVal(...arguments);\n }\n\n toAssignable(node: N.Node): N.Node {\n if (\n node &&\n node.type === \"Placeholder\" &&\n node.expectedNode === \"Expression\"\n ) {\n node.expectedNode = \"Pattern\";\n return node;\n }\n return super.toAssignable(...arguments);\n }\n\n /* ============================================================ *\n * parser/statement.js *\n * ============================================================ */\n\n isLet(context: ?string): boolean {\n if (super.isLet(context)) {\n return true;\n }\n\n // Replicate the original checks that lead to looking ahead for an\n // identifier.\n if (!this.isContextual(\"let\")) {\n return false;\n }\n if (context) return false;\n\n // Accept \"let %%\" as the start of \"let %%placeholder%%\", as though the\n // placeholder were an identifier.\n const nextToken = this.lookahead();\n if (nextToken.type === tt.placeholder) {\n return true;\n }\n\n return false;\n }\n\n verifyBreakContinue(node: N.BreakStatement | N.ContinueStatement) {\n if (node.label && node.label.type === \"Placeholder\") return;\n super.verifyBreakContinue(...arguments);\n }\n\n parseExpressionStatement(\n node: MaybePlaceholder<\"Statement\">,\n expr: N.Expression,\n ): MaybePlaceholder<\"Statement\"> {\n if (\n expr.type !== \"Placeholder\" ||\n (expr.extra && expr.extra.parenthesized)\n ) {\n return super.parseExpressionStatement(...arguments);\n }\n\n if (this.match(tt.colon)) {\n const stmt: N.LabeledStatement = node;\n stmt.label = this.finishPlaceholder(expr, \"Identifier\");\n this.next();\n stmt.body = this.parseStatement(\"label\");\n return this.finishNode(stmt, \"LabeledStatement\");\n }\n\n this.semicolon();\n\n node.name = expr.name;\n return this.finishPlaceholder(node, \"Statement\");\n }\n\n parseBlock(): MaybePlaceholder<\"BlockStatement\"> {\n return (\n this.parsePlaceholder(\"BlockStatement\") ||\n super.parseBlock(...arguments)\n );\n }\n\n parseFunctionId(): ?MaybePlaceholder<\"Identifier\"> {\n return (\n this.parsePlaceholder(\"Identifier\") ||\n super.parseFunctionId(...arguments)\n );\n }\n\n parseClass(\n node: T,\n isStatement: /* T === ClassDeclaration */ boolean,\n optionalId?: boolean,\n ): T {\n const type = isStatement ? \"ClassDeclaration\" : \"ClassExpression\";\n\n this.next();\n this.takeDecorators(node);\n const oldStrict = this.state.strict;\n\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (placeholder) {\n if (\n this.match(tt._extends) ||\n this.match(tt.placeholder) ||\n this.match(tt.braceL)\n ) {\n node.id = placeholder;\n } else if (optionalId || !isStatement) {\n node.id = null;\n node.body = this.finishPlaceholder(placeholder, \"ClassBody\");\n return this.finishNode(node, type);\n } else {\n this.unexpected(null, \"A class name is required\");\n }\n } else {\n this.parseClassId(node, isStatement, optionalId);\n }\n\n this.parseClassSuper(node);\n node.body =\n this.parsePlaceholder(\"ClassBody\") ||\n this.parseClassBody(!!node.superClass, oldStrict);\n return this.finishNode(node, type);\n }\n\n parseExport(node: N.Node): N.Node {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseExport(...arguments);\n\n if (!this.isContextual(\"from\") && !this.match(tt.comma)) {\n // export %%DECL%%;\n node.specifiers = [];\n node.source = null;\n node.declaration = this.finishPlaceholder(placeholder, \"Declaration\");\n return this.finishNode(node, \"ExportNamedDeclaration\");\n }\n\n // export %%NAME%% from \"foo\";\n this.expectPlugin(\"exportDefaultFrom\");\n const specifier = this.startNode();\n specifier.exported = placeholder;\n node.specifiers = [this.finishNode(specifier, \"ExportDefaultSpecifier\")];\n\n return super.parseExport(node);\n }\n\n isExportDefaultSpecifier(): boolean {\n if (this.match(tt._default)) {\n const next = this.nextTokenStart();\n if (this.isUnparsedContextual(next, \"from\")) {\n if (\n this.input.startsWith(\n tt.placeholder.label,\n this.nextTokenStartSince(next + 4),\n )\n ) {\n return true;\n }\n }\n }\n return super.isExportDefaultSpecifier();\n }\n\n maybeParseExportDefaultSpecifier(node: N.Node): boolean {\n if (node.specifiers && node.specifiers.length > 0) {\n // \"export %%NAME%%\" has already been parsed by #parseExport.\n return true;\n }\n return super.maybeParseExportDefaultSpecifier(...arguments);\n }\n\n checkExport(node: N.ExportNamedDeclaration): void {\n const { specifiers } = node;\n if (specifiers?.length) {\n node.specifiers = specifiers.filter(\n node => node.exported.type === \"Placeholder\",\n );\n }\n super.checkExport(node);\n node.specifiers = specifiers;\n }\n\n parseImport(\n node: N.Node,\n ): N.ImportDeclaration | N.TsImportEqualsDeclaration {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseImport(...arguments);\n\n node.specifiers = [];\n\n if (!this.isContextual(\"from\") && !this.match(tt.comma)) {\n // import %%STRING%%;\n node.source = this.finishPlaceholder(placeholder, \"StringLiteral\");\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n // import %%DEFAULT%% ...\n const specifier = this.startNodeAtNode(placeholder);\n specifier.local = placeholder;\n this.finishNode(specifier, \"ImportDefaultSpecifier\");\n node.specifiers.push(specifier);\n\n if (this.eat(tt.comma)) {\n // import %%DEFAULT%%, * as ...\n const hasStarImport = this.maybeParseStarImportSpecifier(node);\n\n // import %%DEFAULT%%, { ...\n if (!hasStarImport) this.parseNamedImportSpecifiers(node);\n }\n\n this.expectContextual(\"from\");\n node.source = this.parseImportSource();\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n parseImportSource(): MaybePlaceholder<\"StringLiteral\"> {\n // import ... from %%STRING%%;\n\n return (\n this.parsePlaceholder(\"StringLiteral\") ||\n super.parseImportSource(...arguments)\n );\n }\n };\n","import type Parser from \"../parser\";\nimport { types as tt } from \"../tokenizer/types\";\nimport * as N from \"../types\";\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n parseV8Intrinsic(): N.Expression {\n if (this.match(tt.modulo)) {\n const v8IntrinsicStart = this.state.start;\n // let the `loc` of Identifier starts from `%`\n const node = this.startNode();\n this.eat(tt.modulo);\n if (this.match(tt.name)) {\n const name = this.parseIdentifierName(this.state.start);\n const identifier = this.createIdentifier(node, name);\n identifier.type = \"V8IntrinsicIdentifier\";\n if (this.match(tt.parenL)) {\n return identifier;\n }\n }\n this.unexpected(v8IntrinsicStart);\n }\n }\n\n /* ============================================================ *\n * parser/expression.js *\n * ============================================================ */\n\n parseExprAtom(): N.Expression {\n return this.parseV8Intrinsic() || super.parseExprAtom(...arguments);\n }\n };\n","// @flow\n\nimport type Parser from \"./parser\";\n\nexport type Plugin = string | [string, Object];\n\nexport type PluginList = $ReadOnlyArray;\n\nexport type MixinPlugin = (superClass: Class) => Class;\n\nexport function hasPlugin(plugins: PluginList, name: string): boolean {\n return plugins.some(plugin => {\n if (Array.isArray(plugin)) {\n return plugin[0] === name;\n } else {\n return plugin === name;\n }\n });\n}\n\nexport function getPluginOption(\n plugins: PluginList,\n name: string,\n option: string,\n) {\n const plugin = plugins.find(plugin => {\n if (Array.isArray(plugin)) {\n return plugin[0] === name;\n } else {\n return plugin === name;\n }\n });\n\n if (plugin && Array.isArray(plugin)) {\n return plugin[1][option];\n }\n\n return null;\n}\n\nconst PIPELINE_PROPOSALS = [\"minimal\", \"smart\", \"fsharp\"];\nconst RECORD_AND_TUPLE_SYNTAX_TYPES = [\"hash\", \"bar\"];\n\nexport function validatePlugins(plugins: PluginList) {\n if (hasPlugin(plugins, \"decorators\")) {\n if (hasPlugin(plugins, \"decorators-legacy\")) {\n throw new Error(\n \"Cannot use the decorators and decorators-legacy plugin together\",\n );\n }\n\n const decoratorsBeforeExport = getPluginOption(\n plugins,\n \"decorators\",\n \"decoratorsBeforeExport\",\n );\n if (decoratorsBeforeExport == null) {\n throw new Error(\n \"The 'decorators' plugin requires a 'decoratorsBeforeExport' option,\" +\n \" whose value must be a boolean. If you are migrating from\" +\n \" Babylon/Babel 6 or want to use the old decorators proposal, you\" +\n \" should use the 'decorators-legacy' plugin instead of 'decorators'.\",\n );\n } else if (typeof decoratorsBeforeExport !== \"boolean\") {\n throw new Error(\"'decoratorsBeforeExport' must be a boolean.\");\n }\n }\n\n if (hasPlugin(plugins, \"flow\") && hasPlugin(plugins, \"typescript\")) {\n throw new Error(\"Cannot combine flow and typescript plugins.\");\n }\n\n if (hasPlugin(plugins, \"placeholders\") && hasPlugin(plugins, \"v8intrinsic\")) {\n throw new Error(\"Cannot combine placeholders and v8intrinsic plugins.\");\n }\n\n if (\n hasPlugin(plugins, \"pipelineOperator\") &&\n !PIPELINE_PROPOSALS.includes(\n getPluginOption(plugins, \"pipelineOperator\", \"proposal\"),\n )\n ) {\n throw new Error(\n \"'pipelineOperator' requires 'proposal' option whose value should be one of: \" +\n PIPELINE_PROPOSALS.map(p => `'${p}'`).join(\", \"),\n );\n }\n\n if (hasPlugin(plugins, \"moduleAttributes\")) {\n if (hasPlugin(plugins, \"importAssertions\")) {\n throw new Error(\n \"Cannot combine importAssertions and moduleAttributes plugins.\",\n );\n }\n const moduleAttributesVerionPluginOption = getPluginOption(\n plugins,\n \"moduleAttributes\",\n \"version\",\n );\n if (moduleAttributesVerionPluginOption !== \"may-2020\") {\n throw new Error(\n \"The 'moduleAttributes' plugin requires a 'version' option,\" +\n \" representing the last proposal update. Currently, the\" +\n \" only supported value is 'may-2020'.\",\n );\n }\n }\n\n if (\n hasPlugin(plugins, \"recordAndTuple\") &&\n !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(\n getPluginOption(plugins, \"recordAndTuple\", \"syntaxType\"),\n )\n ) {\n throw new Error(\n \"'recordAndTuple' requires 'syntaxType' option whose value should be one of: \" +\n RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(\", \"),\n );\n }\n}\n\n// These plugins are defined using a mixin which extends the parser class.\n\nimport estree from \"./plugins/estree\";\nimport flow from \"./plugins/flow\";\nimport jsx from \"./plugins/jsx\";\nimport typescript from \"./plugins/typescript\";\nimport placeholders from \"./plugins/placeholders\";\nimport v8intrinsic from \"./plugins/v8intrinsic\";\n\n// NOTE: order is important. estree must come first; placeholders must come last.\nexport const mixinPlugins: { [name: string]: MixinPlugin } = {\n estree,\n jsx,\n flow,\n typescript,\n v8intrinsic,\n placeholders,\n};\n\nexport const mixinPluginNames: $ReadOnlyArray = Object.keys(\n mixinPlugins,\n);\n","// @flow\n\nimport type { PluginList } from \"./plugin-utils\";\n\n// A second optional argument can be given to further configure\n// the parser process. These options are recognized:\n\nexport type SourceType = \"script\" | \"module\" | \"unambiguous\";\n\nexport type Options = {\n sourceType: SourceType,\n sourceFilename?: string,\n startLine: number,\n allowAwaitOutsideFunction: boolean,\n allowReturnOutsideFunction: boolean,\n allowImportExportEverywhere: boolean,\n allowSuperOutsideMethod: boolean,\n allowUndeclaredExports: boolean,\n plugins: PluginList,\n strictMode: ?boolean,\n ranges: boolean,\n tokens: boolean,\n createParenthesizedExpressions: boolean,\n errorRecovery: boolean,\n};\n\nexport const defaultOptions: Options = {\n // Source type (\"script\" or \"module\") for different semantics\n sourceType: \"script\",\n // Source filename.\n sourceFilename: undefined,\n // Line from which to start counting source. Useful for\n // integration with other tools.\n startLine: 1,\n // When enabled, await at the top level is not considered an\n // error.\n allowAwaitOutsideFunction: false,\n // When enabled, a return at the top level is not considered an\n // error.\n allowReturnOutsideFunction: false,\n // When enabled, import/export statements are not constrained to\n // appearing at the top of the program.\n allowImportExportEverywhere: false,\n // TODO\n allowSuperOutsideMethod: false,\n // When enabled, export statements can reference undeclared variables.\n allowUndeclaredExports: false,\n // An array of plugins to enable\n plugins: [],\n // TODO\n strictMode: null,\n // Nodes have their start and end characters offsets recorded in\n // `start` and `end` properties (directly on the node, rather than\n // the `loc` object, which holds line/column data. To also add a\n // [semi-standardized][range] `range` property holding a `[start,\n // end]` array with the same numbers, set the `ranges` option to\n // `true`.\n //\n // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n ranges: false,\n // Adds all parsed tokens to a `tokens` property on the `File` node\n tokens: false,\n // Whether to create ParenthesizedExpression AST nodes (if false\n // the parser sets extra.parenthesized on the expression nodes instead).\n createParenthesizedExpressions: false,\n // When enabled, errors are attached to the AST instead of being directly thrown.\n // Some errors will still throw, because @babel/parser can't always recover.\n errorRecovery: false,\n};\n\n// Interpret and default an options object\n\nexport function getOptions(opts: ?Options): Options {\n const options: any = {};\n for (const key of Object.keys(defaultOptions)) {\n options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];\n }\n return options;\n}\n","// @flow\n\nimport type { Options } from \"../options\";\nimport * as N from \"../types\";\nimport { Position } from \"../util/location\";\n\nimport { types as ct, type TokContext } from \"./context\";\nimport { types as tt, type TokenType } from \"./types\";\nimport type { ParsingError } from \"../parser/error\";\n\ntype TopicContextState = {\n // When a topic binding has been currently established,\n // then this is 1. Otherwise, it is 0. This is forwards compatible\n // with a future plugin for multiple lexical topics.\n maxNumOfResolvableTopics: number,\n\n // When a topic binding has been currently established, and if that binding\n // has been used as a topic reference `#`, then this is 0. Otherwise, it is\n // `null`. This is forwards compatible with a future plugin for multiple\n // lexical topics.\n maxTopicIndex: null | 0,\n};\n\nexport default class State {\n strict: boolean;\n curLine: number;\n\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n startLoc: Position;\n endLoc: Position;\n\n init(options: Options): void {\n this.strict =\n options.strictMode === false ? false : options.sourceType === \"module\";\n\n this.curLine = options.startLine;\n this.startLoc = this.endLoc = this.curPosition();\n }\n\n errors: ParsingError[] = [];\n\n // Used to signify the start of a potential arrow function\n potentialArrowAt: number = -1;\n\n // Used to signify the start of an expression which looks like a\n // typed arrow function, but it isn't\n // e.g. a ? (b) : c => d\n // ^\n noArrowAt: number[] = [];\n\n // Used to signify the start of an expression whose params, if it looks like\n // an arrow function, shouldn't be converted to assignable nodes.\n // This is used to defer the validation of typed arrow functions inside\n // conditional expressions.\n // e.g. a ? (b) : c => d\n // ^\n noArrowParamsConversionAt: number[] = [];\n\n // Flags to track\n maybeInArrowParameters: boolean = false;\n inPipeline: boolean = false;\n inType: boolean = false;\n noAnonFunctionType: boolean = false;\n inPropertyName: boolean = false;\n hasFlowComment: boolean = false;\n isIterator: boolean = false;\n isDeclareContext: boolean = false;\n inAbstractClass: boolean = false;\n\n // For the smartPipelines plugin:\n topicContext: TopicContextState = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null,\n };\n\n // For the F# plugin\n soloAwait: boolean = false;\n inFSharpPipelineDirectBody: boolean = false;\n\n // Labels in scope.\n labels: Array<{\n kind: ?(\"loop\" | \"switch\"),\n name?: ?string,\n statementStart?: number,\n }> = [];\n\n // Leading decorators. Last element of the stack represents the decorators in current context.\n // Supports nesting of decorators, e.g. @foo(@bar class inner {}) class outer {}\n // where @foo belongs to the outer class and @bar to the inner\n decoratorStack: Array> = [[]];\n\n // Comment store.\n comments: Array = [];\n\n // Comment attachment store\n trailingComments: Array = [];\n leadingComments: Array = [];\n commentStack: Array<{\n start: number,\n leadingComments: ?Array,\n trailingComments: ?Array,\n type: string,\n }> = [];\n // $FlowIgnore this is initialized when the parser starts.\n commentPreviousNode: N.Node = null;\n\n // The current position of the tokenizer in the input.\n pos: number = 0;\n lineStart: number = 0;\n\n // Properties of the current token:\n // Its type\n type: TokenType = tt.eof;\n\n // For tokens that include more information than their type, the value\n value: any = null;\n\n // Its start and end offset\n start: number = 0;\n end: number = 0;\n\n // Position information for the previous token\n // $FlowIgnore this is initialized when generating the second token.\n lastTokEndLoc: Position = null;\n // $FlowIgnore this is initialized when generating the second token.\n lastTokStartLoc: Position = null;\n lastTokStart: number = 0;\n lastTokEnd: number = 0;\n\n // The context stack is used to superficially track syntactic\n // context to predict whether a regular expression is allowed in a\n // given position.\n context: Array = [ct.braceStatement];\n exprAllowed: boolean = true;\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n containsEsc: boolean = false;\n\n // This property is used to track the following errors\n // - StrictNumericEscape\n // - StrictOctalLiteral\n //\n // in a literal that occurs prior to/immediately after a \"use strict\" directive.\n\n // todo(JLHwung): set strictErrors to null and avoid recording string errors\n // after a non-directive is parsed\n strictErrors: Map = new Map();\n\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n exportedIdentifiers: Array = [];\n\n // Tokens length in token store\n tokensLength: number = 0;\n\n curPosition(): Position {\n return new Position(this.curLine, this.pos - this.lineStart);\n }\n\n clone(skipArrays?: boolean): State {\n const state = new State();\n const keys = Object.keys(this);\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n // $FlowIgnore\n let val = this[key];\n\n if (!skipArrays && Array.isArray(val)) {\n val = val.slice();\n }\n\n // $FlowIgnore\n state[key] = val;\n }\n\n return state;\n }\n}\n","// @flow\n\n/*:: declare var invariant; */\n\nimport type { Options } from \"../options\";\nimport * as N from \"../types\";\nimport type { Position } from \"../util/location\";\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart, isIdentifierChar } from \"../util/identifier\";\nimport { types as tt, keywords as keywordTypes, type TokenType } from \"./types\";\nimport { type TokContext, types as ct } from \"./context\";\nimport ParserErrors, { Errors } from \"../parser/error\";\nimport { SourceLocation } from \"../util/location\";\nimport {\n lineBreak,\n lineBreakG,\n isNewLine,\n isWhitespace,\n skipWhiteSpace,\n} from \"../util/whitespace\";\nimport State from \"./state\";\n\nconst VALID_REGEX_FLAGS = new Set([\"g\", \"m\", \"s\", \"i\", \"y\", \"u\"]);\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\n\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: [\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ],\n hex: [\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ],\n};\n\nconst allowedNumericSeparatorSiblings = {};\nallowedNumericSeparatorSiblings.bin = [\n // 0 - 1\n charCodes.digit0,\n charCodes.digit1,\n];\nallowedNumericSeparatorSiblings.oct = [\n // 0 - 7\n ...allowedNumericSeparatorSiblings.bin,\n\n charCodes.digit2,\n charCodes.digit3,\n charCodes.digit4,\n charCodes.digit5,\n charCodes.digit6,\n charCodes.digit7,\n];\nallowedNumericSeparatorSiblings.dec = [\n // 0 - 9\n ...allowedNumericSeparatorSiblings.oct,\n\n charCodes.digit8,\n charCodes.digit9,\n];\n\nallowedNumericSeparatorSiblings.hex = [\n // 0 - 9, A - F, a - f,\n ...allowedNumericSeparatorSiblings.dec,\n\n charCodes.uppercaseA,\n charCodes.uppercaseB,\n charCodes.uppercaseC,\n charCodes.uppercaseD,\n charCodes.uppercaseE,\n charCodes.uppercaseF,\n\n charCodes.lowercaseA,\n charCodes.lowercaseB,\n charCodes.lowercaseC,\n charCodes.lowercaseD,\n charCodes.lowercaseE,\n charCodes.lowercaseF,\n];\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(state: State) {\n this.type = state.type;\n this.value = state.value;\n this.start = state.start;\n this.end = state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n\n declare type: TokenType;\n declare value: any;\n declare start: number;\n declare end: number;\n declare loc: SourceLocation;\n}\n\n// ## Tokenizer\n\nexport default class Tokenizer extends ParserErrors {\n // Forward-declarations\n // parser/util.js\n /*::\n +hasPrecedingLineBreak: () => boolean;\n +unexpected: (pos?: ?number, messageOrType?: string | TokenType) => empty;\n +expectPlugin: (name: string, pos?: ?number) => true;\n */\n\n isLookahead: boolean;\n\n // Token store.\n tokens: Array = [];\n\n constructor(options: Options, input: string) {\n super();\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.isLookahead = false;\n }\n\n pushToken(token: Token | N.Comment) {\n // Pop out invalid tokens trapped by try-catch parsing.\n // Those parsing branches are mainly created by typescript and flow plugins.\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n // Move to the next token\n\n next(): void {\n if (!this.isLookahead) {\n this.checkKeywordEscapes();\n if (this.options.tokens) {\n this.pushToken(new Token(this.state));\n }\n }\n\n this.state.lastTokEnd = this.state.end;\n this.state.lastTokStart = this.state.start;\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n // TODO\n\n eat(type: TokenType): boolean {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n // TODO\n\n match(type: TokenType): boolean {\n return this.state.type === type;\n }\n\n // TODO\n\n lookahead(): State {\n const old = this.state;\n this.state = old.clone(true);\n\n this.isLookahead = true;\n this.next();\n this.isLookahead = false;\n\n const curr = this.state;\n this.state = old;\n return curr;\n }\n\n nextTokenStart(): number {\n return this.nextTokenStartSince(this.state.pos);\n }\n\n nextTokenStartSince(pos: number): number {\n skipWhiteSpace.lastIndex = pos;\n const skip = skipWhiteSpace.exec(this.input);\n // $FlowIgnore: The skipWhiteSpace ensures to match any string\n return pos + skip[0].length;\n }\n\n lookaheadCharCode(): number {\n return this.input.charCodeAt(this.nextTokenStart());\n }\n\n // Toggle strict mode. Re-reads the next number or string to please\n // pedantic tests (`\"use strict\"; 010;` should fail).\n\n setStrict(strict: boolean): void {\n this.state.strict = strict;\n if (strict) {\n // Throw an error for any string decimal escape found before/immediately\n // after a \"use strict\" directive. Strict mode will be set at parse\n // time for any literals that occur after the next node of the strict\n // directive.\n this.state.strictErrors.forEach((message, pos) =>\n /* eslint-disable @babel/development-internal/dry-error-messages */\n this.raise(pos, message),\n );\n this.state.strictErrors.clear();\n }\n }\n\n curContext(): TokContext {\n return this.state.context[this.state.context.length - 1];\n }\n\n // Read a single token, updating the parser object's token-related\n // properties.\n\n nextToken(): void {\n const curContext = this.curContext();\n if (!curContext?.preserveSpace) this.skipSpace();\n this.state.start = this.state.pos;\n this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(tt.eof);\n return;\n }\n\n const override = curContext?.override;\n if (override) {\n override(this);\n } else {\n this.getTokenFromCode(this.input.codePointAt(this.state.pos));\n }\n }\n\n pushComment(\n block: boolean,\n text: string,\n start: number,\n end: number,\n startLoc: Position,\n endLoc: Position,\n ): void {\n const comment = {\n type: block ? \"CommentBlock\" : \"CommentLine\",\n value: text,\n start: start,\n end: end,\n loc: new SourceLocation(startLoc, endLoc),\n };\n\n if (this.options.tokens) this.pushToken(comment);\n this.state.comments.push(comment);\n this.addComment(comment);\n }\n\n skipBlockComment(): void {\n const startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(\"*/\", this.state.pos + 2);\n if (end === -1) throw this.raise(start, Errors.UnterminatedComment);\n\n this.state.pos = end + 2;\n lineBreakG.lastIndex = start;\n let match;\n while (\n (match = lineBreakG.exec(this.input)) &&\n match.index < this.state.pos\n ) {\n ++this.state.curLine;\n this.state.lineStart = match.index + match[0].length;\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n\n this.pushComment(\n true,\n this.input.slice(start + 2, end),\n start,\n this.state.pos,\n startLoc,\n this.state.curPosition(),\n );\n }\n\n skipLineComment(startSkip: number): void {\n const start = this.state.pos;\n const startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt((this.state.pos += startSkip));\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n\n this.pushComment(\n false,\n this.input.slice(start + startSkip, this.state.pos),\n start,\n this.state.pos,\n startLoc,\n this.state.curPosition(),\n );\n }\n\n // Called at the start of the parse and after every token. Skips\n // whitespace and comments, and.\n\n skipSpace(): void {\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.tab:\n ++this.state.pos;\n break;\n case charCodes.carriageReturn:\n if (\n this.input.charCodeAt(this.state.pos + 1) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n }\n // fall through\n case charCodes.lineFeed:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n\n case charCodes.slash:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case charCodes.asterisk:\n this.skipBlockComment();\n break;\n\n case charCodes.slash:\n this.skipLineComment(2);\n break;\n\n default:\n break loop;\n }\n break;\n\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else {\n break loop;\n }\n }\n }\n }\n\n // Called at the end of every token. Sets `end`, `val`, and\n // maintains `context` and `exprAllowed`, and skips the space after\n // the token, so that the next one's `start` will point at the\n // right position.\n\n finishToken(type: TokenType, val: any): void {\n this.state.end = this.state.pos;\n this.state.endLoc = this.state.curPosition();\n const prevType = this.state.type;\n this.state.type = type;\n this.state.value = val;\n\n if (!this.isLookahead) this.updateContext(prevType);\n }\n\n // ### Token reading\n\n // This is the function that is called to fetch the next token. It\n // is somewhat obscure, because it works in character codes rather\n // than characters, and because operator parsing has been inlined\n // into it.\n //\n // All in the name of speed.\n\n // number sign is \"#\"\n readToken_numberSign(): void {\n if (this.state.pos === 0 && this.readToken_interpreter()) {\n return;\n }\n\n const nextPos = this.state.pos + 1;\n const next = this.input.charCodeAt(nextPos);\n if (next >= charCodes.digit0 && next <= charCodes.digit9) {\n throw this.raise(this.state.pos, Errors.UnexpectedDigitAfterHash);\n }\n\n if (\n next === charCodes.leftCurlyBrace ||\n (next === charCodes.leftSquareBracket && this.hasPlugin(\"recordAndTuple\"))\n ) {\n // When we see `#{`, it is likely to be a hash record.\n // However we don't yell at `#[` since users may intend to use \"computed private fields\",\n // which is not allowed in the spec. Throwing expecting recordAndTuple is\n // misleading\n this.expectPlugin(\"recordAndTuple\");\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"hash\") {\n throw this.raise(\n this.state.pos,\n next === charCodes.leftCurlyBrace\n ? Errors.RecordExpressionHashIncorrectStartSyntaxType\n : Errors.TupleExpressionHashIncorrectStartSyntaxType,\n );\n }\n\n if (next === charCodes.leftCurlyBrace) {\n // #{\n this.finishToken(tt.braceHashL);\n } else {\n // #[\n this.finishToken(tt.bracketHashL);\n }\n this.state.pos += 2;\n } else {\n this.finishOp(tt.hash, 1);\n }\n }\n\n readToken_dot(): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next >= charCodes.digit0 && next <= charCodes.digit9) {\n this.readNumber(true);\n return;\n }\n\n if (\n next === charCodes.dot &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.dot\n ) {\n this.state.pos += 3;\n this.finishToken(tt.ellipsis);\n } else {\n ++this.state.pos;\n this.finishToken(tt.dot);\n }\n }\n\n readToken_slash(): void {\n // '/'\n if (this.state.exprAllowed && !this.state.inType) {\n ++this.state.pos;\n this.readRegexp();\n return;\n }\n\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.slash, 1);\n }\n }\n\n readToken_interpreter(): boolean {\n if (this.state.pos !== 0 || this.length < 2) return false;\n\n let ch = this.input.charCodeAt(this.state.pos + 1);\n if (ch !== charCodes.exclamationMark) return false;\n\n const start = this.state.pos;\n this.state.pos += 1;\n\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n\n const value = this.input.slice(start + 2, this.state.pos);\n\n this.finishToken(tt.interpreterDirective, value);\n\n return true;\n }\n\n readToken_mult_modulo(code: number): void {\n // '%*'\n let type = code === charCodes.asterisk ? tt.star : tt.modulo;\n let width = 1;\n let next = this.input.charCodeAt(this.state.pos + 1);\n const exprAllowed = this.state.exprAllowed;\n\n // Exponentiation operator **\n if (code === charCodes.asterisk && next === charCodes.asterisk) {\n width++;\n next = this.input.charCodeAt(this.state.pos + 2);\n type = tt.exponent;\n }\n\n if (next === charCodes.equalsTo && !exprAllowed) {\n width++;\n type = tt.assign;\n }\n\n this.finishOp(type, width);\n }\n\n readToken_pipe_amp(code: number): void {\n // '||' '&&' '||=' '&&='\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === code) {\n if (this.input.charCodeAt(this.state.pos + 2) === charCodes.equalsTo) {\n this.finishOp(tt.assign, 3);\n } else {\n this.finishOp(\n code === charCodes.verticalBar ? tt.logicalOR : tt.logicalAND,\n 2,\n );\n }\n return;\n }\n\n if (code === charCodes.verticalBar) {\n // '|>'\n if (next === charCodes.greaterThan) {\n this.finishOp(tt.pipeline, 2);\n return;\n }\n // '|}'\n if (\n this.hasPlugin(\"recordAndTuple\") &&\n next === charCodes.rightCurlyBrace\n ) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(\n this.state.pos,\n Errors.RecordExpressionBarIncorrectEndSyntaxType,\n );\n }\n\n this.finishOp(tt.braceBarR, 2);\n return;\n }\n\n // '|]'\n if (\n this.hasPlugin(\"recordAndTuple\") &&\n next === charCodes.rightSquareBracket\n ) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(\n this.state.pos,\n Errors.TupleExpressionBarIncorrectEndSyntaxType,\n );\n }\n\n this.finishOp(tt.bracketBarR, 2);\n return;\n }\n }\n\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n return;\n }\n\n this.finishOp(\n code === charCodes.verticalBar ? tt.bitwiseOR : tt.bitwiseAND,\n 1,\n );\n }\n\n readToken_caret(): void {\n // '^'\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.bitwiseXOR, 1);\n }\n }\n\n readToken_plus_min(code: number): void {\n // '+-'\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === code) {\n if (\n next === charCodes.dash &&\n !this.inModule &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.greaterThan &&\n (this.state.lastTokEnd === 0 || this.hasPrecedingLineBreak())\n ) {\n // A `-->` line comment\n this.skipLineComment(3);\n this.skipSpace();\n this.nextToken();\n return;\n }\n this.finishOp(tt.incDec, 2);\n return;\n }\n\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.plusMin, 1);\n }\n }\n\n readToken_lt_gt(code: number): void {\n // '<>'\n const next = this.input.charCodeAt(this.state.pos + 1);\n let size = 1;\n\n if (next === code) {\n size =\n code === charCodes.greaterThan &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.greaterThan\n ? 3\n : 2;\n if (this.input.charCodeAt(this.state.pos + size) === charCodes.equalsTo) {\n this.finishOp(tt.assign, size + 1);\n return;\n }\n this.finishOp(tt.bitShift, size);\n return;\n }\n\n if (\n next === charCodes.exclamationMark &&\n code === charCodes.lessThan &&\n !this.inModule &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.dash &&\n this.input.charCodeAt(this.state.pos + 3) === charCodes.dash\n ) {\n // ` - -```js -var accepts = require('accepts') -``` - -### accepts(req) - -Create a new `Accepts` object for the given `req`. - -#### .charset(charsets) - -Return the first accepted charset. If nothing in `charsets` is accepted, -then `false` is returned. - -#### .charsets() - -Return the charsets that the request accepts, in the order of the client's -preference (most preferred first). - -#### .encoding(encodings) - -Return the first accepted encoding. If nothing in `encodings` is accepted, -then `false` is returned. - -#### .encodings() - -Return the encodings that the request accepts, in the order of the client's -preference (most preferred first). - -#### .language(languages) - -Return the first accepted language. If nothing in `languages` is accepted, -then `false` is returned. - -#### .languages() - -Return the languages that the request accepts, in the order of the client's -preference (most preferred first). - -#### .type(types) - -Return the first accepted type (and it is returned as the same text as what -appears in the `types` array). If nothing in `types` is accepted, then `false` -is returned. - -The `types` array can contain full MIME types or file extensions. Any value -that is not a full MIME types is passed to `require('mime-types').lookup`. - -#### .types() - -Return the types that the request accepts, in the order of the client's -preference (most preferred first). - -## Examples - -### Simple type negotiation - -This simple example shows how to use `accepts` to return a different typed -respond body based on what the client wants to accept. The server lists it's -preferences in order and will get back the best match between the client and -server. - -```js -var accepts = require('accepts') -var http = require('http') - -function app (req, res) { - var accept = accepts(req) - - // the order of this list is significant; should be server preferred order - switch (accept.type(['json', 'html'])) { - case 'json': - res.setHeader('Content-Type', 'application/json') - res.write('{"hello":"world!"}') - break - case 'html': - res.setHeader('Content-Type', 'text/html') - res.write('hello, world!') - break - default: - // the fallback is text/plain, so no need to specify it above - res.setHeader('Content-Type', 'text/plain') - res.write('hello, world!') - break - } - - res.end() -} - -http.createServer(app).listen(3000) -``` - -You can test this out with the cURL program: -```sh -curl -I -H'Accept: text/html' http://localhost:3000/ -``` - -## License - -[MIT](LICENSE) - -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/accepts/master -[coveralls-url]: https://coveralls.io/r/jshttp/accepts?branch=master -[node-version-image]: https://badgen.net/npm/node/accepts -[node-version-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/accepts -[npm-url]: https://npmjs.org/package/accepts -[npm-version-image]: https://badgen.net/npm/v/accepts -[travis-image]: https://badgen.net/travis/jshttp/accepts/master -[travis-url]: https://travis-ci.org/jshttp/accepts diff --git a/node_modules/accepts/index.js b/node_modules/accepts/index.js deleted file mode 100644 index e9b2f63..0000000 --- a/node_modules/accepts/index.js +++ /dev/null @@ -1,238 +0,0 @@ -/*! - * accepts - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var Negotiator = require('negotiator') -var mime = require('mime-types') - -/** - * Module exports. - * @public - */ - -module.exports = Accepts - -/** - * Create a new Accepts object for the given req. - * - * @param {object} req - * @public - */ - -function Accepts (req) { - if (!(this instanceof Accepts)) { - return new Accepts(req) - } - - this.headers = req.headers - this.negotiator = new Negotiator(req) -} - -/** - * Check if the given `type(s)` is acceptable, returning - * the best match when true, otherwise `undefined`, in which - * case you should respond with 406 "Not Acceptable". - * - * The `type` value may be a single mime type string - * such as "application/json", the extension name - * such as "json" or an array `["json", "html", "text/plain"]`. When a list - * or array is given the _best_ match, if any is returned. - * - * Examples: - * - * // Accept: text/html - * this.types('html'); - * // => "html" - * - * // Accept: text/*, application/json - * this.types('html'); - * // => "html" - * this.types('text/html'); - * // => "text/html" - * this.types('json', 'text'); - * // => "json" - * this.types('application/json'); - * // => "application/json" - * - * // Accept: text/*, application/json - * this.types('image/png'); - * this.types('png'); - * // => undefined - * - * // Accept: text/*;q=.5, application/json - * this.types(['html', 'json']); - * this.types('html', 'json'); - * // => "json" - * - * @param {String|Array} types... - * @return {String|Array|Boolean} - * @public - */ - -Accepts.prototype.type = -Accepts.prototype.types = function (types_) { - var types = types_ - - // support flattened arguments - if (types && !Array.isArray(types)) { - types = new Array(arguments.length) - for (var i = 0; i < types.length; i++) { - types[i] = arguments[i] - } - } - - // no types, return all requested types - if (!types || types.length === 0) { - return this.negotiator.mediaTypes() - } - - // no accept header, return first given type - if (!this.headers.accept) { - return types[0] - } - - var mimes = types.map(extToMime) - var accepts = this.negotiator.mediaTypes(mimes.filter(validMime)) - var first = accepts[0] - - return first - ? types[mimes.indexOf(first)] - : false -} - -/** - * Return accepted encodings or best fit based on `encodings`. - * - * Given `Accept-Encoding: gzip, deflate` - * an array sorted by quality is returned: - * - * ['gzip', 'deflate'] - * - * @param {String|Array} encodings... - * @return {String|Array} - * @public - */ - -Accepts.prototype.encoding = -Accepts.prototype.encodings = function (encodings_) { - var encodings = encodings_ - - // support flattened arguments - if (encodings && !Array.isArray(encodings)) { - encodings = new Array(arguments.length) - for (var i = 0; i < encodings.length; i++) { - encodings[i] = arguments[i] - } - } - - // no encodings, return all requested encodings - if (!encodings || encodings.length === 0) { - return this.negotiator.encodings() - } - - return this.negotiator.encodings(encodings)[0] || false -} - -/** - * Return accepted charsets or best fit based on `charsets`. - * - * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5` - * an array sorted by quality is returned: - * - * ['utf-8', 'utf-7', 'iso-8859-1'] - * - * @param {String|Array} charsets... - * @return {String|Array} - * @public - */ - -Accepts.prototype.charset = -Accepts.prototype.charsets = function (charsets_) { - var charsets = charsets_ - - // support flattened arguments - if (charsets && !Array.isArray(charsets)) { - charsets = new Array(arguments.length) - for (var i = 0; i < charsets.length; i++) { - charsets[i] = arguments[i] - } - } - - // no charsets, return all requested charsets - if (!charsets || charsets.length === 0) { - return this.negotiator.charsets() - } - - return this.negotiator.charsets(charsets)[0] || false -} - -/** - * Return accepted languages or best fit based on `langs`. - * - * Given `Accept-Language: en;q=0.8, es, pt` - * an array sorted by quality is returned: - * - * ['es', 'pt', 'en'] - * - * @param {String|Array} langs... - * @return {Array|String} - * @public - */ - -Accepts.prototype.lang = -Accepts.prototype.langs = -Accepts.prototype.language = -Accepts.prototype.languages = function (languages_) { - var languages = languages_ - - // support flattened arguments - if (languages && !Array.isArray(languages)) { - languages = new Array(arguments.length) - for (var i = 0; i < languages.length; i++) { - languages[i] = arguments[i] - } - } - - // no languages, return all requested languages - if (!languages || languages.length === 0) { - return this.negotiator.languages() - } - - return this.negotiator.languages(languages)[0] || false -} - -/** - * Convert extnames to mime. - * - * @param {String} type - * @return {String} - * @private - */ - -function extToMime (type) { - return type.indexOf('/') === -1 - ? mime.lookup(type) - : type -} - -/** - * Check if mime is valid. - * - * @param {String} type - * @return {String} - * @private - */ - -function validMime (type) { - return typeof type === 'string' -} diff --git a/node_modules/accepts/package.json b/node_modules/accepts/package.json deleted file mode 100644 index 8ebfbf2..0000000 --- a/node_modules/accepts/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_from": "accepts@~1.3.5", - "_id": "accepts@1.3.7", - "_inBundle": false, - "_integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", - "_location": "/accepts", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "accepts@~1.3.5", - "name": "accepts", - "escapedName": "accepts", - "rawSpec": "~1.3.5", - "saveSpec": null, - "fetchSpec": "~1.3.5" - }, - "_requiredBy": [ - "/express" - ], - "_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "_shasum": "531bc726517a3b2b41f850021c6cc15eaab507cd", - "_spec": "accepts@~1.3.5", - "_where": "/var/www/html/gtg2nodejs/node_modules/express", - "bugs": { - "url": "https://github.com/jshttp/accepts/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - } - ], - "dependencies": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" - }, - "deprecated": false, - "description": "Higher-level content negotiation", - "devDependencies": { - "deep-equal": "1.0.1", - "eslint": "5.16.0", - "eslint-config-standard": "12.0.0", - "eslint-plugin-import": "2.17.2", - "eslint-plugin-markdown": "1.0.0", - "eslint-plugin-node": "8.0.1", - "eslint-plugin-promise": "4.1.1", - "eslint-plugin-standard": "4.0.0", - "mocha": "6.1.4", - "nyc": "14.0.0" - }, - "engines": { - "node": ">= 0.6" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "index.js" - ], - "homepage": "https://github.com/jshttp/accepts#readme", - "keywords": [ - "content", - "negotiation", - "accept", - "accepts" - ], - "license": "MIT", - "name": "accepts", - "repository": { - "type": "git", - "url": "git+https://github.com/jshttp/accepts.git" - }, - "scripts": { - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --reporter spec --check-leaks --bail test/", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "test-travis": "nyc --reporter=text npm test" - }, - "version": "1.3.7" -} diff --git a/node_modules/acorn-globals/LICENSE b/node_modules/acorn-globals/LICENSE deleted file mode 100644 index 27cc9f3..0000000 --- a/node_modules/acorn-globals/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014 Forbes Lindesay - -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/acorn-globals/README.md b/node_modules/acorn-globals/README.md deleted file mode 100644 index d8cd372..0000000 --- a/node_modules/acorn-globals/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# acorn-globals - -Detect global variables in JavaScript using acorn - -[![Build Status](https://img.shields.io/travis/ForbesLindesay/acorn-globals/master.svg)](https://travis-ci.org/ForbesLindesay/acorn-globals) -[![Dependency Status](https://img.shields.io/david/ForbesLindesay/acorn-globals.svg)](https://david-dm.org/ForbesLindesay/acorn-globals) -[![NPM version](https://img.shields.io/npm/v/acorn-globals.svg)](https://www.npmjs.org/package/acorn-globals) - -## Installation - - npm install acorn-globals - -## Usage - -detect.js - -```js -var fs = require('fs'); -var detect = require('acorn-globals'); - -var src = fs.readFileSync(__dirname + '/input.js', 'utf8'); - -var scope = detect(src); -console.dir(scope); -``` - -input.js - -```js -var x = 5; -var y = 3, z = 2; - -w.foo(); -w = 2; - -RAWR=444; -RAWR.foo(); - -BLARG=3; - -foo(function () { - var BAR = 3; - process.nextTick(function (ZZZZZZZZZZZZ) { - console.log('beep boop'); - var xyz = 4; - x += 10; - x.zzzzzz; - ZZZ=6; - }); - function doom () { - } - ZZZ.foo(); - -}); - -console.log(xyz); -``` - -output: - -``` -$ node example/detect.js -[ { name: 'BLARG', nodes: [ [Object] ] }, - { name: 'RAWR', nodes: [ [Object], [Object] ] }, - { name: 'ZZZ', nodes: [ [Object], [Object] ] }, - { name: 'console', nodes: [ [Object], [Object] ] }, - { name: 'foo', nodes: [ [Object] ] }, - { name: 'process', nodes: [ [Object] ] }, - { name: 'w', nodes: [ [Object], [Object] ] }, - { name: 'xyz', nodes: [ [Object] ] } ] -``` - - -## License - - MIT diff --git a/node_modules/acorn-globals/index.js b/node_modules/acorn-globals/index.js deleted file mode 100644 index ff924c9..0000000 --- a/node_modules/acorn-globals/index.js +++ /dev/null @@ -1,180 +0,0 @@ -'use strict'; - -var acorn = require('acorn'); -var walk = require('acorn/dist/walk'); - -function isScope(node) { - return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration' || node.type === 'ArrowFunctionExpression' || node.type === 'Program'; -} -function isBlockScope(node) { - return node.type === 'BlockStatement' || isScope(node); -} - -function declaresArguments(node) { - return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration'; -} - -function declaresThis(node) { - return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration'; -} - -function reallyParse(source) { - try { - return acorn.parse(source, { - ecmaVersion: 6, - allowReturnOutsideFunction: true, - allowImportExportEverywhere: true, - allowHashBang: true - }); - } catch (ex) { - return acorn.parse(source, { - ecmaVersion: 5, - allowReturnOutsideFunction: true, - allowImportExportEverywhere: true, - allowHashBang: true - }); - } -} -module.exports = findGlobals; -module.exports.parse = reallyParse; -function findGlobals(source) { - var globals = []; - var ast; - // istanbul ignore else - if (typeof source === 'string') { - ast = reallyParse(source); - } else { - ast = source; - } - // istanbul ignore if - if (!(ast && typeof ast === 'object' && ast.type === 'Program')) { - throw new TypeError('Source must be either a string of JavaScript or an acorn AST'); - } - var declareFunction = function (node) { - var fn = node; - fn.locals = fn.locals || {}; - node.params.forEach(function (node) { - declarePattern(node, fn); - }); - if (node.id) { - fn.locals[node.id.name] = true; - } - } - var declarePattern = function (node, parent) { - switch (node.type) { - case 'Identifier': - parent.locals[node.name] = true; - break; - case 'ObjectPattern': - node.properties.forEach(function (node) { - declarePattern(node.value, parent); - }); - break; - case 'ArrayPattern': - node.elements.forEach(function (node) { - if (node) declarePattern(node, parent); - }); - break; - case 'RestElement': - declarePattern(node.argument, parent); - break; - case 'AssignmentPattern': - declarePattern(node.left, parent); - break; - // istanbul ignore next - default: - throw new Error('Unrecognized pattern type: ' + node.type); - } - } - var declareModuleSpecifier = function (node, parents) { - ast.locals = ast.locals || {}; - ast.locals[node.local.name] = true; - } - walk.ancestor(ast, { - 'VariableDeclaration': function (node, parents) { - var parent = null; - for (var i = parents.length - 1; i >= 0 && parent === null; i--) { - if (node.kind === 'var' ? isScope(parents[i]) : isBlockScope(parents[i])) { - parent = parents[i]; - } - } - parent.locals = parent.locals || {}; - node.declarations.forEach(function (declaration) { - declarePattern(declaration.id, parent); - }); - }, - 'FunctionDeclaration': function (node, parents) { - var parent = null; - for (var i = parents.length - 2; i >= 0 && parent === null; i--) { - if (isScope(parents[i])) { - parent = parents[i]; - } - } - parent.locals = parent.locals || {}; - parent.locals[node.id.name] = true; - declareFunction(node); - }, - 'Function': declareFunction, - 'ClassDeclaration': function (node, parents) { - var parent = null; - for (var i = parents.length - 2; i >= 0 && parent === null; i--) { - if (isScope(parents[i])) { - parent = parents[i]; - } - } - parent.locals = parent.locals || {}; - parent.locals[node.id.name] = true; - }, - 'TryStatement': function (node) { - if (node.handler === null) return; - node.handler.body.locals = node.handler.body.locals || {}; - node.handler.body.locals[node.handler.param.name] = true; - }, - 'ImportDefaultSpecifier': declareModuleSpecifier, - 'ImportSpecifier': declareModuleSpecifier, - 'ImportNamespaceSpecifier': declareModuleSpecifier - }); - function identifier(node, parents) { - var name = node.name; - if (name === 'undefined') return; - for (var i = 0; i < parents.length; i++) { - if (name === 'arguments' && declaresArguments(parents[i])) { - return; - } - if (parents[i].locals && name in parents[i].locals) { - return; - } - } - if ( - parents[parents.length - 2] && - parents[parents.length - 2].type === 'TryStatement' && - parents[parents.length - 2].handler && - node === parents[parents.length - 2].handler.param - ) { - return; - } - node.parents = parents; - globals.push(node); - } - walk.ancestor(ast, { - 'VariablePattern': identifier, - 'Identifier': identifier, - 'ThisExpression': function (node, parents) { - for (var i = 0; i < parents.length; i++) { - if (declaresThis(parents[i])) { - return; - } - } - node.parents = parents; - globals.push(node); - } - }); - var groupedGlobals = {}; - globals.forEach(function (node) { - groupedGlobals[node.name] = (groupedGlobals[node.name] || []); - groupedGlobals[node.name].push(node); - }); - return Object.keys(groupedGlobals).sort().map(function (name) { - return {name: name, nodes: groupedGlobals[name]}; - }); -} diff --git a/node_modules/acorn-globals/package.json b/node_modules/acorn-globals/package.json deleted file mode 100644 index bf31433..0000000 --- a/node_modules/acorn-globals/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "acorn-globals@^1.0.3", - "_id": "acorn-globals@1.0.9", - "_inBundle": false, - "_integrity": "sha1-VbtemGkVB7dFedBRNBMhfDgMVM8=", - "_location": "/acorn-globals", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "acorn-globals@^1.0.3", - "name": "acorn-globals", - "escapedName": "acorn-globals", - "rawSpec": "^1.0.3", - "saveSpec": null, - "fetchSpec": "^1.0.3" - }, - "_requiredBy": [ - "/with" - ], - "_resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-1.0.9.tgz", - "_shasum": "55bb5e98691507b74579d0513413217c380c54cf", - "_spec": "acorn-globals@^1.0.3", - "_where": "/var/www/html/gtg2nodejs/node_modules/with", - "author": { - "name": "ForbesLindesay" - }, - "bugs": { - "url": "https://github.com/ForbesLindesay/acorn-globals/issues" - }, - "bundleDependencies": false, - "dependencies": { - "acorn": "^2.1.0" - }, - "deprecated": false, - "description": "Detect global variables in JavaScript using acorn", - "devDependencies": { - "testit": "^2.0.2" - }, - "files": [ - "index.js", - "LICENSE" - ], - "homepage": "https://github.com/ForbesLindesay/acorn-globals#readme", - "keywords": [ - "ast", - "variable", - "name", - "lexical", - "scope", - "local", - "global", - "implicit" - ], - "license": "MIT", - "name": "acorn-globals", - "repository": { - "type": "git", - "url": "git+https://github.com/ForbesLindesay/acorn-globals.git" - }, - "scripts": { - "test": "node test" - }, - "version": "1.0.9" -} diff --git a/node_modules/acorn/.editorconfig b/node_modules/acorn/.editorconfig deleted file mode 100644 index c14d5c6..0000000 --- a/node_modules/acorn/.editorconfig +++ /dev/null @@ -1,7 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -insert_final_newline = true diff --git a/node_modules/acorn/.gitattributes b/node_modules/acorn/.gitattributes deleted file mode 100644 index fcadb2c..0000000 --- a/node_modules/acorn/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text eol=lf diff --git a/node_modules/acorn/.npmignore b/node_modules/acorn/.npmignore deleted file mode 100644 index ecba291..0000000 --- a/node_modules/acorn/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -/.tern-port -/test -/local diff --git a/node_modules/acorn/.tern-project b/node_modules/acorn/.tern-project deleted file mode 100644 index 6718ce0..0000000 --- a/node_modules/acorn/.tern-project +++ /dev/null @@ -1,6 +0,0 @@ -{ - "plugins": { - "node": true, - "es_modules": true - } -} \ No newline at end of file diff --git a/node_modules/acorn/.travis.yml b/node_modules/acorn/.travis.yml deleted file mode 100644 index f50c379..0000000 --- a/node_modules/acorn/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -sudo: false -node_js: - - '0.10' - - '0.12' - - '4' diff --git a/node_modules/acorn/AUTHORS b/node_modules/acorn/AUTHORS deleted file mode 100644 index 0e8f48b..0000000 --- a/node_modules/acorn/AUTHORS +++ /dev/null @@ -1,43 +0,0 @@ -List of Acorn contributors. Updated before every release. - -Adrian Rakovsky -Alistair Braidwood -Andres Suarez -Aparajita Fishman -Arian Stolwijk -Artem Govorov -Brandon Mills -Charles Hughes -Conrad Irwin -David Bonnet -ForbesLindesay -Forbes Lindesay -Gilad Peleg -impinball -Ingvar Stepanyan -Jesse McCarthy -Jiaxing Wang -Joel Kemp -Johannes Herr -Jürg Lehni -keeyipchan -Kevin Kwok -krator -Marijn Haverbeke -Martin Carlberg -Mathias Bynens -Mathieu 'p01' Henri -Max Schaefer -Max Zerzouri -Mihai Bazon -Mike Rennie -Nick Fitzgerald -Oskar Schöldström -Paul Harper -Peter Rust -PlNG -r-e-d -Rich Harris -Sebastian McKenzie -Timothy Gu -zsjforcn diff --git a/node_modules/acorn/LICENSE b/node_modules/acorn/LICENSE deleted file mode 100644 index d4c7fc5..0000000 --- a/node_modules/acorn/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2012-2014 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 deleted file mode 100644 index acd39a8..0000000 --- a/node_modules/acorn/README.md +++ /dev/null @@ -1,396 +0,0 @@ -# Acorn - -[![Build Status](https://travis-ci.org/ternjs/acorn.svg?branch=master)](https://travis-ci.org/ternjs/acorn) -[![NPM version](https://img.shields.io/npm/v/acorn.svg)](https://www.npmjs.com/package/acorn) -[Author funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png?force)](https://marijnhaverbeke.nl/fund/) - -A tiny, fast JavaScript parser, written completely in JavaScript. - -## Community - -Acorn is open source software released under an -[MIT license](https://github.com/ternjs/acorn/blob/master/LICENSE). - -You are welcome to -[report bugs](https://github.com/ternjs/acorn/issues) or create pull -requests on [github](https://github.com/ternjs/acorn). For questions -and discussion, please use the -[Tern discussion forum](https://discuss.ternjs.net). - -## Installation - -The easiest way to install acorn is with [`npm`][npm]. - -[npm]: https://www.npmjs.com/ - -```sh -npm install acorn -``` - -Alternately, download the source. - -```sh -git clone https://github.com/ternjs/acorn.git -``` - -## Components - -When run in a CommonJS (node.js) or AMD environment, exported values -appear in the interfaces exposed by the individual files, as usual. -When loaded in the browser (Acorn works in any JS-enabled browser more -recent than IE5) without any kind of module management, a single -global object `acorn` will be defined, and all the exported properties -will be added to that. - -### Main parser - -This is implemented in `dist/acorn.js`, and is what you get when you -`require("acorn")` in node.js. - -**parse**`(input, options)` is used to parse a JavaScript program. -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][estree]. - -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 character offset at which the -error occurred, and a `loc` object that contains a `{line, column}` -object referring to that same position. - -[estree]: https://github.com/estree/estree - -- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be - either 3, 5, or 6. This influences support for strict mode, the set - of reserved words, and support for new syntax features. Default is 5. - -- **sourceType**: Indicate the mode the code should be parsed in. Can be - either `"script"` or `"module"`. - -- **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. - -- **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][range] `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 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. - -[range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 - -**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. - -**getLineInfo**`(input, offset)` can be used to get a `{line, -column}` object for a given program string and character offset. - -**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. - -#### Note on using with [Escodegen][escodegen] - -Escodegen supports generating comments from AST, attached in -Esprima-specific format. In order to simulate same format in -Acorn, consider following example: - -```javascript -var comments = [], tokens = []; - -var ast = acorn.parse('var x = 42; // answer', { - // collect ranges for each node - ranges: true, - // collect comments in Esprima's format - onComment: comments, - // collect token ranges - onToken: tokens -}); - -// attach comments using collected information -escodegen.attachComments(ast, comments, tokens); - -// generate code -console.log(escodegen.generate(ast, {comment: true})); -// > 'var x = 42; // answer' -``` - -[escodegen]: https://github.com/estools/escodegen - -### dist/acorn_loose.js ### - -This file implements an error-tolerant parser. It exposes a single -function. The loose parser is accessible in node.js via `require("acorn/dist/acorn_loose")`. - -**parse_dammit**`(input, options)` takes the same arguments and -returns the same syntax tree as the `parse` function in `acorn.js`, -but never raises an error, and will do its best to parse syntactically -invalid code in as meaningful a way as it can. It'll insert identifier -nodes with name `"✖"` as placeholders in places where it can't make -sense of the input. Depends on `acorn.js`, because it uses the same -tokenizer. - -### dist/walk.js ### - -Implements an abstract syntax tree walker. Will store its interface in -`acorn.walk` when loaded without a module system. - -**simple**`(node, visitors, base, state)` does a 'simple' walk over -a tree. `node` should be the AST node to walk, and `visitors` an -object with properties whose names correspond to node types in the -[ESTree spec][estree]. The properties should contain functions -that will be called with the node object and, if applicable the state -at that point. The last two arguments are optional. `base` is a walker -algorithm, and `state` is a start state. The default walker will -simply visit all statements and expressions and not produce a -meaningful state. (An example of a use of state is to track scope at -each point in the tree.) - -**ancestor**`(node, visitors, base, state)` does a 'simple' walk over -a tree, building up an array of ancestor nodes (including the current node) -and passing the array to callbacks in the `state` parameter. - -**recursive**`(node, state, functions, base)` does a 'recursive' -walk, where the walker functions are responsible for continuing the -walk on the child nodes of their target node. `state` is the start -state, and `functions` should contain an object that maps node types -to walker functions. Such functions are called with `(node, state, c)` -arguments, and can cause the walk to continue on a sub-node by calling -the `c` argument on it with `(node, state)` arguments. The optional -`base` argument provides the fallback walker functions for node types -that aren't handled in the `functions` object. If not given, the -default walkers will be used. - -**make**`(functions, base)` builds a new walker object by using the -walker functions in `functions` and filling in the missing ones by -taking defaults from `base`. - -**findNodeAt**`(node, start, end, test, base, state)` tries to -locate a node in a tree at the given start and/or end offsets, which -satisfies the predicate `test`. `start` and `end` can be either `null` -(as wildcard) or a number. `test` may be a string (indicating a node -type) or a function that takes `(nodeType, node)` arguments and -returns a boolean indicating whether this node is interesting. `base` -and `state` are optional, and can be used to specify a custom walker. -Nodes are tested from inner to outer, so if two nodes match the -boundaries, the inner one will be preferred. - -**findNodeAround**`(node, pos, test, base, state)` is a lot like -`findNodeAt`, but will match any node that exists 'around' (spanning) -the given position. - -**findNodeAfter**`(node, pos, test, base, state)` is similar to -`findNodeAround`, but will match all nodes *after* the given position -(testing outer nodes before inner nodes). - -## 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`: Sets the ECMAScript version to parse. Default is - version 5. - -- `--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. - -## Build system - -Acorn is written in ECMAScript 6, as a set of small modules, in the -project's `src` directory, and compiled down to bigger ECMAScript 3 -files in `dist` using [Browserify](http://browserify.org) and -[Babel](http://babeljs.io/). If you are already using Babel, you can -consider including the modules directly. - -The command-line test runner (`npm test`) uses the ES6 modules. The -browser-based test page (`test/index.html`) uses the compiled modules. -The `bin/build-acorn.js` script builds the latter from the former. - -If you are working on Acorn, you'll probably want to try the code out -directly, without an intermediate build step. In your scripts, you can -register the Babel require shim like this: - - require("babel-core/register") - -That will allow you to directly `require` the ES6 modules. - -## Plugins - -Acorn is designed support allow plugins which, within reasonable -bounds, redefine the way the parser works. Plugins can add new token -types and new tokenizer contexts (if necessary), and extend methods in -the parser object. This is not a clean, elegant API—using it requires -an understanding of Acorn's internals, and plugins are likely to break -whenever those internals are significantly changed. But still, it is -_possible_, in this way, to create parsers for JavaScript dialects -without forking all of Acorn. And in principle it is even possible to -combine such plugins, so that if you have, for example, a plugin for -parsing types and a plugin for parsing JSX-style XML literals, you -could load them both and parse code with both JSX tags and types. - -A plugin should register itself by adding a property to -`acorn.plugins`, which holds a function. Calling `acorn.parse`, a -`plugins` option can be passed, holding an object mapping plugin names -to configuration values (or just `true` for plugins that don't take -options). After the parser object has been created, the initialization -functions for the chosen plugins are called with `(parser, -configValue)` arguments. They are expected to use the `parser.extend` -method to extend parser methods. For example, the `readToken` method -could be extended like this: - -```javascript -parser.extend("readToken", function(nextMethod) { - return function(code) { - console.log("Reading a token!") - return nextMethod.call(this, code) - } -}) -``` - -The `nextMethod` argument passed to `extend`'s second argument is the -previous value of this method, and should usually be called through to -whenever the extended method does not handle the call itself. - -Similarly, the loose parser allows plugins to register themselves via -`acorn.pluginsLoose`. The extension mechanism is the same as for the -normal parser: - -```javascript -looseParser.extend("readToken", function(nextMethod) { - return function() { - console.log("Reading a token in the loose parser!") - return nextMethod.call(this) - } -}) -``` - -There is a proof-of-concept JSX plugin in the [`acorn-jsx`](https://github.com/RReverser/acorn-jsx) project. diff --git a/node_modules/acorn/bin/acorn b/node_modules/acorn/bin/acorn deleted file mode 100755 index db07909..0000000 --- a/node_modules/acorn/bin/acorn +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env node -"use strict"; - -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)) newObj[key] = obj[key]; } } newObj["default"] = obj; return newObj; } } - -var _path = require("path"); - -var _fs = require("fs"); - -var _distAcornJs = require("../dist/acorn.js"); - -var acorn = _interopRequireWildcard(_distAcornJs); - -var infile = undefined, - forceFile = undefined, - silent = false, - compact = false, - tokenize = false; -var options = {}; - -function help(status) { - var print = status == 0 ? console.log : console.error; - print("usage: " + (0, _path.basename)(process.argv[1]) + " [--ecma3|--ecma5|--ecma6]"); - print(" [--tokenize] [--locations] [---allow-hash-bang] [--compact] [--silent] [--module] [--help] [--] [infile]"); - process.exit(status); -} - -for (var i = 2; i < process.argv.length; ++i) { - var arg = process.argv[i]; - if ((arg == "-" || arg[0] != "-") && !infile) infile = arg;else if (arg == "--" && !infile && i + 2 == process.argv.length) forceFile = infile = process.argv[++i];else if (arg == "--ecma3") options.ecmaVersion = 3;else if (arg == "--ecma5") options.ecmaVersion = 5;else if (arg == "--ecma6") options.ecmaVersion = 6;else if (arg == "--locations") options.locations = true;else if (arg == "--allow-hash-bang") options.allowHashBang = true;else if (arg == "--silent") silent = true;else if (arg == "--compact") compact = true;else if (arg == "--help") help(0);else if (arg == "--tokenize") tokenize = true;else if (arg == "--module") options.sourceType = 'module';else help(1); -} - -function run(code) { - var result = undefined; - if (!tokenize) { - try { - result = acorn.parse(code, options); - } catch (e) { - console.error(e.message);process.exit(1); - } - } else { - result = []; - var tokenizer = acorn.tokenizer(code, options), - token = undefined; - while (true) { - try { - token = tokenizer.getToken(); - } catch (e) { - console.error(e.message);process.exit(1); - } - result.push(token); - if (token.type == acorn.tokTypes.eof) break; - } - } - if (!silent) console.log(JSON.stringify(result, null, compact ? null : 2)); -} - -if (forceFile || infile && infile != "-") { - run((0, _fs.readFileSync)(infile, "utf8")); -} else { - (function () { - var code = ""; - process.stdin.resume(); - process.stdin.on("data", function (chunk) { - return code += chunk; - }); - process.stdin.on("end", function () { - return run(code); - }); - })(); -} \ No newline at end of file diff --git a/node_modules/acorn/bin/build-acorn.js b/node_modules/acorn/bin/build-acorn.js deleted file mode 100644 index 71f2cf9..0000000 --- a/node_modules/acorn/bin/build-acorn.js +++ /dev/null @@ -1,82 +0,0 @@ -var fs = require("fs"), path = require("path") -var stream = require("stream") - -var browserify = require("browserify") -var babel = require('babel-core') -var babelify = require("babelify").configure({loose: "all"}) - -process.chdir(path.resolve(__dirname, "..")) - -browserify({standalone: "acorn"}) - .plugin(require('browserify-derequire')) - .transform(babelify) - .require("./src/index.js", {entry: true}) - .bundle() - .on("error", function (err) { console.log("Error: " + err.message) }) - .pipe(fs.createWriteStream("dist/acorn.js")) - -var ACORN_PLACEHOLDER = "this_function_call_should_be_replaced_with_a_call_to_load_acorn()"; -function acornShimPrepare(file) { - var tr = new stream.Transform - if (file == path.resolve(__dirname, "../src/index.js")) { - var sent = false - tr._transform = function(chunk, _, callback) { - if (!sent) { - sent = true - callback(null, ACORN_PLACEHOLDER); - } else { - callback() - } - } - } else { - tr._transform = function(chunk, _, callback) { callback(null, chunk) } - } - return tr -} -function acornShimComplete() { - var tr = new stream.Transform - var buffer = ""; - tr._transform = function(chunk, _, callback) { - buffer += chunk.toString("utf8"); - callback(); - }; - tr._flush = function (callback) { - tr.push(buffer.replace(ACORN_PLACEHOLDER, "module.exports = typeof acorn != 'undefined' ? acorn : require(\"./acorn\")")); - callback(null); - }; - return tr; -} - -browserify({standalone: "acorn.loose"}) - .plugin(require('browserify-derequire')) - .transform(acornShimPrepare) - .transform(babelify) - .require("./src/loose/index.js", {entry: true}) - .bundle() - .on("error", function (err) { console.log("Error: " + err.message) }) - .pipe(acornShimComplete()) - .pipe(fs.createWriteStream("dist/acorn_loose.js")) - -browserify({standalone: "acorn.walk"}) - .plugin(require('browserify-derequire')) - .transform(acornShimPrepare) - .transform(babelify) - .require("./src/walk/index.js", {entry: true}) - .bundle() - .on("error", function (err) { console.log("Error: " + err.message) }) - .pipe(acornShimComplete()) - .pipe(fs.createWriteStream("dist/walk.js")) - -babel.transformFile("./src/bin/acorn.js", function (err, result) { - if (err) return console.log("Error: " + err.message) - fs.writeFile("bin/acorn", result.code, function (err) { - if (err) return console.log("Error: " + err.message) - - // Make bin/acorn executable - if (process.platform === 'win32') - return - var stat = fs.statSync("bin/acorn") - var newPerm = stat.mode | parseInt('111', 8) - fs.chmodSync("bin/acorn", newPerm) - }) -}) diff --git a/node_modules/acorn/bin/generate-identifier-regex.js b/node_modules/acorn/bin/generate-identifier-regex.js deleted file mode 100644 index 0d7c50f..0000000 --- a/node_modules/acorn/bin/generate-identifier-regex.js +++ /dev/null @@ -1,47 +0,0 @@ -// Note: run `npm install unicode-7.0.0` first. - -// Which Unicode version should be used? -var version = '7.0.0'; - -var start = require('unicode-' + version + '/properties/ID_Start/code-points') - .filter(function(ch) { return ch > 127; }); -var cont = [0x200c, 0x200d].concat(require('unicode-' + version + '/properties/ID_Continue/code-points') - .filter(function(ch) { return ch > 127 && start.indexOf(ch) == -1; })); - -function pad(str, width) { - while (str.length < width) str = "0" + str; - return str; -} - -function esc(code) { - var hex = code.toString(16); - if (hex.length <= 2) return "\\x" + pad(hex, 2); - else return "\\u" + pad(hex, 4); -} - -function generate(chars) { - var astral = [], re = ""; - for (var i = 0, at = 0x10000; i < chars.length; i++) { - var from = chars[i], to = from; - while (i < chars.length - 1 && chars[i + 1] == to + 1) { - i++; - to++; - } - if (to <= 0xffff) { - if (from == to) re += esc(from); - else if (from + 1 == to) re += esc(from) + esc(to); - else re += esc(from) + "-" + esc(to); - } else { - astral.push(from - at, to - from); - at = to; - } - } - return {nonASCII: re, astral: astral}; -} - -var startData = generate(start), contData = generate(cont); - -console.log(" var nonASCIIidentifierStartChars = \"" + startData.nonASCII + "\";"); -console.log(" var nonASCIIidentifierChars = \"" + contData.nonASCII + "\";"); -console.log(" var astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";"); -console.log(" var astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";"); diff --git a/node_modules/acorn/bin/update_authors.sh b/node_modules/acorn/bin/update_authors.sh deleted file mode 100755 index 466c8db..0000000 --- a/node_modules/acorn/bin/update_authors.sh +++ /dev/null @@ -1,6 +0,0 @@ -# Combine existing list of authors with everyone known in git, sort, add header. -tail --lines=+3 AUTHORS > AUTHORS.tmp -git log --format='%aN' | grep -v abraidwood >> AUTHORS.tmp -echo -e "List of Acorn contributors. Updated before every release.\n" > AUTHORS -sort -u AUTHORS.tmp >> AUTHORS -rm -f AUTHORS.tmp diff --git a/node_modules/acorn/dist/.keep b/node_modules/acorn/dist/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/acorn/dist/acorn.js b/node_modules/acorn/dist/acorn.js deleted file mode 100644 index 9419f86..0000000 --- a/node_modules/acorn/dist/acorn.js +++ /dev/null @@ -1,3340 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.acorn = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 6 && (prop.computed || prop.method || prop.shorthand)) return; - var key = prop.key;var name = undefined; - 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) this.raise(key.start, "Redefinition of __proto__ property"); - propHash.proto = true; - } - return; - } - name = "$" + name; - var other = propHash[name]; - if (other) { - var isGetSet = kind !== "init"; - if ((this.strict || isGetSet) && other[kind] || !(isGetSet ^ other.init)) this.raise(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.parseExpression = function (noIn, refDestructuringErrors) { - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseMaybeAssign(noIn, refDestructuringErrors); - if (this.type === _tokentype.types.comma) { - var node = this.startNodeAt(startPos, startLoc); - node.expressions = [expr]; - while (this.eat(_tokentype.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.parseMaybeAssign = function (noIn, refDestructuringErrors, afterLeftParse) { - if (this.type == _tokentype.types._yield && this.inGenerator) return this.parseYield(); - - var validateDestructuring = false; - if (!refDestructuringErrors) { - refDestructuringErrors = { shorthandAssign: 0, trailingComma: 0 }; - validateDestructuring = true; - } - var startPos = this.start, - startLoc = this.startLoc; - if (this.type == _tokentype.types.parenL || this.type == _tokentype.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) { - if (validateDestructuring) this.checkPatternErrors(refDestructuringErrors, true); - var node = this.startNodeAt(startPos, startLoc); - node.operator = this.value; - node.left = this.type === _tokentype.types.eq ? this.toAssignable(left) : left; - refDestructuringErrors.shorthandAssign = 0; // reset because shorthand default was used correctly - this.checkLVal(left); - this.next(); - node.right = this.parseMaybeAssign(noIn); - return this.finishNode(node, "AssignmentExpression"); - } else { - if (validateDestructuring) this.checkExpressionErrors(refDestructuringErrors, true); - } - return left; -}; - -// Parse a ternary conditional (`?:`) operator. - -pp.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(_tokentype.types.question)) { - var node = this.startNodeAt(startPos, startLoc); - node.test = expr; - node.consequent = this.parseMaybeAssign(); - this.expect(_tokentype.types.colon); - node.alternate = this.parseMaybeAssign(noIn); - return this.finishNode(node, "ConditionalExpression"); - } - return expr; -}; - -// Start the precedence parser. - -pp.parseExprOps = function (noIn, refDestructuringErrors) { - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseMaybeUnary(refDestructuringErrors); - if (this.checkExpressionErrors(refDestructuringErrors)) return expr; - return 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.parseExprOp = function (left, leftStartPos, leftStartLoc, minPrec, noIn) { - var prec = this.type.binop; - if (prec != null && (!noIn || this.type !== _tokentype.types._in)) { - if (prec > minPrec) { - var node = this.startNodeAt(leftStartPos, leftStartLoc); - node.left = left; - node.operator = this.value; - var op = this.type; - this.next(); - var startPos = this.start, - startLoc = this.startLoc; - node.right = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, prec, noIn); - this.finishNode(node, op === _tokentype.types.logicalOR || op === _tokentype.types.logicalAND ? "LogicalExpression" : "BinaryExpression"); - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn); - } - } - return left; -}; - -// Parse unary operators, both prefix and postfix. - -pp.parseMaybeUnary = function (refDestructuringErrors) { - if (this.type.prefix) { - var node = this.startNode(), - update = this.type === _tokentype.types.incDec; - node.operator = this.value; - node.prefix = true; - this.next(); - node.argument = this.parseMaybeUnary(); - this.checkExpressionErrors(refDestructuringErrors, true); - if (update) this.checkLVal(node.argument);else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") this.raise(node.start, "Deleting local variable in strict mode"); - return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); - } - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseExprSubscripts(refDestructuringErrors); - if (this.checkExpressionErrors(refDestructuringErrors)) return expr; - while (this.type.postfix && !this.canInsertSemicolon()) { - var node = this.startNodeAt(startPos, startLoc); - node.operator = this.value; - node.prefix = false; - node.argument = expr; - this.checkLVal(expr); - this.next(); - expr = this.finishNode(node, "UpdateExpression"); - } - return expr; -}; - -// Parse call, dot, and `[]`-subscript expressions. - -pp.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; - return this.parseSubscripts(expr, startPos, startLoc); -}; - -pp.parseSubscripts = function (base, startPos, startLoc, noCalls) { - for (;;) { - if (this.eat(_tokentype.types.dot)) { - var node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.property = this.parseIdent(true); - node.computed = false; - base = this.finishNode(node, "MemberExpression"); - } else if (this.eat(_tokentype.types.bracketL)) { - var node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.property = this.parseExpression(); - node.computed = true; - this.expect(_tokentype.types.bracketR); - base = this.finishNode(node, "MemberExpression"); - } else if (!noCalls && this.eat(_tokentype.types.parenL)) { - var node = this.startNodeAt(startPos, startLoc); - node.callee = base; - node.arguments = this.parseExprList(_tokentype.types.parenR, false); - base = this.finishNode(node, "CallExpression"); - } else if (this.type === _tokentype.types.backQuote) { - var node = this.startNodeAt(startPos, startLoc); - node.tag = base; - node.quasi = this.parseTemplate(); - base = this.finishNode(node, "TaggedTemplateExpression"); - } else { - 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.parseExprAtom = function (refDestructuringErrors) { - var node = undefined, - canBeArrow = this.potentialArrowAt == this.start; - switch (this.type) { - case _tokentype.types._super: - if (!this.inFunction) this.raise(this.start, "'super' outside of function or class"); - case _tokentype.types._this: - var type = this.type === _tokentype.types._this ? "ThisExpression" : "Super"; - node = this.startNode(); - this.next(); - return this.finishNode(node, type); - - case _tokentype.types._yield: - if (this.inGenerator) this.unexpected(); - - case _tokentype.types.name: - var startPos = this.start, - startLoc = this.startLoc; - var id = this.parseIdent(this.type !== _tokentype.types.name); - if (canBeArrow && !this.canInsertSemicolon() && this.eat(_tokentype.types.arrow)) return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id]); - return id; - - case _tokentype.types.regexp: - var value = this.value; - node = this.parseLiteral(value.value); - node.regex = { pattern: value.pattern, flags: value.flags }; - return node; - - case _tokentype.types.num:case _tokentype.types.string: - return this.parseLiteral(this.value); - - case _tokentype.types._null:case _tokentype.types._true:case _tokentype.types._false: - node = this.startNode(); - node.value = this.type === _tokentype.types._null ? null : this.type === _tokentype.types._true; - node.raw = this.type.keyword; - this.next(); - return this.finishNode(node, "Literal"); - - case _tokentype.types.parenL: - return this.parseParenAndDistinguishExpression(canBeArrow); - - case _tokentype.types.bracketL: - node = this.startNode(); - this.next(); - // check whether this is array comprehension or regular array - if (this.options.ecmaVersion >= 7 && this.type === _tokentype.types._for) { - return this.parseComprehension(node, false); - } - node.elements = this.parseExprList(_tokentype.types.bracketR, true, true, refDestructuringErrors); - return this.finishNode(node, "ArrayExpression"); - - case _tokentype.types.braceL: - return this.parseObj(false, refDestructuringErrors); - - case _tokentype.types._function: - node = this.startNode(); - this.next(); - return this.parseFunction(node, false); - - case _tokentype.types._class: - return this.parseClass(this.startNode(), false); - - case _tokentype.types._new: - return this.parseNew(); - - case _tokentype.types.backQuote: - return this.parseTemplate(); - - default: - this.unexpected(); - } -}; - -pp.parseLiteral = function (value) { - var node = this.startNode(); - node.value = value; - node.raw = this.input.slice(this.start, this.end); - this.next(); - return this.finishNode(node, "Literal"); -}; - -pp.parseParenExpression = function () { - this.expect(_tokentype.types.parenL); - var val = this.parseExpression(); - this.expect(_tokentype.types.parenR); - return val; -}; - -pp.parseParenAndDistinguishExpression = function (canBeArrow) { - var startPos = this.start, - startLoc = this.startLoc, - val = undefined; - if (this.options.ecmaVersion >= 6) { - this.next(); - - if (this.options.ecmaVersion >= 7 && this.type === _tokentype.types._for) { - return this.parseComprehension(this.startNodeAt(startPos, startLoc), true); - } - - var innerStartPos = this.start, - innerStartLoc = this.startLoc; - var exprList = [], - first = true; - var refDestructuringErrors = { shorthandAssign: 0, trailingComma: 0 }, - spreadStart = undefined, - innerParenStart = undefined; - while (this.type !== _tokentype.types.parenR) { - first ? first = false : this.expect(_tokentype.types.comma); - if (this.type === _tokentype.types.ellipsis) { - spreadStart = this.start; - exprList.push(this.parseParenItem(this.parseRest())); - break; - } else { - if (this.type === _tokentype.types.parenL && !innerParenStart) { - innerParenStart = this.start; - } - exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); - } - } - var innerEndPos = this.start, - innerEndLoc = this.startLoc; - this.expect(_tokentype.types.parenR); - - if (canBeArrow && !this.canInsertSemicolon() && this.eat(_tokentype.types.arrow)) { - this.checkPatternErrors(refDestructuringErrors, true); - if (innerParenStart) this.unexpected(innerParenStart); - return this.parseParenArrowList(startPos, startLoc, exprList); - } - - if (!exprList.length) this.unexpected(this.lastTokStart); - if (spreadStart) this.unexpected(spreadStart); - this.checkExpressionErrors(refDestructuringErrors, true); - - 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.parseParenItem = function (item) { - return item; -}; - -pp.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 = []; - -pp.parseNew = function () { - var node = this.startNode(); - var meta = this.parseIdent(true); - if (this.options.ecmaVersion >= 6 && this.eat(_tokentype.types.dot)) { - node.meta = meta; - node.property = this.parseIdent(true); - if (node.property.name !== "target") this.raise(node.property.start, "The only valid meta property for new is new.target"); - if (!this.inFunction) this.raise(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.eat(_tokentype.types.parenL)) node.arguments = this.parseExprList(_tokentype.types.parenR, false);else node.arguments = empty; - return this.finishNode(node, "NewExpression"); -}; - -// Parse template expression. - -pp.parseTemplateElement = function () { - var elem = this.startNode(); - elem.value = { - raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, '\n'), - cooked: this.value - }; - this.next(); - elem.tail = this.type === _tokentype.types.backQuote; - return this.finishNode(elem, "TemplateElement"); -}; - -pp.parseTemplate = function () { - var node = this.startNode(); - this.next(); - node.expressions = []; - var curElt = this.parseTemplateElement(); - node.quasis = [curElt]; - while (!curElt.tail) { - this.expect(_tokentype.types.dollarBraceL); - node.expressions.push(this.parseExpression()); - this.expect(_tokentype.types.braceR); - node.quasis.push(curElt = this.parseTemplateElement()); - } - this.next(); - return this.finishNode(node, "TemplateLiteral"); -}; - -// Parse an object literal or binding pattern. - -pp.parseObj = function (isPattern, refDestructuringErrors) { - var node = this.startNode(), - first = true, - propHash = {}; - node.properties = []; - this.next(); - while (!this.eat(_tokentype.types.braceR)) { - if (!first) { - this.expect(_tokentype.types.comma); - if (this.afterTrailingComma(_tokentype.types.braceR)) break; - } else first = false; - - var prop = this.startNode(), - isGenerator = undefined, - startPos = undefined, - startLoc = undefined; - 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(_tokentype.types.star); - } - this.parsePropertyName(prop); - this.parsePropertyValue(prop, isPattern, isGenerator, startPos, startLoc, refDestructuringErrors); - this.checkPropClash(prop, propHash); - node.properties.push(this.finishNode(prop, "Property")); - } - return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); -}; - -pp.parsePropertyValue = function (prop, isPattern, isGenerator, startPos, startLoc, refDestructuringErrors) { - if (this.eat(_tokentype.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 === _tokentype.types.parenL) { - if (isPattern) this.unexpected(); - prop.kind = "init"; - prop.method = true; - prop.value = this.parseMethod(isGenerator); - } else if (this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type != _tokentype.types.comma && this.type != _tokentype.types.braceR)) { - if (isGenerator || isPattern) 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.raise(start, "getter should have no params");else this.raise(start, "setter should have exactly one param"); - } - if (prop.kind === "set" && prop.value.params[0].type === "RestElement") this.raise(prop.value.params[0].start, "Setter cannot use rest params"); - } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { - prop.kind = "init"; - if (isPattern) { - if (this.keywords.test(prop.key.name) || (this.strict ? this.reservedWordsStrictBind : this.reservedWords).test(prop.key.name)) this.raise(prop.key.start, "Binding " + prop.key.name); - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); - } else if (this.type === _tokentype.types.eq && refDestructuringErrors) { - if (!refDestructuringErrors.shorthandAssign) refDestructuringErrors.shorthandAssign = this.start; - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); - } else { - prop.value = prop.key; - } - prop.shorthand = true; - } else this.unexpected(); -}; - -pp.parsePropertyName = function (prop) { - if (this.options.ecmaVersion >= 6) { - if (this.eat(_tokentype.types.bracketL)) { - prop.computed = true; - prop.key = this.parseMaybeAssign(); - this.expect(_tokentype.types.bracketR); - return prop.key; - } else { - prop.computed = false; - } - } - return prop.key = this.type === _tokentype.types.num || this.type === _tokentype.types.string ? this.parseExprAtom() : this.parseIdent(true); -}; - -// Initialize empty function node. - -pp.initFunction = function (node) { - node.id = null; - if (this.options.ecmaVersion >= 6) { - node.generator = false; - node.expression = false; - } -}; - -// Parse object or class method. - -pp.parseMethod = function (isGenerator) { - var node = this.startNode(); - this.initFunction(node); - this.expect(_tokentype.types.parenL); - node.params = this.parseBindingList(_tokentype.types.parenR, false, false); - if (this.options.ecmaVersion >= 6) node.generator = isGenerator; - this.parseFunctionBody(node, false); - return this.finishNode(node, "FunctionExpression"); -}; - -// Parse arrow function expression with given parameters. - -pp.parseArrowExpression = function (node, params) { - this.initFunction(node); - node.params = this.toAssignableList(params, true); - this.parseFunctionBody(node, true); - return this.finishNode(node, "ArrowFunctionExpression"); -}; - -// Parse function body and check parameters. - -pp.parseFunctionBody = function (node, isArrowFunction) { - var isExpression = isArrowFunction && this.type !== _tokentype.types.braceL; - - if (isExpression) { - node.body = this.parseMaybeAssign(); - node.expression = true; - } else { - // Start a new scope with regard to labels and the `inFunction` - // flag (restore them to their old value afterwards). - var oldInFunc = this.inFunction, - oldInGen = this.inGenerator, - oldLabels = this.labels; - this.inFunction = true;this.inGenerator = node.generator;this.labels = []; - node.body = this.parseBlock(true); - node.expression = false; - this.inFunction = oldInFunc;this.inGenerator = oldInGen;this.labels = oldLabels; - } - - // 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 (this.strict || !isExpression && node.body.body.length && this.isUseStrict(node.body.body[0])) { - var oldStrict = this.strict; - this.strict = true; - if (node.id) this.checkLVal(node.id, true); - this.checkParams(node); - this.strict = oldStrict; - } else if (isArrowFunction) { - this.checkParams(node); - } -}; - -// Checks function params for various disallowed patterns such as using "eval" -// or "arguments" and duplicate parameters. - -pp.checkParams = function (node) { - var nameHash = {}; - for (var i = 0; i < node.params.length; i++) { - this.checkLVal(node.params[i], true, 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.parseExprList = function (close, allowTrailingComma, allowEmpty, refDestructuringErrors) { - var elts = [], - first = true; - while (!this.eat(close)) { - if (!first) { - this.expect(_tokentype.types.comma); - if (this.type === close && refDestructuringErrors && !refDestructuringErrors.trailingComma) { - refDestructuringErrors.trailingComma = this.lastTokStart; - } - if (allowTrailingComma && this.afterTrailingComma(close)) break; - } else first = false; - - var elt = undefined; - if (allowEmpty && this.type === _tokentype.types.comma) elt = null;else if (this.type === _tokentype.types.ellipsis) elt = this.parseSpread(refDestructuringErrors);else elt = this.parseMaybeAssign(false, refDestructuringErrors); - elts.push(elt); - } - return elts; -}; - -// Parse the next token as an identifier. If `liberal` is true (used -// when parsing properties), it will also convert keywords into -// identifiers. - -pp.parseIdent = function (liberal) { - var node = this.startNode(); - if (liberal && this.options.allowReserved == "never") liberal = false; - if (this.type === _tokentype.types.name) { - if (!liberal && (this.strict ? this.reservedWordsStrict : this.reservedWords).test(this.value) && (this.options.ecmaVersion >= 6 || this.input.slice(this.start, this.end).indexOf("\\") == -1)) this.raise(this.start, "The keyword '" + this.value + "' is reserved"); - node.name = this.value; - } else if (liberal && this.type.keyword) { - node.name = this.type.keyword; - } else { - this.unexpected(); - } - this.next(); - return this.finishNode(node, "Identifier"); -}; - -// Parses yield expression inside generator. - -pp.parseYield = function () { - var node = this.startNode(); - this.next(); - if (this.type == _tokentype.types.semi || this.canInsertSemicolon() || this.type != _tokentype.types.star && !this.type.startsExpr) { - node.delegate = false; - node.argument = null; - } else { - node.delegate = this.eat(_tokentype.types.star); - node.argument = this.parseMaybeAssign(); - } - return this.finishNode(node, "YieldExpression"); -}; - -// Parses array and generator comprehensions. - -pp.parseComprehension = function (node, isGenerator) { - node.blocks = []; - while (this.type === _tokentype.types._for) { - var block = this.startNode(); - this.next(); - this.expect(_tokentype.types.parenL); - block.left = this.parseBindingAtom(); - this.checkLVal(block.left, true); - this.expectContextual("of"); - block.right = this.parseExpression(); - this.expect(_tokentype.types.parenR); - node.blocks.push(this.finishNode(block, "ComprehensionBlock")); - } - node.filter = this.eat(_tokentype.types._if) ? this.parseParenExpression() : null; - node.body = this.parseExpression(); - this.expect(isGenerator ? _tokentype.types.parenR : _tokentype.types.bracketR); - node.generator = isGenerator; - return this.finishNode(node, "ComprehensionExpression"); -}; - -},{"./state":10,"./tokentype":14}],2:[function(_dereq_,module,exports){ -// This is a trick taken from Esprima. It turns out that, on -// non-Chrome browsers, to check whether a string is in a set, a -// predicate containing a big ugly `switch` statement is faster than -// a regular expression, and on Chrome the two are about on par. -// This function uses `eval` (non-lexical) to produce such a -// predicate from a space-separated string of words. -// -// It starts by sorting the words by length. - -// Reserved word lists for various dialects of the language - -"use strict"; - -exports.__esModule = true; -exports.isIdentifierStart = isIdentifierStart; -exports.isIdentifierChar = isIdentifierChar; -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" -}; - -exports.reservedWords = reservedWords; -// 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, - 6: ecma5AndLessKeywords + " let const class extends export import yield super" -}; - -exports.keywords = keywords; -// ## 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 = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ"; -var nonASCIIidentifierChars = "‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︭︳︴﹍-﹏0-9_"; - -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 tools/generate-identifier-regex.js -var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 17, 26, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 99, 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, 98, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 955, 52, 76, 44, 33, 24, 27, 35, 42, 34, 4, 0, 13, 47, 15, 3, 22, 0, 38, 17, 2, 24, 133, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 32, 4, 287, 47, 21, 1, 2, 0, 185, 46, 82, 47, 21, 0, 60, 42, 502, 63, 32, 0, 449, 56, 1288, 920, 104, 110, 2962, 1070, 13266, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 881, 68, 12, 0, 67, 12, 16481, 1, 3071, 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, 4149, 196, 1340, 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, 16355, 541]; -var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 1306, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 52, 0, 13, 2, 49, 13, 16, 9, 83, 11, 168, 11, 6, 9, 8, 2, 57, 0, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 316, 19, 13, 9, 214, 6, 3, 8, 112, 16, 16, 9, 82, 12, 9, 9, 535, 9, 20855, 9, 135, 4, 60, 6, 26, 9, 1016, 45, 17, 3, 19723, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 4305, 6, 792618, 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); -} - -},{}],3:[function(_dereq_,module,exports){ -// Acorn is a tiny, fast JavaScript parser written in JavaScript. -// -// Acorn was written by Marijn Haverbeke, Ingvar Stepanyan, and -// various contributors and released under an MIT license. -// -// Git repositories for Acorn are available at -// -// http://marijnhaverbeke.nl/git/acorn -// https://github.com/ternjs/acorn.git -// -// Please use the [github bug tracker][ghbt] to report issues. -// -// [ghbt]: https://github.com/ternjs/acorn/issues -// -// This file defines the main parser interface. The library also comes -// with a [error-tolerant parser][dammit] and an -// [abstract syntax tree walker][walk], defined in other files. -// -// [dammit]: acorn_loose.js -// [walk]: util/walk.js - -"use strict"; - -exports.__esModule = true; -exports.parse = parse; -exports.parseExpressionAt = parseExpressionAt; -exports.tokenizer = tokenizer; - -var _state = _dereq_("./state"); - -_dereq_("./parseutil"); - -_dereq_("./statement"); - -_dereq_("./lval"); - -_dereq_("./expression"); - -_dereq_("./location"); - -exports.Parser = _state.Parser; -exports.plugins = _state.plugins; - -var _options = _dereq_("./options"); - -exports.defaultOptions = _options.defaultOptions; - -var _locutil = _dereq_("./locutil"); - -exports.Position = _locutil.Position; -exports.SourceLocation = _locutil.SourceLocation; -exports.getLineInfo = _locutil.getLineInfo; - -var _node = _dereq_("./node"); - -exports.Node = _node.Node; - -var _tokentype = _dereq_("./tokentype"); - -exports.TokenType = _tokentype.TokenType; -exports.tokTypes = _tokentype.types; - -var _tokencontext = _dereq_("./tokencontext"); - -exports.TokContext = _tokencontext.TokContext; -exports.tokContexts = _tokencontext.types; - -var _identifier = _dereq_("./identifier"); - -exports.isIdentifierChar = _identifier.isIdentifierChar; -exports.isIdentifierStart = _identifier.isIdentifierStart; - -var _tokenize = _dereq_("./tokenize"); - -exports.Token = _tokenize.Token; - -var _whitespace = _dereq_("./whitespace"); - -exports.isNewLine = _whitespace.isNewLine; -exports.lineBreak = _whitespace.lineBreak; -exports.lineBreakG = _whitespace.lineBreakG; -var version = "2.7.0"; - -exports.version = version; -// The main exported interface (under `self.acorn` when in the -// browser) is a `parse` function that takes a code string and -// returns an abstract syntax tree as specified by [Mozilla parser -// API][api]. -// -// [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - -function parse(input, options) { - return new _state.Parser(options, input).parse(); -} - -// This function tries to parse a single expression at a given -// offset in a string. Useful for parsing mixed-language formats -// that embed JavaScript expressions. - -function parseExpressionAt(input, pos, options) { - var p = new _state.Parser(options, input, pos); - p.nextToken(); - return p.parseExpression(); -} - -// Acorn is organized as a tokenizer and a recursive-descent parser. -// The `tokenizer` export provides an interface to the tokenizer. - -function tokenizer(input, options) { - return new _state.Parser(options, input); -} - -},{"./expression":1,"./identifier":2,"./location":4,"./locutil":5,"./lval":6,"./node":7,"./options":8,"./parseutil":9,"./state":10,"./statement":11,"./tokencontext":12,"./tokenize":13,"./tokentype":14,"./whitespace":16}],4:[function(_dereq_,module,exports){ -"use strict"; - -var _state = _dereq_("./state"); - -var _locutil = _dereq_("./locutil"); - -var pp = _state.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.raise = function (pos, message) { - var loc = _locutil.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.curPosition = function () { - if (this.options.locations) { - return new _locutil.Position(this.curLine, this.pos - this.lineStart); - } -}; - -},{"./locutil":5,"./state":10}],5:[function(_dereq_,module,exports){ -"use strict"; - -exports.__esModule = true; -exports.getLineInfo = getLineInfo; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var _whitespace = _dereq_("./whitespace"); - -// These are used when `options.locations` is on, for the -// `startLoc` and `endLoc` properties. - -var Position = (function () { - function Position(line, col) { - _classCallCheck(this, Position); - - this.line = line; - this.column = col; - } - - Position.prototype.offset = function offset(n) { - return new Position(this.line, this.column + n); - }; - - return Position; -})(); - -exports.Position = Position; - -var SourceLocation = function SourceLocation(p, start, end) { - _classCallCheck(this, SourceLocation); - - 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. - -; - -exports.SourceLocation = SourceLocation; - -function getLineInfo(input, offset) { - for (var line = 1, cur = 0;;) { - _whitespace.lineBreakG.lastIndex = cur; - var match = _whitespace.lineBreakG.exec(input); - if (match && match.index < offset) { - ++line; - cur = match.index + match[0].length; - } else { - return new Position(line, offset - cur); - } - } -} - -},{"./whitespace":16}],6:[function(_dereq_,module,exports){ -"use strict"; - -var _tokentype = _dereq_("./tokentype"); - -var _state = _dereq_("./state"); - -var _util = _dereq_("./util"); - -var pp = _state.Parser.prototype; - -// Convert existing expression atom to assignable pattern -// if possible. - -pp.toAssignable = function (node, isBinding) { - if (this.options.ecmaVersion >= 6 && node) { - switch (node.type) { - case "Identifier": - case "ObjectPattern": - case "ArrayPattern": - break; - - case "ObjectExpression": - node.type = "ObjectPattern"; - for (var i = 0; i < node.properties.length; i++) { - var prop = node.properties[i]; - if (prop.kind !== "init") this.raise(prop.key.start, "Object pattern can't contain getter or setter"); - this.toAssignable(prop.value, isBinding); - } - break; - - case "ArrayExpression": - node.type = "ArrayPattern"; - this.toAssignableList(node.elements, isBinding); - break; - - case "AssignmentExpression": - if (node.operator === "=") { - node.type = "AssignmentPattern"; - delete node.operator; - // falls through to AssignmentPattern - } else { - this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); - break; - } - - case "AssignmentPattern": - if (node.right.type === "YieldExpression") this.raise(node.right.start, "Yield expression cannot be a default value"); - break; - - case "ParenthesizedExpression": - node.expression = this.toAssignable(node.expression, isBinding); - break; - - case "MemberExpression": - if (!isBinding) break; - - default: - this.raise(node.start, "Assigning to rvalue"); - } - } - return node; -}; - -// Convert list of expression atoms to binding list. - -pp.toAssignableList = function (exprList, isBinding) { - var end = exprList.length; - if (end) { - var last = exprList[end - 1]; - if (last && last.type == "RestElement") { - --end; - } else if (last && last.type == "SpreadElement") { - last.type = "RestElement"; - var arg = last.argument; - this.toAssignable(arg, isBinding); - if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern") this.unexpected(arg.start); - --end; - } - - if (isBinding && last.type === "RestElement" && last.argument.type !== "Identifier") this.unexpected(last.argument.start); - } - for (var i = 0; i < end; i++) { - var elt = exprList[i]; - if (elt) this.toAssignable(elt, isBinding); - } - return exprList; -}; - -// Parses spread element. - -pp.parseSpread = function (refDestructuringErrors) { - var node = this.startNode(); - this.next(); - node.argument = this.parseMaybeAssign(refDestructuringErrors); - return this.finishNode(node, "SpreadElement"); -}; - -pp.parseRest = function (allowNonIdent) { - var node = this.startNode(); - this.next(); - - // RestElement inside of a function parameter must be an identifier - if (allowNonIdent) node.argument = this.type === _tokentype.types.name ? this.parseIdent() : this.unexpected();else node.argument = this.type === _tokentype.types.name || this.type === _tokentype.types.bracketL ? this.parseBindingAtom() : this.unexpected(); - - return this.finishNode(node, "RestElement"); -}; - -// Parses lvalue (assignable) atom. - -pp.parseBindingAtom = function () { - if (this.options.ecmaVersion < 6) return this.parseIdent(); - switch (this.type) { - case _tokentype.types.name: - return this.parseIdent(); - - case _tokentype.types.bracketL: - var node = this.startNode(); - this.next(); - node.elements = this.parseBindingList(_tokentype.types.bracketR, true, true); - return this.finishNode(node, "ArrayPattern"); - - case _tokentype.types.braceL: - return this.parseObj(true); - - default: - this.unexpected(); - } -}; - -pp.parseBindingList = function (close, allowEmpty, allowTrailingComma, allowNonIdent) { - var elts = [], - first = true; - while (!this.eat(close)) { - if (first) first = false;else this.expect(_tokentype.types.comma); - if (allowEmpty && this.type === _tokentype.types.comma) { - elts.push(null); - } else if (allowTrailingComma && this.afterTrailingComma(close)) { - break; - } else if (this.type === _tokentype.types.ellipsis) { - var rest = this.parseRest(allowNonIdent); - this.parseBindingListItem(rest); - elts.push(rest); - this.expect(close); - break; - } else { - var elem = this.parseMaybeDefault(this.start, this.startLoc); - this.parseBindingListItem(elem); - elts.push(elem); - } - } - return elts; -}; - -pp.parseBindingListItem = function (param) { - return param; -}; - -// Parses assignment pattern around given atom if possible. - -pp.parseMaybeDefault = function (startPos, startLoc, left) { - left = left || this.parseBindingAtom(); - if (this.options.ecmaVersion < 6 || !this.eat(_tokentype.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. - -pp.checkLVal = function (expr, isBinding, checkClashes) { - switch (expr.type) { - case "Identifier": - if (this.strict && this.reservedWordsStrictBind.test(expr.name)) this.raise(expr.start, (isBinding ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); - if (checkClashes) { - if (_util.has(checkClashes, expr.name)) this.raise(expr.start, "Argument name clash"); - checkClashes[expr.name] = true; - } - break; - - case "MemberExpression": - if (isBinding) this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression"); - break; - - case "ObjectPattern": - for (var i = 0; i < expr.properties.length; i++) { - this.checkLVal(expr.properties[i].value, isBinding, checkClashes); - }break; - - case "ArrayPattern": - for (var i = 0; i < expr.elements.length; i++) { - var elem = expr.elements[i]; - if (elem) this.checkLVal(elem, isBinding, checkClashes); - } - break; - - case "AssignmentPattern": - this.checkLVal(expr.left, isBinding, checkClashes); - break; - - case "RestElement": - this.checkLVal(expr.argument, isBinding, checkClashes); - break; - - case "ParenthesizedExpression": - this.checkLVal(expr.expression, isBinding, checkClashes); - break; - - default: - this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " rvalue"); - } -}; - -},{"./state":10,"./tokentype":14,"./util":15}],7:[function(_dereq_,module,exports){ -"use strict"; - -exports.__esModule = true; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var _state = _dereq_("./state"); - -var _locutil = _dereq_("./locutil"); - -var Node = function Node(parser, pos, loc) { - _classCallCheck(this, Node); - - this.type = ""; - this.start = pos; - this.end = 0; - if (parser.options.locations) this.loc = new _locutil.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. - -; - -exports.Node = Node; -var pp = _state.Parser.prototype; - -pp.startNode = function () { - return new Node(this, this.start, this.startLoc); -}; - -pp.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.finishNode = function (node, type) { - return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc); -}; - -// Finish node at given position - -pp.finishNodeAt = function (node, type, pos, loc) { - return finishNodeAt.call(this, node, type, pos, loc); -}; - -},{"./locutil":5,"./state":10}],8:[function(_dereq_,module,exports){ -"use strict"; - -exports.__esModule = true; -exports.getOptions = getOptions; - -var _util = _dereq_("./util"); - -var _locutil = _dereq_("./locutil"); - -// 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, or 5, or 6. This influences support for strict - // mode, the set of reserved words, support for getters and - // setters and other features. - ecmaVersion: 5, - // Source type ("script" or "module") for different semantics - sourceType: "script", - // `onInsertedSemicolon` can be a callback that will be called - // when a semicolon is automatically inserted. It will be passed - // th 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, 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, - plugins: {} -}; - -exports.defaultOptions = defaultOptions; -// Interpret and default an options object - -function getOptions(opts) { - var options = {}; - for (var opt in defaultOptions) { - options[opt] = opts && _util.has(opts, opt) ? opts[opt] : defaultOptions[opt]; - }if (options.allowReserved == null) options.allowReserved = options.ecmaVersion < 5; - - if (_util.isArray(options.onToken)) { - (function () { - var tokens = options.onToken; - options.onToken = function (token) { - return tokens.push(token); - }; - })(); - } - if (_util.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 _locutil.SourceLocation(this, startLoc, endLoc); - if (options.ranges) comment.range = [start, end]; - array.push(comment); - }; -} - -},{"./locutil":5,"./util":15}],9:[function(_dereq_,module,exports){ -"use strict"; - -var _tokentype = _dereq_("./tokentype"); - -var _state = _dereq_("./state"); - -var _whitespace = _dereq_("./whitespace"); - -var pp = _state.Parser.prototype; - -// ## Parser utilities - -// Test whether a statement node is the string literal `"use strict"`. - -pp.isUseStrict = function (stmt) { - return this.options.ecmaVersion >= 5 && stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && stmt.expression.raw.slice(1, -1) === "use strict"; -}; - -// 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 === _tokentype.types.name && this.value === name; -}; - -// Consumes contextual keyword if possible. - -pp.eatContextual = function (name) { - return this.value === name && this.eat(_tokentype.types.name); -}; - -// 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 === _tokentype.types.eof || this.type === _tokentype.types.braceR || _whitespace.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(_tokentype.types.semi) && !this.insertSemicolon()) this.unexpected(); -}; - -pp.afterTrailingComma = function (tokType) { - if (this.type == tokType) { - if (this.options.onTrailingComma) this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); - 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"); -}; - -pp.checkPatternErrors = function (refDestructuringErrors, andThrow) { - var pos = refDestructuringErrors && refDestructuringErrors.trailingComma; - if (!andThrow) return !!pos; - if (pos) this.raise(pos, "Trailing comma is not permitted in destructuring patterns"); -}; - -pp.checkExpressionErrors = function (refDestructuringErrors, andThrow) { - var pos = refDestructuringErrors && refDestructuringErrors.shorthandAssign; - if (!andThrow) return !!pos; - if (pos) this.raise(pos, "Shorthand property assignments are valid only in destructuring patterns"); -}; - -},{"./state":10,"./tokentype":14,"./whitespace":16}],10:[function(_dereq_,module,exports){ -"use strict"; - -exports.__esModule = true; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var _identifier = _dereq_("./identifier"); - -var _tokentype = _dereq_("./tokentype"); - -var _whitespace = _dereq_("./whitespace"); - -var _options = _dereq_("./options"); - -// Registered plugins -var plugins = {}; - -exports.plugins = plugins; -function keywordRegexp(words) { - return new RegExp("^(" + words.replace(/ /g, "|") + ")$"); -} - -var Parser = (function () { - function Parser(options, input, startPos) { - _classCallCheck(this, Parser); - - this.options = options = _options.getOptions(options); - this.sourceFile = options.sourceFile; - this.keywords = keywordRegexp(_identifier.keywords[options.ecmaVersion >= 6 ? 6 : 5]); - var reserved = options.allowReserved ? "" : _identifier.reservedWords[options.ecmaVersion] + (options.sourceType == "module" ? " await" : ""); - this.reservedWords = keywordRegexp(reserved); - var reservedStrict = (reserved ? reserved + " " : "") + _identifier.reservedWords.strict; - this.reservedWordsStrict = keywordRegexp(reservedStrict); - this.reservedWordsStrictBind = keywordRegexp(reservedStrict + " " + _identifier.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; - - // Load plugins - this.loadPlugins(options.plugins); - - // Set up token state - - // The current position of the tokenizer in the input. - if (startPos) { - this.pos = startPos; - this.lineStart = Math.max(0, this.input.lastIndexOf("\n", startPos)); - this.curLine = this.input.slice(0, this.lineStart).split(_whitespace.lineBreak).length; - } else { - this.pos = this.lineStart = 0; - this.curLine = 1; - } - - // Properties of the current token: - // Its type - this.type = _tokentype.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.strict = this.inModule = options.sourceType === "module"; - - // Used to signify the start of a potential arrow function - this.potentialArrowAt = -1; - - // Flags to track whether we are in a function, a generator. - this.inFunction = this.inGenerator = false; - // Labels in scope. - this.labels = []; - - // If enabled, skip leading hashbang line. - if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === '#!') this.skipLineComment(2); - } - - // DEPRECATED Kept for backwards compatibility until 3.0 in case a plugin uses them - - Parser.prototype.isKeyword = function isKeyword(word) { - return this.keywords.test(word); - }; - - Parser.prototype.isReservedWord = function isReservedWord(word) { - return this.reservedWords.test(word); - }; - - Parser.prototype.extend = function extend(name, f) { - this[name] = f(this[name]); - }; - - Parser.prototype.loadPlugins = function loadPlugins(pluginConfigs) { - for (var _name in pluginConfigs) { - var plugin = plugins[_name]; - if (!plugin) throw new Error("Plugin '" + _name + "' not found"); - plugin(this, pluginConfigs[_name]); - } - }; - - Parser.prototype.parse = function parse() { - var node = this.options.program || this.startNode(); - this.nextToken(); - return this.parseTopLevel(node); - }; - - return Parser; -})(); - -exports.Parser = Parser; - -},{"./identifier":2,"./options":8,"./tokentype":14,"./whitespace":16}],11:[function(_dereq_,module,exports){ -"use strict"; - -var _tokentype = _dereq_("./tokentype"); - -var _state = _dereq_("./state"); - -var _whitespace = _dereq_("./whitespace"); - -var pp = _state.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.parseTopLevel = function (node) { - var first = true; - if (!node.body) node.body = []; - while (this.type !== _tokentype.types.eof) { - var stmt = this.parseStatement(true, true); - node.body.push(stmt); - if (first) { - if (this.isUseStrict(stmt)) this.setStrict(true); - first = false; - } - } - this.next(); - if (this.options.ecmaVersion >= 6) { - node.sourceType = this.options.sourceType; - } - return this.finishNode(node, "Program"); -}; - -var loopLabel = { kind: "loop" }, - switchLabel = { kind: "switch" }; - -// 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.parseStatement = function (declaration, topLevel) { - var starttype = this.type, - node = this.startNode(); - - // 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 _tokentype.types._break:case _tokentype.types._continue: - return this.parseBreakContinueStatement(node, starttype.keyword); - case _tokentype.types._debugger: - return this.parseDebuggerStatement(node); - case _tokentype.types._do: - return this.parseDoStatement(node); - case _tokentype.types._for: - return this.parseForStatement(node); - case _tokentype.types._function: - if (!declaration && this.options.ecmaVersion >= 6) this.unexpected(); - return this.parseFunctionStatement(node); - case _tokentype.types._class: - if (!declaration) this.unexpected(); - return this.parseClass(node, true); - case _tokentype.types._if: - return this.parseIfStatement(node); - case _tokentype.types._return: - return this.parseReturnStatement(node); - case _tokentype.types._switch: - return this.parseSwitchStatement(node); - case _tokentype.types._throw: - return this.parseThrowStatement(node); - case _tokentype.types._try: - return this.parseTryStatement(node); - case _tokentype.types._let:case _tokentype.types._const: - if (!declaration) this.unexpected(); // NOTE: falls through to _var - case _tokentype.types._var: - return this.parseVarStatement(node, starttype); - case _tokentype.types._while: - return this.parseWhileStatement(node); - case _tokentype.types._with: - return this.parseWithStatement(node); - case _tokentype.types.braceL: - return this.parseBlock(); - case _tokentype.types.semi: - return this.parseEmptyStatement(node); - case _tokentype.types._export: - case _tokentype.types._import: - 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 === _tokentype.types._import ? this.parseImport(node) : this.parseExport(node); - - // 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: - var maybeName = this.value, - expr = this.parseExpression(); - if (starttype === _tokentype.types.name && expr.type === "Identifier" && this.eat(_tokentype.types.colon)) return this.parseLabeledStatement(node, maybeName, expr);else return this.parseExpressionStatement(node, expr); - } -}; - -pp.parseBreakContinueStatement = function (node, keyword) { - var isBreak = keyword == "break"; - this.next(); - if (this.eat(_tokentype.types.semi) || this.insertSemicolon()) node.label = null;else if (this.type !== _tokentype.types.name) this.unexpected();else { - node.label = this.parseIdent(); - this.semicolon(); - } - - // Verify that there is an actual destination to break or - // continue to. - for (var i = 0; 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.parseDebuggerStatement = function (node) { - this.next(); - this.semicolon(); - return this.finishNode(node, "DebuggerStatement"); -}; - -pp.parseDoStatement = function (node) { - this.next(); - this.labels.push(loopLabel); - node.body = this.parseStatement(false); - this.labels.pop(); - this.expect(_tokentype.types._while); - node.test = this.parseParenExpression(); - if (this.options.ecmaVersion >= 6) this.eat(_tokentype.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.parseForStatement = function (node) { - this.next(); - this.labels.push(loopLabel); - this.expect(_tokentype.types.parenL); - if (this.type === _tokentype.types.semi) return this.parseFor(node, null); - if (this.type === _tokentype.types._var || this.type === _tokentype.types._let || this.type === _tokentype.types._const) { - var _init = this.startNode(), - varKind = this.type; - this.next(); - this.parseVar(_init, true, varKind); - this.finishNode(_init, "VariableDeclaration"); - if ((this.type === _tokentype.types._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && _init.declarations.length === 1 && !(varKind !== _tokentype.types._var && _init.declarations[0].init)) return this.parseForIn(node, _init); - return this.parseFor(node, _init); - } - var refDestructuringErrors = { shorthandAssign: 0, trailingComma: 0 }; - var init = this.parseExpression(true, refDestructuringErrors); - if (this.type === _tokentype.types._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) { - this.checkPatternErrors(refDestructuringErrors, true); - this.toAssignable(init); - this.checkLVal(init); - return this.parseForIn(node, init); - } else { - this.checkExpressionErrors(refDestructuringErrors, true); - } - return this.parseFor(node, init); -}; - -pp.parseFunctionStatement = function (node) { - this.next(); - return this.parseFunction(node, true); -}; - -pp.parseIfStatement = function (node) { - this.next(); - node.test = this.parseParenExpression(); - node.consequent = this.parseStatement(false); - node.alternate = this.eat(_tokentype.types._else) ? this.parseStatement(false) : null; - return this.finishNode(node, "IfStatement"); -}; - -pp.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(_tokentype.types.semi) || this.insertSemicolon()) node.argument = null;else { - node.argument = this.parseExpression();this.semicolon(); - } - return this.finishNode(node, "ReturnStatement"); -}; - -pp.parseSwitchStatement = function (node) { - this.next(); - node.discriminant = this.parseParenExpression(); - node.cases = []; - this.expect(_tokentype.types.braceL); - this.labels.push(switchLabel); - - // Statements under must be grouped (by label) in SwitchCase - // nodes. `cur` is used to keep the node that we are currently - // adding statements to. - - for (var cur, sawDefault = false; this.type != _tokentype.types.braceR;) { - if (this.type === _tokentype.types._case || this.type === _tokentype.types._default) { - var isCase = this.type === _tokentype.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.raise(this.lastTokStart, "Multiple default clauses"); - sawDefault = true; - cur.test = null; - } - this.expect(_tokentype.types.colon); - } else { - if (!cur) this.unexpected(); - cur.consequent.push(this.parseStatement(true)); - } - } - if (cur) this.finishNode(cur, "SwitchCase"); - this.next(); // Closing brace - this.labels.pop(); - return this.finishNode(node, "SwitchStatement"); -}; - -pp.parseThrowStatement = function (node) { - this.next(); - if (_whitespace.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.parseTryStatement = function (node) { - this.next(); - node.block = this.parseBlock(); - node.handler = null; - if (this.type === _tokentype.types._catch) { - var clause = this.startNode(); - this.next(); - this.expect(_tokentype.types.parenL); - clause.param = this.parseBindingAtom(); - this.checkLVal(clause.param, true); - this.expect(_tokentype.types.parenR); - clause.body = this.parseBlock(); - node.handler = this.finishNode(clause, "CatchClause"); - } - node.finalizer = this.eat(_tokentype.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.parseVarStatement = function (node, kind) { - this.next(); - this.parseVar(node, false, kind); - this.semicolon(); - return this.finishNode(node, "VariableDeclaration"); -}; - -pp.parseWhileStatement = function (node) { - this.next(); - node.test = this.parseParenExpression(); - this.labels.push(loopLabel); - node.body = this.parseStatement(false); - this.labels.pop(); - return this.finishNode(node, "WhileStatement"); -}; - -pp.parseWithStatement = function (node) { - if (this.strict) this.raise(this.start, "'with' in strict mode"); - this.next(); - node.object = this.parseParenExpression(); - node.body = this.parseStatement(false); - return this.finishNode(node, "WithStatement"); -}; - -pp.parseEmptyStatement = function (node) { - this.next(); - return this.finishNode(node, "EmptyStatement"); -}; - -pp.parseLabeledStatement = function (node, maybeName, expr) { - for (var i = 0; i < this.labels.length; ++i) { - if (this.labels[i].name === maybeName) this.raise(expr.start, "Label '" + maybeName + "' is already declared"); - }var kind = this.type.isLoop ? "loop" : this.type === _tokentype.types._switch ? "switch" : null; - for (var i = this.labels.length - 1; i >= 0; i--) { - var label = this.labels[i]; - if (label.statementStart == node.start) { - label.statementStart = this.start; - label.kind = kind; - } else break; - } - this.labels.push({ name: maybeName, kind: kind, statementStart: this.start }); - node.body = this.parseStatement(true); - this.labels.pop(); - node.label = expr; - return this.finishNode(node, "LabeledStatement"); -}; - -pp.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.parseBlock = function (allowStrict) { - var node = this.startNode(), - first = true, - oldStrict = undefined; - node.body = []; - this.expect(_tokentype.types.braceL); - while (!this.eat(_tokentype.types.braceR)) { - var stmt = this.parseStatement(true); - node.body.push(stmt); - if (first && allowStrict && this.isUseStrict(stmt)) { - oldStrict = this.strict; - this.setStrict(this.strict = true); - } - first = false; - } - if (oldStrict === false) this.setStrict(false); - 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.parseFor = function (node, init) { - node.init = init; - this.expect(_tokentype.types.semi); - node.test = this.type === _tokentype.types.semi ? null : this.parseExpression(); - this.expect(_tokentype.types.semi); - node.update = this.type === _tokentype.types.parenR ? null : this.parseExpression(); - this.expect(_tokentype.types.parenR); - node.body = this.parseStatement(false); - 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.parseForIn = function (node, init) { - var type = this.type === _tokentype.types._in ? "ForInStatement" : "ForOfStatement"; - this.next(); - node.left = init; - node.right = this.parseExpression(); - this.expect(_tokentype.types.parenR); - node.body = this.parseStatement(false); - this.labels.pop(); - return this.finishNode(node, type); -}; - -// Parse a list of variable declarations. - -pp.parseVar = function (node, isFor, kind) { - node.declarations = []; - node.kind = kind.keyword; - for (;;) { - var decl = this.startNode(); - this.parseVarId(decl); - if (this.eat(_tokentype.types.eq)) { - decl.init = this.parseMaybeAssign(isFor); - } else if (kind === _tokentype.types._const && !(this.type === _tokentype.types._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) { - this.unexpected(); - } else if (decl.id.type != "Identifier" && !(isFor && (this.type === _tokentype.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(_tokentype.types.comma)) break; - } - return node; -}; - -pp.parseVarId = function (decl) { - decl.id = this.parseBindingAtom(); - this.checkLVal(decl.id, true); -}; - -// Parse a function declaration or literal (depending on the -// `isStatement` parameter). - -pp.parseFunction = function (node, isStatement, allowExpressionBody) { - this.initFunction(node); - if (this.options.ecmaVersion >= 6) node.generator = this.eat(_tokentype.types.star); - if (isStatement || this.type === _tokentype.types.name) node.id = this.parseIdent(); - this.parseFunctionParams(node); - this.parseFunctionBody(node, allowExpressionBody); - return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); -}; - -pp.parseFunctionParams = function (node) { - this.expect(_tokentype.types.parenL); - node.params = this.parseBindingList(_tokentype.types.parenR, false, false, true); -}; - -// Parse a class declaration or literal (depending on the -// `isStatement` parameter). - -pp.parseClass = function (node, isStatement) { - this.next(); - this.parseClassId(node, isStatement); - this.parseClassSuper(node); - var classBody = this.startNode(); - var hadConstructor = false; - classBody.body = []; - this.expect(_tokentype.types.braceL); - while (!this.eat(_tokentype.types.braceR)) { - if (this.eat(_tokentype.types.semi)) continue; - var method = this.startNode(); - var isGenerator = this.eat(_tokentype.types.star); - var isMaybeStatic = this.type === _tokentype.types.name && this.value === "static"; - this.parsePropertyName(method); - method["static"] = isMaybeStatic && this.type !== _tokentype.types.parenL; - if (method["static"]) { - if (isGenerator) this.unexpected(); - isGenerator = this.eat(_tokentype.types.star); - this.parsePropertyName(method); - } - method.kind = "method"; - var isGetSet = false; - if (!method.computed) { - var key = method.key; - - if (!isGenerator && key.type === "Identifier" && this.type !== _tokentype.types.parenL && (key.name === "get" || key.name === "set")) { - isGetSet = true; - method.kind = key.name; - key = this.parsePropertyName(method); - } - if (!method["static"] && (key.type === "Identifier" && key.name === "constructor" || key.type === "Literal" && key.value === "constructor")) { - if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class"); - if (isGetSet) this.raise(key.start, "Constructor can't have get/set modifier"); - if (isGenerator) this.raise(key.start, "Constructor can't be a generator"); - method.kind = "constructor"; - hadConstructor = true; - } - } - this.parseClassMethod(classBody, method, isGenerator); - if (isGetSet) { - var paramCount = method.kind === "get" ? 0 : 1; - if (method.value.params.length !== paramCount) { - var start = method.value.start; - if (method.kind === "get") this.raise(start, "getter should have no params");else this.raise(start, "setter should have exactly one param"); - } - if (method.kind === "set" && method.value.params[0].type === "RestElement") this.raise(method.value.params[0].start, "Setter cannot use rest params"); - } - } - node.body = this.finishNode(classBody, "ClassBody"); - return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); -}; - -pp.parseClassMethod = function (classBody, method, isGenerator) { - method.value = this.parseMethod(isGenerator); - classBody.body.push(this.finishNode(method, "MethodDefinition")); -}; - -pp.parseClassId = function (node, isStatement) { - node.id = this.type === _tokentype.types.name ? this.parseIdent() : isStatement ? this.unexpected() : null; -}; - -pp.parseClassSuper = function (node) { - node.superClass = this.eat(_tokentype.types._extends) ? this.parseExprSubscripts() : null; -}; - -// Parses module export declaration. - -pp.parseExport = function (node) { - this.next(); - // export * from '...' - if (this.eat(_tokentype.types.star)) { - this.expectContextual("from"); - node.source = this.type === _tokentype.types.string ? this.parseExprAtom() : this.unexpected(); - this.semicolon(); - return this.finishNode(node, "ExportAllDeclaration"); - } - if (this.eat(_tokentype.types._default)) { - // export default ... - var expr = this.parseMaybeAssign(); - var needsSemi = true; - if (expr.type == "FunctionExpression" || expr.type == "ClassExpression") { - needsSemi = false; - if (expr.id) { - expr.type = expr.type == "FunctionExpression" ? "FunctionDeclaration" : "ClassDeclaration"; - } - } - node.declaration = expr; - if (needsSemi) this.semicolon(); - return this.finishNode(node, "ExportDefaultDeclaration"); - } - // export var|const|let|function|class ... - if (this.shouldParseExportStatement()) { - node.declaration = this.parseStatement(true); - node.specifiers = []; - node.source = null; - } else { - // export { x, y as z } [from '...'] - node.declaration = null; - node.specifiers = this.parseExportSpecifiers(); - if (this.eatContextual("from")) { - node.source = this.type === _tokentype.types.string ? this.parseExprAtom() : this.unexpected(); - } else { - // check for keywords used as local names - for (var i = 0; i < node.specifiers.length; i++) { - if (this.keywords.test(node.specifiers[i].local.name) || this.reservedWords.test(node.specifiers[i].local.name)) { - this.unexpected(node.specifiers[i].local.start); - } - } - - node.source = null; - } - this.semicolon(); - } - return this.finishNode(node, "ExportNamedDeclaration"); -}; - -pp.shouldParseExportStatement = function () { - return this.type.keyword; -}; - -// Parses a comma-separated list of module exports. - -pp.parseExportSpecifiers = function () { - var nodes = [], - first = true; - // export { x, y as z } [from '...'] - this.expect(_tokentype.types.braceL); - while (!this.eat(_tokentype.types.braceR)) { - if (!first) { - this.expect(_tokentype.types.comma); - if (this.afterTrailingComma(_tokentype.types.braceR)) break; - } else first = false; - - var node = this.startNode(); - node.local = this.parseIdent(this.type === _tokentype.types._default); - node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local; - nodes.push(this.finishNode(node, "ExportSpecifier")); - } - return nodes; -}; - -// Parses import declaration. - -pp.parseImport = function (node) { - this.next(); - // import '...' - if (this.type === _tokentype.types.string) { - node.specifiers = empty; - node.source = this.parseExprAtom(); - } else { - node.specifiers = this.parseImportSpecifiers(); - this.expectContextual("from"); - node.source = this.type === _tokentype.types.string ? this.parseExprAtom() : this.unexpected(); - } - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); -}; - -// Parses a comma-separated list of module imports. - -pp.parseImportSpecifiers = function () { - var nodes = [], - first = true; - if (this.type === _tokentype.types.name) { - // import defaultObj, { x, y as z } from '...' - var node = this.startNode(); - node.local = this.parseIdent(); - this.checkLVal(node.local, true); - nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); - if (!this.eat(_tokentype.types.comma)) return nodes; - } - if (this.type === _tokentype.types.star) { - var node = this.startNode(); - this.next(); - this.expectContextual("as"); - node.local = this.parseIdent(); - this.checkLVal(node.local, true); - nodes.push(this.finishNode(node, "ImportNamespaceSpecifier")); - return nodes; - } - this.expect(_tokentype.types.braceL); - while (!this.eat(_tokentype.types.braceR)) { - if (!first) { - this.expect(_tokentype.types.comma); - if (this.afterTrailingComma(_tokentype.types.braceR)) break; - } else first = false; - - var node = this.startNode(); - node.imported = this.parseIdent(true); - if (this.eatContextual("as")) { - node.local = this.parseIdent(); - } else { - node.local = node.imported; - if (this.isKeyword(node.local.name)) this.unexpected(node.local.start); - if (this.reservedWordsStrict.test(node.local.name)) this.raise(node.local.start, "The keyword '" + node.local.name + "' is reserved"); - } - this.checkLVal(node.local, true); - nodes.push(this.finishNode(node, "ImportSpecifier")); - } - return nodes; -}; - -},{"./state":10,"./tokentype":14,"./whitespace":16}],12:[function(_dereq_,module,exports){ -// The algorithm used to determine whether a regexp can appear at a -// given point in the program is loosely based on sweet.js' approach. -// See https://github.com/mozilla/sweet.js/wiki/design - -"use strict"; - -exports.__esModule = true; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var _state = _dereq_("./state"); - -var _tokentype = _dereq_("./tokentype"); - -var _whitespace = _dereq_("./whitespace"); - -var TokContext = function TokContext(token, isExpr, preserveSpace, override) { - _classCallCheck(this, TokContext); - - this.token = token; - this.isExpr = !!isExpr; - this.preserveSpace = !!preserveSpace; - this.override = override; -}; - -exports.TokContext = TokContext; -var types = { - b_stat: new TokContext("{", false), - b_expr: new TokContext("{", true), - b_tmpl: new TokContext("${", true), - p_stat: new TokContext("(", false), - p_expr: new TokContext("(", true), - q_tmpl: new TokContext("`", true, true, function (p) { - return p.readTmplToken(); - }), - f_expr: new TokContext("function", true) -}; - -exports.types = types; -var pp = _state.Parser.prototype; - -pp.initialContext = function () { - return [types.b_stat]; -}; - -pp.braceIsBlock = function (prevType) { - if (prevType === _tokentype.types.colon) { - var _parent = this.curContext(); - if (_parent === types.b_stat || _parent === types.b_expr) return !_parent.isExpr; - } - if (prevType === _tokentype.types._return) return _whitespace.lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); - if (prevType === _tokentype.types._else || prevType === _tokentype.types.semi || prevType === _tokentype.types.eof || prevType === _tokentype.types.parenR) return true; - if (prevType == _tokentype.types.braceL) return this.curContext() === types.b_stat; - return !this.exprAllowed; -}; - -pp.updateContext = function (prevType) { - var update = undefined, - type = this.type; - if (type.keyword && prevType == _tokentype.types.dot) this.exprAllowed = false;else if (update = type.updateContext) update.call(this, prevType);else this.exprAllowed = type.beforeExpr; -}; - -// Token-specific context update code - -_tokentype.types.parenR.updateContext = _tokentype.types.braceR.updateContext = function () { - if (this.context.length == 1) { - this.exprAllowed = true; - return; - } - var out = this.context.pop(); - if (out === types.b_stat && this.curContext() === types.f_expr) { - this.context.pop(); - this.exprAllowed = false; - } else if (out === types.b_tmpl) { - this.exprAllowed = true; - } else { - this.exprAllowed = !out.isExpr; - } -}; - -_tokentype.types.braceL.updateContext = function (prevType) { - this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); - this.exprAllowed = true; -}; - -_tokentype.types.dollarBraceL.updateContext = function () { - this.context.push(types.b_tmpl); - this.exprAllowed = true; -}; - -_tokentype.types.parenL.updateContext = function (prevType) { - var statementParens = prevType === _tokentype.types._if || prevType === _tokentype.types._for || prevType === _tokentype.types._with || prevType === _tokentype.types._while; - this.context.push(statementParens ? types.p_stat : types.p_expr); - this.exprAllowed = true; -}; - -_tokentype.types.incDec.updateContext = function () { - // tokExprAllowed stays unchanged -}; - -_tokentype.types._function.updateContext = function () { - if (this.curContext() !== types.b_stat) this.context.push(types.f_expr); - this.exprAllowed = false; -}; - -_tokentype.types.backQuote.updateContext = function () { - if (this.curContext() === types.q_tmpl) this.context.pop();else this.context.push(types.q_tmpl); - this.exprAllowed = false; -}; - -},{"./state":10,"./tokentype":14,"./whitespace":16}],13:[function(_dereq_,module,exports){ -"use strict"; - -exports.__esModule = true; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var _identifier = _dereq_("./identifier"); - -var _tokentype = _dereq_("./tokentype"); - -var _state = _dereq_("./state"); - -var _locutil = _dereq_("./locutil"); - -var _whitespace = _dereq_("./whitespace"); - -// 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) { - _classCallCheck(this, Token); - - this.type = p.type; - this.value = p.value; - this.start = p.start; - this.end = p.end; - if (p.options.locations) this.loc = new _locutil.SourceLocation(p, p.startLoc, p.endLoc); - if (p.options.ranges) this.range = [p.start, p.end]; -} - -// ## Tokenizer - -; - -exports.Token = Token; -var pp = _state.Parser.prototype; - -// Are we running under Rhino? -var isRhino = typeof Packages == "object" && Object.prototype.toString.call(Packages) == "[object JavaPackage]"; - -// Move to the next token - -pp.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.getToken = function () { - this.next(); - return new Token(this); -}; - -// If we're in an ES6 environment, make parsers iterable -if (typeof Symbol !== "undefined") pp[Symbol.iterator] = function () { - var self = this; - return { next: function next() { - var token = self.getToken(); - return { - done: token.type === _tokentype.types.eof, - value: token - }; - } }; -}; - -// Toggle strict mode. Re-reads the next number or string to please -// pedantic tests (`"use strict"; 010;` should fail). - -pp.setStrict = function (strict) { - this.strict = strict; - if (this.type !== _tokentype.types.num && this.type !== _tokentype.types.string) return; - this.pos = this.start; - if (this.options.locations) { - while (this.pos < this.lineStart) { - this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; - --this.curLine; - } - } - this.nextToken(); -}; - -pp.curContext = function () { - return this.context[this.context.length - 1]; -}; - -// Read a single token, updating the parser object's token-related -// properties. - -pp.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(_tokentype.types.eof); - - if (curContext.override) return curContext.override(this);else this.readToken(this.fullCharCodeAtPos()); -}; - -pp.readToken = function (code) { - // Identifier or keyword. '\uXXXX' sequences are allowed in - // identifiers, so '\' also dispatches to that. - if (_identifier.isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) return this.readWord(); - - return this.getTokenFromCode(code); -}; - -pp.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.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) { - _whitespace.lineBreakG.lastIndex = start; - var match = undefined; - while ((match = _whitespace.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.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 && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) { - ++this.pos; - 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.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 && _whitespace.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.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.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(_tokentype.types.ellipsis); - } else { - ++this.pos; - return this.finishToken(_tokentype.types.dot); - } -}; - -pp.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(_tokentype.types.assign, 2); - return this.finishOp(_tokentype.types.slash, 1); -}; - -pp.readToken_mult_modulo = function (code) { - // '%*' - var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) return this.finishOp(_tokentype.types.assign, 2); - return this.finishOp(code === 42 ? _tokentype.types.star : _tokentype.types.modulo, 1); -}; - -pp.readToken_pipe_amp = function (code) { - // '|&' - var next = this.input.charCodeAt(this.pos + 1); - if (next === code) return this.finishOp(code === 124 ? _tokentype.types.logicalOR : _tokentype.types.logicalAND, 2); - if (next === 61) return this.finishOp(_tokentype.types.assign, 2); - return this.finishOp(code === 124 ? _tokentype.types.bitwiseOR : _tokentype.types.bitwiseAND, 1); -}; - -pp.readToken_caret = function () { - // '^' - var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) return this.finishOp(_tokentype.types.assign, 2); - return this.finishOp(_tokentype.types.bitwiseXOR, 1); -}; - -pp.readToken_plus_min = function (code) { - // '+-' - var next = this.input.charCodeAt(this.pos + 1); - if (next === code) { - if (next == 45 && this.input.charCodeAt(this.pos + 2) == 62 && _whitespace.lineBreak.test(this.input.slice(this.lastTokEnd, this.pos))) { - // A `-->` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken(); - } - return this.finishOp(_tokentype.types.incDec, 2); - } - if (next === 61) return this.finishOp(_tokentype.types.assign, 2); - return this.finishOp(_tokentype.types.plusMin, 1); -}; - -pp.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(_tokentype.types.assign, size + 1); - return this.finishOp(_tokentype.types.bitShift, size); - } - if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && this.input.charCodeAt(this.pos + 3) == 45) { - if (this.inModule) this.unexpected(); - // `` line comment - this.skipLineComment(3) - this.skipSpace() - return this.nextToken() - } - return this.finishOp(tt.incDec, 2) - } - if (next === 61) return this.finishOp(tt.assign, 2) - return this.finishOp(tt.plusMin, 1) -} - -pp.readToken_lt_gt = function(code) { // '<>' - let next = this.input.charCodeAt(this.pos + 1) - let 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(tt.assign, size + 1) - return this.finishOp(tt.bitShift, size) - } - if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && - this.input.charCodeAt(this.pos + 3) == 45) { - if (this.inModule) this.unexpected() - // ` - -```js -var auth = require('basic-auth') -``` - -### auth(req) - -Get the basic auth credentials from the given request. The `Authorization` -header is parsed and if the header is invalid, `undefined` is returned, -otherwise an object with `name` and `pass` properties. - -### auth.parse(string) - -Parse a basic auth authorization header string. This will return an object -with `name` and `pass` properties, or `undefined` if the string is invalid. - -## Example - -Pass a Node.js request object to the module export. If parsing fails -`undefined` is returned, otherwise an object with `.name` and `.pass`. - - - -```js -var auth = require('basic-auth') -var user = auth(req) -// => { name: 'something', pass: 'whatever' } -``` - -A header string from any other location can also be parsed with -`auth.parse`, for example a `Proxy-Authorization` header: - - - -```js -var auth = require('basic-auth') -var user = auth.parse(req.getHeader('Proxy-Authorization')) -``` - -### With vanilla node.js http server - -```js -var http = require('http') -var auth = require('basic-auth') -var compare = require('tsscmp') - -// Create server -var server = http.createServer(function (req, res) { - var credentials = auth(req) - - // Check credentials - // The "check" function will typically be against your user store - if (!credentials || !check(credentials.name, credentials.pass)) { - res.statusCode = 401 - res.setHeader('WWW-Authenticate', 'Basic realm="example"') - res.end('Access denied') - } else { - res.end('Access granted') - } -}) - -// Basic function to validate credentials for example -function check (name, pass) { - var valid = true - - // Simple method to prevent short-circut and use timing-safe compare - valid = compare(name, 'john') && valid - valid = compare(pass, 'secret') && valid - - return valid -} - -// Listen -server.listen(3000) -``` - -# License - -[MIT](LICENSE) - -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/basic-auth/master -[coveralls-url]: https://coveralls.io/r/jshttp/basic-auth?branch=master -[downloads-image]: https://badgen.net/npm/dm/basic-auth -[downloads-url]: https://npmjs.org/package/basic-auth -[node-version-image]: https://badgen.net/npm/node/basic-auth -[node-version-url]: https://nodejs.org/en/download -[npm-image]: https://badgen.net/npm/v/basic-auth -[npm-url]: https://npmjs.org/package/basic-auth -[travis-image]: https://badgen.net/travis/jshttp/basic-auth/master -[travis-url]: https://travis-ci.org/jshttp/basic-auth diff --git a/node_modules/basic-auth/index.js b/node_modules/basic-auth/index.js deleted file mode 100644 index 9106e64..0000000 --- a/node_modules/basic-auth/index.js +++ /dev/null @@ -1,133 +0,0 @@ -/*! - * basic-auth - * Copyright(c) 2013 TJ Holowaychuk - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015-2016 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var Buffer = require('safe-buffer').Buffer - -/** - * Module exports. - * @public - */ - -module.exports = auth -module.exports.parse = parse - -/** - * RegExp for basic auth credentials - * - * credentials = auth-scheme 1*SP token68 - * auth-scheme = "Basic" ; case insensitive - * token68 = 1*( ALPHA / DIGIT / "-" / "." / "_" / "~" / "+" / "/" ) *"=" - * @private - */ - -var CREDENTIALS_REGEXP = /^ *(?:[Bb][Aa][Ss][Ii][Cc]) +([A-Za-z0-9._~+/-]+=*) *$/ - -/** - * RegExp for basic auth user/pass - * - * user-pass = userid ":" password - * userid = * - * password = *TEXT - * @private - */ - -var USER_PASS_REGEXP = /^([^:]*):(.*)$/ - -/** - * Parse the Authorization header field of a request. - * - * @param {object} req - * @return {object} with .name and .pass - * @public - */ - -function auth (req) { - if (!req) { - throw new TypeError('argument req is required') - } - - if (typeof req !== 'object') { - throw new TypeError('argument req is required to be an object') - } - - // get header - var header = getAuthorization(req) - - // parse header - return parse(header) -} - -/** - * Decode base64 string. - * @private - */ - -function decodeBase64 (str) { - return Buffer.from(str, 'base64').toString() -} - -/** - * Get the Authorization header from request object. - * @private - */ - -function getAuthorization (req) { - if (!req.headers || typeof req.headers !== 'object') { - throw new TypeError('argument req is required to have headers property') - } - - return req.headers.authorization -} - -/** - * Parse basic auth to object. - * - * @param {string} string - * @return {object} - * @public - */ - -function parse (string) { - if (typeof string !== 'string') { - return undefined - } - - // parse header - var match = CREDENTIALS_REGEXP.exec(string) - - if (!match) { - return undefined - } - - // decode user pass - var userPass = USER_PASS_REGEXP.exec(decodeBase64(match[1])) - - if (!userPass) { - return undefined - } - - // return credentials object - return new Credentials(userPass[1], userPass[2]) -} - -/** - * Object to represent user credentials. - * @private - */ - -function Credentials (name, pass) { - this.name = name - this.pass = pass -} diff --git a/node_modules/basic-auth/package.json b/node_modules/basic-auth/package.json deleted file mode 100644 index 5537056..0000000 --- a/node_modules/basic-auth/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "_from": "basic-auth@~2.0.0", - "_id": "basic-auth@2.0.1", - "_inBundle": false, - "_integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", - "_location": "/basic-auth", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "basic-auth@~2.0.0", - "name": "basic-auth", - "escapedName": "basic-auth", - "rawSpec": "~2.0.0", - "saveSpec": null, - "fetchSpec": "~2.0.0" - }, - "_requiredBy": [ - "/morgan" - ], - "_resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", - "_shasum": "b998279bf47ce38344b4f3cf916d4679bbf51e3a", - "_spec": "basic-auth@~2.0.0", - "_where": "/var/www/html/gtg2nodejs/node_modules/morgan", - "bugs": { - "url": "https://github.com/jshttp/basic-auth/issues" - }, - "bundleDependencies": false, - "dependencies": { - "safe-buffer": "5.1.2" - }, - "deprecated": false, - "description": "node.js basic auth parser", - "devDependencies": { - "eslint": "5.6.0", - "eslint-config-standard": "12.0.0", - "eslint-plugin-import": "2.14.0", - "eslint-plugin-markdown": "1.0.0-beta.6", - "eslint-plugin-node": "7.0.1", - "eslint-plugin-promise": "4.0.1", - "eslint-plugin-standard": "4.0.0", - "istanbul": "0.4.5", - "mocha": "5.2.0" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "index.js" - ], - "homepage": "https://github.com/jshttp/basic-auth#readme", - "keywords": [ - "basic", - "auth", - "authorization", - "basicauth" - ], - "license": "MIT", - "name": "basic-auth", - "repository": { - "type": "git", - "url": "git+https://github.com/jshttp/basic-auth.git" - }, - "scripts": { - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --check-leaks --reporter spec --bail", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - }, - "version": "2.0.1" -} diff --git a/node_modules/bindings/LICENSE.md b/node_modules/bindings/LICENSE.md deleted file mode 100644 index 5a92289..0000000 --- a/node_modules/bindings/LICENSE.md +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> - -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/bindings/README.md b/node_modules/bindings/README.md deleted file mode 100644 index 5b3e7a8..0000000 --- a/node_modules/bindings/README.md +++ /dev/null @@ -1,98 +0,0 @@ -node-bindings -============= -### Helper module for loading your native module's `.node` file - -This is a helper module for authors of Node.js native addon modules. -It is basically the "swiss army knife" of `require()`ing your native module's -`.node` file. - -Throughout the course of Node's native addon history, addons have ended up being -compiled in a variety of different places, depending on which build tool and which -version of node was used. To make matters worse, now the `gyp` build tool can -produce either a __Release__ or __Debug__ build, each being built into different -locations. - -This module checks _all_ the possible locations that a native addon would be built -at, and returns the first one that loads successfully. - - -Installation ------------- - -Install with `npm`: - -``` bash -$ npm install --save bindings -``` - -Or add it to the `"dependencies"` section of your `package.json` file. - - -Example -------- - -`require()`ing the proper bindings file for the current node version, platform -and architecture is as simple as: - -``` js -var bindings = require('bindings')('binding.node') - -// Use your bindings defined in your C files -bindings.your_c_function() -``` - - -Nice Error Output ------------------ - -When the `.node` file could not be loaded, `node-bindings` throws an Error with -a nice error message telling you exactly what was tried. You can also check the -`err.tries` Array property. - -``` -Error: Could not load the bindings file. Tried: - → /Users/nrajlich/ref/build/binding.node - → /Users/nrajlich/ref/build/Debug/binding.node - → /Users/nrajlich/ref/build/Release/binding.node - → /Users/nrajlich/ref/out/Debug/binding.node - → /Users/nrajlich/ref/Debug/binding.node - → /Users/nrajlich/ref/out/Release/binding.node - → /Users/nrajlich/ref/Release/binding.node - → /Users/nrajlich/ref/build/default/binding.node - → /Users/nrajlich/ref/compiled/0.8.2/darwin/x64/binding.node - at bindings (/Users/nrajlich/ref/node_modules/bindings/bindings.js:84:13) - at Object. (/Users/nrajlich/ref/lib/ref.js:5:47) - at Module._compile (module.js:449:26) - at Object.Module._extensions..js (module.js:467:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - ... -``` - -The searching for the `.node` file will originate from the first directory in which has a `package.json` file is found. - -License -------- - -(The MIT License) - -Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> - -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/bindings/bindings.js b/node_modules/bindings/bindings.js deleted file mode 100644 index 727413a..0000000 --- a/node_modules/bindings/bindings.js +++ /dev/null @@ -1,221 +0,0 @@ -/** - * Module dependencies. - */ - -var fs = require('fs'), - path = require('path'), - fileURLToPath = require('file-uri-to-path'), - join = path.join, - dirname = path.dirname, - exists = - (fs.accessSync && - function(path) { - try { - fs.accessSync(path); - } catch (e) { - return false; - } - return true; - }) || - fs.existsSync || - path.existsSync, - defaults = { - arrow: process.env.NODE_BINDINGS_ARROW || ' → ', - compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled', - platform: process.platform, - arch: process.arch, - nodePreGyp: - 'node-v' + - process.versions.modules + - '-' + - process.platform + - '-' + - process.arch, - version: process.versions.node, - bindings: 'bindings.node', - try: [ - // node-gyp's linked version in the "build" dir - ['module_root', 'build', 'bindings'], - // node-waf and gyp_addon (a.k.a node-gyp) - ['module_root', 'build', 'Debug', 'bindings'], - ['module_root', 'build', 'Release', 'bindings'], - // Debug files, for development (legacy behavior, remove for node v0.9) - ['module_root', 'out', 'Debug', 'bindings'], - ['module_root', 'Debug', 'bindings'], - // Release files, but manually compiled (legacy behavior, remove for node v0.9) - ['module_root', 'out', 'Release', 'bindings'], - ['module_root', 'Release', 'bindings'], - // Legacy from node-waf, node <= 0.4.x - ['module_root', 'build', 'default', 'bindings'], - // Production "Release" buildtype binary (meh...) - ['module_root', 'compiled', 'version', 'platform', 'arch', 'bindings'], - // node-qbs builds - ['module_root', 'addon-build', 'release', 'install-root', 'bindings'], - ['module_root', 'addon-build', 'debug', 'install-root', 'bindings'], - ['module_root', 'addon-build', 'default', 'install-root', 'bindings'], - // node-pre-gyp path ./lib/binding/{node_abi}-{platform}-{arch} - ['module_root', 'lib', 'binding', 'nodePreGyp', 'bindings'] - ] - }; - -/** - * The main `bindings()` function loads the compiled bindings for a given module. - * It uses V8's Error API to determine the parent filename that this function is - * being invoked from, which is then used to find the root directory. - */ - -function bindings(opts) { - // Argument surgery - if (typeof opts == 'string') { - opts = { bindings: opts }; - } else if (!opts) { - opts = {}; - } - - // maps `defaults` onto `opts` object - Object.keys(defaults).map(function(i) { - if (!(i in opts)) opts[i] = defaults[i]; - }); - - // Get the module root - if (!opts.module_root) { - opts.module_root = exports.getRoot(exports.getFileName()); - } - - // Ensure the given bindings name ends with .node - if (path.extname(opts.bindings) != '.node') { - opts.bindings += '.node'; - } - - // https://github.com/webpack/webpack/issues/4175#issuecomment-342931035 - var requireFunc = - typeof __webpack_require__ === 'function' - ? __non_webpack_require__ - : require; - - var tries = [], - i = 0, - l = opts.try.length, - n, - b, - err; - - for (; i < l; i++) { - n = join.apply( - null, - opts.try[i].map(function(p) { - return opts[p] || p; - }) - ); - tries.push(n); - try { - b = opts.path ? requireFunc.resolve(n) : requireFunc(n); - if (!opts.path) { - b.path = n; - } - return b; - } catch (e) { - if (e.code !== 'MODULE_NOT_FOUND' && - e.code !== 'QUALIFIED_PATH_RESOLUTION_FAILED' && - !/not find/i.test(e.message)) { - throw e; - } - } - } - - err = new Error( - 'Could not locate the bindings file. Tried:\n' + - tries - .map(function(a) { - return opts.arrow + a; - }) - .join('\n') - ); - err.tries = tries; - throw err; -} -module.exports = exports = bindings; - -/** - * Gets the filename of the JavaScript file that invokes this function. - * Used to help find the root directory of a module. - * Optionally accepts an filename argument to skip when searching for the invoking filename - */ - -exports.getFileName = function getFileName(calling_file) { - var origPST = Error.prepareStackTrace, - origSTL = Error.stackTraceLimit, - dummy = {}, - fileName; - - Error.stackTraceLimit = 10; - - Error.prepareStackTrace = function(e, st) { - for (var i = 0, l = st.length; i < l; i++) { - fileName = st[i].getFileName(); - if (fileName !== __filename) { - if (calling_file) { - if (fileName !== calling_file) { - return; - } - } else { - return; - } - } - } - }; - - // run the 'prepareStackTrace' function above - Error.captureStackTrace(dummy); - dummy.stack; - - // cleanup - Error.prepareStackTrace = origPST; - Error.stackTraceLimit = origSTL; - - // handle filename that starts with "file://" - var fileSchema = 'file://'; - if (fileName.indexOf(fileSchema) === 0) { - fileName = fileURLToPath(fileName); - } - - return fileName; -}; - -/** - * Gets the root directory of a module, given an arbitrary filename - * somewhere in the module tree. The "root directory" is the directory - * containing the `package.json` file. - * - * In: /home/nate/node-native-module/lib/index.js - * Out: /home/nate/node-native-module - */ - -exports.getRoot = function getRoot(file) { - var dir = dirname(file), - prev; - while (true) { - if (dir === '.') { - // Avoids an infinite loop in rare cases, like the REPL - dir = process.cwd(); - } - if ( - exists(join(dir, 'package.json')) || - exists(join(dir, 'node_modules')) - ) { - // Found the 'package.json' file or 'node_modules' dir; we're done - return dir; - } - if (prev === dir) { - // Got to the top - throw new Error( - 'Could not find module root given file: "' + - file + - '". Do you have a `package.json` file? ' - ); - } - // Try the parent dir next - prev = dir; - dir = join(dir, '..'); - } -}; diff --git a/node_modules/bindings/package.json b/node_modules/bindings/package.json deleted file mode 100644 index 67e5f6b..0000000 --- a/node_modules/bindings/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "_from": "bindings@^1.5.0", - "_id": "bindings@1.5.0", - "_inBundle": false, - "_integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "_location": "/bindings", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "bindings@^1.5.0", - "name": "bindings", - "escapedName": "bindings", - "rawSpec": "^1.5.0", - "saveSpec": null, - "fetchSpec": "^1.5.0" - }, - "_requiredBy": [ - "/node-expat" - ], - "_resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "_shasum": "10353c9e945334bc0511a6d90b38fbc7c9c504df", - "_spec": "bindings@^1.5.0", - "_where": "/var/www/html/gtg2nodejs/node_modules/node-expat", - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://tootallnate.net" - }, - "bugs": { - "url": "https://github.com/TooTallNate/node-bindings/issues" - }, - "bundleDependencies": false, - "dependencies": { - "file-uri-to-path": "1.0.0" - }, - "deprecated": false, - "description": "Helper module for loading your native module's .node file", - "homepage": "https://github.com/TooTallNate/node-bindings", - "keywords": [ - "native", - "addon", - "bindings", - "gyp", - "waf", - "c", - "c++" - ], - "license": "MIT", - "main": "./bindings.js", - "name": "bindings", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/node-bindings.git" - }, - "version": "1.5.0" -} diff --git a/node_modules/body-parser/HISTORY.md b/node_modules/body-parser/HISTORY.md deleted file mode 100644 index d8152cc..0000000 --- a/node_modules/body-parser/HISTORY.md +++ /dev/null @@ -1,588 +0,0 @@ -1.18.3 / 2018-05-14 -=================== - - * Fix stack trace for strict json parse error - * deps: depd@~1.1.2 - - perf: remove argument reassignment - * deps: http-errors@~1.6.3 - - deps: depd@~1.1.2 - - deps: setprototypeof@1.1.0 - - deps: statuses@'>= 1.3.1 < 2' - * deps: iconv-lite@0.4.23 - - Fix loading encoding with year appended - - Fix deprecation warnings on Node.js 10+ - * deps: qs@6.5.2 - * deps: raw-body@2.3.3 - - deps: http-errors@1.6.3 - - deps: iconv-lite@0.4.23 - * deps: type-is@~1.6.16 - - deps: mime-types@~2.1.18 - -1.18.2 / 2017-09-22 -=================== - - * deps: debug@2.6.9 - * perf: remove argument reassignment - -1.18.1 / 2017-09-12 -=================== - - * deps: content-type@~1.0.4 - - perf: remove argument reassignment - - perf: skip parameter parsing when no parameters - * deps: iconv-lite@0.4.19 - - Fix ISO-8859-1 regression - - Update Windows-1255 - * deps: qs@6.5.1 - - Fix parsing & compacting very deep objects - * deps: raw-body@2.3.2 - - deps: iconv-lite@0.4.19 - -1.18.0 / 2017-09-08 -=================== - - * Fix JSON strict violation error to match native parse error - * Include the `body` property on verify errors - * Include the `type` property on all generated errors - * Use `http-errors` to set status code on errors - * deps: bytes@3.0.0 - * deps: debug@2.6.8 - * deps: depd@~1.1.1 - - Remove unnecessary `Buffer` loading - * deps: http-errors@~1.6.2 - - deps: depd@1.1.1 - * deps: iconv-lite@0.4.18 - - Add support for React Native - - Add a warning if not loaded as utf-8 - - Fix CESU-8 decoding in Node.js 8 - - Improve speed of ISO-8859-1 encoding - * deps: qs@6.5.0 - * deps: raw-body@2.3.1 - - Use `http-errors` for standard emitted errors - - deps: bytes@3.0.0 - - deps: iconv-lite@0.4.18 - - perf: skip buffer decoding on overage chunk - * perf: prevent internal `throw` when missing charset - -1.17.2 / 2017-05-17 -=================== - - * deps: debug@2.6.7 - - Fix `DEBUG_MAX_ARRAY_LENGTH` - - deps: ms@2.0.0 - * deps: type-is@~1.6.15 - - deps: mime-types@~2.1.15 - -1.17.1 / 2017-03-06 -=================== - - * deps: qs@6.4.0 - - Fix regression parsing keys starting with `[` - -1.17.0 / 2017-03-01 -=================== - - * deps: http-errors@~1.6.1 - - Make `message` property enumerable for `HttpError`s - - deps: setprototypeof@1.0.3 - * deps: qs@6.3.1 - - Fix compacting nested arrays - -1.16.1 / 2017-02-10 -=================== - - * deps: debug@2.6.1 - - Fix deprecation messages in WebStorm and other editors - - Undeprecate `DEBUG_FD` set to `1` or `2` - -1.16.0 / 2017-01-17 -=================== - - * deps: debug@2.6.0 - - Allow colors in workers - - Deprecated `DEBUG_FD` environment variable - - Fix error when running under React Native - - Use same color for same namespace - - deps: ms@0.7.2 - * deps: http-errors@~1.5.1 - - deps: inherits@2.0.3 - - deps: setprototypeof@1.0.2 - - deps: statuses@'>= 1.3.1 < 2' - * deps: iconv-lite@0.4.15 - - Added encoding MS-31J - - Added encoding MS-932 - - Added encoding MS-936 - - Added encoding MS-949 - - Added encoding MS-950 - - Fix GBK/GB18030 handling of Euro character - * deps: qs@6.2.1 - - Fix array parsing from skipping empty values - * deps: raw-body@~2.2.0 - - deps: iconv-lite@0.4.15 - * deps: type-is@~1.6.14 - - deps: mime-types@~2.1.13 - -1.15.2 / 2016-06-19 -=================== - - * deps: bytes@2.4.0 - * deps: content-type@~1.0.2 - - perf: enable strict mode - * deps: http-errors@~1.5.0 - - Use `setprototypeof` module to replace `__proto__` setting - - deps: statuses@'>= 1.3.0 < 2' - - perf: enable strict mode - * deps: qs@6.2.0 - * deps: raw-body@~2.1.7 - - deps: bytes@2.4.0 - - perf: remove double-cleanup on happy path - * deps: type-is@~1.6.13 - - deps: mime-types@~2.1.11 - -1.15.1 / 2016-05-05 -=================== - - * deps: bytes@2.3.0 - - Drop partial bytes on all parsed units - - Fix parsing byte string that looks like hex - * deps: raw-body@~2.1.6 - - deps: bytes@2.3.0 - * deps: type-is@~1.6.12 - - deps: mime-types@~2.1.10 - -1.15.0 / 2016-02-10 -=================== - - * deps: http-errors@~1.4.0 - - Add `HttpError` export, for `err instanceof createError.HttpError` - - deps: inherits@2.0.1 - - deps: statuses@'>= 1.2.1 < 2' - * deps: qs@6.1.0 - * deps: type-is@~1.6.11 - - deps: mime-types@~2.1.9 - -1.14.2 / 2015-12-16 -=================== - - * deps: bytes@2.2.0 - * deps: iconv-lite@0.4.13 - * deps: qs@5.2.0 - * deps: raw-body@~2.1.5 - - deps: bytes@2.2.0 - - deps: iconv-lite@0.4.13 - * deps: type-is@~1.6.10 - - deps: mime-types@~2.1.8 - -1.14.1 / 2015-09-27 -=================== - - * Fix issue where invalid charset results in 400 when `verify` used - * deps: iconv-lite@0.4.12 - - Fix CESU-8 decoding in Node.js 4.x - * deps: raw-body@~2.1.4 - - Fix masking critical errors from `iconv-lite` - - deps: iconv-lite@0.4.12 - * deps: type-is@~1.6.9 - - deps: mime-types@~2.1.7 - -1.14.0 / 2015-09-16 -=================== - - * Fix JSON strict parse error to match syntax errors - * Provide static `require` analysis in `urlencoded` parser - * deps: depd@~1.1.0 - - Support web browser loading - * deps: qs@5.1.0 - * deps: raw-body@~2.1.3 - - Fix sync callback when attaching data listener causes sync read - * deps: type-is@~1.6.8 - - Fix type error when given invalid type to match against - - deps: mime-types@~2.1.6 - -1.13.3 / 2015-07-31 -=================== - - * deps: type-is@~1.6.6 - - deps: mime-types@~2.1.4 - -1.13.2 / 2015-07-05 -=================== - - * deps: iconv-lite@0.4.11 - * deps: qs@4.0.0 - - Fix dropping parameters like `hasOwnProperty` - - Fix user-visible incompatibilities from 3.1.0 - - Fix various parsing edge cases - * deps: raw-body@~2.1.2 - - Fix error stack traces to skip `makeError` - - deps: iconv-lite@0.4.11 - * deps: type-is@~1.6.4 - - deps: mime-types@~2.1.2 - - perf: enable strict mode - - perf: remove argument reassignment - -1.13.1 / 2015-06-16 -=================== - - * deps: qs@2.4.2 - - Downgraded from 3.1.0 because of user-visible incompatibilities - -1.13.0 / 2015-06-14 -=================== - - * Add `statusCode` property on `Error`s, in addition to `status` - * Change `type` default to `application/json` for JSON parser - * Change `type` default to `application/x-www-form-urlencoded` for urlencoded parser - * Provide static `require` analysis - * Use the `http-errors` module to generate errors - * deps: bytes@2.1.0 - - Slight optimizations - * deps: iconv-lite@0.4.10 - - The encoding UTF-16 without BOM now defaults to UTF-16LE when detection fails - - Leading BOM is now removed when decoding - * deps: on-finished@~2.3.0 - - Add defined behavior for HTTP `CONNECT` requests - - Add defined behavior for HTTP `Upgrade` requests - - deps: ee-first@1.1.1 - * deps: qs@3.1.0 - - Fix dropping parameters like `hasOwnProperty` - - Fix various parsing edge cases - - Parsed object now has `null` prototype - * deps: raw-body@~2.1.1 - - Use `unpipe` module for unpiping requests - - deps: iconv-lite@0.4.10 - * deps: type-is@~1.6.3 - - deps: mime-types@~2.1.1 - - perf: reduce try block size - - perf: remove bitwise operations - * perf: enable strict mode - * perf: remove argument reassignment - * perf: remove delete call - -1.12.4 / 2015-05-10 -=================== - - * deps: debug@~2.2.0 - * deps: qs@2.4.2 - - Fix allowing parameters like `constructor` - * deps: on-finished@~2.2.1 - * deps: raw-body@~2.0.1 - - Fix a false-positive when unpiping in Node.js 0.8 - - deps: bytes@2.0.1 - * deps: type-is@~1.6.2 - - deps: mime-types@~2.0.11 - -1.12.3 / 2015-04-15 -=================== - - * Slight efficiency improvement when not debugging - * deps: depd@~1.0.1 - * deps: iconv-lite@0.4.8 - - Add encoding alias UNICODE-1-1-UTF-7 - * deps: raw-body@1.3.4 - - Fix hanging callback if request aborts during read - - deps: iconv-lite@0.4.8 - -1.12.2 / 2015-03-16 -=================== - - * deps: qs@2.4.1 - - Fix error when parameter `hasOwnProperty` is present - -1.12.1 / 2015-03-15 -=================== - - * deps: debug@~2.1.3 - - Fix high intensity foreground color for bold - - deps: ms@0.7.0 - * deps: type-is@~1.6.1 - - deps: mime-types@~2.0.10 - -1.12.0 / 2015-02-13 -=================== - - * add `debug` messages - * accept a function for the `type` option - * use `content-type` to parse `Content-Type` headers - * deps: iconv-lite@0.4.7 - - Gracefully support enumerables on `Object.prototype` - * deps: raw-body@1.3.3 - - deps: iconv-lite@0.4.7 - * deps: type-is@~1.6.0 - - fix argument reassignment - - fix false-positives in `hasBody` `Transfer-Encoding` check - - support wildcard for both type and subtype (`*/*`) - - deps: mime-types@~2.0.9 - -1.11.0 / 2015-01-30 -=================== - - * make internal `extended: true` depth limit infinity - * deps: type-is@~1.5.6 - - deps: mime-types@~2.0.8 - -1.10.2 / 2015-01-20 -=================== - - * deps: iconv-lite@0.4.6 - - Fix rare aliases of single-byte encodings - * deps: raw-body@1.3.2 - - deps: iconv-lite@0.4.6 - -1.10.1 / 2015-01-01 -=================== - - * deps: on-finished@~2.2.0 - * deps: type-is@~1.5.5 - - deps: mime-types@~2.0.7 - -1.10.0 / 2014-12-02 -=================== - - * make internal `extended: true` array limit dynamic - -1.9.3 / 2014-11-21 -================== - - * deps: iconv-lite@0.4.5 - - Fix Windows-31J and X-SJIS encoding support - * deps: qs@2.3.3 - - Fix `arrayLimit` behavior - * deps: raw-body@1.3.1 - - deps: iconv-lite@0.4.5 - * deps: type-is@~1.5.3 - - deps: mime-types@~2.0.3 - -1.9.2 / 2014-10-27 -================== - - * deps: qs@2.3.2 - - Fix parsing of mixed objects and values - -1.9.1 / 2014-10-22 -================== - - * deps: on-finished@~2.1.1 - - Fix handling of pipelined requests - * deps: qs@2.3.0 - - Fix parsing of mixed implicit and explicit arrays - * deps: type-is@~1.5.2 - - deps: mime-types@~2.0.2 - -1.9.0 / 2014-09-24 -================== - - * include the charset in "unsupported charset" error message - * include the encoding in "unsupported content encoding" error message - * deps: depd@~1.0.0 - -1.8.4 / 2014-09-23 -================== - - * fix content encoding to be case-insensitive - -1.8.3 / 2014-09-19 -================== - - * deps: qs@2.2.4 - - Fix issue with object keys starting with numbers truncated - -1.8.2 / 2014-09-15 -================== - - * deps: depd@0.4.5 - -1.8.1 / 2014-09-07 -================== - - * deps: media-typer@0.3.0 - * deps: type-is@~1.5.1 - -1.8.0 / 2014-09-05 -================== - - * make empty-body-handling consistent between chunked requests - - empty `json` produces `{}` - - empty `raw` produces `new Buffer(0)` - - empty `text` produces `''` - - empty `urlencoded` produces `{}` - * deps: qs@2.2.3 - - Fix issue where first empty value in array is discarded - * deps: type-is@~1.5.0 - - fix `hasbody` to be true for `content-length: 0` - -1.7.0 / 2014-09-01 -================== - - * add `parameterLimit` option to `urlencoded` parser - * change `urlencoded` extended array limit to 100 - * respond with 413 when over `parameterLimit` in `urlencoded` - -1.6.7 / 2014-08-29 -================== - - * deps: qs@2.2.2 - - Remove unnecessary cloning - -1.6.6 / 2014-08-27 -================== - - * deps: qs@2.2.0 - - Array parsing fix - - Performance improvements - -1.6.5 / 2014-08-16 -================== - - * deps: on-finished@2.1.0 - -1.6.4 / 2014-08-14 -================== - - * deps: qs@1.2.2 - -1.6.3 / 2014-08-10 -================== - - * deps: qs@1.2.1 - -1.6.2 / 2014-08-07 -================== - - * deps: qs@1.2.0 - - Fix parsing array of objects - -1.6.1 / 2014-08-06 -================== - - * deps: qs@1.1.0 - - Accept urlencoded square brackets - - Accept empty values in implicit array notation - -1.6.0 / 2014-08-05 -================== - - * deps: qs@1.0.2 - - Complete rewrite - - Limits array length to 20 - - Limits object depth to 5 - - Limits parameters to 1,000 - -1.5.2 / 2014-07-27 -================== - - * deps: depd@0.4.4 - - Work-around v8 generating empty stack traces - -1.5.1 / 2014-07-26 -================== - - * deps: depd@0.4.3 - - Fix exception when global `Error.stackTraceLimit` is too low - -1.5.0 / 2014-07-20 -================== - - * deps: depd@0.4.2 - - Add `TRACE_DEPRECATION` environment variable - - Remove non-standard grey color from color output - - Support `--no-deprecation` argument - - Support `--trace-deprecation` argument - * deps: iconv-lite@0.4.4 - - Added encoding UTF-7 - * deps: raw-body@1.3.0 - - deps: iconv-lite@0.4.4 - - Added encoding UTF-7 - - Fix `Cannot switch to old mode now` error on Node.js 0.10+ - * deps: type-is@~1.3.2 - -1.4.3 / 2014-06-19 -================== - - * deps: type-is@1.3.1 - - fix global variable leak - -1.4.2 / 2014-06-19 -================== - - * deps: type-is@1.3.0 - - improve type parsing - -1.4.1 / 2014-06-19 -================== - - * fix urlencoded extended deprecation message - -1.4.0 / 2014-06-19 -================== - - * add `text` parser - * add `raw` parser - * check accepted charset in content-type (accepts utf-8) - * check accepted encoding in content-encoding (accepts identity) - * deprecate `bodyParser()` middleware; use `.json()` and `.urlencoded()` as needed - * deprecate `urlencoded()` without provided `extended` option - * lazy-load urlencoded parsers - * parsers split into files for reduced mem usage - * support gzip and deflate bodies - - set `inflate: false` to turn off - * deps: raw-body@1.2.2 - - Support all encodings from `iconv-lite` - -1.3.1 / 2014-06-11 -================== - - * deps: type-is@1.2.1 - - Switch dependency from mime to mime-types@1.0.0 - -1.3.0 / 2014-05-31 -================== - - * add `extended` option to urlencoded parser - -1.2.2 / 2014-05-27 -================== - - * deps: raw-body@1.1.6 - - assert stream encoding on node.js 0.8 - - assert stream encoding on node.js < 0.10.6 - - deps: bytes@1 - -1.2.1 / 2014-05-26 -================== - - * invoke `next(err)` after request fully read - - prevents hung responses and socket hang ups - -1.2.0 / 2014-05-11 -================== - - * add `verify` option - * deps: type-is@1.2.0 - - support suffix matching - -1.1.2 / 2014-05-11 -================== - - * improve json parser speed - -1.1.1 / 2014-05-11 -================== - - * fix repeated limit parsing with every request - -1.1.0 / 2014-05-10 -================== - - * add `type` option - * deps: pin for safety and consistency - -1.0.2 / 2014-04-14 -================== - - * use `type-is` module - -1.0.1 / 2014-03-20 -================== - - * lower default limits to 100kb diff --git a/node_modules/body-parser/LICENSE b/node_modules/body-parser/LICENSE deleted file mode 100644 index 386b7b6..0000000 --- a/node_modules/body-parser/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2014-2015 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/body-parser/README.md b/node_modules/body-parser/README.md deleted file mode 100644 index d9138bc..0000000 --- a/node_modules/body-parser/README.md +++ /dev/null @@ -1,445 +0,0 @@ -# body-parser - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Node.js body parsing middleware. - -Parse incoming request bodies in a middleware before your handlers, available -under the `req.body` property. - -**Note** As `req.body`'s shape is based on user-controlled input, all -properties and values in this object are untrusted and should be validated -before trusting. For example, `req.body.foo.toString()` may fail in multiple -ways, for example the `foo` property may not be there or may not be a string, -and `toString` may not be a function and instead a string or other user input. - -[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/). - -_This does not handle multipart bodies_, due to their complex and typically -large nature. For multipart bodies, you may be interested in the following -modules: - - * [busboy](https://www.npmjs.org/package/busboy#readme) and - [connect-busboy](https://www.npmjs.org/package/connect-busboy#readme) - * [multiparty](https://www.npmjs.org/package/multiparty#readme) and - [connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme) - * [formidable](https://www.npmjs.org/package/formidable#readme) - * [multer](https://www.npmjs.org/package/multer#readme) - -This module provides the following parsers: - - * [JSON body parser](#bodyparserjsonoptions) - * [Raw body parser](#bodyparserrawoptions) - * [Text body parser](#bodyparsertextoptions) - * [URL-encoded form body parser](#bodyparserurlencodedoptions) - -Other body parsers you might be interested in: - -- [body](https://www.npmjs.org/package/body#readme) -- [co-body](https://www.npmjs.org/package/co-body#readme) - -## Installation - -```sh -$ npm install body-parser -``` - -## API - - - -```js -var bodyParser = require('body-parser') -``` - -The `bodyParser` object exposes various factories to create middlewares. All -middlewares will populate the `req.body` property with the parsed body when -the `Content-Type` request header matches the `type` option, or an empty -object (`{}`) if there was no body to parse, the `Content-Type` was not matched, -or an error occurred. - -The various errors returned by this module are described in the -[errors section](#errors). - -### bodyParser.json([options]) - -Returns middleware that only parses `json` and only looks at requests where -the `Content-Type` header matches the `type` option. This parser accepts any -Unicode encoding of the body and supports automatic inflation of `gzip` and -`deflate` encodings. - -A new `body` object containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). - -#### Options - -The `json` function takes an optional `options` object that may contain any of -the following keys: - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### reviver - -The `reviver` option is passed directly to `JSON.parse` as the second -argument. You can find more information on this argument -[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter). - -##### strict - -When set to `true`, will only accept arrays and objects; when `false` will -accept anything `JSON.parse` accepts. Defaults to `true`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. If not a -function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this can -be an extension name (like `json`), a mime type (like `application/json`), or -a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type` -option is called as `fn(req)` and the request is parsed if it returns a truthy -value. Defaults to `application/json`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -### bodyParser.raw([options]) - -Returns middleware that parses all bodies as a `Buffer` and only looks at -requests where the `Content-Type` header matches the `type` option. This -parser supports automatic inflation of `gzip` and `deflate` encodings. - -A new `body` object containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). This will be a `Buffer` object -of the body. - -#### Options - -The `raw` function takes an optional `options` object that may contain any of -the following keys: - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. -If not a function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this -can be an extension name (like `bin`), a mime type (like -`application/octet-stream`), or a mime type with a wildcard (like `*/*` or -`application/*`). If a function, the `type` option is called as `fn(req)` -and the request is parsed if it returns a truthy value. Defaults to -`application/octet-stream`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -### bodyParser.text([options]) - -Returns middleware that parses all bodies as a string and only looks at -requests where the `Content-Type` header matches the `type` option. This -parser supports automatic inflation of `gzip` and `deflate` encodings. - -A new `body` string containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). This will be a string of the -body. - -#### Options - -The `text` function takes an optional `options` object that may contain any of -the following keys: - -##### defaultCharset - -Specify the default character set for the text content if the charset is not -specified in the `Content-Type` header of the request. Defaults to `utf-8`. - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. If not -a function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this can -be an extension name (like `txt`), a mime type (like `text/plain`), or a mime -type with a wildcard (like `*/*` or `text/*`). If a function, the `type` -option is called as `fn(req)` and the request is parsed if it returns a -truthy value. Defaults to `text/plain`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -### bodyParser.urlencoded([options]) - -Returns middleware that only parses `urlencoded` bodies and only looks at -requests where the `Content-Type` header matches the `type` option. This -parser accepts only UTF-8 encoding of the body and supports automatic -inflation of `gzip` and `deflate` encodings. - -A new `body` object containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). This object will contain -key-value pairs, where the value can be a string or array (when `extended` is -`false`), or any type (when `extended` is `true`). - -#### Options - -The `urlencoded` function takes an optional `options` object that may contain -any of the following keys: - -##### extended - -The `extended` option allows to choose between parsing the URL-encoded data -with the `querystring` library (when `false`) or the `qs` library (when -`true`). The "extended" syntax allows for rich objects and arrays to be -encoded into the URL-encoded format, allowing for a JSON-like experience -with URL-encoded. For more information, please -[see the qs library](https://www.npmjs.org/package/qs#readme). - -Defaults to `true`, but using the default has been deprecated. Please -research into the difference between `qs` and `querystring` and choose the -appropriate setting. - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### parameterLimit - -The `parameterLimit` option controls the maximum number of parameters that -are allowed in the URL-encoded data. If a request contains more parameters -than this value, a 413 will be returned to the client. Defaults to `1000`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. If not -a function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this can -be an extension name (like `urlencoded`), a mime type (like -`application/x-www-form-urlencoded`), or a mime type with a wildcard (like -`*/x-www-form-urlencoded`). If a function, the `type` option is called as -`fn(req)` and the request is parsed if it returns a truthy value. Defaults -to `application/x-www-form-urlencoded`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -## Errors - -The middlewares provided by this module create errors depending on the error -condition during parsing. The errors will typically have a `status`/`statusCode` -property that contains the suggested HTTP response code, an `expose` property -to determine if the `message` property should be displayed to the client, a -`type` property to determine the type of error without matching against the -`message`, and a `body` property containing the read body, if available. - -The following are the common errors emitted, though any error can come through -for various reasons. - -### content encoding unsupported - -This error will occur when the request had a `Content-Encoding` header that -contained an encoding but the "inflation" option was set to `false`. The -`status` property is set to `415`, the `type` property is set to -`'encoding.unsupported'`, and the `charset` property will be set to the -encoding that is unsupported. - -### request aborted - -This error will occur when the request is aborted by the client before reading -the body has finished. The `received` property will be set to the number of -bytes received before the request was aborted and the `expected` property is -set to the number of expected bytes. The `status` property is set to `400` -and `type` property is set to `'request.aborted'`. - -### request entity too large - -This error will occur when the request body's size is larger than the "limit" -option. The `limit` property will be set to the byte limit and the `length` -property will be set to the request body's length. The `status` property is -set to `413` and the `type` property is set to `'entity.too.large'`. - -### request size did not match content length - -This error will occur when the request's length did not match the length from -the `Content-Length` header. This typically occurs when the request is malformed, -typically when the `Content-Length` header was calculated based on characters -instead of bytes. The `status` property is set to `400` and the `type` property -is set to `'request.size.invalid'`. - -### stream encoding should not be set - -This error will occur when something called the `req.setEncoding` method prior -to this middleware. This module operates directly on bytes only and you cannot -call `req.setEncoding` when using this module. The `status` property is set to -`500` and the `type` property is set to `'stream.encoding.set'`. - -### too many parameters - -This error will occur when the content of the request exceeds the configured -`parameterLimit` for the `urlencoded` parser. The `status` property is set to -`413` and the `type` property is set to `'parameters.too.many'`. - -### unsupported charset "BOGUS" - -This error will occur when the request had a charset parameter in the -`Content-Type` header, but the `iconv-lite` module does not support it OR the -parser does not support it. The charset is contained in the message as well -as in the `charset` property. The `status` property is set to `415`, the -`type` property is set to `'charset.unsupported'`, and the `charset` property -is set to the charset that is unsupported. - -### unsupported content encoding "bogus" - -This error will occur when the request had a `Content-Encoding` header that -contained an unsupported encoding. The encoding is contained in the message -as well as in the `encoding` property. The `status` property is set to `415`, -the `type` property is set to `'encoding.unsupported'`, and the `encoding` -property is set to the encoding that is unsupported. - -## Examples - -### Express/Connect top-level generic - -This example demonstrates adding a generic JSON and URL-encoded parser as a -top-level middleware, which will parse the bodies of all incoming requests. -This is the simplest setup. - -```js -var express = require('express') -var bodyParser = require('body-parser') - -var app = express() - -// parse application/x-www-form-urlencoded -app.use(bodyParser.urlencoded({ extended: false })) - -// parse application/json -app.use(bodyParser.json()) - -app.use(function (req, res) { - res.setHeader('Content-Type', 'text/plain') - res.write('you posted:\n') - res.end(JSON.stringify(req.body, null, 2)) -}) -``` - -### Express route-specific - -This example demonstrates adding body parsers specifically to the routes that -need them. In general, this is the most recommended way to use body-parser with -Express. - -```js -var express = require('express') -var bodyParser = require('body-parser') - -var app = express() - -// create application/json parser -var jsonParser = bodyParser.json() - -// create application/x-www-form-urlencoded parser -var urlencodedParser = bodyParser.urlencoded({ extended: false }) - -// POST /login gets urlencoded bodies -app.post('/login', urlencodedParser, function (req, res) { - if (!req.body) return res.sendStatus(400) - res.send('welcome, ' + req.body.username) -}) - -// POST /api/users gets JSON bodies -app.post('/api/users', jsonParser, function (req, res) { - if (!req.body) return res.sendStatus(400) - // create user in req.body -}) -``` - -### Change accepted type for parsers - -All the parsers accept a `type` option which allows you to change the -`Content-Type` that the middleware will parse. - -```js -var express = require('express') -var bodyParser = require('body-parser') - -var app = express() - -// parse various different custom JSON types as JSON -app.use(bodyParser.json({ type: 'application/*+json' })) - -// parse some custom thing into a Buffer -app.use(bodyParser.raw({ type: 'application/vnd.custom-type' })) - -// parse an HTML body into a string -app.use(bodyParser.text({ type: 'text/html' })) -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/body-parser.svg -[npm-url]: https://npmjs.org/package/body-parser -[travis-image]: https://img.shields.io/travis/expressjs/body-parser/master.svg -[travis-url]: https://travis-ci.org/expressjs/body-parser -[coveralls-image]: https://img.shields.io/coveralls/expressjs/body-parser/master.svg -[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master -[downloads-image]: https://img.shields.io/npm/dm/body-parser.svg -[downloads-url]: https://npmjs.org/package/body-parser diff --git a/node_modules/body-parser/index.js b/node_modules/body-parser/index.js deleted file mode 100644 index 93c3a1f..0000000 --- a/node_modules/body-parser/index.js +++ /dev/null @@ -1,157 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var deprecate = require('depd')('body-parser') - -/** - * Cache of loaded parsers. - * @private - */ - -var parsers = Object.create(null) - -/** - * @typedef Parsers - * @type {function} - * @property {function} json - * @property {function} raw - * @property {function} text - * @property {function} urlencoded - */ - -/** - * Module exports. - * @type {Parsers} - */ - -exports = module.exports = deprecate.function(bodyParser, - 'bodyParser: use individual json/urlencoded middlewares') - -/** - * JSON parser. - * @public - */ - -Object.defineProperty(exports, 'json', { - configurable: true, - enumerable: true, - get: createParserGetter('json') -}) - -/** - * Raw parser. - * @public - */ - -Object.defineProperty(exports, 'raw', { - configurable: true, - enumerable: true, - get: createParserGetter('raw') -}) - -/** - * Text parser. - * @public - */ - -Object.defineProperty(exports, 'text', { - configurable: true, - enumerable: true, - get: createParserGetter('text') -}) - -/** - * URL-encoded parser. - * @public - */ - -Object.defineProperty(exports, 'urlencoded', { - configurable: true, - enumerable: true, - get: createParserGetter('urlencoded') -}) - -/** - * Create a middleware to parse json and urlencoded bodies. - * - * @param {object} [options] - * @return {function} - * @deprecated - * @public - */ - -function bodyParser (options) { - var opts = {} - - // exclude type option - if (options) { - for (var prop in options) { - if (prop !== 'type') { - opts[prop] = options[prop] - } - } - } - - var _urlencoded = exports.urlencoded(opts) - var _json = exports.json(opts) - - return function bodyParser (req, res, next) { - _json(req, res, function (err) { - if (err) return next(err) - _urlencoded(req, res, next) - }) - } -} - -/** - * Create a getter for loading a parser. - * @private - */ - -function createParserGetter (name) { - return function get () { - return loadParser(name) - } -} - -/** - * Load a parser module. - * @private - */ - -function loadParser (parserName) { - var parser = parsers[parserName] - - if (parser !== undefined) { - return parser - } - - // this uses a switch for static require analysis - switch (parserName) { - case 'json': - parser = require('./lib/types/json') - break - case 'raw': - parser = require('./lib/types/raw') - break - case 'text': - parser = require('./lib/types/text') - break - case 'urlencoded': - parser = require('./lib/types/urlencoded') - break - } - - // store to prevent invoking require() - return (parsers[parserName] = parser) -} diff --git a/node_modules/body-parser/lib/read.js b/node_modules/body-parser/lib/read.js deleted file mode 100644 index c102609..0000000 --- a/node_modules/body-parser/lib/read.js +++ /dev/null @@ -1,181 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var createError = require('http-errors') -var getBody = require('raw-body') -var iconv = require('iconv-lite') -var onFinished = require('on-finished') -var zlib = require('zlib') - -/** - * Module exports. - */ - -module.exports = read - -/** - * Read a request into a buffer and parse. - * - * @param {object} req - * @param {object} res - * @param {function} next - * @param {function} parse - * @param {function} debug - * @param {object} options - * @private - */ - -function read (req, res, next, parse, debug, options) { - var length - var opts = options - var stream - - // flag as parsed - req._body = true - - // read options - var encoding = opts.encoding !== null - ? opts.encoding - : null - var verify = opts.verify - - try { - // get the content stream - stream = contentstream(req, debug, opts.inflate) - length = stream.length - stream.length = undefined - } catch (err) { - return next(err) - } - - // set raw-body options - opts.length = length - opts.encoding = verify - ? null - : encoding - - // assert charset is supported - if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) { - return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { - charset: encoding.toLowerCase(), - type: 'charset.unsupported' - })) - } - - // read body - debug('read body') - getBody(stream, opts, function (error, body) { - if (error) { - var _error - - if (error.type === 'encoding.unsupported') { - // echo back charset - _error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { - charset: encoding.toLowerCase(), - type: 'charset.unsupported' - }) - } else { - // set status code on error - _error = createError(400, error) - } - - // read off entire request - stream.resume() - onFinished(req, function onfinished () { - next(createError(400, _error)) - }) - return - } - - // verify - if (verify) { - try { - debug('verify body') - verify(req, res, body, encoding) - } catch (err) { - next(createError(403, err, { - body: body, - type: err.type || 'entity.verify.failed' - })) - return - } - } - - // parse - var str = body - try { - debug('parse body') - str = typeof body !== 'string' && encoding !== null - ? iconv.decode(body, encoding) - : body - req.body = parse(str) - } catch (err) { - next(createError(400, err, { - body: str, - type: err.type || 'entity.parse.failed' - })) - return - } - - next() - }) -} - -/** - * Get the content stream of the request. - * - * @param {object} req - * @param {function} debug - * @param {boolean} [inflate=true] - * @return {object} - * @api private - */ - -function contentstream (req, debug, inflate) { - var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase() - var length = req.headers['content-length'] - var stream - - debug('content-encoding "%s"', encoding) - - if (inflate === false && encoding !== 'identity') { - throw createError(415, 'content encoding unsupported', { - encoding: encoding, - type: 'encoding.unsupported' - }) - } - - switch (encoding) { - case 'deflate': - stream = zlib.createInflate() - debug('inflate body') - req.pipe(stream) - break - case 'gzip': - stream = zlib.createGunzip() - debug('gunzip body') - req.pipe(stream) - break - case 'identity': - stream = req - stream.length = length - break - default: - throw createError(415, 'unsupported content encoding "' + encoding + '"', { - encoding: encoding, - type: 'encoding.unsupported' - }) - } - - return stream -} diff --git a/node_modules/body-parser/lib/types/json.js b/node_modules/body-parser/lib/types/json.js deleted file mode 100644 index 2971dc1..0000000 --- a/node_modules/body-parser/lib/types/json.js +++ /dev/null @@ -1,230 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var bytes = require('bytes') -var contentType = require('content-type') -var createError = require('http-errors') -var debug = require('debug')('body-parser:json') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = json - -/** - * RegExp to match the first non-space in a string. - * - * Allowed whitespace is defined in RFC 7159: - * - * ws = *( - * %x20 / ; Space - * %x09 / ; Horizontal tab - * %x0A / ; Line feed or New line - * %x0D ) ; Carriage return - */ - -var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*(.)/ // eslint-disable-line no-control-regex - -/** - * Create a middleware to parse JSON bodies. - * - * @param {object} [options] - * @return {function} - * @public - */ - -function json (options) { - var opts = options || {} - - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var inflate = opts.inflate !== false - var reviver = opts.reviver - var strict = opts.strict !== false - var type = opts.type || 'application/json' - var verify = opts.verify || false - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (body) { - if (body.length === 0) { - // special-case empty json body, as it's a common client-side mistake - // TODO: maybe make this configurable or part of "strict" option - return {} - } - - if (strict) { - var first = firstchar(body) - - if (first !== '{' && first !== '[') { - debug('strict violation') - throw createStrictSyntaxError(body, first) - } - } - - try { - debug('parse json') - return JSON.parse(body, reviver) - } catch (e) { - throw normalizeJsonSyntaxError(e, { - message: e.message, - stack: e.stack - }) - } - } - - return function jsonParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // assert charset per RFC 7159 sec 8.1 - var charset = getCharset(req) || 'utf-8' - if (charset.substr(0, 4) !== 'utf-') { - debug('invalid charset') - next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { - charset: charset, - type: 'charset.unsupported' - })) - return - } - - // read - read(req, res, next, parse, debug, { - encoding: charset, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Create strict violation syntax error matching native error. - * - * @param {string} str - * @param {string} char - * @return {Error} - * @private - */ - -function createStrictSyntaxError (str, char) { - var index = str.indexOf(char) - var partial = str.substring(0, index) + '#' - - try { - JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation') - } catch (e) { - return normalizeJsonSyntaxError(e, { - message: e.message.replace('#', char), - stack: e.stack - }) - } -} - -/** - * Get the first non-whitespace character in a string. - * - * @param {string} str - * @return {function} - * @private - */ - -function firstchar (str) { - return FIRST_CHAR_REGEXP.exec(str)[1] -} - -/** - * Get the charset of a request. - * - * @param {object} req - * @api private - */ - -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch (e) { - return undefined - } -} - -/** - * Normalize a SyntaxError for JSON.parse. - * - * @param {SyntaxError} error - * @param {object} obj - * @return {SyntaxError} - */ - -function normalizeJsonSyntaxError (error, obj) { - var keys = Object.getOwnPropertyNames(error) - - for (var i = 0; i < keys.length; i++) { - var key = keys[i] - if (key !== 'stack' && key !== 'message') { - delete error[key] - } - } - - // replace stack before message for Node.js 0.10 and below - error.stack = obj.stack.replace(error.message, obj.message) - error.message = obj.message - - return error -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/node_modules/body-parser/lib/types/raw.js b/node_modules/body-parser/lib/types/raw.js deleted file mode 100644 index f5d1b67..0000000 --- a/node_modules/body-parser/lib/types/raw.js +++ /dev/null @@ -1,101 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - */ - -var bytes = require('bytes') -var debug = require('debug')('body-parser:raw') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = raw - -/** - * Create a middleware to parse raw bodies. - * - * @param {object} [options] - * @return {function} - * @api public - */ - -function raw (options) { - var opts = options || {} - - var inflate = opts.inflate !== false - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var type = opts.type || 'application/octet-stream' - var verify = opts.verify || false - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (buf) { - return buf - } - - return function rawParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // read - read(req, res, next, parse, debug, { - encoding: null, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/node_modules/body-parser/lib/types/text.js b/node_modules/body-parser/lib/types/text.js deleted file mode 100644 index 083a009..0000000 --- a/node_modules/body-parser/lib/types/text.js +++ /dev/null @@ -1,121 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - */ - -var bytes = require('bytes') -var contentType = require('content-type') -var debug = require('debug')('body-parser:text') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = text - -/** - * Create a middleware to parse text bodies. - * - * @param {object} [options] - * @return {function} - * @api public - */ - -function text (options) { - var opts = options || {} - - var defaultCharset = opts.defaultCharset || 'utf-8' - var inflate = opts.inflate !== false - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var type = opts.type || 'text/plain' - var verify = opts.verify || false - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (buf) { - return buf - } - - return function textParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // get charset - var charset = getCharset(req) || defaultCharset - - // read - read(req, res, next, parse, debug, { - encoding: charset, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Get the charset of a request. - * - * @param {object} req - * @api private - */ - -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch (e) { - return undefined - } -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/node_modules/body-parser/lib/types/urlencoded.js b/node_modules/body-parser/lib/types/urlencoded.js deleted file mode 100644 index 5ccda21..0000000 --- a/node_modules/body-parser/lib/types/urlencoded.js +++ /dev/null @@ -1,284 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var bytes = require('bytes') -var contentType = require('content-type') -var createError = require('http-errors') -var debug = require('debug')('body-parser:urlencoded') -var deprecate = require('depd')('body-parser') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = urlencoded - -/** - * Cache of parser modules. - */ - -var parsers = Object.create(null) - -/** - * Create a middleware to parse urlencoded bodies. - * - * @param {object} [options] - * @return {function} - * @public - */ - -function urlencoded (options) { - var opts = options || {} - - // notice because option default will flip in next major - if (opts.extended === undefined) { - deprecate('undefined extended: provide extended option') - } - - var extended = opts.extended !== false - var inflate = opts.inflate !== false - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var type = opts.type || 'application/x-www-form-urlencoded' - var verify = opts.verify || false - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate query parser - var queryparse = extended - ? extendedparser(opts) - : simpleparser(opts) - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (body) { - return body.length - ? queryparse(body) - : {} - } - - return function urlencodedParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // assert charset - var charset = getCharset(req) || 'utf-8' - if (charset !== 'utf-8') { - debug('invalid charset') - next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { - charset: charset, - type: 'charset.unsupported' - })) - return - } - - // read - read(req, res, next, parse, debug, { - debug: debug, - encoding: charset, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Get the extended query parser. - * - * @param {object} options - */ - -function extendedparser (options) { - var parameterLimit = options.parameterLimit !== undefined - ? options.parameterLimit - : 1000 - var parse = parser('qs') - - if (isNaN(parameterLimit) || parameterLimit < 1) { - throw new TypeError('option parameterLimit must be a positive number') - } - - if (isFinite(parameterLimit)) { - parameterLimit = parameterLimit | 0 - } - - return function queryparse (body) { - var paramCount = parameterCount(body, parameterLimit) - - if (paramCount === undefined) { - debug('too many parameters') - throw createError(413, 'too many parameters', { - type: 'parameters.too.many' - }) - } - - var arrayLimit = Math.max(100, paramCount) - - debug('parse extended urlencoding') - return parse(body, { - allowPrototypes: true, - arrayLimit: arrayLimit, - depth: Infinity, - parameterLimit: parameterLimit - }) - } -} - -/** - * Get the charset of a request. - * - * @param {object} req - * @api private - */ - -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch (e) { - return undefined - } -} - -/** - * Count the number of parameters, stopping once limit reached - * - * @param {string} body - * @param {number} limit - * @api private - */ - -function parameterCount (body, limit) { - var count = 0 - var index = 0 - - while ((index = body.indexOf('&', index)) !== -1) { - count++ - index++ - - if (count === limit) { - return undefined - } - } - - return count -} - -/** - * Get parser for module name dynamically. - * - * @param {string} name - * @return {function} - * @api private - */ - -function parser (name) { - var mod = parsers[name] - - if (mod !== undefined) { - return mod.parse - } - - // this uses a switch for static require analysis - switch (name) { - case 'qs': - mod = require('qs') - break - case 'querystring': - mod = require('querystring') - break - } - - // store to prevent invoking require() - parsers[name] = mod - - return mod.parse -} - -/** - * Get the simple query parser. - * - * @param {object} options - */ - -function simpleparser (options) { - var parameterLimit = options.parameterLimit !== undefined - ? options.parameterLimit - : 1000 - var parse = parser('querystring') - - if (isNaN(parameterLimit) || parameterLimit < 1) { - throw new TypeError('option parameterLimit must be a positive number') - } - - if (isFinite(parameterLimit)) { - parameterLimit = parameterLimit | 0 - } - - return function queryparse (body) { - var paramCount = parameterCount(body, parameterLimit) - - if (paramCount === undefined) { - debug('too many parameters') - throw createError(413, 'too many parameters', { - type: 'parameters.too.many' - }) - } - - debug('parse urlencoding') - return parse(body, undefined, undefined, {maxKeys: parameterLimit}) - } -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/node_modules/body-parser/node_modules/debug/.coveralls.yml b/node_modules/body-parser/node_modules/debug/.coveralls.yml deleted file mode 100644 index 20a7068..0000000 --- a/node_modules/body-parser/node_modules/debug/.coveralls.yml +++ /dev/null @@ -1 +0,0 @@ -repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/node_modules/body-parser/node_modules/debug/.eslintrc b/node_modules/body-parser/node_modules/debug/.eslintrc deleted file mode 100644 index 8a37ae2..0000000 --- a/node_modules/body-parser/node_modules/debug/.eslintrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "env": { - "browser": true, - "node": true - }, - "rules": { - "no-console": 0, - "no-empty": [1, { "allowEmptyCatch": true }] - }, - "extends": "eslint:recommended" -} diff --git a/node_modules/body-parser/node_modules/debug/.npmignore b/node_modules/body-parser/node_modules/debug/.npmignore deleted file mode 100644 index 5f60eec..0000000 --- a/node_modules/body-parser/node_modules/debug/.npmignore +++ /dev/null @@ -1,9 +0,0 @@ -support -test -examples -example -*.sock -dist -yarn.lock -coverage -bower.json diff --git a/node_modules/body-parser/node_modules/debug/.travis.yml b/node_modules/body-parser/node_modules/debug/.travis.yml deleted file mode 100644 index 6c6090c..0000000 --- a/node_modules/body-parser/node_modules/debug/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ - -language: node_js -node_js: - - "6" - - "5" - - "4" - -install: - - make node_modules - -script: - - make lint - - make test - - make coveralls diff --git a/node_modules/body-parser/node_modules/debug/CHANGELOG.md b/node_modules/body-parser/node_modules/debug/CHANGELOG.md deleted file mode 100644 index eadaa18..0000000 --- a/node_modules/body-parser/node_modules/debug/CHANGELOG.md +++ /dev/null @@ -1,362 +0,0 @@ - -2.6.9 / 2017-09-22 -================== - - * remove ReDoS regexp in %o formatter (#504) - -2.6.8 / 2017-05-18 -================== - - * Fix: Check for undefined on browser globals (#462, @marbemac) - -2.6.7 / 2017-05-16 -================== - - * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) - * Fix: Inline extend function in node implementation (#452, @dougwilson) - * Docs: Fix typo (#455, @msasad) - -2.6.5 / 2017-04-27 -================== - - * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) - * Misc: clean up browser reference checks (#447, @thebigredgeek) - * Misc: add npm-debug.log to .gitignore (@thebigredgeek) - - -2.6.4 / 2017-04-20 -================== - - * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) - * Chore: ignore bower.json in npm installations. (#437, @joaovieira) - * Misc: update "ms" to v0.7.3 (@tootallnate) - -2.6.3 / 2017-03-13 -================== - - * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) - * Docs: Changelog fix (@thebigredgeek) - -2.6.2 / 2017-03-10 -================== - - * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) - * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) - * Docs: Add Slackin invite badge (@tootallnate) - -2.6.1 / 2017-02-10 -================== - - * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error - * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) - * Fix: IE8 "Expected identifier" error (#414, @vgoma) - * Fix: Namespaces would not disable once enabled (#409, @musikov) - -2.6.0 / 2016-12-28 -================== - - * Fix: added better null pointer checks for browser useColors (@thebigredgeek) - * Improvement: removed explicit `window.debug` export (#404, @tootallnate) - * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) - -2.5.2 / 2016-12-25 -================== - - * Fix: reference error on window within webworkers (#393, @KlausTrainer) - * Docs: fixed README typo (#391, @lurch) - * Docs: added notice about v3 api discussion (@thebigredgeek) - -2.5.1 / 2016-12-20 -================== - - * Fix: babel-core compatibility - -2.5.0 / 2016-12-20 -================== - - * Fix: wrong reference in bower file (@thebigredgeek) - * Fix: webworker compatibility (@thebigredgeek) - * Fix: output formatting issue (#388, @kribblo) - * Fix: babel-loader compatibility (#383, @escwald) - * Misc: removed built asset from repo and publications (@thebigredgeek) - * Misc: moved source files to /src (#378, @yamikuronue) - * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) - * Test: coveralls integration (#378, @yamikuronue) - * Docs: simplified language in the opening paragraph (#373, @yamikuronue) - -2.4.5 / 2016-12-17 -================== - - * Fix: `navigator` undefined in Rhino (#376, @jochenberger) - * Fix: custom log function (#379, @hsiliev) - * Improvement: bit of cleanup + linting fixes (@thebigredgeek) - * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) - * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) - -2.4.4 / 2016-12-14 -================== - - * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) - -2.4.3 / 2016-12-14 -================== - - * Fix: navigation.userAgent error for react native (#364, @escwald) - -2.4.2 / 2016-12-14 -================== - - * Fix: browser colors (#367, @tootallnate) - * Misc: travis ci integration (@thebigredgeek) - * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) - -2.4.1 / 2016-12-13 -================== - - * Fix: typo that broke the package (#356) - -2.4.0 / 2016-12-13 -================== - - * Fix: bower.json references unbuilt src entry point (#342, @justmatt) - * Fix: revert "handle regex special characters" (@tootallnate) - * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) - * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) - * Improvement: allow colors in workers (#335, @botverse) - * Improvement: use same color for same namespace. (#338, @lchenay) - -2.3.3 / 2016-11-09 -================== - - * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) - * Fix: Returning `localStorage` saved values (#331, Levi Thomason) - * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) - -2.3.2 / 2016-11-09 -================== - - * Fix: be super-safe in index.js as well (@TooTallNate) - * Fix: should check whether process exists (Tom Newby) - -2.3.1 / 2016-11-09 -================== - - * Fix: Added electron compatibility (#324, @paulcbetts) - * Improvement: Added performance optimizations (@tootallnate) - * Readme: Corrected PowerShell environment variable example (#252, @gimre) - * Misc: Removed yarn lock file from source control (#321, @fengmk2) - -2.3.0 / 2016-11-07 -================== - - * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) - * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) - * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) - * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) - * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) - * Package: Update "ms" to 0.7.2 (#315, @DevSide) - * Package: removed superfluous version property from bower.json (#207 @kkirsche) - * Readme: fix USE_COLORS to DEBUG_COLORS - * Readme: Doc fixes for format string sugar (#269, @mlucool) - * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) - * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) - * Readme: better docs for browser support (#224, @matthewmueller) - * Tooling: Added yarn integration for development (#317, @thebigredgeek) - * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) - * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) - * Misc: Updated contributors (@thebigredgeek) - -2.2.0 / 2015-05-09 -================== - - * package: update "ms" to v0.7.1 (#202, @dougwilson) - * README: add logging to file example (#193, @DanielOchoa) - * README: fixed a typo (#191, @amir-s) - * browser: expose `storage` (#190, @stephenmathieson) - * Makefile: add a `distclean` target (#189, @stephenmathieson) - -2.1.3 / 2015-03-13 -================== - - * Updated stdout/stderr example (#186) - * Updated example/stdout.js to match debug current behaviour - * Renamed example/stderr.js to stdout.js - * Update Readme.md (#184) - * replace high intensity foreground color for bold (#182, #183) - -2.1.2 / 2015-03-01 -================== - - * dist: recompile - * update "ms" to v0.7.0 - * package: update "browserify" to v9.0.3 - * component: fix "ms.js" repo location - * changed bower package name - * updated documentation about using debug in a browser - * fix: security error on safari (#167, #168, @yields) - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/body-parser/node_modules/debug/LICENSE b/node_modules/body-parser/node_modules/debug/LICENSE deleted file mode 100644 index 658c933..0000000 --- a/node_modules/body-parser/node_modules/debug/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 TJ Holowaychuk - -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/body-parser/node_modules/debug/Makefile b/node_modules/body-parser/node_modules/debug/Makefile deleted file mode 100644 index 584da8b..0000000 --- a/node_modules/body-parser/node_modules/debug/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 -THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) - -# BIN directory -BIN := $(THIS_DIR)/node_modules/.bin - -# Path -PATH := node_modules/.bin:$(PATH) -SHELL := /bin/bash - -# applications -NODE ?= $(shell which node) -YARN ?= $(shell which yarn) -PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) -BROWSERIFY ?= $(NODE) $(BIN)/browserify - -.FORCE: - -install: node_modules - -node_modules: package.json - @NODE_ENV= $(PKG) install - @touch node_modules - -lint: .FORCE - eslint browser.js debug.js index.js node.js - -test-node: .FORCE - istanbul cover node_modules/mocha/bin/_mocha -- test/**.js - -test-browser: .FORCE - mkdir -p dist - - @$(BROWSERIFY) \ - --standalone debug \ - . > dist/debug.js - - karma start --single-run - rimraf dist - -test: .FORCE - concurrently \ - "make test-node" \ - "make test-browser" - -coveralls: - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js - -.PHONY: all install clean distclean diff --git a/node_modules/body-parser/node_modules/debug/README.md b/node_modules/body-parser/node_modules/debug/README.md deleted file mode 100644 index f67be6b..0000000 --- a/node_modules/body-parser/node_modules/debug/README.md +++ /dev/null @@ -1,312 +0,0 @@ -# debug -[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) -[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) - - - -A tiny node.js debugging utility modelled after node core's debugging technique. - -**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)** - -## Installation - -```bash -$ npm install debug -``` - -## Usage - -`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -#### Windows note - - On Windows the environment variable is set using the `set` command. - - ```cmd - set DEBUG=*,-not_this - ``` - - Note that PowerShell uses different syntax to set environment variables. - - ```cmd - $env:DEBUG = "*,-not_this" - ``` - -Then, run the program to be debugged as usual. - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". - -## Environment Variables - - When running through Node.js, you can set a few environment variables that will - change the behavior of the debug logging: - -| Name | Purpose | -|-----------|-------------------------------------------------| -| `DEBUG` | Enables/disables specific debugging namespaces. | -| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | -| `DEBUG_DEPTH` | Object inspection depth. | -| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | - - - __Note:__ The environment variables beginning with `DEBUG_` end up being - converted into an Options object that gets used with `%o`/`%O` formatters. - See the Node.js documentation for - [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) - for the complete list. - -## Formatters - - - Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: - -| Formatter | Representation | -|-----------|----------------| -| `%O` | Pretty-print an Object on multiple lines. | -| `%o` | Pretty-print an Object all on a single line. | -| `%s` | String. | -| `%d` | Number (both integer and float). | -| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | -| `%%` | Single percent sign ('%'). This does not consume an argument. | - -### Custom formatters - - You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: - -```js -const createDebug = require('debug') -createDebug.formatters.h = (v) => { - return v.toString('hex') -} - -// …elsewhere -const debug = createDebug('foo') -debug('this is hex: %h', new Buffer('hello world')) -// foo this is hex: 68656c6c6f20776f726c6421 +0ms -``` - -## Browser support - You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), - or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), - if you don't want to build it yourself. - - Debug's enable state is currently persisted by `localStorage`. - Consider the situation shown below where you have `worker:a` and `worker:b`, - and wish to debug both. You can enable this using `localStorage.debug`: - -```js -localStorage.debug = 'worker:*' -``` - -And then refresh the page. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - b('doing some work'); -}, 1200); -``` - -#### Web Inspector Colors - - Colors are also enabled on "Web Inspectors" that understand the `%c` formatting - option. These are WebKit web inspectors, Firefox ([since version - 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) - and the Firebug plugin for Firefox (any version). - - Colored output looks something like: - - ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) - - -## Output streams - - By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: - -Example _stdout.js_: - -```js -var debug = require('debug'); -var error = debug('app:error'); - -// by default stderr is used -error('goes to stderr!'); - -var log = debug('app:log'); -// set this namespace to log via console.log -log.log = console.log.bind(console); // don't forget to bind to console! -log('goes to stdout'); -error('still goes to stderr!'); - -// set all output to go via console.info -// overrides all per-namespace log settings -debug.log = console.info.bind(console); -error('now goes to stdout via console.info'); -log('still goes to stdout, but via console.info now'); -``` - - -## Authors - - - TJ Holowaychuk - - Nathan Rajlich - - Andrew Rhyne - -## Backers - -Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -## Sponsors - -Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -## License - -(The MIT License) - -Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/body-parser/node_modules/debug/component.json b/node_modules/body-parser/node_modules/debug/component.json deleted file mode 100644 index 9de2641..0000000 --- a/node_modules/body-parser/node_modules/debug/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "2.6.9", - "keywords": [ - "debug", - "log", - "debugger" - ], - "main": "src/browser.js", - "scripts": [ - "src/browser.js", - "src/debug.js" - ], - "dependencies": { - "rauchg/ms.js": "0.7.1" - } -} diff --git a/node_modules/body-parser/node_modules/debug/karma.conf.js b/node_modules/body-parser/node_modules/debug/karma.conf.js deleted file mode 100644 index 103a82d..0000000 --- a/node_modules/body-parser/node_modules/debug/karma.conf.js +++ /dev/null @@ -1,70 +0,0 @@ -// Karma configuration -// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) - -module.exports = function(config) { - config.set({ - - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: '', - - - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['mocha', 'chai', 'sinon'], - - - // list of files / patterns to load in the browser - files: [ - 'dist/debug.js', - 'test/*spec.js' - ], - - - // list of files to exclude - exclude: [ - 'src/node.js' - ], - - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - }, - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], - - - // web server port - port: 9876, - - - // enable / disable colors in the output (reporters and logs) - colors: true, - - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: true, - - - // start these browsers - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: ['PhantomJS'], - - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: false, - - // Concurrency level - // how many browser should be started simultaneous - concurrency: Infinity - }) -} diff --git a/node_modules/body-parser/node_modules/debug/node.js b/node_modules/body-parser/node_modules/debug/node.js deleted file mode 100644 index 7fc36fe..0000000 --- a/node_modules/body-parser/node_modules/debug/node.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./src/node'); diff --git a/node_modules/body-parser/node_modules/debug/package.json b/node_modules/body-parser/node_modules/debug/package.json deleted file mode 100644 index 86502c7..0000000 --- a/node_modules/body-parser/node_modules/debug/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "_from": "debug@2.6.9", - "_id": "debug@2.6.9", - "_inBundle": false, - "_integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "_location": "/body-parser/debug", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "debug@2.6.9", - "name": "debug", - "escapedName": "debug", - "rawSpec": "2.6.9", - "saveSpec": null, - "fetchSpec": "2.6.9" - }, - "_requiredBy": [ - "/body-parser" - ], - "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "_shasum": "5d128515df134ff327e90a4c93f4e077a536341f", - "_spec": "debug@2.6.9", - "_where": "/var/www/html/gtg2nodejs/node_modules/body-parser", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "browser": "./src/browser.js", - "bugs": { - "url": "https://github.com/visionmedia/debug/issues" - }, - "bundleDependencies": false, - "component": { - "scripts": { - "debug/index.js": "browser.js", - "debug/debug.js": "debug.js" - } - }, - "contributors": [ - { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io" - }, - { - "name": "Andrew Rhyne", - "email": "rhyneandrew@gmail.com" - } - ], - "dependencies": { - "ms": "2.0.0" - }, - "deprecated": false, - "description": "small debugging utility", - "devDependencies": { - "browserify": "9.0.3", - "chai": "^3.5.0", - "concurrently": "^3.1.0", - "coveralls": "^2.11.15", - "eslint": "^3.12.1", - "istanbul": "^0.4.5", - "karma": "^1.3.0", - "karma-chai": "^0.1.0", - "karma-mocha": "^1.3.0", - "karma-phantomjs-launcher": "^1.0.2", - "karma-sinon": "^1.0.5", - "mocha": "^3.2.0", - "mocha-lcov-reporter": "^1.2.0", - "rimraf": "^2.5.4", - "sinon": "^1.17.6", - "sinon-chai": "^2.8.0" - }, - "homepage": "https://github.com/visionmedia/debug#readme", - "keywords": [ - "debug", - "log", - "debugger" - ], - "license": "MIT", - "main": "./src/index.js", - "name": "debug", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "version": "2.6.9" -} diff --git a/node_modules/body-parser/node_modules/debug/src/browser.js b/node_modules/body-parser/node_modules/debug/src/browser.js deleted file mode 100644 index 7106924..0000000 --- a/node_modules/body-parser/node_modules/debug/src/browser.js +++ /dev/null @@ -1,185 +0,0 @@ -/** - * This is the web browser implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = 'undefined' != typeof chrome - && 'undefined' != typeof chrome.storage - ? chrome.storage.local - : localstorage(); - -/** - * Colors. - */ - -exports.colors = [ - 'lightseagreen', - 'forestgreen', - 'goldenrod', - 'dodgerblue', - 'darkorchid', - 'crimson' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { - return true; - } - - // is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || - // double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -exports.formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (err) { - return '[UnexpectedJSONParseError]: ' + err.message; - } -}; - - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs(args) { - var useColors = this.useColors; - - args[0] = (useColors ? '%c' : '') - + this.namespace - + (useColors ? ' %c' : ' ') - + args[0] - + (useColors ? '%c ' : ' ') - + '+' + exports.humanize(this.diff); - - if (!useColors) return; - - var c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit') - - // the final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - var index = 0; - var lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, function(match) { - if ('%%' === match) return; - index++; - if ('%c' === match) { - // we only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); -} - -/** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ - -function log() { - // this hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return 'object' === typeof console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - try { - if (null == namespaces) { - exports.storage.removeItem('debug'); - } else { - exports.storage.debug = namespaces; - } - } catch(e) {} -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - var r; - try { - r = exports.storage.debug; - } catch(e) {} - - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } - - return r; -} - -/** - * Enable namespaces listed in `localStorage.debug` initially. - */ - -exports.enable(load()); - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage() { - try { - return window.localStorage; - } catch (e) {} -} diff --git a/node_modules/body-parser/node_modules/debug/src/debug.js b/node_modules/body-parser/node_modules/debug/src/debug.js deleted file mode 100644 index 6a5e3fc..0000000 --- a/node_modules/body-parser/node_modules/debug/src/debug.js +++ /dev/null @@ -1,202 +0,0 @@ - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; -exports.coerce = coerce; -exports.disable = disable; -exports.enable = enable; -exports.enabled = enabled; -exports.humanize = require('ms'); - -/** - * The currently active debug mode names, and names to skip. - */ - -exports.names = []; -exports.skips = []; - -/** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - -exports.formatters = {}; - -/** - * Previous log timestamp. - */ - -var prevTime; - -/** - * Select a color. - * @param {String} namespace - * @return {Number} - * @api private - */ - -function selectColor(namespace) { - var hash = 0, i; - - for (i in namespace) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return exports.colors[Math.abs(hash) % exports.colors.length]; -} - -/** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - -function createDebug(namespace) { - - function debug() { - // disabled? - if (!debug.enabled) return; - - var self = debug; - - // set `diff` timestamp - var curr = +new Date(); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - // turn the `arguments` into a proper Array - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - - args[0] = exports.coerce(args[0]); - - if ('string' !== typeof args[0]) { - // anything else let's inspect with %O - args.unshift('%O'); - } - - // apply any `formatters` transformations - var index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { - // if we encounter an escaped % then don't increase the array index - if (match === '%%') return match; - index++; - var formatter = exports.formatters[format]; - if ('function' === typeof formatter) { - var val = args[index]; - match = formatter.call(self, val); - - // now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - // apply env-specific formatting (colors, etc.) - exports.formatArgs.call(self, args); - - var logFn = debug.log || exports.log || console.log.bind(console); - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.enabled = exports.enabled(namespace); - debug.useColors = exports.useColors(); - debug.color = selectColor(namespace); - - // env-specific initialization logic for debug instances - if ('function' === typeof exports.init) { - exports.init(debug); - } - - return debug; -} - -/** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - -function enable(namespaces) { - exports.save(namespaces); - - exports.names = []; - exports.skips = []; - - var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - var len = split.length; - - for (var i = 0; i < len; i++) { - if (!split[i]) continue; // ignore empty strings - namespaces = split[i].replace(/\*/g, '.*?'); - if (namespaces[0] === '-') { - exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - exports.names.push(new RegExp('^' + namespaces + '$')); - } - } -} - -/** - * Disable debug output. - * - * @api public - */ - -function disable() { - exports.enable(''); -} - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -function enabled(name) { - var i, len; - for (i = 0, len = exports.skips.length; i < len; i++) { - if (exports.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = exports.names.length; i < len; i++) { - if (exports.names[i].test(name)) { - return true; - } - } - return false; -} - -/** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function coerce(val) { - if (val instanceof Error) return val.stack || val.message; - return val; -} diff --git a/node_modules/body-parser/node_modules/debug/src/index.js b/node_modules/body-parser/node_modules/debug/src/index.js deleted file mode 100644 index e12cf4d..0000000 --- a/node_modules/body-parser/node_modules/debug/src/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Detect Electron renderer process, which is node, but we should - * treat as a browser. - */ - -if (typeof process !== 'undefined' && process.type === 'renderer') { - module.exports = require('./browser.js'); -} else { - module.exports = require('./node.js'); -} diff --git a/node_modules/body-parser/node_modules/debug/src/inspector-log.js b/node_modules/body-parser/node_modules/debug/src/inspector-log.js deleted file mode 100644 index 60ea6c0..0000000 --- a/node_modules/body-parser/node_modules/debug/src/inspector-log.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = inspectorLog; - -// black hole -const nullStream = new (require('stream').Writable)(); -nullStream._write = () => {}; - -/** - * Outputs a `console.log()` to the Node.js Inspector console *only*. - */ -function inspectorLog() { - const stdout = console._stdout; - console._stdout = nullStream; - console.log.apply(console, arguments); - console._stdout = stdout; -} diff --git a/node_modules/body-parser/node_modules/debug/src/node.js b/node_modules/body-parser/node_modules/debug/src/node.js deleted file mode 100644 index b15109c..0000000 --- a/node_modules/body-parser/node_modules/debug/src/node.js +++ /dev/null @@ -1,248 +0,0 @@ -/** - * Module dependencies. - */ - -var tty = require('tty'); -var util = require('util'); - -/** - * This is the Node.js implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.init = init; -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; - -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -/** - * Build up the default `inspectOpts` object from the environment variables. - * - * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js - */ - -exports.inspectOpts = Object.keys(process.env).filter(function (key) { - return /^debug_/i.test(key); -}).reduce(function (obj, key) { - // camel-case - var prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); - - // coerce string value into JS value - var val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) val = true; - else if (/^(no|off|false|disabled)$/i.test(val)) val = false; - else if (val === 'null') val = null; - else val = Number(val); - - obj[prop] = val; - return obj; -}, {}); - -/** - * The file descriptor to write the `debug()` calls to. - * Set the `DEBUG_FD` env variable to override with another value. i.e.: - * - * $ DEBUG_FD=3 node script.js 3>debug.log - */ - -var fd = parseInt(process.env.DEBUG_FD, 10) || 2; - -if (1 !== fd && 2 !== fd) { - util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')() -} - -var stream = 1 === fd ? process.stdout : - 2 === fd ? process.stderr : - createWritableStdioStream(fd); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - return 'colors' in exports.inspectOpts - ? Boolean(exports.inspectOpts.colors) - : tty.isatty(fd); -} - -/** - * Map %o to `util.inspect()`, all on a single line. - */ - -exports.formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts) - .split('\n').map(function(str) { - return str.trim() - }).join(' '); -}; - -/** - * Map %o to `util.inspect()`, allowing multiple lines if needed. - */ - -exports.formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); -}; - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs(args) { - var name = this.namespace; - var useColors = this.useColors; - - if (useColors) { - var c = this.color; - var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; - - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); - } else { - args[0] = new Date().toUTCString() - + ' ' + name + ' ' + args[0]; - } -} - -/** - * Invokes `util.format()` with the specified arguments and writes to `stream`. - */ - -function log() { - return stream.write(util.format.apply(util, arguments) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - if (null == namespaces) { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } else { - process.env.DEBUG = namespaces; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * Copied from `node/src/node.js`. - * - * XXX: It's lame that node doesn't expose this API out-of-the-box. It also - * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. - */ - -function createWritableStdioStream (fd) { - var stream; - var tty_wrap = process.binding('tty_wrap'); - - // Note stream._type is used for test-module-load-list.js - - switch (tty_wrap.guessHandleType(fd)) { - case 'TTY': - stream = new tty.WriteStream(fd); - stream._type = 'tty'; - - // Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - case 'FILE': - var fs = require('fs'); - stream = new fs.SyncWriteStream(fd, { autoClose: false }); - stream._type = 'fs'; - break; - - case 'PIPE': - case 'TCP': - var net = require('net'); - stream = new net.Socket({ - fd: fd, - readable: false, - writable: true - }); - - // FIXME Should probably have an option in net.Socket to create a - // stream from an existing fd which is writable only. But for now - // we'll just add this hack and set the `readable` member to false. - // Test: ./node test/fixtures/echo.js < /etc/passwd - stream.readable = false; - stream.read = null; - stream._type = 'pipe'; - - // FIXME Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - default: - // Probably an error on in uv_guess_handle() - throw new Error('Implement me. Unknown stream file type!'); - } - - // For supporting legacy API we put the FD here. - stream.fd = fd; - - stream._isStdio = true; - - return stream; -} - -/** - * Init logic for `debug` instances. - * - * Create a new `inspectOpts` object in case `useColors` is set - * differently for a particular `debug` instance. - */ - -function init (debug) { - debug.inspectOpts = {}; - - var keys = Object.keys(exports.inspectOpts); - for (var i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} - -/** - * Enable namespaces listed in `process.env.DEBUG` initially. - */ - -exports.enable(load()); diff --git a/node_modules/body-parser/node_modules/http-errors/HISTORY.md b/node_modules/body-parser/node_modules/http-errors/HISTORY.md deleted file mode 100644 index cba86e2..0000000 --- a/node_modules/body-parser/node_modules/http-errors/HISTORY.md +++ /dev/null @@ -1,132 +0,0 @@ -2018-03-29 / 1.6.3 -================== - - * deps: depd@~1.1.2 - - perf: remove argument reassignment - * deps: setprototypeof@1.1.0 - * deps: statuses@'>= 1.3.1 < 2' - -2017-08-04 / 1.6.2 -================== - - * deps: depd@1.1.1 - - Remove unnecessary `Buffer` loading - -2017-02-20 / 1.6.1 -================== - - * deps: setprototypeof@1.0.3 - - Fix shim for old browsers - -2017-02-14 / 1.6.0 -================== - - * Accept custom 4xx and 5xx status codes in factory - * Add deprecation message to `"I'mateapot"` export - * Deprecate passing status code as anything except first argument in factory - * Deprecate using non-error status codes - * Make `message` property enumerable for `HttpError`s - -2016-11-16 / 1.5.1 -================== - - * deps: inherits@2.0.3 - - Fix issue loading in browser - * deps: setprototypeof@1.0.2 - * deps: statuses@'>= 1.3.1 < 2' - -2016-05-18 / 1.5.0 -================== - - * Support new code `421 Misdirected Request` - * Use `setprototypeof` module to replace `__proto__` setting - * deps: statuses@'>= 1.3.0 < 2' - - Add `421 Misdirected Request` - - perf: enable strict mode - * perf: enable strict mode - -2016-01-28 / 1.4.0 -================== - - * Add `HttpError` export, for `err instanceof createError.HttpError` - * deps: inherits@2.0.1 - * deps: statuses@'>= 1.2.1 < 2' - - Fix message for status 451 - - Remove incorrect nginx status code - -2015-02-02 / 1.3.1 -================== - - * Fix regression where status can be overwritten in `createError` `props` - -2015-02-01 / 1.3.0 -================== - - * Construct errors using defined constructors from `createError` - * Fix error names that are not identifiers - - `createError["I'mateapot"]` is now `createError.ImATeapot` - * Set a meaningful `name` property on constructed errors - -2014-12-09 / 1.2.8 -================== - - * Fix stack trace from exported function - * Remove `arguments.callee` usage - -2014-10-14 / 1.2.7 -================== - - * Remove duplicate line - -2014-10-02 / 1.2.6 -================== - - * Fix `expose` to be `true` for `ClientError` constructor - -2014-09-28 / 1.2.5 -================== - - * deps: statuses@1 - -2014-09-21 / 1.2.4 -================== - - * Fix dependency version to work with old `npm`s - -2014-09-21 / 1.2.3 -================== - - * deps: statuses@~1.1.0 - -2014-09-21 / 1.2.2 -================== - - * Fix publish error - -2014-09-21 / 1.2.1 -================== - - * Support Node.js 0.6 - * Use `inherits` instead of `util` - -2014-09-09 / 1.2.0 -================== - - * Fix the way inheriting functions - * Support `expose` being provided in properties argument - -2014-09-08 / 1.1.0 -================== - - * Default status to 500 - * Support provided `error` to extend - -2014-09-08 / 1.0.1 -================== - - * Fix accepting string message - -2014-09-08 / 1.0.0 -================== - - * Initial release diff --git a/node_modules/body-parser/node_modules/http-errors/LICENSE b/node_modules/body-parser/node_modules/http-errors/LICENSE deleted file mode 100644 index 82af4df..0000000 --- a/node_modules/body-parser/node_modules/http-errors/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.com -Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/body-parser/node_modules/http-errors/README.md b/node_modules/body-parser/node_modules/http-errors/README.md deleted file mode 100644 index 79663d8..0000000 --- a/node_modules/body-parser/node_modules/http-errors/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# http-errors - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Create HTTP errors for Express, Koa, Connect, etc. with ease. - -## Install - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```bash -$ npm install http-errors -``` - -## Example - -```js -var createError = require('http-errors') -var express = require('express') -var app = express() - -app.use(function (req, res, next) { - if (!req.user) return next(createError(401, 'Please login to view this page.')) - next() -}) -``` - -## API - -This is the current API, currently extracted from Koa and subject to change. - -All errors inherit from JavaScript `Error` and the exported `createError.HttpError`. - -### Error Properties - -- `expose` - can be used to signal if `message` should be sent to the client, - defaulting to `false` when `status` >= 500 -- `headers` - can be an object of header names to values to be sent to the - client, defaulting to `undefined`. When defined, the key names should all - be lower-cased -- `message` - the traditional error message, which should be kept short and all - single line -- `status` - the status code of the error, mirroring `statusCode` for general - compatibility -- `statusCode` - the status code of the error, defaulting to `500` - -### createError([status], [message], [properties]) - - - -```js -var err = createError(404, 'This video does not exist!') -``` - -- `status: 500` - the status code as a number -- `message` - the message of the error, defaulting to node's text for that status code. -- `properties` - custom properties to attach to the object - -### new createError\[code || name\](\[msg]\)) - - - -```js -var err = new createError.NotFound() -``` - -- `code` - the status code as a number -- `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`. - -#### List of all constructors - -|Status Code|Constructor Name | -|-----------|-----------------------------| -|400 |BadRequest | -|401 |Unauthorized | -|402 |PaymentRequired | -|403 |Forbidden | -|404 |NotFound | -|405 |MethodNotAllowed | -|406 |NotAcceptable | -|407 |ProxyAuthenticationRequired | -|408 |RequestTimeout | -|409 |Conflict | -|410 |Gone | -|411 |LengthRequired | -|412 |PreconditionFailed | -|413 |PayloadTooLarge | -|414 |URITooLong | -|415 |UnsupportedMediaType | -|416 |RangeNotSatisfiable | -|417 |ExpectationFailed | -|418 |ImATeapot | -|421 |MisdirectedRequest | -|422 |UnprocessableEntity | -|423 |Locked | -|424 |FailedDependency | -|425 |UnorderedCollection | -|426 |UpgradeRequired | -|428 |PreconditionRequired | -|429 |TooManyRequests | -|431 |RequestHeaderFieldsTooLarge | -|451 |UnavailableForLegalReasons | -|500 |InternalServerError | -|501 |NotImplemented | -|502 |BadGateway | -|503 |ServiceUnavailable | -|504 |GatewayTimeout | -|505 |HTTPVersionNotSupported | -|506 |VariantAlsoNegotiates | -|507 |InsufficientStorage | -|508 |LoopDetected | -|509 |BandwidthLimitExceeded | -|510 |NotExtended | -|511 |NetworkAuthenticationRequired| - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/http-errors.svg -[npm-url]: https://npmjs.org/package/http-errors -[node-version-image]: https://img.shields.io/node/v/http-errors.svg -[node-version-url]: https://nodejs.org/en/download/ -[travis-image]: https://img.shields.io/travis/jshttp/http-errors.svg -[travis-url]: https://travis-ci.org/jshttp/http-errors -[coveralls-image]: https://img.shields.io/coveralls/jshttp/http-errors.svg -[coveralls-url]: https://coveralls.io/r/jshttp/http-errors -[downloads-image]: https://img.shields.io/npm/dm/http-errors.svg -[downloads-url]: https://npmjs.org/package/http-errors diff --git a/node_modules/body-parser/node_modules/http-errors/index.js b/node_modules/body-parser/node_modules/http-errors/index.js deleted file mode 100644 index 9509303..0000000 --- a/node_modules/body-parser/node_modules/http-errors/index.js +++ /dev/null @@ -1,260 +0,0 @@ -/*! - * http-errors - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2016 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var deprecate = require('depd')('http-errors') -var setPrototypeOf = require('setprototypeof') -var statuses = require('statuses') -var inherits = require('inherits') - -/** - * Module exports. - * @public - */ - -module.exports = createError -module.exports.HttpError = createHttpErrorConstructor() - -// Populate exports for all constructors -populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError) - -/** - * Get the code class of a status code. - * @private - */ - -function codeClass (status) { - return Number(String(status).charAt(0) + '00') -} - -/** - * Create a new HTTP Error. - * - * @returns {Error} - * @public - */ - -function createError () { - // so much arity going on ~_~ - var err - var msg - var status = 500 - var props = {} - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i] - if (arg instanceof Error) { - err = arg - status = err.status || err.statusCode || status - continue - } - switch (typeof arg) { - case 'string': - msg = arg - break - case 'number': - status = arg - if (i !== 0) { - deprecate('non-first-argument status code; replace with createError(' + arg + ', ...)') - } - break - case 'object': - props = arg - break - } - } - - if (typeof status === 'number' && (status < 400 || status >= 600)) { - deprecate('non-error status code; use only 4xx or 5xx status codes') - } - - if (typeof status !== 'number' || - (!statuses[status] && (status < 400 || status >= 600))) { - status = 500 - } - - // constructor - var HttpError = createError[status] || createError[codeClass(status)] - - if (!err) { - // create error - err = HttpError - ? new HttpError(msg) - : new Error(msg || statuses[status]) - Error.captureStackTrace(err, createError) - } - - if (!HttpError || !(err instanceof HttpError) || err.status !== status) { - // add properties to generic error - err.expose = status < 500 - err.status = err.statusCode = status - } - - for (var key in props) { - if (key !== 'status' && key !== 'statusCode') { - err[key] = props[key] - } - } - - return err -} - -/** - * Create HTTP error abstract base class. - * @private - */ - -function createHttpErrorConstructor () { - function HttpError () { - throw new TypeError('cannot construct abstract class') - } - - inherits(HttpError, Error) - - return HttpError -} - -/** - * Create a constructor for a client error. - * @private - */ - -function createClientErrorConstructor (HttpError, name, code) { - var className = name.match(/Error$/) ? name : name + 'Error' - - function ClientError (message) { - // create the error object - var msg = message != null ? message : statuses[code] - var err = new Error(msg) - - // capture a stack trace to the construction point - Error.captureStackTrace(err, ClientError) - - // adjust the [[Prototype]] - setPrototypeOf(err, ClientError.prototype) - - // redefine the error message - Object.defineProperty(err, 'message', { - enumerable: true, - configurable: true, - value: msg, - writable: true - }) - - // redefine the error name - Object.defineProperty(err, 'name', { - enumerable: false, - configurable: true, - value: className, - writable: true - }) - - return err - } - - inherits(ClientError, HttpError) - - ClientError.prototype.status = code - ClientError.prototype.statusCode = code - ClientError.prototype.expose = true - - return ClientError -} - -/** - * Create a constructor for a server error. - * @private - */ - -function createServerErrorConstructor (HttpError, name, code) { - var className = name.match(/Error$/) ? name : name + 'Error' - - function ServerError (message) { - // create the error object - var msg = message != null ? message : statuses[code] - var err = new Error(msg) - - // capture a stack trace to the construction point - Error.captureStackTrace(err, ServerError) - - // adjust the [[Prototype]] - setPrototypeOf(err, ServerError.prototype) - - // redefine the error message - Object.defineProperty(err, 'message', { - enumerable: true, - configurable: true, - value: msg, - writable: true - }) - - // redefine the error name - Object.defineProperty(err, 'name', { - enumerable: false, - configurable: true, - value: className, - writable: true - }) - - return err - } - - inherits(ServerError, HttpError) - - ServerError.prototype.status = code - ServerError.prototype.statusCode = code - ServerError.prototype.expose = false - - return ServerError -} - -/** - * Populate the exports object with constructors for every error class. - * @private - */ - -function populateConstructorExports (exports, codes, HttpError) { - codes.forEach(function forEachCode (code) { - var CodeError - var name = toIdentifier(statuses[code]) - - switch (codeClass(code)) { - case 400: - CodeError = createClientErrorConstructor(HttpError, name, code) - break - case 500: - CodeError = createServerErrorConstructor(HttpError, name, code) - break - } - - if (CodeError) { - // export the constructor - exports[code] = CodeError - exports[name] = CodeError - } - }) - - // backwards-compatibility - exports["I'mateapot"] = deprecate.function(exports.ImATeapot, - '"I\'mateapot"; use "ImATeapot" instead') -} - -/** - * Convert a string of words to a JavaScript identifier. - * @private - */ - -function toIdentifier (str) { - return str.split(' ').map(function (token) { - return token.slice(0, 1).toUpperCase() + token.slice(1) - }).join('').replace(/[^ _0-9a-z]/gi, '') -} diff --git a/node_modules/body-parser/node_modules/http-errors/package.json b/node_modules/body-parser/node_modules/http-errors/package.json deleted file mode 100644 index 7f76e63..0000000 --- a/node_modules/body-parser/node_modules/http-errors/package.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "_from": "http-errors@~1.6.3", - "_id": "http-errors@1.6.3", - "_inBundle": false, - "_integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "_location": "/body-parser/http-errors", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "http-errors@~1.6.3", - "name": "http-errors", - "escapedName": "http-errors", - "rawSpec": "~1.6.3", - "saveSpec": null, - "fetchSpec": "~1.6.3" - }, - "_requiredBy": [ - "/body-parser" - ], - "_resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "_shasum": "8b55680bb4be283a0b5bf4ea2e38580be1d9320d", - "_spec": "http-errors@~1.6.3", - "_where": "/var/www/html/gtg2nodejs/node_modules/body-parser", - "author": { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - }, - "bugs": { - "url": "https://github.com/jshttp/http-errors/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Alan Plum", - "email": "me@pluma.io" - }, - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - } - ], - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - }, - "deprecated": false, - "description": "Create HTTP error objects", - "devDependencies": { - "eslint": "4.18.1", - "eslint-config-standard": "11.0.0", - "eslint-plugin-import": "2.9.0", - "eslint-plugin-markdown": "1.0.0-beta.6", - "eslint-plugin-node": "6.0.1", - "eslint-plugin-promise": "3.6.0", - "eslint-plugin-standard": "3.0.1", - "istanbul": "0.4.5", - "mocha": "1.21.5" - }, - "engines": { - "node": ">= 0.6" - }, - "files": [ - "index.js", - "HISTORY.md", - "LICENSE", - "README.md" - ], - "homepage": "https://github.com/jshttp/http-errors#readme", - "keywords": [ - "http", - "error" - ], - "license": "MIT", - "name": "http-errors", - "repository": { - "type": "git", - "url": "git+https://github.com/jshttp/http-errors.git" - }, - "scripts": { - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --reporter spec --bail", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" - }, - "version": "1.6.3" -} diff --git a/node_modules/body-parser/package.json b/node_modules/body-parser/package.json deleted file mode 100644 index 7099c39..0000000 --- a/node_modules/body-parser/package.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "_from": "body-parser@1.18.3", - "_id": "body-parser@1.18.3", - "_inBundle": false, - "_integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", - "_location": "/body-parser", - "_phantomChildren": { - "depd": "1.1.2", - "inherits": "2.0.3", - "ms": "2.0.0", - "setprototypeof": "1.1.0", - "statuses": "1.4.0" - }, - "_requested": { - "type": "version", - "registry": true, - "raw": "body-parser@1.18.3", - "name": "body-parser", - "escapedName": "body-parser", - "rawSpec": "1.18.3", - "saveSpec": null, - "fetchSpec": "1.18.3" - }, - "_requiredBy": [ - "/express" - ], - "_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", - "_shasum": "5b292198ffdd553b3a0f20ded0592b956955c8b4", - "_spec": "body-parser@1.18.3", - "_where": "/var/www/html/gtg2nodejs/node_modules/express", - "bugs": { - "url": "https://github.com/expressjs/body-parser/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - } - ], - "dependencies": { - "bytes": "3.0.0", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "~1.6.3", - "iconv-lite": "0.4.23", - "on-finished": "~2.3.0", - "qs": "6.5.2", - "raw-body": "2.3.3", - "type-is": "~1.6.16" - }, - "deprecated": false, - "description": "Node.js body parsing middleware", - "devDependencies": { - "eslint": "4.19.1", - "eslint-config-standard": "11.0.0", - "eslint-plugin-import": "2.11.0", - "eslint-plugin-markdown": "1.0.0-beta.6", - "eslint-plugin-node": "6.0.1", - "eslint-plugin-promise": "3.7.0", - "eslint-plugin-standard": "3.1.0", - "istanbul": "0.4.5", - "methods": "1.1.2", - "mocha": "2.5.3", - "safe-buffer": "5.1.2", - "supertest": "1.1.0" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "lib/", - "LICENSE", - "HISTORY.md", - "index.js" - ], - "homepage": "https://github.com/expressjs/body-parser#readme", - "license": "MIT", - "name": "body-parser", - "repository": { - "type": "git", - "url": "git+https://github.com/expressjs/body-parser.git" - }, - "scripts": { - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --require test/support/env --reporter spec --check-leaks --bail test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/" - }, - "version": "1.18.3" -} diff --git a/node_modules/bytes/History.md b/node_modules/bytes/History.md deleted file mode 100644 index 13d463a..0000000 --- a/node_modules/bytes/History.md +++ /dev/null @@ -1,82 +0,0 @@ -3.0.0 / 2017-08-31 -================== - - * Change "kB" to "KB" in format output - * Remove support for Node.js 0.6 - * Remove support for ComponentJS - -2.5.0 / 2017-03-24 -================== - - * Add option "unit" - -2.4.0 / 2016-06-01 -================== - - * Add option "unitSeparator" - -2.3.0 / 2016-02-15 -================== - - * Drop partial bytes on all parsed units - * Fix non-finite numbers to `.format` to return `null` - * Fix parsing byte string that looks like hex - * perf: hoist regular expressions - -2.2.0 / 2015-11-13 -================== - - * add option "decimalPlaces" - * add option "fixedDecimals" - -2.1.0 / 2015-05-21 -================== - - * add `.format` export - * add `.parse` export - -2.0.2 / 2015-05-20 -================== - - * remove map recreation - * remove unnecessary object construction - -2.0.1 / 2015-05-07 -================== - - * fix browserify require - * remove node.extend dependency - -2.0.0 / 2015-04-12 -================== - - * add option "case" - * add option "thousandsSeparator" - * return "null" on invalid parse input - * support proper round-trip: bytes(bytes(num)) === num - * units no longer case sensitive when parsing - -1.0.0 / 2014-05-05 -================== - - * add negative support. fixes #6 - -0.3.0 / 2014-03-19 -================== - - * added terabyte support - -0.2.1 / 2013-04-01 -================== - - * add .component - -0.2.0 / 2012-10-28 -================== - - * bytes(200).should.eql('200b') - -0.1.0 / 2012-07-04 -================== - - * add bytes to string conversion [yields] diff --git a/node_modules/bytes/LICENSE b/node_modules/bytes/LICENSE deleted file mode 100644 index 63e95a9..0000000 --- a/node_modules/bytes/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2012-2014 TJ Holowaychuk -Copyright (c) 2015 Jed Watson - -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/bytes/Readme.md b/node_modules/bytes/Readme.md deleted file mode 100644 index 9b53745..0000000 --- a/node_modules/bytes/Readme.md +++ /dev/null @@ -1,125 +0,0 @@ -# Bytes utility - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Utility to parse a string bytes (ex: `1TB`) to bytes (`1099511627776`) and vice-versa. - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```bash -$ npm install bytes -``` - -## Usage - -```js -var bytes = require('bytes'); -``` - -#### bytes.format(number value, [options]): string|null - -Format the given value in bytes into a string. If the value is negative, it is kept as such. If it is a float, it is - rounded. - -**Arguments** - -| Name | Type | Description | -|---------|----------|--------------------| -| value | `number` | Value in bytes | -| options | `Object` | Conversion options | - -**Options** - -| Property | Type | Description | -|-------------------|--------|-----------------------------------------------------------------------------------------| -| decimalPlaces | `number`|`null` | Maximum number of decimal places to include in output. Default value to `2`. | -| fixedDecimals | `boolean`|`null` | Whether to always display the maximum number of decimal places. Default value to `false` | -| thousandsSeparator | `string`|`null` | Example of values: `' '`, `','` and `.`... Default value to `''`. | -| unit | `string`|`null` | The unit in which the result will be returned (B/KB/MB/GB/TB). Default value to `''` (which means auto detect). | -| unitSeparator | `string`|`null` | Separator to use between number and unit. Default value to `''`. | - -**Returns** - -| Name | Type | Description | -|---------|------------------|-------------------------------------------------| -| results | `string`|`null` | Return null upon error. String value otherwise. | - -**Example** - -```js -bytes(1024); -// output: '1KB' - -bytes(1000); -// output: '1000B' - -bytes(1000, {thousandsSeparator: ' '}); -// output: '1 000B' - -bytes(1024 * 1.7, {decimalPlaces: 0}); -// output: '2KB' - -bytes(1024, {unitSeparator: ' '}); -// output: '1 KB' - -``` - -#### bytes.parse(string|number value): number|null - -Parse the string value into an integer in bytes. If no unit is given, or `value` -is a number, it is assumed the value is in bytes. - -Supported units and abbreviations are as follows and are case-insensitive: - - * `b` for bytes - * `kb` for kilobytes - * `mb` for megabytes - * `gb` for gigabytes - * `tb` for terabytes - -The units are in powers of two, not ten. This means 1kb = 1024b according to this parser. - -**Arguments** - -| Name | Type | Description | -|---------------|--------|--------------------| -| value | `string`|`number` | String to parse, or number in bytes. | - -**Returns** - -| Name | Type | Description | -|---------|-------------|-------------------------| -| results | `number`|`null` | Return null upon error. Value in bytes otherwise. | - -**Example** - -```js -bytes('1KB'); -// output: 1024 - -bytes('1024'); -// output: 1024 - -bytes(1024); -// output: 1024 -``` - -## License - -[MIT](LICENSE) - -[downloads-image]: https://img.shields.io/npm/dm/bytes.svg -[downloads-url]: https://npmjs.org/package/bytes -[npm-image]: https://img.shields.io/npm/v/bytes.svg -[npm-url]: https://npmjs.org/package/bytes -[travis-image]: https://img.shields.io/travis/visionmedia/bytes.js/master.svg -[travis-url]: https://travis-ci.org/visionmedia/bytes.js -[coveralls-image]: https://img.shields.io/coveralls/visionmedia/bytes.js/master.svg -[coveralls-url]: https://coveralls.io/r/visionmedia/bytes.js?branch=master diff --git a/node_modules/bytes/index.js b/node_modules/bytes/index.js deleted file mode 100644 index 1e39afd..0000000 --- a/node_modules/bytes/index.js +++ /dev/null @@ -1,159 +0,0 @@ -/*! - * bytes - * Copyright(c) 2012-2014 TJ Holowaychuk - * Copyright(c) 2015 Jed Watson - * MIT Licensed - */ - -'use strict'; - -/** - * Module exports. - * @public - */ - -module.exports = bytes; -module.exports.format = format; -module.exports.parse = parse; - -/** - * Module variables. - * @private - */ - -var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g; - -var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/; - -var map = { - b: 1, - kb: 1 << 10, - mb: 1 << 20, - gb: 1 << 30, - tb: ((1 << 30) * 1024) -}; - -var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb)$/i; - -/** - * Convert the given value in bytes into a string or parse to string to an integer in bytes. - * - * @param {string|number} value - * @param {{ - * case: [string], - * decimalPlaces: [number] - * fixedDecimals: [boolean] - * thousandsSeparator: [string] - * unitSeparator: [string] - * }} [options] bytes options. - * - * @returns {string|number|null} - */ - -function bytes(value, options) { - if (typeof value === 'string') { - return parse(value); - } - - if (typeof value === 'number') { - return format(value, options); - } - - return null; -} - -/** - * Format the given value in bytes into a string. - * - * If the value is negative, it is kept as such. If it is a float, - * it is rounded. - * - * @param {number} value - * @param {object} [options] - * @param {number} [options.decimalPlaces=2] - * @param {number} [options.fixedDecimals=false] - * @param {string} [options.thousandsSeparator=] - * @param {string} [options.unit=] - * @param {string} [options.unitSeparator=] - * - * @returns {string|null} - * @public - */ - -function format(value, options) { - if (!Number.isFinite(value)) { - return null; - } - - var mag = Math.abs(value); - var thousandsSeparator = (options && options.thousandsSeparator) || ''; - var unitSeparator = (options && options.unitSeparator) || ''; - var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2; - var fixedDecimals = Boolean(options && options.fixedDecimals); - var unit = (options && options.unit) || ''; - - if (!unit || !map[unit.toLowerCase()]) { - if (mag >= map.tb) { - unit = 'TB'; - } else if (mag >= map.gb) { - unit = 'GB'; - } else if (mag >= map.mb) { - unit = 'MB'; - } else if (mag >= map.kb) { - unit = 'KB'; - } else { - unit = 'B'; - } - } - - var val = value / map[unit.toLowerCase()]; - var str = val.toFixed(decimalPlaces); - - if (!fixedDecimals) { - str = str.replace(formatDecimalsRegExp, '$1'); - } - - if (thousandsSeparator) { - str = str.replace(formatThousandsRegExp, thousandsSeparator); - } - - return str + unitSeparator + unit; -} - -/** - * Parse the string value into an integer in bytes. - * - * If no unit is given, it is assumed the value is in bytes. - * - * @param {number|string} val - * - * @returns {number|null} - * @public - */ - -function parse(val) { - if (typeof val === 'number' && !isNaN(val)) { - return val; - } - - if (typeof val !== 'string') { - return null; - } - - // Test if the string passed is valid - var results = parseRegExp.exec(val); - var floatValue; - var unit = 'b'; - - if (!results) { - // Nothing could be extracted from the given string - floatValue = parseInt(val, 10); - unit = 'b' - } else { - // Retrieve the value and the unit - floatValue = parseFloat(results[1]); - unit = results[4].toLowerCase(); - } - - return Math.floor(map[unit] * floatValue); -} diff --git a/node_modules/bytes/package.json b/node_modules/bytes/package.json deleted file mode 100644 index a23de55..0000000 --- a/node_modules/bytes/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_from": "bytes@3.0.0", - "_id": "bytes@3.0.0", - "_inBundle": false, - "_integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", - "_location": "/bytes", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "bytes@3.0.0", - "name": "bytes", - "escapedName": "bytes", - "rawSpec": "3.0.0", - "saveSpec": null, - "fetchSpec": "3.0.0" - }, - "_requiredBy": [ - "/body-parser", - "/raw-body" - ], - "_resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "_shasum": "d32815404d689699f85a4ea4fa8755dd13a96048", - "_spec": "bytes@3.0.0", - "_where": "/var/www/html/gtg2nodejs/node_modules/body-parser", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "bugs": { - "url": "https://github.com/visionmedia/bytes.js/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jed Watson", - "email": "jed.watson@me.com" - }, - { - "name": "Théo FIDRY", - "email": "theo.fidry@gmail.com" - } - ], - "deprecated": false, - "description": "Utility to parse a string bytes to bytes and vice-versa", - "devDependencies": { - "mocha": "2.5.3", - "nyc": "10.3.2" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "History.md", - "LICENSE", - "Readme.md", - "index.js" - ], - "homepage": "https://github.com/visionmedia/bytes.js#readme", - "keywords": [ - "byte", - "bytes", - "utility", - "parse", - "parser", - "convert", - "converter" - ], - "license": "MIT", - "name": "bytes", - "repository": { - "type": "git", - "url": "git+https://github.com/visionmedia/bytes.js.git" - }, - "scripts": { - "test": "mocha --check-leaks --reporter spec", - "test-ci": "nyc --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - }, - "version": "3.0.0" -} diff --git a/node_modules/call-bind/.eslintignore b/node_modules/call-bind/.eslintignore deleted file mode 100644 index 404abb2..0000000 --- a/node_modules/call-bind/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -coverage/ diff --git a/node_modules/call-bind/.eslintrc b/node_modules/call-bind/.eslintrc deleted file mode 100644 index e5d3c9a..0000000 --- a/node_modules/call-bind/.eslintrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "func-name-matching": 0, - "id-length": 0, - "new-cap": [2, { - "capIsNewExceptions": [ - "GetIntrinsic", - ], - }], - "no-magic-numbers": 0, - "operator-linebreak": [2, "before"], - }, -} diff --git a/node_modules/call-bind/.github/FUNDING.yml b/node_modules/call-bind/.github/FUNDING.yml deleted file mode 100644 index c70c2ec..0000000 --- a/node_modules/call-bind/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -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/call-bind -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/call-bind/.nycrc b/node_modules/call-bind/.nycrc deleted file mode 100644 index 1826526..0000000 --- a/node_modules/call-bind/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/call-bind/CHANGELOG.md b/node_modules/call-bind/CHANGELOG.md deleted file mode 100644 index 62a3727..0000000 --- a/node_modules/call-bind/CHANGELOG.md +++ /dev/null @@ -1,42 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.0.2](https://github.com/ljharb/call-bind/compare/v1.0.1...v1.0.2) - 2021-01-11 - -### Commits - -- [Fix] properly include the receiver in the bound length [`dbae7bc`](https://github.com/ljharb/call-bind/commit/dbae7bc676c079a0d33c0a43e9ef92cb7b01345d) - -## [v1.0.1](https://github.com/ljharb/call-bind/compare/v1.0.0...v1.0.1) - 2021-01-08 - -### Commits - -- [Tests] migrate tests to Github Actions [`b6db284`](https://github.com/ljharb/call-bind/commit/b6db284c36f8ccd195b88a6764fe84b7223a0da1) -- [meta] do not publish github action workflow files [`ec7fe46`](https://github.com/ljharb/call-bind/commit/ec7fe46e60cfa4764ee943d2755f5e5a366e578e) -- [Fix] preserve original function’s length when possible [`adbceaa`](https://github.com/ljharb/call-bind/commit/adbceaa3cac4b41ea78bb19d7ccdbaaf7e0bdadb) -- [Tests] gather coverage data on every job [`d69e23c`](https://github.com/ljharb/call-bind/commit/d69e23cc65f101ba1d4c19bb07fa8eb0ec624be8) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`2fd3586`](https://github.com/ljharb/call-bind/commit/2fd3586c5d47b335364c14293114c6b625ae1f71) -- [Deps] update `get-intrinsic` [`f23e931`](https://github.com/ljharb/call-bind/commit/f23e9318cc271c2add8bb38cfded85ee7baf8eee) -- [Deps] update `get-intrinsic` [`72d9f44`](https://github.com/ljharb/call-bind/commit/72d9f44e184465ba8dd3fb48260bbcff234985f2) -- [meta] fix FUNDING.yml [`e723573`](https://github.com/ljharb/call-bind/commit/e723573438c5a68dcec31fb5d96ea6b7e4a93be8) -- [eslint] ignore coverage output [`15e76d2`](https://github.com/ljharb/call-bind/commit/15e76d28a5f43e504696401e5b31ebb78ee1b532) -- [meta] add Automatic Rebase and Require Allow Edits workflows [`8fa4dab`](https://github.com/ljharb/call-bind/commit/8fa4dabb23ba3dd7bb92c9571c1241c08b56e4b6) - -## v1.0.0 - 2020-10-30 - -### Commits - -- Initial commit [`306cf98`](https://github.com/ljharb/call-bind/commit/306cf98c7ec9e7ef66b653ec152277ac1381eb50) -- Tests [`e10d0bb`](https://github.com/ljharb/call-bind/commit/e10d0bbdadc7a10ecedc9a1c035112d3e368b8df) -- Implementation [`43852ed`](https://github.com/ljharb/call-bind/commit/43852eda0f187327b7fad2423ca972149a52bd65) -- npm init [`408f860`](https://github.com/ljharb/call-bind/commit/408f860b773a2f610805fd3613d0d71bac1b6249) -- [meta] add Automatic Rebase and Require Allow Edits workflows [`fb349b2`](https://github.com/ljharb/call-bind/commit/fb349b2e48defbec8b5ec8a8395cc8f69f220b13) -- [meta] add `auto-changelog` [`c4001fc`](https://github.com/ljharb/call-bind/commit/c4001fc43031799ef908211c98d3b0fb2b60fde4) -- [meta] add "funding"; create `FUNDING.yml` [`d4d6d29`](https://github.com/ljharb/call-bind/commit/d4d6d2974a14bc2e98830468eda7fe6d6a776717) -- [Tests] add `npm run lint` [`dedfb98`](https://github.com/ljharb/call-bind/commit/dedfb98bd0ecefb08ddb9a94061bd10cde4332af) -- Only apps should have lockfiles [`54ac776`](https://github.com/ljharb/call-bind/commit/54ac77653db45a7361dc153d2f478e743f110650) -- [meta] add `safe-publish-latest` [`9ea8e43`](https://github.com/ljharb/call-bind/commit/9ea8e435b950ce9b705559cd651039f9bf40140f) diff --git a/node_modules/call-bind/LICENSE b/node_modules/call-bind/LICENSE deleted file mode 100644 index 48f05d0..0000000 --- a/node_modules/call-bind/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Jordan Harband - -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/call-bind/README.md b/node_modules/call-bind/README.md deleted file mode 100644 index 53649eb..0000000 --- a/node_modules/call-bind/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# call-bind -Robustly `.call.bind()` a function. diff --git a/node_modules/call-bind/callBound.js b/node_modules/call-bind/callBound.js deleted file mode 100644 index 8374adf..0000000 --- a/node_modules/call-bind/callBound.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('get-intrinsic'); - -var callBind = require('./'); - -var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); - -module.exports = function callBoundIntrinsic(name, allowMissing) { - var intrinsic = GetIntrinsic(name, !!allowMissing); - if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { - return callBind(intrinsic); - } - return intrinsic; -}; diff --git a/node_modules/call-bind/index.js b/node_modules/call-bind/index.js deleted file mode 100644 index 6fa3e4a..0000000 --- a/node_modules/call-bind/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -var bind = require('function-bind'); -var GetIntrinsic = require('get-intrinsic'); - -var $apply = GetIntrinsic('%Function.prototype.apply%'); -var $call = GetIntrinsic('%Function.prototype.call%'); -var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); - -var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); -var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); -var $max = GetIntrinsic('%Math.max%'); - -if ($defineProperty) { - try { - $defineProperty({}, 'a', { value: 1 }); - } catch (e) { - // IE 8 has a broken defineProperty - $defineProperty = null; - } -} - -module.exports = function callBind(originalFunction) { - var func = $reflectApply(bind, $call, arguments); - if ($gOPD && $defineProperty) { - var desc = $gOPD(func, 'length'); - if (desc.configurable) { - // original length, plus the receiver, minus any additional arguments (after the receiver) - $defineProperty( - func, - 'length', - { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } - ); - } - } - return func; -}; - -var applyBind = function applyBind() { - return $reflectApply(bind, $apply, arguments); -}; - -if ($defineProperty) { - $defineProperty(module.exports, 'apply', { value: applyBind }); -} else { - module.exports.apply = applyBind; -} diff --git a/node_modules/call-bind/package.json b/node_modules/call-bind/package.json deleted file mode 100644 index 2a82b8b..0000000 --- a/node_modules/call-bind/package.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "_from": "call-bind@^1.0.2", - "_id": "call-bind@1.0.2", - "_inBundle": false, - "_integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "_location": "/call-bind", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "call-bind@^1.0.2", - "name": "call-bind", - "escapedName": "call-bind", - "rawSpec": "^1.0.2", - "saveSpec": null, - "fetchSpec": "^1.0.2" - }, - "_requiredBy": [ - "/is-regex" - ], - "_resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "_shasum": "b1d4e89e688119c3c9a903ad30abb2f6a919be3c", - "_spec": "call-bind@^1.0.2", - "_where": "/var/www/html/gtg2nodejs/node_modules/is-regex", - "author": { - "name": "Jordan Harband", - "email": "ljharb@gmail.com" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "bugs": { - "url": "https://github.com/ljharb/call-bind/issues" - }, - "bundleDependencies": false, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "deprecated": false, - "description": "Robustly `.call.bind()` a function", - "devDependencies": { - "@ljharb/eslint-config": "^17.3.0", - "aud": "^1.1.3", - "auto-changelog": "^2.2.1", - "eslint": "^7.17.0", - "nyc": "^10.3.2", - "safe-publish-latest": "^1.1.4", - "tape": "^5.1.1" - }, - "exports": { - ".": [ - { - "default": "./index.js" - }, - "./index.js" - ], - "./callBound": [ - { - "default": "./callBound.js" - }, - "./callBound.js" - ], - "./package.json": "./package.json" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "homepage": "https://github.com/ljharb/call-bind#readme", - "keywords": [ - "javascript", - "ecmascript", - "es", - "js", - "callbind", - "callbound", - "call", - "bind", - "bound", - "call-bind", - "call-bound", - "function", - "es-abstract" - ], - "license": "MIT", - "main": "index.js", - "name": "call-bind", - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/call-bind.git" - }, - "scripts": { - "lint": "eslint --ext=.js,.mjs .", - "posttest": "aud --production", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"", - "prepublish": "safe-publish-latest", - "pretest": "npm run lint", - "test": "npm run tests-only", - "tests-only": "nyc tape 'test/*'", - "version": "auto-changelog && git add CHANGELOG.md" - }, - "version": "1.0.2" -} diff --git a/node_modules/call-bind/test/callBound.js b/node_modules/call-bind/test/callBound.js deleted file mode 100644 index 209ce3c..0000000 --- a/node_modules/call-bind/test/callBound.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -var test = require('tape'); - -var callBound = require('../callBound'); - -test('callBound', function (t) { - // static primitive - t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself'); - t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself'); - - // static non-function object - t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself'); - t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself'); - t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself'); - t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself'); - - // static function - t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself'); - t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself'); - - // prototype primitive - t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself'); - t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself'); - - // prototype function - t.notEqual(callBound('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString does not yield itself'); - t.notEqual(callBound('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% does not yield itself'); - t.equal(callBound('Object.prototype.toString')(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original'); - t.equal(callBound('%Object.prototype.toString%')(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original'); - - t['throws']( - function () { callBound('does not exist'); }, - SyntaxError, - 'nonexistent intrinsic throws' - ); - t['throws']( - function () { callBound('does not exist', true); }, - SyntaxError, - 'allowMissing arg still throws for unknown intrinsic' - ); - - /* globals WeakRef: false */ - t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) { - st['throws']( - function () { callBound('WeakRef'); }, - TypeError, - 'real but absent intrinsic throws' - ); - st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception'); - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/call-bind/test/index.js b/node_modules/call-bind/test/index.js deleted file mode 100644 index bf6769c..0000000 --- a/node_modules/call-bind/test/index.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict'; - -var callBind = require('../'); -var bind = require('function-bind'); - -var test = require('tape'); - -/* - * older engines have length nonconfigurable - * in io.js v3, it is configurable except on bound functions, hence the .bind() - */ -var functionsHaveConfigurableLengths = !!( - Object.getOwnPropertyDescriptor - && Object.getOwnPropertyDescriptor(bind.call(function () {}), 'length').configurable -); - -test('callBind', function (t) { - var sentinel = { sentinel: true }; - var func = function (a, b) { - // eslint-disable-next-line no-invalid-this - return [this, a, b]; - }; - t.equal(func.length, 2, 'original function length is 2'); - t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args'); - t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args'); - t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args'); - - var bound = callBind(func); - t.equal(bound.length, func.length + 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); - t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with too few args'); - t.deepEqual(bound(1, 2), [1, 2, undefined], 'bound func with right args'); - t.deepEqual(bound(1, 2, 3), [1, 2, 3], 'bound func with too many args'); - - var boundR = callBind(func, sentinel); - t.equal(boundR.length, func.length, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); - t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args'); - t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args'); - t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args'); - - var boundArg = callBind(func, sentinel, 1); - t.equal(boundArg.length, func.length - 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); - t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args'); - t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg'); - t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args'); - - t.test('callBind.apply', function (st) { - var aBound = callBind.apply(func); - st.deepEqual(aBound(sentinel), [sentinel, undefined, undefined], 'apply-bound func with no args'); - st.deepEqual(aBound(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); - st.deepEqual(aBound(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); - - var aBoundArg = callBind.apply(func); - st.deepEqual(aBoundArg(sentinel, [1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with too many args'); - st.deepEqual(aBoundArg(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); - st.deepEqual(aBoundArg(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); - - var aBoundR = callBind.apply(func, sentinel); - st.deepEqual(aBoundR([1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with receiver and too many args'); - st.deepEqual(aBoundR([1, 2], 4), [sentinel, 1, 2], 'apply-bound func with receiver and right args'); - st.deepEqual(aBoundR([1], 4), [sentinel, 1, undefined], 'apply-bound func with receiver and too few args'); - - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/camelcase/index.js b/node_modules/camelcase/index.js deleted file mode 100644 index b46e100..0000000 --- a/node_modules/camelcase/index.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; -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 || !(/[_.\- ]+/).test(str) ) { - if (str[0] === str[0].toLowerCase() && str.slice(1) !== str.slice(1).toLowerCase()) { - return str; - } - - return str.toLowerCase(); - } - - return str - .replace(/^[_.\- ]+/, '') - .toLowerCase() - .replace(/[_.\- ]+(\w|$)/g, function (m, p1) { - return p1.toUpperCase(); - }); -}; diff --git a/node_modules/camelcase/license b/node_modules/camelcase/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/camelcase/license +++ /dev/null @@ -1,21 +0,0 @@ -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/camelcase/package.json b/node_modules/camelcase/package.json deleted file mode 100644 index ff08a02..0000000 --- a/node_modules/camelcase/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "camelcase@^1.0.2", - "_id": "camelcase@1.2.1", - "_inBundle": false, - "_integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", - "_location": "/camelcase", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "camelcase@^1.0.2", - "name": "camelcase", - "escapedName": "camelcase", - "rawSpec": "^1.0.2", - "saveSpec": null, - "fetchSpec": "^1.0.2" - }, - "_requiredBy": [ - "/yargs" - ], - "_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "_shasum": "9bb5304d2e0b56698b2c758b08a3eaa9daa58a39", - "_spec": "camelcase@^1.0.2", - "_where": "/var/www/html/gtg2nodejs/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": "0.0.4" - }, - "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": "node test.js" - }, - "version": "1.2.1" -} diff --git a/node_modules/camelcase/readme.md b/node_modules/camelcase/readme.md deleted file mode 100644 index 516dc39..0000000 --- a/node_modules/camelcase/readme.md +++ /dev/null @@ -1,56 +0,0 @@ -# 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 - -```sh -$ npm install --save camelcase -``` - - -## Usage - -```js -var 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 - -See [`decamelize`](https://github.com/sindresorhus/decamelize) for the inverse. - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/center-align/LICENSE b/node_modules/center-align/LICENSE deleted file mode 100644 index 65f90ac..0000000 --- a/node_modules/center-align/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/center-align/README.md b/node_modules/center-align/README.md deleted file mode 100644 index cbcf3be..0000000 --- a/node_modules/center-align/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# center-align [![NPM version](https://badge.fury.io/js/center-align.svg)](http://badge.fury.io/js/center-align) - -> Center-align the text in a string. - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i center-align --save -``` - -## Usage - -```js -var centerAlign = require('center-align'); -``` - -**Example** - -If used on the following: - -``` -Lorem ipsum dolor sit amet, -consectetur adipiscing -elit, sed do eiusmod tempor incididunt -ut labore et dolore -magna aliqua. Ut enim ad minim -veniam, quis -``` - -The result would be: - -``` - Lorem ipsum dolor sit amet, - consectetur adipiscing -elit, sed do eiusmod tempor incididunt - ut labore et dolore - magna aliqua. Ut enim ad minim - veniam, quis -``` - -## Related projects - -* [align-text](https://www.npmjs.com/package/align-text): Align the text in a string. | [homepage](https://github.com/jonschlinkert/align-text) -* [justified](https://www.npmjs.com/package/justified): Wrap words to a specified length and justified the text. | [homepage](https://github.com/jonschlinkert/justified) -* [right-align](https://www.npmjs.com/package/right-align): Right-align the text in a string. | [homepage](https://github.com/jonschlinkert/right-align) -* [word-wrap](https://www.npmjs.com/package/word-wrap): Wrap words to a specified length. | [homepage](https://github.com/jonschlinkert/word-wrap) - -## 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/center-align/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 October 27, 2015._ \ No newline at end of file diff --git a/node_modules/center-align/index.js b/node_modules/center-align/index.js deleted file mode 100644 index c6ed54a..0000000 --- a/node_modules/center-align/index.js +++ /dev/null @@ -1,16 +0,0 @@ -/*! - * center-align - * - * Copycenter (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var utils = require('./utils'); - -module.exports = function centerAlign(val) { - return utils.align(val, function (len, longest) { - return Math.floor((longest - len) / 2); - }); -}; diff --git a/node_modules/center-align/package.json b/node_modules/center-align/package.json deleted file mode 100644 index 423d4da..0000000 --- a/node_modules/center-align/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_from": "center-align@^0.1.1", - "_id": "center-align@0.1.3", - "_inBundle": false, - "_integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", - "_location": "/center-align", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "center-align@^0.1.1", - "name": "center-align", - "escapedName": "center-align", - "rawSpec": "^0.1.1", - "saveSpec": null, - "fetchSpec": "^0.1.1" - }, - "_requiredBy": [ - "/cliui" - ], - "_resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "_shasum": "aa0d32629b6ee972200411cbd4461c907bc2b7ad", - "_spec": "center-align@^0.1.1", - "_where": "/var/www/html/gtg2nodejs/node_modules/cliui", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/center-align/issues" - }, - "bundleDependencies": false, - "dependencies": { - "align-text": "^0.1.3", - "lazy-cache": "^1.0.3" - }, - "deprecated": false, - "description": "Center-align the text in a string.", - "devDependencies": { - "mocha": "^2.2.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "utils.js" - ], - "homepage": "https://github.com/jonschlinkert/center-align", - "keywords": [ - "align", - "align-center", - "center", - "center-align", - "right", - "right-align", - "text", - "typography" - ], - "license": "MIT", - "main": "index.js", - "name": "center-align", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/center-align.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "description": "", - "list": [ - "align-text", - "right-align", - "justified", - "word-wrap" - ] - } - }, - "version": "0.1.3" -} diff --git a/node_modules/center-align/utils.js b/node_modules/center-align/utils.js deleted file mode 100644 index aead6d2..0000000 --- a/node_modules/center-align/utils.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -/** - * Lazily-required module dependencies (makes the application - * faster) - */ - -var utils = require('lazy-cache')(require); - -/** - * Temporarily re-assign `require` to trick browserify and - * webpack into reconizing lazy dependencies. - * - * This tiny bit of ugliness has the huge dual advantage of - * only loading modules that are actually called at some - * point in the lifecycle of the application, whilst also - * allowing browserify and webpack to find modules that - * are depended on but never actually called. - */ - -var fn = require; -require = utils; - -/** - * Lazily required module dependencies - */ - -require('align-text', 'align'); - -/** - * Restore `require` - */ - -require = fn; - -/** - * Expose `utils` modules - */ - -module.exports = utils; diff --git a/node_modules/character-parser/.npmignore b/node_modules/character-parser/.npmignore deleted file mode 100644 index 2a72174..0000000 --- a/node_modules/character-parser/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -test/ -.travis.yml \ No newline at end of file diff --git a/node_modules/character-parser/LICENSE b/node_modules/character-parser/LICENSE deleted file mode 100644 index 2ecc0d1..0000000 --- a/node_modules/character-parser/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013 Forbes Lindesay - -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/character-parser/README.md b/node_modules/character-parser/README.md deleted file mode 100644 index 1ea3136..0000000 --- a/node_modules/character-parser/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# character-parser - -Parse JavaScript one character at a time to look for snippets in Templates. This is not a validator, it's just designed to allow you to have sections of JavaScript delimited by brackets robustly. - -[![Build Status](https://img.shields.io/travis/ForbesLindesay/character-parser/master.svg)](https://travis-ci.org/ForbesLindesay/character-parser) - -## Installation - - npm install character-parser - -## Usage - -Work out how much depth changes: - -```js -var state = parse('foo(arg1, arg2, {\n foo: [a, b\n'); -assert(state.roundDepth === 1); -assert(state.curlyDepth === 1); -assert(state.squareDepth === 1); -parse(' c, d]\n })', state); -assert(state.squareDepth === 0); -assert(state.curlyDepth === 0); -assert(state.roundDepth === 0); -``` - -### Bracketed Expressions - -Find all the contents of a bracketed expression: - -```js -var section = parser.parseMax('foo="(", bar="}") bing bong'); -assert(section.start === 0); -assert(section.end === 16);//exclusive end of string -assert(section.src = 'foo="(", bar="}"'); - - -var section = parser.parseMax('{foo="(", bar="}"} bing bong', {start: 1}); -assert(section.start === 1); -assert(section.end === 17);//exclusive end of string -assert(section.src = 'foo="(", bar="}"'); -``` - -The bracketed expression parsing simply parses up to but excluding the first unmatched closed bracket (`)`, `}`, `]`). It is clever enough to ignore brackets in comments or strings. - - -### Custom Delimited Expressions - -Find code up to a custom delimiter: - -```js -var section = parser.parseUntil('foo.bar("%>").baz%> bing bong', '%>'); -assert(section.start === 0); -assert(section.end === 17);//exclusive end of string -assert(section.src = 'foo.bar("%>").baz'); - -var section = parser.parseUntil('<%foo.bar("%>").baz%> bing bong', '%>', {start: 2}); -assert(section.start === 2); -assert(section.end === 19);//exclusive end of string -assert(section.src = 'foo.bar("%>").baz'); -``` - -Delimiters are ignored if they are inside strings or comments. - -## API - -### parse(str, state = defaultState(), options = {start: 0, end: src.length}) - -Parse a string starting at the index start, and return the state after parsing that string. - -If you want to parse one string in multiple sections you should keep passing the resulting state to the next parse operation. - -Returns a `State` object. - -### parseMax(src, options = {start: 0}) - -Parses the source until the first unmatched close bracket (any of `)`, `}`, `]`). It returns an object with the structure: - -```js -{ - start: 0,//index of first character of string - end: 13,//index of first character after the end of string - src: 'source string' -} -``` - -### parseUntil(src, delimiter, options = {start: 0, includeLineComment: false}) - -Parses the source until the first occurence of `delimiter` which is not in a string or a comment. If `includeLineComment` is `true`, it will still count if the delimiter occurs in a line comment, but not in a block comment. It returns an object with the structure: - -```js -{ - start: 0,//index of first character of string - end: 13,//index of first character after the end of string - src: 'source string' -} -``` - -### parseChar(character, state = defaultState()) - -Parses the single character and returns the state. See `parse` for the structure of the returned state object. N.B. character must be a single character not a multi character string. - -### defaultState() - -Get a default starting state. - -### isPunctuator(character) - -Returns `true` if `character` represents punctuation in JavaScript. - -### isKeyword(name) - -Returns `true` if `name` is a keyword in JavaScript. - -## State - -A state is an object with the following structure - -```js -{ - lineComment: false, //true if inside a line comment - blockComment: false, //true if inside a block comment - - singleQuote: false, //true if inside a single quoted string - doubleQuote: false, //true if inside a double quoted string - regexp: false, //true if inside a regular expression - escaped: false, //true if in a string and the last character was an escape character - - roundDepth: 0, //number of un-closed open `(` brackets - curlyDepth: 0, //number of un-closed open `{` brackets - squareDepth: 0 //number of un-closed open `[` brackets -} -``` - -It also has the following useful methods: - -- `.isString()` returns `true` if the current location is inside a string. -- `.isComment()` returns `true` if the current location is inside a comment. -- `isNesting()` returns `true` if the current location is anything but at the top level, i.e. with no nesting. - -## License - -MIT \ No newline at end of file diff --git a/node_modules/character-parser/index.js b/node_modules/character-parser/index.js deleted file mode 100644 index 08afbcd..0000000 --- a/node_modules/character-parser/index.js +++ /dev/null @@ -1,231 +0,0 @@ -exports = (module.exports = parse); -exports.parse = parse; -function parse(src, state, options) { - options = options || {}; - state = state || exports.defaultState(); - var start = options.start || 0; - var end = options.end || src.length; - var index = start; - while (index < end) { - if (state.roundDepth < 0 || state.curlyDepth < 0 || state.squareDepth < 0) { - throw new SyntaxError('Mismatched Bracket: ' + src[index - 1]); - } - exports.parseChar(src[index++], state); - } - return state; -} - -exports.parseMax = parseMax; -function parseMax(src, options) { - options = options || {}; - var start = options.start || 0; - var index = start; - var state = exports.defaultState(); - while (state.roundDepth >= 0 && state.curlyDepth >= 0 && state.squareDepth >= 0) { - if (index >= src.length) { - throw new Error('The end of the string was reached with no closing bracket found.'); - } - exports.parseChar(src[index++], state); - } - var end = index - 1; - return { - start: start, - end: end, - src: src.substring(start, end) - }; -} - -exports.parseUntil = parseUntil; -function parseUntil(src, delimiter, options) { - options = options || {}; - var includeLineComment = options.includeLineComment || false; - var start = options.start || 0; - var index = start; - var state = exports.defaultState(); - while (state.isString() || state.regexp || state.blockComment || - (!includeLineComment && state.lineComment) || !startsWith(src, delimiter, index)) { - exports.parseChar(src[index++], state); - } - var end = index; - return { - start: start, - end: end, - src: src.substring(start, end) - }; -} - - -exports.parseChar = parseChar; -function parseChar(character, state) { - if (character.length !== 1) throw new Error('Character must be a string of length 1'); - state = state || exports.defaultState(); - state.src = state.src || ''; - state.src += character; - var wasComment = state.blockComment || state.lineComment; - var lastChar = state.history ? state.history[0] : ''; - - if (state.regexpStart) { - if (character === '/' || character == '*') { - state.regexp = false; - } - state.regexpStart = false; - } - if (state.lineComment) { - if (character === '\n') { - state.lineComment = false; - } - } else if (state.blockComment) { - if (state.lastChar === '*' && character === '/') { - state.blockComment = false; - } - } else if (state.singleQuote) { - if (character === '\'' && !state.escaped) { - state.singleQuote = false; - } else if (character === '\\' && !state.escaped) { - state.escaped = true; - } else { - state.escaped = false; - } - } else if (state.doubleQuote) { - if (character === '"' && !state.escaped) { - state.doubleQuote = false; - } else if (character === '\\' && !state.escaped) { - state.escaped = true; - } else { - state.escaped = false; - } - } else if (state.regexp) { - if (character === '/' && !state.escaped) { - state.regexp = false; - } else if (character === '\\' && !state.escaped) { - state.escaped = true; - } else { - state.escaped = false; - } - } else if (lastChar === '/' && character === '/') { - state.history = state.history.substr(1); - state.lineComment = true; - } else if (lastChar === '/' && character === '*') { - state.history = state.history.substr(1); - state.blockComment = true; - } else if (character === '/' && isRegexp(state.history)) { - state.regexp = true; - state.regexpStart = true; - } else if (character === '\'') { - state.singleQuote = true; - } else if (character === '"') { - state.doubleQuote = true; - } else if (character === '(') { - state.roundDepth++; - } else if (character === ')') { - state.roundDepth--; - } else if (character === '{') { - state.curlyDepth++; - } else if (character === '}') { - state.curlyDepth--; - } else if (character === '[') { - state.squareDepth++; - } else if (character === ']') { - state.squareDepth--; - } - if (!state.blockComment && !state.lineComment && !wasComment) state.history = character + state.history; - state.lastChar = character; // store last character for ending block comments - return state; -} - -exports.defaultState = function () { return new State() }; -function State() { - this.lineComment = false; - this.blockComment = false; - - this.singleQuote = false; - this.doubleQuote = false; - this.regexp = false; - - this.escaped = false; - - this.roundDepth = 0; - this.curlyDepth = 0; - this.squareDepth = 0; - - this.history = '' - this.lastChar = '' -} -State.prototype.isString = function () { - return this.singleQuote || this.doubleQuote; -} -State.prototype.isComment = function () { - return this.lineComment || this.blockComment; -} -State.prototype.isNesting = function () { - return this.isString() || this.isComment() || this.regexp || this.roundDepth > 0 || this.curlyDepth > 0 || this.squareDepth > 0 -} - -function startsWith(str, start, i) { - return str.substr(i || 0, start.length) === start; -} - -exports.isPunctuator = isPunctuator -function isPunctuator(c) { - if (!c) return true; // the start of a string is a punctuator - var code = c.charCodeAt(0) - - switch (code) { - case 46: // . dot - case 40: // ( open bracket - case 41: // ) close bracket - case 59: // ; semicolon - case 44: // , comma - case 123: // { open curly brace - case 125: // } close curly brace - case 91: // [ - case 93: // ] - case 58: // : - case 63: // ? - case 126: // ~ - case 37: // % - case 38: // & - case 42: // *: - case 43: // + - case 45: // - - case 47: // / - case 60: // < - case 62: // > - case 94: // ^ - case 124: // | - case 33: // ! - case 61: // = - return true; - default: - return false; - } -} -exports.isKeyword = isKeyword -function isKeyword(id) { - return (id === 'if') || (id === 'in') || (id === 'do') || (id === 'var') || (id === 'for') || (id === 'new') || - (id === 'try') || (id === 'let') || (id === 'this') || (id === 'else') || (id === 'case') || - (id === 'void') || (id === 'with') || (id === 'enum') || (id === 'while') || (id === 'break') || (id === 'catch') || - (id === 'throw') || (id === 'const') || (id === 'yield') || (id === 'class') || (id === 'super') || - (id === 'return') || (id === 'typeof') || (id === 'delete') || (id === 'switch') || (id === 'export') || - (id === 'import') || (id === 'default') || (id === 'finally') || (id === 'extends') || (id === 'function') || - (id === 'continue') || (id === 'debugger') || (id === 'package') || (id === 'private') || (id === 'interface') || - (id === 'instanceof') || (id === 'implements') || (id === 'protected') || (id === 'public') || (id === 'static') || - (id === 'yield') || (id === 'let'); -} - -function isRegexp(history) { - //could be start of regexp or divide sign - - history = history.replace(/^\s*/, ''); - - //unless its an `if`, `while`, `for` or `with` it's a divide, so we assume it's a divide - if (history[0] === ')') return false; - //unless it's a function expression, it's a regexp, so we assume it's a regexp - if (history[0] === '}') return true; - //any punctuation means it's a regexp - if (isPunctuator(history[0])) return true; - //if the last thing was a keyword then it must be a regexp (e.g. `typeof /foo/`) - if (/^\w+\b/.test(history) && isKeyword(/^\w+\b/.exec(history)[0].split('').reverse().join(''))) return true; - - return false; -} diff --git a/node_modules/character-parser/package.json b/node_modules/character-parser/package.json deleted file mode 100644 index 5486d18..0000000 --- a/node_modules/character-parser/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "_from": "character-parser@1.2.1", - "_id": "character-parser@1.2.1", - "_inBundle": false, - "_integrity": "sha1-wN3kqxgnE7kZuXCVmhI+zBow/NY=", - "_location": "/character-parser", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "character-parser@1.2.1", - "name": "character-parser", - "escapedName": "character-parser", - "rawSpec": "1.2.1", - "saveSpec": null, - "fetchSpec": "1.2.1" - }, - "_requiredBy": [ - "/jade" - ], - "_resolved": "https://registry.npmjs.org/character-parser/-/character-parser-1.2.1.tgz", - "_shasum": "c0dde4ab182713b919b970959a123ecc1a30fcd6", - "_spec": "character-parser@1.2.1", - "_where": "/var/www/html/gtg2nodejs/node_modules/jade", - "author": { - "name": "ForbesLindesay" - }, - "bugs": { - "url": "https://github.com/ForbesLindesay/character-parser/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Parse JavaScript one character at a time to look for snippets in Templates. This is not a validator, it's just designed to allow you to have sections of JavaScript delimited by brackets robustly.", - "devDependencies": { - "better-assert": "~1.0.0", - "mocha": "~1.9.0" - }, - "homepage": "https://github.com/ForbesLindesay/character-parser#readme", - "keywords": [ - "parser", - "JavaScript", - "bracket", - "nesting", - "comment", - "string", - "escape", - "escaping" - ], - "license": "MIT", - "main": "index.js", - "name": "character-parser", - "repository": { - "type": "git", - "url": "git+https://github.com/ForbesLindesay/character-parser.git" - }, - "scripts": { - "test": "mocha -R spec" - }, - "version": "1.2.1" -} diff --git a/node_modules/clean-css/History.md b/node_modules/clean-css/History.md deleted file mode 100644 index 2d6a203..0000000 --- a/node_modules/clean-css/History.md +++ /dev/null @@ -1,1138 +0,0 @@ -[3.4.28 / 2017-07-14](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.27...v3.4.28) -================== - -* Backports [#957](https://github.com/jakubpawlowicz/clean-css/issues/957) - `0%` minification of `width` property. - -[3.4.27 / 2017-06-09](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.26...v3.4.27) -================== - -* Fixes [#948](https://github.com/jakubpawlowicz/clean-css/issues/948) - enforces line break before source map comment. - -[3.4.26 / 2017-05-10](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.25...v3.4.26) -================== - -* Backports [#939](https://github.com/jakubpawlowicz/clean-css/issues/939) - semicolon after `@apply` at-rule. - -[3.4.25 / 2017-02-22](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.24...v3.4.25) -================== - -* Fixed issue [#897](https://github.com/jakubpawlowicz/clean-css/issues/897) - tokenization with escaped markers. - -[3.4.24 / 2017-01-20](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.23...v3.4.24) -================== - -* Fixed issue [#859](https://github.com/jakubpawlowicz/clean-css/issues/859) - avoid `-webkit-border-radius` optimizations. - -[3.4.23 / 2016-12-17](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.22...v3.4.23) -================== - -* Fixed issue [#844](https://github.com/jakubpawlowicz/clean-css/issues/844) - regression in property values extraction. - -[3.4.22 / 2016-12-12](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.21...v3.4.22) -================== - -* Fixed issue [#841](https://github.com/jakubpawlowicz/clean-css/issues/841) - disabled importing and files passed as array. -* Ignores `@import` at-rules if appearing after any non-`@import` rules. - -[3.4.21 / 2016-11-16](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.20...v3.4.21) -================== - -* Fixed issue [#821](https://github.com/jakubpawlowicz/clean-css/issues/821) - reducing non-adjacent rules. -* Fixed issue [#830](https://github.com/jakubpawlowicz/clean-css/issues/830) - reordering border-* properties. -* Fixed issue [#833](https://github.com/jakubpawlowicz/clean-css/issues/833) - moving `@media` queries. - -[3.4.20 / 2016-09-26](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.19...v3.4.20) -================== - -* Fixed issue [#814](https://github.com/jakubpawlowicz/clean-css/issues/814) - `:selection` rule merging. - -[3.4.19 / 2016-07-25](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.18...v3.4.19) -================== - -* Fixed issue [#795](https://github.com/jakubpawlowicz/clean-css/issues/795) - `!important` and override compacting. - -[3.4.18 / 2016-06-15](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.17...v3.4.18) -================== - -* Fixed issue [#787](https://github.com/jakubpawlowicz/clean-css/issues/787) - regression in processing data URIs. - -[3.4.17 / 2016-06-04](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.16...v3.4.17) -================== - -* Fixed issue [#783](https://github.com/jakubpawlowicz/clean-css/issues/783) - regression in processing data URIs. - -[3.4.16 / 2016-06-02](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.15...v3.4.16) -================== - -* Fixed issue [#781](https://github.com/jakubpawlowicz/clean-css/issues/781) - regression in override compacting. -* Fixed issue [#782](https://github.com/jakubpawlowicz/clean-css/issues/782) - regression in processing data URIs. - -[3.4.15 / 2016-06-01](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.14...v3.4.15) -================== - -* Fixed issue [#776](https://github.com/jakubpawlowicz/clean-css/issues/776) - edge case in quoted data URIs. -* Fixed issue [#779](https://github.com/jakubpawlowicz/clean-css/issues/779) - merging `background-(position|size)`. -* Fixed issue [#780](https://github.com/jakubpawlowicz/clean-css/issues/780) - space after inlined variables. - -[3.4.14 / 2016-05-31](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.13...v3.4.14) -================== - -* Fixed issue [#751](https://github.com/jakubpawlowicz/clean-css/issues/751) - stringifying CSS variables. -* Fixed issue [#763](https://github.com/jakubpawlowicz/clean-css/issues/763) - data URI SVG and quoting. -* Fixed issue [#765](https://github.com/jakubpawlowicz/clean-css/issues/765) - two values of border-radius. -* Fixed issue [#768](https://github.com/jakubpawlowicz/clean-css/issues/768) - invalid border-radius property. - -[3.4.13 / 2016-05-23](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.12...v3.4.13) -================== - -* Fixed issue [#734](https://github.com/jakubpawlowicz/clean-css/issues/769) - Node.js 6.x support. - -[3.4.12 / 2016-04-09](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.11...v3.4.12) -================== - -* Fixed issue [#734](https://github.com/jakubpawlowicz/clean-css/issues/734) - `--root` option edge case. -* Fixed issue [#758](https://github.com/jakubpawlowicz/clean-css/issues/758) - treats empty rule as unmergeable. - -[3.4.11 / 2016-04-01](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.10...v3.4.11) -================== - -* Fixed issue [#738](https://github.com/jakubpawlowicz/clean-css/issues/738) - edge case in comment processing. -* Fixed issue [#741](https://github.com/jakubpawlowicz/clean-css/issues/741) - HTTP proxy with HTTPS inlining. -* Fixed issue [#743](https://github.com/jakubpawlowicz/clean-css/issues/743) - background shorthand and source maps. -* Fixed issue [#745](https://github.com/jakubpawlowicz/clean-css/issues/745) - matching mixed case `!important`. - -[3.4.10 / 2016-02-29](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.9...v3.4.10) -================== - -* Fixed issue [#735](https://github.com/jakubpawlowicz/clean-css/issues/735) - whitespace removal with escaped chars. - -[3.4.9 / 2016-01-03](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.8...v3.4.9) -================== - -* Sped up merging by body advanced optimization. -* Fixed issue [#693](https://github.com/jakubpawlowicz/clean-css/issues/693) - restructuring edge case. -* Fixed issue [#711](https://github.com/jakubpawlowicz/clean-css/issues/711) - border fuzzy matching. -* Fixed issue [#714](https://github.com/jakubpawlowicz/clean-css/issues/714) - stringifying property level at rules. -* Fixed issue [#715](https://github.com/jakubpawlowicz/clean-css/issues/715) - stack too deep in comment scan. - -[3.4.8 / 2015-11-13](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.7...v3.4.8) -================== - -* Fixed issue [#676](https://github.com/jakubpawlowicz/clean-css/issues/676) - fuzzy matching unqoted data URIs. - -[3.4.7 / 2015-11-10](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.6...v3.4.7) -================== - -* Fixed issue [#692](https://github.com/jakubpawlowicz/clean-css/issues/692) - edge case in URL quoting. -* Fixed issue [#695](https://github.com/jakubpawlowicz/clean-css/issues/695) - shorthand overriding edge case. -* Fixed issue [#699](https://github.com/jakubpawlowicz/clean-css/issues/699) - IE9 transparent hack. -* Fixed issue [#701](https://github.com/jakubpawlowicz/clean-css/issues/701) - `url` quoting with hash arguments. - -[3.4.6 / 2015-10-14](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.5...v3.4.6) -================== - -* Fixed issue [#679](https://github.com/jakubpawlowicz/clean-css/issues/679) - wrong rebasing of remote URLs. - -[3.4.5 / 2015-09-28](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.4...v3.4.5) -================== - -* Fixed issue [#681](https://github.com/jakubpawlowicz/clean-css/issues/681) - property inheritance & restructuring. -* Fixed issue [#675](https://github.com/jakubpawlowicz/clean-css/issues/675) - overriding with `!important`. - -[3.4.4 / 2015-09-21](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.3...v3.4.4) -================== - -* Fixed issue [#626](https://github.com/jakubpawlowicz/clean-css/issues/626) - edge case in import rebasing. -* Fixed issue [#674](https://github.com/jakubpawlowicz/clean-css/issues/674) - adjacent merging order. - -[3.4.3 / 2015-09-15](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.2...v3.4.3) -================== - -* Fixed issue [#668](https://github.com/jakubpawlowicz/clean-css/issues/668) - node v4 path.join. -* Fixed issue [#669](https://github.com/jakubpawlowicz/clean-css/issues/669) - adjacent overriding with `!important`. - -[3.4.2 / 2015-09-14](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.1...v3.4.2) -================== - -* Fixed issue [#598](https://github.com/jakubpawlowicz/clean-css/issues/598) - restructuring border properties. -* Fixed issue [#654](https://github.com/jakubpawlowicz/clean-css/issues/654) - disables length optimizations. -* Fixed issue [#655](https://github.com/jakubpawlowicz/clean-css/issues/655) - shorthands override merging. -* Fixed issue [#660](https://github.com/jakubpawlowicz/clean-css/issues/660) - !important token overriding. -* Fixed issue [#662](https://github.com/jakubpawlowicz/clean-css/issues/662) - !important selector reducing. -* Fixed issue [#667](https://github.com/jakubpawlowicz/clean-css/issues/667) - rebasing remote URLs. - -[3.4.1 / 2015-08-27](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.0...v3.4.1) -================== - -* Fixed issue [#652](https://github.com/jakubpawlowicz/clean-css/issues/652) - order of restoring and removing tokens. - -[3.4.0 / 2015-08-27](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.10...v3.4.0) -================== - -* Adds an option for a fine-grained `@import` control. -* Adds unit compatibility switches to disable length optimizations. -* Adds inferring proxy settings from HTTP_PROXY environment variable. -* Adds support for Polymer / Web Components special selectors. -* Adds support for Polymer mixins. -* Adds testing source maps in batch mode. -* Unifies wrappers for simple & advanced optimizations. -* Fixed issue [#596](https://github.com/jakubpawlowicz/clean-css/issues/596) - support for !ie IE<8 hack. -* Fixed issue [#599](https://github.com/jakubpawlowicz/clean-css/issues/599) - support for inlined source maps. -* Fixed issue [#607](https://github.com/jakubpawlowicz/clean-css/issues/607) - adds better rule reordering. -* Fixed issue [#612](https://github.com/jakubpawlowicz/clean-css/issues/612) - adds HTTP proxy support. -* Fixed issue [#618](https://github.com/jakubpawlowicz/clean-css/issues/618) - adds safer function validation. -* Fixed issue [#625](https://github.com/jakubpawlowicz/clean-css/issues/625) - adds length unit optimizations. -* Fixed issue [#632](https://github.com/jakubpawlowicz/clean-css/issues/632) - adds disabling remote `import`s. -* Fixed issue [#635](https://github.com/jakubpawlowicz/clean-css/issues/635) - adds safer `0%` optimizations. -* Fixed issue [#644](https://github.com/jakubpawlowicz/clean-css/issues/644) - adds time unit optimizations. -* Fixed issue [#645](https://github.com/jakubpawlowicz/clean-css/issues/645) - adds bottom to top `media` merging. -* Fixed issue [#648](https://github.com/jakubpawlowicz/clean-css/issues/648) - adds property level at-rule support. - -[3.3.10 / 2015-08-27](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.9...v3.3.10) -================== - -* Adds better comments + keepBreaks handling. -* Adds better text normalizing in source maps mode. -* Fixes non-adjacent optimizations for source maps. -* Fixes removing unused items. -* Improves `outline` break up with source maps. -* Refixed issue [#629](https://github.com/jakubpawlowicz/clean-css/issues/629) - source maps & background shorthands. - -[3.3.9 / 2015-08-09](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.8...v3.3.9) -================== - -* Fixed issue [#640](https://github.com/jakubpawlowicz/clean-css/issues/640) - URI processing regression. - -[3.3.8 / 2015-08-06](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.7...v3.3.8) -================== - -* Fixed issue [#629](https://github.com/jakubpawlowicz/clean-css/issues/629) - source maps & background shorthands. -* Fixed issue [#630](https://github.com/jakubpawlowicz/clean-css/issues/630) - vendor prefixed flex optimizations. -* Fixed issue [#633](https://github.com/jakubpawlowicz/clean-css/issues/633) - handling data URI with brackets. -* Fixed issue [#634](https://github.com/jakubpawlowicz/clean-css/issues/634) - merging :placeholder selectors. - -[3.3.7 / 2015-07-29](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.6...v3.3.7) -================== - -* Fixed issue [#616](https://github.com/jakubpawlowicz/clean-css/issues/616) - ordering in restructuring. - -[3.3.6 / 2015-07-14](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.5...v3.3.6) -================== - -* Fixed issue [#620](https://github.com/jakubpawlowicz/clean-css/issues/620) - `bold` style in font shorthands. - -[3.3.5 / 2015-07-01](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.4...v3.3.5) -================== - -* Fixed issue [#608](https://github.com/jakubpawlowicz/clean-css/issues/608) - custom URI protocols handling. - -[3.3.4 / 2015-06-24](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.3...v3.3.4) -================== - -* Fixed issue [#610](https://github.com/jakubpawlowicz/clean-css/issues/610) - `border:inherit` restoring. -* Fixed issue [#611](https://github.com/jakubpawlowicz/clean-css/issues/611) - edge case in quote stripping. - -[3.3.3 / 2015-06-16](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.2...v3.3.3) -================== - -* Fixed issue [#603](https://github.com/jakubpawlowicz/clean-css/issues/603) - IE suffix hack defaults to on. - -[3.3.2 / 2015-06-14](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.1...v3.3.2) -================== - -* Fixed issue [#595](https://github.com/jakubpawlowicz/clean-css/issues/595) - more relaxed block matching. -* Fixed issue [#601](https://github.com/jakubpawlowicz/clean-css/issues/601) - percentage minifying inside `flex`. -* Fixed issue [#602](https://github.com/jakubpawlowicz/clean-css/issues/602) - backslash IE hacks after a space. - -[3.3.1 / 2015-06-02](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.0...v3.3.1) -================== - -* Fixed issue [#590](https://github.com/jakubpawlowicz/clean-css/issues/590) - edge case in `@import` processing. - -[3.3.0 / 2015-05-31](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.11...v3.3.0) -================== - -* Cleans up url rebase code getting rid of unnecessary state. -* Cleans up tokenizer code getting rid of unnecessary state. -* Moves source maps tracker into lib/source-maps/track. -* Moves tokenizer code into lib/tokenizer. -* Moves URL scanner into lib/urls/reduce (was named incorrectly before). -* Moves URL rebasing & rewriting into lib/urls. -* Fixed issue [#375](https://github.com/jakubpawlowicz/clean-css/issues/375) - unit compatibility switches. -* Fixed issue [#436](https://github.com/jakubpawlowicz/clean-css/issues/436) - refactors URI rewriting. -* Fixed issue [#448](https://github.com/jakubpawlowicz/clean-css/issues/448) - rebasing no protocol URIs. -* Fixed issue [#517](https://github.com/jakubpawlowicz/clean-css/issues/517) - turning off color optimizations. -* Fixed issue [#542](https://github.com/jakubpawlowicz/clean-css/issues/542) - space after closing brace in IE. -* Fixed issue [#562](https://github.com/jakubpawlowicz/clean-css/issues/562) - optimizing invalid color values. -* Fixed issue [#563](https://github.com/jakubpawlowicz/clean-css/issues/563) - `background:inherit` restoring. -* Fixed issue [#570](https://github.com/jakubpawlowicz/clean-css/issues/570) - rebasing "no-url()" imports. -* Fixed issue [#574](https://github.com/jakubpawlowicz/clean-css/issues/574) - rewriting internal URLs. -* Fixed issue [#575](https://github.com/jakubpawlowicz/clean-css/issues/575) - missing directory as a `target`. -* Fixed issue [#577](https://github.com/jakubpawlowicz/clean-css/issues/577) - `background-clip` into shorthand. -* Fixed issue [#579](https://github.com/jakubpawlowicz/clean-css/issues/579) - `background-origin` into shorthand. -* Fixed issue [#580](https://github.com/jakubpawlowicz/clean-css/issues/580) - mixed `@import` processing. -* Fixed issue [#582](https://github.com/jakubpawlowicz/clean-css/issues/582) - overriding with prefixed values. -* Fixed issue [#583](https://github.com/jakubpawlowicz/clean-css/issues/583) - URL quoting for SVG data. -* Fixed issue [#587](https://github.com/jakubpawlowicz/clean-css/issues/587) - too aggressive `border` reordering. - -[3.2.11 / 2015-05-31](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.10...v3.2.11) -================== - -* Fixed issue [#563](https://github.com/jakubpawlowicz/clean-css/issues/563) - `background:inherit` restoring. -* Fixed issue [#582](https://github.com/jakubpawlowicz/clean-css/issues/582) - overriding with prefixed values. -* Fixed issue [#583](https://github.com/jakubpawlowicz/clean-css/issues/583) - URL quoting for SVG data. -* Fixed issue [#587](https://github.com/jakubpawlowicz/clean-css/issues/587) - too aggressive `border` reordering. - -[3.2.10 / 2015-05-14](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.9...v3.2.10) -================== - -* Fixed issue [#572](https://github.com/jakubpawlowicz/clean-css/issues/572) - empty elements removal. - -[3.2.9 / 2015-05-08](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.8...v3.2.9) -================== - -* Fixed issue [#567](https://github.com/jakubpawlowicz/clean-css/issues/567) - merging colors as functions. - -[3.2.8 / 2015-05-04](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.7...v3.2.8) -================== - -* Fixed issue [#561](https://github.com/jakubpawlowicz/clean-css/issues/561) - restructuring special selectors. - -[3.2.7 / 2015-05-03](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.6...v3.2.7) -================== - -* Fixed issue [#551](https://github.com/jakubpawlowicz/clean-css/issues/551) - edge case in restructuring. -* Fixed issue [#553](https://github.com/jakubpawlowicz/clean-css/issues/553) - another style of SVG fallback. -* Fixed issue [#558](https://github.com/jakubpawlowicz/clean-css/issues/558) - units in same selector merging. - -[3.2.6 / 2015-04-28](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.5...v3.2.6) -================== - -* Fixed issue [#550](https://github.com/jakubpawlowicz/clean-css/issues/550) - proper `contentSources` tracking. -* Fixed issue [#556](https://github.com/jakubpawlowicz/clean-css/issues/556) - regression in IE backslash hacks. - -[3.2.5 / 2015-04-25](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.4...v3.2.5) -================== - -* Fixed issue [#543](https://github.com/jakubpawlowicz/clean-css/issues/543) - better "comment in body" handling. -* Fixed issue [#548](https://github.com/jakubpawlowicz/clean-css/issues/548) - regression in font minifying. -* Fixed issue [#549](https://github.com/jakubpawlowicz/clean-css/issues/549) - special comments in source maps. - -[3.2.4 / 2015-04-24](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.3...v3.2.4) -================== - -* Fixed issue [#544](https://github.com/jakubpawlowicz/clean-css/issues/544) - regression in same value merging. -* Fixed issue [#546](https://github.com/jakubpawlowicz/clean-css/issues/546) - IE<11 `calc()` issue. - -[3.2.3 / 2015-04-22](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.2...v3.2.3) -================== - -* Fixed issue [#541](https://github.com/jakubpawlowicz/clean-css/issues/541) - `outline-style:auto` in shorthand. - -[3.2.2 / 2015-04-21](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.1...v3.2.2) -================== - -* Fixed issue [#537](https://github.com/jakubpawlowicz/clean-css/issues/537) - regression in simple optimizer. - -[3.2.1 / 2015-04-20](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.0...v3.2.1) -================== - -* Fixed issue [#534](https://github.com/jakubpawlowicz/clean-css/issues/534) - wrong `@font-face` stringifying. - -[3.2.0 / 2015-04-19](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.9...v3.2.0) -================== - -* Bumps commander to 2.8.x. -* Fixes remote asset rebasing when passing data as a hash. -* Improves path resolution inside source maps. -* Makes `root` option implicitely default to `process.cwd()`. -* Fixed issue [#371](https://github.com/jakubpawlowicz/clean-css/issues/371) - `background` fallback with `none`. -* Fixed issue [#376](https://github.com/jakubpawlowicz/clean-css/issues/376) - option to disable `0[unit]` -> `0`. -* Fixed issue [#396](https://github.com/jakubpawlowicz/clean-css/issues/396) - better input source maps tracking. -* Fixed issue [#397](https://github.com/jakubpawlowicz/clean-css/issues/397) - support for source map sources. -* Fixed issue [#399](https://github.com/jakubpawlowicz/clean-css/issues/399) - support compacting with source maps. -* Fixed issue [#429](https://github.com/jakubpawlowicz/clean-css/issues/429) - unifies data tokenization. -* Fixed issue [#446](https://github.com/jakubpawlowicz/clean-css/issues/446) - `list-style` fuzzy matching. -* Fixed issue [#468](https://github.com/jakubpawlowicz/clean-css/issues/468) - bumps `source-map` to 0.4.x. -* Fixed issue [#480](https://github.com/jakubpawlowicz/clean-css/issues/480) - extracting uppercase property names. -* Fixed issue [#487](https://github.com/jakubpawlowicz/clean-css/issues/487) - source map paths under Windows. -* Fixed issue [#490](https://github.com/jakubpawlowicz/clean-css/issues/490) - vendor prefixed multivalue `background`. -* Fixed issue [#500](https://github.com/jakubpawlowicz/clean-css/issues/500) - merging duplicate adjacent properties. -* Fixed issue [#504](https://github.com/jakubpawlowicz/clean-css/issues/504) - keeping `url()` quotes. -* Fixed issue [#507](https://github.com/jakubpawlowicz/clean-css/issues/507) - merging longhands into many shorthands. -* Fixed issue [#508](https://github.com/jakubpawlowicz/clean-css/issues/508) - removing duplicate media queries. -* Fixed issue [#521](https://github.com/jakubpawlowicz/clean-css/issues/521) - unit optimizations inside `calc()`. -* Fixed issue [#524](https://github.com/jakubpawlowicz/clean-css/issues/524) - timeouts in `@import` inlining. -* Fixed issue [#526](https://github.com/jakubpawlowicz/clean-css/issues/526) - shorthand overriding into a function. -* Fixed issue [#528](https://github.com/jakubpawlowicz/clean-css/issues/528) - better support for IE<9 hacks. -* Fixed issue [#529](https://github.com/jakubpawlowicz/clean-css/issues/529) - wrong font weight minification. - -[3.1.9 / 2015-04-04](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.8...v3.1.9) -================== - -* Fixes issue [#511](https://github.com/jakubpawlowicz/clean-css/issues/511) - `)` advanced processing. - -[3.1.8 / 2015-03-17](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.7...v3.1.8) -================== - -* Fixes issue [#498](https://github.com/jakubpawlowicz/clean-css/issues/498) - reordering and flexbox. -* Fixes issue [#499](https://github.com/jakubpawlowicz/clean-css/issues/499) - too aggressive `-` removal. - -[3.1.7 / 2015-03-16](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.6...v3.1.7) -================== - -* Backports fix to [#480](https://github.com/jakubpawlowicz/clean-css/issues/480) - reordering and uppercase properties. -* Fixes issue [#496](https://github.com/jakubpawlowicz/clean-css/issues/496) - space after bracket removal. - -[3.1.6 / 2015-03-12](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.5...v3.1.6) -================== - -* Fixes issue [#489](https://github.com/jakubpawlowicz/clean-css/issues/489) - `AlphaImageLoader` IE filter. - -[3.1.5 / 2015-03-06](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.4...v3.1.5) -================== - -* Fixes issue [#483](https://github.com/jakubpawlowicz/clean-css/issues/483) - property order in restructuring. - -[3.1.4 / 2015-03-04](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.3...v3.1.4) -================== - -* Fixes issue [#472](https://github.com/jakubpawlowicz/clean-css/issues/472) - broken function minification. -* Fixes issue [#477](https://github.com/jakubpawlowicz/clean-css/issues/477) - `@import`s order in restructuring. -* Fixes issue [#478](https://github.com/jakubpawlowicz/clean-css/issues/478) - ultimate fix to brace whitespace. - -[3.1.3 / 2015-03-03](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.2...v3.1.3) -================== - -* Fixes issue [#464](https://github.com/jakubpawlowicz/clean-css/issues/464) - data URI with quoted braces. -* Fixes issue [#475](https://github.com/jakubpawlowicz/clean-css/issues/475) - whitespace after closing brace. - -[3.1.2 / 2015-03-01](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.1...v3.1.2) -================== - -* Refixed issue [#471](https://github.com/jakubpawlowicz/clean-css/issues/471) - correct order after restructuring. -* Fixes issue [#466](https://github.com/jakubpawlowicz/clean-css/issues/466) - rebuilding background shorthand. -* Fixes issue [#462](https://github.com/jakubpawlowicz/clean-css/issues/462) - escaped apostrophes in selectors. - -[3.1.1 / 2015-02-27](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.0...v3.1.1) -================== - -* Fixed issue [#469](https://github.com/jakubpawlowicz/clean-css/issues/469) - extracting broken property. -* Fixed issue [#470](https://github.com/jakubpawlowicz/clean-css/issues/470) - negative padding removal. -* Fixed issue [#471](https://github.com/jakubpawlowicz/clean-css/issues/471) - correct order after restructuring. - -[3.1.0 / 2015-02-26](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.10...v3.1.0) -================== - -* Adds `0deg` to `0` minification where possible. -* Adds better non-adjacent selector merging when body is the same. -* Adds official support for node.js 0.12. -* Adds official support for io.js 1.0. -* Adds restructuring optimizations to reorganize selectors, which vastly improves minification. -* Fixed issue [#158](https://github.com/jakubpawlowicz/clean-css/issues/158) - adds body-based selectors reduction. -* Fixed issue [#182](https://github.com/jakubpawlowicz/clean-css/issues/182) - removing space after closing brace. -* Fixed issue [#204](https://github.com/jakubpawlowicz/clean-css/issues/204) - `@media` merging. -* Fixed issue [#351](https://github.com/jakubpawlowicz/clean-css/issues/351) - remote `@import`s after content. -* Fixed issue [#357](https://github.com/jakubpawlowicz/clean-css/issues/357) - non-standard but valid URLs. -* Fixed issue [#416](https://github.com/jakubpawlowicz/clean-css/issues/416) - accepts hash as `minify` argument. -* Fixed issue [#419](https://github.com/jakubpawlowicz/clean-css/issues/419) - multiple input source maps. -* Fixed issue [#435](https://github.com/jakubpawlowicz/clean-css/issues/435) - `background-clip` in shorthand. -* Fixed issue [#439](https://github.com/jakubpawlowicz/clean-css/issues/439) - `background-origin` in shorthand. -* Fixed issue [#442](https://github.com/jakubpawlowicz/clean-css/issues/442) - space before adjacent `nav`. -* Fixed issue [#445](https://github.com/jakubpawlowicz/clean-css/issues/445) - regression issue in url processor. -* Fixed issue [#449](https://github.com/jakubpawlowicz/clean-css/issues/449) - warns of missing close braces. -* Fixed issue [#463](https://github.com/jakubpawlowicz/clean-css/issues/463) - relative remote `@import` URLs. - -[3.0.10 / 2015-02-07](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.9...v3.0.10) -================== - -* Fixed issue [#453](https://github.com/jakubpawlowicz/clean-css/issues/453) - double `background-repeat`. -* Fixed issue [#455](https://github.com/jakubpawlowicz/clean-css/issues/455) - property extracting regression. - -[3.0.9 / 2015-02-04](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.8...v3.0.9) -================== - -* Fixed issue [#452](https://github.com/jakubpawlowicz/clean-css/issues/452) - regression in advanced merging. - -[3.0.8 / 2015-01-31](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.7...v3.0.8) -================== - -* Fixed issue [#447](https://github.com/jakubpawlowicz/clean-css/issues/447) - `background-color` in shorthands. -* Fixed issue [#450](https://github.com/jakubpawlowicz/clean-css/issues/450) - name to hex color converting. - -[3.0.7 / 2015-01-22](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.6...v3.0.7) -================== - -* Fixed issue [#441](https://github.com/jakubpawlowicz/clean-css/issues/441) - hex to name color converting. - -[3.0.6 / 2015-01-20](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.5...v3.0.6) -================== - -* Refixed issue [#414](https://github.com/jakubpawlowicz/clean-css/issues/414) - source maps position fallback. - -[3.0.5 / 2015-01-18](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.4...v3.0.5) -================== - -* Fixed issue [#414](https://github.com/jakubpawlowicz/clean-css/issues/414) - source maps position fallback. -* Fixed issue [#433](https://github.com/jakubpawlowicz/clean-css/issues/433) - meging `!important` in shorthands. - -[3.0.4 / 2015-01-11](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.3...v3.0.4) -================== - -* Fixed issue [#314](https://github.com/jakubpawlowicz/clean-css/issues/314) - spaces inside `calc`. - -[3.0.3 / 2015-01-07](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.2...v3.0.3) -================== - -* Just a version bump as npm incorrectly things 2.2.23 is the latest one. - -[3.0.2 / 2015-01-04](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.1...v3.0.2) -================== - -* Fixed issue [#422](https://github.com/jakubpawlowicz/clean-css/issues/422) - handling `calc` as a unit. - -[3.0.1 / 2014-12-19](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.0...v3.0.1) -================== - -* Fixed issue [#410](https://github.com/jakubpawlowicz/clean-css/issues/410) - advanced merging and comments. -* Fixed issue [#411](https://github.com/jakubpawlowicz/clean-css/issues/411) - properties and important comments. - -[3.0.0 / 2014-12-18](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.22...v3.0.0) -================== - -* Adds more granular control over compatibility settings. -* Adds support for @counter-style at-rule. -* Adds `--source-map`/`sourceMap` switch for building input's source map. -* Adds `--skip-shorthand-compacting`/`shorthandComacting` option for disabling shorthand compacting. -* Allows `target` option to be a path to a folder instead of a file. -* Allows disabling rounding precision. By [@superlukas](https://github.com/superlukas). -* Breaks 2.x compatibility for using CleanCSS as a function. -* Changes `minify` method output to handle multiple outputs. -* Reworks minification to tokenize first then minify. - See [changes](https://github.com/jakubpawlowicz/clean-css/compare/b06f37d...dd8c14a). -* Removes support for node.js 0.8.x. -* Renames `noAdvanced` option into `advanced`. -* Renames `noAggressiveMerging` option into `aggressiveMerging`. -* Renames `noRebase` option into `rebase`. -* Speeds up advanced processing by shortening optimize loop. -* Fixed issue [#125](https://github.com/jakubpawlowicz/clean-css/issues/125) - source maps! -* Fixed issue [#344](https://github.com/jakubpawlowicz/clean-css/issues/344) - merging `background-size` into shorthand. -* Fixed issue [#352](https://github.com/jakubpawlowicz/clean-css/issues/352) - honors rebasing in imported stylesheets. -* Fixed issue [#360](https://github.com/jakubpawlowicz/clean-css/issues/360) - adds 7 extra CSS colors. -* Fixed issue [#363](https://github.com/jakubpawlowicz/clean-css/issues/363) - `rem` units overriding `px`. -* Fixed issue [#373](https://github.com/jakubpawlowicz/clean-css/issues/373) - proper `background` shorthand merging. -* Fixed issue [#395](https://github.com/jakubpawlowicz/clean-css/issues/395) - unescaped brackets in data URIs. -* Fixed issue [#398](https://github.com/jakubpawlowicz/clean-css/issues/398) - restoring important comments. -* Fixed issue [#400](https://github.com/jakubpawlowicz/clean-css/issues/400) - API to accept an array of filenames. -* Fixed issue [#403](https://github.com/jakubpawlowicz/clean-css/issues/403) - tracking input files in source maps. -* Fixed issue [#404](https://github.com/jakubpawlowicz/clean-css/issues/404) - no state sharing in API. -* Fixed issue [#405](https://github.com/jakubpawlowicz/clean-css/issues/405) - disables default `background-size` merging. -* Refixed issue [#304](https://github.com/jakubpawlowicz/clean-css/issues/304) - `background-position` merging. - -[2.2.22 / 2014-12-13](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.21...v2.2.22) -================== - -* Backports fix to issue [#304](https://github.com/jakubpawlowicz/clean-css/issues/304) - `background-position` merging. - -[2.2.21 / 2014-12-10](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.20...v2.2.21) -================== - -* Backports fix to issue [#373](https://github.com/jakubpawlowicz/clean-css/issues/373) - `background` shorthand merging. - -[2.2.20 / 2014-12-02](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.19...v2.2.20) -================== - -* Backports fix to issue [#390](https://github.com/jakubpawlowicz/clean-css/issues/390) - pseudo-class merging. - -[2.2.19 / 2014-11-20](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.18...v2.2.19) -================== - -* Fixed issue [#385](https://github.com/jakubpawlowicz/clean-css/issues/385) - edge cases in processing cut off data. - -[2.2.18 / 2014-11-17](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.17...v2.2.18) -================== - -* Fixed issue [#383](https://github.com/jakubpawlowicz/clean-css/issues/383) - rounding fractions once again. - -[2.2.17 / 2014-11-09](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.16...v2.2.17) -================== - -* Fixed issue [#380](https://github.com/jakubpawlowicz/clean-css/issues/380) - rounding fractions to a whole number. - -[2.2.16 / 2014-09-16](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.15...v2.2.16) -================== - -* Fixed issue [#359](https://github.com/jakubpawlowicz/clean-css/issues/359) - handling escaped double backslash. -* Fixed issue [#358](https://github.com/jakubpawlowicz/clean-css/issues/358) - property merging in compatibility mode. -* Fixed issue [#356](https://github.com/jakubpawlowicz/clean-css/issues/356) - preserving `*+html` hack. -* Fixed issue [#354](https://github.com/jakubpawlowicz/clean-css/issues/354) - `!important` overriding in shorthands. - -[2.2.15 / 2014-09-01](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.14...v2.2.15) -================== - -* Fixed issue [#343](https://github.com/jakubpawlowicz/clean-css/issues/343) - too aggressive `rgba`/`hsla` minification. -* Fixed issue [#345](https://github.com/jakubpawlowicz/clean-css/issues/345) - URL rebasing for document relative ones. -* Fixed issue [#346](https://github.com/jakubpawlowicz/clean-css/issues/346) - overriding `!important` by `!important`. -* Fixed issue [#350](https://github.com/jakubpawlowicz/clean-css/issues/350) - edge cases in `@import` processing. - -[2.2.14 / 2014-08-25](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.13...v2.2.14) -================== - -* Makes multival operations idempotent. -* Fixed issue [#339](https://github.com/jakubpawlowicz/clean-css/issues/339) - skips invalid properties. -* Fixed issue [#341](https://github.com/jakubpawlowicz/clean-css/issues/341) - ensure output is shorter than input. - -[2.2.13 / 2014-08-12](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.12...v2.2.13) -================== - -* Fixed issue [#337](https://github.com/jakubpawlowicz/clean-css/issues/337) - handling component importance. - -[2.2.12 / 2014-08-02](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.11...v2.2.12) -================== - -* Fixed issue with tokenizer removing first selector after an unknown @ rule. -* Fixed issue [#329](https://github.com/jakubpawlowicz/clean-css/issues/329) - `font` shorthands incorrectly processed. -* Fixed issue [#332](https://github.com/jakubpawlowicz/clean-css/issues/332) - `background` shorthand with colors. -* Refixed issue [#325](https://github.com/jakubpawlowicz/clean-css/issues/325) - invalid charset declarations. - -[2.2.11 / 2014-07-28](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.10...v2.2.11) -================== - -* Fixed issue [#326](https://github.com/jakubpawlowicz/clean-css/issues/326) - `background-size` regression. - -[2.2.10 / 2014-07-27](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.9...v2.2.10) -================== - -* Improved performance of advanced mode validators. -* Fixed issue [#307](https://github.com/jakubpawlowicz/clean-css/issues/307) - `background-color` in multiple backgrounds. -* Fixed issue [#322](https://github.com/jakubpawlowicz/clean-css/issues/322) - adds `background-size` support. -* Fixed issue [#323](https://github.com/jakubpawlowicz/clean-css/issues/323) - stripping variable references. -* Fixed issue [#325](https://github.com/jakubpawlowicz/clean-css/issues/325) - removing invalid `@charset` declarations. - -[2.2.9 / 2014-07-23](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.8...v2.2.9) -================== - -* Adds `background` normalization according to W3C spec. -* Fixed issue [#316](https://github.com/jakubpawlowicz/clean-css/issues/316) - incorrect `background` processing. - -[2.2.8 / 2014-07-14](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.7...v2.2.8) -================== - -* Fixed issue [#313](https://github.com/jakubpawlowicz/clean-css/issues/313) - processing comment marks in URLs. -* Fixed issue [#315](https://github.com/jakubpawlowicz/clean-css/issues/315) - `rgba`/`hsla` -> `transparent` in gradients. - -[2.2.7 / 2014-07-10](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.6...v2.2.7) -================== - -* Fixed issue [#304](https://github.com/jakubpawlowicz/clean-css/issues/304) - merging multiple backgrounds. -* Fixed issue [#312](https://github.com/jakubpawlowicz/clean-css/issues/312) - merging with mixed repeat. - -[2.2.6 / 2014-07-05](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.5...v2.2.6) -================== - -* Adds faster quote matching in QuoteScanner. -* Improves QuoteScanner to handle comments correctly. -* Fixed issue [#308](https://github.com/jakubpawlowicz/clean-css/issues/308) - parsing comments in quoted URLs. -* Fixed issue [#311](https://github.com/jakubpawlowicz/clean-css/issues/311) - leading/trailing decimal points. - -[2.2.5 / 2014-06-29](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.4...v2.2.5) -================== - -* Adds removing extra spaces around / in border-radius. -* Adds replacing same horizontal & vertical value in border-radius. -* Fixed issue [#305](https://github.com/jakubpawlowicz/clean-css/issues/305) - allows width keywords in `border-width`. - -[2.2.4 / 2014-06-27](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.3...v2.2.4) -================== - -* Fixed issue [#301](https://github.com/jakubpawlowicz/clean-css/issues/301) - proper `border-radius` processing. -* Fixed issue [#303](https://github.com/jakubpawlowicz/clean-css/issues/303) - correctly preserves viewport units. - -[2.2.3 / 2014-06-24](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.2...v2.2.3) -================== - -* Fixed issue [#302](https://github.com/jakubpawlowicz/clean-css/issues/302) - handling of `outline-style: auto`. - -[2.2.2 / 2014-06-18](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.1...v2.2.2) -================== - -* Fixed issue [#297](https://github.com/jakubpawlowicz/clean-css/issues/297) - `box-shadow` zeros minification. - -[2.2.1 / 2014-06-14](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.0...v2.2.1) -================== - -* Fixes new property optimizer for 'none' values. -* Fixed issue [#294](https://github.com/jakubpawlowicz/clean-css/issues/294) - space after `rgba`/`hsla` in IE<=11. - -[2.2.0 / 2014-06-11](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.8...v2.2.0) -================== - -* Adds a better algorithm for quotation marks' removal. -* Adds a better non-adjacent optimizer compatible with the upcoming new property optimizer. -* Adds minifying remote files directly from CLI. -* Adds `--rounding-precision` to control rounding precision. -* Moves quotation matching into a `QuoteScanner` class. -* Adds `npm run browserify` for creating embeddable version of clean-css. -* Fixed list-style-* advanced processing. -* Fixed issue [#134](https://github.com/jakubpawlowicz/clean-css/issues/134) - merges properties into shorthand form. -* Fixed issue [#164](https://github.com/jakubpawlowicz/clean-css/issues/164) - removes default values if not needed. -* Fixed issue [#168](https://github.com/jakubpawlowicz/clean-css/issues/168) - adds better property merging algorithm. -* Fixed issue [#173](https://github.com/jakubpawlowicz/clean-css/issues/173) - merges same properties if grouped. -* Fixed issue [#184](https://github.com/jakubpawlowicz/clean-css/issues/184) - uses `!important` for optimization opportunities. -* Fixed issue [#190](https://github.com/jakubpawlowicz/clean-css/issues/190) - uses shorthand to override another shorthand. -* Fixed issue [#197](https://github.com/jakubpawlowicz/clean-css/issues/197) - adds borders merging by understandability. -* Fixed issue [#210](https://github.com/jakubpawlowicz/clean-css/issues/210) - adds temporary workaround for aggressive merging. -* Fixed issue [#246](https://github.com/jakubpawlowicz/clean-css/issues/246) - removes IE hacks when not in compatibility mode. -* Fixed issue [#247](https://github.com/jakubpawlowicz/clean-css/issues/247) - removes deprecated `selectorsMergeMode` switch. -* Refixed issue [#250](https://github.com/jakubpawlowicz/clean-css/issues/250) - based on new quotation marks removal. -* Fixed issue [#257](https://github.com/jakubpawlowicz/clean-css/issues/257) - turns `rgba`/`hsla` to `transparent` if possible. -* Fixed issue [#265](https://github.com/jakubpawlowicz/clean-css/issues/265) - adds support for multiple input files. -* Fixed issue [#275](https://github.com/jakubpawlowicz/clean-css/issues/275) - handling transform properties. -* Fixed issue [#276](https://github.com/jakubpawlowicz/clean-css/issues/276) - corrects unicode handling. -* Fixed issue [#288](https://github.com/jakubpawlowicz/clean-css/issues/288) - adds smarter expression parsing. -* Fixed issue [#293](https://github.com/jakubpawlowicz/clean-css/issues/293) - handles escaped `@` symbols in class names and IDs. - -[2.1.8 / 2014-03-28](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.7...v2.1.8) -================== - -* Fixed issue [#267](https://github.com/jakubpawlowicz/clean-css/issues/267) - incorrect non-adjacent selector merging. - -[2.1.7 / 2014-03-24](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.6...v2.1.7) -================== - -* Fixed issue [#264](https://github.com/jakubpawlowicz/clean-css/issues/264) - `@import` statements inside comments. - -[2.1.6 / 2014-03-10](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.5...v2.1.6) -================== - -* Fixed issue [#258](https://github.com/jakubpawlowicz/clean-css/issues/258) - wrong `@import` handling in `EmptyRemoval`. - -[2.1.5 / 2014-03-07](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.4...v2.1.5) -================== - -* Fixed issue [#255](https://github.com/jakubpawlowicz/clean-css/issues/255) - incorrect processing of a trailing `-0`. - -[2.1.4 / 2014-03-01](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.3...v2.1.4) -================== - -* Fixed issue [#250](https://github.com/jakubpawlowicz/clean-css/issues/250) - correctly handle JSON data in quotations. - -[2.1.3 / 2014-02-26](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.2...v2.1.3) -================== - -* Fixed issue [#248](https://github.com/jakubpawlowicz/clean-css/issues/248) - incorrect merging for vendor selectors. - -[2.1.2 / 2014-02-25](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.1...v2.1.2) -================== - -* Fixed issue [#245](https://github.com/jakubpawlowicz/clean-css/issues/245) - incorrect handling of backslash IE hack. - -[2.1.1 / 2014-02-18](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.0...v2.1.1) -================== - -* Adds faster selectors processing in advanced optimizer. -* Fixed issue [#241](https://github.com/jakubpawlowicz/clean-css/issues/241) - incorrect handling of `:not()` selectors. - -[2.1.0 / 2014-02-13](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.8...v2.1.0) -================== - -* Adds an optional callback to minify method. -* Deprecates `--selectors-merge-mode` / `selectorsMergeMode` in favor to `--compatibility` / `compatibility`. -* Fixes debug mode stats for stylesheets using `@import` statements. -* Skips empty removal if advanced processing is enabled. -* Fixed issue [#85](https://github.com/jakubpawlowicz/clean-css/issues/85) - resolving protocol `@import`s. -* Fixed issue [#160](https://github.com/jakubpawlowicz/clean-css/issues/160) - re-runs optimizer until a clean pass. -* Fixed issue [#161](https://github.com/jakubpawlowicz/clean-css/issues/161) - improves tokenizer performance. -* Fixed issue [#163](https://github.com/jakubpawlowicz/clean-css/issues/163) - round pixels to 2nd decimal place. -* Fixed issue [#165](https://github.com/jakubpawlowicz/clean-css/issues/165) - extra space after trailing parenthesis. -* Fixed issue [#186](https://github.com/jakubpawlowicz/clean-css/issues/186) - strip unit from `0rem`. -* Fixed issue [#207](https://github.com/jakubpawlowicz/clean-css/issues/207) - bug in parsing protocol `@import`s. -* Fixed issue [#213](https://github.com/jakubpawlowicz/clean-css/issues/213) - faster `rgb` to `hex` transforms. -* Fixed issue [#215](https://github.com/jakubpawlowicz/clean-css/issues/215) - leading zeros in numerical values. -* Fixed issue [#217](https://github.com/jakubpawlowicz/clean-css/issues/217) - whitespace inside attribute selectors and URLs. -* Fixed issue [#218](https://github.com/jakubpawlowicz/clean-css/issues/218) - `@import` statements cleanup. -* Fixed issue [#220](https://github.com/jakubpawlowicz/clean-css/issues/220) - selector between comments. -* Fixed issue [#223](https://github.com/jakubpawlowicz/clean-css/issues/223) - two-pass adjacent selectors merging. -* Fixed issue [#226](https://github.com/jakubpawlowicz/clean-css/issues/226) - don't minify `border:none` to `border:0`. -* Fixed issue [#229](https://github.com/jakubpawlowicz/clean-css/issues/229) - improved processing of fraction numbers. -* Fixed issue [#230](https://github.com/jakubpawlowicz/clean-css/issues/230) - better handling of zero values. -* Fixed issue [#235](https://github.com/jakubpawlowicz/clean-css/issues/235) - IE7 compatibility mode. -* Fixed issue [#236](https://github.com/jakubpawlowicz/clean-css/issues/236) - incorrect rebasing with nested `import`s. - -[2.0.8 / 2014-02-07](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.7...v2.0.8) -================== - -* Fixed issue [#232](https://github.com/jakubpawlowicz/clean-css/issues/232) - edge case in non-adjacent selectors merging. - -[2.0.7 / 2014-01-16](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.6...v2.0.7) -================== - -* Fixed issue [#208](https://github.com/jakubpawlowicz/clean-css/issues/208) - don't swallow `@page` and `@viewport`. - -[2.0.6 / 2014-01-04](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.5...v2.0.6) -================== - -* Fixed issue [#198](https://github.com/jakubpawlowicz/clean-css/issues/198) - process comments and `@import`s correctly. -* Fixed issue [#205](https://github.com/jakubpawlowicz/clean-css/issues/205) - freeze on broken `@import` declaration. - -[2.0.5 / 2014-01-03](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.4...v2.0.5) -================== - -* Fixed issue [#199](https://github.com/jakubpawlowicz/clean-css/issues/199) - keep line breaks with no advanced optimizations. -* Fixed issue [#203](https://github.com/jakubpawlowicz/clean-css/issues/203) - Buffer as a first argument to minify method. - -[2.0.4 / 2013-12-19](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.3...v2.0.4) -================== - -* Fixed issue [#193](https://github.com/jakubpawlowicz/clean-css/issues/193) - HSL color space normalization. - -[2.0.3 / 2013-12-18](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.2...v2.0.3) -================== - -* Fixed issue [#191](https://github.com/jakubpawlowicz/clean-css/issues/191) - leading numbers in `font`/`animation` names. -* Fixed issue [#192](https://github.com/jakubpawlowicz/clean-css/issues/192) - many `@import`s inside a comment. - -[2.0.2 / 2013-11-18](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.1...v2.0.2) -================== - -* Fixed issue [#177](https://github.com/jakubpawlowicz/clean-css/issues/177) - process broken content correctly. - -[2.0.1 / 2013-11-14](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.0...v2.0.1) -================== - -* Fixed issue [#176](https://github.com/jakubpawlowicz/clean-css/issues/176) - hangs on `undefined` keyword. - -[2.0.0 / 2013-11-04](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.7...v2.0.0) -================== - -* Adds simplified and more advanced text escaping / restoring via `EscapeStore` class. -* Adds simplified and much faster empty elements removal. -* Adds missing `@import` processing to our benchmark (run via `npm run bench`). -* Adds CSS tokenizer which will make it possible to optimize content by reordering and/or merging selectors. -* Adds basic optimizer removing duplicate selectors from a list. -* Adds merging duplicate properties within a single selector's body. -* Adds merging adjacent selectors within a scope (single and multiple ones). -* Changes behavior of `--keep-line-breaks`/`keepBreaks` option to keep breaks after trailing braces only. -* Makes all multiple selectors ordered alphabetically (aids merging). -* Adds property overriding so more coarse properties override more granular ones. -* Adds reducing non-adjacent selectors. -* Adds `--skip-advanced`/`noAdvanced` switch to disable advanced optimizations. -* Adds reducing non-adjacent selectors when overridden by more complex selectors. -* Fixed issue [#138](https://github.com/jakubpawlowicz/clean-css/issues/138) - makes CleanCSS interface OO. -* Fixed issue [#139](https://github.com/jakubpawlowicz/clean-css/issues/138) - consistent error & warning handling. -* Fixed issue [#145](https://github.com/jakubpawlowicz/clean-css/issues/145) - debug mode in library too. -* Fixed issue [#157](https://github.com/jakubpawlowicz/clean-css/issues/157) - gets rid of `removeEmpty` option. -* Fixed issue [#159](https://github.com/jakubpawlowicz/clean-css/issues/159) - escaped quotes inside content. -* Fixed issue [#162](https://github.com/jakubpawlowicz/clean-css/issues/162) - strip quotes from Base64 encoded URLs. -* Fixed issue [#166](https://github.com/jakubpawlowicz/clean-css/issues/166) - `debug` formatting in CLI -* Fixed issue [#167](https://github.com/jakubpawlowicz/clean-css/issues/167) - `background:transparent` minification. - -[1.1.7 / 2013-10-28](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.6...v1.1.7) -================== - -* Fixed issue [#156](https://github.com/jakubpawlowicz/clean-css/issues/156) - `@import`s inside comments. - -[1.1.6 / 2013-10-26](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.5...v1.1.6) -================== - -* Fixed issue [#155](https://github.com/jakubpawlowicz/clean-css/issues/155) - broken irregular CSS content. - -[1.1.5 / 2013-10-24](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.4...v1.1.5) -================== - -* Fixed issue [#153](https://github.com/jakubpawlowicz/clean-css/issues/153) - `keepSpecialComments` `0`/`1` as a string. - -[1.1.4 / 2013-10-23](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.3...v1.1.4) -================== - -* Fixed issue [#152](https://github.com/jakubpawlowicz/clean-css/issues/152) - adds an option to disable rebasing. - -[1.1.3 / 2013-10-04](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.2...v1.1.3) -================== - -* Fixed issue [#150](https://github.com/jakubpawlowicz/clean-css/issues/150) - minifying `background:none`. - -[1.1.2 / 2013-09-29](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.1...v1.1.2) -================== - -* Fixed issue [#149](https://github.com/jakubpawlowicz/clean-css/issues/149) - shorthand `font` property. - -[1.1.1 / 2013-09-07](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.0...v1.1.1) -================== - -* Fixed issue [#144](https://github.com/jakubpawlowicz/clean-css/issues/144) - skip URLs rebasing by default. - -[1.1.0 / 2013-09-06](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.12...v1.1.0) -================== - -* Renamed lib's `debug` option to `benchmark` when doing per-minification benchmarking. -* Added simplified comments processing & imports. -* Fixed issue [#43](https://github.com/jakubpawlowicz/clean-css/issues/43) - `--debug` switch for minification stats. -* Fixed issue [#65](https://github.com/jakubpawlowicz/clean-css/issues/65) - full color name / hex shortening. -* Fixed issue [#84](https://github.com/jakubpawlowicz/clean-css/issues/84) - support for `@import` with media queries. -* Fixed issue [#124](https://github.com/jakubpawlowicz/clean-css/issues/124) - raise error on broken imports. -* Fixed issue [#126](https://github.com/jakubpawlowicz/clean-css/issues/126) - proper CSS expressions handling. -* Fixed issue [#129](https://github.com/jakubpawlowicz/clean-css/issues/129) - rebasing imported URLs. -* Fixed issue [#130](https://github.com/jakubpawlowicz/clean-css/issues/130) - better code modularity. -* Fixed issue [#135](https://github.com/jakubpawlowicz/clean-css/issues/135) - require node.js 0.8+. - -[1.0.12 / 2013-07-19](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.11...v1.0.12) -=================== - -* Fixed issue [#121](https://github.com/jakubpawlowicz/clean-css/issues/121) - ability to skip `@import` processing. - -[1.0.11 / 2013-07-08](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.10...v1.0.11) -=================== - -* Fixed issue [#117](https://github.com/jakubpawlowicz/clean-css/issues/117) - line break escaping in comments. - -[1.0.10 / 2013-06-13](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.9...v1.0.10) -=================== - -* Fixed issue [#114](https://github.com/jakubpawlowicz/clean-css/issues/114) - comments in imported stylesheets. - -[1.0.9 / 2013-06-11](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.8...v1.0.9) -================== - -* Fixed issue [#113](https://github.com/jakubpawlowicz/clean-css/issues/113) - `@import` in comments. - -[1.0.8 / 2013-06-10](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.7...v1.0.8) -================== - -* Fixed issue [#112](https://github.com/jakubpawlowicz/clean-css/issues/112) - reducing `box-shadow` zeros. - -[1.0.7 / 2013-06-05](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.6...v1.0.7) -================== - -* Support for `@import` URLs starting with `//`. By [@petetak](https://github.com/petetak). - -[1.0.6 / 2013-06-04](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.5...v1.0.6) -================== - -* Fixed issue [#110](https://github.com/jakubpawlowicz/clean-css/issues/110) - data URIs in URLs. - -[1.0.5 / 2013-05-26](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.4...v1.0.5) -================== - -* Fixed issue [#107](https://github.com/jakubpawlowicz/clean-css/issues/107) - data URIs in imported stylesheets. - -1.0.4 / 2013-05-23 -================== - -* Rewrite relative URLs in imported stylesheets. By [@bluej100](https://github.com/bluej100). - -1.0.3 / 2013-05-20 -================== - -* Support alternative `@import` syntax with file name not wrapped inside `url()` statement. - By [@bluej100](https://github.com/bluej100). - -1.0.2 / 2013-04-29 -================== - -* Fixed issue [#97](https://github.com/jakubpawlowicz/clean-css/issues/97) - `--remove-empty` & FontAwesome. - -1.0.1 / 2013-04-08 -================== - -* Do not pick up `bench` and `test` while building `npm` package. - By [@sindresorhus](https://https://github.com/sindresorhus). - -1.0.0 / 2013-03-30 -================== - -* Fixed issue [#2](https://github.com/jakubpawlowicz/clean-css/issues/2) - resolving `@import` rules. -* Fixed issue [#44](https://github.com/jakubpawlowicz/clean-css/issues/44) - examples in `--help`. -* Fixed issue [#46](https://github.com/jakubpawlowicz/clean-css/issues/46) - preserving special characters in URLs and attributes. -* Fixed issue [#80](https://github.com/jakubpawlowicz/clean-css/issues/80) - quotation in multi line strings. -* Fixed issue [#83](https://github.com/jakubpawlowicz/clean-css/issues/83) - HSL to hex color conversions. -* Fixed issue [#86](https://github.com/jakubpawlowicz/clean-css/issues/86) - broken `@charset` replacing. -* Fixed issue [#88](https://github.com/jakubpawlowicz/clean-css/issues/88) - removes space in `! important`. -* Fixed issue [#92](https://github.com/jakubpawlowicz/clean-css/issues/92) - uppercase hex to short versions. - -0.10.2 / 2013-03-19 -=================== - -* Fixed issue [#79](https://github.com/jakubpawlowicz/clean-css/issues/79) - node.js 0.10.x compatibility. - -0.10.1 / 2013-02-14 -=================== - -* Fixed issue [#66](https://github.com/jakubpawlowicz/clean-css/issues/66) - line breaks without extra spaces should - be handled correctly. - -0.10.0 / 2013-02-09 -=================== - -* Switched from [optimist](https://github.com/substack/node-optimist) to - [commander](https://github.com/visionmedia/commander.js) for CLI processing. -* Changed long options from `--removeempty` to `--remove-empty` and from `--keeplinebreaks` to `--keep-line-breaks`. -* Fixed performance issue with replacing multiple `@charset` declarations and issue - with line break after `@charset` when using `keepLineBreaks` option. By [@rrjaime](https://github.com/rrjamie). -* Removed Makefile in favor to `npm run` commands (e.g. `make check` -> `npm run check`). -* Fixed issue [#47](https://github.com/jakubpawlowicz/clean-css/issues/47) - commandline issues on Windows. -* Fixed issue [#49](https://github.com/jakubpawlowicz/clean-css/issues/49) - remove empty selectors from media query. -* Fixed issue [#52](https://github.com/jakubpawlowicz/clean-css/issues/52) - strip fraction zeros if not needed. -* Fixed issue [#58](https://github.com/jakubpawlowicz/clean-css/issues/58) - remove colon where possible. -* Fixed issue [#59](https://github.com/jakubpawlowicz/clean-css/issues/59) - content property handling. - -0.9.1 / 2012-12-19 -================== - -* Fixed issue [#37](https://github.com/jakubpawlowicz/clean-css/issues/37) - converting - `white` and other colors in class names (reported by [@malgorithms](https://github.com/malgorithms)). - -0.9.0 / 2012-12-15 -================== - -* Added stripping quotation from font names (if possible). -* Added stripping quotation from `@keyframes` declaration, `animation` and - `animation-name` property. -* Added stripping quotations from attributes' value (e.g. `[data-target='x']`). -* Added better hex->name and name->hex color shortening. -* Added `font: normal` and `font: bold` shortening the same way as `font-weight` is. -* Refactored shorthand selectors and added `border-radius`, `border-style` - and `border-color` shortening. -* Added `margin`, `padding` and `border-width` shortening. -* Added removing line break after commas. -* Fixed removing whitespace inside media query definition. -* Added removing line breaks after a comma, so all declarations are one-liners now. -* Speed optimizations (~10% despite many new features). -* Added [JSHint](https://github.com/jshint/jshint/) validation rules via `make check`. - -0.8.3 / 2012-11-29 -================== - -* Fixed HSL/HSLA colors processing. - -0.8.2 / 2012-10-31 -================== - -* Fixed shortening hex colors and their relation to hashes in URLs. -* Cleanup by [@XhmikosR](https://github.com/XhmikosR). - -0.8.1 / 2012-10-28 -================== - -* Added better zeros processing for `rect(...)` syntax (clip property). - -0.8.0 / 2012-10-21 -================== - -* Added removing URLs quotation if possible. -* Rewrote breaks processing. -* Added `keepBreaks`/`-b` option to keep line breaks in the minimized file. -* Reformatted [lib/clean.js](/lib/clean.js) so it's easier to follow the rules. -* Minimized test data is now minimized with line breaks so it's easier to - compare the changes line by line. - -0.7.0 / 2012-10-14 -================== - -* Added stripping special comments to CLI (`--s0` and `--s1` options). -* Added stripping special comments to programmatic interface - (`keepSpecialComments` option). - -0.6.0 / 2012-08-05 -================== - -* Full Windows support with tests (./test.bat). - -0.5.0 / 2012-08-02 -================== - -* Made path to vows local. -* Explicit node.js 0.6 requirement. - -0.4.2 / 2012-06-28 -================== - -* Updated binary `-v` option (version). -* Updated binary to output help when no options given (but not in piped mode). -* Added binary tests. - -0.4.1 / 2012-06-10 -================== - -* Fixed stateless mode where calling `CleanCSS#process` directly was giving - errors (reported by [@facelessuser](https://github.com/facelessuser)). - -0.4.0 / 2012-06-04 -================== - -* Speed improvements up to 4x thanks to the rewrite of comments and CSS' content - processing. -* Stripping empty CSS tags is now optional (see [bin/cleancss](/bin/cleancss) for details). -* Improved debugging mode (see [test/bench.js](/test/bench.js)) -* Added `make bench` for a one-pass benchmark. - -0.3.3 / 2012-05-27 -================== - -* Fixed tests, [package.json](/package.json) for development, and regex - for removing empty declarations (thanks to [@vvo](https://github.com/vvo)). - -0.3.2 / 2012-01-17 -================== - -* Fixed output method under node.js 0.6 which incorrectly tried to close - `process.stdout`. - -0.3.1 / 2011-12-16 -================== - -* Fixed cleaning up `0 0 0 0` expressions. - -0.3.0 / 2011-11-29 -================== - -* Clean-css requires node.js 0.4.0+ to run. -* Removed node.js's 0.2.x 'sys' package dependency - (thanks to [@jmalonzo](https://github.com/jmalonzo) for a patch). - -0.2.6 / 2011-11-27 -================== - -* Fixed expanding `+` signs in `calc()` when mixed up with adjacent `+` selector. - -0.2.5 / 2011-11-27 -================== - -* Fixed issue with cleaning up spaces inside `calc`/`-moz-calc` declarations - (thanks to [@cvan](https://github.com/cvan) for reporting it). -* Fixed converting `#f00` to `red` in borders and gradients. - -0.2.4 / 2011-05-25 -================== - -* Fixed problem with expanding `none` to `0` in partial/full background - declarations. -* Fixed including clean-css library from binary (global to local). - -0.2.3 / 2011-04-18 -================== - -* Fixed problem with optimizing IE filters. - -0.2.2 / 2011-04-17 -================== - -* Fixed problem with space before color in `border` property. - -0.2.1 / 2011-03-19 -================== - -* Added stripping space before `!important` keyword. -* Updated repository location and author information in [package.json](/package.json). - -0.2.0 / 2011-03-02 -================== - -* Added options parsing via optimist. -* Changed code inclusion (thus the version bump). - -0.1.0 / 2011-02-27 -================== - -* First version of clean-css library. -* Implemented all basic CSS transformations. diff --git a/node_modules/clean-css/LICENSE b/node_modules/clean-css/LICENSE deleted file mode 100644 index 32bb13f..0000000 --- a/node_modules/clean-css/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2015 JakubPawlowicz.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/clean-css/README.md b/node_modules/clean-css/README.md deleted file mode 100644 index ee08b7a..0000000 --- a/node_modules/clean-css/README.md +++ /dev/null @@ -1,369 +0,0 @@ -[![NPM version](https://img.shields.io/npm/v/clean-css.svg?style=flat)](https://www.npmjs.com/package/clean-css) -[![Linux Build Status](https://img.shields.io/travis/jakubpawlowicz/clean-css/master.svg?style=flat&label=Linux%20build)](https://travis-ci.org/jakubpawlowicz/clean-css) -[![Windows Build status](https://img.shields.io/appveyor/ci/jakubpawlowicz/clean-css/master.svg?style=flat&label=Windows%20build)](https://ci.appveyor.com/project/jakubpawlowicz/clean-css/branch/master) -[![Dependency Status](https://img.shields.io/david/jakubpawlowicz/clean-css.svg?style=flat)](https://david-dm.org/jakubpawlowicz/clean-css) -[![devDependency Status](https://img.shields.io/david/dev/jakubpawlowicz/clean-css.svg?style=flat)](https://david-dm.org/jakubpawlowicz/clean-css#info=devDependencies) - -## What is clean-css? - -Clean-css is a fast and efficient [Node.js](http://nodejs.org/) library for minifying CSS files. - -According to [tests](http://goalsmashers.github.io/css-minification-benchmark/) it is one of the best available. - - -## Usage - -### What are the requirements? - -``` -Node.js 0.10+ (tested on CentOS, Ubuntu, OS X 10.6+, and Windows 7+) or io.js 3.0+ -``` - -### How to install clean-css? - -``` -npm install clean-css -``` - -### How to use clean-css CLI? - -Clean-css accepts the following command line arguments (please make sure -you use `` as the very last argument to avoid potential issues): - -``` -cleancss [options] source-file, [source-file, ...] - --h, --help output usage information --v, --version output the version number --b, --keep-line-breaks Keep line breaks --c, --compatibility [ie7|ie8] Force compatibility mode (see Readme for advanced examples) --d, --debug Shows debug information (minification time & compression efficiency) --o, --output [output-file] Use [output-file] as output instead of STDOUT --r, --root [root-path] Set a root path to which resolve absolute @import rules --s, --skip-import Disable @import processing --t, --timeout [seconds] Per connection timeout when fetching remote @imports (defaults to 5 seconds) ---rounding-precision [n] Rounds to `N` decimal places. Defaults to 2. -1 disables rounding ---s0 Remove all special comments, i.e. /*! comment */ ---s1 Remove all special comments but the first one ---semantic-merging Enables unsafe mode by assuming BEM-like semantic stylesheets (warning, this may break your styling!) ---skip-advanced Disable advanced optimizations - ruleset reordering & merging ---skip-aggressive-merging Disable properties merging based on their order ---skip-import-from [rules] Disable @import processing for specified rules ---skip-media-merging Disable @media merging ---skip-rebase Disable URLs rebasing ---skip-restructuring Disable restructuring optimizations ---skip-shorthand-compacting Disable shorthand compacting ---source-map Enables building input's source map ---source-map-inline-sources Enables inlining sources inside source maps -``` - -#### Examples: - -To minify a **public.css** file into **public-min.css** do: - -``` -cleancss -o public-min.css public.css -``` - -To minify the same **public.css** into the standard output skip the `-o` parameter: - -``` -cleancss public.css -``` - -More likely you would like to concatenate a couple of files. -If you are on a Unix-like system: - -```bash -cat one.css two.css three.css | cleancss -o merged-and-minified.css -``` - -On Windows: - -```bat -type one.css two.css three.css | cleancss -o merged-and-minified.css -``` - -Or even gzip the result at once: - -```bash -cat one.css two.css three.css | cleancss | gzip -9 -c > merged-minified-and-gzipped.css.gz -``` - -### How to use clean-css API? - -```js -var CleanCSS = require('clean-css'); -var source = 'a{font-weight:bold;}'; -var minified = new CleanCSS().minify(source).styles; -``` - -CleanCSS constructor accepts a hash as a parameter, i.e., -`new CleanCSS(options)` with the following options available: - -* `advanced` - set to false to disable advanced optimizations - selector & property merging, reduction, etc. -* `aggressiveMerging` - set to false to disable aggressive merging of properties. -* `benchmark` - turns on benchmarking mode measuring time spent on cleaning up (run `npm run bench` to see example) -* `compatibility` - enables compatibility mode, see [below for more examples](#how-to-set-a-compatibility-mode) -* `debug` - set to true to get minification statistics under `stats` property (see `test/custom-test.js` for examples) -* `inliner` - a hash of options for `@import` inliner, see [test/protocol-imports-test.js](https://github.com/jakubpawlowicz/clean-css/blob/master/test/protocol-imports-test.js#L372) for examples, or [this comment](https://github.com/jakubpawlowicz/clean-css/issues/612#issuecomment-119594185) for a proxy use case. -* `keepBreaks` - whether to keep line breaks (default is false) -* `keepSpecialComments` - `*` for keeping all (default), `1` for keeping first one only, `0` for removing all -* `mediaMerging` - whether to merge `@media` at-rules (default is true) -* `processImport` - whether to process `@import` rules -* `processImportFrom` - a list of `@import` rules, can be `['all']` (default), `['local']`, `['remote']`, or a blacklisted path e.g. `['!fonts.googleapis.com']` -* `rebase` - set to false to skip URL rebasing -* `relativeTo` - path to **resolve** relative `@import` rules and URLs -* `restructuring` - set to false to disable restructuring in advanced optimizations -* `root` - path to **resolve** absolute `@import` rules and **rebase** relative URLs -* `roundingPrecision` - rounding precision; defaults to `2`; `-1` disables rounding -* `semanticMerging` - set to true to enable semantic merging mode which assumes BEM-like content (default is false as it's highly likely this will break your stylesheets - **use with caution**!) -* `shorthandCompacting` - set to false to skip shorthand compacting (default is true unless sourceMap is set when it's false) -* `sourceMap` - exposes source map under `sourceMap` property, e.g. `new CleanCSS().minify(source).sourceMap` (default is false) - If input styles are a product of CSS preprocessor (Less, Sass) an input source map can be passed as a string. -* `sourceMapInlineSources` - set to true to inline sources inside a source map's `sourcesContent` field (defaults to false) - It is also required to process inlined sources from input source maps. -* `target` - path to a folder or an output file to which **rebase** all URLs - -The output of `minify` method (or the 2nd argument to passed callback) is a hash containing the following fields: - -* `styles` - optimized output CSS as a string -* `sourceMap` - output source map (if requested with `sourceMap` option) -* `errors` - a list of errors raised -* `warnings` - a list of warnings raised -* `stats` - a hash of statistic information (if requested with `debug` option): - * `originalSize` - original content size (after import inlining) - * `minifiedSize` - optimized content size - * `timeSpent` - time spent on optimizations - * `efficiency` - a ratio of output size to input size (e.g. 25% if content was reduced from 100 bytes to 75 bytes) - -#### How to make sure remote `@import`s are processed correctly? - -In order to inline remote `@import` statements you need to provide a callback to minify method, e.g.: - -```js -var CleanCSS = require('clean-css'); -var source = '@import url(http://path/to/remote/styles);'; -new CleanCSS().minify(source, function (errors, minified) { - // minified.styles -}); -``` - -This is due to a fact, that, while local files can be read synchronously, remote resources can only be processed asynchronously. -If you don't provide a callback, then remote `@import`s will be left intact. - -### How to use clean-css with build tools? - -* [Broccoli](https://github.com/broccolijs/broccoli#broccoli): [broccoli-clean-css](https://github.com/shinnn/broccoli-clean-css) -* [Brunch](http://brunch.io/): [clean-css-brunch](https://github.com/brunch/clean-css-brunch) -* [Grunt](http://gruntjs.com): [grunt-contrib-cssmin](https://github.com/gruntjs/grunt-contrib-cssmin) -* [Gulp](http://gulpjs.com/): [gulp-minify-css](https://github.com/jonathanepollack/gulp-minify-css) -* [Gulp](http://gulpjs.com/): [using vinyl-map as a wrapper - courtesy of @sogko](https://github.com/jakubpawlowicz/clean-css/issues/342) -* [component-builder2](https://github.com/component/builder2.js): [builder-clean-css](https://github.com/poying/builder-clean-css) -* [Metalsmith](http://metalsmith.io): [metalsmith-clean-css](https://github.com/aymericbeaumet/metalsmith-clean-css) -* [Lasso](https://github.com/lasso-js/lasso): [lasso-clean-css](https://github.com/yomed/lasso-clean-css) - -### What are the clean-css' dev commands? - -First clone the source, then run: - -* `npm run bench` for clean-css benchmarks (see [test/bench.js](https://github.com/jakubpawlowicz/clean-css/blob/master/test/bench.js) for details) -* `npm run browserify` to create the browser-ready clean-css version -* `npm run check` to check JS sources with [JSHint](https://github.com/jshint/jshint/) -* `npm test` for the test suite - -## How to contribute to clean-css? - -See [CONTRIBUTING.md](https://github.com/jakubpawlowicz/clean-css/blob/master/CONTRIBUTING.md). - -## Tips & Tricks - -### How to preserve a comment block? - -Use the `/*!` notation instead of the standard one `/*`: - -```css -/*! - Important comments included in minified output. -*/ -``` - -### How to rebase relative image URLs? - -Clean-css will handle it automatically for you (since version 1.1) in the following cases: - -* When using the CLI: - 1. Use an output path via `-o`/`--output` to rebase URLs as relative to the output file. - 2. Use a root path via `-r`/`--root` to rebase URLs as absolute from the given root path. - 3. If you specify both then `-r`/`--root` takes precendence. -* When using clean-css as a library: - 1. Use a combination of `relativeTo` and `target` options for relative rebase (same as 1 in CLI). - 2. Use a combination of `relativeTo` and `root` options for absolute rebase (same as 2 in CLI). - 3. `root` takes precendence over `target` as in CLI. - -### How to generate source maps? - -Source maps are supported since version 3.0. - -Additionally to mapping original CSS files, clean-css also supports input source maps, so minified styles can be mapped into their [Less](http://lesscss.org/) or [Sass](http://sass-lang.com/) sources directly. - -Source maps are generated using [source-map](https://github.com/mozilla/source-map/) module from Mozilla. - -#### Using CLI - -To generate a source map, use `--source-map` switch, e.g.: - -``` -cleancss --source-map --output styles.min.css styles.css -``` - -Name of the output file is required, so a map file, named by adding `.map` suffix to output file name, can be created (styles.min.css.map in this case). - -#### Using API - -To generate a source map, use `sourceMap: true` option, e.g.: - -```js -new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }) - .minify(source, function (minified) { - // access minified.sourceMap for SourceMapGenerator object - // see https://github.com/mozilla/source-map/#sourcemapgenerator for more details - // see https://github.com/jakubpawlowicz/clean-css/blob/master/bin/cleancss#L114 on how it's used in clean-css' CLI -}); -``` - -Using API you can also pass an input source map directly: - -```js -new CleanCSS({ sourceMap: inputSourceMapAsString, target: pathToOutputDirectory }) - .minify(source, function (minified) { - // access minified.sourceMap to access SourceMapGenerator object - // see https://github.com/mozilla/source-map/#sourcemapgenerator for more details - // see https://github.com/jakubpawlowicz/clean-css/blob/master/bin/cleancss#L114 on how it's used in clean-css' CLI -}); -``` - -Or even multiple input source maps at once (available since version 3.1): - -```js -new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }).minify({ - 'path/to/source/1': { - styles: '...styles...', - sourceMap: '...source-map...' - }, - 'path/to/source/2': { - styles: '...styles...', - sourceMap: '...source-map...' - } -}, function (minified) { - // access minified.sourceMap as above -}); -``` - -### How to minify multiple files with API? - -#### Passing an array - -```js -new CleanCSS().minify(['path/to/file/one', 'path/to/file/two']); -``` - -#### Passing a hash - -```js -new CleanCSS().minify({ - 'path/to/file/one': { - styles: 'contents of file one' - }, - 'path/to/file/two': { - styles: 'contents of file two' - } -}); -``` - -### How to set a compatibility mode? - -Compatibility settings are controlled by `--compatibility` switch (CLI) and `compatibility` option (library mode). - -In both modes the following values are allowed: - -* `'ie7'` - Internet Explorer 7 compatibility mode -* `'ie8'` - Internet Explorer 8 compatibility mode -* `''` or `'*'` (default) - Internet Explorer 9+ compatibility mode - -Since clean-css 3 a fine grained control is available over -[those settings](https://github.com/jakubpawlowicz/clean-css/blob/master/lib/utils/compatibility.js), -with the following options available: - -* `'[+-]colors.opacity'` - - turn on (+) / off (-) `rgba()` / `hsla()` declarations removal -* `'[+-]properties.backgroundClipMerging'` - turn on / off background-clip merging into shorthand -* `'[+-]properties.backgroundOriginMerging'` - turn on / off background-origin merging into shorthand -* `'[+-]properties.backgroundSizeMerging'` - turn on / off background-size merging into shorthand -* `'[+-]properties.colors'` - turn on / off any color optimizations -* `'[+-]properties.ieBangHack'` - turn on / off IE bang hack removal -* `'[+-]properties.iePrefixHack'` - turn on / off IE prefix hack removal -* `'[+-]properties.ieSuffixHack'` - turn on / off IE suffix hack removal -* `'[+-]properties.merging'` - turn on / off property merging based on understandability -* `'[+-]properties.spaceAfterClosingBrace'` - turn on / off removing space after closing brace - `url() no-repeat` into `url()no-repeat` -* `'[+-]properties.urlQuotes'` - turn on / off `url()` quoting -* `'[+-]properties.zeroUnits'` - turn on / off units removal after a `0` value -* `'[+-]selectors.adjacentSpace'` - turn on / off extra space before `nav` element -* `'[+-]selectors.ie7Hack'` - turn on / off IE7 selector hack removal (`*+html...`) -* `'[+-]selectors.special'` - a regular expression with all special, unmergeable selectors (leave it empty unless you know what you are doing) -* `'[+-]units.ch'` - turn on / off treating `ch` as a proper unit -* `'[+-]units.in'` - turn on / off treating `in` as a proper unit -* `'[+-]units.pc'` - turn on / off treating `pc` as a proper unit -* `'[+-]units.pt'` - turn on / off treating `pt` as a proper unit -* `'[+-]units.rem'` - turn on / off treating `rem` as a proper unit -* `'[+-]units.vh'` - turn on / off treating `vh` as a proper unit -* `'[+-]units.vm'` - turn on / off treating `vm` as a proper unit -* `'[+-]units.vmax'` - turn on / off treating `vmax` as a proper unit -* `'[+-]units.vmin'` - turn on / off treating `vmin` as a proper unit -* `'[+-]units.vm'` - turn on / off treating `vm` as a proper unit - -For example, using `--compatibility 'ie8,+units.rem'` will ensure IE8 compatibility while enabling `rem` units so the following style `margin:0px 0rem` can be shortened to `margin:0`, while in pure IE8 mode it can't be. - -To pass a single off (-) switch in CLI please use the following syntax `--compatibility *,-units.rem`. - -In library mode you can also pass `compatibility` as a hash of options. - -### What advanced optimizations are applied? - -All advanced optimizations are dispatched [here](https://github.com/jakubpawlowicz/clean-css/blob/master/lib/selectors/advanced.js#L59), and this is what they do: - -* `recursivelyOptimizeBlocks` - does all the following operations on a block (think `@media` or `@keyframe` at-rules); -* `recursivelyOptimizeProperties` - optimizes properties in rulesets and "flat at-rules" (like @font-face) by splitting them into components (e.g. `margin` into `margin-(*)`), optimizing, and rebuilding them back. You may want to use `shorthandCompacting` option to control whether you want to turn multiple (long-hand) properties into a shorthand ones; -* `removeDuplicates` - gets rid of duplicate rulesets with exactly the same set of properties (think of including the same Sass / Less partial twice for no good reason); -* `mergeAdjacent` - merges adjacent rulesets with the same selector or rules; -* `reduceNonAdjacent` - identifies which properties are overridden in same-selector non-adjacent rulesets, and removes them; -* `mergeNonAdjacentBySelector` - identifies same-selector non-adjacent rulesets which can be moved (!) to be merged, requires all intermediate rulesets to not redefine the moved properties, or if redefined to be either more coarse grained (e.g. `margin` vs `margin-top`) or have the same value; -* `mergeNonAdjacentByBody` - same as the one above but for same-rules non-adjacent rulesets; -* `restructure` - tries to reorganize different-selector different-rules rulesets so they take less space, e.g. `.one{padding:0}.two{margin:0}.one{margin-bottom:3px}` into `.two{margin:0}.one{padding:0;margin-bottom:3px}`; -* `removeDuplicateMediaQueries` - removes duplicated `@media` at-rules; -* `mergeMediaQueries` - merges non-adjacent `@media` at-rules by same rules as `mergeNonAdjacentBy*` above; - -## Acknowledgments (sorted alphabetically) - -* Anthony Barre ([@abarre](https://github.com/abarre)) for improvements to - `@import` processing, namely introducing the `--skip-import` / - `processImport` options. -* Simon Altschuler ([@altschuler](https://github.com/altschuler)) for fixing - `@import` processing inside comments. -* Isaac ([@facelessuser](https://github.com/facelessuser)) for pointing out - a flaw in clean-css' stateless mode. -* Jan Michael Alonzo ([@jmalonzo](https://github.com/jmalonzo)) for a patch - removing node.js' old `sys` package. -* Luke Page ([@lukeapage](https://github.com/lukeapage)) for suggestions and testing the source maps feature. - Plus everyone else involved in [#125](https://github.com/jakubpawlowicz/clean-css/issues/125) for pushing it forward. -* Timur Kristóf ([@Venemo](https://github.com/Venemo)) for an outstanding - contribution of advanced property optimizer for 2.2 release. -* Vincent Voyer ([@vvo](https://github.com/vvo)) for a patch with better - empty element regex and for inspiring us to do many performance improvements - in 0.4 release. -* [@XhmikosR](https://github.com/XhmikosR) for suggesting new features - (option to remove special comments and strip out URLs quotation) and - pointing out numerous improvements (JSHint, media queries). - -## License - -Clean-css is released under the [MIT License](https://github.com/jakubpawlowicz/clean-css/blob/master/LICENSE). diff --git a/node_modules/clean-css/bin/cleancss b/node_modules/clean-css/bin/cleancss deleted file mode 100755 index 72148cf..0000000 --- a/node_modules/clean-css/bin/cleancss +++ /dev/null @@ -1,184 +0,0 @@ -#!/usr/bin/env node - -var fs = require('fs'); -var path = require('path'); -var CleanCSS = require('../index'); - -var commands = require('commander'); - -var packageConfig = fs.readFileSync(path.join(path.dirname(fs.realpathSync(process.argv[1])), '../package.json')); -var buildVersion = JSON.parse(packageConfig).version; - -var isWindows = process.platform == 'win32'; -var lineBreak = require('os').EOL; - -// Specify commander options to parse command line params correctly -commands - .version(buildVersion, '-v, --version') - .usage('[options] source-file, [source-file, ...]') - .option('-b, --keep-line-breaks', 'Keep line breaks') - .option('-c, --compatibility [ie7|ie8]', 'Force compatibility mode (see Readme for advanced examples)') - .option('-d, --debug', 'Shows debug information (minification time & compression efficiency)') - .option('-o, --output [output-file]', 'Use [output-file] as output instead of STDOUT') - .option('-r, --root [root-path]', 'Set a root path to which resolve absolute @import rules') - .option('-s, --skip-import', 'Disable @import processing') - .option('-t, --timeout [seconds]', 'Per connection timeout when fetching remote @imports (defaults to 5 seconds)') - .option('--rounding-precision [n]', 'Rounds to `N` decimal places. Defaults to 2. -1 disables rounding', parseInt) - .option('--s0', 'Remove all special comments, i.e. /*! comment */') - .option('--s1', 'Remove all special comments but the first one') - .option('--semantic-merging', 'Enables unsafe mode by assuming BEM-like semantic stylesheets (warning, this may break your styling!)') - .option('--skip-advanced', 'Disable advanced optimizations - ruleset reordering & merging') - .option('--skip-aggressive-merging', 'Disable properties merging based on their order') - .option('--skip-import-from [rules]', 'Disable @import processing for specified rules', function (val) { return val.split(','); }, []) - .option('--skip-media-merging', 'Disable @media merging') - .option('--skip-rebase', 'Disable URLs rebasing') - .option('--skip-restructuring', 'Disable restructuring optimizations') - .option('--skip-shorthand-compacting', 'Disable shorthand compacting') - .option('--source-map', 'Enables building input\'s source map') - .option('--source-map-inline-sources', 'Enables inlining sources inside source maps'); - -commands.on('--help', function () { - console.log(' Examples:\n'); - console.log(' %> cleancss one.css'); - console.log(' %> cleancss -o one-min.css one.css'); - if (isWindows) { - console.log(' %> type one.css two.css three.css | cleancss -o merged-and-minified.css'); - } else { - console.log(' %> cat one.css two.css three.css | cleancss -o merged-and-minified.css'); - console.log(' %> cat one.css two.css three.css | cleancss | gzip -9 -c > merged-minified-and-gzipped.css.gz'); - } - console.log(''); - process.exit(); -}); - -commands.parse(process.argv); - -// If no sensible data passed in just print help and exit -var fromStdin = !process.env.__DIRECT__ && !process.stdin.isTTY; -if (!fromStdin && commands.args.length === 0) { - commands.outputHelp(); - return 0; -} - -// Now coerce commands into CleanCSS configuration... -var options = { - advanced: commands.skipAdvanced ? false : true, - aggressiveMerging: commands.skipAggressiveMerging ? false : true, - compatibility: commands.compatibility, - debug: commands.debug, - inliner: commands.timeout ? { timeout: parseFloat(commands.timeout) * 1000 } : undefined, - keepBreaks: !!commands.keepLineBreaks, - keepSpecialComments: commands.s0 ? 0 : (commands.s1 ? 1 : '*'), - mediaMerging: commands.skipMediaMerging ? false : true, - processImport: commands.skipImport ? false : true, - processImportFrom: processImportFrom(commands.skipImportFrom), - rebase: commands.skipRebase ? false : true, - restructuring: commands.skipRestructuring ? false : true, - root: commands.root, - roundingPrecision: commands.roundingPrecision, - semanticMerging: commands.semanticMerging ? true : false, - shorthandCompacting: commands.skipShorthandCompacting ? false : true, - sourceMap: commands.sourceMap, - sourceMapInlineSources: commands.sourceMapInlineSources, - target: commands.output -}; - -if (options.root || commands.args.length > 0) { - var relativeTo = options.root || commands.args[0]; - - if (isRemote(relativeTo)) { - options.relativeTo = relativeTo; - } else { - var resolvedRelativeTo = path.resolve(relativeTo); - - options.relativeTo = fs.statSync(resolvedRelativeTo).isFile() ? - path.dirname(resolvedRelativeTo) : - resolvedRelativeTo; - } -} - -if (options.sourceMap && !options.target) { - outputFeedback(['Source maps will not be built because you have not specified an output file.'], true); - options.sourceMap = false; -} - -// ... and do the magic! -if (commands.args.length > 0) { - minify(commands.args); -} else { - var stdin = process.openStdin(); - stdin.setEncoding('utf-8'); - var data = ''; - stdin.on('data', function (chunk) { - data += chunk; - }); - stdin.on('end', function () { - minify(data); - }); -} - -function isRemote(path) { - return /^https?:\/\//.test(path) || /^\/\//.test(path); -} - -function processImportFrom(rules) { - if (rules.length === 0) { - return ['all']; - } else if (rules.length == 1 && rules[0] == 'all') { - return []; - } else { - return rules.map(function (rule) { - if (rule == 'local') - return 'remote'; - else if (rule == 'remote') - return 'local'; - else - return '!' + rule; - }); - } -} - -function minify(data) { - new CleanCSS(options).minify(data, function (errors, minified) { - if (options.debug) { - console.error('Original: %d bytes', minified.stats.originalSize); - console.error('Minified: %d bytes', minified.stats.minifiedSize); - console.error('Efficiency: %d%', ~~(minified.stats.efficiency * 10000) / 100.0); - console.error('Time spent: %dms', minified.stats.timeSpent); - } - - outputFeedback(minified.errors, true); - outputFeedback(minified.warnings); - - if (minified.errors.length > 0) - process.exit(1); - - if (minified.sourceMap) { - var mapFilename = path.basename(options.target) + '.map'; - output(minified.styles + lineBreak + '/*# sourceMappingURL=' + mapFilename + ' */'); - outputMap(minified.sourceMap, mapFilename); - } else { - output(minified.styles); - } - }); -} - -function output(minified) { - if (options.target) - fs.writeFileSync(options.target, minified, 'utf8'); - else - process.stdout.write(minified); -} - -function outputMap(sourceMap, mapFilename) { - var mapPath = path.join(path.dirname(options.target), mapFilename); - fs.writeFileSync(mapPath, sourceMap.toString(), 'utf-8'); -} - -function outputFeedback(messages, isError) { - var prefix = isError ? '\x1B[31mERROR\x1B[39m:' : 'WARNING:'; - - messages.forEach(function (message) { - console.error('%s %s', prefix, message); - }); -} diff --git a/node_modules/clean-css/index.js b/node_modules/clean-css/index.js deleted file mode 100644 index d7b0503..0000000 --- a/node_modules/clean-css/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/clean'); diff --git a/node_modules/clean-css/lib/clean.js b/node_modules/clean-css/lib/clean.js deleted file mode 100644 index c9ce2e9..0000000 --- a/node_modules/clean-css/lib/clean.js +++ /dev/null @@ -1,231 +0,0 @@ -/** - * Clean-css - https://github.com/jakubpawlowicz/clean-css - * Released under the terms of MIT license - * - * Copyright (C) 2015 JakubPawlowicz.com - */ - -var ImportInliner = require('./imports/inliner'); -var rebaseUrls = require('./urls/rebase'); - -var tokenize = require('./tokenizer/tokenize'); -var simpleOptimize = require('./selectors/simple'); -var advancedOptimize = require('./selectors/advanced'); - -var simpleStringify = require('./stringifier/simple'); -var sourceMapStringify = require('./stringifier/source-maps'); - -var CommentsProcessor = require('./text/comments-processor'); -var ExpressionsProcessor = require('./text/expressions-processor'); -var FreeTextProcessor = require('./text/free-text-processor'); -var UrlsProcessor = require('./text/urls-processor'); - -var Compatibility = require('./utils/compatibility'); -var InputSourceMapTracker = require('./utils/input-source-map-tracker'); -var SourceTracker = require('./utils/source-tracker'); -var SourceReader = require('./utils/source-reader'); -var Validator = require('./properties/validator'); - -var fs = require('fs'); -var path = require('path'); -var url = require('url'); - -var override = require('./utils/object').override; - -var DEFAULT_TIMEOUT = 5000; - -var CleanCSS = module.exports = function CleanCSS(options) { - options = options || {}; - - this.options = { - advanced: undefined === options.advanced ? true : !!options.advanced, - aggressiveMerging: undefined === options.aggressiveMerging ? true : !!options.aggressiveMerging, - benchmark: options.benchmark, - compatibility: new Compatibility(options.compatibility).toOptions(), - debug: options.debug, - explicitRoot: !!options.root, - explicitTarget: !!options.target, - inliner: options.inliner || {}, - keepBreaks: options.keepBreaks || false, - keepSpecialComments: 'keepSpecialComments' in options ? options.keepSpecialComments : '*', - mediaMerging: undefined === options.mediaMerging ? true : !!options.mediaMerging, - processImport: undefined === options.processImport ? true : !!options.processImport, - processImportFrom: importOptionsFrom(options.processImportFrom), - rebase: undefined === options.rebase ? true : !!options.rebase, - relativeTo: options.relativeTo, - restructuring: undefined === options.restructuring ? true : !!options.restructuring, - root: options.root || process.cwd(), - roundingPrecision: options.roundingPrecision, - semanticMerging: undefined === options.semanticMerging ? false : !!options.semanticMerging, - shorthandCompacting: undefined === options.shorthandCompacting ? true : !!options.shorthandCompacting, - sourceMap: options.sourceMap, - sourceMapInlineSources: !!options.sourceMapInlineSources, - target: !options.target || missingDirectory(options.target) || presentDirectory(options.target) ? options.target : path.dirname(options.target) - }; - - this.options.inliner.timeout = this.options.inliner.timeout || DEFAULT_TIMEOUT; - this.options.inliner.request = override( - /* jshint camelcase: false */ - proxyOptionsFrom(process.env.HTTP_PROXY || process.env.http_proxy), - this.options.inliner.request || {} - ); -}; - -function importOptionsFrom(rules) { - return undefined === rules ? ['all'] : rules; -} - -function missingDirectory(filepath) { - return !fs.existsSync(filepath) && !/\.css$/.test(filepath); -} - -function presentDirectory(filepath) { - return fs.existsSync(filepath) && fs.statSync(filepath).isDirectory(); -} - -function proxyOptionsFrom(httpProxy) { - return httpProxy ? - { - hostname: url.parse(httpProxy).hostname, - port: parseInt(url.parse(httpProxy).port) - } : - {}; -} - -CleanCSS.prototype.minify = function (data, callback) { - var context = { - stats: {}, - errors: [], - warnings: [], - options: this.options, - debug: this.options.debug, - localOnly: !callback, - sourceTracker: new SourceTracker(), - validator: new Validator(this.options.compatibility) - }; - - if (context.options.sourceMap) - context.inputSourceMapTracker = new InputSourceMapTracker(context); - - context.sourceReader = new SourceReader(context, data); - data = context.sourceReader.toString(); - - if (context.options.processImport || data.indexOf('@shallow') > 0) { - // inline all imports - var runner = callback ? - process.nextTick : - function (callback) { return callback(); }; - - return runner(function () { - return new ImportInliner(context).process(data, { - localOnly: context.localOnly, - imports: context.options.processImportFrom, - whenDone: runMinifier(callback, context) - }); - }); - } else { - return runMinifier(callback, context)(data); - } -}; - -function runMinifier(callback, context) { - function whenSourceMapReady (data) { - data = context.options.debug ? - minifyWithDebug(context, data) : - minify(context, data); - data = withMetadata(context, data); - - return callback ? - callback.call(null, context.errors.length > 0 ? context.errors : null, data) : - data; - } - - return function (data) { - if (context.options.sourceMap) { - return context.inputSourceMapTracker.track(data, function () { - if (context.options.sourceMapInlineSources) { - return context.inputSourceMapTracker.resolveSources(function () { - return whenSourceMapReady(data); - }); - } else { - return whenSourceMapReady(data); - } - }); - } else { - return whenSourceMapReady(data); - } - }; -} - -function withMetadata(context, data) { - data.stats = context.stats; - data.errors = context.errors; - data.warnings = context.warnings; - return data; -} - -function minifyWithDebug(context, data) { - var startedAt = process.hrtime(); - context.stats.originalSize = context.sourceTracker.removeAll(data).length; - - data = minify(context, data); - - var elapsed = process.hrtime(startedAt); - context.stats.timeSpent = ~~(elapsed[0] * 1e3 + elapsed[1] / 1e6); - context.stats.efficiency = 1 - data.styles.length / context.stats.originalSize; - context.stats.minifiedSize = data.styles.length; - - return data; -} - -function benchmark(runner) { - return function (processor, action) { - var name = processor.constructor.name + '#' + action; - var start = process.hrtime(); - runner(processor, action); - var itTook = process.hrtime(start); - console.log('%d ms: ' + name, 1000 * itTook[0] + itTook[1] / 1000000); - }; -} - -function minify(context, data) { - var options = context.options; - - var commentsProcessor = new CommentsProcessor(context, options.keepSpecialComments, options.keepBreaks, options.sourceMap); - var expressionsProcessor = new ExpressionsProcessor(options.sourceMap); - var freeTextProcessor = new FreeTextProcessor(options.sourceMap); - var urlsProcessor = new UrlsProcessor(context, options.sourceMap, options.compatibility.properties.urlQuotes); - - var stringify = options.sourceMap ? sourceMapStringify : simpleStringify; - - var run = function (processor, action) { - data = typeof processor == 'function' ? - processor(data) : - processor[action](data); - }; - - if (options.benchmark) - run = benchmark(run); - - run(commentsProcessor, 'escape'); - run(expressionsProcessor, 'escape'); - run(urlsProcessor, 'escape'); - run(freeTextProcessor, 'escape'); - - function restoreEscapes(data, prefixContent) { - data = freeTextProcessor.restore(data, prefixContent); - data = urlsProcessor.restore(data); - data = options.rebase ? rebaseUrls(data, context) : data; - data = expressionsProcessor.restore(data); - return commentsProcessor.restore(data); - } - - var tokens = tokenize(data, context); - - simpleOptimize(tokens, options, context); - - if (options.advanced) - advancedOptimize(tokens, options, context, true); - - return stringify(tokens, options, restoreEscapes, context.inputSourceMapTracker); -} diff --git a/node_modules/clean-css/lib/colors/hex-name-shortener.js b/node_modules/clean-css/lib/colors/hex-name-shortener.js deleted file mode 100644 index 2af2f4e..0000000 --- a/node_modules/clean-css/lib/colors/hex-name-shortener.js +++ /dev/null @@ -1,186 +0,0 @@ -var HexNameShortener = {}; - -var COLORS = { - aliceblue: '#f0f8ff', - antiquewhite: '#faebd7', - aqua: '#0ff', - aquamarine: '#7fffd4', - azure: '#f0ffff', - beige: '#f5f5dc', - bisque: '#ffe4c4', - black: '#000', - blanchedalmond: '#ffebcd', - blue: '#00f', - blueviolet: '#8a2be2', - brown: '#a52a2a', - burlywood: '#deb887', - cadetblue: '#5f9ea0', - chartreuse: '#7fff00', - chocolate: '#d2691e', - coral: '#ff7f50', - cornflowerblue: '#6495ed', - cornsilk: '#fff8dc', - crimson: '#dc143c', - cyan: '#0ff', - darkblue: '#00008b', - darkcyan: '#008b8b', - darkgoldenrod: '#b8860b', - darkgray: '#a9a9a9', - darkgreen: '#006400', - darkgrey: '#a9a9a9', - darkkhaki: '#bdb76b', - darkmagenta: '#8b008b', - darkolivegreen: '#556b2f', - darkorange: '#ff8c00', - darkorchid: '#9932cc', - darkred: '#8b0000', - darksalmon: '#e9967a', - darkseagreen: '#8fbc8f', - darkslateblue: '#483d8b', - darkslategray: '#2f4f4f', - darkslategrey: '#2f4f4f', - darkturquoise: '#00ced1', - darkviolet: '#9400d3', - deeppink: '#ff1493', - deepskyblue: '#00bfff', - dimgray: '#696969', - dimgrey: '#696969', - dodgerblue: '#1e90ff', - firebrick: '#b22222', - floralwhite: '#fffaf0', - forestgreen: '#228b22', - fuchsia: '#f0f', - gainsboro: '#dcdcdc', - ghostwhite: '#f8f8ff', - gold: '#ffd700', - goldenrod: '#daa520', - gray: '#808080', - green: '#008000', - greenyellow: '#adff2f', - grey: '#808080', - honeydew: '#f0fff0', - hotpink: '#ff69b4', - indianred: '#cd5c5c', - indigo: '#4b0082', - ivory: '#fffff0', - khaki: '#f0e68c', - lavender: '#e6e6fa', - lavenderblush: '#fff0f5', - lawngreen: '#7cfc00', - lemonchiffon: '#fffacd', - lightblue: '#add8e6', - lightcoral: '#f08080', - lightcyan: '#e0ffff', - lightgoldenrodyellow: '#fafad2', - lightgray: '#d3d3d3', - lightgreen: '#90ee90', - lightgrey: '#d3d3d3', - lightpink: '#ffb6c1', - lightsalmon: '#ffa07a', - lightseagreen: '#20b2aa', - lightskyblue: '#87cefa', - lightslategray: '#778899', - lightslategrey: '#778899', - lightsteelblue: '#b0c4de', - lightyellow: '#ffffe0', - lime: '#0f0', - limegreen: '#32cd32', - linen: '#faf0e6', - magenta: '#ff00ff', - maroon: '#800000', - mediumaquamarine: '#66cdaa', - mediumblue: '#0000cd', - mediumorchid: '#ba55d3', - mediumpurple: '#9370db', - mediumseagreen: '#3cb371', - mediumslateblue: '#7b68ee', - mediumspringgreen: '#00fa9a', - mediumturquoise: '#48d1cc', - mediumvioletred: '#c71585', - midnightblue: '#191970', - mintcream: '#f5fffa', - mistyrose: '#ffe4e1', - moccasin: '#ffe4b5', - navajowhite: '#ffdead', - navy: '#000080', - oldlace: '#fdf5e6', - olive: '#808000', - olivedrab: '#6b8e23', - orange: '#ffa500', - orangered: '#ff4500', - orchid: '#da70d6', - palegoldenrod: '#eee8aa', - palegreen: '#98fb98', - paleturquoise: '#afeeee', - palevioletred: '#db7093', - papayawhip: '#ffefd5', - peachpuff: '#ffdab9', - peru: '#cd853f', - pink: '#ffc0cb', - plum: '#dda0dd', - powderblue: '#b0e0e6', - purple: '#800080', - rebeccapurple: '#663399', - red: '#f00', - rosybrown: '#bc8f8f', - royalblue: '#4169e1', - saddlebrown: '#8b4513', - salmon: '#fa8072', - sandybrown: '#f4a460', - seagreen: '#2e8b57', - seashell: '#fff5ee', - sienna: '#a0522d', - silver: '#c0c0c0', - skyblue: '#87ceeb', - slateblue: '#6a5acd', - slategray: '#708090', - slategrey: '#708090', - snow: '#fffafa', - springgreen: '#00ff7f', - steelblue: '#4682b4', - tan: '#d2b48c', - teal: '#008080', - thistle: '#d8bfd8', - tomato: '#ff6347', - turquoise: '#40e0d0', - violet: '#ee82ee', - wheat: '#f5deb3', - white: '#fff', - whitesmoke: '#f5f5f5', - yellow: '#ff0', - yellowgreen: '#9acd32' -}; - -var toHex = {}; -var toName = {}; - -for (var name in COLORS) { - var hex = COLORS[name]; - if (name.length < hex.length) - toName[hex] = name; - else - toHex[name] = hex; -} - -var toHexPattern = new RegExp('(^| |,|\\))(' + Object.keys(toHex).join('|') + ')( |,|\\)|$)', 'ig'); -var toNamePattern = new RegExp('(' + Object.keys(toName).join('|') + ')([^a-f0-9]|$)', 'ig'); - -function hexConverter(match, prefix, colorValue, suffix) { - return prefix + toHex[colorValue.toLowerCase()] + suffix; -} - -function nameConverter(match, colorValue, suffix) { - return toName[colorValue.toLowerCase()] + suffix; -} - -HexNameShortener.shorten = function (value) { - var hasHex = value.indexOf('#') > -1; - var shortened = value.replace(toHexPattern, hexConverter); - - if (shortened != value) - shortened = shortened.replace(toHexPattern, hexConverter); - - return hasHex ? shortened.replace(toNamePattern, nameConverter) : shortened; -}; - -module.exports = HexNameShortener; diff --git a/node_modules/clean-css/lib/colors/hsl.js b/node_modules/clean-css/lib/colors/hsl.js deleted file mode 100644 index 5c76b6e..0000000 --- a/node_modules/clean-css/lib/colors/hsl.js +++ /dev/null @@ -1,67 +0,0 @@ -// HSL to RGB converter. Both methods adapted from: -// http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript - -function HSLColor(hue, saturation, lightness) { - this.hue = hue; - this.saturation = saturation; - this.lightness = lightness; -} - -function hslToRgb(h, s, l) { - var r, g, b; - - // normalize hue orientation b/w 0 and 360 degrees - h = h % 360; - if (h < 0) - h += 360; - h = ~~h / 360; - - if (s < 0) - s = 0; - else if (s > 100) - s = 100; - s = ~~s / 100; - - if (l < 0) - l = 0; - else if (l > 100) - l = 100; - l = ~~l / 100; - - if (s === 0) { - r = g = b = l; // achromatic - } else { - var q = l < 0.5 ? - l * (1 + s) : - l + s - l * s; - var p = 2 * l - q; - r = hueToRgb(p, q, h + 1/3); - g = hueToRgb(p, q, h); - b = hueToRgb(p, q, h - 1/3); - } - - return [~~(r * 255), ~~(g * 255), ~~(b * 255)]; -} - -function hueToRgb(p, q, t) { - if (t < 0) t += 1; - if (t > 1) t -= 1; - if (t < 1/6) return p + (q - p) * 6 * t; - if (t < 1/2) return q; - if (t < 2/3) return p + (q - p) * (2/3 - t) * 6; - return p; -} - -HSLColor.prototype.toHex = function () { - var asRgb = hslToRgb(this.hue, this.saturation, this.lightness); - var redAsHex = asRgb[0].toString(16); - var greenAsHex = asRgb[1].toString(16); - var blueAsHex = asRgb[2].toString(16); - - return '#' + - ((redAsHex.length == 1 ? '0' : '') + redAsHex) + - ((greenAsHex.length == 1 ? '0' : '') + greenAsHex) + - ((blueAsHex.length == 1 ? '0' : '') + blueAsHex); -}; - -module.exports = HSLColor; diff --git a/node_modules/clean-css/lib/colors/rgb.js b/node_modules/clean-css/lib/colors/rgb.js deleted file mode 100644 index 2f94548..0000000 --- a/node_modules/clean-css/lib/colors/rgb.js +++ /dev/null @@ -1,16 +0,0 @@ -function RGB(red, green, blue) { - this.red = red; - this.green = green; - this.blue = blue; -} - -RGB.prototype.toHex = function () { - var red = Math.max(0, Math.min(~~this.red, 255)); - var green = Math.max(0, Math.min(~~this.green, 255)); - var blue = Math.max(0, Math.min(~~this.blue, 255)); - - // Credit: Asen http://jsbin.com/UPUmaGOc/2/edit?js,console - return '#' + ('00000' + (red << 16 | green << 8 | blue).toString(16)).slice(-6); -}; - -module.exports = RGB; diff --git a/node_modules/clean-css/lib/imports/inliner.js b/node_modules/clean-css/lib/imports/inliner.js deleted file mode 100644 index 041d733..0000000 --- a/node_modules/clean-css/lib/imports/inliner.js +++ /dev/null @@ -1,399 +0,0 @@ -var fs = require('fs'); -var path = require('path'); -var http = require('http'); -var https = require('https'); -var url = require('url'); - -var rewriteUrls = require('../urls/rewrite'); -var split = require('../utils/split'); -var override = require('../utils/object.js').override; - -var MAP_MARKER = /\/\*# sourceMappingURL=(\S+) \*\//; -var REMOTE_RESOURCE = /^(https?:)?\/\//; -var NO_PROTOCOL_RESOURCE = /^\/\//; - -function ImportInliner (context) { - this.outerContext = context; -} - -ImportInliner.prototype.process = function (data, context) { - var root = this.outerContext.options.root; - - context = override(context, { - baseRelativeTo: this.outerContext.options.relativeTo || root, - debug: this.outerContext.options.debug, - done: [], - errors: this.outerContext.errors, - left: [], - inliner: this.outerContext.options.inliner, - rebase: this.outerContext.options.rebase, - relativeTo: this.outerContext.options.relativeTo || root, - root: root, - sourceReader: this.outerContext.sourceReader, - sourceTracker: this.outerContext.sourceTracker, - warnings: this.outerContext.warnings, - visited: [] - }); - - return importFrom(data, context); -}; - -function importFrom(data, context) { - if (context.shallow) { - context.shallow = false; - context.done.push(data); - return processNext(context); - } - - var nextStart = 0; - var nextEnd = 0; - var cursor = 0; - var isComment = commentScanner(data); - - for (; nextEnd < data.length;) { - nextStart = nextImportAt(data, cursor); - if (nextStart == -1) - break; - - if (isComment(nextStart)) { - cursor = nextStart + 1; - continue; - } - - nextEnd = data.indexOf(';', nextStart); - if (nextEnd == -1) { - cursor = data.length; - data = ''; - break; - } - - var noImportPart = data.substring(0, nextStart); - context.done.push(noImportPart); - context.left.unshift([data.substring(nextEnd + 1), override(context, { shallow: false })]); - context.afterContent = hasContent(noImportPart); - return inline(data, nextStart, nextEnd, context); - } - - // no @import matched in current data - context.done.push(data); - return processNext(context); -} - -function rebaseMap(data, source) { - return data.replace(MAP_MARKER, function (match, sourceMapUrl) { - return REMOTE_RESOURCE.test(sourceMapUrl) ? - match : - match.replace(sourceMapUrl, url.resolve(source, sourceMapUrl)); - }); -} - -function nextImportAt(data, cursor) { - var nextLowerCase = data.indexOf('@import', cursor); - var nextUpperCase = data.indexOf('@IMPORT', cursor); - - if (nextLowerCase > -1 && nextUpperCase == -1) - return nextLowerCase; - else if (nextLowerCase == -1 && nextUpperCase > -1) - return nextUpperCase; - else - return Math.min(nextLowerCase, nextUpperCase); -} - -function processNext(context) { - return context.left.length > 0 ? - importFrom.apply(null, context.left.shift()) : - context.whenDone(context.done.join('')); -} - -function commentScanner(data) { - var commentRegex = /(\/\*(?!\*\/)[\s\S]*?\*\/)/; - var lastStartIndex = 0; - var lastEndIndex = 0; - var noComments = false; - - // test whether an index is located within a comment - return function scanner(idx) { - var comment; - var localStartIndex = 0; - var localEndIndex = 0; - var globalStartIndex = 0; - var globalEndIndex = 0; - - // return if we know there are no more comments - if (noComments) - return false; - - do { - // idx can be still within last matched comment (many @import statements inside one comment) - if (idx > lastStartIndex && idx < lastEndIndex) - return true; - - comment = data.match(commentRegex); - - if (!comment) { - noComments = true; - return false; - } - - // get the indexes relative to the current data chunk - lastStartIndex = localStartIndex = comment.index; - localEndIndex = localStartIndex + comment[0].length; - - // calculate the indexes relative to the full original data - globalEndIndex = localEndIndex + lastEndIndex; - globalStartIndex = globalEndIndex - comment[0].length; - - // chop off data up to and including current comment block - data = data.substring(localEndIndex); - lastEndIndex = globalEndIndex; - } while (globalEndIndex < idx); - - return globalEndIndex > idx && idx > globalStartIndex; - }; -} - -function hasContent(data) { - var isComment = commentScanner(data); - var firstContentIdx = -1; - while (true) { - firstContentIdx = data.indexOf('{', firstContentIdx + 1); - if (firstContentIdx == -1 || !isComment(firstContentIdx)) - break; - } - - return firstContentIdx > -1; -} - -function inline(data, nextStart, nextEnd, context) { - context.shallow = data.indexOf('@shallow') > 0; - - var importDeclaration = data - .substring(nextImportAt(data, nextStart) + '@import'.length + 1, nextEnd) - .replace(/@shallow\)$/, ')') - .trim(); - - var viaUrl = importDeclaration.indexOf('url(') === 0; - var urlStartsAt = viaUrl ? 4 : 0; - var isQuoted = /^['"]/.exec(importDeclaration.substring(urlStartsAt, urlStartsAt + 2)); - var urlEndsAt = isQuoted ? - importDeclaration.indexOf(isQuoted[0], urlStartsAt + 1) : - split(importDeclaration, ' ')[0].length - (viaUrl ? 1 : 0); - - var importedFile = importDeclaration - .substring(urlStartsAt, urlEndsAt) - .replace(/['"]/g, '') - .replace(/\)$/, '') - .trim(); - - var mediaQuery = importDeclaration - .substring(urlEndsAt + 1) - .replace(/^\)/, '') - .trim(); - - var isRemote = context.isRemote || REMOTE_RESOURCE.test(importedFile); - - if (isRemote && (context.localOnly || !allowedResource(importedFile, true, context.imports))) { - if (context.afterContent || hasContent(context.done.join(''))) - context.warnings.push('Ignoring remote @import of "' + importedFile + '" as no callback given.'); - else - restoreImport(importedFile, mediaQuery, context); - - return processNext(context); - } - - if (!isRemote && !allowedResource(importedFile, false, context.imports)) { - if (context.afterImport) - context.warnings.push('Ignoring local @import of "' + importedFile + '" as after other inlined content.'); - else - restoreImport(importedFile, mediaQuery, context); - return processNext(context); - } - - if (!isRemote && context.afterContent) { - context.warnings.push('Ignoring local @import of "' + importedFile + '" as after other CSS content.'); - return processNext(context); - } - - var method = isRemote ? inlineRemoteResource : inlineLocalResource; - return method(importedFile, mediaQuery, context); -} - -function allowedResource(importedFile, isRemote, rules) { - if (rules.length === 0) - return false; - - if (isRemote && NO_PROTOCOL_RESOURCE.test(importedFile)) - importedFile = 'http:' + importedFile; - - var match = isRemote ? - url.parse(importedFile).host : - importedFile; - var allowed = true; - - for (var i = 0; i < rules.length; i++) { - var rule = rules[i]; - - if (rule == 'all') - allowed = true; - else if (isRemote && rule == 'local') - allowed = false; - else if (isRemote && rule == 'remote') - allowed = true; - else if (!isRemote && rule == 'remote') - allowed = false; - else if (!isRemote && rule == 'local') - allowed = true; - else if (rule[0] == '!' && rule.substring(1) === match) - allowed = false; - } - - return allowed; -} - -function inlineRemoteResource(importedFile, mediaQuery, context) { - var importedUrl = REMOTE_RESOURCE.test(importedFile) ? - importedFile : - url.resolve(context.relativeTo, importedFile); - var originalUrl = importedUrl; - - if (NO_PROTOCOL_RESOURCE.test(importedUrl)) - importedUrl = 'http:' + importedUrl; - - if (context.visited.indexOf(importedUrl) > -1) - return processNext(context); - - - if (context.debug) - console.error('Inlining remote stylesheet: ' + importedUrl); - - context.visited.push(importedUrl); - - var proxyProtocol = context.inliner.request.protocol || context.inliner.request.hostname; - var get = - ((proxyProtocol && proxyProtocol.indexOf('https://') !== 0 ) || - importedUrl.indexOf('http://') === 0) ? - http.get : - https.get; - - var errorHandled = false; - function handleError(message) { - if (errorHandled) - return; - - errorHandled = true; - context.errors.push('Broken @import declaration of "' + importedUrl + '" - ' + message); - restoreImport(importedUrl, mediaQuery, context); - - process.nextTick(function () { - processNext(context); - }); - } - - var requestOptions = override(url.parse(importedUrl), context.inliner.request); - if (context.inliner.request.hostname !== undefined) { - - //overwrite as we always expect a http proxy currently - requestOptions.protocol = context.inliner.request.protocol || 'http:'; - requestOptions.path = requestOptions.href; - } - - - get(requestOptions, function (res) { - if (res.statusCode < 200 || res.statusCode > 399) { - return handleError('error ' + res.statusCode); - } else if (res.statusCode > 299) { - var movedUrl = url.resolve(importedUrl, res.headers.location); - return inlineRemoteResource(movedUrl, mediaQuery, context); - } - - var chunks = []; - var parsedUrl = url.parse(importedUrl); - res.on('data', function (chunk) { - chunks.push(chunk.toString()); - }); - res.on('end', function () { - var importedData = chunks.join(''); - if (context.rebase) - importedData = rewriteUrls(importedData, { toBase: originalUrl }, context); - context.sourceReader.trackSource(importedUrl, importedData); - importedData = context.sourceTracker.store(importedUrl, importedData); - importedData = rebaseMap(importedData, importedUrl); - - if (mediaQuery.length > 0) - importedData = '@media ' + mediaQuery + '{' + importedData + '}'; - - context.afterImport = true; - - var newContext = override(context, { - isRemote: true, - relativeTo: parsedUrl.protocol + '//' + parsedUrl.host + parsedUrl.pathname - }); - - process.nextTick(function () { - importFrom(importedData, newContext); - }); - }); - }) - .on('error', function (res) { - handleError(res.message); - }) - .on('timeout', function () { - handleError('timeout'); - }) - .setTimeout(context.inliner.timeout); -} - -function inlineLocalResource(importedFile, mediaQuery, context) { - var relativeTo = importedFile[0] == '/' ? - context.root : - context.relativeTo; - - var fullPath = path.resolve(path.join(relativeTo, importedFile)); - - if (!fs.existsSync(fullPath) || !fs.statSync(fullPath).isFile()) { - context.errors.push('Broken @import declaration of "' + importedFile + '"'); - return processNext(context); - } - - if (context.visited.indexOf(fullPath) > -1) - return processNext(context); - - - if (context.debug) - console.error('Inlining local stylesheet: ' + fullPath); - - context.visited.push(fullPath); - - var importRelativeTo = path.dirname(fullPath); - var importedData = fs.readFileSync(fullPath, 'utf8'); - if (context.rebase) { - var rewriteOptions = { - relative: true, - fromBase: importRelativeTo, - toBase: context.baseRelativeTo - }; - importedData = rewriteUrls(importedData, rewriteOptions, context); - } - - var relativePath = path.relative(context.root, fullPath); - context.sourceReader.trackSource(relativePath, importedData); - importedData = context.sourceTracker.store(relativePath, importedData); - - if (mediaQuery.length > 0) - importedData = '@media ' + mediaQuery + '{' + importedData + '}'; - - context.afterImport = true; - - var newContext = override(context, { - relativeTo: importRelativeTo - }); - - return importFrom(importedData, newContext); -} - -function restoreImport(importedUrl, mediaQuery, context) { - var restoredImport = '@import url(' + importedUrl + ')' + (mediaQuery.length > 0 ? ' ' + mediaQuery : '') + ';'; - context.done.push(restoredImport); -} - -module.exports = ImportInliner; diff --git a/node_modules/clean-css/lib/properties/break-up.js b/node_modules/clean-css/lib/properties/break-up.js deleted file mode 100644 index 6657b7a..0000000 --- a/node_modules/clean-css/lib/properties/break-up.js +++ /dev/null @@ -1,335 +0,0 @@ -var wrapSingle = require('./wrap-for-optimizing').single; -var InvalidPropertyError = require('./invalid-property-error'); - -var split = require('../utils/split'); -var MULTIPLEX_SEPARATOR = ','; - -function _colorFilter(validator) { - return function (value) { - return value[0] == 'invert' || validator.isValidColor(value[0]); - }; -} - -function _styleFilter(validator) { - return function (value) { - return value[0] != 'inherit' && validator.isValidStyle(value[0]) && !validator.isValidColorValue(value[0]); - }; -} - -function _wrapDefault(name, property, compactable) { - var descriptor = compactable[name]; - if (descriptor.doubleValues && descriptor.defaultValue.length == 2) - return wrapSingle([[name, property.important], [descriptor.defaultValue[0]], [descriptor.defaultValue[1]]]); - else if (descriptor.doubleValues && descriptor.defaultValue.length == 1) - return wrapSingle([[name, property.important], [descriptor.defaultValue[0]]]); - else - return wrapSingle([[name, property.important], [descriptor.defaultValue]]); -} - -function _widthFilter(validator) { - return function (value) { - return value[0] != 'inherit' && validator.isValidWidth(value[0]) && !validator.isValidStyleKeyword(value[0]) && !validator.isValidColorValue(value[0]); - }; -} - -function background(property, compactable, validator) { - var image = _wrapDefault('background-image', property, compactable); - var position = _wrapDefault('background-position', property, compactable); - var size = _wrapDefault('background-size', property, compactable); - var repeat = _wrapDefault('background-repeat', property, compactable); - var attachment = _wrapDefault('background-attachment', property, compactable); - var origin = _wrapDefault('background-origin', property, compactable); - var clip = _wrapDefault('background-clip', property, compactable); - var color = _wrapDefault('background-color', property, compactable); - var components = [image, position, size, repeat, attachment, origin, clip, color]; - var values = property.value; - - var positionSet = false; - var clipSet = false; - var originSet = false; - var repeatSet = false; - - if (property.value.length == 1 && property.value[0][0] == 'inherit') { - // NOTE: 'inherit' is not a valid value for background-attachment - color.value = image.value = repeat.value = position.value = size.value = origin.value = clip.value = property.value; - return components; - } - - for (var i = values.length - 1; i >= 0; i--) { - var value = values[i]; - - if (validator.isValidBackgroundAttachment(value[0])) { - attachment.value = [value]; - } else if (validator.isValidBackgroundBox(value[0])) { - if (clipSet) { - origin.value = [value]; - originSet = true; - } else { - clip.value = [value]; - clipSet = true; - } - } else if (validator.isValidBackgroundRepeat(value[0])) { - if (repeatSet) { - repeat.value.unshift(value); - } else { - repeat.value = [value]; - repeatSet = true; - } - } else if (validator.isValidBackgroundPositionPart(value[0]) || validator.isValidBackgroundSizePart(value[0])) { - if (i > 0) { - var previousValue = values[i - 1]; - - if (previousValue[0].indexOf('/') > 0) { - var twoParts = split(previousValue[0], '/'); - // NOTE: we do this slicing as value may contain metadata too, like for source maps - size.value = [[twoParts.pop()].concat(previousValue.slice(1)), value]; - values[i - 1] = [twoParts.pop()].concat(previousValue.slice(1)); - } else if (i > 1 && values[i - 2][0] == '/') { - size.value = [previousValue, value]; - i -= 2; - } else if (previousValue[0] == '/') { - size.value = [value]; - } else { - if (!positionSet) - position.value = []; - - position.value.unshift(value); - positionSet = true; - } - } else { - if (!positionSet) - position.value = []; - - position.value.unshift(value); - positionSet = true; - } - } else if (validator.isValidBackgroundPositionAndSize(value[0])) { - var sizeValue = split(value[0], '/'); - // NOTE: we do this slicing as value may contain metadata too, like for source maps - size.value = [[sizeValue.pop()].concat(value.slice(1))]; - position.value = [[sizeValue.pop()].concat(value.slice(1))]; - } else if ((color.value[0][0] == compactable[color.name].defaultValue || color.value[0][0] == 'none') && validator.isValidColor(value[0])) { - color.value = [value]; - } else if (validator.isValidUrl(value[0]) || validator.isValidFunction(value[0])) { - image.value = [value]; - } - } - - if (clipSet && !originSet) - origin.value = clip.value.slice(0); - - return components; -} - -function borderRadius(property, compactable) { - var values = property.value; - var splitAt = -1; - - for (var i = 0, l = values.length; i < l; i++) { - if (values[i][0] == '/') { - splitAt = i; - break; - } - } - - if (splitAt === 0 || splitAt === values.length - 1) { - throw new InvalidPropertyError('Invalid border-radius value.'); - } - - var target = _wrapDefault(property.name, property, compactable); - target.value = splitAt > -1 ? - values.slice(0, splitAt) : - values.slice(0); - target.components = fourValues(target, compactable); - - var remainder = _wrapDefault(property.name, property, compactable); - remainder.value = splitAt > -1 ? - values.slice(splitAt + 1) : - values.slice(0); - remainder.components = fourValues(remainder, compactable); - - for (var j = 0; j < 4; j++) { - target.components[j].multiplex = true; - target.components[j].value = target.components[j].value.concat(remainder.components[j].value); - } - - return target.components; -} - -function fourValues(property, compactable) { - var componentNames = compactable[property.name].components; - var components = []; - var value = property.value; - - if (value.length < 1) - return []; - - if (value.length < 2) - value[1] = value[0].slice(0); - if (value.length < 3) - value[2] = value[0].slice(0); - if (value.length < 4) - value[3] = value[1].slice(0); - - for (var i = componentNames.length - 1; i >= 0; i--) { - var component = wrapSingle([[componentNames[i], property.important]]); - component.value = [value[i]]; - components.unshift(component); - } - - return components; -} - -function multiplex(splitWith) { - return function (property, compactable, validator) { - var splitsAt = []; - var values = property.value; - var i, j, l, m; - - // find split commas - for (i = 0, l = values.length; i < l; i++) { - if (values[i][0] == ',') - splitsAt.push(i); - } - - if (splitsAt.length === 0) - return splitWith(property, compactable, validator); - - var splitComponents = []; - - // split over commas, and into components - for (i = 0, l = splitsAt.length; i <= l; i++) { - var from = i === 0 ? 0 : splitsAt[i - 1] + 1; - var to = i < l ? splitsAt[i] : values.length; - - var _property = _wrapDefault(property.name, property, compactable); - _property.value = values.slice(from, to); - - splitComponents.push(splitWith(_property, compactable, validator)); - } - - var components = splitComponents[0]; - - // group component values from each split - for (i = 0, l = components.length; i < l; i++) { - components[i].multiplex = true; - - for (j = 1, m = splitComponents.length; j < m; j++) { - components[i].value.push([MULTIPLEX_SEPARATOR]); - Array.prototype.push.apply(components[i].value, splitComponents[j][i].value); - } - } - - return components; - }; -} - -function listStyle(property, compactable, validator) { - var type = _wrapDefault('list-style-type', property, compactable); - var position = _wrapDefault('list-style-position', property, compactable); - var image = _wrapDefault('list-style-image', property, compactable); - var components = [type, position, image]; - - if (property.value.length == 1 && property.value[0][0] == 'inherit') { - type.value = position.value = image.value = [property.value[0]]; - return components; - } - - var values = property.value.slice(0); - var total = values.length; - var index = 0; - - // `image` first... - for (index = 0, total = values.length; index < total; index++) { - if (validator.isValidUrl(values[index][0]) || values[index][0] == '0') { - image.value = [values[index]]; - values.splice(index, 1); - break; - } - } - - // ... then `type`... - for (index = 0, total = values.length; index < total; index++) { - if (validator.isValidListStyleType(values[index][0])) { - type.value = [values[index]]; - values.splice(index, 1); - break; - } - } - - // ... and what's left is a `position` - if (values.length > 0 && validator.isValidListStylePosition(values[0][0])) - position.value = [values[0]]; - - return components; -} - -function widthStyleColor(property, compactable, validator) { - var descriptor = compactable[property.name]; - var components = [ - _wrapDefault(descriptor.components[0], property, compactable), - _wrapDefault(descriptor.components[1], property, compactable), - _wrapDefault(descriptor.components[2], property, compactable) - ]; - var color, style, width; - - for (var i = 0; i < 3; i++) { - var component = components[i]; - - if (component.name.indexOf('color') > 0) - color = component; - else if (component.name.indexOf('style') > 0) - style = component; - else - width = component; - } - - if ((property.value.length == 1 && property.value[0][0] == 'inherit') || - (property.value.length == 3 && property.value[0][0] == 'inherit' && property.value[1][0] == 'inherit' && property.value[2][0] == 'inherit')) { - color.value = style.value = width.value = [property.value[0]]; - return components; - } - - var values = property.value.slice(0); - var match, matches; - - // NOTE: usually users don't follow the required order of parts in this shorthand, - // so we'll try to parse it caring as little about order as possible - - if (values.length > 0) { - matches = values.filter(_widthFilter(validator)); - match = matches.length > 1 && (matches[0][0] == 'none' || matches[0][0] == 'auto') ? matches[1] : matches[0]; - if (match) { - width.value = [match]; - values.splice(values.indexOf(match), 1); - } - } - - if (values.length > 0) { - match = values.filter(_styleFilter(validator))[0]; - if (match) { - style.value = [match]; - values.splice(values.indexOf(match), 1); - } - } - - if (values.length > 0) { - match = values.filter(_colorFilter(validator))[0]; - if (match) { - color.value = [match]; - values.splice(values.indexOf(match), 1); - } - } - - return components; -} - -module.exports = { - background: background, - border: widthStyleColor, - borderRadius: borderRadius, - fourValues: fourValues, - listStyle: listStyle, - multiplex: multiplex, - outline: widthStyleColor -}; diff --git a/node_modules/clean-css/lib/properties/can-override.js b/node_modules/clean-css/lib/properties/can-override.js deleted file mode 100644 index 474e237..0000000 --- a/node_modules/clean-css/lib/properties/can-override.js +++ /dev/null @@ -1,142 +0,0 @@ -// Functions that decide what value can override what. -// The main purpose is to disallow removing CSS fallbacks. -// A separate implementation is needed for every different kind of CSS property. -// ----- -// The generic idea is that properties that have wider browser support are 'more understandable' -// than others and that 'less understandable' values can't override more understandable ones. - -// Use when two tokens of the same property can always be merged -function always() { - return true; -} - -function alwaysButIntoFunction(property1, property2, validator) { - var value1 = property1.value[0][0]; - var value2 = property2.value[0][0]; - - var validFunction1 = validator.isValidFunction(value1); - var validFunction2 = validator.isValidFunction(value2); - - if (validFunction1 && validFunction2) { - return validator.areSameFunction(value1, value2); - } else if (!validFunction1 && validFunction2) { - return false; - } else { - return true; - } -} - -function backgroundImage(property1, property2, validator) { - // The idea here is that 'more understandable' values override 'less understandable' values, but not vice versa - // Understandability: (none | url | inherit) > (same function) > (same value) - - // (none | url) - var image1 = property1.value[0][0]; - var image2 = property2.value[0][0]; - - if (image2 == 'none' || image2 == 'inherit' || validator.isValidUrl(image2)) - return true; - if (image1 == 'none' || image1 == 'inherit' || validator.isValidUrl(image1)) - return false; - - // Functions with the same name can override each other; same values can override each other - return sameFunctionOrValue(property1, property2, validator); -} - -function border(property1, property2, validator) { - return color(property1.components[2], property2.components[2], validator); -} - -// Use for color properties (color, background-color, border-color, etc.) -function color(property1, property2, validator) { - // The idea here is that 'more understandable' values override 'less understandable' values, but not vice versa - // Understandability: (hex | named) > (rgba | hsla) > (same function name) > anything else - // NOTE: at this point rgb and hsl are replaced by hex values by clean-css - - var color1 = property1.value[0][0]; - var color2 = property2.value[0][0]; - - if (!validator.colorOpacity && (validator.isValidRgbaColor(color1) || validator.isValidHslaColor(color1))) - return false; - if (!validator.colorOpacity && (validator.isValidRgbaColor(color2) || validator.isValidHslaColor(color2))) - return false; - - // (hex | named) - if (validator.isValidNamedColor(color2) || validator.isValidHexColor(color2)) - return true; - if (validator.isValidNamedColor(color1) || validator.isValidHexColor(color1)) - return false; - - // (rgba|hsla) - if (validator.isValidRgbaColor(color2) || validator.isValidHslaColor(color2)) - return true; - if (validator.isValidRgbaColor(color1) || validator.isValidHslaColor(color1)) - return false; - - // Functions with the same name can override each other; same values can override each other - return sameFunctionOrValue(property1, property2, validator); -} - -function twoOptionalFunctions(property1, property2, validator) { - var value1 = property1.value[0][0]; - var value2 = property2.value[0][0]; - - return !(validator.isValidFunction(value1) ^ validator.isValidFunction(value2)); -} - -function sameValue(property1, property2) { - var value1 = property1.value[0][0]; - var value2 = property2.value[0][0]; - - return value1 === value2; -} - -function sameFunctionOrValue(property1, property2, validator) { - var value1 = property1.value[0][0]; - var value2 = property2.value[0][0]; - - // Functions with the same name can override each other - if (validator.areSameFunction(value1, value2)) - return true; - - return value1 === value2; -} - -// Use for properties containing CSS units (margin-top, padding-left, etc.) -function unit(property1, property2, validator) { - // The idea here is that 'more understandable' values override 'less understandable' values, but not vice versa - // Understandability: (unit without functions) > (same functions | standard functions) > anything else - // NOTE: there is no point in having different vendor-specific functions override each other or standard functions, - // or having standard functions override vendor-specific functions, but standard functions can override each other - // NOTE: vendor-specific property values are not taken into consideration here at the moment - var value1 = property1.value[0][0]; - var value2 = property2.value[0][0]; - - if (validator.isValidAndCompatibleUnitWithoutFunction(value1) && !validator.isValidAndCompatibleUnitWithoutFunction(value2)) - return false; - - if (validator.isValidUnitWithoutFunction(value2)) - return true; - if (validator.isValidUnitWithoutFunction(value1)) - return false; - - // Standard non-vendor-prefixed functions can override each other - if (validator.isValidFunctionWithoutVendorPrefix(value2) && validator.isValidFunctionWithoutVendorPrefix(value1)) { - return true; - } - - // Functions with the same name can override each other; same values can override each other - return sameFunctionOrValue(property1, property2, validator); -} - -module.exports = { - always: always, - alwaysButIntoFunction: alwaysButIntoFunction, - backgroundImage: backgroundImage, - border: border, - color: color, - sameValue: sameValue, - sameFunctionOrValue: sameFunctionOrValue, - twoOptionalFunctions: twoOptionalFunctions, - unit: unit -}; diff --git a/node_modules/clean-css/lib/properties/clone.js b/node_modules/clean-css/lib/properties/clone.js deleted file mode 100644 index 5be6441..0000000 --- a/node_modules/clean-css/lib/properties/clone.js +++ /dev/null @@ -1,26 +0,0 @@ -var wrapSingle = require('./wrap-for-optimizing').single; - -function deep(property) { - var cloned = shallow(property); - for (var i = property.components.length - 1; i >= 0; i--) { - var component = shallow(property.components[i]); - component.value = property.components[i].value.slice(0); - cloned.components.unshift(component); - } - - cloned.dirty = true; - cloned.value = property.value.slice(0); - - return cloned; -} - -function shallow(property) { - var cloned = wrapSingle([[property.name, property.important, property.hack]]); - cloned.unused = false; - return cloned; -} - -module.exports = { - deep: deep, - shallow: shallow -}; diff --git a/node_modules/clean-css/lib/properties/compactable.js b/node_modules/clean-css/lib/properties/compactable.js deleted file mode 100644 index 5131233..0000000 --- a/node_modules/clean-css/lib/properties/compactable.js +++ /dev/null @@ -1,285 +0,0 @@ -// Contains the interpretation of CSS properties, as used by the property optimizer - -var breakUp = require('./break-up'); -var canOverride = require('./can-override'); -var restore = require('./restore'); - -// Properties to process -// Extend this object in order to add support for more properties in the optimizer. -// -// Each key in this object represents a CSS property and should be an object. -// Such an object contains properties that describe how the represented CSS property should be handled. -// Possible options: -// -// * components: array (Only specify for shorthand properties.) -// Contains the names of the granular properties this shorthand compacts. -// -// * canOverride: function (Default is canOverride.sameValue - meaning that they'll only be merged if they have the same value.) -// Returns whether two tokens of this property can be merged with each other. -// This property has no meaning for shorthands. -// -// * defaultValue: string -// Specifies the default value of the property according to the CSS standard. -// For shorthand, this is used when every component is set to its default value, therefore it should be the shortest possible default value of all the components. -// -// * shortestValue: string -// Specifies the shortest possible value the property can possibly have. -// (Falls back to defaultValue if unspecified.) -// -// * breakUp: function (Only specify for shorthand properties.) -// Breaks the shorthand up to its components. -// -// * restore: function (Only specify for shorthand properties.) -// Puts the shorthand together from its components. -// -var compactable = { - 'color': { - canOverride: canOverride.color, - defaultValue: 'transparent', - shortestValue: 'red' - }, - 'background': { - components: [ - 'background-image', - 'background-position', - 'background-size', - 'background-repeat', - 'background-attachment', - 'background-origin', - 'background-clip', - 'background-color' - ], - breakUp: breakUp.multiplex(breakUp.background), - defaultValue: '0 0', - restore: restore.multiplex(restore.background), - shortestValue: '0', - shorthand: true - }, - 'background-clip': { - canOverride: canOverride.always, - defaultValue: 'border-box', - shortestValue: 'border-box' - }, - 'background-color': { - canOverride: canOverride.color, - defaultValue: 'transparent', - multiplexLastOnly: true, - nonMergeableValue: 'none', - shortestValue: 'red' - }, - 'background-image': { - canOverride: canOverride.backgroundImage, - defaultValue: 'none' - }, - 'background-origin': { - canOverride: canOverride.always, - defaultValue: 'padding-box', - shortestValue: 'border-box' - }, - 'background-repeat': { - canOverride: canOverride.always, - defaultValue: ['repeat'], - doubleValues: true - }, - 'background-position': { - canOverride: canOverride.alwaysButIntoFunction, - defaultValue: ['0', '0'], - doubleValues: true, - shortestValue: '0' - }, - 'background-size': { - canOverride: canOverride.alwaysButIntoFunction, - defaultValue: ['auto'], - doubleValues: true, - shortestValue: '0 0' - }, - 'background-attachment': { - canOverride: canOverride.always, - defaultValue: 'scroll' - }, - 'border': { - breakUp: breakUp.border, - canOverride: canOverride.border, - components: [ - 'border-width', - 'border-style', - 'border-color' - ], - defaultValue: 'none', - restore: restore.withoutDefaults, - shorthand: true - }, - 'border-color': { - canOverride: canOverride.color, - defaultValue: 'none', - shorthand: true - }, - 'border-style': { - canOverride: canOverride.always, - defaultValue: 'none', - shorthand: true - }, - 'border-width': { - canOverride: canOverride.unit, - defaultValue: 'medium', - shortestValue: '0', - shorthand: true - }, - 'list-style': { - components: [ - 'list-style-type', - 'list-style-position', - 'list-style-image' - ], - canOverride: canOverride.always, - breakUp: breakUp.listStyle, - restore: restore.withoutDefaults, - defaultValue: 'outside', // can't use 'disc' because that'd override default 'decimal' for
    - shortestValue: 'none', - shorthand: true - }, - 'list-style-type' : { - canOverride: canOverride.always, - defaultValue: '__hack', - // NOTE: we can't tell the real default value here, it's 'disc' for